1 2010-06-15 Marek Safar <marek.safar@gmail.com>
4 * dynamic.cs, ecore.cs: A new flag for dynamic resolver to ignore
5 generated member access left expression.
7 2010-06-16 Marek Safar <marek.safar@gmail.com>
9 * expression.cs: Dispatch dynamic invocation solely on left
12 2010-06-16 Marek Safar <marek.safar@gmail.com>
14 * expression.cs, statement.cs: Always persist explicit cast
15 semantic at expression level.
17 2010-06-15 Marek Safar <marek.safar@gmail.com>
19 * expression.cs, attribute.cs: Enable generic type parameters
22 2010-06-15 Marek Safar <marek.safar@gmail.com>
25 * generic.cs: Don't use fixed array for inflated type parameter
26 interface constraints.
28 2010-06-15 Marek Safar <marek.safar@gmail.com>
30 * typespec.cs: ElementTypeSpec has to use its own ITypeDefinition.
32 * report.cs: Unwrap elements for related symbols reporting.
34 2010-06-15 Marek Safar <marek.safar@gmail.com>
37 * cs-tokenizer.cs: Offset correctly keywords the first character
40 2010-06-15 Marek Safar <marek.safar@gmail.com>
43 * expression.cs: Removed too aggressive object initializers
46 2010-06-15 Marek Safar <marek.safar@gmail.com>
48 * parameter.cs, property.cs, membercache.cs, decl.cs, iterators.cs,
49 anonymous.cs, expression.cs, support.cs, method.cs, pending.cs,
50 class.cs, cs-parser.jay: Simplify parsing of accessors by removing
51 any intermediate steps and fake nodes, also saves few MBs of memory.
53 2010-06-11 Marek Safar <marek.safar@gmail.com>
55 * modifiers.cs, rootcontext.cs, location.cs, cs-parser.jay: More
56 precise modifiers parsing.
58 2010-06-09 Marek Safar <marek.safar@gmail.com>
60 * cs-tokenizer.cs, anonymous.cs, expression.cs, cs-parser.jay:
61 Fixed few shift/reduce conflicts.
63 2010-06-09 Marek Safar <marek.safar@gmail.com>
65 * typemanager.cs, parameter.cs, dynamic.cs, typespec.cs,
66 expression.cs, ecore.cs, cs-parser.jay: Fully parse composed type
67 specifiers and stop using string in AST.
69 2010-06-07 Marek Safar <marek.safar@gmail.com>
71 * typemanager.cs, eval.cs, iterators.cs, anonymous.cs, expression.cs
72 method.cs, class.cs, delegate.cs, cs-parser.jay, driver.cs, visit.cs
73 enum.cs: Hold location of predefined types.
75 2010-06-07 Marek Safar <marek.safar@gmail.com>
78 * pending.cs: Clone cached list before modifying.
80 2010-06-04 Marek Safar <marek.safar@gmail.com>
82 * convert.cs, typespec.cs, expression.cs: Start using array member
83 kind for better conversion checks.
85 * import.cs, report.cs: Report better error message for runtime
88 2010-06-04 Marek Safar <marek.safar@gmail.com>
90 * membercache.cs, convert.cs, nullable.cs, expression.cs: Optimize
91 user defined conversion probing and simplify user conversion for
92 nullabe types. Fixes #610940.
94 2010-06-03 Marek Safar <marek.safar@gmail.com>
97 * parameter.cs, property.cs, cs-parser.jay: Use independent implicit
98 parameters for explicit event accessors. Anonymous method capturing
99 won't otherwise work for event implicit parameter.
101 2010-06-02 Marek Safar <marek.safar@gmail.com>
103 A fix for bug #610088
104 * nullable.cs, expression.cs, statement.cs, method.cs, ecore.cs:
105 Ignore overrides for base overload resolution as for non-base
106 expressions and convert the best candidate to closest override
109 2010-06-01 Marek Safar <marek.safar@gmail.com>
111 A fix for bug #610139
112 * generic.cs, convert.cs: Recursively check effective base interface
114 2010-06-01 Marek Safar <marek.safar@gmail.com>
116 * statement.cs: Handle nullable types and type parameters in using
117 statement, avoid boxing value types. Also fixes #571010
119 2010-06-01 Marek Safar <marek.safar@gmail.com>
121 * convert.cs, expression.cs: Emit unbox for underlying nullable
124 2010-05-29 Marek Safar <marek.safar@gmail.com>
126 A fix for bug #610126
127 * expression.cs: Don't use branch optimization for types bigger than
130 2010-05-28 Marek Safar <marek.safar@gmail.com>
132 A fix for bug #609088
133 * import.cs: Check private modifier correctly.
135 2010-05-28 Marek Safar <marek.safar@gmail.com>
137 A fix for bug #609049
138 * ecore.cs: Don't ignore override methods when looking for base
141 2010-05-27 Marek Safar <marek.safar@gmail.com>
143 A fix for bugs #608007, #572540, #566130, #476358
145 * generic.cs, linq.cs, expression.cs, statement.cs, cs-parser.jay:
146 More tricky refactoring of implicit linq blocks.
148 2010-05-25 Marek Safar <marek.safar@gmail.com>
150 * linq.cs, cs-parser.jay: Keep location for all linq clauses.
152 2010-05-25 Marek Safar <marek.safar@gmail.com>
154 * context.cs, expression.cs, cs-parser.jay: Don't store current
155 block in This expression (it's too early for linq blocks).
157 2010-05-21 Marek Safar <marek.safar@gmail.com>
159 * expression.cs: Use constrained prefix more broadly to avoid boxing.
161 2010-05-20 Marek Safar <marek.safar@gmail.com>
163 A fix for bug #591149
164 * nullable.cs: Don't double wrap same expression.
166 2010-05-20 Marek Safar <marek.safar@gmail.com>
168 A fix for bug #569827
169 * anonymous.cs: Any issued error in probing mode means no match.
171 2010-05-20 Marek Safar <marek.safar@gmail.com>
173 * expression.cs: Search for base indexer using the closest match
176 2010-05-20 Marek Safar <marek.safar@gmail.com>
178 A fix for bug #572071
179 * method.cs: Set override constraints using unexpanded interface
182 2010-05-20 Marek Safar <marek.safar@gmail.com>
184 A fix for bug #572071
185 * ecore.cs: Include secondary extension method lookup in probing
188 2010-05-19 Marek Safar <marek.safar@gmail.com>
190 A fix for bug #515801
191 * typespec.cs (MayBecomeEqualGenericTypes): Recursively check
194 2010-05-19 Marek Safar <marek.safar@gmail.com>
196 A fix for bug #515801
197 * pending.cs: Advance counter correctly.
199 2010-05-19 Marek Safar <marek.safar@gmail.com>
201 A fix for bug #480139
202 * method.cs, pending.cs: Indexer override uses base name.
204 2010-05-19 Marek Safar <marek.safar@gmail.com>
206 A fix for bug #424064
207 * generic.cs: Replace original with inflated type parameter on
210 2010-05-19 Marek Safar <marek.safar@gmail.com>
212 A fix for bug #359733
213 * parameter.cs: Extension attribute can be defined in each assembly.
215 2010-05-18 Marek Safar <marek.safar@gmail.com>
217 A fix for bug #446507
218 * method.cs: Only one method can implement an interface.
220 2010-05-18 Marek Safar <marek.safar@gmail.com>
222 A fix for bug #594905
223 * convert.cs, constant.cs, expression.cs, literal.cs, ecore.cs:
224 Typed null can be used as a source for expression methods.
226 2010-05-18 Marek Safar <marek.safar@gmail.com>
228 A fix for bug #606551
229 * namespace.cs: Using directive imports only types and not nested
232 2010-05-17 Marek Safar <marek.safar@gmail.com>
234 * typespec.cs, expression.cs, statement.cs, ecore.cs, complete.cs,
235 delegate.cs: Member instance is resolved after member overload
236 definitely resolves static/instance property of member expression.
237 Fixes #545047, #358848, #456605, #460016, #603299
239 2010-05-12 Marek Safar <marek.safar@gmail.com>
241 A fix for bug #604981
242 * generic.cs, decl.cs, anonymous.cs: Reset more type arguments
243 details for nested anonymous methods stories.
245 2010-05-11 Marek Safar <marek.safar@gmail.com>
247 A fix for bug #604735
248 * namespace.cs: Don't report namespace collision.
250 2010-05-11 Marek Safar <marek.safar@gmail.com>
252 A fix for bug #604748
253 * class.cs, typespec.cs: Search full imported attribute hierarchy
256 2010-05-11 Marek Safar <marek.safar@gmail.com>
258 * namespace.cs: Ignore missing dependencies failure at
261 2010-05-11 Marek Safar <marek.safar@gmail.com>
263 A fix for bug #604640
264 * namespace.cs: Don't resolve using constraints too early.
266 2010-05-11 Marek Safar <marek.safar@gmail.com>
268 A fix for bug #604239
269 * generic.cs: Copy partial type constraints to partial container.
271 2010-05-10 Marek Safar <marek.safar@gmail.com>
273 A fix for bug #557210
274 * import.cs: Relax underlying enum field rules.
276 2010-05-10 Marek Safar <marek.safar@gmail.com>
278 A fix for bug #603476
279 * property.cs: Implement IParametersMember for indexer accessors.
281 2010-05-07 Marek Safar <marek.safar@gmail.com>
283 A fix for bug #601141
284 * class.cs: Update all partial modifiers.
286 2010-05-06 Marek Safar <marek.safar@gmail.com>
288 A fix for bug #601708
289 * method.cs, membercache.cs: Destructors cannot be hidden.
291 2010-05-06 Marek Safar <marek.safar@gmail.com>
293 A fix for bug #602551
294 * class.cs: Resursive reference of type definition is allowed.
296 2010-05-06 Marek Safar <marek.safar@gmail.com>
298 * anonymous.cs: Mutate cached storey instance types too.
300 2010-05-06 Marek Safar <marek.safar@gmail.com>
302 A fix for bug #602443
303 * convert.cs: Explicit enum conversion cannot involve user operators
305 2010-05-05 Miguel de Icaza <miguel@novell.com>
307 * class.cs (TypeContainer.DefineBaseTypes)
308 (TypeContainer.CheckRecursiveDefinition): check for the iface not
309 being null, as we could have failed resolution and crashed;
312 * cs-parser.jay: Productions to catch common mistakes when other
313 punctuation operators are used instead of comma. Fixes 571702
315 2010-05-05 Marek Safar <marek.safar@gmail.com>
317 * anonymous.cs: Mutate correct set of constraints.
319 2010-05-05 Marek Safar <marek.safar@gmail.com>
321 A fix for bug #602842
322 * expression.cs: Resolve all array bound arguments.
324 2010-05-05 Marek Safar <marek.safar@gmail.com>
326 * import.cs: Don't import private fields.
328 2010-04-30 Marek Safar <marek.safar@gmail.com>
330 Partially based on patch by <sami.lamti@gmail.com>
332 * eval.cs, ecore.cs: Fixed eval show methods.
334 2010-04-30 Marek Safar <marek.safar@gmail.com>
336 * generic.cs, delegate.cs: Implement output type inference of
337 methodgroup now when the specification was cleared at least little
340 2010-04-29 Marek Safar <marek.safar@gmail.com>
342 A fix for bug #575611
343 * class.cs: Fix recursive unmanaged recursice sruct check.
345 2010-04-29 Marek Safar <marek.safar@gmail.com>
347 A fix for bug #479776
348 * expression.cs: Implement typeof unbounded nested generic types.
350 2010-04-29 Marek Safar <marek.safar@gmail.com>
352 A fix for bug #474953
353 * class.cs: Fix valid recursive base type definition.
355 2010-04-29 Marek Safar <marek.safar@gmail.com>
357 A fix for bug #421737
358 * convert.cs, expression.cs: A boxing conversion exists from a
359 nullable-type to a reference type, if a boxing conversion exists
360 from the underlying non-nullable-value-type to the reference type.
362 2010-04-29 Marek Safar <marek.safar@gmail.com>
364 A fix for bug #376875
365 * import.cs: Import volatile modifier.
367 2010-04-29 Marek Safar <marek.safar@gmail.com>
369 A fix for bug #372412
370 * typespec.cs, expression.cs, codegen.cs: Emit readonly prefix for
373 2010-04-29 Marek Safar <marek.safar@gmail.com>
375 A fix for bug #568955
376 * statements.cs: Handle recursive scope initializers.
378 2010-04-28 Marek Safar <marek.safar@gmail.com>
380 A fix for bug #566511
381 * anonymous.cs: Always get inflated version of hoisted variable
382 on generic type definition.
384 2010-04-28 Marek Safar <marek.safar@gmail.com>
386 * import.cs, membercache.cs: Relax rules for valid properties.
388 2010-04-28 Marek Safar <marek.safar@gmail.com>
390 * import.cs: Intern arrays used in generic arguments.
392 2010-04-28 Marek Safar <marek.safar@gmail.com>
394 A fix for bug #600398
395 * convert.cs: Actually use effective base type for the comparison.
397 2010-04-28 Marek Safar <marek.safar@gmail.com>
399 A fix for bug #600326
400 * ecore.cs: Pass arity to base member lookup.
402 2010-04-28 Marek Safar <marek.safar@gmail.com>
404 A fix for bug #573385
405 * expression.cs: MemberAccess is of generic type based on right
408 2010-05-28 Marek Safar <marek.safar@gmail.com>
410 * cs-tokenizer.cs: Made tab size configurable.
412 2010-05-27 Marek Safar <marek.safar@gmail.com>
414 * attribute.cs: Ensure Obsolete members are defined before doing
417 2010-05-27 Marek Safar <marek.safar@gmail.com>
419 * visit.cs: Add DOM visitor skeleton.
423 2010-05-27 Marek Safar <marek.safar@gmail.com>
425 * attribute.cs, codegen.cs: Drop COMPILER_ACCESS hack.
427 2010-05-27 Marek Safar <marek.safar@gmail.com>
429 * *.cs: Major rewrite of compiler internals to better work with
430 unmodified System.Reflection.Emit. Some of the key changes are
431 - TypeSpec replaces reflection specific System.Type.
432 - All Type(TypeSpec) operations are now done in compiler therefore
433 no dependency on SRE to inflate generic members and types or to
434 query unclosed types.
435 - MemberCache is now the only and full hierarchical topology.
436 - Generic constraints are implemented properly.
437 - And as a bonus compilation is on average 30% faster.
439 2010-04-15 Jb Evain <jbevain@novell.com>
441 * dmcs.exe.config: update the runtime version to .net 4.0 RTM.
443 2010-04-12 Marek Safar <marek.safar@gmail.com>
445 * expression.cs, attribute.cs, parameter.cs: More attribute type
448 2010-04-12 Marek Safar <marek.safar@gmail.com>
450 A fix for bug #593342
452 * generic.cs, parameter.cs, argument.cs, field.cs, property.cs,
453 decl.cs, roottypes.cs, constant.cs, nullable.cs, expression.cs,
454 method.cs, ecore.cs, class.cs, delegate.cs, attribute.cs,
455 codegen.cs: Add custom attribute encoder to deal with unfinished
456 types and easier corlib bootstrap from its own types.
458 2010-03-26 Marek Safar <marek.safar@gmail.com>
460 * cs-parser.jay: Report invalid constraint types.
462 2010-03-16 Jb Evain <jbevain@novell.com>
464 * Makefile: rename the net_2_1 profile to moonlight.
466 2010-03-11 Marek Safar <marek.safar@gmail.com>
468 * statement.cs, cs-parser.jay: Use correct location for empty
471 2010-03-11 Marek Safar <marek.safar@gmail.com>
473 * cs-parser.jay: Disable Location from expression.
475 * generic.cs: Check constraints for overrides in the parser.
477 2010-03-09 Marek Safar <marek.safar@gmail.com>
479 * cs-parser.jay (GetLocation): Use an expression when available.
481 2010-03-04 Marek Safar <marek.safar@gmail.com>
483 A fix for bug #582579
484 * ecore.cs (FieldExpr): Don't optimize cross reference loads.
486 2010-03-04 Marek Safar <marek.safar@gmail.com>
488 A patch by kornelpal@gmail.com
490 * dynamic.cs, anonymous.cs, rootcontext.cs, class.cs: Don't make
491 compiler generated classes sealed by default. Emit and close top
492 level compiler generated classes as well.
494 * support.cs: Use RuntimeHelpers.GetHashCode.
496 2010-03-03 Rolf Bjarne Kvinge <RKvinge@novell.com>
498 * Makefile: We need to use the internal bootstrapping gmcs for
499 net_2_1_bootstrap too now.
501 2010-03-02 Raja R Harinath <harinath@hurrynot.org>
503 * expression.cs (IndexerAccess.ResolveAccessor): Add CS1540 check.
505 2010-03-02 Marek Safar <marek.safar@gmail.com>
507 * cs-tokenizer.cs: Missed few locations in previous fix.
509 2010-03-02 Marek Safar <marek.safar@gmail.com>
511 * cs-tokenizer.cs, argument.cs, dynamic.cs, assign.cs, anonymous.cs,
512 nullable.cs, expression.cs, statement.cs, cs-parser.jay, cfold.cs:
513 Report correct location for operator errors.
515 2010-03-02 Marek Safar <marek.safar@gmail.com>
517 * typemanager.cs (IsDynamicType): Don't check external types when
518 the attribute is not external.
520 2010-02-24 Marek Safar <marek.safar@gmail.com>
522 A fix for bug #582579
523 * decl.cs (IsExposedFromAssembly): Use PartialContainer for parent
526 2010-02-24 Marek Safar <marek.safar@gmail.com>
528 A fix for bug #581804
529 * ecore.cs: Fixed type comparison.
531 2010-02-08 Miguel de Icaza <miguel@novell.com>
533 * namespace.cs (CompletionGetTypesStartingWith): Do not include
534 private types in the completion results.
536 * cs-parser.jay: Bubble completions after "from x in ?" and "from x
539 2010-02-17 Marek Safar <marek.safar@gmail.com>
541 * generic.cs, field.cs, decl.cs, cs-parser.jay: Simplify special
544 2010-02-14 Miguel de Icaza <miguel@novell.com>
546 * eval.cs: Do not do the report printer dance unless the user has
547 set the DescribeTypes feature.
549 2010-02-10 Marek Safar <marek.safar@gmail.com>
551 * argument.cs, dynamic.cs, expression.cs: Track RC API changes.
553 2010-02-08 Marek Safar <marek.safar@gmail.com>
555 A fix for bug #577029
556 * anonymous.cs: Fixed TypeBuilder* check.
558 2010-02-06 Miguel de Icaza <miguel@novell.com>
560 * eval.cs (CompileBlock): Also undo if there are problems during
561 semantic analysis, fixes various cases where invalid C# code would
562 be reported, but the internal changes would not be undone.
564 2010-02-03 Miguel de Icaza <miguel@novell.com>
566 * driver.cs: Change the --fatal flag to allow a number to be
567 passed, this ignores the first N fatal errors. Useful to debug
568 errors that do not happen on the first hit.
570 * cs-parser.jay (invocation_expression): accept both the
571 CLOSE_PARENS and COMPLETE_COMPLETION, this allows completions
572 inside an invocation.
574 * driver.cs: Expose FatalErrors.
576 * eval.cs: Initialize the printer's Fatal property from the
577 Driver's FatalError flag, this allows csharp --fatal to work
580 Add support for calling Describe (typeof (TYPE)) if the expression
583 2010-02-02 Marek Safar <marek.safar@gmail.com>
585 A fix for bug #574991
586 * rootcontext.cs, class.cs, driver.cs: Hide enhanced warnings behind
589 2010-02-02 Marek Safar <marek.safar@gmail.com>
591 A fix for bug #575986
592 * expression.cs: Don't mutate typeof type definitions.
594 2010-01-28 Marek Safar <marek.safar@gmail.com>
596 * decl.cs: Use only one set of modifiers.
598 2010-01-26 Marek Safar <marek.safar@gmail.com>
600 A fix for bug #573329
601 * eval.cs: Don't disable error reporting completely on silent mode.
603 2010-01-25 Marek Safar <marek.safar@gmail.com>
605 A fix for bug #573312
606 * constant.cs, expression.cs, ecore.cs: Emit correct offset for
607 pointer index of unknown size types greater than 2.
609 2010-01-15 Marek Safar <marek.safar@gmail.com>
611 * *.cs: Use only 1 member kind enum.
613 2010-01-15 Marek Safar <marek.safar@gmail.com>
615 * *.cs: Add event specification.
617 2010-01-14 Marek Safar <marek.safar@gmail.com>
619 * membercache.cs: Extracted from decl.cs.
621 * *.cs: Put more infrastructure in place.
623 2010-01-13 Marek Safar <marek.safar@gmail.com>
625 * *.cs: Add property specification, unused yet.
627 2010-01-13 Marek Safar <marek.safar@gmail.com>
629 * property.cs: Move all property based declarations into a new file.
631 2010-01-13 Marek Safar <marek.safar at gmail.com>
633 * expression.cs (Conditional): Resolve reduced expression.
635 2010-01-13 Marek Safar <marek.safar at gmail.com>
637 * *.cs: Introduced non-generic method specification.
639 2010-01-07 Marek Safar <marek.safar@gmail.com>
641 * method.cs: Move all method based declarations into a new file.
643 2010-01-07 Marek Safar <marek.safar@gmail.com>
645 * *.cs: Extract field specification.
647 2009-12-17 Marek Safar <marek.safar@gmail.com>
649 * field.cs: Extracted from class.cs
651 2009-12-15 Marek Safar <marek.safar@gmail.com>
653 * attribute.cs (GetFixedBuffer): Work on field definition only.
655 2009-12-15 Marek Safar <marek.safar@gmail.com>
657 * *.cs: Clean up NET_4_0 conditional where possible.
659 2009-12-14 Rodrigo Kumpera <rkumpera@novell.com>
661 support.cs (DynamicType): Assembly property returns the assembly builder.
662 This is required due to how compiler context works in corlib.
664 2009-12-14 Marek Safar <marek.safar@gmail.com>
666 A fix for bug #564376
667 * assign.cs (LocalTemporary): Removed no longer needed special
670 2009-12-11 Marek Safar <marek.safar@gmail.com>
672 * modifiers.cs, decl.cs, iterators.cs, const.cs, anonymous.cs,
673 class.cs, delegate.cs, cs-parser.jay, enum.cs: Turn modifiers into
674 enum for easier debugging.
676 2009-12-10 Marek Safar <marek.safar@gmail.com>
678 * decl.cs, anonymous.cs, class.cs: Sealed Define it's now main entry
681 * parameter.cs, delegate.cs, dynamic.cs: Don't use builder methods
684 2009-12-10 Marek Safar <marek.safar@gmail.com>
686 * cs-parser.jay, statement.cs: Handle parser error in code
689 2009-12-10 Marek Safar <marek.safar@gmail.com>
691 * ecore.cs: Ignore base imported methods when they are already
694 * eval.cs: Handle non-existent keys.
696 * report.cs, driver.cs: Make fatal work with console printer only.
698 2009-12-08 Rodrigo Kumpera <rkumpera@novell.com>
700 * typemanager.cs (MakeGenericMethod): Fix stupid mistake.
702 2009-12-08 Rodrigo Kumpera <rkumpera@novell.com>
704 * typemanager.cs: Add MakeGenericMethod that checks if the method
705 is really the generic method definition.
707 ecore.cs (MethodGroupExpr:IsApplicable): Use new TypeManager function
708 to inflate generic methods.
710 2009-12-08 Marek Safar <marek.safar@gmail.com>
712 A fix for bug #561149
713 * anonymous.cs: Use actual type parameters when checking for generic
716 2009-12-08 Marek Safar <marek.safar@gmail.com>
718 A fix for bug #561369
719 * expression.cs (DoNumericPromotion): Fixed typo.
721 2009-12-08 Marek Safar <marek.safar@gmail.com>
723 *.cs: Moving to generics world.
725 cs-parser.jay: Removed current_array_type.
727 2009-12-07 Marek Safar <marek.safar@gmail.com>
729 *.cs: Moving to generics world.
731 2009-12-04 Marek Safar <marek.safar@gmail.com>
733 *.cs: Moving to generics world (day 2).
735 2009-12-03 Marek Safar <marek.safar@gmail.com>
737 *.cs: Moving to generics world.
739 2009-12-02 Marek Safar <marek.safar@gmail.com>
741 * typemanager.cs, parameter.cs, class.cs, delegate.cs, attribute.cs:
742 Encode dynamic type attribute for elements where attributes cannot
745 2009-12-01 Marek Safar <marek.safar@gmail.com>
747 argument.cs, assign.cs, expression.cs, cs-parser.jay: Named
750 2009-12-01 Marek Safar <marek.safar@gmail.com>
752 A fix for bug #360455
753 * class.cs: Never report a unused warning for generic events to
754 workaround wrong expression type.
756 2009-11-30 Marek Safar <marek.safar@gmail.com>
758 A fix for bug #558305
759 * decl.cs, class.cs: Check partial method definitions using correct
762 2009-11-30 Marek Safar <marek.safar@gmail.com>
764 * argument.cs: Don't cache rarely used dynamic flag.
766 2009-11-27 Marek Safar <marek.safar@gmail.com>
768 * cs-parser.jay: Use jay global stacks (saves over 3MB for corlib).
770 2009-11-27 Marek Safar <marek.safar@gmail.com>
772 * ecore.cs (SimpleName): Removed no longer needed in_transit as
773 Resolve is now non-reentrant (saves ~0.6MB for corlib).
775 2009-11-26 Marek Safar <marek.safar@gmail.com>
777 A fix for bug #545081
778 * decl.cs: Check private nested types of nested types recursively.
780 2009-11-26 Marek Safar <marek.safar@gmail.com>
782 A fix for bug #558305
783 * location.cs: Ignore self referencing #line directive
785 2009-11-26 Marek Safar <marek.safar@gmail.com>
787 A fix for bug #558292
788 * class.cs: Allow single unsafe fixed buffer fields.
790 2009-11-26 Marek Safar <marek.safar@gmail.com>
792 * expression: Optimize few more zero-based operations.
794 2009-11-26 Marek Safar <marek.safar@gmail.com>
796 * cs-tokenizer.cs, cs-parser.jay: Simplify literal parsing, also
797 avoids boxing of literal values.
799 2009-11-26 Marek Safar <marek.safar@gmail.com>
801 * cs-tokenizer.cs, argument.cs, eval.cs, linq.cs, decl.cs,
802 expression.cs, ecore.cs, location.cs, cs-parser.jay, attribute.cs,
803 codegen.cs: LocatedToken redesing to avoid excessive allocation and
804 boxing (saves ~7MB for corlib). Also fixes presise token location.
806 2009-11-25 Marek Safar <marek.safar@gmail.com>
808 * ecore.cs, cs-parser.jay: Keep parser structures local. Share
811 2009-11-24 Marek Safar <marek.safar@gmail.com>
813 * expression.cs: Lower static array initializer barrier.
815 * support.cs, driver.cs: Share reader buffer.
817 2009-11-23 Marek Safar <marek.safar@gmail.com>
819 * cs-tokenizer.cs, support.cs: Some tokenizer optimizations.
821 2009-11-23 Marek Safar <marek.safar@gmail.com>
823 * cs-tokenizer.cs, support.cs: Use Dictionary instead of Hashtable,
824 cleanup some obsolete code.
826 2009-11-20 Marek Safar <marek.safar@gmail.com>
828 * context.cs, expression.cs, ecore.cs, complete.cs: Cleaned up
831 2009-11-20 Marek Safar <marek.safar@gmail.com>
833 * *.cs: Resolved expressions are never resolved again, this helps to
834 uncover some not easy to find bugs and improve the performance.
836 2009-11-19 Marek Safar <marek.safar@gmail.com>
838 * *.cs: Made constant expressions fully compatible with any other
841 2009-11-19 Marek Safar <marek.safar@gmail.com>
843 * *.cs: DoResolve is a worker method and has to be protected.
845 2009-11-18 Marek Safar <marek.safar@gmail.com>
847 * *.cs: More context specific handling.
849 2009-11-17 Marek Safar <marek.safar@gmail.com>
851 * *.cs: More context specific handling.
853 2009-11-16 Marek Safar <marek.safar@gmail.com>
855 * dynamic.cs, class.cs: Removed few fixed user types conversions.
857 * symbolwriter.cs: Uses public ILOffset.
859 2009-11-13 Marek Safar <marek.safar@gmail.com>
861 A fix for bug #553650
862 * generic.cs: Another missing TypeToCoreType, still too many to fix.
864 2009-11-13 Marek Safar <marek.safar@gmail.com>
866 A fix for bug #555170
868 * class.cs, delegate.cs, enum.cs: Constants have to be available
869 for parameters resolve.
871 2009-11-12 Marek Safar <marek.safar@gmail.com>
873 * typemanager.cs, argument.cs, support.cs, delegate.cs: Dynamic
876 2009-11-12 Marek Safar <marek.safar@gmail.com>
878 * argument.cs, context.cs, expression.cs, ecore.cs: Dynamic binding
879 with a statically known candidate set.
881 2009-11-11 Scott Peterson <lunchtimemama@gmail.com>
883 * generic.cs: Made type inflation for generic constraint checks
884 recursive. This fixes BGO #553655.
886 2009-11-11 Marek Safar <marek.safar@gmail.com>
888 * dynamic.cs, decl.cs, expression.cs, ecore.cs: More dynamic type
891 2009-11-10 Marek Safar <marek.safar@gmail.com>
893 * typemanager.cs, generic.cs, parameter.cs, argument.cs, dynamic.cs,
894 linq.cs, rootcontext.cs, ecore.cs, class.cs, delegate.cs,
895 attribute.cs: Add some dynamic error checking.
897 2009-11-07 Marek Safar <marek.safar@gmail.com>
899 A fix for bug #553465
901 * expression.cs: Fixed mixed version of expression tree anonymous
904 2009-11-06 Marek Safar <marek.safar@gmail.com>
906 A fix for bug #553031
908 * linq.cs, expression.cs, class.cs, cs-parser.jay: Initialize
909 expression tree version of anonymous type with members declaration.
911 2009-11-05 Marek Safar <marek.safar@gmail.com>
913 * parameter.cs: Handle nullable parameter default expression.
915 * argument.cs, dynamic.cs, expression.cs, support.cs, ecore.cs,
916 class.cs, attribute.cs: Check for wrong dynamic arguments.
918 2009-11-05 Marek Safar <marek.safar@gmail.com>
920 * statement.cs: Dynamic statements.
922 2009-11-04 Marek Safar <marek.safar@gmail.com>
924 * dynamic.cs, assign.cs, context.cs, expression.cs, ecore.cs:
925 Compound assignments over dynamic type.
927 2009-11-03 Marek Safar <marek.safar@gmail.com>
929 * argument.cs, dynamic.cs, expression.cs, delegate.cs: Dynamic
930 constructor arguments.
932 2009-10-30 Marek Safar <marek.safar@gmail.com>
934 * dynamic.cs, convert.cs, assign.cs, constant.cs, expression.cs,
935 codegen.cs: Unary mutator on dynamic member access expression.
937 2009-10-29 Marek Safar <marek.safar@gmail.com>
939 A fix for bug #550580
940 * convert.cs: Don't eliminate explicit precission casts.
942 2009-10-28 Marek Safar <marek.safar@gmail.com>
944 A fix for bug #550404
946 * parameter.cs, iterators.cs, context.cs, anonymous.cs,
947 expression.cs, statement.cs, ecore.cs: Quote any nested expression
950 2009-10-27 Marek Safar <marek.safar@gmail.com>
952 * constant.cs, nullable.cs: Create nullable-null as LiftedNull
955 * class.cs: Allow nullable binary user operators.
957 2009-10-26 Marek Safar <marek.safar@gmail.com>
959 * expression.cs: Move binary expression optimization at the end of
962 2009-10-23 Marek Safar <marek.safar@gmail.com>
964 * constant.cs, nullable.cs, expression.cs, literal.cs, cfold.cs:
965 Separate NullConstant from NullLiteral.
967 2009-10-23 Marek Safar <marek.safar@gmail.com>
969 * typemanager.cs, eval.cs, decl.cs, roottypes.cs, context.cs,
970 anonymous.cs, expression.cs, rootcontext.cs, ecore.cs, class.cs,
971 flowanalysis.cs, cs-parser.jay, driver.cs, codegen.cs: Split
972 ModuleContainer. Add common unclosed member check routine.
974 2009-10-22 Marek Safar <marek.safar@gmail.com>
976 * argument.cs: Use literal flag for real literals only.
978 * dynamic.cs: Use correct return type for custom delegates.
980 2009-10-22 Marek Safar <marek.safar@gmail.com>
982 * dynamic.cs, expression.cs: Pass logical binary flag to dynamic
985 2009-10-22 Marek Safar <marek.safar@gmail.com>
987 * dynamic.cs, ecore.cs: Dynamic invocation with void return type.
989 2009-10-21 Marek Safar <marek.safar@gmail.com>
991 * dynamic.cs, convert.cs, expression.cs, ecore.cs: Wrap array index
994 2009-10-21 Marek Safar <marek.safar@gmail.com>
996 * typemanager.cs, dynamic.cs, expression.cs: Don't resolve runtime
999 2009-10-20 Marek Safar <marek.safar@gmail.com>
1001 * argument.cs, dynamic.cs, expression.cs: Latest API update.
1003 2009-10-19 Marek Safar <marek.safar@gmail.com>
1005 * typemanager.cs, expression.cs: Dynamic array initializer.
1007 2009-10-16 Marek Safar <marek.safar@gmail.com>
1009 * typemanager.cs, rootcontext.cs: Clear -nostdlib flag when object
1012 2009-10-16 Marek Safar <marek.safar@gmail.com>
1014 A fix for bug #493523, #507067
1015 * convert.cs, nullable.cs, expression.cs: Do implicit and explicit
1016 standard nullable conversion using underlying standard conversion
1017 and not full conversion.
1019 2009-10-15 Marek Safar <marek.safar@gmail.com>
1021 * dynamic.cs, expression.cs, ecore.cs, delegate.cs: Check return
1022 type in VerifyArgumentsCompat.
1024 2009-10-15 Marek Safar <marek.safar@gmail.com>
1026 * nullable.cs, expression.cs, statement.cs, namespace.cs, ecore.cs:
1027 Reject variable used with type arguments.
1029 2009-10-14 Marek Safar <marek.safar@gmail.com>
1031 * argument.cs, dynamic.cs, assign.cs, expression.cs, ecore.cs:
1032 Implement dynamic expressions assignment.
1034 2009-10-14 Marek Safar <marek.safar@gmail.com>
1036 * expression.cs: Build underlying expression when resolving unary
1039 2009-10-14 Marek Safar <marek.safar@gmail.com>
1041 * expression.cs: Emit enum array initializer using binary blob.
1043 2009-10-08 Marek Safar <marek.safar@gmail.com>
1045 * typemanager.cs, constant.cs: Optimize decimal constants which fit
1048 2009-10-07 Marek Safar <marek.safar@gmail.com>
1050 * typemanager.cs: Reset object_type.
1052 * assign: Made SimpleAssign public.
1054 2009-10-06 Marek Safar <marek.safar@gmail.com>
1056 * typemanager.cs, decl.cs, namespace.cs, ecore.cs, class.cs: Pass
1057 invocation assembly to IsThisOrFriendAssembly.
1059 2009-10-05 Marek Safar <marek.safar@gmail.com>
1061 * expression.cs: Equality comparison of generic parameter with
1064 2009-10-05 Marek Safar <marek.safar@gmail.com>
1066 A fix for bug #543570
1067 * generic.cs: Import predefined constraints correctly.
1069 2009-10-02 Marek Safar <marek.safar@gmail.com>
1071 * ecore.cs: Don't crash on overloads with optional paremeters where
1072 arguments count overflows.
1074 * parameter.cs: Import optional parameter constants using optional
1077 2009-10-01 Marek Safar <marek.safar@gmail.com>
1079 * Makefile: Default is gmcs compiler.
1081 2009-10-01 Marek Safar <marek.safar@gmail.com>
1083 * cs-parser.jay: Fixed few NRE.
1085 2009-10-01 Marek Safar <marek.safar@gmail.com>
1087 * cs-parser.jay, driver.cs: Expose parser exception in verbose mode.
1089 2009-09-30 Marek Safar <marek.safar@gmail.com>
1091 * linq.cs, convert.cs, assign.cs, expression.cs, ecore.cs: Add
1092 ShimExpression, ImplicitCast.
1094 2009-09-30 Marek Safar <marek.safar@gmail.com>
1096 A fix for bug #542959
1097 * delegate.cs: Emit correct delegate instance variable when there
1098 are static and non-static overloads.
1100 2009-09-29 Marek Safar <marek.safar@gmail.com>
1102 * dynamic.cs, linq.cs, anonymous.cs, expression.cs, statement.cs,
1103 ecore.cs, cs-parser.jay: Unary expression dynamic compiler.
1105 2009-09-28 Marek Safar <marek.safar@gmail.com>
1107 A fix for bug #542487
1108 * ecore.cs: Resolve extension methods hidden by properties.
1110 2009-09-25 Marek Safar <marek.safar@gmail.com>
1112 * expression.cs, ecore.cs: More dynamic binary expressions.
1114 2009-09-22 Marek Safar <marek.safar@gmail.com>
1116 * nullable.cs, expression.cs: Fixed null lifted conversion for
1117 bitwise enum operations.
1119 2009-09-22 Marek Safar <marek.safar@gmail.com>
1121 * convert.cs, ecore.cs: Fixed explicit unsafe coversion of long
1122 values in checked context.
1124 2009-09-22 Marek Safar <marek.safar@gmail.com>
1126 * expression.cs, ecore.cs: Fixed array index constant conversion.
1128 2009-09-20 Miguel de Icaza <miguel@novell.com>
1130 * expression.cs: Do not crash when MemberLookup returns something
1131 that is not a MemberExpr here. Report error 582 instead.
1135 2009-09-18 Marek Safar <marek.safar@gmail.com>
1137 * decl.cs, class.cs: Check protected property accessors.
1139 2009-09-18 Marek Safar <marek.safar@gmail.com>
1141 * dynamic.cs, assign.cs: Dynamic compound assignment.
1143 2009-09-17 Marek Safar <marek.safar@gmail.com>
1145 * expression.cs: Fixed compound assignment explicit conversion.
1147 2009-09-17 Marek Safar <marek.safar@gmail.com>
1149 * expression.cs, ecore.cs: Cannot infer variables from method group.
1151 2009-09-16 Marek Safar <marek.safar@gmail.com>
1153 * argument.cs, dynamic.cs, convert.cs, context.cs, anonymous.cs,
1154 constant.cs, nullable.cs, expression.cs, literal.cs, ecore.cs,
1155 codegen.cs: Dynamic binary operations scaffolding.
1157 2009-09-15 Marek Safar <marek.safar@gmail.com>
1159 * expression.cs: Fixes nullable promotion for enum type variables.
1161 2009-09-11 Marek Safar <marek.safar@gmail.com>
1163 * driver.cs, dynamic.cs: Reset more static variables.
1165 2009-09-11 Marek Safar <marek.safar@gmail.com>
1167 * dynamic.cs, expression.cs, rootcontext.cs, namespace.cs, ecore.cs,
1168 driver.cs: Introduced Expression::MakeExpression.
1170 2009-09-11 Marek Safar <marek.safar@gmail.com>
1172 * eval.cs: Exposed MessageOutput instead of cleaning up eval API.
1174 2009-09-09 Marek Safar <marek.safar@gmail.com>
1176 * eval.cs, report.cs: Use Console.Out for all eval error or warning
1179 2009-09-09 Marek Safar <marek.safar@gmail.com>
1181 A fix for bug #518707
1182 * expression.cs (Is): Optimize only generic parameter type
1183 expression probing value type generic parameter.
1185 2009-09-09 Marek Safar <marek.safar@gmail.com>
1187 A fix for bug #532571
1188 * ecore.cs: Check for simple name type arguments used with
1191 2009-09-08 Marek Safar <marek.safar@gmail.com>
1193 A fix for bug #497421
1194 * generic.cs (CheckConstraint): Don't use buildin types to check for
1195 parameterless constructor.
1197 2009-09-08 Marek Safar <marek.safar@gmail.com>
1199 A fix for bug #537402
1200 * generic.cs (CheckConstraint): Correctly inflate generic type
1201 arguments when checking generic method.
1203 2009-09-08 Marek Safar <marek.safar@gmail.com>
1205 A fix for bug #536463
1206 * decl.cs (AddToContainer): Don't report collision between explicit
1207 and parameterless non-explicit members.
1209 2009-09-08 Marek Safar <marek.safar@gmail.com>
1211 * eval.cs: Reset more static stuff.
1213 2009-09-07 Marek Safar <marek.safar@gmail.com>
1215 A fix for bug #324625
1216 * expression.cs, ecore.cs: Create nested generic type expression
1217 using declaring and not current type.
1219 2009-09-07 Marek Safar <marek.safar@gmail.com>
1221 * *.cs: Changed Report class to accept various output printers and
1222 be an instance class. An expression resolver can now use different
1223 message reporter for each call and Report.Error can safely throw
1224 an exception. Part of ongoing work to turn mcs into proper library.
1226 2009-09-04 Marek Safar <marek.safar@gmail.com>
1228 * statement.cs, ecore.cs: Removed error reporting from emit code.
1230 2009-09-04 Marek Safar <marek.safar@gmail.com>
1232 * cs-parser.jay, parameter.cs: Moved parser check out of constructor
1234 2009-09-03 Marek Safar <marek.safar@gmail.com>
1236 * anonymous.cs, expression.cs, statement.cs, cs-parser.jay: Moved
1237 parser checks out of constructors.
1239 2009-09-02 Marek Safar <marek.safar@gmail.com>
1241 * expression.cs, statement.cs, ecore.cs: Use common Report.Error.
1243 2009-09-02 Marek Safar <marek.safar@gmail.com>
1245 A fix for bug #535448
1246 * anonymous.cs, class.cs: Copy return label between all contexts.
1248 2009-09-02 Marek Safar <marek.safar@gmail.com>
1250 A fix for bug #535395
1251 * namespace.cs: Resolve context can be null.
1253 2009-08-25 Marek Safar <marek.safar@gmail.com>
1255 A fix for bug #533912
1256 * generic.cs: Use correct context for constraints resolving.
1258 2009-08-25 Marek Safar <marek.safar@gmail.com>
1260 A fix for bug #532630
1261 * driver.cs: Trim conditional symbols.
1263 2009-08-25 Marek Safar <marek.safar@gmail.com>
1265 * context.cs: New file.
1267 * *.exe.sources, *.csproj: Updated.
1269 2009-08-25 Marek Safar <marek.safar@gmail.com>
1271 * generic.cs, parameter.cs, decl.cs, statement.cs, namespace.cs,
1272 class.cs, generic-mcs.cs, codegen.cs: Add GetSignatureForError to
1273 IMembercontext, some small cleanups.
1275 2009-08-24 Marek Safar <marek.safar@gmail.com>
1277 * *.cs: Split ResolveContext and EmitContext.
1279 2009-08-24 Marek Safar <marek.safar@gmail.com>
1281 * *.cs: Only ResolveContext implements IMemberContext.
1283 2009-08-21 Marek Safar <marek.safar@gmail.com>
1285 * *.cs: Renamed IResolveContext to IMemberContext.
1287 2009-08-21 Marek Safar <marek.safar@gmail.com>
1289 * *.cs: Detached ResolveContext from EmitContext.
1291 2009-08-21 Marek Safar <marek.safar@gmail.com>
1293 * codegen.cs: Moved flow-analysis to BlockContext.
1295 2009-08-21 Marek Safar <marek.safar@gmail.com>
1297 * *.cs: Detached BlockContext from EmitContext.
1299 2009-08-20 Gonzalo Paniagua Javier <gonzalo@novell.com>
1301 * statement.cs: avoid nullref when the return value of GetEnumerator()
1302 does not contain any MoveNext() method.
1304 2009-08-19 Marek Safar <marek.safar@gmail.com>
1306 * *.cs: Removed IResolveContext::GenericDeclContainer.
1308 2009-08-19 Marek Safar <marek.safar@gmail.com>
1310 * class.cs, delegate.cs: Changed Delegate to be TypeContainer based.
1312 2009-08-19 Marek Safar <marek.safar@gmail.com>
1314 * generic.cs, iterators.cs, expression.cs, statement.cs, ecore.cs,
1315 cs-parser.jay, attribute.cs, codegen.cs: Better error reports.
1317 2009-08-18 Marek Safar <marek.safar@gmail.com>
1319 * *.cs: Removed boolean fields from EmitContext.
1321 2009-08-18 Marek Safar <marek.safar@gmail.com>
1323 * *.cs: Add IResolveContext::IsStatic.
1325 2009-08-18 Marek Safar <marek.safar@gmail.com>
1327 * *.cs: Moved TopBlock's methods from EmitContext to TopBlock.
1329 2009-08-17 Marek Safar <marek.safar@gmail.com>
1331 * *.cs: Removed DeclContainer from EmitContext.
1333 2009-08-17 Marek Safar <marek.safar@gmail.com>
1335 * *.cs: Add IResolveContext::CurrentTypeParameters.
1337 2009-08-14 Marek Safar <marek.safar@gmail.com>
1339 * *.cs: Removed TypeContainer and ContainerType from EmitContext.
1341 2009-08-14 Marek Safar <marek.safar@gmail.com>
1343 * decl.cs, expression.cs, namespace.cs, ecore.cs, class.cs,
1344 codegen.cs: Add IResolveContext::LookupExtensionMethod.
1346 2009-08-13 Marek Safar <marek.safar@gmail.com>
1348 * decl.cs: Look in PartialContainer for parent type parameters.
1350 2009-08-13 Marek Safar <marek.safar@gmail.com>
1352 * decl.cs, namespace.cs, ecore.cs, class.cs, attribute.cs,
1353 codegen.cs: Add IResolveContext::LookupTypeParameter.
1355 2009-08-13 Marek Safar <marek.safar@gmail.com>
1357 * lambda.cs, expression.cs, statement.cs, namespace.cs, ecore.cs:
1358 Moved resolved logic from Emit to Resolve.
1360 2009-08-13 Marek Safar <marek.safar@gmail.com>
1362 * parameter.cs, decl.cs, roottypes.cs, class.cs, attribute.cs,
1363 codegen.cs: Reworked atttributes handling of ResolveContext.
1365 2009-08-12 Marek Safar <marek.safar@gmail.com>
1367 * decl.cs, ecore.cs, class.cs, attribute.cs, codegen.cs: Pushed
1368 LookupNamespaceOrType to ResolveContext.
1370 2009-08-12 Marek Safar <marek.safar@gmail.com>
1372 * typemanager.cs, decl.cs, expression.cs, namespace.cs, ecore.cs,
1373 class.cs: Removed unused parameters and methods.
1375 2009-08-11 Marek Safar <marek.safar@gmail.com>
1377 * generic.cs, lambda.cs, anonymous.cs, statement.cs, generic-mcs.cs,
1378 codegen.cs: Finding the best common type of a set of expressions for
1381 2009-08-07 Marek Safar <marek.safar@gmail.com>
1383 * dynamic.cs, expression.cs: More dynamic conversions.
1385 2009-08-06 Miguel de Icaza <miguel@novell.com>
1387 * generic.cs: This loop was incorrect, it was increment ii, but
1388 checking for `i'. This was a change introduced to fix #327497,
1391 * class.cs: Catch another case for cs0533 error, fixes #324782.
1393 2009-08-06 Rodrigo Kumpera <rkumpera@novell.com>
1395 * typemanager.cs (GetGenericArguments): SRE returns null for
1396 generic methods on type builder instances if they are not generic
1397 themselves. For example, for Foo<int>::Bar() it returns null, but
1398 not for Foo<int>::Bar<>() or Foo<int>::Bar<double>().
1400 2009-08-05 Marek Safar <marek.safar@gmail.com>
1402 * argument.cs, dynamic.cs, expression.cs, ecore.cs, class.cs,
1403 delegate.cs: Work on dynamic binding.
1405 2009-08-04 Marek Safar <marek.safar@gmail.com>
1407 A second fix for bug #525342
1408 * class.cs: Attach partial method attributes to method
1411 2009-08-03 Marek Safar <marek.safar@gmail.com>
1413 * typemanager.cs, parameter.cs, support.cs, class.cs: Dynamic type
1416 * rootcontext.cs: Default to langversion v4.
1418 2009-08-03 Marek Safar <marek.safar@gmail.com>
1420 * pending.cs: Check return type before member info is set.
1422 2009-08-03 Marek Safar <marek.safar@gmail.com>
1424 * anonymous.cs: Fully initialize generic hoisted field expression.
1426 2009-08-02 Miguel de Icaza <miguel@novell.com>
1428 * cs-parser.jay: Flag variables declared on the interactive shell
1429 as used to prevent the 168 warning about local variable not being
1432 2009-07-31 Marek Safar <marek.safar@gmail.com>
1434 * parameter.cs, dynamic.cs, support.cs, class.cs, delegate.cs,
1435 attribute.cs: Emit dynamic export attribute.
1437 2009-07-30 Marek Safar <marek.safar@gmail.com>
1439 * expression.cs: More verifier work.
1441 2009-07-29 Marek Safar <marek.safar@gmail.com>
1443 * nullable.cs: Fixed SRE crash during corlib compilation.
1445 2009-07-29 Marek Safar <marek.safar@gmail.com>
1447 * generic.cs, typemanager.cs, decl.cs, iterators.cs, convert.cs,
1448 nullable.cs, expression.cs, ecore.cs, class.cs, attribute.cs:
1449 More TypeManager.TypeToCoreType needed.
1451 2009-07-29 Marek Safar <marek.safar@gmail.com>
1453 * anonymous.cs: Update after recent SRE fixes.
1455 2009-07-28 Marek Safar <marek.safar@gmail.com>
1457 * typemanager.cs, expression.cs, ecore.cs, delegate.cs: Use correct
1458 version of GetFieldHandle for fields of generic types.
1460 2009-07-27 Marek Safar <marek.safar@gmail.com>
1462 * typemanager.cs, argument.cs, convert.cs, assign.cs, expression.cs,
1463 ecore.cs: Add TypeManager.IsDynamicType,
1464 PredefinedAttributes.Dynamic.
1466 2009-07-27 Marek Safar <marek.safar@gmail.com>
1468 A fix for bug #415375
1469 * expression.cs: Fixed object and reference type parameter
1472 2009-07-27 Marek Safar <marek.safar@gmail.com>
1474 A fix for bug #525342
1475 * class.cs: Attach partial method attributes to method
1478 2009-07-24 Marek Safar <marek.safar@gmail.com>
1480 * argument.cs, dynamic.cs, expression.cs, class.cs, attribute.cs:
1483 2009-07-24 Marek Safar <marek.safar@gmail.com>
1485 * anonymous.cs (MutateField): Add imported types handling.
1487 2009-07-23 Marek Safar <marek.safar@gmail.com>
1489 * expression.cs, delegate.cs: Moved arguments resolve into their
1490 counterparts expressions. Removed argument resolve from
1491 CollectionElementInitializer.
1493 2009-07-23 Marek Safar <marek.safar@gmail.com>
1495 A fix for bug #523683
1496 * convert.cs, delegate.cs: Use common overload mechanism for method
1497 group conversion check.
1499 2009-07-22 Marek Safar <marek.safar@gmail.com>
1501 A fix for bug #523899
1502 * generics.cs: Exact type inference with other bound types.
1504 2009-07-22 Raja R Harinath <harinath@hurrynot.org>
1506 Don't complain when the same type is implemented by the output
1507 assembly as well as multiple referenced assemblies
1508 * namespace.cs (RootNamespace.LookupTypeReflection): Add
1509 'must_be_unique' flag.
1510 (GlobalRootNamespace): Update to changes.
1511 (Namespace.LookupType): Pass 'must_be_unique' only when we don't
1512 already have a type in hand.
1514 2009-07-22 Marek Safar <marek.safar@gmail.com>
1516 * expression.cs: More verifier instrumentation.
1518 * statement.cs: Do proper throw expression conversion.
1520 2009-07-22 Marek Safar <marek.safar@gmail.com>
1522 A fix for bug #522789
1523 * expression.cs: Mutate invocation return type.
1525 2009-07-16 Marek Safar <marek.safar@gmail.com>
1527 * anonymous.cs: Split assignable and readonly generated variable
1530 2009-07-16 Marek Safar <marek.safar@gmail.com>
1532 A fix for bug #521671
1533 * statement.cs: Fixed crash when checking missing type.
1535 2009-07-16 Marek Safar <marek.safar@gmail.com>
1537 * typemanager.cs, generic.cs, argument.cs, linq.cs, convert.cs,
1538 assign.cs, expression.cs, statement.cs, support.cs, ecore.cs,
1539 class.cs, driver.cs: Work on dynamic binding.
1541 * dynamic.cs: New file.
1543 * *.sources, *.proj: Updated.
1545 2009-07-15 Marek Safar <marek.safar@gmail.com>
1547 * expression.cs (Conditional): Avoid double Resolve.
1549 2009-07-13 Marcus Griep <marcus@griep.us>
1551 * ecore.cs: Fix obscure bug with resolving members of interfaces
1552 that hide parent interface members. Fixes bug #444388 and corrects
1555 2009-07-13 Marek Safar <marek.safar@gmail.com>
1557 * expression.cs (LocalVariableReference): Bounce resolve.
1559 2009-07-10 Marek Safar <marek.safar@gmail.com>
1561 * typemanager.cs, lambda.cs, parameter.cs, convert.cs, anonymous.cs,
1562 expression.cs, literal.cs, ecore.cs, complete.cs: Moved internal
1565 * support.cs: New dynamic type wrapper.
1567 2009-07-08 Marek Safar <marek.safar@gmail.com>
1569 * ecore.cs, cs-parser.jay: Better error reporting for implicitly
1570 typed local variable.
1572 2009-07-06 Marek Safar <marek.safar@gmail.com>
1574 A fix for bug #519005
1575 * anonymous.cs: Use null_type as no return type placeholder.
1577 2009-07-02 Marek Safar <marek.safar@gmail.com>
1579 * generic.cs: Handle type inference of identical type parameters
1580 with different bounds.
1582 2009-07-01 Marek Safar <marek.safar@gmail.com>
1584 * expression.cs, class.cs: Events variance.
1586 * cs-parser.jay: Interface events error messages.
1588 2009-07-01 Marek Safar <marek.safar@gmail.com>
1590 * generic.cs, argument.cs: Updated type inference logic to C# 4.0.
1592 2009-06-29 Marek Safar <marek.safar@gmail.com>
1594 * parameter.cs, convert.cs, expression.cs, class.cs: Default
1595 parameter expression can be value-type New.
1597 * cs-parser.jay: Clean up too many parameter modifier boolean flags.
1599 2009-06-26 Marek Safar <marek.safar@gmail.com>
1601 * generic.cs, argument.cs, expression.cs, ecore.cs, cs-parser.jay:
1602 Implemented C# 4.0 named arguments.
1604 2009-06-24 Marek Safar <marek.safar@gmail.com>
1606 * typemanager.cs, parameter.cs, iterators.cs, convert.cs,
1607 expression.cs, ecore.cs, delegate.cs: Removed unnecessary ArgList
1608 parameter modifier. Also fixes bug #515497.
1610 2009-06-24 Marek Safar <marek.safar@gmail.com>
1612 * *.cs: Replaced ArrayList with Arguments in need of a nonsequential
1613 arguments expression to be implemented.
1615 *.sources: Add argument.cs
1617 2009-06-23 Marek Safar <marek.safar@gmail.com>
1619 * parameter.cs: Moved GetParameterIndexByName to base class.
1621 * expression.cs, statement.cs, ecore.cs, delegate.cs: Removed
1622 unused AType. Use argument's version of GetExpressionTree.
1624 2009-06-22 Marek Safar <marek.safar@gmail.com>
1626 * expression.cs, cs-parser.jay, attribute.cs, codegen.cs: Named
1629 2009-06-17 Marek Safar <marek.safar@gmail.com>
1631 A fix for bug #514096
1632 * class.cs: Allow IntPtr/UIntPtr fields to be volatile.
1634 2009-06-17 Marek Safar <marek.safar@gmail.com>
1636 * expression.cs: The first multi-dimensional array nested array
1637 initializers was not checked.
1639 * statement.cs (Switch): Fixed error message to reflect 2.0 changes.
1641 2009-06-17 Marek Safar <marek.safar@gmail.com>
1643 A fix for bug #513400
1644 * nullable.cs (EmitEquality): Operands emit could be simplified for
1645 built-in types when we now emit user operators differently.
1647 2009-06-16 Marek Safar <marek.safar@gmail.com>
1649 * ecore.cs: Report inaccessible delegate methods correctly.
1651 2009-06-16 Marek Safar <marek.safar@gmail.com>
1653 * parameter.cs, expression.cs, ecore.cs, class.cs, delegate.cs,
1654 cs-parser.jay: Implemented C# 4.0 optional parameters.
1656 2009-06-16 Marek Safar <marek.safar@gmail.com>
1658 * driver.cs: Removed broken DefineManifestResource.
1660 2009-06-16 Raja R Harinath <harinath@hurrynot.org>
1662 * Makefile [net_2_0_bootstrap]: Don't explicitly mention net_1_1.
1663 Use $(BOOTSTRAP_PROFILE) instead.
1665 2009-06-12 Jb Evain <jbevain@novell.com>
1667 * rootcontext.cs: add a Platform field.
1668 * driver.cs: handle /platform.
1669 * codegen.cs: pass the proper flags according to
1670 the platform when saving the assembly.
1672 2009-06-11 Marek Safar <marek.safar@gmail.com>
1674 * parameter.cs, const.cs, report.cs, cs-parser.jay, attribute.cs:
1675 Add optional parameters grammar.
1677 2009-06-10 Marek Safar <marek.safar@gmail.com>
1679 * eval.cs, anonymous.cs, report.cs, rootcontext.cs, cs-parser.jay,
1680 driver.cs: Split lang version and metadata version.
1682 2009-06-10 Marek Safar <marek.safar@gmail.com>
1684 * decl.cs: Better overload ctor collision error message.
1686 2009-06-05 Jb Evain <jbevain@novell.com>
1688 * driver.cs (EmbededResource): avoid using an internal method
1689 in gmcs to embed manifest resources.
1691 2009-06-04 Sebastien Pouliot <sebastien@ximian.com>
1693 * generic.cs, parameter.cs: Avoid using 'var' so we can bootstrap
1694 the compiler from older mono versions (like moon's bots)
1696 2009-06-04 Marek Safar <marek.safar@gmail.com>
1698 * namespace.cs (LookupTypeReflection): Ignore collisions between
1701 2009-06-04 Marek Safar <marek.safar@gmail.com>
1703 * codegen.cs: Enabled generic type forwarders.
1705 2009-06-04 Marek Safar <marek.safar@gmail.com>
1707 * dmcs.*: Add another version of SRE compiler.
1709 2009-06-03 Marek Safar <marek.safar@gmail.com>
1711 * generic.cs, typemanager.cs, parameter.cs, convert.cs,
1712 generic-mcs.cs: Fixed variant type conversions.
1714 2009-06-02 Marek Safar <marek.safar@gmail.com>
1716 A fix for bug #507863
1717 * codegen.cs: Fixes a crash on invalid string value attribute.
1719 2009-06-01 Marek Safar <marek.safar@gmail.com>
1721 A fix for bug #508334
1722 * typemanager.cs, parameter.cs, convert.cs, expression.cs, ecore.cs,
1723 cs-parser.jay: Fully import __arglist modifier.
1725 2009-05-29 Marek Safar <marek.safar@gmail.com>
1727 * generic.cs, typemanager.cs, parameter.cs, ecore.cs, class.cs,
1728 delegate.cs, generic-mcs.cs: Rewrote type variance checks to
1729 actually work with closed generic types.
1731 2009-05-27 Alan McGovern <amcgovern@novell.com>
1733 * class.cs, decl.cs, delegate.cs, parameter.cs:
1734 Fix the build by replacing the use of 'var' with the actual type.
1736 2009-05-27 Marek Safar <marek.safar@gmail.com>
1738 * generic.cs, parameter.cs, decl.cs, ecore.cs, class.cs, delegate.cs
1739 cs-parser.jay, generic-mcs.cs: Report wrong variant types
1742 * driver.cs, rootcontext.cs, report.cs: Add 3.0 language version
1745 2009-05-26 Rodrigo Kumpera <rkumpera@novell.com>
1746 Marek Safar <marek.safar@gmail.com>
1748 A fix for bug #377509
1749 * parameter.cs: Use predefined and not empty name for implicit
1752 2009-05-21 Marek Safar <marek.safar@gmail.com>
1754 * class.cs: Don't report wrong warnings for event fields.
1756 2009-05-21 Marek Safar <marek.safar@gmail.com>
1758 A fix for bug #504667
1759 * class.cs: Check for static class using parent container instead of
1762 2009-05-08 Marek Safar <marek.safar@gmail.com>
1764 A fix for bug #496922
1765 * expression.cs: Always use temporary variable when using object
1768 2009-04-28 Marek Safar <marek.safar@gmail.com>
1770 A fix for bug #495112
1771 * class.cs (IsUnmanagedType): Handle recursive unmanaged types using
1774 2009-04-27 Miguel de Icaza <miguel@novell.com>
1776 * driver.cs: Add a flag to work as a replacement for CSC in VS.
1778 2009-04-24 Miguel de Icaza <miguel@novell.com>
1780 * complete.cs: No idea how gonzalo got a null in the list, but
1783 2009-04-24 Miguel de Icaza <miguel@novell.com>
1785 * complete.cs (CompletionElementInitializer): New completion class
1786 to support completing inside a C# 3 element initializer, so this
1787 allows completion for Silverlight situations where it is very
1790 new TextBlock () { Fo<TAB>
1792 (CompletionSimpleName): Expose the prefix that was
1793 passed to the simple name.
1795 * cs-parser.jay (object_or_collection_initializer): Add support
1796 for element_initializers.
1798 * expression.cs (CollectionOrObjectInitializers.DoResolve):
1799 special case completion expressions as this method aggressively
1800 collects data before it operates, and errors were being thrown
1801 earlier than we were able to complete.
1803 2009-04-23 Miguel de Icaza <miguel@novell.com>
1805 * eval.cs: Make getcompletions silent and enable debugging output
1806 if the -v option is passed.
1808 * namespace.cs (NamespaceEntry.CompletionGetTypesStartingWith):
1809 Consider looking up the namespace that matches the prefix being
1812 This is part of the support for allowing completions like:
1813 `System.Co<TAB>' to complete to System.Console.
1815 * complete.cs (CompletionSimpleName.AppendResults): Make this
1818 2009-04-21 Raja R Harinath <harinath@hurrynot.org>
1820 * cs-parser.jay (GetTokenName): Mark GENERATE_COMPLETION and
1821 COMPLETE_COMPLETION as internal.
1823 2009-04-17 Miguel de Icaza <miguel@novell.com>
1825 * complete.cs: Include namespace resolution in simple names as
1826 well as global types and types in the using scope in the
1829 * namespace.cs: Supporting infrastrcture to provide completions
1830 based on the current using scope.
1832 * eval.cs: Introduce an entry point that allows for initialization
1833 to return a list of the files passed on the command line.
1835 2009-04-14 Marek Safar <marek.safar@gmail.com>
1837 A fix for bug #494243
1838 * report.cs (SymbolRelatedToPreviousError): Fixed NRE.
1840 2009-04-13 Marek Safar <marek.safar@gmail.com>
1842 A fix for bug #493887
1843 * statement.cs: Don't skip string multi-section with default or
1844 null label when populating string hashtable.
1846 2009-04-06 Marek Safar <marek.safar@gmail.com>
1848 A fix for bug #492329
1849 * expression.cs (New): Load variable when assigning type parameter
1852 2009-04-06 Marek Safar <marek.safar@gmail.com>
1854 A fix for bug #488960
1855 * decl.cs: Compare MVAR types using non-null values.
1857 2009-03-27 Marek Safar <marek.safar@gmail.com>
1859 * typemanager.cs, expression.cs: Removed unused nullable checks.
1861 2009-03-27 Marek Safar <marek.safar@gmail.com>
1863 * *.cs: Removed some gmcs conditionals.
1865 2009-03-26 Marek Safar <marek.safar@gmail.com>
1867 * generic.cs, support.cs: Moved generics stuff out of support.cs
1869 2009-03-24 Marek Safar <marek.safar@gmail.com>
1871 * ecore.cs, expression.cs: Use queried type for MethodGroupExpr
1874 2009-03-23 Marek Safar <marek.safar@gmail.com>
1876 * attribute.cs: Consider all members for error reporting when
1877 checking named arguments.
1879 2009-03-23 Marek Safar <marek.safar@gmail.com>
1881 A fix for bug #487625
1882 * namespace.cs: Use a warning for all predefined type conflicts.
1884 2009-03-23 Marek Safar <marek.safar@gmail.com>
1886 A fix for bug #485706
1887 * statement.cs: Explicitly type catch type argument to pass verifier
1890 2009-03-22 Miguel de Icaza <miguel@novell.com>
1892 Initial support to provide code completion facilities to consumers
1893 of the evaluator API.
1895 * cs-tokenizer.cs (CompleteOnEOF): this new property is used to
1896 support the completion engine. When we reach the end of the
1897 input stream instead of returning EOF, when this flag is true the
1898 tokenizer instead produces:
1900 One GENERATE_COMPLETION token: this token then must be
1901 handled in the grammar at every point where the user
1902 would likely request a completion.
1904 As many COMPLETE_COMPLETION tokens as necessary. These
1905 tokens are generated to assist the parser in unwinding and
1906 producing a valid parse tree.
1908 The parser rules do not have to be perfect, the parser needs to be
1909 augmented with judicious use of GENERATE_COMPLETION tokens to
1910 improve the areas where we can provide completion and the parser
1911 needs to add support for COMPLETE_COMPLETION tokens in productions
1914 It is common to not have enough support for COMPLETE_COMPLETION
1915 under certain rules and that even if we generated the
1916 GENERATE_COMPLETION token that the resulting tree will be invalid
1917 due to the missing rules that support COMPLETE_COMPLETION.
1919 The final EOF token is produced by having the parser notify the
1920 tokenizer when it reaches the root production that the next token
1923 * support.cs (CompletionResult): New Exception. This exception
1924 is thrown to return the completion results when one of the special
1925 completion expressions is reached.
1927 This exception is thrown by the completing ExpressionStatements
1928 classes that live in complete.cs
1930 * complete.cs (CompletingExpression): a new base class for
1931 completing expressions. This derives from the
1932 ExpressionStatement class and not from Expression as it allows
1933 completion to happen not only where expressions are expected in
1934 the grammar, but also where statements are expected.
1936 (CompletionSimpleName): A new class used to provide completions
1937 for SimpleNames. This currently only resolves to local
1938 variables from the evaluator context (GetVars call).
1940 (CompletionMemberAccess): Implements support for completing member
1943 * cs-parser.jay: Add support for completion in a few places.
1945 * eval.cs (GetCompletions): New public API for the evaluator that
1946 returns a list of possible completions given the input. The
1947 return value is an array of completions
1949 * anonymous.cs (Compatible): If the exception thrown from the
1950 resolved expression is a CompletionResult exception let that one
1951 through instead of printing a diagnostic error in the try/catch.
1953 2009-03-22 Miguel de Icaza <miguel@novell.com>
1957 * driver.cs (Main): Use Environment.Exit to quit quickly and
1958 prevent the compiler from doing the usual wait for helper thread
1961 This is to prevent a slowdown that was reported by Gonzalo on
1964 2009-03-19 Marek Safar <marek.safar@gmail.com>
1966 * ecore.cs: Load build-in types directly instead of accessing
1969 2009-03-18 Marek Safar <marek.safar@gmail.com>
1971 * ecore.cs: Always use unbox.any when available.
1973 2009-03-18 Marek Safar <marek.safar@gmail.com>
1975 * class.cs: Always set TypeAttributes.BeforeFieldInit conditionally.
1977 2009-03-17 Marek Safar <marek.safar@gmail.com>
1979 * generic.cs: Removed obsolete version of type inference.
1981 2009-03-16 Marek Safar <marek.safar@gmail.com>
1983 * typemanager.cs, decl.cs, roottypes.cs, anonymous.cs, nullable.cs,
1984 expression.cs, rootcontext.cs, namespace.cs, ecore.cs, class.cs,
1985 delegate.cs, flowanalysis.cs, cs-parser.jay, driver.cs,
1986 attribute.cs, codegen.cs: Changed RootTypes to be ModuleContainer.
1988 2009-03-11 Marek Safar <marek.safar@gmail.com>
1990 A fix for bug #482996
1991 * anonymous.cs: Make sure we are not infering return type when
1992 checking type compatibility.
1994 2009-03-11 Marek Safar <marek.safar@gmail.com>
1996 * typemanager.cs, generic.cs, parameter.cs, decl.cs, const.cs,
1997 rootcontext.cs, namespace.cs, class.cs, delegate.cs, driver.cs,
1998 generic-mcs.cs, attribute.cs, codegen.cs: Maintain predefined
1999 attributes in their own structure. Needed when accessing their
2000 properties before they are resolved.
2002 2009-03-09 Marek Safar <marek.safar@gmail.com>
2004 * cs-tokenizer.cs: Optimized GetKeyword using an array instead of
2005 hashtable (~10x faster).
2007 * driver.cs: Removed wrong Reset.
2009 2009-03-08 Marek Safar <marek.safar@gmail.com>
2011 * class.cs: Use correct common base type for unmanaged delayed
2014 * rootcontext.cs: Wrap unhandled exception.
2016 2009-03-06 Raja R Harinath <harinath@hurrynot.org>
2018 Make SeekableStreamReader self-tuning and arbitrarily seekable
2019 * support.cs (SeekableStreamReader.ResetStream): New. Allocates
2021 (SeekableStreamReader.Position.set): Use it. Simplify logic
2022 which, as a side-effect, makes it arbitrarily-seekable. Tune the
2023 buffer size when the stream needs to be re-read from the beginning.
2025 2009-03-05 Marek Safar <marek.safar@gmail.com>
2027 A fix for bug #480100
2028 * parameter.cs: A parameter is not hoisted when used directly as ET.
2030 2009-03-04 Marek Safar <marek.safar@gmail.com>
2032 * statement.cs: Fixed an issue when using variable is of interface
2035 2009-03-03 Marek Safar <marek.safar@gmail.com>
2037 A fix for bug #480319
2038 * report.cs, driver.cs: Support -warnaserror-:<warning list> option.
2040 2009-03-03 Marek Safar <marek.safar@gmail.com>
2042 A fix for bug #480867
2043 * typemanager.cs, expression.cs, ecore.cs: Changed method group
2044 expression to have no valid type.
2046 2009-03-03 Marek Safar <marek.safar@gmail.com>
2048 A fix for bug #481258
2049 * class.cs: Set extension method flag in partial container.
2051 2009-03-03 Marek Safar <marek.safar@gmail.com>
2053 * statement.cs, typemanager.cs: Use expression for StringEmitter.
2055 * attribute.cs: Add sanity check.
2057 2009-02-27 Marek Safar <marek.safar@gmail.com>
2059 * class.cs: Add external constructor error.
2061 2009-02-26 Marek Safar <marek.safar@gmail.com>
2063 A fix for bug #475354
2064 * convert.cs, nullable.cs, expression.cs, statement.cs: Emit
2065 correctly user defined nullable equality operators.
2067 2009-02-25 Marek Safar <marek.safar@gmail.com>
2069 A fix for bug #479532
2070 * expression.cs: Implement NewInitialize::AddressOf.
2072 2009-02-25 Marek Safar <marek.safar@gmail.com>
2074 A fix for bug #413633
2075 * expression.cs: Iterate all base class-constraint types.
2077 2009-02-24 Marek Safar <marek.safar@gmail.com>
2079 A fix for bug #479209
2080 * literal.cs: Mutate null underlying type.
2082 2009-02-24 Marek Safar <marek.safar@gmail.com>
2084 A fix for bug #476295
2085 * convert.cs: Avoid wrapping implicitly convertible reference type.
2087 2009-02-23 Marek Safar <marek.safar@gmail.com>
2089 * iterators.cs: Create MemberName correctly.
2091 2009-02-23 Marek Safar <marek.safar@gmail.com>
2093 A fix for bug #478655
2094 * literal.cs: Check also underlying null type conversion.
2096 2009-02-21 Marek Safar <marek.safar@gmail.com>
2098 * generic.cs, ecore.cs, class.cs: Removed redundant AsAccessible.
2100 2009-02-20 Marek Safar <marek.safar@gmail.com>
2102 A fix for bug #477447
2103 * statement.cs: Add reference to correct parent storey when this
2104 is accessible from deep children storey (more than 1 level).
2106 2009-02-19 Marek Safar <marek.safar@gmail.com>
2108 A fix for bug #475860 by David Mitchell <dmitchell@logos.com>
2109 * class.cs: Define base type members before setting up member cache.
2111 2009-02-18 Marek Safar <marek.safar@gmail.com>
2113 A fix for bug #477378
2114 * nullable.cs, expression.cs, statement.cs: More precise null type
2117 2009-02-18 Marek Safar <marek.safar@gmail.com>
2119 A fix for bug #472805
2120 * typemanager.cs, namespace.cs: Import only visible extension method
2123 2009-02-18 Marek Safar <marek.safar@gmail.com>
2125 A fix for bug #476895
2126 * attribute.cs: Use correct resolve context for attribute type.
2128 2009-02-18 Marek Safar <marek.safar@gmail.com>
2130 A fix for bug #476266
2131 * anonymous.cs: Mutate multi-dimensional arrays.
2133 2009-02-18 Marek Safar <marek.safar@gmail.com>
2135 A fix for bug #476400
2136 * statement.cs, expression.cs: Removed wrong Dispose optimization.
2138 2009-02-18 Marek Safar <marek.safar@gmail.com>
2140 A fix for bug #476811
2141 * generics.cs: Fixed null-literal check.
2143 2009-02-17 Marek Safar <marek.safar@gmail.com>
2145 * typemanager.cs, convert.cs, flowanalysis.cs, driver.cs,
2146 expression.cs, ecore.cs, rootcontext.cs, eval.cs, class.cs: More
2147 messing with static variables.
2149 2009-02-16 Marek Safar <marek.safar@gmail.com>
2151 A fix for bug #475965
2152 * generics.cs: Check generic parameter type after extracting from
2155 2009-02-16 Marek Safar <marek.safar@gmail.com>
2157 A fix for bug #475823
2158 * convert.cs, expression.cs, literal.cs, ecore.cs, cfold.cs: Add
2161 2009-02-14 Marek Safar <marek.safar@gmail.com>
2163 * modifiers.cs, decl.cs, ecore.cs, class.cs, flowanalysis.cs:
2164 Simplified event field definition using backing field and not
2165 field builder directly.
2167 * expression.cs (EmitLdArg): Optimize fast paths.
2169 2009-02-13 Marek Safar <marek.safar@gmail.com>
2171 A fix for bug #475327
2172 * expression.cs (ArrayCreation): Don't mutate values optimized away.
2174 2009-02-13 Marek Safar <marek.safar@gmail.com>
2176 A fix for bug #475342
2177 * cs-parser.jay: Using 'super' instead of 'base' to call base
2178 constructor crashes compiler.
2180 2009-02-13 Marek Safar <marek.safar@gmail.com>
2182 A fix for bug #475354
2183 * expression.cs (Constantify): Add nullable types.
2185 * const.cs (EmitDecimalConstant): Avoid explicit cast.
2187 2009-02-12 Marek Safar <marek.safar@gmail.com>
2189 A fix for bug #475246
2190 * expression.cs: More broken flowanalysis hacking needed.
2192 2009-02-12 Marek Safar <marek.safar@gmail.com>
2194 * attribute.cs: Compare only ref/out array modifiers.
2196 2009-02-11 Marek Safar <marek.safar@gmail.com>
2198 * statement.cs: Use member cache when looking for foreach members.
2200 2009-02-11 Marek Safar <marek.safar@gmail.com>
2202 * expression.cs: Don't expose internal initializer types.
2204 * statement.cs: Check also explicit conversions for goto case.
2206 2009-02-11 Marek Safar <marek.safar@gmail.com>
2208 * convert.cs, statement.cs: Removed usage of IsAssignableFrom.
2210 2009-02-10 Marek Safar <marek.safar@gmail.com>
2212 * *.cs: Replace null-type with NullLiteral where appropriate.
2214 2009-02-09 Marek Safar <marek.safar@gmail.com>
2216 * expression.cs: Initializer of reference argument use temporary
2217 variable to be verifiable.
2219 * parameter.cs: Share EmitLdArg.
2221 2009-02-09 Marek Safar <marek.safar@gmail.com>
2223 A fix for bug #473559
2224 * class.cs: Fixed: Not reporting error about nested class with the
2227 2009-02-06 Scott Peterson <lunchtimemama@gmail.com>
2229 Contributed under the MIT/X11 license.
2231 * generic.cs: Added VerifyVariantTypeParameters which performs new
2232 variance verification logic. The old logic, based on the spec, was
2233 wrong because the spec is full of LIES!
2235 * generic-mcs.cs: Stubbed out the VerifyVariantTypeParameters method.
2237 *typemanager.cs: Moved variance verification logic to GenericTypeExpr.
2240 * ecore.cs: Added calls to the new variance verification logic.
2243 * delegate.cs: Removed calls to the old variance verification logic.
2245 2009-02-06 Marek Safar <marek.safar@gmail.com>
2247 * delegate.cs: Use cached Invoke method directly.
2249 2009-02-06 Marek Safar <marek.safar@gmail.com>
2251 * expression.cs: Emit expression tree for hoisted variable access.
2253 2009-02-04 Marek Safar <marek.safar@gmail.com>
2255 * namespace.cs: Add better extension class check.
2257 2009-02-05 Scott Peterson <lunchtimemama@gmail.com>
2259 * generic.cs: Fixed typeo (TypeParameter.Variacne).
2261 2009-02-04 Scott Peterson <lunchtimemama@gmail.com>
2263 This patch adds initial generic variance support to the compiler.
2264 It is contributed under the MIT/X11 license.
2266 * typemanager.cs: Modified ImplementsInterface to check variance.
2267 Added VerifyVariantTypeParameters which checks the specified type to see
2268 if it uses a variant type parameter as a type argument (which is not
2269 allowed). Added IsVariantOf which determins if the first type is a
2270 variant of the second. NOTE: This only supports reference types at
2271 the moment to conform with the current level of VM support. When the
2272 VM supports value types, this will follow step.
2274 * generic.cs: Added the Variance enum. Added a Variance property to
2275 TypeParameter and added variance support to definition phase. Added a
2276 Variance property to TypeParameterName. Also check to make sure that
2277 no variant types appear in generic method parameters.
2279 * cs-tokenizer.cs: Modified parse_less_than to tokenize the variance
2280 keywords if the langversion supports it.
2282 * parameter.cs: Added Parameter.VerifyNoVariantTypeParameters to ensure
2283 that variant types are only used in legal positions. Also added
2284 ParametersCompiled.VerifyNoVariantTypeParameters to check all of its
2287 * decl.cs: Construct TypeParameter with the variance information.
2289 * convert.cs: Checks variance in ImplicitReferenceConversionExists
2290 and ImplicitConversionStandard.
2292 * rootcontext.cs: Added new "Future" language version.
2294 * class.cs: In TypeContainer.DoDefineMembers, ensure that contravariant
2295 type parameters are not used as type arguments in interface inheritance.
2296 In MemberBase.DoMemberDependentChecks, ensure that contravariant type
2297 parameters are not used as method return types. In MemberBase.
2298 ResolveMemberType, ensure that variant type parameters are not used
2299 as type arguments. Also call VerifyNoVariantTypeParameters on every
2300 set of parameters which are resolved.
2302 * delegate.cs: Modified Delegate.Define to ensure that variant
2303 parameters are not used as type arguments and that a contravariant
2304 parameter is not used as the return type. Also call
2305 VerifyNoVariantTypeParameters on the delegate parameters.
2307 * cs-parser.jay: Modified grammar to support "in" and "out" keywords
2308 to specify generic variance.
2310 * driver.cs: Added support for LanguageVersion.Future in the form of
2311 "-langversion:future".
2313 * generic-mcs.cs: Stubbed out new members in generic.cs.
2315 2009-02-03 Marek Safar <marek.safar@gmail.com>
2317 * class.cs, generic.cs: Emit type parameter constraints for nested
2320 2009-02-02 Marek Safar <marek.safar@gmail.com>
2322 A fix for bug #471213
2323 * class.cs: Avoid emitting backing field for abstract event fields.
2325 2009-02-01 Marek Safar <marek.safar@gmail.com>
2327 A fix for bug #359731
2328 * cs-tokenizer.cs, cs-parser.jay: Correctly parse nested query
2331 2009-01-30 Marek Safar <marek.safar@gmail.com>
2333 A fix for bug #470767
2334 * statement.cs: Introduced BlockScopeExpression, needed when
2335 expression tree conversion has to emit scope variables.
2337 2009-01-29 Marek Safar <marek.safar@gmail.com>
2339 * class.cs: Remove duplicate CallingConvention.
2341 2009-01-29 Marek Safar <marek.safar@gmail.com>
2343 *.cs: Rename Parameters to ParametersCompiled and ParametersImported
2344 when I finally found the right naming convention.
2346 2009-01-29 Marek Safar <marek.safar@gmail.com>
2348 * cs-tokenizer.cs: Put back different open parens optimization.
2350 2009-01-28 Marek Safar <marek.safar@gmail.com>
2352 A fix for bug #470227
2353 * cs-tokenizer.cs: Remove too agressive parser optimization.
2355 2009-01-28 Marek Safar <marek.safar@gmail.com>
2357 A fix for bug #324319
2358 * class.cs: Remove too early base type resolve.
2360 2009-01-27 Marek Safar <marek.safar@gmail.com>
2362 A fix for bug #324319
2363 * ecore.cs: Explicitly type null when assigning to type argument to
2364 make pass verifier check.
2366 2009-01-27 Marek Safar <marek.safar@gmail.com>
2368 * anonymous.cs: Fixed recent regression when initializing captured
2371 2009-01-26 Marek Safar <marek.safar@gmail.com>
2373 A fix for bug #469019
2374 * anonymous.cs: Use all parent type parameters when instantiating
2375 nested generic storey.
2377 2009-01-26 Marek Safar <marek.safar@gmail.com>
2379 * expression.cs: Check for null instance methodgroup expression.
2381 2009-01-26 Marek Safar <marek.safar@gmail.com>
2383 A fix for bug #469244
2384 * cs-tokenizer.cs, cs-parser.jay: Fixed parsing of nullable type
2385 instance inside a conditional expression.
2387 2009-01-23 Marek Safar <marek.safar@gmail.com>
2389 * typemanager.cs, generic.cs, parameter.cs, decl.cs, anonymous.cs,
2390 expression.cs, report.cs, ecore.cs, attribute.cs: Use common
2391 GetElementType and HasElementType. IsValueType clean up.
2393 2009-01-23 Marek Safar <marek.safar@gmail.com>
2395 * nullable.cs: Use common EmitCall.
2397 * expression.cs: Emit constraint. for virtual calls only.
2399 2009-01-23 Marek Safar <marek.safar@gmail.com>
2401 * typemanager.cs, generic.cs, eval.cs, convert.cs, const.cs,
2402 expression.cs, statement.cs, rootcontext.cs, ecore.cs, class.cs,
2403 driver.cs, attribute.cs, enum.cs: Split IsValueType and IsStruct
2406 2009-01-22 Jb Evain <jbevain@novell.com>
2408 * anonymous.cs: make anonymous types' ToString implementation
2409 match what csc outputs.
2411 2009-01-21 Marek Safar <marek.safar@gmail.com>
2413 * typemanager.cs, ecore.cs, iterator.cs: TypeLookupExpression clean
2416 2009-01-17 Marek Safar <marek.safar@gmail.com>
2418 * convert.cs, ecore.cs: Explicitly casts type arguments to pass
2421 2009-01-16 Marek Safar <marek.safar@gmail.com>
2423 * nullable.cs (LiftedBinaryOperator): Check for all possible null
2426 2009-01-15 Marek Safar <marek.safar@gmail.com>
2428 A fix for bug #466634
2429 * statement.cs: Add reference for nested storey when only this
2432 2009-01-15 Marek Safar <marek.safar@gmail.com>
2434 A fix for bug #466474
2435 * codegen.cs: Emit SecurityPermissionAttribute when -unsafe option
2438 2009-01-15 Marek Safar <marek.safar@gmail.com>
2440 * iterators.cs, anonymous.cs, expression.cs, statement.cs, ecore.cs:
2441 Fixed nested stories parent referencing process. Also fixes #463985.
2443 2009-01-06 Marek Safar <marek.safar@gmail.com>
2445 * decl.cs, iterators.cs, expression.cs, statement.cs, doc.cs,
2446 class.cs, cs-parser.jay, codegen.cs: Clean up destructor
2447 implementation. Also fixes #463108.
2449 2009-01-05 Marek Safar <marek.safar@gmail.com>
2451 A fix for bug #416109
2452 * decl.cs: Issue correct CLSAttribute warning location.
2454 2009-01-05 Marek Safar <marek.safar@gmail.com>
2456 A fix for bug #456775
2457 * attribute.cs: Use attribute owner scope when resolving attribute
2460 2009-01-05 Marek Safar <marek.safar@gmail.com>
2462 A fix for bug #457257
2463 * decl.cs: Fixed incorrect member declaring type comparison.
2465 2009-01-05 Marek Safar <marek.safar@gmail.com>
2467 A fix for bug #460896
2468 * driver.cs: Handle /RES resources as embeddable.
2470 2009-01-05 Marek Safar <marek.safar@gmail.com>
2472 A fix for bug #462515
2473 * ecore.cs: Report inacessible members upwards.
2475 2009-01-05 Marek Safar <marek.safar@gmail.com>
2477 A fix for bug #463190, #463192
2478 * decl.cs, namespace.cs: Also import internal extension classes.
2480 2009-01-04 Marek Safar <marek.safar@gmail.com>
2482 A fix for bug #463415
2483 * generic.cs: Use right index for RemoveDependentTypes.
2485 2009-01-02 Marek Safar <marek.safar@gmail.com>
2487 A fix for bug #463196
2488 * expression.cs: Fixed enum to null comparison.
2490 2009-01-02 Marek Safar <marek.safar@gmail.com>
2492 A fix for bug #463121
2493 * nullable.cs: Fixed nullable user equality operator comparison.
2495 2009-01-02 Marek Safar <marek.safar@gmail.com>
2497 A fix for bug #462950
2498 * class.cs, decl.cs: Use full explicit name when defining automatic
2499 property backing field.
2501 2009-01-02 Marek Safar <marek.safar@gmail.com>
2503 A fix for bug #462592
2504 * pending.cs: Emit type arguments for generic proxy method.
2506 2008-12-30 Marek Safar <marek.safar@gmail.com>
2508 * expression.cs (As): Mutate all type arguments.
2510 2008-12-29 Marek Safar <marek.safar@gmail.com>
2512 A fix for bug #462622
2513 * anonymous.cs: Resolve anonymous type GetHashCode in unchecked
2516 2008-12-29 Marek Safar <marek.safar@gmail.com>
2518 A fix for bug #450782
2519 * ecore.cs: Consider more variables of form V.I to be fixed.
2521 2008-12-29 Marek Safar <marek.safar@gmail.com>
2523 A fix for bug #460712
2524 * typemanager.cs: Core types could be imported.
2526 2008-12-28 Marek Safar <marek.safar@gmail.com>
2528 A fix for bugs #460847, #460772, #458049, #457339, #447807
2529 * generic.cs, parameter.cs, lambda.cs, linq.cs, anonymous.cs
2530 statement.cs, ecore.cs, class.cs, delegate.cs, flowanalysis.cs
2531 cs-parser.jay, driver.cs: LINQ implementation upgrade to deal with
2532 user lambdas used inside query clauses.
2534 2008-12-18 Marek Safar <marek.safar@gmail.com>
2536 A fix for bug #460229
2537 * cs-tokenizer.cs: Ignore wrongly placed BOM markers.
2539 2008-12-18 Marek Safar <marek.safar@gmail.com>
2541 A fix for bug #459952
2542 * decl.cs, namespace.cs: Use common CheckAccessLevel.
2544 2008-12-18 Marek Safar <marek.safar@gmail.com>
2546 A fix for bug #459630
2547 * convert.cs: Enum to valuetype conversion is not allowed.
2549 2008-12-18 Marek Safar <marek.safar@gmail.com>
2551 A fix for bug #457087
2552 * generic.cs: Don't crash when constraint comes from type
2555 2008-12-16 Marek Safar <marek.safar@gmail.com>
2557 A fix for bug #459221
2558 * anonymous.cs, statement.cs: Delay only captured this
2561 2008-12-12 Marek Safar <marek.safar@gmail.com>
2563 A fix for bug #457489
2564 * anonymous.cs, statement.cs: Split anonymous storey instantiation
2565 and initialization to capture scope initializers correctly.
2567 2008-12-11 Marek Safar <marek.safar@gmail.com>
2569 * generic.cs, parameter.cs, expression.cs, statement.cs, doc.cs:
2570 ParameterReference refactoring.
2572 2008-12-03 Marek Safar <marek.safar@gmail.com>
2574 * typemanager.cs, namespace.cs, driver.cs: Allow ExtensionAttribute
2575 to be imported from any assembly.
2577 2008-12-03 Marek Safar <marek.safar@gmail.com>
2579 * parameter.cs, lambda.cs, linq.cs, iterators.cs, anonymous.cs
2580 statement.cs, class.cs, cs-parser.jay: Removed duplicate parameters
2581 from anonymous method and lambda expression.
2583 2008-12-01 Marek Safar <marek.safar@gmail.com>
2585 A fix for bug #448560
2586 * expression.cs (As): Box any generic type arguments to be
2589 2008-11-29 Raja R Harinath <harinath@hurrynot.org>
2591 Add tripwire for implicit conversion bugs
2592 * ecore.cs (MethodGroupExpr.Error_ArgumentCountWrong): New helper
2594 (MethodGroupExpr.OverloadResolve): Add sanity check between
2595 IsApplicable and VerifyArgumentsCompat.
2596 (VerifyArgumentsCompat): Report CS1501 where appropriate.
2598 2008-11-29 Raja R Harinath <harinath@hurrynot.org>
2600 Fix build break in System.Data_test
2601 * convert.cs (ImplicitConversionExists): Move NullLiteral
2603 (ImplicitStandardConversionExists): ... here.
2605 2008-11-28 Marek Safar <marek.safar@gmail.com>
2607 * literal.cs: Emit correctly explicit null to nullable cast.
2609 2008-11-28 Marek Safar <marek.safar@gmail.com>
2611 * ecore.cs, generics.cs: Fixed crash when type arguments fail to
2614 2008-11-28 Marek Safar <marek.safar@gmail.com>
2616 A fix for bug #449005
2617 * convert.cs, nullable.cs: Use only one implicit nullable
2620 2008-11-27 Marek Safar <marek.safar@gmail.com>
2622 * convert.cs, literal.cs: More Convert cleanup is needed.
2624 2008-11-27 Marek Safar <marek.safar@gmail.com>
2626 * decl.cs, class.cs: Fixed misleading error message.
2628 2008-11-26 Marek Safar <marek.safar@gmail.com>
2630 A fix for bug #449005
2631 * nullable.cs (EmitEquality): Disable optimization for user operator
2634 2008-11-25 Marek Safar <marek.safar@gmail.com>
2636 A fix for bug #447027
2637 * anonymous.cs (HoistedVariable): Cache also outer access to deal
2638 with context variables stored as expression instances.
2640 2008-11-25 Marek Safar <marek.safar@gmail.com>
2642 A fix for bug #447027
2643 * delegate.cs: Fixed delegate VerifyMethod logic.
2645 2008-11-24 Marek Safar <marek.safar@gmail.com>
2647 * ecore.cs, delegate.cs: MethodGroup expressions can be applicable
2650 2008-11-21 Marek Safar <marek.safar@gmail.com>
2652 * typemanager.cs, decl.cs, anonymous.cs, class.cs, enum.cs: Rewrote
2653 member type resolve to follow normal flow, instead of random
2656 2008-11-21 Marek Safar <marek.safar@gmail.com>
2658 * iterators.cs (GetEnumeratorStatement): Re-use already resolved
2661 2008-11-21 Marek Safar <marek.safar@gmail.com>
2663 * const.cs: Emit decimal array constant as literal.
2665 2008-11-20 Marek Safar <marek.safar@gmail.com>
2667 * iterators.cs, ecore.cs: Removed CurrentBlock statement.
2669 2008-11-19 Marek Safar <marek.safar@gmail.com>
2671 * eval.cs, location.cs, driver.cs (Location.SourceFiles): Turned
2672 into real property (saves 8 MB for corlib compilation).
2674 2008-11-19 Marek Safar <marek.safar@gmail.com>
2676 * generic.cs, lambda.cs, linq.cs, iterators.cs, anonymous.cs,
2677 nullable.cs, expression.cs, statement.cs, ecore.cs, cs-parser.jay
2678 generic-mcs.cs: Small cleanup of TypeArguments.
2680 2008-11-18 Marek Safar <marek.safar@gmail.com>
2682 * generic.cs, iterators.cs, anonymous.cs, nullable.cs, ecore.cs,
2683 expression.cs, namespace.cs, generic-mcs.cs, class.cs: Small cleanup
2684 of ConstructedType expression, renamed to GenericTypeExpr.
2686 2008-11-17 Marek Safar <marek.safar@gmail.com>
2688 A fix for bug #445303
2689 * location.cs (IsConditionalDefined): Handle undefined global
2692 2008-11-17 Marek Safar <marek.safar@gmail.com>
2694 A fix for bug #444678
2695 * expression.cs (TryReduceConstant): Always create new constant
2698 2008-11-17 Marek Safar <marek.safar@gmail.com>
2700 A fix for bug #444673
2701 * ecore.cs: Ignore open generic types when used as generic type
2704 2008-11-17 Marek Safar <marek.safar@gmail.com>
2706 A fix for bug #445458
2707 * expression.cs, cs-parser.jay: Don't crash when an expression
2710 2008-11-17 Marek Safar <marek.safar@gmail.com>
2712 A fix for bug #445464
2713 * expression.cs, cs-parser.jay: Fixed typeof of non-generic type
2714 inside unbound type.
2716 2008-11-14 Jb Evain <jbevain@novell.com>
2718 * driver.cs: ignore empty -nowarn argument such as
2719 the one in -nowarn:12,13,,.
2721 2008-11-13 Marek Safar <marek.safar@gmail.com>
2723 A fix for bug #444271
2724 * anonymous.cs: Rescan parent storeys when best candidate was
2727 2008-11-13 Marek Safar <marek.safar@gmail.com>
2729 * generic.cs, expression.cs, ecore.cs, cs-parser.jay: Removed
2730 useless UnboundTypeExpression.
2732 * attribute.cs: Do check obsolete attribute on generic types.
2734 2008-11-12 Marek Safar <marek.safar@gmail.com>
2736 A fix for bugs #425680, #400139
2737 * ecore.cs, expression.cs: Trying to do some almost_matched_members
2740 2008-11-11 Marek Safar <marek.safar@gmail.com>
2742 A fix for bug #435747
2743 * assign.cs, expression.cs: Cleanup New assignment to emit correcly
2744 compound value types assignment. Few micro optimizations added.
2746 2008-11-10 Marek Safar <marek.safar@gmail.com>
2748 A fix for bug #442610
2749 * anonymous.cs (MutateConstructor): More SRE hacking.
2751 2008-11-10 Marek Safar <marek.safar@gmail.com>
2753 A fix for bug #442579
2754 * ecore.cs: Also initialize expanded form of a method with 1 params
2757 2008-11-06 Marek Safar <marek.safar@gmail.com>
2759 * expression.cs (UnaryMutator): Do early l-side check.
2761 2008-11-05 Miguel de Icaza <miguel@novell.com>
2763 * codegen.cs (InitDynamic): also setup Assembly.Name like we do in
2764 Init, otherwise we would crash later on when checking for friend
2767 * eval.cs: Do not hide errors from invalid calls to LoadAssembly.
2768 Otherwise we never get any meaningful information as to what
2771 2008-11-05 Marek Safar <marek.safar@gmail.com>
2773 A fix for bug #436318
2774 * driver.cs, report.cs: Add -warnaserror:Wn to command line options.
2776 2008-11-05 Miguel de Icaza <miguel@novell.com>
2778 * namespace.cs: Turns out that it was a really bad idea to hide
2779 the errors for namespaces not found here in eval mode.
2781 * eval.cs: When we process using clauses, only enter those into
2782 the list of valid using clauses after they have been validated.
2784 The above change gives the proper semantics: it does not
2785 senselessly report the same errors with broken using statements by
2786 never storing them in the first place when they are invalid.
2788 2008-11-05 Marek Safar <marek.safar@gmail.com>
2790 A fix for bug #421839
2791 * cs-parser.jay: Remove expression from coalesce rule to force lower
2792 priority than the assignment operator.
2794 2008-11-05 Marek Safar <marek.safar@gmail.com>
2796 A fix for bug #437875
2797 * nullable.cs: Compile correctly method group operand used with null
2798 coalescing operator.
2800 2008-11-04 Marek Safar <marek.safar@gmail.com>
2802 A fix for bug #434589
2803 * expression.cs (Binary): Ignore lifted conversions when at least
2804 one operand is of reference type.
2806 2008-11-04 Marek Safar <marek.safar@gmail.com>
2808 * cs-parser.jay: Better syntax error report.
2810 2008-11-03 Marek Safar <marek.safar@gmail.com>
2812 A fix for bug #436792
2813 * cs-parser.jay: Use GetLocation to access location.
2815 2008-11-03 Marek Safar <marek.safar@gmail.com>
2817 A fix for bug #440774
2818 * cs-parser.jay: Also set current_array_type when parsing local
2821 2008-11-03 Marek Safar <marek.safar@gmail.com>
2823 A fix for bug #440785
2824 * expression.cs (As): Don't resolve self modifing expression
2827 2008-11-03 Marek Safar <marek.safar@gmail.com>
2829 A fix for bug #439447
2830 * cs-tokenizer.cs: Tokenize surrogates only where allowed.
2832 2008-11-03 Marek Safar <marek.safar@gmail.com>
2834 A fix for bug #437571
2835 * cs-parser.jay: Fixes internal error for invalid expression
2838 2008-10-17 Marek Safar <marek.safar@gmail.com>
2840 * ecore.cs: Resolve correctly ambiguous params delegate methods.
2842 2008-10-17 Marek Safar <marek.safar@gmail.com>
2844 * generic.cs, anonymous.cs: Simplified GetDeclarations.
2846 2008-10-17 Marek Safar <marek.safar@gmail.com>
2848 * cs-tokenizer.cs: More precise cast parsing.
2850 2008-10-16 Martin Baulig <martin@ximian.com>
2852 * anonymous.cs (AnonymousMethodStorey): Put back the
2853 `hoisted_locals' hashtable and use it in EmitType().
2855 2008-10-15 Marek Safar <marek.safar@gmail.com>
2857 * cs-tokenizer.cs, nullable.cs, expression.cs, statement.cs,
2858 cs-parser.jay: Tokenizer optimizations and memory reduction, saves
2861 2008-10-14 Marek Safar <marek.safar@gmail.com>
2863 * cs-tokenizer.cs: Add bool type to the list of valid cast tokens.
2865 2008-10-14 Marek Safar <marek.safar@gmail.com>
2867 * statement.cs: Mutate scope initializers.
2869 2008-10-14 Marek Safar <marek.safar@gmail.com>
2871 * expression.cs: Use typeless value for This constant.
2873 * ecore.cs: Access FieldInfo via GetConstructedFieldInfo.
2875 2008-10-14 Marek Safar <marek.safar@gmail.com>
2877 * cs-tokenizer.cs, cs-parser.jay: Unify context sensite keyword
2880 2008-10-13 Marek Safar <marek.safar@gmail.com>
2882 * cs-tokenizer.cs: Add missing alias qualifier and dotted generic
2885 2008-10-13 Marek Safar <marek.safar@gmail.com>
2887 * cs-tokenizer.cs, expression.cs, cs-parser.jay: Reworked parens
2888 parser and tokenizer. Fixes many ambiguities including #433258.
2890 2008-10-10 Marek Safar <marek.safar@gmail.com>
2892 * cs-parser.jay: Fixed missing accessor recovery.
2894 2008-10-10 Marek Safar <marek.safar@gmail.com>
2896 A fix for bug #433701
2897 * expression.cs: Better error message.
2899 2008-10-10 Marek Safar <marek.safar@gmail.com>
2901 * cs-parser.jay, expression.cs: Start reporting real parser errors.
2903 * Makefile: Disabled unused debug symbols.
2905 Also fixes: #320556, #321097, #321656, #321876, #351316
2907 2008-10-09 Miguel de Icaza <miguel@novell.com>
2909 * eval.cs: rename "<interactive>" to "{interactive}", to work
2910 around a requirement in the compiler that this be a valid
2911 filename, and in Windows it is not (433886).
2913 2008-10-09 Marek Safar <marek.safar@gmail.com>
2915 * cs-tokenizer.cs, cs-parser.jay: Fixed more subtle parser problems
2917 2008-10-08 Marek Safar <marek.safar@gmail.com>
2919 * cs-tokenizer.cs, eval.cs, anonymous.cs, statement.cs, class.cs
2920 cs-parser.jay: Generic type declaration and type arguments cleanup.
2922 2008-10-05 Marek Safar <marek.safar@gmail.com>
2924 * cs-parser.jay: Allow parsing weird array creation construct.
2926 2008-10-05 Marek Safar <marek.safar@gmail.com>
2928 * cs-parser.jay: Conflicts reduction.
2930 2008-10-04 Marek Safar <marek.safar@gmail.com>
2932 * cs-parser.jay: Conflicts reduction.
2934 2008-10-04 Raja R Harinath <harinath@hurrynot.org>
2937 * flowanalysis.cs (MyBitvector.MakeShared): Rename from 'Shared'
2938 property. Add a 'count' hint about the use of the shared vector.
2939 Ensure that we don't leak out dirty bits.
2940 (UsageVector.MergeChild): Throw away information about variables
2942 Based on patch and analysis by Moritz Kroll <Moritz.Kroll@gmx.de>.
2944 2008-10-03 Marek Safar <marek.safar@gmail.com>
2946 A fix for bug #431746
2947 * iterators.cs, anonymous.cs: Re-initialize hoisted iterator
2948 parameters when iterator is created.
2950 2008-10-03 Marek Safar <marek.safar@gmail.com>
2952 A fix for bug #431827
2953 * expression.cs: Fixed right based pointer arithmetic operations
2956 2008-10-03 Marek Safar <marek.safar@gmail.com>
2958 A fix for bug #353779
2959 * assign.cs, expression.cs: Fixed compound assignment conversions.
2961 2008-10-02 Marek Safar <marek.safar@gmail.com>
2963 A fix for bug #375262
2964 * statement.cs: Refactor ArrayForeach to be usable with string
2965 indexer. Optimized single dimentional arrays foreach.
2967 2008-10-02 Marek Safar <marek.safar@gmail.com>
2969 A fix for bug #431255
2970 * anonymous.cs, expression.cs: Removed broken optimization.
2972 2008-10-01 Marek Safar <marek.safar@gmail.com>
2974 * anonymous.cs: Use full type parameters of parent generic
2975 containers. Removed unnecessary AddParentStoreyReference call.
2977 2008-10-01 Marek Safar <marek.safar@gmail.com>
2979 A fix for bug #324702
2980 * class.cs: Use better shorter names for explicit interface member
2983 * ecore.cs, typemanager.cs: Convert only mscorlib predefined names.
2985 2008-10-01 Marek Safar <marek.safar@gmail.com>
2987 * expression.cs: Use new interface to check fixed expression.
2989 2008-10-01 Marek Safar <marek.safar@gmail.com>
2991 A fix for bug #421101
2992 * expression.cs, statement.cs, ecore.cs: Use IFixedExpression
2993 interface to check for fixed fixed-buffers.
2995 2008-10-01 Marek Safar <marek.safar@gmail.com>
2997 A fix for bug #429264
2998 * assign.cs, anonymous.cs, ecore.cs: More type mutators added.
3000 * delegate.cs: Removed unnecessary casts.
3002 2008-09-30 Marek Safar <marek.safar@gmail.com>
3004 A fix for bug #352151
3005 * decl.cs, iterators.cs, anonymous.cs, report.cs, namespace.cs,
3006 class.cs: Fixed already defined explicit interface members check.
3008 2008-09-29 Rodrigo Kumpera <rkumpera@novell.com>
3010 cs-tokenizer.cs: Fix typo.
3012 2008-09-28 Miguel de Icaza <miguel@novell.com>
3014 * eval.cs (InteractiveBase): The quit command now just sets a
3015 flag, instead of calling Environment.Exit(), it is milder on
3018 CompiledMethod is now in Mono.CSharp, not nested inside
3019 the Evaluator, it was inconvenient to use.
3021 2008-09-27 Miguel de Icaza <miguel@novell.com>
3023 * eval.cs (Evaluator): Introduce Compile method, to allow compiled
3024 code to be invoked without having to reparse.
3026 2008-09-27 Miguel de Icaza <miguel@novell.com>
3028 * ecore.cs: The recent changes to FieldExpr broke this as well.
3029 Fixes LINQ queries in the interactive shell.
3031 * Multiple files: indentation fixing for the Mono coding
3032 guidelines for the switch statement.
3034 * eval.cs: Make the Evaluator API thread safe.
3036 2008-09-26 Marek Safar <marek.safar@gmail.com>
3038 * anonymous.cs, statement.cs, class.cs, cs-parser.jay: Simplified
3039 constructor parsing.
3041 2008-09-26 Marek Safar <marek.safar@gmail.com>
3043 A fix for bug #325326
3044 * statement.cs: Check possible mistaken empty statement using
3045 explicit blocks only.
3047 2008-09-25 Miguel de Icaza <miguel@novell.com>
3049 * eval.cs (LoadAssembly, ReferenceAssembly): Call
3050 RootNamespace.ComputeNamespaces to update the internal list of
3051 namespaces, this is no longer done for us.
3053 (InteractiveBase): Use the Evaluator APIs instead of calling into
3056 2008-09-25 Marek Safar <marek.safar@gmail.com>
3058 A fix for bug #429264
3059 * expression.cs: Missing mutator for access to multidimensional
3062 2008-09-25 Marek Safar <marek.safar@gmail.com>
3064 * class.cs, statement: Emit DebuggerHidden attribute for iterator
3067 * driver.cs: Missing input argument check.
3069 2008-09-25 Marek Safar <marek.safar@gmail.com>
3071 * typemanager.cs, generic.cs, eval.cs, decl.cs, anonymous.cs,
3072 expression.cs, statement.cs, rootcontext.cs, class.cs,
3073 cs-parser.jay, driver.cs, generic-mcs.cs, enum.cs: Removed obsolete
3076 2008-09-24 Miguel de Icaza <miguel@novell.com>
3078 * ecore.cs (FieldExpr): Only initialize eclass when we return a
3079 fully constructed FieldExpr, fixes the regression introduced in
3082 * ecore.cs, expression.cs: Plug back the eclass initialization as
3083 otherwise it regresses `csharp'.
3085 2008-09-24 Marek Safar <marek.safar@gmail.com>
3087 * typemanager.cs, decl.cs, convert.cs, assign.cs, expression.cs,
3088 ecore.cs, attribute.cs: Moved obsolete method checks from emit
3089 phase to resolve phase. It resolves problems with expression trees
3090 and fixes bugs #323796, #325156.
3092 2008-09-23 Marek Safar <marek.safar@gmail.com>
3094 * codegen.cs: Report better error when symbol writer is missing.
3096 2008-09-23 Marek Safar <marek.safar@gmail.com>
3098 * codegen.cs: Set .NET symbol writer.
3100 * decl.cs: Guard against null generic arguments.
3102 * report.cs: Don't report exactly same additional details.
3104 2008-09-22 Marek Safar <marek.safar@gmail.com>
3106 A fix for bug #324917
3107 * cs-parser.jay: Add missing multidimensional non-expression type
3110 2008-09-22 Marek Safar <marek.safar@gmail.com>
3112 A fix for bug #428191
3113 * anonymous.cs: Create an outer generic fields also for non-storey
3116 2008-09-22 Marek Safar <marek.safar@gmail.com>
3118 A fix for bug #378294
3119 * class.cs: Make fixed size buffers gmcs feature only.
3121 2008-09-22 Marek Safar <marek.safar@gmail.com>
3123 A fix for bug #355622, #324993
3124 * assign.cs, const.cs, class.cs: Create new EmitContext for each
3127 2008-09-19 Marek Safar <marek.safar@gmail.com>
3129 * nullable.cs, expression.cs, namespace.cs, delegate.cs: Duplicate
3132 2008-09-19 Marek Safar <marek.safar@gmail.com>
3134 A fix for bug #416110
3135 * generic.cs: Struct constraint results in default ctor and
3136 ValueType base type constraint to be set.
3138 2008-09-19 Marek Safar <marek.safar@gmail.com>
3140 A fix for bug #423791
3141 * generic.cs: Fixed params output type type-inference.
3143 2008-09-19 Marek Safar <marek.safar@gmail.com>
3145 * cs-parser.jay, expression.cs: Fixed few expression crashes.
3147 2008-09-19 Marek Safar <marek.safar@gmail.com>
3149 * cs-tokenizer.cs: Don't break on extra partial modifier.
3151 2008-09-19 Marek Safar <marek.safar@gmail.com>
3153 A fix for bug #427592
3154 * generic.cs: Use common parameter resolve method.
3156 2008-09-18 Marek Safar <marek.safar@gmail.com>
3158 A fix for bug #414758
3159 * expression.cs, ecore.cs: Fixed crash when accessing non-static
3162 2008-09-18 Marek Safar <marek.safar@gmail.com>
3164 * driver.cs, namespace.cs: Read types and namespaces after all
3165 requested assemblies are loaded, fixes issues with System.Core
3166 auto-reference, and #419888.
3168 2008-09-18 Marek Safar <marek.safar@gmail.com>
3170 A fix for bug #417705
3171 * cs-parser.jay: Fixed as/is operator expression split.
3173 2008-09-18 Marek Safar <marek.safar@gmail.com>
3175 * const.cs, expression.cs, statement.cs, ecore.cs, cs-parser.jay:
3176 Fixed expression tree representation of empty new expression and
3177 new initializer expression.
3179 2008-09-18 Miguel de Icaza <miguel@novell.com>
3181 * eval.cs: Remove warning, keep reference to driver around.
3183 * Hide fields that do not need to be public.
3185 2008-09-17 Marek Safar <marek.safar@gmail.com>
3187 A fix for bug #426385
3188 * expression.cs (ImplicitlyTypedArrayCreation): Use full implicit
3189 conversion for array elements.
3191 2008-09-17 Marek Safar <marek.safar@gmail.com>
3193 * expression.cs, statement.cs, class.cs, cs-parser.jay: Fixed
3194 void parsing conflicts.
3196 2008-09-15 Marek Safar <marek.safar@gmail.com>
3198 A fix for bug #425601
3199 * driver.cs, typemanager.cs, namespace.cs: Automatically reference
3200 System.Core only when there is no custom ExtensionAttribute
3203 2008-09-15 Miguel de Icaza <miguel@novell.com>
3205 * namespace.cs: Do not report CS0246 (name
3207 2008-09-12 Marek Safar <marek.safar@gmail.com>
3209 A fix for bug #425669
3210 * generic.cs: Don't cache generic static anonymous method
3213 2008-09-12 Marek Safar <marek.safar@gmail.com>
3215 * generic.cs, class.cs, delegate.cs: Check recursive inherited
3216 conflicting constraints.
3218 2008-09-12 Raja R Harinath <harinath@hurrynot.org>
3220 * cs-tokenizer.cs (consume_identifier): Allow partial methods in
3223 2008-09-12 Marek Safar <marek.safar@gmail.com>
3225 * literal.cs, convert.cs, expression.cs, statement.cs: More null
3226 to null pointer conversion fixes.
3228 2008-09-11 Marek Safar <marek.safar@gmail.com>
3230 * cs-parser.jay, expression.cs: An implicitly typed local variable
3231 declarator cannot use an array initializer.
3233 2008-09-11 Marek Safar <marek.safar@gmail.com>
3235 * cs-parser.jay: Reduced number of printed tokens, add sorting.
3237 2008-09-11 Marek Safar <marek.safar@gmail.com>
3239 * generic.cs (InflatedConstraints): Don't crash when constraints
3242 * cs-parser.jay: const_declarator is a block.
3244 * constant.cs: Check for not allowed NaN conversions.
3246 2008-09-10 Miguel de Icaza <miguel@novell.com>
3248 * driver.cs: Drop --shell argument, the compiler is no longer a
3251 * eval.cs: Move most of the code that deals with evaluation into
3252 this file and document the public API from repl.cs
3254 * repl.cs: Remove from here.
3256 2008-09-10 Marek Safar <marek.safar@gmail.com>
3258 A fix for bug #424684
3259 * generic.cs: Generic class constraints must come first.
3261 2008-09-09 Miguel de Icaza <miguel@novell.com>
3263 * cs-parser.jay: Improve error reporting for syntax errors in
3264 statements and expressions, we now report the expected tokens
3265 instead of reporting the useless "; expected".
3267 Drop the strings from the token declaration, it turns out that
3268 they did not do what I thought they did. Instead they were adding
3269 two sets of tokens to the tables.
3271 2008-09-09 Marek Safar <marek.safar@gmail.com>
3273 * typemanager.cs, generic.cs, parameter.cs, expression.cs, class.cs,
3274 delegate.cs: Share special type check.
3276 2008-09-09 Marek Safar <marek.safar@gmail.com>
3278 A fix for bug #423981
3279 * expression.cs (EmitBranchable): Correctly emit inverted float conditions.
3281 2008-09-09 Marek Safar <marek.safar@gmail.com>
3283 * ecore.cs (ReducedConstantExpression): Implemented ConvertExplicitly and
3286 2008-09-09 Marek Safar <marek.safar@gmail.com>
3288 A fix for bugs: #324750, #335946
3289 * cs-tokenizer.cs, cs-parser.jay, expression.cs: Use a custom
3290 lookup rule to determine ?-based tokens.
3292 2008-09-08 Miguel de Icaza <miguel@novell.com>
3294 * repl.cs (OptionalAssign.EmitStatement): It is possible that some
3295 expressions (like event adding or removing) end up here, so we
3296 need to treat those as statements.
3298 Add LoadAssembly method.
3300 2008-09-04 Miguel de Icaza <miguel@novell.com>
3302 * repl.cs: Add Time method.
3304 2008-09-05 Marek Safar <marek.safar@gmail.com>
3306 * cs-tokenizer.cs: Fixed swaped UTF-16 surrogates parsing.
3308 2008-09-05 Miguel de Icaza <miguel@novell.com>
3310 * repl.cs: Add workaround for old compilers.
3312 2008-09-04 Jb Evain <jbevain@novell.com>
3314 * repl.cs (PrettyPrint): pretty print everything that
3315 implements IDictionary, as well as IEnumerables. Also,
3316 add a quit helper property.
3318 2008-09-04 Marek Safar <marek.safar@gmail.com>
3320 * constant.cs: Better error reporting for decimal literals.
3322 * class.cs, attribute.cs, typemanager.cs: Emit more fixed buffer
3325 2008-09-04 Marek Safar <marek.safar@gmail.com>
3326 Miguel de Icaza <miguel@novell.com>
3328 A fix for bug #422951
3329 * assign.cs (Assign.DoResolve): Perform the type conversions
3330 checks before we attempt to initialize `New' initializers.
3332 2008-09-04 Marek Safar <marek.safar@gmail.com>
3334 A fix for bug #422853
3335 * delegate.cs (DelegateCreation): Add special handling for
3336 EmptyExpression.Null instance expression which is just another
3337 hack for undecided member instance exression.
3339 2008-09-04 Marek Safar <marek.safar@gmail.com>
3341 * expression.cs, ecore.cs: Emit full expression tree for reduced
3344 2008-09-04 Marek Safar <marek.safar@gmail.com>
3346 * expression.cs (This): Guard against multi-resolving.
3348 * ecore.cs, statement.cs (Throw): Simplified.
3350 * flowanalysis.cs: Also verify event fields.
3352 2008-09-04 Miguel de Icaza <miguel@novell.com>
3354 * assign.cs (Assign.DoResolve): Perform the type conversions
3355 checks before we attempt to initialize `New' initializers.
3357 * repl.cs (PrettyPrint): Add Hashtable prettyprint
3359 * anonymous.cs (AnonymousTypeClass): On EvalMode make the class
3362 * repl.cs: Update help.
3364 2008-09-03 Miguel de Icaza <miguel@novell.com>
3366 * driver.cs (ProcessDefaultConfig): Now it encapsulates all the
3367 handling of the default config handling, including the special
3368 treatment of System.Core assembly.
3370 Fixes the REPL processing for LINQ.
3372 2008-09-03 Marek Safar <marek.safar@gmail.com>
3374 A fix for bug #422507
3375 * expression.cs (UnboxCast): Add missing child expression mutator.
3377 2008-09-03 Marek Safar <marek.safar@gmail.com>
3379 * driver.cs: Don't self reference System.Core assembly.
3381 2008-09-03 Marek Safar <marek.safar@gmail.com>
3383 A fix for bug #422507
3384 * expression.cs (StringConcat): Add missing type mutator.
3386 2008-09-03 Marek Safar <marek.safar@gmail.com>
3388 * generic.cs (TypeInferenceContext): Follow equality rule for
3389 constructed type lower bound type inference.
3391 2008-09-02 Miguel de Icaza <miguel@novell.com>
3393 * getline.cs (CmdRefresh): Apply patch from Douglas S. Blank
3394 <dblank@cs.brynmawr.edu> which updates the cursor position on
3397 2008-09-02 Marek Safar <marek.safar@gmail.com>
3399 A fix for bug #367145
3400 * driver.cs: Fixed import of extension methods when using -noconfig
3403 2008-09-02 Marek Safar <marek.safar@gmail.com>
3405 * iterator.cs: Don't emit GetEnumerator method twice but call a generic
3406 version from non-generic implementation instead.
3408 2008-09-01 Marek Safar <marek.safar@gmail.com>
3410 A fix for bug #418908
3411 * class.cs: Use AddScopeStatement for field initializers.
3413 2008-09-01 Marek Safar <marek.safar@gmail.com>
3415 A fix for bug #415385
3416 * ecore.cs, convert.cs: Do method group conversion for equal group types.
3418 2008-09-01 Marek Safar <marek.safar@gmail.com>
3420 A fix for bug #421736
3421 * iterators.cs: Don't crash on unreachable iterators.
3423 2008-09-01 Marek Safar <marek.safar@gmail.com>
3425 A fix for bug #421628
3426 * parameter.cs, attribute.cs: Clone also parameter attributes.
3428 2008-08-30 Miguel de Icaza <miguel@novell.com>
3430 * namespace.cs (LookupType): In EvalMode, try to replace
3431 the TypeBuilder from our cache with a Type as Reflection.Emit does
3432 not like to mix code from older assemblies emitted and new
3435 This sounds like a serious Mono bug that prevents multiple
3436 assemblies to be generated and consumed at the same time.
3438 * cs-parser.jay (push_current_class): Do not make interactive
3439 classes internal or private, make them public as we currently
3440 generate each new class in a new assembly.
3442 2008-08-29 Miguel de Icaza <miguel@novell.com>
3444 * decl.cs, roottypes.cs, class.cs:: Add an infrastructure to
3445 remove types that are entered into the global namespace during
3446 parsing so that we can remove them on failure.
3448 * cs-parser.jay: Parsing: we now keep track of types that are
3449 entered into global variables and queue those in case the parsing
3452 This happens in a few situations: during partial-input, we invoke
3453 the parser repeatedly for example with the string "class X", this
3454 would cause X to be registed, and we need to remove this
3455 registration so that another parse attempt later with say "class X {"
3456 would actually work.
3458 Additionally, if there is an error in the resolution phase, for
3459 example: "class X : NonExistant {}" th
3461 * cs-parser.jay: Be more precise with the errors being raised,
3462 instead of flagging all exceptions during parsing to be attributed
3463 to the parsing process, distinguish those from errors happening in
3464 the actions and hint that using -v would produce the actual
3467 * repl.cs: Do not load all compiler references on each reset,
3468 doing the partial reset takes care of this.
3470 2008-08-28 Miguel de Icaza <miguel@novell.com>
3472 * repl.cs: Add support for loading all the files from
3473 ~/.config/csharp/*cs as startup scripts and ~/.config/csharp/*.dll
3476 Introduce a micro-parser that is able to deambiguate on its input
3477 whether we are dealing with a compilation unit (namespace, class,
3478 interface, struct, delegate) declaration or a statement. This
3479 allows both declarations and statements to be entered.
3481 Set history size by default to 300 lines.
3483 Instead of distinguishing based on the parser.InteractiveResult,
3484 have only two cases: statements were parsed, or a compilation unit
3485 was. Always pull the Using statement additions from the
3486 compilation unit parse.
3488 * cs-tokenizer.cs: Rename tokens to better describe their intent
3489 (EvalStatementParserCharacter and EvalCompilationUnitParserCharacter).
3491 * rootcontext.cs: Split EvalMode into EvalMode and StatementMode.
3492 EvalMode is used to trigger the lookup of global variables while
3493 StatementMode is used turn variable declarations into static
3496 * getline.cs: Allow history size to be set.
3498 2008-08-29 Marek Safar <marek.safar@gmail.com>
3500 A fix for bug #360755
3501 * ecore.cs (SimpleName): Exclude indexers from simple name resolve.
3503 2008-08-29 Marek Safar <marek.safar@gmail.com>
3505 * generic.cs, iterators.cs, codegen.cs: Removed unused variable.
3507 * typemanager.cs, statement.cs, ecore.cs, enum.cs: Don't reconstruct enum
3508 member name, it is too confusing
3510 * decl.cs, class.cs: Don't report unused fields with attached attribute.
3512 * rootcontext.cs: Finally default to warning level 4.
3514 2008-08-28 Marek Safar <marek.safar@gmail.com>
3516 * class.cs (CheckBase): Ignore overloaded operators.
3518 2008-08-28 Marek Safar <marek.safar@gmail.com>
3520 A fix for bug #420830
3521 * expression.cs, cs-parser.jay: Put back InvocationOrCast expression.
3523 2008-08-28 Marek Safar <marek.safar@gmail.com>
3525 A fix for bug #420832
3526 * anonymous.cs, iterators.cs: Also clone hoisted this iterator variable.
3528 2008-08-28 Marek Safar <marek.safar@gmail.com>
3530 A fix for bug #420386
3531 * nullables.cs: Fixed logic of nullable user comparison operators involving
3534 2008-08-28 Marek Safar <marek.safar@gmail.com>
3536 * attribute (IsClsCompliant): Use FALSE value for pointer types.
3538 2008-08-27 Miguel de Icaza <miguel@novell.com>
3540 * repl.cs: Add support for aborting the running code with C-c.
3542 2008-08-27 Raja R Harinath <harinath@hurrynot.org>
3544 * cs-parser.jay (CS1002): Dump 'yyToken' with Report.ExtraInformation.
3546 2008-08-27 Miguel de Icaza <miguel@novell.com>
3548 * cs-parser.jay (interactive_statement_list): A new set of rules
3549 for hosting statements that uses the "interactive_" prefix.
3551 * repl.cs: Add support for parsing `using' as a statement or as a
3552 directive. Deambiguating before passing this to the parser.
3554 We need to distinguish statement_expressions that occur at the
3555 toplevel vs those that occur embedded into expressions.
3557 * getline.cs: Applied patch from Stuart Carnie <stuart.carnie@gmail.com>
3558 that fixes the cursor key handling, and a history bug.
3560 2008-08-26 Miguel de Icaza <miguel@novell.com>
3562 * Makefile: Drop BOOTSTRAP_COMPILER as that was masking the
3563 limitations in Console, instead the 2.0 bootstrap libraries now
3564 include the Console bits.
3566 Also, remove the use of Nullables from getline.cs
3570 Interactive support for the C# compiler. Use gmcs --shell to
3571 enter a read-eval-print loop shell.
3573 Docs: http://www.mono-project.com/CsharpRepl
3575 * sources: include repl.cs here and getline.cs for gmcs.exe,
3576 everything else is getline.cs impaired.
3578 * Makefile: when bootstrapping pass a special flag
3579 BOOTSTRAP_COMPILER which we use to prevent failures in compilation
3580 as we use NET_2_0 define to pull 2.0 APIs from System.Console.
3581 This distinguishes those two cases.
3583 * repl.cs: Support for a read-eval-print loop. Will be soon
3584 refactored into eval support and then REPL on top of it.
3586 * ecore.cs: If a simplename lookup fails, before erroring out,
3587 if we are in EvalMode to resolve the name to a declaration in the
3590 This means that variable declarations that happened in previous
3591 classes (as repl puts every statement in a separate class) are
3592 made visible in this way.
3594 * cs-parser.jay: UnexpectedEOF, a new flag that is set if we
3595 triggered an error due to the end of file being reached. This is
3596 used to do multi-line input, and notify the caller that the user
3597 needs to provide more text before a successful parse.
3599 Add new grammar rules after the INTERACTIVE_PARSER token is seen
3600 to drive the evaluation with a custom wrapper.
3602 * driver.cs: Add support for --shell, and refactor some code to be
3605 * namespace.cs: Add support for serializing the contents of the
3606 namespaces and reloading them.
3608 * getline.cs: A managed implementation of ReadLine under
3609 X11/Apache2 license terms. Easy to embed in other applications as
3612 * namespace.cs: Add some functions to save and restore the
3615 * rootcontext.cs: New public field.
3617 * cs-tokenizer.cs: Add support for one of the possible characters
3618 we introduce into the token stream.
3620 This patch does not affect the regular tokenization process, the
3621 only performance hit would happen if there is an invalid character
3622 on the input string.
3624 * support.cs: Move isatty helper routine here.
3626 * codegen.cs: Small cleanup, and add a mechanism to initialize the
3627 code generator for in-memory assemblies.
3629 2008-08-26 Marek Safar <marek.safar@gmail.com>
3631 * generic.cs, ecore.cs, delegate.cs, cs-parser.jay, expression.cs: A type
3632 parameter cannot be always used as a type.
3634 2008-08-21 Marek Safar <marek.safar@gmail.com>
3636 * convert.cs, expression.cs: Use single ExplicitReferenceConversion routine.
3638 2008-08-21 Marek Safar <marek.safar@gmail.com>
3640 * convert.cs: Implement explicit array to IList<T> conversion.
3642 2008-08-20 Marek Safar <marek.safar@gmail.com>
3644 A fix for bug #362740
3645 * cs-tokenizer.cs: Handle UTF-16 surrogates.
3647 2008-08-20 Marek Safar <marek.safar@gmail.com>
3649 * generic.cs, support.cs, typemanager.cs, lambda.cs, parameter.cs,
3650 pending.cs, ecore.cs, linq.cs, class.cs, decl.cs, delegate.cs,
3651 flowanalysis.cs, iterators.cs, cs-parser.jay, convert.cs, anonymous.cs,
3652 expression.cs, attribute.cs, statement.cs, doc.cs: Refactored parameters
3653 handling to use just one type of infrastructure and deal with generics
3656 2008-07-23 Martin Baulig <martin@ximian.com>
3658 *** Merged this from trunk revision 108527 ***
3661 (ExplicitBlock.EmitSymbolInfo): Moved to `ToplevelBlock'.
3662 (ToplevelBlock.EmitSymbolInfo): Tell the symbol writer about the
3665 2008-08-15 Marek Safar <marek.safar@gmail.com>
3667 * ecore.cs, linq.cs, const.cs, expression.cs, statement.cs: More robust
3670 2008-08-15 Marek Safar <marek.safar@gmail.com>
3672 * delegate.cs: Fixed compiler crash when creating delegate using partial
3675 * typemanager.cs: MulticastDelegate is not a delegate.
3677 2008-08-14 Marek Safar <marek.safar@gmail.com>
3679 * expression.cs, ecore.cs, anonymous.cs, class.cs: Fixed missing error
3682 2008-08-14 Raja R Harinath <harinath@hurrynot.org>
3684 * cs-parser.jay (type): Allow 'var' in mcs too.
3685 (local_variable_type): Likewise.
3687 2008-08-14 Marek Safar <marek.safar@gmail.com>
3689 * driver.cs: Removed broken -noconfig variants.
3691 2008-08-14 Marek Safar <marek.safar@gmail.com>
3693 A fix for bug #417078
3694 * expression.cs: Emit correctly left side pointer operators.
3696 2008-08-13 Marek Safar <marek.safar@gmail.com>
3698 * generic.cs, lambda.cs: Inflate method generic arguments only.
3700 2008-08-12 Marek Safar <marek.safar@gmail.com>
3702 * class.cs: Fixed struct layout check regression.
3704 2008-08-12 Marek Safar <marek.safar@gmail.com>
3706 * cs-parser.jay, enum.cs: Simplified enum parsing.
3708 * decl.cs: Check all type parameters conflicts.
3710 * expression.cs, statement.cs, attribute.cs: More expression checks.
3712 2008-08-11 Marek Safar <marek.safar@gmail.com>
3714 * generic.cs: Add type inference types restriction.
3716 * parameter.cs, class.cs, delegate.cs, iterators.cs, cs-parser.jay,
3717 anonymous.cs, expression.cs: Allocate less accessor parameters.
3719 2008-08-08 Marek Safar <marek.safar@gmail.com>
3721 * typemanager.cs, ecore.cs: Ambiguous operators can come from different
3724 2008-08-08 Marek Safar <marek.safar@gmail.com>
3726 * convert.cs, delegate.cs: Fixed delegate compatibility conversion.
3728 2008-08-07 Marek Safar <marek.safar@gmail.com>
3730 * class.cs, decl.cs, iterator.cs, ecore.cs: Refactor base type resolving.
3731 Also fixes #362146 and #381592.
3733 2008-08-07 Marek Safar <marek.safar@gmail.com>
3735 * ecore.cs: Reduced constant cannot be used as an attribute value.
3737 * cs-parser.jay: Base expression has to be a type.
3739 * expression.cs (Conditional): Uses ReducedExpression.
3741 2008-08-06 Marek Safar <marek.safar@gmail.com>
3743 A fix for bug #376826
3744 * parameter.cs, ecore.cs, anonymous.cs, expression.cs, statement.cs: An
3745 address of hoisted local variable or parameter cannot be taken.
3747 2008-08-05 Marek Safar <marek.safar@gmail.com>
3749 * ecore.cs, constant.cs, expression.cs, statement.cs: Resolve correctly
3750 anonymous method inside checked/unchecked expression.
3752 2008-08-05 Marek Safar <marek.safar@gmail.com>
3754 * typemanager.cs (IsEqual): Guard against null.
3756 * ecore.cs, class.cs, convert.cs, const.cs, constant.cs, expression.cs,
3757 attribute.cs, enum.cs, statement.cs: Pass EmitContext to constant conversion
3758 routine. Fixed few misleading conversion errors.
3760 2008-08-04 Marek Safar <marek.safar@gmail.com>
3762 * class.cs: Consider generics when checking cycles in struct layout.
3764 2008-08-04 Raja R Harinath <harinath@hurrynot.org>
3766 * cs-tokenizer.cs (get_cmd_arg): Simplify. Don't be too pedantic.
3768 2008-08-04 Marek Safar <marek.safar@gmail.com>
3770 A fix for bug #414165
3771 * anonymous.cs: Use same anonymous implementation method for all anonymous
3774 2008-08-04 Marek Safar <marek.safar@gmail.com>
3776 * generic.cs, anonymous.cs, statement.cs: Emit inherited anonymous method
3779 2008-08-04 Marek Safar <marek.safar@gmail.com>
3781 * cs-parser.jay: Typeof argument has to be a type expression.
3783 * namespace.cs: Check alias and namespace definitions collisions.
3785 * class.cs, pending.cs: Moved explicit interface accessor implementation
3788 * delegate.cs, expression.cs: Verify special name invocations.
3790 2008-08-01 Marek Safar <marek.safar@gmail.com>
3792 * cs-parser.jay: Don't choke on empty generic type arguments.
3794 * cs-tokenizer.cs: Handle escaped preprocessor directives.
3796 * expression.cs, ecore.cs: Minor expressions bugs.
3798 2008-08-01 Marek Safar <marek.safar@gmail.com>
3800 * cs-parser.jay: Removed duplicate interface declaration (fixes 2 conflicts)
3801 and added more error handling.
3803 * class.cs, iterators.cs, anonymous.cs: Removed useless interface parameter.
3805 * modifiers.cs, enum.cs: Fixed.
3807 2008-07-31 Jb Evain <jbevain@novell.com>
3809 * driver.cs: remove -pkg ability of smcs.
3811 2008-07-30 Marek Safar <marek.safar@gmail.com>
3813 * statement.cs (Switch): Correctly set empty default target for single
3816 2008-07-30 Marek Safar <marek.safar@gmail.com>
3818 * typemanager.cs, assign.cs, driver.cs, expression.cs, statement.cs: Rewrote
3819 string switch statement implementation to use string dictionary which
3820 significantly (2-8x) improves performance of generated code.
3822 2008-07-29 Marek Safar <marek.safar@gmail.com>
3824 A fix for bug #412880 by Atsushi Enomoto <atsushi@ximian.com>
3825 * modifiers.cs (GetDescription): Fixed FamANDAssem case.
3827 2008-07-29 Marek Safar <marek.safar@gmail.com>
3829 A fix for bug #412595
3830 * typemanager.cs, convert.cs, expression.cs: Some types are never
3831 convertible to each other.
3833 2008-07-29 Marek Safar <marek.safar@gmail.com>
3835 * nullable.cs (CreateNullConstant): An error messages update.
3837 2008-07-29 Marek Safar <marek.safar@gmail.com>
3839 A fix for bug #412595
3840 * cfold.cs: Don't cast undefined bool constant.
3842 2008-07-29 Martin Baulig <martin@ximian.com>
3845 (SymbolWriter.Reset): New public static method.
3848 (CompilerCallableEntryPoint.Reset): Call SymbolWriter.Reset().
3850 2008-07-28 Marek Safar <marek.safar@gmail.com>
3852 * cs-tokenizer.cs (IsLambdaOpenParens): Optimized using more stop tokens.
3854 * expression.cs (ElementAccess): Exact size allocation.
3856 2008-07-26 Marek Safar <marek.safar@gmail.com>
3858 * driver.cs: Replaced outdated UnixParseOption with CSCParseOption.
3860 2008-07-25 Marek Safar <marek.safar@gmail.com>
3862 * flowanalysis.cs (StructInfo): Fixed detection of dynamic types.
3864 * class.cs: Removed $PRIVATE$ field hack which caused problems during
3867 2008-07-25 Marek Safar <marek.safar@gmail.com>
3869 A fix for bug #412217
3870 * assign.cs: Mutate also assignment type.
3872 2008-07-25 Marek Safar <marek.safar@gmail.com>
3874 A fix for bug #323644
3875 * typemanager.cs (IsValidProperty): Verify DefaultMemberName when checking
3878 2008-07-25 Marek Safar <marek.safar@gmail.com>
3880 A fix for bug #412134
3881 * expression.cs (ResolveOperatorEnum): Do implicit conversion of
3882 non-enumerable operands when overloading equality or bitwise operators.
3884 2008-07-25 Marek Safar <marek.safar@gmail.com>
3886 * anonymous.cs: Cache closed generic anonymous method delegates.
3888 2008-07-24 Marek Safar <marek.safar@gmail.com>
3890 * lambda.cs, linq.cs, class.cs, iterators.cs, cs-parser.jay, assign.cs,
3891 anonymous.cs, statement.cs: Always emit anonymous method as static method
3892 when is instance free. Use nesting for nested anynomous methods blocks.
3894 2008-07-23 Marek Safar <marek.safar@gmail.com>
3896 * anonymous.cs (MutateGenericMethod): Added extra code path for imported
3899 2008-07-23 Marek Safar <marek.safar@gmail.com>
3901 * expression.cs: Removed MakeSimpleCall.
3903 2008-07-23 Marek Safar <marek.safar@gmail.com>
3905 A fix for bug #323012
3906 * class.cs, pending.cs: Emit proxy for indexers when they differ in name.
3907 Base method implementing interface has to be public.
3909 2008-07-23 Marek Safar <marek.safar@gmail.com>
3911 * cs-parser.jay: Don't break on missing argument.
3913 2008-07-22 Marek Safar <marek.safar@gmail.com>
3915 A fix for bug #320993
3916 * report.cs, parameter.cs, class.cs, decl.cs, delegate.cs, attribute.cs,
3917 enum.cs, codegen.cs: Report CLS compliance errors as warnings.
3919 2008-07-22 Marek Safar <marek.safar@gmail.com>
3921 A fix for bug #320748
3922 * convert.cs: Implicit user operators cannot convert to interfaces
3924 2008-07-22 Marek Safar <marek.safar@gmail.com>
3926 A fix for bug #312686
3927 * driver.cs: Ignore empty assembly references.
3929 2008-07-22 Marek Safar <marek.safar@gmail.com>
3931 A fix for bug #387040
3932 * ecore.cs: Skip constrains check for an explicit implementation.
3934 2008-07-21 Marek Safar <marek.safar@gmail.com>
3936 A fix for bug #409045
3937 * cs-tokenizer.cs, rootcontext.cs, class.cs, location.cs, delegate.cs,
3938 cs-parser.jay, driver.cs, expression.cs, attribute.cs: Conditional
3939 identifiers are file specific unless passed as input arguments.
3941 2008-07-21 Marek Safar <marek.safar@gmail.com>
3943 * typemanager.cs, parameter.cs, class.cs, attribute.cs: Use an attribute
3944 to emit UnmanagedMarshal data under 2.0 profile.
3946 2008-07-21 Marek Safar <marek.safar@gmail.com>
3948 A fix for bug #410369
3949 * parameter.cs: Clone correctly ParamsParameter.
3951 2008-07-21 Marek Safar <marek.safar@gmail.com>
3953 * expression.cs (Argument): Always report type for type based expressions
3956 2008-07-18 Marek Safar <marek.safar@gmail.com>
3958 A fix for bug #410666
3959 * anonymous.cs: Correctly initialize generic storey reference.
3961 2008-07-18 Marek Safar <marek.safar@gmail.com>
3963 * convert.cs: Don't box same type arguments.
3965 2008-07-18 Marek Safar <marek.safar@gmail.com>
3967 * ecore.cs, linq.cs, delegate.cs, constant.cs, nullable.cs, expression.cs:
3968 Finished missing generic type mutators.
3970 2008-07-18 Marek Safar <marek.safar@gmail.com>
3972 * iterators.cs, statement.cs: Finished statements CloneTo.
3974 2008-07-18 Marek Safar <marek.safar@gmail.com>
3976 * anonymous.cs: ExpressionTreeProxy is of Value type expression.
3978 * expression.cs: Emit optimized default value expressions in expression tree
3981 2008-07-18 Marek Safar <marek.safar@gmail.com>
3983 * ecore.cs, cs-parser.jay, statement.cs: Error reporting fixes.
3985 2008-07-17 Marek Safar <marek.safar@gmail.com>
3987 A fix for bug #367536
3988 * cs-parser.jay: Check static constructor of generic types for an access
3991 2008-07-17 Marek Safar <marek.safar@gmail.com>
3993 A fix for bug #353800
3994 * lambda.cs: Emit ret for contextual statements.
3996 * codegen.cs: Keep both resolved and unreachable flags, otherwise we end
3997 up emitting redundant ret for all anonymous methods with return.
3999 2008-07-17 Marek Safar <marek.safar@gmail.com>
4001 A fix for bug #365188
4002 * ecore.cs, anonymous.cs, expression.cs, codegen.cs, statement.cs: Don't
4003 create anonymous method storey in unreachable block.
4005 2008-07-17 Marek Safar <marek.safar@gmail.com>
4007 * generic.cs, typemanager.cs, cs-tokenizer.cs, parameter.cs, namespace.cs,
4008 class.cs, delegate.cs, flowanalysis.cs, iterators.cs, anonymous.cs,
4009 driver.cs, nullable.cs, expression.cs, attribute.cs, codegen.cs,
4010 statement.cs: Fixed relevant defects found by Gendarme.
4012 2008-07-17 Marek Safar <marek.safar@gmail.com>
4014 A fix for bug #325291
4015 * modifiers.cs, class.cs, cs-parser.jay, anonymous.cs, codegen.cs,
4016 statement.cs: Replaced IAnonymousHost with top level block flag.
4018 2008-07-17 Marek Safar <marek.safar@gmail.com>
4020 * cs-parser.jay: Clean up unused open_parens.
4022 2008-07-17 Marek Safar <marek.safar@gmail.com>
4024 * ecore.cs: Custom error message for a range variable assignment.
4026 2008-07-16 Marek Safar <marek.safar@gmail.com>
4028 * constant.cs, typemanager.cs: Emit empty string ("") as string.Empty field
4031 2008-07-16 Marek Safar <marek.safar@gmail.com>
4033 * literal.cs: Null literal is of object type.
4035 2008-07-16 Marek Safar <marek.safar@gmail.com>
4037 * nullable.cs (LiftedBinaryOperator): Always lift unwrapped nullable
4038 expression of nullable equality comparison.
4040 2008-07-15 Marek Safar <marek.safar@gmail.com>
4042 * expression.cs(PointerArithmetic): Removed redundant assignment.
4044 2008-07-15 Marek Safar <marek.safar@gmail.com>
4046 * decl.cs (GetSignatureForError): Report full namespace name for containers.
4048 2008-07-14 Marek Safar <marek.safar@gmail.com>
4050 A fix for bug #408361
4051 * anonymous.cs (MutateGenericMethod): Store generic type arguments before
4052 they are replaced by GetMethod.
4054 2008-07-14 Marek Safar <marek.safar@gmail.com>
4056 A fix for bug #408721 by jeremie.laval@gmail.com
4057 * expression.cs (Indirection): Implemented CloneTo.
4059 2008-07-14 Marek Safar <marek.safar@gmail.com>
4061 * statement.cs (AssignableSlots): Temporary disabled variable initialization
4064 2008-07-14 Marek Safar <marek.safar@gmail.com>
4066 * report.cs (EnableReporting): Don't reinitialize 0-based values.
4068 2008-07-11 Marek Safar <marek.safar@gmail.com>
4070 * linq.cs: Reset tranparent parameter counter in probing mode.
4072 2008-07-11 Marek Safar <marek.safar@gmail.com>
4074 * anonymous.cs: Mutate anonymous method type.
4076 2008-07-11 Marek Safar <marek.safar@gmail.com>
4078 * ecore.cs, anonymous.cs: Mutate field expressions.
4080 2008-07-10 Marek Safar <marek.safar@gmail.com>
4082 A fix for bug #369670
4083 * linq.cs, statement.cs: Use explicit block for query expressions variables.
4085 2008-07-10 Marek Safar <marek.safar@gmail.com>
4087 * report.cs, ecore.cs: Flush recorder only when silent mode is off.
4089 2008-07-10 Raja R Harinath <harinath@hurrynot.org>
4092 * cs-tokenizer.cs (is_punct): If a generic lookahead is looking
4093 only one '>', and finds a '>>', abort the generic lookahead.
4095 2008-07-10 Marek Safar <marek.safar@gmail.com>
4097 A fix for bug #319902
4098 * cs-tokenizer.cs: Always look-ahed for `>=' when tokenizing `>'.
4100 2008-07-10 Marek Safar <marek.safar@gmail.com>
4102 A fix for bug #406371
4103 * statement.cs: Moved EmitSymbolInfo to Block.
4105 2008-07-09 Marek Safar <marek.safar@gmail.com>
4107 * ecore.cs: Report better error for extension method overload failures.
4109 2008-07-09 Marek Safar <marek.safar@gmail.com>
4111 * expression.cs (Is): No need to box reference values.
4113 2008-07-09 Marek Safar <marek.safar@gmail.com>
4115 * class.cs: Use event resolve context when initializing CreateEmitContext.
4117 2008-07-09 Marek Safar <marek.safar@gmail.com>
4119 A fix for bug #394436
4120 * anonymous.cs, class.cs, expression.cs, lambda.cs: Emit correctly extension
4121 method used inside expression trees. Added more LINQ to expression tree
4124 2008-07-08 Marek Safar <marek.safar@gmail.com>
4126 A fix for bug #378189, #370577
4127 * lambda.cs, ecore.cs: Implemented 3.0 enhancement to better conversion
4130 2008-07-08 Marek Safar <marek.safar@gmail.com>
4132 * anonymous.cs, class.cs, decl.cs: Emit CompilerGenerated attribute
4135 2008-07-08 Marek Safar <marek.safar@gmail.com>
4137 A fix for bug #406702
4138 * anonymous.cs: Always park anonymous method in the nearest parent storey.
4140 2008-07-07 Marek Safar <marek.safar@gmail.com>
4142 A fix for bug #406648
4143 * cs-parser.jay: Report nullable use in mcs for some cases.
4145 2008-07-07 Marek Safar <marek.safar@gmail.com>
4147 * ecore.cs: Improved argument mismatch error messages.
4149 2008-07-07 Marek Safar <marek.safar@gmail.com>
4151 * anonymous.cs: Don't cache generic delegates when reference MVAR argument.
4153 2008-07-07 Marek Safar <marek.safar@gmail.com>
4155 * expression.cs (TypeOf): Mutate type argument.
4157 2008-07-04 Marek Safar <marek.safar@gmail.com>
4159 * class.cs: Report missing partial modifier for correct type.
4161 2008-07-04 Marek Safar <marek.safar@gmail.com>
4163 * ecore.cs, expression.cs (VariableReference): Variable property is
4166 2008-07-04 Marek Safar <marek.safar@gmail.com>
4168 * ecore.cs, convert.cs: Made OpcodeCast more memory efficient.
4170 2008-07-04 Marek Safar <marek.safar@gmail.com>
4172 * anonymous.cs, class.cs, lambda.cs, iterator.cs: Cache static anonymous
4175 2008-07-04 Marek Safar <marek.safar@gmail.com>
4177 * anonymous.cs, class.cs, expression.cs, iterator.cs, statement.cs: Reduce
4178 anonymous method storey to an instance method when only "this" is hoisted.
4180 2008-07-03 Marek Safar <marek.safar@gmail.com>
4182 A fix for bug #321615
4183 * expression.cs: Pointer comparisons use unsigned operator.
4185 2008-07-03 Marek Safar <marek.safar@gmail.com>
4187 * expression.cs: Fixed native pointer conversions. Also fixes #321615.
4189 2008-07-02 Marek Safar <marek.safar@gmail.com>
4191 A fix for bug #404905
4192 * class.cs: Always initialize local unsafe variables.
4194 2008-06-30 Marek Safar <marek.safar@gmail.com>
4196 A fix for bug #396987
4197 * expression.cs (NewInitialize): Clear local temporary variable for next run
4199 2008-06-27 Marek Safar <marek.safar@gmail.com>
4201 A fix for bug #401020
4202 * ecore.cs: Both types and modifiers have to match for ref and out arguments
4204 2008-06-27 Marek Safar <marek.safar@gmail.com>
4206 A fix for bug #398319
4207 * cs-parser.jay: Implemented undocumented base access expression inside
4210 2008-06-26 Marek Safar <marek.safar@gmail.com>
4212 A fix for bug #404227
4213 * cs-parser.jay: Parse namespace declaration using qualified identifier.
4215 2008-06-26 Marek Safar <marek.safar@gmail.com>
4217 A fix for bug #404227
4218 * convert.cs: Fixed explicit array to interface cast.
4220 2008-06-26 Marek Safar <marek.safar@gmail.com>
4222 A fix for bug #403894
4223 * delegate.cs: Mutate DelegateInvocation type.
4225 2008-06-26 Marek Safar <marek.safar@gmail.com>
4227 A fix for bug #379348
4228 * delegate.cs: Box a load of generic parameters.
4230 2008-06-26 Marek Safar <marek.safar@gmail.com>
4232 * expression.cs: Add an array creation arguments mutate.
4234 2008-06-26 Marek Safar <marek.safar@gmail.com>
4236 A fix for bug #386068
4237 * anonymous.cs, expression.cs: Emit correctly hoisted expression tree
4240 2008-06-25 Marek Safar <marek.safar@gmail.com>
4242 * ecore.cs, expression.cs: Fixed broken TypeCast clone, implemented few more
4245 2008-06-25 Marek Safar <marek.safar@gmail.com>
4247 A fix for bug #403518
4248 * delegate.cs: Type correctly anonymous method new invocation.
4250 2008-06-24 Marek Safar <marek.safar@gmail.com>
4252 A fix for bug #394826
4253 * anonymous.cs: Fully qualify members when resolving anonymous type internal
4256 2008-06-24 Marek Safar <marek.safar@gmail.com>
4258 A fix for bug #394826
4259 * anonymous.cs, iterators.cs: Construct generic storey only when is really
4262 2008-06-24 Marek Safar <marek.safar@gmail.com>
4264 * class.cs: Clone indexer parameters for localized capturing.
4266 2008-06-24 Marek Safar <marek.safar@gmail.com>
4268 A fix for bug #402379
4269 * expression.cs: Don't crash when an object initializer resolve fails.
4271 2008-06-24 Marek Safar <marek.safar@gmail.com>
4273 A fix for bug #402888
4274 * expression.cs: Mutate conditional expression.
4276 2008-06-24 Marek Safar <marek.safar@gmail.com>
4278 A fix for bug #401012
4279 * class.cs: Keep StructLayout in shared container.
4281 2008-06-24 Marek Safar <marek.safar@gmail.com>
4283 A fix for bug #400438
4284 * decl.cs, class.cs: Only properties can be automatically implemented.
4286 2008-06-24 Marek Safar <marek.safar@gmail.com>
4288 * statement.cs (ChangeToIterator): Copy also labels.
4290 2008-06-23 Marek Safar <marek.safar@gmail.com>
4292 * ecore.cs: Pass type argument details to parent extension method.
4294 2008-06-23 Marek Safar <marek.safar@gmail.com>
4296 A fix for bug #375966
4297 * delegate.cs: Fixed IsTypeCovariant generic type conversions.
4299 2008-06-23 Raja R Harinath <harinath@hurrynot.org>
4301 * Makefile (bootstrap-libs): Pass NO_DIR_CHECK to sub-make.
4303 2008-06-22 Marek Safar <marek.safar@gmail.com>
4305 A fix for bug #394347
4306 * anonymous.cs: Cache compatible delegates as compatibility check produces
4307 a new method every time.
4309 2008-06-20 Marek Safar <marek.safar@gmail.com>
4311 * anonymous.cs: Propagate storey reference for single references.
4313 2008-06-20 Marek Safar <marek.safar@gmail.com>
4315 A fix for bug #387615
4316 * assign.cs, expression.cs: Correctly clone compound assignment.
4318 2008-06-19 Marek Safar <marek.safar@gmail.com>
4320 A fix for bug #359611, #359604
4321 * anonymous.cs: Mutate all types of hoisted parameters.
4323 2008-06-19 Marek Safar <marek.safar@gmail.com>
4325 * typemanager.cs, lambda.cs, parameter.cs, ecore.cs, linq.cs, class.cs
4326 delegate.cs, iterators.cs, cs-parser.jay, assign.cs, anonymous.cs, driver.cs
4327 expression.cs, codegen.cs, statement.cs
4329 Fixes bugs: #318652, #323223, #234779, #325069, #325476, #332532, #334465,
4330 #345907, #349190, #353276, #355256, #359617, #378542, #384584, #396530
4332 ** Anonymous methods, lambda expressions rewrite **
4334 Anonymous expressions are now resolved when an explicit block is resolved
4335 and they don't require any registration procedure anymore. Further,
4336 anonymous methods are defined when explicit block is emitted which allows
4337 better control of whole process and opens possibilities for more
4338 optimizations as well as alternative to reverse whole process.
4340 A concept of `MutateHoistedGenericType' was introduced to keep the resolve
4341 process consistent and to correctly emit hoisted generic methods when they
4342 have at least 1 hoisted variable.
4344 2008-06-17 Martin Baulig <martin@ximian.com>
4346 * class.cs: Also emit the `[DebuggerHidden]' attribute on the main
4348 (AbstractPropertyEventMethod.IsDebuggerHidden): New protected
4349 virtual property; check it in Emit().
4350 (PropertyMethod.IsDebuggerHidden): Override, check whether we're
4352 (MethodOrOperator.ResolveMethods): Set `DEBUGGER_HIDDEN' if we're
4354 (Indexer.Define): Likewise.
4356 2008-06-17 Marek Safar <marek.safar@gmail.com>
4358 * convert.cs: Don't use IsInterface on type arguments.
4360 * delegate.cs: DelegateInvocation uses MethodInfo.
4362 * parameter.cs: Removed IsTypeParameter.
4364 * generic-mcs.cs: More missing stuff.
4366 2008-06-16 Martin Baulig <martin@ximian.com>
4369 (Modifiers.DEBUGGER_HIDDEN): New public const.
4372 (TypeManager.GetDebuggerHiddenAttribute): New public static method.
4375 (MethodOrOperator.Emit): Check `Modifiers.DEBUGGER_HIDDEN'.
4376 (AbstractPropertyEventMethod): Likewise.
4377 (Constructor.Emit): Likewise.
4378 (SourceMethod.SetCompilerGenerated): Removed.
4380 * iterator.cs: Set `Modifiers.DEBUGGER_HIDDEN' everywhere except
4384 (RootScopeInfo.DoDefineMembers): Set `Modifiers.DEBUGGER_HIDDEN'
4385 if we're an `IteratorHost'.
4386 (AnonymousMethodMethod..ctor): Don't set
4387 `Modifiers.COMPILER_GENERATED'; csc only sets this on the class,
4390 2008-06-16 Marek Safar <marek.safar@gmail.com>
4392 * statement.cs: Clean-up foreach statements.
4394 2008-06-12 Marek Safar <marek.safar@gmail.com>
4396 * class.cs: Stop using public method which should not exist
4397 (MethodBuilder.SetGenericMethodSignature).
4399 2008-06-11 Martin Baulig <martin@ximian.com>
4402 (Location.LookupFile): Add `CompilationUnit' argument; when given
4403 a relative file name, make it relative to the directory the .cs
4404 file is located in instead of using the current directory.
4406 2008-06-11 Martin Baulig <martin@ximian.com>
4409 (IMethodData.EmitExtraSymbolInfo): Added `SourceMethod' argument.
4410 (MethodOrOperator.EmitExtraSymbolInfo): Likewise.
4411 (SourceMethod.SetRealMethodName): Moved here from the symbol writer.
4412 (SourceMethod.SetCompilerGenerated): Likewise.
4414 2008-06-11 Marek Safar <marek.safar@gmail.com>
4416 * codegen.cs, driver: Only write symbol file when it's asked for.
4418 2008-06-11 Marek Safar <marek.safar@gmail.com>
4420 * codegen.cs: Don't use assembly writer error handling for symbol writer.
4422 2008-06-10 Martin Baulig <martin@ximian.com>
4424 * symbolwriter.cs: Reflect latest MarkSequencePoint() API changes.
4426 2008-06-09 Marek Safar <marek.safar@gmail.com>
4428 A fix for bug #316290
4429 * expression.cs: Include decimal operators in predefined table.
4431 * parameters.cs: More readonlyness.
4433 2008-06-09 Marek Safar <marek.safar@gmail.com>
4435 A fix for bug #397213
4436 * cs-parser.jay: One more missing current_local_parameters reset.
4438 2008-06-09 Marek Safar <marek.safar@gmail.com>
4440 A fix for bug #396633
4441 * class.cs: Host backing field in partial container.
4443 2008-06-09 Marek Safar <marek.safar@gmail.com>
4445 A fix for bug #397068
4446 * expression.cs: Check both operand types when predefined operator is used.
4448 2008-06-05 Martin Baulig <martin@ximian.com>
4450 Merged the `debugger-kahalo' branch.
4453 (MethodData.Emit): Call SymbolWriter.SetCompilerGenerated() if
4454 we're an iterator method.
4455 (SourceMethod): Reflect latest symbol writer changes;
4456 SymbolWriter.OpenMethod() now takes a `ICompileUnit' argument and
4457 now `start_row' and `end_row'.
4458 (Constructor.Emit): Fix the logic whether to emit symbol information.
4460 * iterator.cs: Call SymbolWriter.SetCompilerGenerated() on all the
4464 (CompilationUnit): New public class; derives from `SourceFile'.
4465 (SourceFileEntry.DefineSymbolInfo): New public method.
4466 (SourceFileEntry.SetChecksum): New public method.
4467 (Location): Encode hidden line numbers by using `column == 255';
4468 the .ctor now accepts `column == -1' to mark a hidden line number.
4469 (Location.Hidden): New public property.
4470 (Location.CheckPoint): Add `CompilationUnit'.
4471 (Location.SourceFiles): Change return type to `CompilationUnit[]'.
4472 (Location.Push): Add `CompilationUnit compile_unit' argument.
4473 (Location.CompilationUnit): New public property.
4476 (ToplevelBlock.Emit): Add `ec.Mark (EndLocation)'.
4478 * cs-parser.jay: `SourceFile' -> `CompilationUnit'.
4480 * driver.cs: `SourceFile' -> `CompilationUnit'.
4482 * cs-tokenizer.cs: `SourceFile' -> `CompilationUnit'.
4484 * namespace.cs: `SourceFile' -> `CompilationUnit'.
4486 * cs-tokenizer.cs: Add support for `#pragma checksum' and
4490 (SymbolWriter.MarkSequencePoint): Take a `Location' and use the
4491 new symbol writer API to also pass the file.
4493 2008-06-05 Marek Safar <marek.safar@gmail.com>
4495 * statement.cs: Emit catch variable assignment using variable expression.
4497 2008-06-05 Marek Safar <marek.safar@gmail.com>
4499 * ecore.cs, expression.cs, statement.cs: Make TemporaryVariable compatible
4500 with other variable types.
4502 2008-06-04 Marek Safar <marek.safar@gmail.com>
4504 * ecore.cs, expression.cs, statement.cs, typemanager.cs: Removed custom
4505 GetLength method emit, it breaks resolve rules.
4507 2008-06-02 Atsushi Enomoto <atsushi@ximian.com>
4508 Marek Safar <marek.safar@gmail.com>
4510 A fix for bug #395542
4511 * cs-parser.jay: The trailing comma is allowed in anonymous type member
4514 2008-06-02 Marek Safar <marek.safar@gmail.com>
4516 A fix for bug #395287
4517 * class.cs, modifiers.cs: Automatic properties method base modifiers checks.
4519 2008-05-31 Marek Safar <marek.safar@gmail.com>
4521 A fix for bug #395845
4522 * class.cs, nullable.cs: User unary operator is allowed to have nullable and
4523 non-nullable parameter type.
4525 2008-05-31 Marek Safar <marek.safar@gmail.com>
4527 * class.cs: Handle contructor initializer as a statement in top-level block.
4529 2008-05-30 Marek Safar <marek.safar@gmail.com>
4531 * attribute.cs: Don't mix old and new corlib types when emitting corlib
4532 security attributes.
4534 2008-05-24 Marek Safar <marek.safar@gmail.com>
4536 * ecore.cs, expression.cs: Small IVariable refactoring.
4538 2008-05-22 Marek Safar <marek.safar@gmail.com>
4540 * assign.cs (LocalTemporary): Implemented CreateExpressionTree.
4542 2008-05-21 Marek Safar <marek.safar@gmail.com>
4544 * cs-parser.jay: Removed redundant catch type check.
4546 2008-05-21 Marek Safar <marek.safar@gmail.com>
4548 A fix for bug #390372
4549 * nullable.cs: Set correct return type.
4551 2008-05-21 Marek Safar <marek.safar@gmail.com>
4553 A fix for bug #391062
4554 * typemanager.cs: Fixed crash when comparing null types.
4556 2008-05-21 Marek Safar <marek.safar@gmail.com>
4558 A fix for bug #391871
4559 * cs-parser.jay: Better error handling for invalid catch type.
4561 2008-05-20 Marek Safar <marek.safar@gmail.com>
4563 A fix for bug #392155
4564 * cs-tokenizer.cs: Fixed casting of byte and decimal expression.
4566 2008-05-15 Marek Safar <marek.safar@gmail.com>
4568 A fix for bug #390666
4569 * ecore.cs (BetterExpressionConversion): Unwrap each Expression<T>
4572 2008-05-15 Marek Safar <marek.safar@gmail.com>
4574 * class.cs, expression.cs, statement.cs: Removed a hack, setting block flag
4577 2008-05-13 Marek Safar <marek.safar@gmail.com>
4579 A fix for bug #389625
4580 * delegate.cs, generic.cs: Some progress on method group return type
4583 2008-05-13 Marek Safar <marek.safar@gmail.com>
4585 A fix for bug #378419
4586 * namespace.cs: Inspect also parent namespaces not only namespace entries.
4588 2008-05-12 Marek Safar <marek.safar@gmail.com>
4590 * class.cs (Constructor): Added IsCompilerGenerated.
4592 2008-05-12 Marek Safar <marek.safar@gmail.com>
4594 * expression.cs: Enum binary operators can accept non-enum operand only when
4595 is implicitly convertible to underlying type.
4597 2008-05-12 Marek Safar <marek.safar@gmail.com>
4599 A fix for bug #389272
4600 * support.cs: Workaround System.InvalidOperationException for enums.
4602 2008-05-12 Marek Safar <marek.safar@gmail.com>
4604 A fix for bug #389073
4605 * convert.cs: More undocumented explicit IntPtr/UIntPtr conversions.
4607 2008-05-10 Marek Safar <marek.safar@gmail.com>
4609 * driver.cs: Split Parse.
4611 * location.cs (LookupFile): Uses string.Empty.
4613 2008-05-07 Marek Safar <marek.safar@gmail.com>
4615 * expression.cs, parameter.cs: Small ParameterReference clean up.
4617 2008-05-07 Marek Safar <marek.safar@gmail.com>
4619 * anonymous.cs, codegen.cs, convert.cs, ecore.cs: Removed uber ugly TempEc
4620 hack. Fixes #387502.
4622 2008-05-06 Martin Baulig <martin@ximian.com>
4624 * class.cs (Constructor.Emit): Fix the logic whether to emit
4627 2008-05-06 Raja R Harinath <harinath@hurrynot.org>
4630 * iterators.cs (Iterator.CurrentBlock.DoEmit): Don't emit
4631 InvalidOperationException when the iterator is before the start or
4634 2008-05-06 Marek Safar <marek.safar@gmail.com>
4636 * nullable.cs (NullCoalescingOperator): Result is underlying type of left,
4637 when left is nullable type.
4639 2008-05-06 Marek Safar <marek.safar@gmail.com>
4641 A fix for bug #386628
4642 * expression.cs (LocalVariableReference): Continue in resolving when
4643 variable is not assigned.
4645 2008-05-05 Marek Safar <marek.safar@gmail.com>
4647 * nullable.cs, statement.cs (Unwrap): Store non-variable expression in all
4648 nullable operations.
4650 2008-05-04 Marek Safar <marek.safar@gmail.com>
4652 * nullable.cs, statement.cs (Unwrap): Don't duplicate variable expressions,
4653 it saves many redundant temporary variables for nullable operations.
4655 2008-05-03 Marek Safar <marek.safar@gmail.com>
4657 * assign.cs: EventAddOrRemove is a statement and cannot have a type.
4659 * cfold.cs, constant.cs, expression.cs: Share Error_OperatorCannotBeApplied
4662 * nullable.cs: Constant coalescing operator optimizations.
4664 2008-05-03 Marek Safar <marek.safar@gmail.com>
4666 * constant.cs: Use unsigned conversion for values which are unsigned only.
4668 2008-05-03 Marek Safar <marek.safar@gmail.com>
4670 * convert.cs, literal.cs, nullabel.cs, typemanager.cs: Implemeted null
4671 coalescing operator as it should be.
4673 2008-05-02 Marek Safar <marek.safar@gmail.com>
4675 A fix for bug #371016
4676 * expression.cs: All predefined delegate operators require implicit method
4679 2008-05-02 Marek Safar <marek.safar@gmail.com>
4681 * constant.cs: Emit long constant as uint when fits the range.
4683 * convert.cs, expression.cs: Fixed few unsafe conversions.
4685 2008-05-02 Marek Safar <marek.safar@gmail.com>
4687 * convert.cs, literal.cs: Don't wrap implicit reference conversion to object
4689 2008-05-02 Raja R Harinath <harinath@hurrynot.org>
4692 * convert.cs (ImplicitNumericConversion): Don't modify the type of
4694 * ecore.cs (EmptyCast.Create): Flatten nested EmptyCasts.
4696 2008-05-01 Marek Safar <marek.safar@gmail.com>
4698 * constant.cs, literal.cs: IsLiteral property for error reporting.
4700 * ecore.cs, expression.cs: Implemented Property expression.
4702 2008-05-01 Marek Safar <marek.safar@gmail.com>
4704 * class.cs, modifiers.cs, flowanalysis.cs: New BACKING_FIELD flag.
4706 * nullable.cs: Implemented nullable coalescing null operator.
4708 * ecore.cs, expression.cs: Expression trees work.
4710 2008-05-01 Marek Safar <marek.safar@gmail.com>
4712 * ecore.cs: CreateExpressionTree is finally abstract.
4714 * expression.cs, linq.cs: Updated.
4716 2008-05-01 Marek Safar <marek.safar@gmail.com>
4718 * expression.cs, ecore.cs: Block base access expression inside expression
4721 2008-05-01 Marek Safar <marek.safar@gmail.com>
4723 A fix for bug #385058
4724 * expression.cs: User-defined operator implementations always take
4725 precedence over predefined operator implementations.
4727 2008-04-30 Marek Safar <marek.safar@gmail.com>
4729 * assign.cs, anonymous.cs, lambda.cs, nullable.cs, ecore.cs, linq.cs,
4730 class.cs, iterators.cs, expression.cs, attribute.cs: Filled a few more
4731 expression tree conversions.
4733 2008-04-30 Marek Safar <marek.safar@gmail.com>
4735 * typemanager.cs, ecore.cs, class.cs, expression.cs, doc.cs: Merged all
4736 operators method details to Operator class.
4738 2008-04-30 Marek Safar <marek.safar@gmail.com>
4740 * anonymous.cs: Pass unsafe flags to anonymous container.
4742 * ecore.cs, expression.cs, statement.cs: Block unsafe pointer operations
4743 inside expression tree.
4745 2008-04-29 Martin Baulig <martin@ximian.com>
4747 * cs-tokenizer.cs (Tokenizer.Position): Added `line'.
4748 (Tokenizer.PopPosition): Also restore the `line'.
4750 2008-04-29 Marek Safar <marek.safar@gmail.com>
4752 * delegate.cs: Implemented Invoke expression.
4754 2008-04-29 Marek Safar <marek.safar@gmail.com>
4756 * expression.cs: Fixed equality reference comparison regression.
4758 2008-04-29 Marek Safar <marek.safar@gmail.com>
4760 * ecore.cs: Clean up EmptyCast hack.
4762 * expression.cs, nullable.cs: Implemented enum binary and unary operations
4763 using correct conversion rules. Also fixes #383993.
4765 2008-04-28 Martin Baulig <martin@ximian.com>
4767 * class.cs (Constructor.Emit): Don't emit debugging information
4768 for generated default .ctor's.
4770 2008-04-28 Marek Safar <marek.safar@gmail.com>
4772 * convert.cs: Empty-cast ushort to int conversion.
4774 2008-04-28 Marek Safar <marek.safar@gmail.com>
4776 A fix for bug #384191
4777 * ecore.cs, expression.cs: Fixed expression cloning.
4779 2008-04-28 Marek Safar <marek.safar@gmail.com>
4781 * ecore.cs, delegate.cs, assign.cs: Few tweaks for recent changes.
4783 2008-04-28 Raja R Harinath <harinath@hurrynot.org>
4785 Fix #381559, test-638.cs, test-639.cs
4786 * assign.cs (CompoundAssign.Helper): New wrapper.
4787 (CompoundAssign.DoResolve): Use it to wrap the nested 'target'
4789 * ecore.cs (MethodGroupExpr.VerifyArgumentsCompat) <params arguments>:
4790 Pass unconverted expressions to the params array creation expression.
4791 (FieldExpr.EmitAssign): Don't special-case StringConcat.
4792 (PropertyExpr.EmitAssign): Likewise.
4793 * expression.cs (ArrayCreation.ResolveArrayElement): Keep track of the
4794 element if it is of kind CompoundAssign.Helper.
4795 (ArrayCreation.Emit): If we saw a CompoundAssign.Helper, emit it
4796 first before anything else.
4797 (ArrayAccess.EmitAssign): Don't special-case StringConcat.
4798 (ArrayAccess.LoadArrayAndArguments): Simplify.
4800 2008-04-27 Marek Safar <marek.safar@gmail.com>
4802 * expression.cs: Fixed cloning of typeof(void).
4804 2008-04-27 Raja R Harinath <harinath@hurrynot.org>
4806 * assign.cs (Assign.DoResolve): Remove support for EventExprs.
4807 (Assign.Emit): Likewise. Move it to ...
4808 (CompoundAssign.DoResolve): ... here and ...
4809 (CompoundAssign.Emit): ... here.
4810 (EventAddOrRemove): New helper to handle += and -= on events, and
4811 avoid the use of BinaryDelegates.
4812 * ecore.cs (EventExpr.DoResolveLValue): Emit CS0070 unconditionally.
4813 (EventExpr.EmitAddOrRemove): Improve.
4814 * delegate.cs (DelegateInvocation.DoResolve): Simplify slightly.
4816 * cs-parser.jay (type) <namespace_or_type_name variant>: Don't
4817 create VarExprs for 'foo.bar.var'.
4818 * ecore.cs (VarExpr.InferType): Rename from DoResolveLValue, which
4819 is a highly inappropriate name for its functionality.
4821 2008-04-26 Raja R Harinath <harinath@hurrynot.org>
4823 Simplify handling of multiple assignments
4824 * assign.cs (Assign): Clear out all 'embedded assign' gunk. Make
4826 (SimpleAssign): New. Class to be used for normal assignments.
4827 * anonymous.cs, class.cs, cs-parser.jay: Update to changes.
4828 * expression.cs, parameter.cs, statement.cs: Likewise.
4830 2008-04-25 Marek Safar <marek.safar@gmail.com>
4832 * ecore.cs, expression.cs, nullable.cs: Implemeted enum binary add operation
4833 for incompatible underlying types, more to come, uff.
4835 2008-04-26 Raja R Harinath <harinath@hurrynot.org>
4838 * expression.cs (VariableReference.EmitAssign) <source is NewInstance>:
4839 Handle 'leave_copy'.
4841 2008-04-25 Marek Safar <marek.safar@gmail.com>
4843 * expression.cs, nullable.cs: Implemented UnaryPlus expression.
4845 2008-04-24 Raja R Harinath <harinath@hurrynot.org>
4847 Fix test-636.cs. Sprinkle a few more 'EmitSideEffect's around
4848 * expression.cs (Unary.TryReduceConstant): Unwrap SideEffectConstant.
4849 * statement.cs (While, Do, For): Allow test to have side effects.
4850 (For.DoEmit): Always emit InitStatement.
4853 * expression.cs (Binary.DoResolve) <BitwiseAnd with zero constant>:
4854 Always create SideEffectConstant.
4855 (Binary.EnumLiftUp): Don't assume that the enumeration constant is
4856 of type EnumConstant.
4858 * expression.cs (Binary.EmitBranchable) <Equality with constant>:
4859 Handle 'right' being SideEffectConstant of type 'bool'.
4861 * expression.cs (Binary.EmitBranchable) <Equality with constant>:
4862 Use left.EmitBranchable instead of open coding it, so as to
4863 improve optimization opportunities.
4865 * constant.cs (SideEffectConstant.EmitSideEffect): Simplify slightly.
4867 * ecore.cs (Expression.EmitBranchable): Document some non-obvious
4869 (Expression.EmitSideEffect): Document.
4871 2008-04-23 Marek Safar <marek.safar@gmail.com>
4873 * expression.cs: Implemented NewArrayBounds, TypeIs, and TypeAs expressions.
4875 2008-04-23 Marek Safar <marek.safar@gmail.com>
4877 * constant.cs, statement.cs: Use EmitSideEffect for constant if statement.
4879 2008-04-23 Marek Safar <marek.safar@gmail.com>
4881 * ecore.cs, expression.cs, delegate.cs: Implemeted delegate instantiation
4882 conversion to expression tree.
4884 2008-04-23 Marek Safar <marek.safar@gmail.com>
4886 * ecore.cs: Removed unused expression.
4888 2008-04-22 Marek Safar <marek.safar@gmail.com>
4890 * expression.cs: Implemented NegateChecked and New expressions.
4892 2008-04-22 Marek Safar <marek.safar@gmail.com>
4894 * convert.cs, nullable.cs, expression.cs: Implemented Negate expression.
4896 2008-04-22 Raja R Harinath <harinath@hurrynot.org>
4899 * anonymous.cs (AnonymousMethodExpression.DoResolve): Mark as
4900 needing final 'ret' instruction.
4902 2008-04-22 Marek Safar <marek.safar@gmail.com>
4904 * expression.cs: Disabled lifted binary conversion on ISO-1 profiles.
4906 2008-04-21 Marek Safar <marek.safar@gmail.com>
4908 * expression.cs: Emit ldnull and not null expression as an instance argument
4909 of static method expression calls.
4911 2008-04-21 Marek Safar <marek.safar@gmail.com>
4913 A fix for bug #378200
4914 * expression.cs: Fixed crash when creating parameterless expression tree
4917 2008-04-21 Marek Safar <marek.safar@gmail.com>
4919 A fix for bug #375297
4920 * anonymous.cs: Fixed crash when inferring from null argument anonymous
4923 2008-04-21 Marek Safar <marek.safar@gmail.com>
4925 A fix for bug #377596
4926 * decl.cs, class.cs: Emit delegate type argument attributes.
4928 2008-04-21 Marek Safar <marek.safar@gmail.com>
4930 A fix for bug #365314
4931 * generic.cs, ecore.cs: Type parameter declaration cannot be of generic type
4933 2008-04-21 Marek Safar <marek.safar@gmail.com>
4935 * cs-parser.jay, expression.cs: ComposedCast can work with type expressions
4938 2008-04-21 Marek Safar <marek.safar@gmail.com>
4940 * generic.cs (TypeParameter): Removed redundant location.
4942 2008-04-19 Marek Safar <marek.safar@gmail.com>
4944 * generic.cs, parameter.cs, namespace.cs, ecore.cs, class.cs, decl.cs,
4945 delegate.cs, iterators.cs, cs-parser.jay, const.cs, enum.cs: Use
4946 FullNamedExpression in all declaration type expression, statements will come
4949 2008-04-18 Marek Safar <marek.safar@gmail.com>
4951 * generic.cs, namespace.cs, ecore.cs, class.cs, decl.cs, generic-mcs.cs,
4952 nullable.cs, expression.cs, enum.cs, doc.cs: Cleaning up type expressions.
4954 2008-04-18 Marek Safar <marek.safar@gmail.com>
4956 * parameter.cs, delegate.cs, cs-parser.jay, expression.cs: Removed unused
4959 2008-04-17 Marek Safar <marek.safar@gmail.com>
4961 * decl.cs, class.cs, generic.cs: Verify partial parts type parameters and
4964 2008-04-17 Marek Safar <marek.safar@gmail.com>
4966 * decl.cs, class.cs, cs-parser.jay, ecore.cs, expression.cs: Unify all type
4970 2008-04-17 Raja R Harinath <harinath@hurrynot.org>
4972 Hook up 'EmitSideEffect'
4973 * constant.cs (Constant.EmitSideEffect): New.
4974 (SideEffectConstant.Emit): Simplify. Use EmitSideEffect.
4975 (SideEffectConstant.EmitSideEffect): New.
4976 * ecore.cs (BoxedCast.EmitBranchable): Remove. We can't use an
4977 unconditional branch in EmitBranchable.
4978 (FieldExpr.EmitBranchable): New.
4979 * expression.cs (Unary.EmitSideEffect): New.
4980 (Binary.EmitSideEffect): New.
4981 (VariableReference.EmitSideEffect): New. Do nothing.
4983 2008-04-16 Raja R Harinath <harinath@hurrynot.org>
4985 Introduce 'EmitSideEffect'
4986 * ecore.cs (Expression.EmitSideEffect): New.
4987 (TypeCast): Rename from EmptyCast.
4989 (EmptyCast.EmitBranchable, EmptyCast.EmitSideEffect): Implement.
4990 (BoxedCast.EmitBranchable, BoxedCast.EmitSideEffect): Implement.
4991 * convert.cs, nullable.cs: Update to changes.
4993 2008-04-16 Marek Safar <marek.safar@gmail.com>
4995 * class.cs, cs-parser.jay: Early check for base types expression.
4997 2008-04-16 Marek Safar <marek.safar@gmail.com>
4999 * decl.cs (MemberName): Declare PrettyName as obsolete.
5001 2008-04-16 Marek Safar <marek.safar@gmail.com>
5003 * namespace.cs: Use MemberName comparison.
5005 2008-04-16 Raja R Harinath <harinath@hurrynot.org>
5008 * decl.cs (MemberName.PrettyName): New. Replaces the misnamed
5010 (MemberName.MethodName, MemberName.GetSignatureForError): Improve.
5011 (MemberName.FullyQualifiedName): New. Provides the functionality
5012 that users assume FullName would have.
5013 * ecore.cs, namespace.cs: Update to changes.
5015 * statement.cs (Using.assign): Make into ExpressionStatement.
5016 (Using.EmitPreTryBody): Simplify.
5018 2008-04-16 Marek Safar <marek.safar@gmail.com>
5020 * report.cs: ColorFormat is protected.
5022 * rootcontext.cs: Unused fields clean-up.
5024 * namespace.cs: Made UsingEntry name private.
5026 2008-04-16 Marek Safar <marek.safar@gmail.com>
5028 * cs-tokenizer.cs, location.cs: Removed unused field.
5030 2008-04-16 Jan Oravec <jan.oravec@6com.sk>
5031 Raja R Harinath <harinath@hurrynot.org>
5034 * constant.cs (SideEffectConstant.value): Rename from 'left'.
5035 (SideEffectConstant.side_effect): Rename from 'right'.
5036 (SideEffectConstant..ctor): Normalize 'side_effect'.
5037 (SideEffectConstant.Emit): Emit 'value', not 'side_effect' as the
5038 value of this constant.
5039 * cfold.cs: Update to changes.
5041 2008-04-15 Marek Safar <marek.safar@gmail.com>
5043 * cs-paser.jay: Removed unused variable.
5045 * driver.cs: Made Compile instance method.
5047 2008-04-15 Raja R Harinath <harinath@hurrynot.org>
5049 * flowanalysis.cs (FlowBranching.MergeChild): Simplify.
5051 2008-04-15 Marek Safar <marek.safar@gmail.com>
5053 * cs-paser.jay, namespace.cs: Simplified handling of namespace imports.
5055 2008-04-13 Jb Evain <jbevain@novell.com>
5057 * namespace.cs: update the System.Core fullname for 2.1
5058 * driver.cs: update the list of required assemblies for 2.1.
5059 Merged from the Moonlight 2 branch.
5061 2008-04-11 Marek Safar <marek.safar@gmail.com>
5063 * assign.cs, ecore.cs, expression.cs, nullable.cs: More work on nullable
5064 types and user defined operators. User operators arguments has to be checked
5065 for null value before invocation, which also means no operator is called
5066 when any argument is not convertible to unwrapped nullable type.
5068 2008-04-09 Marek Safar <marek.safar@gmail.com>
5070 * convert.cs, ecore.cs, expression.cs, nullable.cs: Initial refactoring
5071 of Unary expressions to follow operator overloading rules precisely.
5072 Also fixes #321794, #323794
5074 2008-04-08 Marek Safar <marek.safar@gmail.com>
5076 * cs-parser.jay, expression.cs: Don't wrap Indirection expression in Unary
5079 2008-04-08 Marek Safar <marek.safar@gmail.com>
5081 * expression.cs, ecore.cs: Implemented MemberInit expression.
5083 2008-04-08 Raja R Harinath <harinath@hurrynot.org>
5085 Fix mono/tests/exception4.cs
5086 * statement.cs (ExceptionStatement, TryCatch): Revert to using
5087 ec.NeedReturnLabel () rather emitting a 'nop'.
5089 * statement.cs (ExceptionStatement.SomeCodeFollows): A hook for a
5091 (TryCatch.SomeCodeFollows): Likewise.
5092 * flowanalysis.cs (FlowBranchingException): Call 'SomeCodeFollows'
5093 for 'break', 'continue' and 'return' statements inside a try.
5094 We're fairly sure that the generated IL stream will have more
5095 instructions textually following the try.
5096 (FlowBranchingTryCatch): Likewise.
5098 * statement.cs (Throw.Resolve): Move CS0156 and CS0724 testing ...
5099 * flowanalysis.cs (FlowBranching.CheckRethrow): ... here and to its
5102 * statement.cs (CollectionForeach.DisposableWrapper): Make a true
5103 wrapper -- forward everything to CollectionForeach.
5104 (CollectionForeach.NonDisposableWrapper): New.
5105 (CollectionForeach.EmitFinallyBody): Use 'endfinally' instruction
5106 instead of a pop + branch to end.
5108 2008-04-07 Marek Safar <marek.safar@gmail.com>
5110 A fix for bug #377485
5111 * assign.cs, expression.cs, decl.cs, class.cs, ecore.cs, namespace.cs:
5112 Propagate location for extension method groups. Report conversion failure at
5115 2008-04-07 Marek Safar <marek.safar@gmail.com>
5117 * anonymous.cs, expression.cs, ecore.cs, typemanager.cs: Implemented
5118 ListInit and Field expressions.
5120 2008-04-06 Raja R Harinath <harinath@hurrynot.org>
5122 * iterators.cs (Iterator.EmitMoveNext): Remove try/fault wrapper.
5123 Since $PC is always -1 inside the body of MoveNext, the fault
5125 * flowanalysis.cs (FlowBranchingException.EmitFinally): Kill.
5126 * statement.cs (ExceptionStatement.emit_finally): Likewise.
5127 (ExceptionStatement.ResolveFinally): Drop 'branching' argument.
5129 The denouement! Fix #324708
5130 * iterators.cs (Iterator.EmitMoveNext): Reset $PC to -1 on entry.
5131 (Iterator.EmitYieldBreak): We no longer need to reset $PC.
5132 * statement.cs (ExceptionStatement.DoEmit): Actually emit the
5133 'finally' inside the finally clause.
5135 * statement.cs (ExceptionStatement.DoEmit): Emit try/finally block
5136 inside an iterator. Don't emit the body of the 'finally' inside
5137 the finally clause yet.
5139 Use the ResumableStatement infrastructure for MoveNext ()
5140 * iterators.cs (Iterator.EmitMoveNext_NoResumePoints): New.
5141 (Iterator.EmitMoveNext): Use 'resume_points'. Get rid of
5142 'old_resume_points'. Move dispatcher upfront.
5143 (Iterator.MarkYield): Mark the 'resume_point' of a Yield.
5144 * statement.cs (ExceptionStatement.DoEmit): Emit a dispatcher if
5145 in an enumerator. This encodes the main fix in this patch series
5146 -- we can only jump into the first instruction of a try from the
5147 outside, but we want to emit try/finally regions in iterators and
5148 resume in the middle of them.
5150 2008-04-05 Raja R Harinath <harinath@hurrynot.org>
5152 * statement.cs (ExceptionStatement.ResolveFinally): Move setting
5153 of NeedReturnLabel here.
5155 Introduce a common point for emitting try/finally to IL
5156 * statement.cs (ExceptionStatement.DoEmit): New. Combines all the
5157 features of the various subclasses, which are now driven by ...
5158 (ExceptionStatement.EmitPreTryBody): ... this and ...
5159 (ExceptionStatement.EmitTryBody): ... this and the original
5161 (TryFinally, Lock, Using, UsingTemporary, DisposableWrapper):
5162 Remove DoEmit and update to follow above protocol.
5164 * statement.cs (ExceptionStatement.EmitForDispose): If all labels
5165 of the dispatcher are the same, skip emitting the 'switch'.
5166 * iterator.cs (Iterator.EmitDispose): Update to changes.
5168 Clean up handling of 'using' statement
5169 * statement.cs (UsingTemporary): New. Carved out of ...
5170 (Using): ... this. Simplify drastically. Handle exactly
5172 * cs-parser.jay (using_statement): Split. Create UsingTemporary
5173 or Using as appropriate. If there are multiple variable declared,
5174 create nested Using statements.
5175 (resource_acquisition): Kill.
5177 * statement.cs (ExceptionStatement.EmitForDispose): Use
5178 EmitFinallyBody, not EmitFinally.
5180 * flowanalysis.cs (FlowBranching.StealFinallyClauses): Remove.
5181 * iterator.cs: Update to changes.
5183 Start using the ResumableStatement infrastructure
5184 * statement.cs (ResumeableStatement.PrepareForDispose): New.
5185 (ResumableStatement.EmitForDispose): New.
5186 (ExceptionStatement): Override them.
5187 * iterators.cs (Iterator.EmitDispose): Use PrepareForDispose and
5188 EmitForDispose to create the body of the Dispose method. Don't
5191 * iterator.cs (Iterator.AddResumePoint): Move here from ...
5192 * statement.cs (Toplevel.AddResumePoint): ... here.
5193 (Toplevel.MoveNextStatement.Resolve): Create FlowBranchingIterator.
5194 * flowanalysis.cs (FlowBranchingIterator): New.
5195 * codegen.cs (EmitContext): Update to changes.
5197 * iterators.cs (Iterator.OldResumePoint): Rename from ResumePoint.
5198 (Iterator.old_resume_points): Rename from 'resume_points'.
5199 (Iterator.MoveNextStatement): Remove unused class.
5201 New infrastructure for try/finally in iterators (still unused)
5202 * flowanalysis.cs (FlowBranching.AddResumePoint): New.
5203 (FlowBranchingToplevel.AddResumePoint): Hook into
5204 ToplevelBlock.AddResumePoint.
5205 (FlowBranchingTryCatch): Move CS01626 and CS01631 checks here.
5206 (FlowBranchingException): Hook into ExceptionBlock.AddResumePoint.
5207 * statement.cs (ToplevelBlock.AddResumePoint): New. Collect
5208 resume points and assign program-counter values.
5209 (ExceptionBlock.AddResumePoint): Collect resume points for
5210 de-muxer at the top of try block.
5211 * iterators.cs (Yield.CheckContext): Simplify.
5212 (Yield.Resolve): Use FlowBranching.AddResumePoint.
5214 2008-04-04 Raja R Harinath <harinath@hurrynot.org>
5216 * flowanalysis.cs (FlowBranching.AddReturnOrigin): Change Location
5217 argument to an ExitStatement.
5218 (FlowBranchingException): Refactor saved origins code.
5219 * statement.cs (ExitStatement): Update to cahges.
5220 * iterator.cs (YieldBreak): Likewise.
5222 * statement.cs (ResumableStatement): New. Common base class for
5223 YieldReturn and ExceptionStatement.
5224 (ExitStatement): New. Common base class for Return and YieldBreak.
5225 (Return): Update to changes.
5226 * iterator.cs (YieldBreak): Likewise.
5227 * lambda.cs (ContextualReturn): Likewise.
5230 * ecore.cs (Expression.ResolveAsTypeStep): If '!silent' attempt to
5231 emit a meaningful error message.
5233 Fix #324765, #319508
5234 * flowanalysis.cs (VariableInfo.IsEverAssigned): New.
5235 (VariableInfo.SetAssigned): Set it.
5236 * statement.cs (Block.UsageWarning): Use 'IsEverAssigned' to
5237 determine if CS0219 or CS0168 is appropriate. Don't use
5238 flow-analysis information.
5239 (Block.Resolve): Use ec.EndFlowBranching, not ec.DoEndFlowBranching.
5240 * codegen.cs (EmitContext.DoEndFlowBranching): Kill. Inline into ...
5241 (EmitContext.EndFlowBranching): ... this.
5243 2008-04-03 Marek Safar <marek.safar@gmail.com>
5245 * class.cs, typemanager.cs: Emit volatile field with IsVolatile modifier.
5247 2008-04-03 Marek Safar <marek.safar@gmail.com>
5249 A fix for bug #376508
5250 * convert.cs, expression.cs: Fixed difference between ImplicitConversion and
5251 ImplicitConversionExists.
5253 2008-04-03 Marek Safar <marek.safar@gmail.com>
5255 * expression.cs (Binary): Added remaining binary operators to expression
5258 * nullable.cs: Optimize shift with null argument.
5260 2008-04-03 Raja R Harinath <harinath@hurrynot.org>
5262 Fix minor IL regression
5263 * statement.cs (TryCatch..ctor): Add 'inside_try_finally' argument.
5264 (TryCatch.DoEmit): Use it to avoid creating another ExceptionBlock.
5265 * cs-parser.jay (try_statement): Update to changes.
5267 * statement.cs (TryFinally.need_exc_block): Delete.
5268 (TryFinally): Update to changes.
5270 Now all ExceptionStatements are unconditional
5271 * statement.cs (CollectionForeach.DisposableWrapper): New.
5272 Extract out the try/finally code into a new wrapper.
5273 (CollectionForeach.Resolve): Use it to simplify the code.
5275 2008-04-02 Raja R Harinath <harinath@hurrynot.org>
5277 Start at simplifying ExceptionStatement semantics a bit
5278 * statement.cs (TryCatch, TryFinally): Split 'Try' into two pieces.
5279 * cs-parser.jay (try_statement): Update to changes.
5280 (opt_catch_clauses): Remove.
5281 * flowanalysis.cs: Update to changes.
5282 (FlowBranching.BranchingType.TryCatch): New.
5283 (FlowBranchingTryCatch): New.
5285 * flowanalysis.cs (FlowBranching.BranchingType.SwitchSection): Kill.
5286 (FlowBranching.CreateBranching): Update to changes.
5287 (FlowBranchingBlock.AddSibling): Add sanity check.
5288 * codegen.cs (EmitContext.StartFlowBranching) <Block variant>:
5291 * iterators.cs (Iterator.MarkFinally): Remove.
5292 * statement.cs (ExceptionStatement): Update to changes.
5294 Add support for skipping over finally blocks at runtime. First
5295 in a series to fix #324708
5296 * iterators.cs (Iterator.SkipFinally): New LocalBuilder.
5297 (Iterator.EmitMoveNext): Initialize it.
5298 * statement.cs (ExceptionStatement.EmitFinally): Use it to emit a
5299 branch over the body of the 'finally' clause.
5301 2008-03-31 Raja R Harinath <harinath@hurrynot.org>
5303 Avoid lopsided use of Foo/DoFoo names
5304 * statement.cs (ExpressionStatement.EmitFinallyBody):
5305 Rename from EmitFinally.
5306 (ExpressionStatement.EmitFinally): Rename from DoEmitFinally.
5307 * iterator.cs: Update to changes.
5309 2008-04-02 Marek Safar <marek.safar@gmail.com>
5311 * ecore.cs, expression.cs, nullable.cs: ConditionalLogicalOperator is now
5312 based on UserOperatorCall. More binary nullable operators clean up.
5314 2008-04-02 Martin Baulig <martin@ximian.com>
5316 * symbolwriter.cs: Remove the `#if !DISABLE_TERRANIA_CHANGES' conditionals.
5318 2008-04-02 Marek Safar <marek.safar@gmail.com>
5320 * nullable.cs: Merge user and empty conversions when lifting expression
5323 * expression.cs (StringConcat): Implemented expression tree representation.
5325 2008-04-01 Marek Safar <marek.safar@gmail.com>
5327 * nullable.cs: When lifting null literal and a user operator exists, no call
5330 2008-04-01 Marek Safar <marek.safar@gmail.com>
5332 * nullable.cs, ecore.cs, expression.cs: Convert null arithmetic to lifted
5335 2008-04-01 Marek Safar <marek.safar@gmail.com>
5337 * nullable.cs, expression.cs: Use namespace instead heavily nested
5338 monster abstract class.
5340 2008-04-01 Marek Safar <marek.safar@gmail.com>
5342 * ecore.cs, convert.cs, constant.cs, nullable.cs, expression.cs: Implemented
5343 lifting of null literal and user operators. Clean up of some temporary
5346 2008-03-30 Raja R Harinath <harinath@hurrynot.org>
5348 Fix #368224, test-629.cs
5349 * flowanalysis.cs (FlowBranching.StealFinallyClauses): Return true
5350 if it crossed an unwind-protect boundary.
5351 * iterators.cs (Yield.CheckContext): Relax check for 'yield break'.
5352 (Yield.Resolve, Yield.DoEmit): Track whether the yield occurs
5353 inside an unwind-protected region.
5354 (YieldBreak.Resolve, YieldBreak.DoEmit): Likewise.
5355 (Iterator.MarkYield): Add 'unwind_protect' parameter. Emit a
5356 'leave' instead of a 'br' if unwind-protected.
5357 (Iterator.EmitYieldBreak): Likewise.
5359 2008-03-29 Gert Driesen <drieseng@users.sourceforge.net>
5361 * driver.cs: Only define versioninfo resources if no win32 resource
5364 2008-03-28 Marek Safar <marek.safar@gmail.com>
5366 A fix for bug #372375
5367 * convert.cs: Fixed boxing of nullable types.
5369 2008-03-28 Marek Safar <marek.safar@gmail.com>
5371 * typemanager.cs: Initialize InternalsVisibleTo as the very first optional
5374 2008-03-28 Marek Safar <marek.safar@gmail.com>
5376 A fix for bug #374619
5377 * nullable.cs: Fixed guarding of EmitBitwiseBoolean.
5379 2008-03-27 Marek Safar <marek.safar@gmail.com>
5381 * lambda.cs: Check return type only for invocation.
5383 2008-03-27 Marek Safar <marek.safar@gmail.com>
5385 A fix for bug #374214
5386 * ecore.cs: Correctly report argument type mismatch.
5388 2008-03-27 Marek Safar <marek.safar@gmail.com>
5390 * convert.cs (ImplicitReferenceConversionCore): Correctly compare enum type
5391 and not rely on broken IsEnum.
5393 2008-03-27 Marek Safar <marek.safar@gmail.com>
5395 * nullable.cs: New file, extracted from generic.cs.
5397 * generic.cs, generic-mcs.cs, *.csproj, *.sources: Updated.
5399 2008-03-27 Marek Safar <marek.safar@gmail.com>
5401 * generic.cs, convert.cs, generic-mcs.cs, expression.cs: Added lifting of
5402 predefined comparison operators and null literals.
5404 * report.cs: New warning ID.
5406 2008-03-25 Marek Safar <marek.safar@gmail.com>
5408 A fix for bug #370577
5409 * lambda.cs: Check return type too.
5411 2008-03-25 Marek Safar <marek.safar@gmail.com>
5413 A fix for bug #372846
5414 * class.cs: Automatic properties can be declared as unsafe.
5416 2008-03-20 Marek Safar <marek.safar@gmail.com>
5418 * location.cs: Use string based concatenation.
5420 * expression.cs: LiftedBinaryOperator is gmcs only.
5422 2008-03-20 Marek Safar <marek.safar@gmail.com>
5424 * generic.cs, literal.cs, ecore.cs, expression.cs: Ongoing work on nullable
5425 conversions rules and expression trees.
5427 2008-03-19 Marek Safar <marek.safar@gmail.com>
5429 * delegate.cs: Use extension method source as delegate target.
5431 2008-03-19 Marek Safar <marek.safar@gmail.com>
5433 * generic.cs, generic-mcs.cs, expression.cs, ecore.cs: Rewrote nullable
5434 binary operations to be purely based on binary operations and optimized
5435 emitted code (30% less in some cases). Introduced ReducedExpression for ETs
5436 and other ET refactoring.
5438 * typemanager.cs: Fixed warning.
5440 2008-03-17 Marek Safar <marek.safar@gmail.com>
5442 * class.cs, decl.cs, delegate.cs: Do protected modifier check on each member
5444 * symbolwriter.cs: Fixed.
5446 2008-03-17 Marek Safar <marek.safar@gmail.com>
5448 * anonymous.cs, driver.cs: Reset anonymous types counters.
5450 2008-03-17 Marek Safar <marek.safar@gmail.com>
5452 * ecore.cs (MethodGroupExpr): Skip first candidate, it's already the best.
5454 * class.cs: Use fullname for all type member definitions.
5456 2008-02-19 Martin Baulig <martin@ximian.com>
5459 (IMethodData.EmitExtraSymbolInfo): New interface method.
5460 (MethodData.Emit): Call method.EmitExtraSymbolInfo().
5461 (MethodOrOperator.EmitExtraSymbolInfo): Implement this new
5462 interface method here as an empty public virtual method.
5465 (AnonymousMethodMethod.ctor): Added `string real_name' argument.
5466 (AnonymousMethodMethod.EmitExtraSymbolInfo): Override and call
5467 CodeGen.SymbolWriter.SetRealMethodName().
5469 2008-02-18 Martin Baulig <martin@ximian.com>
5472 (ScopeInfo.EmitType): Override this and emit debugging
5473 information for captured variables.
5474 (RootScopeInfo.EmitType): Override this and emit symbol
5475 information for a captured `this'.
5477 2008-02-15 Martin Baulig <martin@ximian.com>
5479 * iterators.cs: Emit debugging info.
5482 (EmitContext.Flags): Add `OmitDebuggingInfo'.
5483 (EmitContext.OmitDebuggingInfo): New public property.
5486 (While): Override Emit() and don't emit symbol info there; do it
5487 inside DoEmit() instead.
5488 (Block.Emit): Omit symbol information while emitting the scope
5489 initializers; don't ec.Mark() the `EndLocation'. Fix the lexical
5491 (ExplicitBlock.IsIterator): Moved here from `ToplevelBlock'.
5492 (ToplevelBlock.MakeIterator): Pass the `flags' to `ExplicitBlock's
5493 .ctor to make `IsIterator' work.
5495 2008-03-14 Martin Baulig <martin@ximian.com>
5497 * symbolwriter.cs: Added the new symbol writer function from the
5498 debugger's `terrania' branch; temporarily enclose them inside
5499 `#if !DISABLE_TERRANIA_CHANGES' conditionals until I'm back from
5502 2008-03-14 Martin Baulig <martin@ximian.com>
5505 (SymbolWriter): Make this a public static class.
5508 (CodeGen.SymbolWriter): Removed; use the new static `SymbolWriter'
5509 class instead of using `if (CodeGen.SymbolWriter != null)' everywhere.
5511 2008-03-14 Marek Safar <marek.safar@gmail.com>
5513 A fix for bug #370577
5514 * statement.cs, lambda.cs: Added extra limitations when dealing with void
5517 2008-03-14 Marek Safar <marek.safar@gmail.com>
5519 * typemanager.cs (CSharpName): Made 250 times faster.
5521 2008-03-13 Marek Safar <marek.safar@gmail.com>
5523 * ecore.cs, expression.cs: Emit conversion for ET shift argument.
5525 2008-03-12 Marek Safar <marek.safar@gmail.com>
5527 * generic.cs, typemanager.cs, enum.cs, codegen.cs, statement.cs: Try not to
5528 crash when predefined field does not exist.
5530 2008-03-12 Marek Safar <marek.safar@gmail.com>
5532 * ecore.cs (PropertyExpr): Fixed IsSingleDimensionalArrayLength regression.
5534 2008-03-12 Marek Safar <marek.safar@gmail.com>
5536 * class.cs (FixedField): Don't crash when contructors are missing.
5538 2008-03-11 Marek Safar <marek.safar@gmail.com>
5540 * typemanager.cs, namespace.cs, literal.cs, ecore.cs, class.cs, decl.cs,
5541 convert.cs, constant.cs, expression.cs, statement.cs: Use same method to
5542 check internal types accessibility for internal and external types.
5543 Replaced EnumToUnderlying by GetEnumUnderlyingType.
5545 2008-03-11 Marek Safar <marek.safar@gmail.com>
5547 * support.cs, typemanager.cs, pending.cs, ecore.cs, class.cs, delegate.cs
5548 convert.cs, const.cs, anonymous.cs, constant.cs, expression.cs,
5549 attribute.cs, statement: Use corect instance of predefined types (work
5550 related to #364674).
5552 2008-03-07 Marek Safar <marek.safar@gmail.com>
5554 * expression.cs (TypeOfVoid): Fixed predefined method initialization.
5556 2008-03-07 Marek Safar <marek.safar@gmail.com>
5558 * generic.cs, typemanager.cs, parameter.cs, rootcontext.cs, ecore.cs,
5559 class.cs, delegate.cs, iterators.cs, const.cs, constant.cs, driver.cs,
5560 expression.cs, attribute.cs, codegen.cs, statement.cs: TypeManager optional
5561 predefined types clean up, delayed predefined types members initialization
5562 (work related to #364674).
5564 2008-03-05 Marek Safar <marek.safar@gmail.com>
5566 * typemanager.cs (IsFriendAssembly): InternalsVisibleTo is not mandatory.
5568 2008-03-05 Marek Safar <marek.safar@gmail.com>
5570 * typemanager.cs, parameter.cs, rootcontext.cs, ecore.cs, class.cs, decl.cs,
5571 delegate.cs, convert.cs, driver.cs, attribute.cs, codegen.cs: TypeManager
5572 predefined types clean up (work related to #364674).
5574 2008-03-04 Marek Safar <marek.safar@gmail.com>
5576 * ecore.cs: Print an error message instead of throwing exception.
5578 2008-03-04 Marek Safar <marek.safar@gmail.com>
5580 * generic.cs, typemanager.cs, literal.cs, convert.cs, cfold.cs, constant.cs,
5581 expression.cs, statement.cs: Unififed null literal representation.
5583 2008-03-03 Marek Safar <marek.safar@gmail.com>
5585 * anonymous.cs, cfold.cs, convert.cs, delegate.cs, doc.cs, ecore.cs,
5586 expression.cs: Refactored binary operators resolve phase and improved speed.
5587 The nullable code is still missing and won't work correctly, more fixes
5590 It also fixes #323726, #324312, #324248, and many other unreported issues.
5592 2008-02-29 Zoltan Varga <vargaz@gmail.com>
5594 * report.cs (FeatureIsNotAvailable): Use 'mcs1' instead of 'mcs', and 'mcs'
5597 2008-02-27 Marek Safar <marek.safar@gmail.com>
5599 * ecore.cs: Clean-up and split BetterConversion.
5601 2008-02-25 Raja R Harinath <harinath@hurrynot.org>
5604 * enum.cs (EnumMember.Value): Only access 'value' if
5605 ResolveValue says it's ok.
5606 (EnumMember.DoResolveValue): Don't set prev_member.value.
5607 (Enum.GetDefinition): Reverse arguments of Equals --
5608 EnumMember.Value can return 'null'.
5610 * statement.cs (Switch.Error_AlreadyOccurs): Fix typo in name.
5612 2008-02-22 Marek Safar <marek.safar@gmail.com>
5614 * generic.cs, expression.cs: More ongoing work on expression trees.
5616 2008-02-21 Marek Safar <marek.safar@gmail.com>
5618 * class.cs, typemanager.cs: Rewrote operator matching logic to correctly
5619 handle missing matches when mutiple operators exist.
5621 2008-02-20 Marek Safar <marek.safar@gmail.com>
5623 A fix for bug #363218
5624 * expression.cs (ArrayCreation.Clone): Deal with multi-dimensional
5627 2008-02-20 Marek Safar <marek.safar@gmail.com>
5629 * expression.cs, constant.cs, cfold.cs: Yet another side-effect constant
5630 update. This time to deal correctly with SideEffectConstant expression used
5631 as an argument for another constant folding.
5633 2008-02-20 Raja R Harinath <harinath@hurrynot.org>
5635 * typemanager.cs (DropGenericMethodArguments): Ensure we get an underlying
5638 2008-02-19 Marek Safar <marek.safar@gmail.com>
5640 * constant.cs, cfold.cs: SideEffectConstant results can apply for folding.
5642 2008-02-19 Marek Safar <marek.safar@gmail.com>
5644 A fix for bug #328136
5645 * expression.cs: Do not fold immediately LogicalAnd operators when the left
5646 side is a false constant, because we still need to evaluate the right-hand
5649 * statement.cs (If): Emit two types of boolean constants (simple constant,
5650 side-effect constant).
5652 2008-02-19 Marek Safar <marek.safar@gmail.com>
5654 * constant.cs (SideEffectConstant): Don't emit boolean constant.
5656 * expression.cs: Fold immediately LogicalAnd operators when both sides are
5659 2008-02-18 Marek Safar <marek.safar@gmail.com>
5661 A fix for bug #361457
5662 * ecore.cs (IsApplicable): Params methods have lower priority.
5664 * support.cs: Return correct parameter modifier for params types.
5666 2008-02-18 Marek Safar <marek.safar@gmail.com>
5668 * generic.cs (TypeParameter): Cache attribute target name.
5670 * support.cs: Removed unused variable.
5672 * typemanager.cs: Removed debugging leftover.
5674 * ecore.cs: Use local type instead of a property;
5676 * class.cs (VerifyMembers): Consider also parent to test whether type member
5679 * expression.cs (FullMethodDesc): Removed.
5681 * attribute.cs (IsValidArgumentType): Made static.
5683 2008-02-17 Raja R Harinath <harinath@hurrynot.org>
5685 Cleanup to be more readable.
5686 * Makefile (GMCS_PROFILE): Remove.
5687 (COMPILER_NAME): New helper.
5689 2008-02-15 Miguel de Icaza <miguel@novell.com>
5691 * cs-tokenizer.cs: if a conditional expression happens inside a
5692 (...) this also means that we do not need to de-ambiguate between
5693 an parenthesized expression and a cast.
5697 * constant.cs (SideEffectConstant): a constant value that happens
5698 to have a side effect.
5700 Fixes the build regressions introduced by the fix for #359789
5702 2008-02-14 Rodrigo Kumpera <rkumpera@novell.com>
5704 * expression.cs (Conditional.Emit): when emitting the ternary
5705 operator, use local variables to generate code verifiable code.
5707 The verifier cannot infer that the type on stack before the
5708 stloc.0 is executed is of type ParentB. This happens because the
5709 stack merge algorithm uses only parent types when deciding which
5710 is the common type. This is described in Part III 1.8.1.3 of ECMA
5713 This code compiled with mcs is not verifiable under MS. The MS
5714 verifier picks the first common interface of Foo and Bar, which is
5715 wrong, but doesn't use a full join type of the 2 interfaces.
5717 CSC uses a clever hack to compile such code in a verifiable
5718 way. It stores the intermediate values in a local variable with
5723 2008-02-14 Miguel de Icaza <miguel@novell.com>
5725 * expression.cs: Do not fold BitwiseAnd operators when the left
5726 side is a false constant, because we still need to evaluate the
5731 * support.cs: Instead of throwing an InternalErrorException when
5732 the position of the stream is outside the boundary of our buffer,
5733 reset the state of the reader, and restart the reading from the
5734 beginning of the file.
5736 2008-02-14 Marek Safar <marek.safar@gmail.com>
5738 * generic.cs (TypeParameter.GetMembers): Is not supported operation.
5740 2008-02-14 Marek Safar <marek.safar@gmail.com>
5742 A fix for bug #361686
5743 * decl.cs: A protected types used inside a private class which parents
5744 derives from the protected class are accessible.
5746 2008-02-13 Marek Safar <marek.safar@gmail.com>
5748 * generic.cs (ConstraintChecker): Use cached member lookup when looking for
5749 the parameterless constructor.
5751 2008-02-13 Marek Safar <marek.safar@gmail.com>
5753 * generic.cs, typemanager.cs, iterators.cs, codegen.cs: Refactored core
5754 lookup methods to use standard member cache when doing member lookup.
5756 2008-02-12 Marek Safar <marek.safar@gmail.com>
5758 * driver.cs: Don't report full path for referenced module as assembly error.
5760 2008-02-12 Marek Safar <marek.safar@gmail.com>
5762 * Makefile: Fixed `qh' target to work on all machines.
5764 * report.cs, typemanager.cs, parameter.cs, ecore.cs, class.cs, anonymous.cs,
5765 expression.cs, codegen.cs, statement.cs, doc.cs: Replaced type IsSubclassOf
5766 and HasElementType with TypeManager implementation.
5768 2008-02-08 Marek Safar <marek.safar@gmail.com>
5770 A fix for bugs #325134, #359749
5771 * expression.cs, ecore.cs: Try to resolve an extension method even if the
5772 first binds point to non-method member expression.
5774 2008-02-08 Marek Safar <marek.safar@gmail.com>
5776 * cs-parser.jay: Null coalescing operator is not part of ISO-1.
5778 2008-02-08 Marek Safar <marek.safar@gmail.com>
5780 A fix for bugs #321394, #323028
5781 * generic.cs, parameter.cs, ecore.cs, class.cs, decl.cs, delegate.cs:
5782 Reworked naive IsAccessibleAs implementation to handle nested types.
5784 2008-02-05 Jb Evain <jbevain@novell.com>
5786 * class.cs: use generic type comparison for parameters
5789 2008-02-05 Marek Safar <marek.safar@gmail.com>
5791 A fix for bug #325372
5792 * class.cs: Use generic type comparison when testing method signatures.
5794 2008-02-05 Marek Safar <marek.safar@gmail.com>
5796 A fix for bug #357047
5797 * ecore.cs: Applied C# 3.0 changes to better conversion.
5799 2008-02-05 Marek Safar <marek.safar@gmail.com>
5801 A fix for bug #358374
5802 * cs-parser.jay: Correctly set modifiers for all constructor types.
5804 2008-02-04 Marek Safar <marek.safar@gmail.com>
5806 A fix for bug #355251
5807 * generic.cs: Added base class constraint based type inference.
5809 2008-02-01 Marek Safar <marek.safar@gmail.com>
5811 A fix for bug #357255
5812 * decl.cs: One more missing visibility check.
5814 2008-02-01 Marek Safar <marek.safar@gmail.com>
5816 * support.cs: Fixed broken return.
5818 2008-01-25 Marek Safar <marek.safar@gmail.com>
5820 * report.cs: Correctly reset warnings count after probing.
5822 2008-01-25 Martin Baulig <martin@ximian.com>
5825 (NamespaceEntry.SymbolFileID): Make this work again after
5826 MemberName.ToString() is gone.
5828 2008-01-25 Marek Safar <marek.safar@gmail.com>
5830 * expression.cs: Implemented Divide, Equal, ExclusiveOr, GreaterThanOrEqual
5833 2008-01-25 Marek Safar <marek.safar@gmail.com>
5835 * generic.cs: Use full implicit conversion for type inference fixing.
5837 2008-01-24 Marek Safar <marek.safar@gmail.com>
5839 * ecore.cs, expression.cs, generic.cs: Implemented Convert, ConvertChecked.
5840 Fixed user operator conversions.
5842 2008-01-24 Marek Safar <marek.safar@gmail.com>
5844 * generic.cs: Do nullable type to null comparison optimization during
5847 2008-01-24 Marek Safar <marek.safar@gmail.com>
5849 A fix for bug #355163
5850 * generic.cs: Enabled l-value resolve on nullable expressions.
5852 2008-01-24 Marek Safar <marek.safar@gmail.com>
5854 A fix for bug #353986
5855 * class.cs: Ingore static ctors with parameters for any further checks.
5857 2008-01-24 Marek Safar <marek.safar@gmail.com>
5859 A fix for bug #354310
5860 * namespace.cs: Removed redundant check.
5862 2008-01-24 Marek Safar <marek.safar@gmail.com>
5864 A fix for bug #354928
5865 * expression.cs: ElementInitializers can be resolved only once.
5867 2008-01-24 Marek Safar <marek.safar@gmail.com>
5869 * convert.cs, ecore.cs, expression.cs, generic.cs: Implemented Coalesce and
5870 Condition expressions.
5872 2008-01-23 Marek Safar <marek.safar@gmail.com>
5874 * codegen.cs: Fixed AssemblyBuilder initialization on other platforms.
5876 2008-01-22 Marek Safar <marek.safar@gmail.com>
5878 * ecore.cs, expression.cs, generic.cs: Implicit bool? to bool conversion is
5881 * generic.cs: Implemented coalesce expression.
5883 2008-01-22 Marek Safar <marek.safar@gmail.com>
5885 A fix for bug #355145
5886 * anonymous.cs, convert.cs, ecore.cs, generic.cs, lambda.cs: Implemented
5887 expression tree type inference.
5889 2008-01-22 Raja R Harinath <harinath@hurrynot.org>
5892 * expression.cs (Binary.IsUnsignedType): Fix typo.
5894 2008-01-22 Marek Safar <marek.safar@gmail.com>
5896 * ecore.cs, expression.cs, generic.cs: Implemented NewArrayInit expression.
5898 2008-01-22 Marek Safar <marek.safar@gmail.com>
5900 A fix for bug #355161
5901 * ecore.cs, expression.cs: Wider range of extension method supported
5904 2008-01-22 Gert Driesen <drieseng@users.sourceforge.net>
5906 * codegen.cs: Use magic value for AssemblyBuilderAccess to instruct
5907 AssemblyBuilder to operate in compiler context. Fixes mcs part of
5910 2008-01-22 Marek Safar <marek.safar@gmail.com>
5912 A fix for bug #355148
5913 * ecore.cs, expression.cs: Correctly report misused ref and out modifiers.
5915 2008-01-22 Miguel de Icaza <miguel@novell.com>
5917 * expression.cs (CreateExpressionTree): Add support for or and
5918 logical or, and indent following the coding conventions.
5920 * typemanager.cs (LinqExpression): renamed from
5921 ExpressionTreeManager, for a shorter name.
5923 Use TypeManager.CoreLookupType to lookup types from our core
5924 assemblies and turn those into "Type" variables.
5926 Consumers that previously used "Namespace" and "Type" from this
5927 class should instead use the TypeExpression which is a type that
5928 is fully resolved (without involving the regular C# resolution
5931 This typically looks like this:
5933 TypeExpression texpr = new TypeExpression (LinqExpression.expression_type, loc);
5934 new MemberAccess (texpr, name, type_arguments, loc)
5936 This avoids the problem in: #355178
5938 2008-01-21 Marek Safar <marek.safar@gmail.com>
5940 * cs-parser.jay, expression.cs: Check `namespace alias qualifier' language
5941 feature in parser only as we do in other cases.
5943 2008-01-21 Marek Safar <marek.safar@gmail.com>
5945 * attribute.cs, ecore.cs, class.cs, delegate.cs, expression.cs, linq.cs,
5946 typemanager.cs: A refactoring of params arguments to reuse existing
5947 expressions (params -> array initializer) to emit params argument instead
5948 of specialized handling.
5949 It was required by expression tree implementation and it has other benefits
5950 as well, we now apply same optimization for params arguments as we do for
5953 2008-01-18 Marek Safar <marek.safar@gmail.com>
5955 A fix for bug #353526
5956 * generic.cs: A type inference of params arguments may not required any
5957 temporary array creation.
5959 2008-01-18 Marek Safar <marek.safar@gmail.com>
5961 A fix for bug #353534
5962 * generic.cs, ecore.cs, expression.cs: A method group type inference is
5963 supported for delegates only.
5965 2008-01-18 Marek Safar <marek.safar@gmail.com>
5967 * generic.cs: Fixed 3.0 type inference fixing phase to determine a unique
5968 type for more than 1 candidates.
5970 2008-01-18 Marek Safar <marek.safar@gmail.com>
5972 * typemanager.cs, ecore.cs, expression.cs: Implemented ArrayLength and Call
5975 2008-01-16 Marek Safar <marek.safar@gmail.com>
5977 * generic.cs, typemanager.cs, lambda.cs, parameter.cs, ecore.cs, constant.cs,
5978 expression.cs: Implemented Add, And, AndAlso, and ArrayIndex (without unary
5979 operator) expressions.
5981 2008-01-16 Zoltan Varga <vargaz@gmail.com>
5983 * statement.cs: Avoid declaring an IL variable for this_variable since it is
5984 not accessed from the generated IL.
5986 2008-01-14 Marek Safar <marek.safar@gmail.com>
5988 * typemanager.cs, lambda.cs, parameter.cs, ecore.cs, class.cs, delegate.cs,
5989 iterators.cs, convert.cs, assign.cs, anonymous.cs, expression.cs,
5990 statement.cs: The first expression tree implementation drop, mostly
5991 infrastructure work.
5993 2008-01-14 Marek Safar <marek.safar@gmail.com>
5995 * ecore.cs (IsNestedChild): Refactored.
5997 2008-01-11 Marek Safar <marek.safar@gmail.com>
5999 * lambda.cs: Don't use a cast on unknown expression statement.
6001 2008-01-10 Geoff Norton <gnorton@novell.com>
6003 * cs-tokenizer.cs: One more token to distinguish between method and lambda
6006 2008-01-09 Marek Safar <marek.safar@gmail.com>
6008 * doc.cs: Report better /doc crash details.
6010 2008-01-09 Marek Safar <marek.safar@gmail.com>
6012 A fix for bug #352536
6013 * ecore.cs, assign.cs, codegen.cs: Check event assignments.
6015 2008-01-08 Marek Safar <marek.safar@gmail.com>
6017 A fix for bug #352287
6018 * ecore.cs, expression.cs: Do `this' access checking in all member access
6021 2008-01-08 Marek Safar <marek.safar@gmail.com>
6023 * rootcontext.cs, driver.cs: Switch to linq mode by default.
6025 * report.cs: Reset message stacks.
6027 2008-01-08 Marek Safar <marek.safar@gmail.com>
6029 * generic.cs (InferInPhases): Correctly calculate params position.
6031 2008-01-08 Marek Safar <marek.safar@gmail.com>
6033 * cs-tokenizer.cs: No need to parse full string when parsing lambda
6036 2008-01-07 Marek Safar <marek.safar@gmail.com>
6038 * cs-tokenizer.cs: Enabled lambda arguments micro-parser for all profiles.
6040 * decl.cs (LookupNamespaceOrType): Don't cache names which caused an error.
6042 * driver.cs: Updated --help option.
6044 2008-01-07 Marek Safar <marek.safar@gmail.com>
6046 * generic.cs (InferParamsTypeArguments): Removed.
6047 (InferInPhases): Add params type inference.
6048 (LowerBoundInference): Fixed scoring mechanism.
6050 * cs-tokenizer.cs (PreProcessPragma): Use Location instead of line.
6052 2008-01-06 Gert Driesen <drieseng@users.sourceforge.net>
6054 * typemanager.cs: On 2.0 profile, GetPublicKeyToken returns an empty
6055 byte array for unsigned "baked" assemblies.
6057 2008-01-05 Gert Driesen <drieseng@users.sourceforge.net>
6059 * codegen.cs: AssemblyName.GetPublicKey returns a zero-length byte
6060 array for assemblies that are not strongnamed.
6062 2008-01-04 Marek Safar <marek.safar@gmail.com>
6064 A fix for bug #351481
6065 * expression.cs (MemberAccess.ResolveNamespaceOrType): Use correct
6066 declaring type for nested generic types.
6068 2008-01-04 Marek Safar <marek.safar@gmail.com>
6070 * namespace.cs, class.cs, decl.cs, cs-parser.jay: Use GetSignatureForError
6071 instead of ToString.
6073 2008-01-03 Marek Safar <marek.safar@gmail.com>
6075 A fix for bug #351047
6076 * expression.cs (Binary.ResolveOperator): Allow equality operators between
6077 null and structs only when equality and inequality operators are defined
6078 either as an user-operators or predefined operators.
6080 2008-01-03 Marek Safar <marek.safar@gmail.com>
6082 A fix for bug #351047
6083 * generic.cs, typemanager.cs, class.cs: New IsReferenceType helper method.
6085 2008-01-03 Marek Safar <marek.safar@gmail.com>
6087 A fix for bug #351257
6088 * cs-tokenizer.cs: Advance line number for '\r' correctly.
6090 2008-01-03 Marek Safar <marek.safar@gmail.com>
6092 A fix for bug #351157
6093 * class.cs (Using): Fixed yet another broken cloning.
6095 (Block): Put back more sensible default value for statements.
6097 2008-01-01 Gert Driesen <drieseng@users.sourceforge.net>
6099 * codegen.cs: Allow AssemblyVersion with only major version component.
6102 2007-12-29 Marek Safar <marek.safar@gmail.com>
6104 A fix for bug #324654
6105 * class.cs: Use FullName property as member name.
6107 2007-12-28 Marek Safar <marek.safar@gmail.com>
6109 A fix for bug #342117
6110 * generic.cs (ConstraintChecker): Struct constraint also satisfies default
6111 constructor constraint.
6113 2007-12-28 Marek Safar <marek.safar@gmail.com>
6115 A fix for bug #338273
6116 * class.cs (ProbertyBase): Access modifier checks are required for overrides
6119 2007-12-28 Marek Safar <marek.safar@gmail.com>
6121 A fix for bug #350839
6122 * ecore.cs (MethodroupExpr): Probing hacks are no longer required.
6124 2007-12-27 AdTsai (http://code.google.com/u/AdTsai/)
6126 Reviewed by Ben Maurer, Miguel de Icaza, patches from Google's
6129 http://code.google.com/p/google-highly-open-participation-mono/issues/detail?id=4
6131 * statement.cs: Changed some Hashtables to use HybridDictionaries
6132 instead. It was observed that some HashTables only contained a few
6133 items in the vast majority of cases. Since HybridDictionary is
6134 more efficient on small sets (<10 elements), "known_variables"
6135 from class ExplicitBlock as well as "labels" and "constants " from
6136 class Block were changed to HybridDictionaries.
6138 Atsai results: (56216kb->54987kb)
6140 Miguel results (bootstrap of mcs): 59819kb -> 59290kb
6143 2007-12-27 AdTsai (http://code.google.com/u/AdTsai/)
6145 Reviewed by Ben Maurer, Miguel de Icaza, patches from Google's
6148 http://code.google.com/p/google-highly-open-participation-mono/issues/detail?id=4
6150 * expression.cs: foreach loop to for loop, saved on allocation of
6151 enumerator (59333kb->59141kb)
6153 * statement.cs. Changed foreach loops to for loops, saved on
6154 allocation of enumerator (59141kb->59006kb)
6156 * decl.cs: ArrayLists in .NET 1.1 allocate 16 elements by default
6157 when constructed with no specified capacity. This was causing a
6158 few ArrayLists to allocate more memory than they would potentially
6159 need in the Block class and MemberCache class. Setting the
6160 ArrayLists to construct with a capacity of 1 saves some
6161 memory. (56216kb->55585kb)
6163 2007-12-27 Marek Safar <marek.safar@gmail.com>
6165 A fix for bug #347189 (2nd issue)
6166 * expression.cs (MemberAccess): Nested type can be found in base non-generic
6169 2007-12-27 Miguel de Icaza <miguel@novell.com>
6171 * report.cs: Do not use colors if stdout and stderr are not a
6174 2007-12-27 Marek Safar <marek.safar@gmail.com>
6176 A fix for bug #346998
6177 * ecore.cs (MethodGroupExpr): Implemented override filter for generic
6180 2007-12-27 Marek Safar <marek.safar@gmail.com>
6182 A fix for bug #343465
6183 * class.cs: Explicit method name for nested types uses dots only.
6185 2007-12-27 Marek Safar <marek.safar@gmail.com>
6187 A fix for bug #343707
6188 * cs-tokenizer.cs: Advance line number for mixed CR/LF files correctly.
6190 2007-12-27 Marek Safar <marek.safar@gmail.com>
6192 * ecore.cs: Report type inference errors only when arguments count matches
6195 * generic.cs (NullCoalescingOperator): Cannot be applied to null.
6197 * expression.cs, report.cs: New warning.
6199 * typemanager.cs: Catch anonymous method type too.
6201 2007-12-23 Marek Safar <marek.safar@gmail.com>
6203 A fix for bug #346379
6204 * expression.cs (UnaryMutator): Emit size of type for pointer mutator.
6206 2007-12-23 Marek Safar <marek.safar@gmail.com>
6208 A fix for bug #347359
6209 * expression.cs (Invocation): Don't resolve already resolved expression.
6211 2007-12-23 Marek Safar <marek.safar@gmail.com>
6213 A fix for bug #347189
6214 * class.cs (FixedField): Use non-dependent code only in the define phase.
6216 2007-12-23 Marek Safar <marek.safar@gmail.com>
6218 A fix for bug #348076
6219 * ecore.cs (FieldExpr.DoResolve): Allow any variable based expression.
6221 2007-12-22 Marek Safar <marek.safar@gmail.com>
6223 * ecore.cs (MethodGroupExpr.OverloadResolve): Set type arguments for
6224 discovered extension methods.
6226 2007-12-22 Marek Safar <marek.safar@gmail.com>
6228 * ecore.cs, namespace.cs, expression.cs: Removed broken ResolveGeneric
6231 2007-12-21 Miguel de Icaza <miguel@novell.com>
6233 * report.cs (ErrorMessage): Add support for using colors on
6234 terminals that support it.
6236 2007-12-21 Marek Safar <marek.safar@gmail.com>
6238 * ecore.cs: Use information about expanded params for error reporting.
6240 2007-12-21 Marek Safar <marek.safar@gmail.com>
6242 * ecore.cs, generic.cs, delegate.cs: Refactoring of method overloading code
6243 and logic for params overloads.
6245 2007-12-15 Miguel de Icaza <miguel@novell.com>
6247 * generic.cs (NullCoalescingOperator.CloneTo): implement this one,
6248 as this is also created from the parser. Fixes #349034
6250 2007-12-12 Miguel de Icaza <miguel@novell.com>
6252 * statement.cs (Throw.CloneTo): it is valid to have empty
6253 expressions for throw.
6255 2007-12-03 Marek Safar <marek.safar@gmail.com>
6257 * cs-parser.jay: Set delegate constraint parsing region correctly.
6259 2007-12-03 Marek Safar <marek.safar@gmail.com>
6261 A fix for bug #345467
6262 * typemanager.cs (IsEqual): Compare generic parameters position only.
6264 2007-11-28 Marek Safar <marek.safar@gmail.com>
6266 * expression.cs (BaseAccess): Type arguments can be null.
6268 2007-11-27 Raja R Harinath <harinath@gmail.com>
6270 * statement.cs (Block.Resolve): Ensure flow-branching tree is
6271 consistent even when an error has occured.
6272 (Switch.Resolve): Likewise.
6274 2007-11-22 Marek Safar <marek.safar@gmail.com>
6276 A fix for bug #334505
6277 * class.cs: Don't ignore InternalsVisibleTo attribute for internal
6280 2007-11-22 Marek Safar <marek.safar@gmail.com>
6282 * ecore.cs, typemanager.cs, delegate.cs, expression.cs: The first of
6283 refactorings required to resolve extension methods correctly when mixing
6284 generics and non-generics members.
6286 2007-11-20 Marek Safar <marek.safar@gmail.com>
6288 A fix for bug #342584
6289 * convert.cs: Added not documented explicit IntPtr/UIntPtr to enum
6292 2007-11-19 Marek Safar <marek.safar@gmail.com>
6294 A fix for bug #342512
6295 * delegate.cs: Use delegate argument expression when is available. Don't
6296 emit virtual call when class is sealed.
6298 2007-11-16 Marek Safar <marek.safar@gmail.com>
6300 A fix for bug #325423
6301 * assign.cs (FieldInitializer): Use resolved expression for emit.
6303 * class.cs: Print less confusing error message.
6305 2007-11-16 Marek Safar <marek.safar@gmail.com>
6307 * cs-tokenizer.cs: Removed GMCS ifdefs.
6309 * rootcontext.cs, report.cs: Report unavailable gmcs features used by
6312 * cs-parser.jay: Disabled nullable check.
6314 * generic-mcs: Copied more generic stuff.
6316 2007-11-16 Marek Safar <marek.safar@gmail.com>
6318 * gcs-parser.jay: Merged to cs-parser.jay.
6320 * generic.cs, typemanager.cs, cs-tokenizer.cs, linq.cs, Makefile
6321 * *.csproj, *.sources: Updated to use only jay parser file.
6323 2007-11-16 Marek Safar <marek.safar@gmail.com>
6325 * gcs-parser.jay: Added nullable and default expression feature checks.
6327 2007-11-16 Marek Safar <marek.safar@gmail.com>
6329 * gcs-parser.jay, cs-parser.jay, class.cs: Unified parameters parsing,
6330 it fixes many TODOs and hidden bugs.
6332 * expression: Removed duplicate error check.
6334 2007-11-15 Marek Safar <marek.safar@gmail.com>
6336 * gcs-parser.jay, statement.cs, decl.cs, ecore.cs: Try to resolve an
6337 implicitly type local variable only when it is used in a declaration.
6339 2007-11-15 Marek Safar <marek.safar@gmail.com>
6341 * attribute.cs: Use CS0612 for empty strings.
6343 2007-11-14 Marek Safar <marek.safar@gmail.com>
6345 * lambda.cs, statement.cs: Contextual return may act as a statement.
6347 2007-11-14 Marek Safar <marek.safar@gmail.com>
6349 A fix for a regression cause by #324222
6350 * class.cs: Don't report unused even when it implements an interface.
6352 2007-11-13 Marek Safar <marek.safar@gmail.com>
6354 A fix for bug #341205
6355 * ecore.cs, expression.cs: Method group expression cannot do static
6356 method access with an instance reference check before overloading takes
6359 2007-11-13 Marek Safar <marek.safar@gmail.com>
6361 A fix for bug #325359
6362 * class.cs: Use predictable name for automatically generated property.
6364 2007-11-12 Marek Safar <marek.safar@gmail.com>
6366 A fix for bug #324996
6367 * expression.cs (Is): Handle case where D is nullable and T is not
6370 * generics.cs (Nullable.HasValue): Nullable HasValue expression.
6372 2007-11-12 Marek Safar <marek.safar@gmail.com>
6374 * generic.cs, literal.cs, ecore.cs, class.cs, delegate.cs, const.cs,
6375 anonymous.cs, expression.cs, attribute.cs, codegen.cs, statement.cs:
6376 Flush small error reporting changes.
6378 2007-11-09 Marek Safar <marek.safar@gmail.com>
6380 A fix for bug #324996
6381 * expression.cs: Rewrote Is expression implementation to work with
6382 generics, nullable types, anonymous method. A const result expression
6383 uses existing infrastructure instead of custom not fully-featured one.
6385 2007-11-08 Marek Safar <marek.safar@gmail.com>
6387 A fix for bug #340202
6388 * class.cs: Consider generics for volatile field.
6390 2007-11-08 Marek Safar <marek.safar@gmail.com>
6392 A fix for bug #335594
6393 * expression.cs: Use conversion rules when handling string addition.
6395 2007-11-07 Marek Safar <marek.safar@gmail.com>
6397 A fix for bug #336651
6398 * expression.cs: Fixed a crash when probing is on.
6400 2007-11-07 Marek Safar <marek.safar@gmail.com>
6402 A fix for bug #324242
6403 * covert.cs: Added a conversion from any nullable-type with an
6404 underlying enum-type to the type System.Enum.
6406 2007-11-07 Marek Safar <marek.safar@gmail.com>
6408 A fix for bug #324222
6409 * class.cs: Report all non-used event fields.
6411 2007-11-07 Marek Safar <marek.safar@gmail.com>
6413 A fix for bug #325161
6414 * cs-parser.jay, gcs-parser.jay, decl.cs: Implemented namespace alias
6415 qualifier for generic types.
6417 2007-11-07 Marek Safar <marek.safar@gmail.com>
6419 A fix for bug #322971
6420 * expression.cs, ecore.cs: Added intermediate result value check for
6423 2007-11-07 Marek Safar <marek.safar@gmail.com>
6425 A fix for bug #324754
6426 * cs-parser.jay, gcs-parser.jay, class.cs: Try to create an interator
6427 when it was requested.
6429 2007-11-07 Marek Safar <marek.safar@gmail.com>
6431 A fix for bug #325101
6432 * expression.cs: Do type not value comparison for `is' expression.
6434 2007-11-07 Marek Safar <marek.safar@gmail.com>
6436 A fix for bug #320236
6437 * convert.cs: Don't apply user conversion on underlying target type.
6439 2007-11-06 Marek Safar <marek.safar@gmail.com>
6441 * expression.cs: Don't use unresolved expression for error reporting.
6443 2007-11-06 Marek Safar <marek.safar@gmail.com>
6445 A fix for bugs #337712, #324490
6446 * ecore.cs (MethodGroupExpr): Refactored to handle delegate method
6447 overloading resolution too.
6449 * delegate.cs: Uses MethodGroupExpr for overloading resolution. It makes
6450 the process consistent and more robust.
6452 * expression.cs, linq.cs, report.cs: Update.
6454 2007-11-02 Marek Safar <marek.safar@gmail.com>
6456 A fix for bug #332909
6457 * attribute.cs: Resolve attributes in correct context using error
6460 * rootcontext.cs: Define Obsolete attribute members as core members.
6462 2007-11-02 Marek Safar <marek.safar@gmail.com>
6464 * statement.cs: Removed unused methods.
6466 2007-10-31 Wade Berrier <wberrier@novell.com>
6468 * Makefile: reenable copy of gmcs.exe.config, but include it in EXTRA
6469 DIST (it doesn't get included because PROGRAM isn't defined to be gmcs
6472 2007-10-31 Marek Safar <marek.safar@gmail.com>
6474 A fix for bug #338102
6475 * decl.cs (CheckExistingMembersOverloads): Workaround issue with generic
6476 methods registered as non-generics.
6478 2007-10-31 Marek Safar <marek.safar@gmail.com>
6480 A fix for bugs #337712, #324490
6481 * delegate.cs: Delegate covariance and contravariance is not allowed for
6484 2007-10-31 Marek Safar <marek.safar@gmail.com>
6486 A fix for bug #337719
6487 * cs-tokenizer.cs: Restore identifier buffer when parsing contextual
6490 2007-10-30 Marek Safar <marek.safar@gmail.com>
6492 * Makefile (net_2_0_bootstrap/mcs.exe.config): Reverted copy gmcs.exe.config.
6494 2007-10-29 Marek Safar <marek.safar@gmail.com>
6496 * cs-tokenizer.cs, gcs-parser.jay, driver.cs: Fixed parsing of nested
6499 2007-10-29 Raja R Harinath <rharinath@novell.com>
6501 * Makefile (net_2_0_bootstrap/mcs.exe.config): Copy gmcs.exe.config.
6503 2007-10-29 Marek Safar <marek.safar@gmail.com>
6505 A fix for bug #334652
6506 * ecore.cs (MethodGroupExpr.OverloadResolve): Do also lookup for
6507 extension methods when we have not found the best candidate in normal
6510 2007-10-27 Marek Safar <marek.safar@gmail.com>
6512 * AssemblyInfo.cs: Keep up-to-date.
6514 2007-10-27 Marek Safar <marek.safar@gmail.com>
6516 * Makefile: Fixed generics compiler name.
6518 2007-10-27 Marek Safar <marek.safar@gmail.com>
6520 * lambda.test: removed, lambda parsing is done differently.
6522 * gen-il.cs, gen-treedump.cs, old-code.cs : Obsolete.
6524 2007-10-27 Gert Driesen <drieseng@users.sourceforge.net>
6526 * Makefile: Removed dependency on gmcs.exe.config. Fixes build.
6528 2007-10-27 Marek Safar <marek.safar@gmail.com>
6530 * Makefile, *.sources : All C# compilers are in mcs folder.
6532 * *.cs: Use existing 2_1 define for smcs.
6534 2007-10-26 Marek Safar <marek.safar@gmail.com>
6536 A fix for bug #335847
6537 * assign.cs, expression.cs: Couple of changes to avoid creating a
6538 temporary variable for each object initializer assignment statement. It
6539 simplifies struct initialization too, otherwise two temporary variables
6541 Implemented optimization of redundant default element initializers.
6543 2007-10-25 Marek Safar <marek.safar@gmail.com>
6545 A fix for bug #336766
6546 * expression.cs (Class.CheckBase): Use generic name when method is
6549 2007-10-25 Marek Safar <marek.safar@gmail.com>
6551 A fix for bug #334737
6552 * expression.cs (IndexerAccess.EmitAssign): Emit local temporary
6553 variable and not variable argument for prepared copies.
6555 2007-10-24 Marek Safar <marek.safar@gmail.com>
6557 A fix for bug #325110
6558 * class.cs, expression.cs, attribute.cs: Use open generic method when
6559 checking conditional attribute.
6561 2007-10-24 Marek Safar <marek.safar@gmail.com>
6563 * report.cs, cs-tokenizer.cs, class.cs, cs-parser.jay, anonymous.cs,
6564 expression.cs, statement.cs: Renamed method FeatureIsNotISO to
6565 FeatureIsNotAvailable.
6567 2007-10-24 Marek Safar <marek.safar@gmail.com>
6569 ** C# 3.0 Partial methods
6571 * cs-tokenizer.cs, support.cs, class.cs, decl.cs: Implemented partial
6572 methods support. Because of member cache issue with generics only
6573 non-generics partial methods are fully supported.
6575 2007-10-23 Marek Safar <marek.safar@gmail.com>
6577 * class.cs, decl.cs: Rewrote member overloads check to cope with
6578 generics and to use member cache for member checking. It also improves
6579 performance and fixes remaining overloads issues.
6581 2007-10-20 Marek Safar <marek.safar@gmail.com>
6583 * class.cs, const.cs, decl.cs, delegate.cs, enum.cs, generic.cs,
6584 roottypes.cs, typemanager.cs:
6586 A member cache creation logic changed to add members immediately and
6587 not rely on fallback. The member cache is now only prefered way
6588 how to access and find type declaration members. It saves 5 MB of memory
6589 during MWF compilation and makes code ready for more optimizations and
6590 clean-ups, it's also a pre-requirement for partial methods.
6592 2007-10-18 Raja R Harinath <harinath@gmail.com>
6594 * ecore.cs (Expression.Error_ValueCannotBeConverted): Add special
6595 handling for generic parameters.
6597 2007-10-15 Marek Safar <marek.safar@gmail.com>
6599 * class.cs (FixedField): Removed redundant volatile check.
6601 2007-10-15 Marek Safar <marek.safar@gmail.com>
6603 * class.cs, decl.cs: Fixed overload members verification to do only one
6604 check per possible collision.
6606 2007-10-13 Marek Safar <marek.safar@gmail.com>
6608 A fix for bug #325478
6609 * anonymous.cs (AnonymousContainer.Compatible): Merge are flags together
6610 and create only one disposable flags container.
6612 2007-10-12 Marek Safar <marek.safar@gmail.com>
6614 A fix for bug #332442 by Alexandre Gomes <alexmipego@gmail.com>
6615 * statement.cs (Fixed): Fixed variables cloning.
6617 2007-10-12 Marek Safar <marek.safar@gmail.com>
6619 A fix for bug #333342
6620 * class.cs (EventField): Don't mark value type event as synchronized.
6622 2007-10-12 Marek Safar <marek.safar@gmail.com>
6624 * ecore.cs, anonymous.cs (MethodGroupExpr): Use score from type
6625 inference to identify best candidate method correctly.
6626 (ProperyExpr): A range variable is read only and cannot be modified.
6628 2007-10-11 Marek Safar <marek.safar@gmail.com>
6630 * ecore.cs, delegate.cs (MethodGroupExpr): Refactored best candidate
6631 logic to identify best candidate method correctly.
6633 2007-10-11 Marek Safar <marek.safar@gmail.com>
6635 * location.cs (Equals, GetHashCode): Removed.
6637 2007-10-11 Marek Safar <marek.safar@gmail.com>
6639 * report.cs: Implemented message recorder. It is used mainly for lambda
6640 expressions to capture otherwise swallowed error messages.
6642 * anonymous.cs, lambda.cs.cs: Do full parameters check.
6644 * ecore.cs (ExtensionMethodGroup): Report binding failure at the botton
6646 (MethodGroupExpr.DoResolve): Use message recorder for error handling.
6648 * expression.cs (MemberAccess): Always report lookup failure.
6650 * location.cs: Implemented Equals, GetHashCode.
6652 * statement.cs (Return.DoResolve): Fixed hardcoded error argument.
6654 2007-10-10 Jb Evain <jbevain@novell.com>
6656 * codegen.cs: re-enable assembly version check.
6658 2007-10-09 Marek Safar <marek.safar@gmail.com>
6660 * report.cs, anonymous.cs, driver.cs, expression.cs: Added few ISO-2
6663 * namespace.cs (UsingAlias): Do correct version check.
6665 2007-10-08 Marek Safar <marek.safar@gmail.com>
6667 * expresison.cs, ecore.cs: Issue extension method error message when
6670 * rootcontext.cs: Added ISO_2 compiler mode option.
6672 2007-10-08 Marek Safar <marek.safar@gmail.com>
6674 * expresison.cs (UnaryMutator.ResolveOperator): Print more useful error
6677 2007-10-08 Marek Safar <marek.safar@gmail.com>
6679 * attribute.cs (GetString, GetBoolean): Work with both literal and
6682 * ecore.cs, expresison.cs, delegate.cs (Invocation, MethodGroupExpr):
6683 Moved method overload specific methods to MethodGroupExpr.
6685 (IndexerAccess): Re-wrote resolving mechanism, fixed many issues and
6686 it should be less memory consuming.
6688 Mon Oct 8 09:29:15 CEST 2007 Paolo Molaro <lupus@ximian.com>
6690 * codegen.cs: remove the assembly version check until the buildbot is
6693 2007-10-07 Jb Evain <jbevain@novell.com>
6695 * attribute.cs (Attribute.GetString): if the value
6696 expression is a StringConstant, return its string value.
6698 2007-10-07 Jb Evain <jbevain@novell.com>
6700 * typemanager.cs: add `assembly_version_attribute_type`.
6701 * codegen.cs: on attribute emission, check that the
6702 AssemblyVersionAttribute doesn't overflow.
6704 2007-10-05 Marek Safar <marek.safar@gmail.com>
6706 A fix for bug #324677
6707 * anonymous.cs, decl.cs: Yes another anonymous container hack. Overwrite
6708 parent container of a scope container with currently resolved one.
6710 2007-10-05 Marek Safar <marek.safar@gmail.com>
6712 A fix for bug #325534
6713 * class.cs (Invocation.DoResolve): Check invocation of object finalizer
6716 2007-10-05 Marek Safar <marek.safar@gmail.com>
6718 A fix for bug #327504
6719 * class.cs (Operator.Define): Refactored implicit and explicit user
6720 operator conversion rules.
6722 2007-10-05 Marek Safar <marek.safar@gmail.com>
6724 A fix for bug #327520
6725 * ecore.cs (ExtensionMethodGroupExpr): Emit resolved extension argument.
6727 2007-10-04 Marek Safar <marek.safar@gmail.com>
6729 A fix for bug #328022
6730 * class.cs (MethodData.Define): Use correct method to check whether
6731 a method implementents an accessor.
6733 2007-10-04 Marek Safar <marek.safar@gmail.com>
6735 A fix for bug #330069
6736 * statement.cs (Fixed.Resolve): Read the first array element only when
6737 an array is instantiated.
6739 2007-10-04 Marek Safar <marek.safar@gmail.com>
6741 * expression.cs, assign.cs, generics.cs: Print correct operator when
6742 compound assignment is used.
6744 2007-10-04 Marek Safar <marek.safar@gmail.com>
6746 A fix for bug #325841
6747 * expression.cs (ArrayAccess): Use full argument cloning only for
6748 string compound concatenation.
6750 2007-10-03 Marek Safar <marek.safar@gmail.com>
6752 A fix for bug #328774
6753 * ecore.cs (FieldExpr.EmitAssign): Fixed string concatenation compound
6755 (PropertyExpr.EmitAssign): Fixed string concatenation compound
6758 2007-10-03 Raja R Harinath <rharinath@novell.com>
6761 * ecore.cs (SimpleName.DoSimpleNameResolve): Handle Property and
6762 Event accessibility checks here. Remove some bogus code that
6763 accidently made GenericMethods work.
6764 (PropertyExpr.IsAccessibleFrom, EventExpr.IsAccessibleFrom): New.
6766 2007-09-25 Marek Safar <marek.safar@gmail.com>
6768 * expression.cs (ArrayCreation): Fixed cloning of an implicit types.
6770 * statement.cs (Block): Refactored AddVariable to allow error handling
6773 * generic.cs: New stub.
6775 2007-09-23 Marek Safar <marek.safar@gmail.com>
6777 * anonymous.cs, codegen.cs: Changed InferReturnType to be EmitContext
6780 2007-09-17 Marek Safar <marek.safar@gmail.com>
6782 * class.cs: Use partial container to record whether any partial part
6783 contains static field initializer and therefore default contructor has
6786 2007-09-14 Marek Safar <marek.safar@gmail.com>
6788 * class.cs (TypeContainer.AddPartial): Fixed an issue reported on
6789 mono-list when only one of two partial parts has defined accessibility
6792 2007-09-14 Marek Safar <marek.safar@gmail.com>
6794 A fix for bug #82845
6796 * class.cs (TypeContainer): Set correct resolve context for all field
6799 2007-09-13 Marek Safar <marek.safar@gmail.com>
6801 * assign.cs: Fixed a crash when field is resolved twice with an error.
6803 * codegen.cs: Changed InFieldInitializer to be flag.
6805 * anonymous.cs, ecore.cs, expression.cs: Update after
6806 IsInFieldInitializer rename.
6808 * const.cs: Removed unused parameter.
6810 * class.cs: Changed the way how we resolve and emit field initializers.
6811 The field initilizers have to have access to contructor block to emit
6812 compiler generated code.
6814 2007-09-13 Marek Safar <marek.safar@gmail.com>
6816 * expression.cs (MemberAccess.DoResolve): DeclSpace is broken by
6817 generics use TypeContainer instead.
6819 2007-09-12 Marek Safar <marek.safar@gmail.com>
6821 * generic.cs (TypeInferenceContext.InflateGenericArgument): Stub.
6823 * lambda.cs (ResolveParameters): Use more powerful
6824 InflateGenericArgument.
6826 * parameters.cs: Better exception message.
6828 2007-09-10 Marek Safar <marek.safar@gmail.com>
6830 * anonymous.cs (AnonymousMethodExpression.CompatibleChecks): Report
6831 correct expression block type.
6833 * ecore.cs (Expression.Error_MemberLookupFailed): Made virtual.
6835 * expression.cs (Invocation): Extracted method group resolve to
6838 2007-09-07 Marek Safar <marek.safar@gmail.com>
6840 * ecore.cs (Expression.MemberLookupFinal): Removed unused loc parameter.
6841 (MethodGroupExpr.ResolveGeneric): Use existing method group instance.
6843 * expression.cs (MemberAccess.DoResolve): Uses generic resolver for
6844 generic extension methods.
6846 2007-09-06 Marek Safar <marek.safar@gmail.com>
6848 A fix for bug #82676 (Do I get it right now?)
6849 * convert.cs (Binary.ResolveOperator): An interface is converted to the
6850 object before a standard conversion is applied.
6852 2007-09-06 Marek Safar <marek.safar@gmail.com>
6854 * convert.cs (ImplicitReferenceConversionCore): Reverted wrong fix of
6857 2007-09-05 Marek Safar <marek.safar@gmail.com>
6859 A fix for bug #82676
6860 * convert.cs (ImplicitReferenceConversionCore): Check both sides for
6861 non-generic interface types.
6863 2007-09-05 Marek Safar <marek.safar@gmail.com>
6865 A fix for bug #82690
6866 * ecore.cs (PropertyExpr.EmitAssign): Leave a copy does just that.
6868 2007-09-05 Marek Safar <marek.safar@gmail.com>
6870 A fix for bug #82571
6871 * anonymous.cs (AnonymousMethod.DoCreateMethodHost): Use internal
6872 modifier for container based methods.
6874 2007-09-05 Marek Safar <marek.safar@gmail.com>
6876 A fix for bug #82676
6877 * convert.cs (ImplicitReferenceConversionCore): From any class-type S to
6878 any interface-type T means to any of interface type T.
6880 2007-09-04 Marek Safar <marek.safar@gmail.com>
6882 * namespace.cs: We have 2 versions of System.Core assembly.
6884 2007-09-04 Marek Safar <marek.safar@gmail.com>
6886 A fix for bug #82652
6887 * class.cs (Class.GetClassBases): Compare types and not expressions.
6889 2007-09-04 Marek Safar <marek.safar@gmail.com>
6891 A fix for bug #82620
6892 * expression.cs (Invocation.EmitArguments): Duplicate params arguments
6893 actually never worked before.
6894 (IndexerAccess): Emit prepared arguments before they are modified.
6896 2007-09-04 Marek Safar <marek.safar@gmail.com>
6898 A fix for bug #82563
6899 * assign.cs: Revert wrong fix.
6901 * expression.cs (VariableReference.EmitAssign): Handle ref reference
6903 (ArrayAccess): Changed the way we emit compound (prepared) assignments.
6904 Instead of ldelema/stdind we have to use temporary variables to handle
6905 cases like String.Concat (params string[]).
6907 2007-08-31 Marek Safar <marek.safar@gmail.com>
6909 * class.cs: EmitAttributes to Emit rename.
6911 * decl.cs (MemberCore.GetClsCompliantAttributeValue): Parent can be
6913 (MemberCore.HasClsCompliantAttribute): Don't depend on
6914 GetClsCompliantAttributeValue execution.
6916 2007-08-31 Marek Safar <marek.safar@gmail.com>
6918 * anonymous.cs: Use shorter type prefix.
6920 * ecore.cs (SimpleName.DoSimpleNameResolve): Use transparent identifiers
6923 * expression.cs (LocalVariableReference.DoResolveBase): Don't capture
6924 variables when probing is on.
6926 * statement.cs (LocaLInfo.Clone): Clone correctly resolved and
6927 unresolved variables.
6928 (TopLevelBlock.GetTransparentIdentifier): Default implementation doesn't
6929 handle transparent identifiers.
6931 2007-08-26 Marek Safar <marek.safar@gmail.com>
6933 * attribute.cs (IsClsCompliant): Add nullable types test.
6935 2007-08-24 Atsushi Enomoto <atsushi@ximian.com>
6937 * doc.cs : catch other types of exception than XmlException to
6938 report CS1570. Fixed bug #82565.
6940 2007-08-23 Marek Safar <marek.safar@gmail.com>
6942 * anonymous.cs (AnonymousMethodExpressin.ExplicitTypeInference):
6943 The number of delegate parameters has to match.
6944 (AnonymousMethodExpressin.VerifyParameterCompatibility): Handles generic
6947 2007-08-21 Marek Safar <marek.safar@gmail.com>
6949 * anonymous.cs (AnonymousMethod): Generate private anonymous method
6950 to fix problem with private arguments.
6952 2007-08-20 Marek Safar <marek.safar@gmail.com>
6954 * anonymous.cs (AnonymousTypeClass): An anonymous type can be empty.
6956 * decl.cs (MemberName): Ignore generic type with no generic arguments.
6958 * expression.cs (AnonymousTypeDeclaration): An anonymous type can be
6959 empty. Add cloning suport.
6961 * roottypes.cs (GetAnonymousType): Fixed argument comparison logic.
6963 2007-08-20 Marek Safar <marek.safar@gmail.com>
6965 * convert.cs, ecore.cs, expression.cs, literal.cs: Use factory method
6966 to create EmptyCast. It handles EmptyConstantCast specialization for
6969 2007-08-18 Marek Safar <marek.safar@gmail.com>
6971 * expression.cs (Binary.is_unsigned): Handle unsafe types too.
6972 (EmitArrayArgument): One routine for array arguments.
6973 (ArrayCreation.MakeByteBlob): Fixed an array alignment.
6975 2007-08-17 Marek Safar <marek.safar@gmail.com>
6977 * cs-tokenizer.cs (GetKeyword): Handle from keyword in a different way.
6979 2007-08-17 Marek Safar <marek.safar@gmail.com>
6981 * anonymous.cs: MemberLookupFinal update.
6983 * class.cs (ConstructorInitializer): Is expression based.
6985 * delegate.cs: MethodGroupExpr update.
6987 * ecore.cs (Error_MemberLookupFailed): Improved to report better error
6989 (Error_MemberLookupFailed): Customizable error override.
6990 (MethodGroupExpr): Keep queried type for later usage.
6991 (MethodGroupExpr.OverloadResolve): Catch errors related to overload
6994 * expression.cs: Error_MemberLookupFailed refactoring.
6995 (New.DoResolve): Resolve as much as possible.
6996 (ElementInitializer.Error_MemberLookupFailed): Object initializer
6997 customization for invalid member types.
6999 * statement.cs: MethodGroupExpr update.
7001 2007-08-16 Marek Safar <marek.safar@gmail.com>
7003 * modifier.cs (Check): Check all modifiers and not only accessibility
7006 2007-08-16 Marek Safar <marek.safar@gmail.com>
7008 * ecore.cs (Expression.Error_ValueCannotBeConverted): Report always a
7009 type and not an expression.
7011 2007-08-16 Marek Safar <marek.safar@gmail.com>
7013 * statement.cs (Catch.Clone): Type and variable can be null.
7015 2007-08-16 Marek Safar <marek.safar@gmail.com>
7017 A fix for bug #81979
7018 * assign.cs (Assign.Emit): Prepare arguments for string concatenation.
7019 I am really not sure whether this is the best fix.
7021 * expression.cs (VariableReference.EmitAssign): Do prepare_load test
7024 2007-08-14 Marek Safar <marek.safar@gmail.com>
7026 ** C# 3.0 Object and collection initializers (major re-write)
7028 * assign.cs (DoResolve): Initializers are not assign related.
7030 * codegen.cs (EmitContext.CurrentInitializerVariable): Holds a varible
7031 used during collection or object initialization.
7033 * expression.cs (Error_InvalidArguments): Add initializers specific
7034 messages. More will come later because it requires some general
7036 (New.DoResolve): Better error handling for unsafe types.
7037 (EmptyExpressionStatement): New class.
7038 (ElementInitializer): An object initializer expression.
7039 (CollectionElementInitializer): A collection initializer expression.
7040 (CollectionOrObjectInitializers): A block of object or collection
7042 (NewInitialize): New expression with element/object initializers.
7044 * statement.cs: Reverted object/collection initializer hacks.
7046 * typemanager.cs (CSharpName): Filter __arglist type.
7048 2007-08-09 Marek Safar <marek.safar@gmail.com>
7050 ** C# 3.0 Anonymous Types (update to the latest standard)
7052 * expression.cs (Binary.ResolveOperator): Threat all null based types
7054 (AnonymousTypeDeclaration): Renamed from AnonymousType and simplified.
7055 (AnonymousTypeParameter): Updated.
7057 * anonymous.cs (CompilerGeneratedClass): Add custom name overload.
7058 (AnonymousTypeClass): New anonymous type container.
7060 * class.cs (AddField): Return operation result.
7062 * generic.cs: Another empty TypeArguments overload.
7064 * roottypes.cs (AddAnonymousType, GetAnonymousType): Anonymous types
7065 are stored at top of normal hierarchy.
7067 * typemanager.cs (CSharpName): Filter anonymous types.
7069 2007-08-09 Marek Safar <marek.safar@gmail.com>
7071 * expression.cs (StringConcat.Append): Handle 3 and more concatenation
7072 as single Concat call. How could we miss that :-(
7074 2007-08-08 Marek Safar <marek.safar@gmail.com>
7076 * expression.cs (ArrayCreation.CloneTo): Allocate exact size.
7078 2007-08-07 Miguel de Icaza <miguel@novell.com>
7080 * expression.cs: Fix the previous commit, the creation of the
7081 arguments array list needs also to be conditional on the arguments
7084 * class.cs: Add a little bit of help to help narrow down problems.
7086 * expression.cs (ArrayCreation.CloneTo): Argument can be null, do
7087 not try to copy in that case.
7089 * driver.cs: When building SMCS, include a new different set of
7090 default assemblies here. Do this here so we can control whether
7091 to include the default assemblies with /noconfig.
7093 2007-08-03 Marek Safar <marek.safar@gmail.com>
7095 A fix for bug #81979
7096 * expression.cs (TypeOf.GetAttributableValue): Check for type arguments
7099 2007-08-03 Marek Safar <marek.safar@gmail.com>
7101 A fix for bug #82300
7103 * anonymous.cs (AnonymousContainer.Define): Don't define anything when
7104 we are in probing scope.
7106 2007-08-03 Marek Safar <marek.safar@gmail.com>
7108 A fix for bug #82301
7110 * statement.cs (Catch.CloneTo): Clone blocks in the right order.
7111 (Statement.CloneTo): Clone and not map children blocks.
7113 2007-08-03 Marek Safar <marek.safar@gmail.com>
7115 A fix for bug #82299
7117 * expression.cs (LocalVariableReference.CloneTo): Remap local info
7120 * statement.cs (Statement.CloneTo): Clone variables before statements
7121 to allow remaping of local variables.
7123 2007-08-03 Marek Safar <marek.safar@gmail.com>
7125 A fix for bug #82296
7128 * report.cs: Log crash details for future clone problems.
7130 * statement.cs (Return.Clone): Don't clone non-existent expression.
7132 2007-08-03 Raja R Harinath <harinath@gmail.com>
7134 * class.cs (TypeContainer.AddBasesForPart): Make virtual.
7135 (Class.AddBasesForPart): Move CS0537 check here from ...
7136 * cs-parser.jay (class_declaration): ... here. Move calling of
7137 'AddBasesForPart' to ...
7138 (class_bases): ... here.
7139 (struct_declaration, interface_declaration): Update to changes.
7141 2007-08-02 Marek Safar <marek.safar@gmail.com>
7143 A fix for bug #81923
7145 * statement.cs (Using.ResolveLocalVariableDecls): Only non-user implicit
7146 conversion is allowed.
7148 2007-08-02 Marek Safar <marek.safar@gmail.com>
7150 A fix for bug #81564
7152 * ecore.cs (EventExpr): Add IsBase handling.
7154 * expression.cs (BaseAccess.CommonResolve): Events can use base accessor
7157 2007-08-02 Raja R Harinath <harinath@gmail.com>
7159 Reduce some differences between cs-parser.jay in mcs/ and gmcs/.
7160 * cs-parser.jay: Some whitespace cleanups.
7161 (current_delegate): New.
7163 (struct_declaration): Make similar to gmcs/cs-parser.jay -- add
7164 a dummy code block, and use 'type_name' instead of 'member_name'.
7165 (interface_declaration, class_declaration): Likewise.
7166 (delegate_declaration): Likewise. Rearrange slightly and use
7168 * cs-tokenizer.cs (handle_where): Rename from handle_constraints.
7169 (GetKeyword): Update to change. Use '!foo' instead of 'foo == false'.
7171 2007-08-02 Marek Safar <marek.safar@gmail.com>
7173 A fix for bug #82039
7175 * ecore.cs (TypeLookup.GetSignatureForError): Use name when type is not
7178 * typemanager.cs (CSharpName): Split to string overload.
7180 2007-08-02 Marek Safar <marek.safar@gmail.com>
7183 * report.cs: Updated warning CS0472.
7185 2007-08-01 Marek Safar <marek.safar@gmail.com>
7187 A fix for bug #82181
7189 * cs-tokenizer.cs: Ignore partial keyword inside block expression.
7191 2007-08-01 Marek Safar <marek.safar@gmail.com>
7193 A fix for bug #82277
7194 * statememnt.cs (Block.Clone): Don't clone explicit blocks twice.
7196 2007-08-01 Marek Safar <marek.safar@gmail.com>
7198 ** C# 3.0 Type Inference (major bits are working)
7200 * anonymous.cs (AnonymousMethodExpression): Removed refactored fields.
7201 (.ImplicitStandardConversionExists): Uses compatible.
7202 (.ExplicitTypeInference): Infers type arguments based on explicit arguments
7203 (.InferReturnType): New method.
7204 (.Compatible): Refactored.
7205 (.ResolveParameters): Uses factory to create resolved parameters.
7206 (.CompatibleMethod): Add probing mode support.
7207 (AnonymousContainer): Removed unused fields. Split Define and Resolve to
7208 clearly distinguish between 2 different operations.
7209 (LambdaMethod): Moved to lambda.cs.
7210 (AnonymousMethod): Removed unused fields and methods.
7211 (AnonymousDelegate): Simplified.
7213 * codegen.cs (ResolveTopBlock): Updated renamed Resolve to Define.
7215 * convert. cs (ImplicitConversionStandard): Compatible works differently.
7217 * delegate.cs (Delegate): New mehods to reduce code duplication.
7218 (.GetConstructor): New method.
7219 (.GetInvokeMethod): New method.
7220 (DelegateCreation): Updated.
7222 * ecore.cs (ResolveOverloadExtensions): Don't crash when extension method
7224 (OverloadResolve): Made probing little bit faster.
7226 * expression.cs (ParameterReference.DoResolveLValue): Reference can be null
7229 * generic.cs (TypeInferenceContext): Dummy implementation.
7231 * iterators.cs: Updated after Resolve/Define rename.
7233 * lambda.cs (LambdaExpression)
7234 (.ResolveParameters): Handles both type of arguments and type inference too.
7236 * parameter.cs (ImplicitLambdaParameter.Resolve): Sanity check.
7237 (InflateTypes): Updated.
7239 * support.cs (InflateTypes): Changed signature and updated.
7241 * typemanager.cs (LookupMemberCache): Better dynamic type check.
7242 (MemberLookup_FindMembers): More MS tricks.
7243 (GetParameterData): Ditto.
7244 (GetDelegateParameters): Uses quick path for dynamic types.
7246 2007-08-01 Marek Safar <marek.safar@gmail.com>
7248 * class.cs (MethodData.Define): EmitContext is required for generic stuff
7251 2007-07-31 Marek Safar <marek.safar@gmail.com>
7253 * statement.cs (ProcessParameters): Don't crash when parameters have wrong
7256 2007-07-26 Jb Evain <jbevain@novell.com>
7258 * typemanager.cs (TypeManager.GetConstructor): Add a method overload
7259 which takes a boolean 'report_errors', similar to the GetMethod.
7260 (InitCodeHelpers): StructLayoutAttribute.ctor(int16) is not visible
7261 in .net 2.1, do not report errors here.
7263 * typemanager.cs (TypeManager.InitCoreTypes): System.ArgIterator,
7264 System.Runtime.CompilerServices.RequiredAttributeAttribute and
7265 System.Runtime.CompilerServices.TypeForwardedToAttribute are internal
7268 * typemanager.cs (TypeManager.InitCoreTypes): Move the resolution
7269 of the type InternalsVisibleToAttribute before the first call
7270 to CoreLookupType which is allowed to fail (third boolean parameter
7271 to true). Because, during the resolution for a type that is not
7272 immediately found, we try to check if the type is not defined in
7273 a friend assembly, and to do so, we need the
7274 InternalVisibleToAttribute.
7276 2007-07-23 Miguel de Icaza <miguel@novell.com>
7278 * expression.cs (Binary): Add support for the brain-dead CSC 2.x
7279 feature that allows structs to be compared against null and inline
7280 the result as true or false.
7282 Notice that the same code is not permitted inside a generic block
7283 of code that would do:
7285 class Foo<T> where T : struct {
7292 It is only allowed if the type of T is not bound (no where
7293 clause). In my opinion, this CSC 2 behavior is broken but people
7294 seem to be using it (IronRuby does, a few bug reports on bugzilla
7295 have it and some people have complained about it).
7297 All of the users that depend on this behavior have code that is
7300 * report.cs (Warning, Error): make these take object arguments,
7301 not strings, as that allows us to take advantage of Format.
7303 2007-07-20 William Holmes <billholmes54@gmail.com>
7305 * decl.cs: Changed MemberName.CountTypeArguments to also check the
7306 Left member variable for the Count.
7307 * doc.cs: Changed DocUtil.GetMethodDocCommentName to call
7308 MemberName.CountTypeArguments to avoid a NRE.
7310 This code is contributed under the MIT X11 license
7312 2007-07-18 Marek Safar <marek.safar@gmail.com>
7314 * cs-tokenizer.cs: Improved lambda parsing and removed old code.
7316 2007-07-18 Atsushi Enomoto <atsushi@ximian.com>
7318 * doc.cs : generic method arguments are written as ``x while generic
7319 type arguments are `x. Combined with the previous change, fixed bug
7322 2007-07-18 Raja R Harinath <rharinath@novell.com>
7325 * expression.cs (Binary.ResolveOperator): When converting
7326 'a + (- b)' to 'a - b', ensure that the unary '-' is discarded.
7328 2007-07-18 Atsushi Enomoto <atsushi@ximian.com>
7330 * doc.cs : when T: or whatever x: is specified, it does not really
7331 check the doc comment's syntax correctness. Fixed bug #82006.
7333 2007-07-18 Marek Safar <marek.safar@gmail.com>
7335 * anonymous.cs (AnonymouseMethodExpression): Refactored to work with
7336 LambdaExpression better.
7338 * cs-tokenizer.cs: Changed a way how we detect lambda parameters.
7340 * driver.cs (LambdaTypeParseTest): Removed, tested method is gone.
7342 * ecore.cs (Expression.MemberLookupFailed): Don't show currect context
7343 as it can be generated.
7345 * expression.cs (Invocation.Error_InvalidArguments): Show correct
7348 * lambda.cs (LambdaExpression): Refactored to share same code with
7349 AnonymousMethodExpression.
7351 2007-07-17 Marek Safar <marek.safar@gmail.com>
7353 * anonymous.cs (MakeName): Include host name for easier debugging.
7354 (LambdaMethod): New class for lambda spcecific stuff.
7356 * attribute.cs: Set EmitContext return type.
7358 * class.cs: Set EmitContext return type.
7360 * codegen.cs (EmitContext): Return type cannot be null to stop messing
7361 with null/void meaning.
7363 * iterators.cs (ContainerType): Implemented.
7365 * rootcontext.cs: Set value of TypeManager.bool_type at early stage.
7367 * statement.cs (Return): Updated to lambda expressions.
7368 (Block.CloneTo): Parent can be null.
7370 2007-07-13 Marek Safar <marek.safar@gmail.com>
7372 A fix for bug #81917
7373 * attribute.cs (AttributeTester.GetFixedBuffer): More robust testing.
7375 * class.cs (FixedField): Check whether field is in unsafe scope.
7377 * ecore.cs (FieldExpr.DoResolve): Create fixed buffer expression here.
7378 (FieldExpr.Emit): Fixed buffers cannot be volatile.
7380 * expression.cs (ElementAccess.Resolve): Move fixed buffers resolve to
7383 * statement.cs (Fixed.Resolve): Simplified fixed buffers.
7385 2007-07-13 Marek Safar <marek.safar@gmail.com>
7387 * cs-tokenizer.cs, class.cs, decl.cs, driver.cs, namespace.cs,
7388 rootcontext.cs, expression.cs, statement.cs: Updated to use WarningLevel
7391 2007-07-13 Marek Safar <marek.safar@gmail.com>
7393 * ecore.cs (FieldExpr.AddressOf): Less confusing warning message.
7395 2007-07-13 Marek Safar <marek.safar@gmail.com>
7397 * anonymous.cs (AnonymousMethodExpression): Parameters are r/o.
7398 (AnonymousContainer.ResolveNoDefine): Another ec to aec flag conversion.
7400 * codegen.cs(EmitContext): Add ProbingMode flag.
7402 * delegate.cs (DelegateInvocation): Set few instance variables as r/o.
7404 * driver.cs: For now set both warning values.
7406 * ecore.cs (SimpleName): Name is readonly.
7407 (MethodGroup.OverloadResolve): One quick path for probing.
7409 * expression.cs (Unary): Set Oper r/o.
7410 (Binary): Set Oper r/o.
7411 (ParameterReference): Set few instance variables as r/o.
7412 (ParameterReference.DoResolveBase): Don't capture aruments when
7414 (Invocation.CloneTo): Fixed typo, looks easy, yeah.
7415 (Arglist): arguments are private.
7416 (SizeOf): type is private and r/o.
7417 (MemberAccess): arguments are private.
7419 * report.cs: Enhanced reporting on/off capabilities.
7421 * lambda.cs: Uses ec.IsInProbingMode.
7422 (ContextualReturn): Derives from return.
7424 * rootcontext.cs: For now set both warning values.
7426 * statement.cs (CloneContext.RemapBlockCopy): Remaps block to cloned
7428 (Return.Resolve): Don't die immediately.
7429 (Block.Resolve): Speed-up probing.
7430 (Block.CloneTo): Clone only child blocks.
7432 Fri Jul 13 11:19:28 CEST 2007 Paolo Molaro <lupus@ximian.com>
7434 * iterators.cs: reverted Miguel's latest change (r81925) as it
7435 breaks the build in System.
7437 2007-07-13 Miguel de Icaza <miguel@novell.com>
7439 * iterators.cs (Yield.CheckContext): Check for the iterator type
7440 also here as we can call into Yield even in codepaths that are not
7442 (MethodOrOperator is the only path that was checked).
7444 In addition to the standard check, use a more specific check for
7445 constructors to report a more verbose error.
7447 2007-07-12 Miguel de Icaza <miguel@novell.com>
7449 * ecore.cs (FieldExpr.AddressOf): Do not stop processing here,
7450 report the warning and continue
7452 * statement.cs (Using.EmitLocalVariableDecls): We were leaving
7453 values on the stack on the call to Emit. Use EmitStatement if
7454 possible, or using Emit + Pop if not possible. Fixes #82064
7456 2007-07-12 Raja R Harinath <rharinath@novell.com>
7458 * expression.cs (Invocation.IsApplicable): Reorganize slightly to
7459 avoid try...finally in some cases.
7461 2007-07-10 Marek Safar <marek.safar@gmail.com>
7463 * attribute.cs (Attribute.ResolveConstructor): Uses method group.
7465 * class.cs (ConstructorInitializer.Resolve): Use and keep method group
7466 instead of method. Re-use standard error handling.
7467 (ConstructorInitializer.Emit): Simplified.
7469 * delegate.cs: Updated after Invocation.EmitCall change.
7471 * ecore.cs (GetOperatorTrueOrFalse): Uses MethodGroupExpr only.
7472 (SimpleName.SimpleNameResolve): Set and reset in_transit flag correctly.
7473 (ExtensionMethodGroupExpr): Refactored to use same OverloadResolve
7474 method and don't permanently changing input arguments.
7475 (MethodGroupExpr): Introduced resolved best_candidate, when method group
7476 is resolved it has one of the candidates is the best one which is later
7477 used to emit. Removed a few unused method.
7478 (MethodGroupExpr.MakeUnionSet): Moved from Invocation, it belongs here.
7480 * expression.cs (StaticCallExpr.MakeSimpleCall): Uses method group.
7481 (Binary.ResolveOperator): Ditto.
7482 (ConditionalLogicalOperator.DoResolve): Ditto.
7483 (Invocation): Uses method group.
7484 (Invocation.DoResolve): Simplified.
7485 (Invocation.EmitCall): Removed useless is_static.
7486 (Invocation.Emit): Delegate to method group.
7487 (Invocation.EmitStatement): Simplified.
7488 (New): Uses method group.
7489 (MemberAccess.DoResolve): Don't destroy original expression.
7491 * statement.cs (ForEach.Resolve): Use null for no method arguments.
7493 2007-07-04 Marek Safar <marek.safar@gmail.com>
7495 * ecore.cs (VarExpr.DoResolveLValue): More restriction checks.
7498 * lambda.cs: Add custom error message type.
7500 2007-07-03 Marek Safar <marek.safar@gmail.com>
7502 * lambda.cs: Simplified little bit.
7504 * parameter.cs: Introduced ImplicitLambdaParameter.
7505 (Parameters.CreateFullyResolved): New factory instead of ctor.
7509 * delegate.cs: Updated parameter creation.
7511 2007-07-03 Marek Safar <marek.safar@gmail.com>
7513 * ecore.cs (SimpleName.GetSignatureForError): Display correctly generic
7516 * generic.cs: Synchronized with gmcs.
7518 2007-07-03 Marek Safar <marek.safar@gmail.com>
7520 * class.cs (Indexer): Check return type as soon as possible.
7522 * cs-parser.jay: Initialize implicit_value_parameter_type for interface
7525 * ecore.cs (VarExpr.DoResolveLValue): Set eclass value.
7527 * expression.cs (Invocation.Error_InvalidArguments): Show type only.
7529 * parameter.cs (Parameter): Use expression type when it is available.
7531 * support.cs (ReflectionParameters.ParameterDesc): Show an extension
7532 method modifier for the first parameter only.
7534 2007-06-24 Marek Safar <marek.safar@gmail.com>
7536 A fix for bug #81938
7537 * typemanager.cs (ChangeType): Fixed couple of char conversions.
7539 * constant.cs: Tide up an exception message.
7541 2007-06-22 Marek Safar <marek.safar@gmail.com>
7543 * ecore.cs (SimpleName.DoSimpleNameResolve): Better error reporting when
7544 an uninitialized variable is used.
7546 * expression.cs (LocalVariableReference.DoResolve): Ditto.
7548 2007-06-22 Marek Safar <marek.safar@gmail.com>
7550 * ecore.cs (SimpleName.TypeOrNamespaceNotFound): Allow to override type
7551 not found error handling.
7553 * expression.cs (ArrayCreation): Removed redundant fields and little bit
7555 (ArrayCreation.ResolveArrayElement): To be ready to customization.
7556 (ArrayCreation.DoResolve): Simplified.
7557 (ImplicitlyTypedArrayCreation.DoResolve): Implicitly typed arrays have
7558 its own resolve process.
7559 (ImplicitlyTypedArrayCreation.ResolveArrayElement): Conversion magic.
7561 2007-06-20 Marek Safar <marek.safar@gmail.com>
7563 * namespace.cs (NamespaceEntry.Error_AmbiguousTypeReference): Print
7566 2007-06-20 Marek Safar <marek.safar@gmail.com>
7568 * cs-tokenizer.cs: Removed var related stuff.
7570 * ecore.cs (Expression.ResolveAsContextualType): Introduced new method.
7571 (VarExpr): Changed to derive from SimpleName. VarExpr now behaves as
7572 a type and a keyword at same time.
7574 * decl.cs (MembeName.GetTypeExpression): Create VarExpr when type name
7577 * expression.cs (ImplicitlyTypedArrayCreation): New empty class for
7578 implicitly typed arrays, more changes will follow.
7580 * statement.cs (LocalInfo.Resolve): Resolve type as contextual type.
7582 2007-06-19 Marek Safar <marek.safar@gmail.com>
7584 * ecore.cs (VarExpr): Removed Handled field.
7586 * statement.cs (Using.ResolveLocalVariableDecls): Refactored to use
7587 build-in assign functionality.
7588 (ForEach.Resolve): Removed all implicitly typed local variable code and
7590 (ArrayForeach.Resolve): Infer implicitly typed local variable here.
7591 (CollectionForeach.Resolve): Infer implicitly typed local variable here.
7593 2007-06-18 Marek Safar <marek.safar@gmail.com>
7595 * assign.cs: Removed implicitly typed local variable check.
7597 * expression.cs (LocalVariableReference.DoResolve): Add check for self
7598 referencing implicitly typed local variable.
7599 (LocalVariableReference.DoResolveLValue): Infer implicitly typed local
7602 * statement.cs (Fixed): Removed unsupported implicitly typed local
7605 2007-06-15 Marek Safar <marek.safar@gmail.com>
7607 * decl.cs (MemberName): Moved all Unbound stuff to parser.
7609 2007-06-14 Marek Safar <marek.safar@gmail.com>
7611 A fix for bugs #81855 and #76274
7612 * attribute.cs (AttachTo): Always set owner for global attributes to
7615 * ecore.cs (Error_TypeDoesNotContainDefinition): A type location can be
7618 * cs-parser.jay: Assembly and module attributes must precede all other
7619 elements except using clauses and extern alias declarations.
7621 2007-06-13 Marek Safar <marek.safar@gmail.com>
7623 A fix for bug #81748
7625 * expression.cs: More checks for non ISO-1 features.
7627 2007-06-12 Marek Safar <marek.safar@gmail.com>
7629 A fix for bug #81807
7630 * statement.cs(Switch.TableSwitchEmit): Define null label when it's not
7631 present inside switch statement and it is required by nullable check.
7633 2007-06-12 Marek Safar <marek.safar@gmail.com>
7635 A fix for bug #81840
7636 * ecore.cs (SimpleName.ResolveAsTypeStep): Look for non-generic type
7637 when type matching fails.
7639 * namespace.cs: Tiny error message change.
7641 2007-06-12 Marek Safar <marek.safar@gmail.com>
7643 * decl.cs (CheckAbstractAndExtern): Moved to MemberCore for easier error
7644 reporting. Added automatic property check.
7646 * class.cs: Updated after CheckAbstractAndExtern relocation.
7647 (AEventPropertyAccessor.GetSignatureForError): Customized.
7649 2007-06-11 Marek Safar <marek.safar@gmail.com>
7651 * class.cs (DefineBaseTypes): Base type can be undefined.
7653 * ecore.cs (TypeLookup): Minor refactoring.
7654 (DoResolveAsTypeStep): Removed redundant check.
7656 * namespace.cs (Lookup): Removed redundant check.
7658 * rootcontext.cs (BootstrapCorlib_ResolveType): Uses normal
7659 ResolveAsTypeTerminal step.
7660 (BootstrapCorlib_*): Simplified.
7661 (PopulateCoreType): Core types can be now external.
7663 2007-06-07 Marek Safar <marek.safar@gmail.com>
7665 * anonymous.cs (VerifyExplicitParameterCompatibility): Add flag to do
7667 (InferTypeArguments): Infers anonymous expression type arguments.
7668 (Compatible): Split to Compatible and InferTypeArguments.
7670 * lambda.cs: Updated.
7672 2007-06-08 Marek Safar <marek.safar@gmail.com>
7674 * anonymous.cs (AnonymousContainer): Marked as compiler generated.
7676 2007-06-07 Raja R Harinath <harinath@gmail.com>
7678 Fix #80477, cs0135-2.cs, cs0135-3.cs
7679 * statement.cs (ToplevelBlock.ProcessParameters): Add parameter
7680 names to the "known" variables list.
7681 (Block.CheckInvariantMeaningInBlock): Handle the fact the
7682 parameter names are also "known".
7683 (Block.CheckError136): Remove.
7684 (ExplicitBlock.CloneTo): New. Set 'known_variables' in target to
7687 2007-06-07 Marek Safar <marek.safar@gmail.com>
7689 * ecore.cs (MethodGroupExpr.OverloadResolve): Print full method definition.
7691 2007-06-06 Marek Safar <marek.safar@gmail.com>
7693 * ecore.cs (SimpleName.Emit): Emitting unresolved simple name is
7694 internal error not an user error.
7696 * expression.cs (IsApplicable): Refactored to make debugging easier.
7698 * support.cs: More tricks for non-mono runtimes.
7700 * typemanager.cs (CoreLookupType): Made public.
7701 (InitSystemCore): All linq specific stuff moved to linq.cs
7703 2007-06-05 Marek Safar <marek.safar@gmail.com>
7705 * typemanager.cs (CSharpSignature): One more missing build-in types
7707 More tricks for non-mono runtime.
7709 2007-06-05 Raja R Harinath <harinath@gmail.com>
7711 * statement.cs (Block.CheckError136_InParents): Remove.
7712 (Block.AddVariable): Use GetParameterInfo instead.
7713 (ToplevelBlock.ProcessArguments): Likewise.
7715 2007-06-04 Raja R Harinath <rharinath@novell.com>
7717 * statement.cs (ToplevelBlock.CloneTo): New. Copy over parameter
7719 (ToplevelBlock.GetParameterInfo): Split out of ...
7720 (ToplevelBlock.GetParameterRefernce): ... this.
7721 (ToplevelBlock.ParameterMap): Remove.
7722 * expression.cs (ParameterReference): Update to use
7723 ToplevelParameterInfo.
7725 * statement.cs (ToplevelBlock.ProcessParameters): Workaround some
7728 * flowanalysis.cs (FlowBranching.CheckOutParameters): Move ...
7729 * statement.cs (ToplevelBlock.CheckOutParameters): ... here.
7731 * statement.cs (ToplevelBlock.ResolveMeta): Move CS0136 checks ...
7732 (ToplevelBlock.ProcessParameters) ... here.
7733 (ToplevelBlock..ctor): Invoke it.
7735 * statement.cs (ToplevelBlock.ResolveMeta): Add sanity checks for
7738 * statement.cs (IKnownVariable): New interface.
7739 (LocalInfo): Implement it.
7740 (ToplevelParameterInfo): New class.
7741 (ExplicitBlock.AddKnownVariable): Use IKnownVariable.
7742 (ExplicitBlock.GetKnownVariable): Likewise. Rename from
7743 GetKnownVariableInfo.
7745 2007-06-03 Raja R Harinath <harinath@gmail.com>
7747 Partly speed up CS0136 error checks.
7748 * statement.cs (ExplicitBlock.GetKnownVariableInfo): Remove
7749 'recurse' parameter.
7750 (Block.DoCheckError136): Only check errors in parameters. Move
7751 local variable checks ...
7752 (Block.AddVariable): ... here, and ...
7753 (ToplevelBlock.ResolveMeta): ... here.
7755 2007-06-02 Raja R Harinath <harinath@gmail.com>
7757 * statement.cs (Block.IsChildOf): Remove.
7759 * statement.cs (Statement.Clone): Move special case code ...
7760 (Block.CloneTo): ... here.
7762 2007-05-29 Raja R Harinath <rharinath@novell.com>
7764 * statement.cs (ToplevelBlock.container): Remove field. It's
7765 redundant with 'Parent'.
7766 (ToplevelBlock.ContainerBlock): Remove accessor.
7767 (ToplevelBlock..ctor): Update to changes. Register anonymous
7768 child with parent here, ...
7769 * cs-parser.jay (end_anonymous): ... not here. Don't modify
7771 (start_anonymous): Don't save current_block.
7772 (top_current_block): Remove.
7774 * statement.cs (Block.Flags): Remove IsExplicit and IsToplevel flags.
7775 (Block.Resolve): Update to changes.
7776 (Block..ctor): Move setting of "correct" 'Toplevel'
7777 and 'Explicit' fields to ...
7778 (ExplicitBlock..ctor, ToplevelBlock..ctor): ... here.
7780 2007-05-27 Raja R Harinath <harinath@gmail.com>
7783 * statement.cs (Block.Implicit): Remove.
7784 (Block): Update to changes.
7785 * flowanalysis.cs: Likewise.
7787 Mildly speed up CheckInvariantMeaningInBlock
7788 * statement.cs (ExplicitBlock.AddKnownVariable): Move here from Block.
7789 Recursively call AddKnownVariable to all enclosing blocks.
7790 (ExplicitBlock.GetKnownVariableInfo): Move here from Block.
7791 Remove recursive calls.
7792 (Block): Update to changes.
7794 New ExplicitBlock invariants
7795 * statement.cs (Block.Explicit): New field. It points to the
7796 immediately enclosing non-implicit block.
7797 (Block..ctor): Maintain the invariant.
7798 * cs-parser.jay: Take advantage of invariant.
7800 Introduce ExplicitBlock
7801 * statement.cs (ExplicitBlock): New.
7802 (ToplevelBlock): Derive from it.
7803 (Block.Flags.IsExplicit): Rename from '...Implicit' and invert
7805 (Block.Implicit): Update to changes.
7806 * cs-parser.jay: Update to changes.
7809 * codegen.cs (EmitContext.IsLastStatement): Remove.
7810 * statement.cs (Block.DoEmit): Update to changes.
7812 2007-05-25 Raja R Harinath <rharinath@novell.com>
7814 * cs-parser.jay: Use 'start_block' and 'end_block' rather than
7815 modifying current_block directly.
7817 2007-05-23 Scott Peterson <lunchtimemama@gmail.com>
7819 * class.cs: Implemented automatic properties (C# 3.0)
7820 Thanks to Marek for the help.
7822 2007-05-23 Raja R Harinath <rharinath@novell.com>
7824 * flowanalysis.cs (VariableInfo.SetAssigned): When noting a
7825 variable as assigned, note also that all its components are
7827 (MyBitVector.SetRange): New. Function to set multiple bits to true.
7829 2007-05-19 Marek Safar <marek.safar@gmail.com>
7831 * anonymous.cs, class.cs: Emit Compiler generated attribute when
7832 member is marked as compiler generated.
7834 * decl.cs (MemberCore): Refactored ModFlags into property.
7836 * modifiers.cs: Add new modifier (COMPILER_GENERATED).
7837 (Check): Check only accessibility modifiers.
7839 2007-05-18 Raja R Harinath <rharinath@novell.com>
7841 Track all assignable slots in one bit array
7842 * statement.cs (ToplevelBlock.ParameterMap): Convert into array.
7843 (ToplevelBlock.ResolveMeta): Don't create a VariableMap. Move
7844 logic from VariableMap constructor here. Use the same 'offset'
7845 variable that's later used for computing offsets of local
7847 * flowanalysis.cs (UsageVector.parameters): Remove.
7848 (UsageVector): Update to changes.
7849 (VariableMap): Remove.
7851 Avoid creating ParameterMap in every block
7852 * statement.cs (Block.ParameterMap): Move ...
7853 (ToplevelBlock.ParameterMap): ... here.
7854 (ToplevelBlock.ResolveMeta): Create VariableMap for parameters
7856 * flowanalysis.cs (FlowBranching.param_map): Remove.
7857 (FlowBranching.UsageVector): Update to changes.
7858 (FlowBranchingToplevel.CheckOutParameters): Likewise.
7860 * statement.cs (Block.CloneTo): Clone Toplevel field too.
7862 * expression.cs (ParameterReference): Distinguish between block
7863 where parameter was referenced and declared.
7865 2007-05-18 Marek Safar <marek.safar@gmail.com>
7867 * flowanalysis.cs, statement.cs: Put back improved error handling.
7869 2007-05-15 Scott Peterson <lunchtimemama@gmail.com>
7873 Imporved object and collection initialization (C# 3.0).
7875 2007-05-15 Marek Safar <marek.safar@gmail.com>
7877 A fix for bug #81380
7878 * expression.cs (Is.DoResolve): Only value types have constant `is'
7881 2007-05-15 Raja R Harinath <rharinath@novell.com>
7883 * statement.cs (ToplevelBlock.child): Remove.
7885 2007-05-15 Raja R Harinath <harinath@gmail.com>
7887 Rationalize ResolveMeta: refactoring
7888 (Block.ResolveMeta): Remove wrong or superfluous comments. Carve
7889 out constant handling code into ...
7890 (Block.DoResolveConstants): ... this.
7892 Rationalize ResolveMeta: kill local_map
7893 * statement.cs (Block.local_map, Block.LocalMap): Remove.
7894 (Block.AssignableSlots): New.
7895 (Block.ResolveMeta): Make protected. Don't create a VariableMap
7896 for locals -- move code from VariableMap here. Avoid unnecessary
7898 * flowanalysis.cs (FlowBranching.local_map): Remove.
7899 (FlowBranching..ctor): Use Block.AssignableSlots.
7900 (VariableMap): Remove unused constructors.
7902 2007-05-11 Raja R Harinath <rharinath@novell.com>
7904 * Makefile [PROFILE=net_2_0_bootstrap]: Add special-case rules.
7906 2007-05-11 Marek Safar <marek.safar@gmail.com>
7908 * typemanager.cs (IsFriendAssembly): Should not be called for building
7911 2007-05-09 Marek Safar <marek.safar@gmail.com>
7913 * literal.cs (NullConstant): Print null in all cases.
7915 * expression.cs (Binary.ResolveOperator): Implemented delegate
7916 comparison based on C# 2.0 changes.
7918 2007-04-28 Scott Peterson <lunchtimemama@gmail.com>
7920 This code is contributed under the MIT X11 license
7922 The following enables support for several C# 3.0 language features:
7924 * cs-tokenizer.cs: Added support for the "var" keyword.
7926 * ecore.cs: Refactored TypeLookupExpression.DoResolveAsTypeStep().
7927 Added VarExpr class to facilitate type inferencing.
7929 * class.cs: Added IDictionary field AnonymousTypes to TypeContainer
7930 to support anonymous types.
7932 * assign.cs: Added support for type inferencing and initialization.
7934 * anonymous.cs: Added AnonymousClass class to enable anonymous types.
7936 * expression.cs: Added implicit array support to ArrayCreation.
7937 Added 5 types and 1 interface:
7939 IInitializable Implementing classes can inject initializing
7940 statements after object instantiation.
7942 Initializer Stores data for object initialization.
7944 AnonymousType An expression for anonymous types.
7946 AnonymousTypeParameter Stores data about an anonymous type's field.
7948 NewInitialize An expression for object initialization.
7950 CollectionInitialize An expression for collection initialization.
7952 * statement.cs: Added "var" keyword support to the foreach, using, and fixed
7955 2007-05-06 Marek Safar <marek.safar@gmail.com>
7957 A fix for bug #81500
7958 * cs-tokenizer.cs: Add special handling for coalescing operator.
7960 2007-05-06 Marek Safar <marek.safar@gmail.com>
7962 A fix for bug #81529
7963 * attribute.cs (GetAttributeUsage): AttributeUsage attribute inherits
7964 its value from base class until it is redefined.
7966 2007-05-02 Raja R Harinath <rharinath@novell.com>
7968 Fix regression in cs0631-3.cs
7969 * cs-parser.jay (operator_declarator): Add opt_attributes to error
7970 fallback. Make error fallback catch more cases.
7972 2007-05-01 Miguel de Icaza <miguel@novell.com>
7974 * cs-parser.jay: Allow parameters in operator declarations to have
7977 2007-04-27 Miguel de Icaza <miguel@novell.com>
7979 * statement.cs (If.CloneTo): Only clone the FalseStatement if it
7982 * lambda.cs (ContextualReturn.Resolve): An expression is valid
7983 inside the ContextualReturn, it does not have to be an
7984 ExpressionStatement.
7986 2007-04-24 Miguel de Icaza <miguel@novell.com>
7988 * lambda.cs (ContextualReturn.Resolve): if the return type is not
7991 2007-04-23 Miguel de Icaza <miguel@novell.com>
7993 * anonymous.cs (AnonymousContainer): split the virtual Resolve
7994 method in two methods: ResolveNoDefine and Resolve.
7996 ResolveNoDefine will stop just after ResolveTopBlock has been
7999 Resolve will then continue by creating a method and issuing the
8000 call to method.Define ().
8002 (AnonymousMethod): Split and implement the new Resolve and
8003 ResolveNoDefine as well.
8005 * lambda.cs (LambdaExpression): Split the anonymous method
8006 resolution code into a separate routine (CoreCompatibilityTest)
8007 from DoCompatibleTest.
8009 (LambdaExpression.TryBuild): New method, this method tries to
8010 build the LambdaExpression with the given set of types to be used
8011 as the types for the various parameters of the lambda expression.
8013 If the compilation succeed with the given types, the infered type
8014 of the Anonymous method is returned, otherwise null is returned.
8016 2007-04-23 Marek Safar <marek.safar@gmail.com>
8018 A fix for bug #81414
8019 * delegate.cs: Better fix, moved ApplyAttributes from Define to Emit.
8021 2007-04-22 Miguel de Icaza <miguel@novell.com>
8023 * cs-tokenizer.cs: Change various identifiers here from the
8024 camelCasing to the recommended Linux-like style for instance
8025 variables from the Coding Guidelines.
8027 2007-04-19 Martin Baulig <martin@ximian.com>
8030 (Convert.ImplicitReferenceConversionCore): Allow conversions from
8031 System.Enum to System.ValueType.
8033 2007-04-13 Martin Baulig <martin@ximian.com>
8035 Rewrote implicit reference conversions. We need to distinguish
8036 between implicit reference conversions (13.1.4) and implicit
8037 boxing conversions (13.1.5).
8039 According to the spec, there's an an implicit conversion
8040 "From a one-dimensional array-type S[] to IList<T> and base
8041 interfaces of this interface, provided there is an implicit
8042 reference conversion from S to T." Note that this does not
8043 include boxing conversions.
8046 (Convert.ImplicitTypeParameterBoxingConversion): New method.
8047 (Convert.ImplicitReferenceConversion): Split into
8048 ImplicitReferenceConversionCore() and
8049 ImplicitBoxingConversionExist().
8050 (Convert.ImplicitReferenceConversionExists): Use the new
8051 ImplicitReferenceConversionCore() and ImplicitBoxingConversionExists().
8053 2007-04-12 Martin Baulig <martin@ximian.com>
8055 * convert.cs (Convert.ImplicitReferenceConversion): Move the
8056 `TypeManager.null_type' checks up to the top of the method.
8058 2007-04-11 Marek Safar <marek.safar@gmail.com>
8060 A fix for bug #81350
8061 * class.cs, decl.cs, ecore.cs, namespace.cs: The optimization for private
8064 2007-04-11 Martin Baulig <martin@ximian.com>
8066 * statement.cs (Foreach.CollectionForeach.ProbeCollectionType):
8067 Use `TypeManager.GetInterfaces(t)' rather than `t.GetInterfaces()'
8068 to make this work for generic classes; fixes #79561.
8070 2007-04-11 Martin Baulig <martin@ximian.com>
8072 * expression.cs (As): Add support for nullable types; fixes #79371.
8074 2007-04-11 Martin Baulig <martin@ximian.com>
8076 * doc.cs (DocUtil.GetSignatureForDoc): Don't crash if
8077 `type.FullName' is null; fixes #80243.
8079 2007-04-11 Martin Baulig <martin@ximian.com>
8081 * expression.cs (Invocation.IsApplicable): Don't modify the method
8082 if type inference succeeded, but the method was not applicable.
8085 2007-04-10 Marek Safar <marek.safar@gmail.com>
8087 A fix for bug #81324
8088 * namespace.cs (Namespace.LookupExtensionMethod): Always inspect both
8089 internal and external namespaces containers.
8091 2007-04-10 Martin Baulig <martin@ximian.com>
8093 * delegate.cs (DelegateCreation.ResolveMethodGroupExpr): Use
8094 TypeManager.DropGenericMethodArguments() so we also call
8095 IMethodData.SetMemberIsUsed() for generic methods. Fixes #80357.
8097 2007-04-10 Martin Baulig <martin@ximian.com>
8099 * iterators.cs (Iterator.CreateIterator): Don't crash if
8100 `method.ReturnType' is null. This happens if something went wrong
8101 while resolving that typ (we already reported an error in this case).
8103 2007-04-10 Martin Baulig <martin@ximian.com>
8105 * expression.cs (New.DoResolve): Don't call CheckComImport() on
8106 generic interfaces; report the CS0144 directly.
8108 2007-04-10 Martin Baulig <martin@ximian.com>
8110 * ecore.cs (MemberExpr.ResolveMemberExpr): If `left' is a
8111 `TypeExpr', call ResolveAsTypeTerminal() on it; fixes #81180.
8113 2007-04-10 Martin Baulig <martin@ximian.com>
8115 * expression.cs (New.DoEmitTypeParameter): Fix #81109.
8117 2007-04-09 Raja R Harinath <rharinath@novell.com>
8120 * flowanalysis.cs (UsageVector.MergeChild): Handle child.Block == null.
8121 * statement.cs: Use KillFlowBranching only in ResolveUnreachable.
8124 * statement.cs (For.Resolve): If resolution fails, use
8127 2007-04-08 Marek Safar <marek.safar@gmail.com>
8129 * anonymous.cs (MakeName): Make faster and zero-based.
8130 (VerifyExplicitParameterCompatibility): Back to mode where generic
8131 parameter is ignored.
8132 (AnonymousMethodMethod.Emit): Decorate method as compiler generated.
8134 * class.cs (EmitType): Method can emit another new method.
8136 * cs-tokenizer.cs (IsLinqEnabled): Fixes static cctor race.
8138 * driver.cs: Updated.
8140 * lambda.cs: Reuse predefined empty parameters.
8142 * parameter.cs: Updated
8144 * support.cs: Implemented InflateTypes.
8146 * typemanager.cs (GetFullName): Don't use FullName as it can be null.
8147 (InitSystemCore): Introduced to isolate 3.0 dependencies.
8149 2007-04-03 Martin Baulig <martin@ximian.com>
8153 * statement.cs (Foreach.CollectionForeach.TryType): Use a custom
8154 version of TypeManager.IsOverride() which also works with generic
8157 2007-04-03 Martin Baulig <martin@ximian.com>
8162 (Convert.ExplicitReferenceConversion): We need to cast when
8163 converting from IList<T> to S[].
8165 2007-04-01 Marek Safar <marek.safar@gmail.com>
8167 * decl.cs (FindExtensionMethods): Consider all candidates with same name
8170 * expression.cs (MemberAccess.DoResolve): Cache resolved expression.
8172 2007-03-31 Marek Safar <marek.safar@gmail.com>
8174 * anonymous.cs (AnonymousMethodExpression.Compatible): Handles both
8175 argument and return type inferring.
8177 * codegen.cs (InferReturnType): Flag whether return can be inferred.
8178 (ReturnType): Turned to property.
8180 * statement.cs (Return): Implemented return type inferring.
8182 * support.cs (ReflectionParameters): Use local types if possible.
8184 2007-03-30 Raja R Harinath <rharinath@novell.com>
8186 * flowanalysis.cs (FlowBranching.Reachability): Remove.
8187 (FlowBranching.UsageVector): Update to changes.
8189 Prepare to kill 'Reachability'
8190 * flowanalysis.cs (UsageVector): Remove 'Reachability' from
8191 argument of constructor.
8193 2007-03-29 Raja R Harinath <rharinath@novell.com>
8195 Prepare to kill 'Reachability'
8196 * flowanalysis.cs (UsageVector.is_unreachable): New.
8197 (UsageVector): Update to maintain 'is_unreachable' in parallel to
8198 'reachability', and verify they're consistent.
8201 * expression.cs (New.EmitStatement): Handle type parameters here too.
8203 2007-03-29 Martin Baulig <martin@ximian.com>
8208 (ScopeInfo.ctor): Use `Modifiers.PUBLIC' if we're a nested
8209 CompilerGeneratedClass.
8210 (ScopeInfo.EmitScopeInstance): Make this protected.
8211 (CapturedVariable.EmitInstance): Use `Ldarg_0' if
8212 `ec.CurrentAnonymousMethod.Scope == Scope'.
8214 * statement.cs (Block.ScopeInfo): Make this a property.
8216 2007-03-27 Raja R Harinath <harinath@gmail.com>
8218 Prepare to kill 'Reachability'
8219 * flowanalysis.cs (FlowBranching.Reachability): Make class private.
8220 (FlowBranching.UsageVector.Reachability): Remove property.
8221 (FlowBranching.UsageVector.IsUnreachable): New property.
8222 (FlowBranching.UsageVector.ResetBarrier): New.
8223 (FlowBranching.UsageVector, FlowBranchingLabeled): Update to changes.
8224 * codegen.cs, statement.cs: Update to changes.
8226 2007-03-27 Martin Baulig <martin@ximian.com>
8231 (DeclSpace.LookupNestedTypeInHierarchy): Correctly handle nested
8234 2007-03-26 Raja R Harinath <rharinath@novell.com>
8236 * flowanalysis.cs (FlowBranching.Reachability): Use a boolean
8237 instead of TriState. Remove all mention of TriState.
8239 * flowanalysis.cs (FlowBranching.Reachability): Prepare to be
8240 replaced by a boolean. Add boolean 'is_unreachable' field, check
8241 and maintain invariants.
8243 2007-03-25 Marek Safar <marek.safar@gmail.com>
8245 * anonymous.cs: Restored checks disabled for uninflated anonymous methods.
8247 2007-03-25 Marek Safar <marek.safar@gmail.com>
8249 * expression.cs: Stop using obsolete 2.0 opcodes.
8251 2007-03-25 Marek Safar <marek.safar@gmail.com>
8253 * enum.cs (EnumMember.Define): Fixed regression and slowdown caused by
8254 one of the latests Martin's fixes.
8256 2007-03-23 Miguel de Icaza <miguel@novell.com>
8258 * expression.cs: On BigEndian systems, swap the bytes, temporary
8259 solution until we get a new bitconverter class.
8261 2007-03-23 Martin Baulig <martin@ximian.com>
8265 * decl.cs (MemberCache.AddMembers): Add generic methods both as
8266 "Method" and "Method`1". Normally, a cache lookup is done on the
8267 "Method" form (ie. without the generic arity), but this one makes
8268 lookups on the full form work as well.
8270 2007-03-22 Raja R Harinath <rharinath@novell.com>
8272 * flowanalysis.cs (Reachability): Reorganize slightly, and remove
8275 2007-03-20 Bill Holmes <billholmes54@gmail.com>
8277 Added 2 MemberCoreArrayList objects, ordered_explicit_member_list and
8278 ordered_member_list, to TypeBuilder to store members to be defined
8279 in the order they were parsed in.
8280 - ordered_explicit_member_list contains all properties indexers
8281 and methods that are defined as explicit implementation of an
8282 interface or base class.
8283 - ordered_member_list contains all properties indexers and methods
8284 that are not defined as explicit implementation of an interface
8287 Removed MethodArrayList and IndexerArrayList from TypeBuilder. The
8288 functionality in these removed classes has been replaced with
8289 ComputeIndexerName, EmitIndexerName, HasEqualss, HasGetHashCode, and
8290 CheckEqualsAndGetHashCode members defined and called in the TypeBuilderClass.
8292 Adding CheckForDuplications to PropertyBase.PropertyMethod and calls
8293 to CheckForDuplications inside GetMethod and SetMethod Define Method
8294 to handle method property and indexer name conflicts.
8298 All code is contributed under the MIT/X11 license.
8300 2007-03-20 Martin Baulig <martin@ximian.com>
8302 * class.cs (TypeContainer.Interfaces): Removed; they're now
8303 included in `TypeContainer.Types'.
8305 2007-03-20 Martin Baulig <martin@ximian.com>
8307 Fix #77963, #80314 and #81019. Added gtest-317, ..., gtest-320.
8309 * class.cs (TypeContainer.CreateType): New public method. This is
8310 now called before DefineType() to create the TypeBuilders.
8311 (TypeContainer.DefineType): Don't create the TypeBuilder here; it
8312 has already been created by CreateType().
8313 (TypeContainer.DefineTypeBuilder): Renamed into CreateTypeBuilder();
8314 don't resolve our base classes here; this has been moved into
8315 DefineBaseTypes(). We're now called from CreateType().
8316 (TypeContainer.DefineBaseTypes): New private method; resolve our
8317 base classes here. We're now called from DefineType().
8320 (RootContext.ResolveTree): Call TypeContainer.CreateType() on all
8321 our types first to create all the TypeBuilders. After that, call
8322 TypeContainer.DefineType() on all the types which'll resolve their
8323 base classes and setup the resolve order.
8325 2007-03-20 Martin Baulig <martin@ximian.com>
8327 * class.cs (TypeContainer.Enums): Removed; they're now included in
8328 `TypeContainer.Types'.
8330 2007-03-20 Martin Baulig <martin@ximian.com>
8333 (TypeContainer.DefineType): Don't call ResolveMembers() here.
8334 (TypeContainer.DoResolveMembers): Call DefineType() on our
8335 `compiler_generated' classes; moved here from DefineNestedTypes().
8338 (RootContext.ResolveTree): Call ResolveMembers() on all
8339 TypeContainer's in the `type_container_resolve_order'.
8341 2007-03-19 Marek Safar <marek.safar@gmail.com>
8343 * class.cs: Use corlib to handle InternalMethodImplAttribute.
8345 2007-03-17 Marek Safar <marek.safar@gmail.com>
8347 * class.cs (EventFieldAccessor.EmitMethod): Don't override existing
8348 implementation flags.
8350 2007-03-17 Marek Safar <marek.safar@gmail.com>
8352 * class.cs: More optimizations for type parameters.
8354 2007-03-15 Marek Safar <marek.safar@gmail.com>
8356 * anonymous.cs (AnomymousMethod): Can be now hosted in generic container.
8358 * ecore.cs, parameter.cs: More common code for both corlibs.
8360 * typemanager.cs (IsGenericMethod): Simplified.
8362 2007-03-15 Raja R Harinath <rharinath@novell.com>
8364 * flowanalysis.cs (FlowBranching.Reachability): Remove handling of
8366 * statement.cs, iterators.cs, lambda.cs: Update to changes.
8368 * statement.cs (Lock.Resolve): Invoke 'ec.NeedReturnLabel'
8369 unconditionally. Simplify explanation.
8370 (Try.Resolve, Using.Resolve): Likewise.
8372 2007-03-15 Martin Baulig <martin@ximian.com>
8376 * decl.cs (DeclSpace): If we're a partial class, use our
8377 `PartialContainer's `TypeParameters' and `CurrentTypeParameters'.
8379 2007-03-15 Raja R Harinath <rharinath@novell.com>
8381 * flowanalysis.cs (FlowBranching.Reachability): Remove handling of
8383 (FlowBranching.UsageVector): Update to changes.
8384 (FlowBranching.MergeSiblings): Likewise.
8385 * statement.cs: Likewise.
8387 2007-03-15 Martin Baulig <martin@ximian.com>
8392 (MemberCache): Added a special .ctor for type parameters.
8395 (TypeManager.MemberLookup_FindMembers): `TypeParameter' now has a
8398 2007-03-09 Martin Baulig <martin@ximian.com>
8400 * enum.cs (Enum): Make this a TypeContainer.
8401 (EnumMember): Derive from `Const'.
8404 (Const.DoResolveValue): New protected virtual method; move most of
8405 the functionality of ResolveValue() here so we can override it in
8407 (Const.CreateConstantReference): Make this virtual.
8409 * class.cs (Kind): Add `Kind.Enum'.
8410 (TypeContainer.Emit): Don't emit the enums here; they're already
8411 in the `RootContext.typecontainer_resolve_order'.
8413 * rootcontext.cs (RootContext.EmitCode): Don't emit the enums
8414 here; they're already in the `typecontainer_resolve_order'.
8416 * ecore.cs (EnumConstant.ConvertImplicitly): Add
8417 TypeManager.DropGenericTypeArguments().
8420 (TypeManager.CSharpEnumValue): Add DropGenericTypeArguments().
8421 (TypeManager.IsEnumType): Likewise.
8422 (TypeManager.EnumToUnderlying): Likewise.
8423 (TypeManager.IsEqual): Add support for enums.
8425 2007-03-12 Raja R Harinath <rharinath@novell.com>
8427 * typemanager.cs (InitCoreTypes) [NET_2_0]: Allow
8428 DefaultParameterValueAttribute to be undefined, say if System.dll
8431 2007-03-11 Marek Safar <marek.safar@gmail.com>
8433 * ecore.cs, parameter.cs, typemanager.cs: Another gmcs fix to work with
8436 2007-03-10 Marek Safar <marek.safar@gmail.com>
8438 * class.cs, parameter.cs: Unified parameters verification.
8440 2007-03-08 Martin Baulig <martin@ximian.com>
8442 * cs-parser.jay (constructor_header): Pass the location to the
8443 newly created TopLevelBlock.
8445 2007-03-07 Martin Baulig <martin@ximian.com>
8447 * statement.cs (Block.Resolve): Don't crash on error; bug #80715.
8449 2007-03-06 Miguel de Icaza <miguel@novell.com>
8451 * convert.cs (ExplicitReferenceConversionExists): Sync this method
8452 with the changes from David, fixes the build.
8454 2007-03-05 David Mitchell <dmitchell@logos.com>
8456 * convert.cs: Implement From System.Collecitons.Generic.IList<T>
8457 and its base interfaces to a one-dimensional array type S[],
8458 provided there is an implicit or explicit reference conversion
8461 2007-03-03 Marek Safar <marek.safar@gmail.com>
8463 * cs-tokenizer.cs: Implemented basic linq grammar.
8465 * driver.cs: Set linq lang version on demand.
8467 2007-02-26 Marek Safar <marek.safar@gmail.com>
8469 * cs-parser.jay, expression.cs: Compile empty __arglist correctly.
8471 2007-02-25 Marek Safar <marek.safar@gmail.com>
8473 * attribute.cs: Replaced DefinePInvoke in favor of S.R.E implementation
8476 * class.cs (InterfaceMemberBase): Share common `extern' modifier checks
8478 Check property and event extern attributes.
8480 * codegen.cs (ModuleClass): HasDefaultCharSet when module defined global
8483 2007-02-24 Marek Safar <marek.safar@gmail.com>
8485 A fix for bug #80407
8486 * ecore.cs: Don't report ambiguity error when methods have same parent.
8488 2007-02-23 Marek Safar <marek.safar@gmail.com>
8490 A fix for bug #80878
8491 * class.cs, cs-parser.jay: Event property can host anonymous methods.
8493 2007-02-22 Marek Safar <marek.safar@gmail.com>
8495 * attribute.cs: Enable ExtensionAttribute presence test.
8497 2007-02-22 Marek Safar <marek.safar@gmail.com>
8499 * class.cs: Warn about missing GetHashCode only when Equals is override.
8501 * decl.cs: Check accessibility of type arguments.
8503 * typemanager.cs: Correctly report nullable array.
8505 2007-02-20 Marek Safar <marek.safar@gmail.com>
8507 * class.cs, report.cs: Capture more details when things go wrong.
8509 2007-02-20 Marek Safar <marek.safar@gmail.com>
8511 A fix for bug #80650
8512 * cs-parser.jay: Anonymous container starts at constructor declaration
8513 and not at block beginning because it has to be usable in constructor
8516 * statement.cs: Use context location and not block one for error reporting.
8518 2007-02-18 Marek Safar <marek.safar@gmail.com>
8520 A fix for bug #78712
8521 * class.cs.cs, decl.cs, ecore.cs: LookupAnyGeneric inspects nested types
8524 2007-02-18 Marek Safar <marek.safar@gmail.com>
8526 A fix for bug #80493 by Atsushi Enomoto
8527 * cs-parser.jay: Ignore invalid attribute target.
8529 2007-02-18 Marek Safar <marek.safar@gmail.com>
8531 * cs-tokenizer.cs: Ignore '\0' as white space character.
8533 2007-02-17 Miguel de Icaza <miguel@novell.com>
8535 * cs-parser.jay: Add support for lambda expressions to the mcs
8538 * lambda.cs: Only clone when we are probing, not on the final call
8539 (Compatible is the final call).
8541 * statement.cs (CloneContext): Introduce class to provide block
8542 remapping during clone.
8544 All statements Clone themselves now.
8546 (Clone): special handling for blocks, when we clone a block, we
8547 register the block inside this routine, as children of the block
8548 might trigger a lookup.
8550 * expression.cs: Add support for CloneContext in all expressions.
8552 2007-02-17 Marek Safar <marek.safar@gmail.com>
8554 A fix for bug #80493
8555 * statement.cs: Report ambiguous warning when interfaces are not related.
8557 2007-02-15 Marek Safar <marek.safar@gmail.com>
8559 C# 3.0 extension methods.
8561 * attribute.cs (Error_MisusedExtensionAttribute): Extension attribute
8562 cannot be used directly.
8564 * class.cs (Class.Emit): Emit extension attribute if any class method
8565 is extension method.
8566 (Method.Define): Add basic extension method validation conditions.
8567 (Method.Emit): Emit extension attribute for method.
8569 * codegen.cs (AssemblyClass): Emit extension attribute if at least one
8570 extension method exists. Currently we follow same approach as Microsoft
8571 does, emit even if a method or a class are private but this can change
8574 * cs-parser.jay: Add handling of `this' keyword in method parameters
8577 * decl.cs (DeclSpace.IsStaticClass): New property.
8578 (MemberCache.FindExtensionMethods): Looks for extension methods with
8579 defined name and extension type.
8581 * doc.cs: Updated after OverloadResolve changes.
8583 * driver.cs: Add new soft reference to System.Core.dll.
8585 * ecore.cs (MethodLookup): Can return only MethodGroupExpr.
8586 (ExtensionMethodGroupExpr): Represents group of extension methods.
8588 * expression.cs (Invocation): Moved methods BetterConversion, MoreSpecific,
8589 BetterFunction, IsOverride, IsAncestralType, OverloadResolve
8590 to MethodGroupExpr and made non-static for easier customization.
8591 (Invocation.DoResolve): Add extension method lookup when no standard
8593 (MemberAccess.DoResolve): Try extension methods if no member exists.
8595 * modifiers.cs: Add METHOD_EXTENSION modifier.
8597 * namespace.cs (RegisterExtensionMethodClass): Register class namespace
8598 as well as candidate extension type.
8599 (ComputeNamespaces): When assembly constains extension methods registers
8601 (Namespace.RegisterExternalExtensionMethodClass): Register type for later
8602 extension method lookup.
8603 (Namespace.LookupExtensionMethod): Looks for extension method in this
8605 (NamespaceEntry.LookupExtensionMethod): Does extension methods lookup to
8606 find a method which matches name and extensionType.
8608 * parameter.cs (Parameter): Add This modifer.
8609 (HasExtensionMethodModifier): New property.
8610 (Resolve): Add extension parameter check.
8611 (ModFlags): turned to property to exclude this modifier as it is not real
8613 (Parameters): Implemented ExtensionMethodType and HasExtensionMethodType.
8615 * support.cs (ParameterData): Add ExtensionMethodType.
8616 (ReflectionParameters): Implemented ExtensionMethodType interface property.
8618 * typemanager.cs: Add type and ctor extension attribute type.
8620 2007-02-15 Miguel de Icaza <miguel@novell.com>
8622 * report.cs (DisableErrors, EnableErrors): used to prevent error
8623 output when we are "trying" to compile various methods with
8626 * ecore.cs (Expression): Add Clone method that calls the virtual
8627 CloneTo method. The current CloneTo method in Expression throws
8628 an exception so we can track down all the places where this must
8629 be implemented (not using abstract, because that would be a lot of
8630 up-front-work before we can start testing the implementation
8633 Important: we only need Clone capabilities for expressions created
8634 by the parser, as the expressions we will be cloning are
8635 expressions in the pre-resolved state. This vastly simplifies
8638 (SimpleName): Add CloneTo that does nothing.
8639 (EmptyCast): Add CloneTo.
8641 * expression.cs (Binary): Implement CloneTo.
8642 (Invocation.IsApplicable): Store the current ec in
8643 EmitContext.TempEc and restore it on return. This is used so we
8644 do not have to sprinkle hundres of methods with an extra
8645 EmitContext, we know that the only user is the lambda expression
8646 ImplicitConversionExists code.
8648 (Argument): Add Cloning capabilities.
8649 (LocalVariableReference, ParenthesizedExpression, Unary, Probe,
8650 Cast, Conditional, ArrayCreation, InvocationOrCast, Invocation,
8651 ArglistAccess, ArgList, TypeOf, SizeOf, CheckedExpr,
8652 UnCheckedExpr, ElementAccess, BaseAccess, BaseIndexerAccess,
8653 IndexerAccess): Add Clone capability.
8655 (LocalVariableReference, This): TODO: needs cloned Block mapping.
8657 (Argument): Add cloning capability.
8659 * assign.cs (Assign): Implement CloneTo.
8661 * anonymous.cs (ImplicitStandardConversionExists): Make virtual.
8663 * lambda.cs (ImplicitStandardConversionExists): Implement lambda
8664 version by calling Convert with the EmitContext (that we are
8665 currently storing in ec, this is not great, but will do for now,
8666 to avoid passing EmitContext parameters to hundreds of functions
8667 that do not need them now).
8669 (SetExpression): Remove, it is not needed.
8671 (ContextualReturn): Implement CloneTo.
8673 * statement.cs (Statement): Implement cloning infrastructure,
8674 similar to expressions.
8676 (Block): Partial implementation of Clone for statements.
8678 (Return): Implement clone.
8680 * constant.cs (Constant.CloneTo): New method, does nothing.
8682 * codegen.cs (TempEc): Add a static EmitContext as a temporary
8683 solution, until we decide how to exactly do this.
8685 2007-02-14 Marek Safar <marek.safar@gmail.com>
8687 A fix for bug #80493
8688 * class.cs (FindOutBaseMethod): When the base accessor does not exist and
8689 a property is override we need to use second accessor.
8691 2007-02-13 Marek Safar <marek.safar@gmail.com>
8693 A fix for bug #80418
8694 * attribute.cs, class.cs: Use correct calling conventions for pinvoke
8697 2007-02-13 Marek Safar <marek.safar@gmail.com>
8699 Another fix for bug #80749
8700 * pending.cs: Abstract class has priority over interfaces.
8702 2007-02-13 Marek Safar <marek.safar@gmail.com>
8704 Another fix for bug #80749
8705 * pending.cs: Abstract class has priority over interfaces.
8707 2007-02-13 Marek Safar <marek.safar@gmail.com>
8709 Another fix for bug #80749
8710 * pending.cs: Abstract class has priority over interfaces.
8712 2007-02-13 Marek Safar <marek.safar@gmail.com>
8714 Another fix for bug #80749
8715 * pending.cs: Abstract class has priority over interfaces.
8717 2007-02-13 Marek Safar <marek.safar@gmail.com>
8719 * class.cs Better error message.
8721 * driver.cs: Add shorter versions of -optimize option.
8723 2007-02-13 Martin Baulig <martin@ximian.com>
8725 * class.cs (Constructor.Emit): Check the return value of
8726 ec.ResolveTopBlock() and return on error.
8728 2007-02-13 Raja R Harinath <rharinath@novell.com>
8730 * ecore.cs (Error_InvalidExpressionStatement): Add a comma to error
8731 message to fix error message regression.
8733 2007-02-12 Marek Safar <marek.safar@gmail.com>
8735 * delegate.cs: Delegate creation expression cannot be of Nullable type.
8737 2007-02-12 Marek Safar <marek.safar@gmail.com>
8739 A fix for bug #80749
8740 * assign.cs (FieldInitializer): FieldInitializer has to keep track of
8741 its parent container.
8743 * class.cs (DefineFieldInitializers): Each initializer can has different
8746 * const.cs: Updated.
8748 2007-02-11 Miguel de Icaza <miguel@novell.com>
8750 * lambda.cs (LambdaExpression.Compatible): Remove some early code,
8751 now all the heavy lifting to check that embedded statements or
8752 expressions have the right form is done in the ContextualReturn.
8754 (ContextualReturn): New class.
8756 * ecore.cs (Error_InvalidExpressionStatement): Make a helper
8757 method that can be invoked to report 201, so we do not replicate
8760 * cs-parser.jay: Reuse Error_InvalidExpressionStatement.
8762 * cs-tokenizer.cs (xtoken): Correctly compute the column, it was
8763 treating tabs as spaces.
8765 2007-02-09 Marek Safar <marek.safar@gmail.com>
8767 A fix for bug #80315 by martin.voelkle@gmail.com (Martin Voelkle)
8768 * assign.cs: Use full implicit conversion for right side check.
8770 2007-02-09 Marek Safar <marek.safar@gmail.com>
8772 * statement.cs (Switch): Switch over boolean type is not standardized.
8774 2007-02-08 Marek Safar <marek.safar@gmail.com>
8776 A fix for bug #80755
8777 * decl.cs (FindBaseEvent): Don't use method cache for events.
8779 2007-02-07 Marek Safar <marek.safar@gmail.com>
8781 * cs-parser.jay: Better syntax error handling.
8783 * ecore.cs, enum.cs, statement.cs, typemanager.cs: Print enum member name
8784 instead of underlying type value.
8786 2007-02-06 Marek Safar <marek.safar@gmail.com>
8788 * driver.cs: Check define identifier before is registered.
8790 * namespace.cs: Use existing error message.
8792 * report.cs: New warning.
8794 2007-02-06 Marek Safar <marek.safar@gmail.com>
8796 A fix for bug #80742
8797 * expression.cs: Delegate Invoke method can be called directly.
8799 2007-02-06 Marek Safar <marek.safar@gmail.com>
8801 A fix for bug #80676
8802 * class.cs (IsEntryPoint): The Main method can have params modifier.
8804 2007-02-04 Miguel de Icaza <miguel@novell.com>
8806 * parameter.cs (Parameter, Parameters): Add Clone method.
8808 * anonymous.cs (Compatible): Turn method into virtual method, so
8809 LambdaExpression can implement a different behavior.
8811 (CompatibleChecks, VerifyExplicitParameterCompatibility): Factor
8812 out the basic checking here, so it can be used by
8815 * lambda.cs: Introduce "Compatible" function that will do the
8818 2007-02-02 Marek Safar <marek.safar@gmail.com>
8820 * attribute.cs: Unified one error message.
8822 * class.cs (Class): Use type attributes and not properties to test static
8824 (IsEntryPoint): Don's pass local variable.
8826 * convert.cs: Removed duplicate check.
8828 * decl.cs, doc.cs, ecore.cs (LookupType): Renamed to LookupNamespaceOrType.
8830 * driver.cs: Don't crash when soft reference does not exist.
8832 * namespace.cs (EnsureNamespace): Renamed to RegisterNamespace.
8833 (UsingEntry): Removed redundant allocation.
8835 * parameter.cs: Add fast path for type parameters.
8837 * support.cs: Don't allocate attribute when it's not used.
8839 2007-01-30 Miguel de Icaza <miguel@novell.com>
8842 (AnonymousMethodExpression.ImplicitStandardConversionExists): turn
8843 this into a virtual method, so we can override it in LambdaExpression.
8845 * driver.cs: Improve diagnostics in case of failure.
8847 * cs-tokenizer.cs: Instead of trying to parse a type and a name,
8848 write a function that is slightly more complex and that parses:
8850 type identifier [, type identifier]* )
8852 The old function would return incorrectly a OPEN_PARENS_LAMBDA for
8855 (canEmpty ? i >= 0 : i > 0)
8857 2007-01-30 Raja R Harinath <rharinath@novell.com>
8859 * cs-tokenizer.cs (parse_namespace_or_typename): Don't throw an
8860 exception on possibly valid code.
8862 2007-01-29 Raja R Harinath <rharinath@novell.com>
8864 * cs-tokenizer.cs (is_punct) ['<']: Update to changes in
8866 (parse_opt_type_arguments): Remove. It's almost the same as
8868 (parse_namespace_or_typename): Use parse_less_than.
8870 2007-01-28 Miguel de Icaza <miguel@novell.com>
8872 * cs-tokenizer.cs: Typo fix, its not GMCS_SOURCES but GMCS_SOURCE,
8873 this bug took a few hours to find, because the state saved and
8874 restored by PushPosition and PopPosition was ignoring the state of
8875 parse_generic_less_than.
8877 I can also now remove the handling of OP_LT and OP_GT, this solves
8880 * cs-tokenizer.cs: store the location for the ARROW token, we use
8883 (PushPosition, PopPosition): save/restore also `current_token',
8884 restore `parse_generic_less_than' (was missing).
8886 (parse_opt_type_arguments): use parse_type, not
8887 parse_namespace_or_typename to parse types.
8889 * lambda.cs: Empty new file, will eventually have the lambda
8890 expression implementation.
8892 * lambda.test: used to test the internal tokenizer.
8894 * report.cs (FeatureIsNotISO1): Rename from
8895 FeatureIsNotStandardized, because it was about the language level
8896 (1 vs 2) it was not about standarization.
8898 (FeatureRequiresLINQ): New.
8900 * support.cs (SeekableStreamReader): Only require that the reader
8901 is a TextReader, not a StreamReader, so we can plug StringReader.
8903 * cs-tokenizer.cs (parse_type_and_parameter): Returns true if at a
8904 given position in the input stream the following tokens can be
8905 parsed as a type followed by an identifier.
8907 (is_punct): after a '(' if parse_type_and_parameter returns true,
8908 then return a special token OPEN_PARENS_LAMBDA which is used to
8909 avoid reduce/reduce errors in the grammar for the
8910 lambda_expression rules.
8912 (parse_type): implement a type parser inside the
8913 tokenizer, the parser only returns true or false depending on
8914 whether the input at a given position can be parsed as a type.
8916 (peek_token): new method used during type parsing.
8918 2007-01-28 Raja R Harinath <rharinath@novell.com>
8921 * anonymous.cs (ScopeInfo.InflateParameters): New.
8922 (AnonymousContainer.Resolve): Use it to redirect types of
8923 delegate parameters.
8925 2007-01-27 Raja R Harinath <rharinath@novell.com>
8928 * expression.cs (Error_InvalidArguments): Don't use two different
8929 messages for CS1503. Use ExtraInformation and
8930 SymbolRelatedToPreviousError instead.
8933 * decl.cs (DeclSpace.initialize_type_params): Don't access
8934 'type_params' of a partial class directly.
8936 2007-01-26 Miguel de Icaza <miguel@novell.com>
8938 * constant.cs: Removed a handful of out-of-range checks that were
8941 2007-01-25 Marek Safar <marek.safar@gmail.com>
8943 * expression.cs (CheckUselessComparison): Add additional check for char
8946 * namespace.cs: Fixed typo.
8948 2007-01-23 Miguel de Icaza <miguel@novell.com>
8950 * constant.cs: Bloat removal, CheckRange and CheckUnsigned are
8951 gone, instead we inline the test, preventing the needless casts to
8952 longs, ulongs and doubles for the parameters, avoiding calls to
8953 methods that overchecked stuff, and instead inlined things
8956 2007-01-20 Marek Safar <marek.safar@gmail.com>
8958 * cs-parser.jay: Better parameter error handling.
8960 2007-01-17 Marek Safar <marek.safar@gmail.com>
8962 A fix for bug #80368, #80522
8963 * expression.cs (ArrayCreation.only_constant_initializers): Indicates
8964 whether array initializer contains constants only.
8965 (ArrayCreation.Emit): Use better formula to decide when
8966 are array initializers for static initialization.
8967 (ArrayCreation.EmitDynamicInitializers): When the array is small enough we
8968 have to emit even constants otherwise they are pre-initialized.
8970 2007-01-17 Bill Holmes <bill.holmes@ansys.com>
8971 Raja R Harinath <rharinath@novell.com>
8973 Fix emit order of 'get' vs. 'set'.
8974 * support.cs (Accessors): New.
8975 * cs-parser.jay (accessor_declarations): Use it instead of 'Pair'.
8976 Note the order in which accessors are declared in the source.
8977 * class.cs (PropertyBase.DefineGet, PropertyBase.DefineSet): New.
8978 Refactored from Property.Define and Indexer.Define.
8979 (PropertyBase.DefineAccessors): New helper that calls the above in
8980 appropriate order as noted by the parser.
8981 (Property.Define, Indexer.Define): Update to changes.
8982 (PropertyBase.SetMethod.PropertyInfo): Don't return a null.
8984 2007-01-17 Raja R Harinath <rharinath@novell.com>
8986 Fix cs0029-6.cs and gcs0029-2.cs (regression)
8987 * ecore.cs (EmptyConstantCast.ConvertImplicitly): Check that
8988 there's an implicit conversion from the current type to the target
8989 type before converting the underlying constant.
8991 2007-01-16 Marek Safar <marek.safar@gmail.com>
8993 * const.cs (ResolveValue): Updated after constant conversion was made more
8996 * constant.cs (GetAttributableValue): constant to object conversion is
8997 used for attributes only.
8998 (IntConstant.ConvertImplicitly): Moved from convert to be used in all
8999 constant conversions.
9000 (LongConstant.ConvertImplicitly): Ditto.
9002 * convert.cs (ImplicitNumericConversion): Extracted constant bussiness.
9003 (ImplicitConversionStandard): Handle constant conversion as extra step.
9004 It solves the issue when constant conversion was called indirectly like
9005 inside array initializer and constant folding was skipped.
9007 * literal.cs (NullLiteral.ConvertImplicitly): Fixed an issue exposed by
9010 * statement.cs(ImplicitConversionStandard): Updated after constant
9011 conversion was made more generic.
9013 2007-01-16 Sergey P. Kondratyev <se@unicom.tomica.ru>
9015 * expression.cs (As.DoResolve): Use GenericConstraints instead of
9016 Constraints, solves the problem where the compiler incorrectly
9017 reported that a type parameter was not constrained to a class (Bug
9020 2007-01-14 Marek Habersack <grendello@gmail.com>
9022 * doc-bootstrap.cs: Fix a compilation problem in the bootstrap phase.
9024 2007-01-14 Marek Safar <marek.safar@gmail.com>
9026 A fix for bug #80368
9027 * assign.cs (FieldInitializer): New class implements field
9028 initializer statement.
9030 * attribute.cs: Update after FieldMember rename.
9032 * class.cs (PropertyBasedMember): New common class for property based
9034 (InterfaceMemberBase): New base class for all members which can be used as
9035 an interface members.
9036 (MethodCore): Moved really common code to InterfaceMemberBase.
9037 (Method.Define): Equal and GetHasCode detection is relevant for methods
9039 (MethodData.Define): Don't assume that public event implements an
9040 interface automatically.
9041 (MethodData.DefineMethodBuilder): Issue an error even if only extern
9043 (MemberBase): Moved all interface speficic code to InterfaceMemberBase.
9044 (FieldMember): Merged with FieldBase.
9045 (EventProperty.AEventPropertyAccessor): New specialization to check whether
9046 event extern modifier can be used.
9047 (EventField.EventFieldAccessor): Moved event field specific code here.
9048 (Event.AllowedModifiers): Even event can be extern.
9049 (Event.FindOutBaseMethod): New override specific to events.
9050 (Indexer.parameters): Reintroduce parameters because base class holds
9051 only properties common data.
9052 (Indexer.CheckForDuplications): Indexers are threated as methods so we
9053 need do extra parameters check.
9055 * const.cs: Update after FieldMember rename.
9057 * decl.cs (MemberCache.FindBaseEvent): New method.
9059 * doc.cs (GetMethodDocCommentName): Accept parameters as extra argument
9060 to reflect that indexer is now derived from PropertyBased.
9062 * ecore.cs (GetMemberType): Made public.
9063 (EventExpr.ResolveMemberAccess): Use right event cache and checks for
9066 * flowanalysis.cs, statement.cs: Update after FieldMember rename.
9068 * typemanager.cs (CSharpSignature): Correctly print event accessors.
9069 (RegisterEvent): Removed.
9070 (RegisterPrivateFieldOfEvent): Renamed to RegisterEventField.
9071 (GetPrivateFieldOfEvent): Renamed to GetEventField.
9073 2007-01-11 Raja R Harinath <rharinath@novell.com>
9076 * statement.cs (CollectionForeach.TryType): Prefer generic
9077 GetEnumerator over non-generic variant. Fix code to follow comments.
9079 2007-01-09 Raja R Harinath <rharinath@novell.com>
9082 * support.cs (ReflectionParameter): Don't use an invalid index on
9083 the generic parameter data.
9085 2007-01-08 Miguel de Icaza <miguel@novell.com>
9087 * driver.cs: Just add a tiny bit of infrastructure.
9089 2007-01-02 Marek Safar <marek.safar@gmail.com>
9091 * class.cs (VerifyMembers): Fixed an crash reported on mono mailing list
9092 where field type is struct from current assembly.
9094 * ecore.cs (EnumConstant.AsString): Report an enum member name whenever
9097 2007-01-02 Marek Safar <marek.safar@gmail.com>
9099 A fix for bug #80381
9100 * attribute.cs (AttributeTester.RegisterNonObsoleteType): Registers
9103 * namespace.cs (GlobalRootNamespace.LookupTypeReflection): Better error
9105 (Namespace.LookupType): Always use core types from corlib when speficied.
9107 * report.cs: A new warning.
9109 * rootcontext.cs (BootstrapCorlib_ResolveInterface,
9110 BootstrapCorlib_ResolveClass): Register type as non-obsolete type.
9111 (ResolveCore): Add missing System.Runtime.InteropServices._Attribute.
9113 * typemanager.cs (CoreLookupType): Register type as non-obsolete type.
9114 (InitCoreTypes): Set expression type of object_type and value_type
9115 immediately after lookup.
9117 2007-01-01 Miguel de Icaza <miguel@novell.com>
9119 * cs-tokenizer.cs: Accept Pc class characters (Connector
9120 Punctuation) as valid identifiers. Fixes #78259
9122 * expression.cs (Invocation.DoResolve): Moved the check for the
9123 use of `this' for doing method calls to the Invocation resolution
9124 step, after overload resolution has taken place instead of doing
9125 the check at the low-level `This.DoResolve' level.
9127 The `This.DoResolve'(appens before overload resolution, so it has
9128 no way of knowing if the method that will be called will be
9129 instace or static, triggering an erroneous report for cs0188 (Bug
9132 We now do the check for instance method invocations after we know
9133 what method will be called.
9135 (This.CheckThisUsage): Move the actual use of this structure
9136 checking into its own method and expose it.
9138 * Everywhere that called Error_ValueCannotBeConverted: pass a new
9141 Exceptions: Null.ConvertImplicitly,
9142 Constant.ImplicitConversionRequired as there are too many call
9143 sites for passing the ec.
9145 * ecore.cs (Expression.Error_ValueCannotBeConverted): Take an
9146 EmitContext, if the value is null, then we do not try to provide
9147 the extra information from the error (If a userdefined conversion
9148 exists, as UserDefinedConversion requires a non null-EmitContext).
9152 2006-12-30 Raja R Harinath <rharinath@novell.com>
9154 * flowanalysis.cs (MyBitVector): Document some invariants.
9155 (MyBitVector.Or, MyBitVector.And): Reimplement the optimizations
9156 introduced below, and add a couple of others,
9158 2006-12-30 Marek Safar <marek.safar@gmail.com>
9160 * attribute.cs (GetMethodObsoleteAttribute): Uses new
9161 GetPropertyFromAccessor and GetEventFromAccessor.
9163 * class.cs (MethodCore.CheckBase): A new warning when obsolete member
9164 overrides non-obsolete one.
9165 (Indexer.Define): Error message has been moved to the parser.
9167 * cs-parser.jay: Better syntax errors handling.
9169 * delegate.cs (NewDelegate.DoResolve): Issue less confusing error message
9170 when an invocation has no arguments.
9172 * ecore.cs: Removed not used caching.
9174 * expression.cs (IsSpecialMethodInvocation): Reuses TypeManager
9177 * report.cs: Add a new warning.
9179 * support.cs (ReflectionParameters): Implements Equals, GetHashCode.
9181 * typemanager.cs (enumeration_type): Removed.
9182 (CSharpSignature): Reuses IsSpecialMethod.
9183 (IsEqual): Hack for MS BCL.
9184 (GetPropertyFromAccessor): New method.
9185 (GetEventFromAccessor): New method.
9186 (IsSpecialMethod): Fixed to handle more cases.
9188 2006-12-30 Marek Safar <marek.safar@gmail.com>
9190 * cs-tokenizer.cs (PreProcessDefinition, handle_preprocessing_directive):
9191 Made white spaces array static.
9193 * ecore.cs (RemoveGenericArity): Optimized.
9195 * flowanalysis.cs (MyBitVector.Or, MyBitVector.And): Optimized (up to
9197 (MyBitVector.initialize_vector): Simplified.
9199 2006-12-22 Miguel de Icaza <miguel@novell.com>
9201 * ecore.cs: Am not entirely happy with this hack, but it seems to
9202 address the issue in 80257 (a small test case for
9205 I set the MethodGroupExpr.Type to an internal compiler type
9206 (itself in this case) to force the resolution to take place. Why
9207 it does not take place with a null is beyond me.
9209 2006-12-20 Marek Safar <marek.safar@gmail.com>
9211 A fix for bug #80288
9212 * expression.cs (ResolveOperator): Consider user defined conversion for
9213 logical and operator too.
9214 (EmitBranchable): Optimization for logical and when full constant folding
9215 could not be applied but one operand is constant.
9217 2006-12-19 Marek Safar <marek.safar@gmail.com>
9219 * class.cs (GetClassBases): Write 5 times every day, will never use
9220 FullName for error reporting.
9222 * decl.cs (AsAccessible, CheckAccessLevel): Always unpack arrays first.
9224 2006-12-19 Martin Baulig <martin@ximian.com>
9226 * statement.cs (LocalInfo.EmitSymbolInfo): New public method; emit
9227 the symbol file info here.
9229 2006-12-18 Marek Safar <marek.safar@gmail.com>
9231 * cs-tokenizer.cs (handle_preprocessing_directive): When previous section
9232 of `elseif' is taking then following sections are not taking.
9233 Fixes an issue reported on mono mailing list.
9235 2006-12-18 Marek Safar <marek.safar@gmail.com>
9237 A fix for bug #80300
9238 * cs-tokenizer.cs (PreProcessDefinition): Do no define/undefine when
9239 a caller is not taking.
9241 2006-12-18 Raja R Harinath <rharinath@novell.com>
9243 * anonymous.cs: Change several TypeContainer declarations to DeclSpace.
9244 (CompilerGeneratedClass): Use parent.PartialContainer unconditionally.
9245 (RootScopeInfo, AnonymousMethodMethod): Update to changes.
9246 * iterator.cs: Change several TypeContainer declarations to DeclSpace.
9247 * class.cs: Update to changes.
9249 2006-12-17 Marek Safar <marek.safar@gmail.com>
9251 A fix for bug #79934
9252 * anonymous.cs (CompilerGeneratedClass): Register class in a shared
9255 * class.cs (ResolveMembers): Register an iterator in current container and
9258 2006-12-16 Raja R Harinath <rharinath@novell.com>
9261 * expression.cs (VerifyArgumentsCompat): Allow zero arguments to
9262 satisfy a params annotated parameter.
9264 2006-12-16 Marek Safar <marek.safar@gmail.com>
9266 A fix for bug #77014
9267 * expression.cs (Invocation.BetterFunction): Fixed to cope with dynamic
9268 paramters correctly and not rely on hacks in Parameters class.
9269 (Invocation.IsParamsMethodApplicable): Changed to accept params parameter
9271 (Invocation.VerifyArgumentsCompat): Ditto.
9272 (Invocation.EmitArguments): Changed to correctly emit params arguments at
9275 * parameter.cs (HasParams): Don't assume that params is the last one.
9277 * support.cs (ReflectionParameters.ctor): Look for params attribute
9279 (ReflectionParameters.ParameterType): Removed hack when we returned last
9280 parameter for out of range parameters.
9281 (ParameterName, ParameterModifier): Ditto.
9283 2006-12-14 Marek Safar <marek.safar@gmail.com>
9285 A fix for bug #79987
9286 * decl.cs (DeclSpace.VerifyClsCompliance): External names cache is null
9287 when assembly is not CLS compliant but type is. I have no idea why is this
9290 * typemanager.cs (Reset): Invalidate AllClsTopLevelTypes cache.
9292 2006-12-13 Miguel de Icaza <miguel@novell.com>
9294 * class.cs (ConstructorInitializer.Resolve): Allow for ":this()"
9295 in struct constructors, they are basically no-ops.
9297 2006-12-12 Marek Safar <marek.safar@gmail.com>
9299 * cs-tokenizer.cs (Position): Save preprocessor status too.
9301 2006-12-12 Marek Safar <marek.safar@gmail.com>
9303 A fix for bug #77794
9304 * cs-tokenizer.cs (consume_identifier): Check for correct partial context.
9306 2006-12-12 Marek Safar <marek.safar@gmail.com>
9308 * cs-tokenizer.cs (get_cmd_arg): Support CR as the line terminator.
9310 (pp_expr): Report error for an invalid expression.
9311 (handle_preprocessing_directive): Simplified; add more error checking.
9313 2006-12-11 Marek Safar <marek.safar@gmail.com>
9315 A fix for bug #74939
9316 * cs-tokenizer.cs (is_punct): We cannot simply disable preprocessor
9317 directives handling.
9319 2006-12-10 Marek Safar <marek.safar@gmail.com>
9321 A fix for bugs #80093, and #75984
9322 * cs-tokenizer.cs (handle_preprocessing_directive): Fixed #if/#else/#endif
9323 logic, it seems to me as it worked before "by coincidence".
9324 (xtoken): Simplified to use reworked handle_preprocessing_directive.
9325 (cleanup): Enabled endif check.
9327 2006-12-09 Marek Safar <marek.safar@gmail.com>
9329 A fix for bug #80162
9330 * statement.cs (CollectionForeach.TryType): Generics and non-generics
9331 enumerators are never ambiguous.
9333 2006-12-08 Raja R Harinath <rharinath@novell.com>
9336 * cs-tokenizer.cs (parse_less_than): Recognize double-colons too.
9338 2006-12-06 Marek Safar <marek.safar@gmail.com>
9340 A fix for bug #80144
9341 * class.cs (EventProperty.Define): Explicit implementation means
9342 that an even is used.
9344 2006-12-06 Marek Safar <marek.safar@gmail.com>
9346 Fixes the operators implementation (part II)
9348 * cfold.cs (DoConstantNumericPromotions): Renamed to
9349 DoBinaryNumericPromotions and simplified.
9350 (BinaryFold): Couple of conversion fixes; simplified.
9352 * constant.cs, ecore.cs, literal.cs
9353 (ToType): Renamed to ConvertImplicitly.
9354 (Reduce): Renamed to ConvertExplicitly.
9356 * class.cs, convert.cs: Updated.
9358 * expression.cs: TryReduce doesn't throw an exception.
9360 2006-12-01 Marek Safar <marek.safar@gmail.com>
9362 A fix for bug #80108
9363 * ecore.cs (EventExpr.EmitAddOrRemove): Don't crash when right side is not
9366 2006-11-30 Marek Safar <marek.safar@gmail.com>
9368 Fixes unary operators implementation (part I)
9371 * cfold.cs (Error_CompileTimeOverflow): Made internal
9373 * const.cs (IConstant): Changed to use reference to constant and
9374 not constant itself.
9375 Updated IConstant implementations.
9377 * constant.cs (CreateConstant): New factory method.
9378 Updated IConstant implementation.
9380 * convert.cs (ImplicitStandardConversionExists): Uses compiler Equals.
9382 * ecore.cs: Updated to use CreateConstantReference.
9384 * enum.cs: Reflects IConstant changes.
9386 * expression.cs (Unary): Reimplemented +,-,~ to conform C# standard.
9388 * literal.cs (NullConstant): Change to be independently usable.
9390 2006-11-29 Martin Baulig <martin@ximian.com>
9392 * class.cs (Constructor.Emit): Correctly handle anonymous methods;
9393 we need to emit the scope initializer before calling the base .ctor.
9395 * anonymous.cs: Merged back from the new anonymous methods branch.
9396 (AnonymousMethodHost): Renamed to `RootScopeInfo'.
9398 * expression.cs (ParameterReference.DoResolveBase): Create a
9399 "normal" ScopeInfo when capturing parameters rather than using the
9400 root scope; this makes things work with anonymous methods having
9404 (ToplevelBlock.AnonymousMethodHost): Renamed into `RootScope'.
9406 2006-11-22 Marek Safar <marek.safar@gmail.com>
9408 A fix for bug #79987
9409 * class.cs (VerifyClsCompliance): Move redundant CLS compliance attribute
9410 check to a base class.
9411 * decl.cs (VerifyClsCompliance): Warn that CLS compliance cannot be tested
9412 only when assembly has missing attribute.
9413 * report.cs: Update.
9415 2006-11-21 Marek Safar <marek.safar@gmail.com>
9417 * cs-tokenizer.cs: Merged with gmcs version.
9419 2006-11-20 Marek Safar <marek.safar@gmail.com>
9422 * cs-parser.jay: Better error message when partial keyword is misplaced.
9424 2006-11-19 Gert Driesen <drieseng@users.sourceforge.net>
9426 A fix for bug #79810
9427 report.cs: CS1058 only applies to 2.0 profile (gmcs).
9428 codegen.cs: on 2.0 profile, non-exception throwables are wrapped in
9429 a RuntimeWrappedException by default.
9431 2006-11-18 Marek Safar <marek.safar@gmail.com>
9433 A fix for bug #79843
9434 * delegate.cs (Delegate.VerifyMethod): Fixed covariance and contravariance
9436 (DelegateCreation.Error_NoMatchingMethodForDelegate): Ditto.
9438 2006-11-18 Marek Safar <marek.safar@gmail.com>
9440 * driver.cs, namespace.cs: Uses faster IndexOf version.
9442 2006-11-17 Marek Safar <marek.safar@gmail.com>
9444 A fix for bug #79941
9445 * class.cs (MemberCore.IsDuplicateImplementation): Add more tricks for
9447 (Operator.Define): Implicit/Explicit operator of same type is duplicate
9448 even if internal name is different.
9449 * convert.cs (GetConversionOperator): Replaced EmitContext with parentType.
9450 (UserDefinedConversion): Simplified as the operators cannot be internal.
9451 * ecore.cs (Error_ValueCannotBeConverted): Take account of user
9453 (MethodLookup): Replaced EmitContext with parentType.
9454 * expression.cs: Updated.
9456 2006-11-09 Raja R Harinath <rharinath@novell.com>
9458 * driver.cs (BadAssembly): Handle all the ugliness of
9459 DefineDynamicAssembly.
9461 2006-11-08 Raja R Harinath <rharinath@novell.com>
9463 Address parts of #58244 -- most of what's left is in the runtime
9464 * driver.cs (LoadAssembly): Simplify slightly. Add CS0009 and
9465 CS1509 error checks, and handle them for all assembly loads, not
9466 just the first invocation.
9467 (LoadModule): Likewise. Move handling of 'adder_method' ...
9468 * codegen.cs (AssemblyClass.AddModule): ... here.
9470 2006-11-02 Marek Safar <marek.safar@gmail.com>
9472 * statement.cs.cs (CollectionForeach.TryType): Issue a error when
9473 IEnumerable<T> is ambiguous.
9475 2006-10-31 Marek Safar <marek.safar@gmail.com>
9477 A fix for bug #67689
9478 * statement.cs.cs (CollectionForeach.TryType): Issue a warning when
9479 GetEnumerator is ambiguous.
9481 * report.cs: Add new warning.
9483 2006-10-29 Marek Safar <marek.safar@gmail.com>
9485 A fix for bug #78602
9486 ecore.cs (PropertyExpr.InstanceResolve): The qualifier for access
9487 to protected member can be nested type.
9489 2006-10-28 Marek Safar <marek.safar@gmail.com>
9491 A fix for bug #78965
9492 ecore.cs (PropertyExpr.InstanceResolve): The qualifier for access
9493 to protected member must derive from current type.
9495 2006-10-27 Marek Safar <marek.safar@gmail.com>
9497 assign.cs: Reuses error method.
9499 ecore.cs (Expression.Error_ValueCannotBeConverted): Report a value
9500 instead of type for constants.
9501 (Expression.Error_ValueAssignment): Common error method.
9503 * expression.cs (UnaryMutator.ResolveOperator): Value cannot be used
9506 2006-10-27 Marek Safar <marek.safar@gmail.com>
9508 A fix for bug #79081
9509 * expression.cs (MemberAccess.DoResolve): Check nested type
9512 2006-10-27 Atsushi Enomoto <atsushi@ximian.com>
9514 * doc.cs : nested delegates were not handled. Fixed bug #79754.
9516 2006-10-26 Marek Safar <marek.safar@gmail.com>
9518 A fix for bug #76591
9519 * cs-tokenizer.cs (IsCastToken): Enable a cast of anonymous method.
9521 2006-10-26 Marek Safar <marek.safar@gmail.com>
9523 * codegen.cs (AssemblyClass.ApplyAttributeBuilder): Don't allow to have
9524 type forwarder of the same type multiple times.
9526 2006-10-26 Raja R Harinath <rharinath@novell.com>
9529 * ecore.cs (PropertyExpr.InstanceResolve): Always resolve the
9530 instance as an rvalue, even when we later resolve as an lvalue.
9532 2006-10-25 Martin Baulig <martin@ximian.com>
9534 * anonymous.cs: Fix #79673.
9536 2006-10-24 Marek Safar <marek.safar@seznam.cz>
9538 A fix for bug #79666
9539 expression.cs (ArrayCreation.GetAttributableValue): An initializer can be
9540 ignored when is optimized (= default value) as its value is already set.
9542 2006-10-23 Marek Safar <marek.safar@seznam.cz>
9544 A fix for bug #79724
9545 * report.cs (SymbolRelatedToPreviousError): Uses DeclSpace instead of
9546 TypeContainer for type lookup.
9548 2006-10-23 Marek Safar <marek.safar@seznam.cz>
9550 A fix for bug #79231
9551 * ecore.cs (ResolveAsBaseTerminal): Removed redundant error test.
9552 * expression.cs (OverloadResolve): Always convert type name for
9554 (ResolveNamespaceOrType): Don't confuse a nested type with any
9557 2006-10-18 Martin Baulig <martin@ximian.com>
9559 * anonymous.cs: Propagate the IsStatic state, fixes the crasher in banshee.
9561 2006-10-17 Miguel de Icaza <miguel@novell.com>
9563 * convert.cs: Fix typo, fixes the test-535.cs, we were casting to
9564 an int32, but requesting an int64 from the conversion
9566 2006-10-12 Martin Baulig <martin@ximian.com>
9569 (AnonymousContainer.Resolve): Inflate the `ReturnType'. Fixes #79592.
9571 2006-10-12 Martin Baulig <martin@ximian.com>
9574 (Using.EmitLocalVariableDeclFinally): Small fix for iterators.
9576 2006-10-11 Miguel de Icaza <miguel@novell.com>
9578 * convert.cs: Remove broken code: I was doing the "Existance"
9579 tests for Implicit conversions.
9581 2006-10-10 Miguel de Icaza <miguel@novell.com>
9583 * convert.cs: Added one missing case in
9584 ImplicitStandardConversionExists uint64 to intptr.
9588 * typemanager.cs (uintptr_type): another core known type.
9590 * ecore.cs (OperatorCast): routine used to do cast operations that
9591 depend on op_Explicit. We could change some of the Decimal
9592 conversions to use this.
9594 This one has a probe mechanism that checks both types for an op_
9595 which it coudl be used to eliminate two classes: CastToDecimal
9596 and CastFromDecimal.
9598 * convert.cs: Implement the conversions documented in #59800
9600 2006-10-10 Martin Baulig <martin@ximian.com>
9602 * iterators.cs (Iterator.Resolve): Call RootScope.ResolveType()
9603 before RootScope.ResolveMembers().
9605 * anonymous.cs (ScopeInfo.CapturedScope.ctor): Use the child's
9606 `CurrentType' if appropriate.
9608 2006-10-09 Marek Safar <marek.safar@seznam.cz>
9610 A fix for bug #78568
9611 * cs-tokenizer.cs (Deambiguate_CloseParens): Expression cannot be cast
9612 when contains binary operators.
9613 * cs-parser.jay: Updated.
9615 2006-10-09 Martin Baulig <martin@ximian.com>
9618 (Delegate.DefineType): Don't call TypeParameter.Resolve() here;
9619 moved that into Define() and also do the other type parameter
9620 checks there. Fixes #79094. Added gtest-292.cs.
9623 (ArrayCreation.EmitDynamicInitializers): Use `etype.IsValueType'
9624 since that doesn't include type parameters; don't use `Ldelema'
9625 for type parameters. Fixes #78980. Added gtest-293.cs.
9627 2006-10-08 Marek Safar <marek.safar@seznam.cz>
9630 * convert.cs (ExplicitReferenceConversion): Only enum to enum value
9631 conversion is allowed.
9633 2006-10-06 Marek Safar <marek.safar@seznam.cz>
9635 * ecore.cs (Expression.MemberLookup): Don't register any symbol for
9636 error reporting when no error occurs.
9638 2006-10-06 Marek Safar <marek.safar@seznam.cz>
9640 * cfold.cs (ConstantFold.BinaryFold): Report an error when the conversion
9643 2006-10-06 Raja R Harinath <rharinath@novell.com>
9646 * class.cs (DefineTypeBuilder): Check circular dependencies before
9647 setting the parent of the TypeBuilder.
9648 (CheckRecursiveDefinition): Don't use 'BaseType', since
9649 it may not be valid until after DefineTypeBuilder. Use
9650 'base_type' instead.
9652 2006-10-04 Martin Baulig <martin@ximian.com>
9654 Merged the Anonymous Methods patch.
9656 * anonymous.cs, iterators.cs: The new anonymous methods code.
9658 * statement.cs (Variable): New public abstract class.
9659 (LocalInfo.Variable): New public property.
9660 (LocalInfo.ResolveVariable): New public method.
9661 (Block.Flags): Add `IsIterator'.
9662 (Block.AddVariable): Improved the CS0136 check.
9663 (Block.AnonymousChildren): New public property.
9664 (Block.AddAnonymousChild): New public method.
9665 (ToplevelBlock): Update to use the new anonymous method framework.
9666 (ToplevelBlock.ctor): `container' is now a `Block' and not a
9667 `ToplevelBlock'; this is required to correctly implement the
9669 (Fixed, Using): Use `TemporaryVariable' instead of directly
9670 creating the `LocalBuilder'.
9672 * parameter.cs (Parameter.ResolveVariable): New public method.
9673 (Parameters.ResolveVariable): Likewise.
9675 * ecore.cs (TemporaryVariable): Use the new `Variable' framework.
9677 * class.cs (TypeContainer): Replaced the `iterators' list and
9678 corresponding methods with a list of `CompilerGeneratedClass'es.
9679 (TypeContainer.ResolveMembers): New public method.
9680 (Method): `IIteratorContainer' has been replaced by
9683 * expression.cs (VariableReference): New public abstract base
9684 class for `LocalVariableReference', `ParameterReference' and
9687 * codegen.cs (EmitContext): Removed `capture_context',
9688 `HaveCaptureInfo', `EmitScopeInitFromBlock()' and `Capture*()'.
9689 (EmitContext.EmitThis): Removed.
9691 * cs-parser.jay: Replace `iterator_container' with
9694 2006-10-04 Martin Baulig <martin@ximian.com>
9696 * generic.cs (GenericMethod): Don't make this abstract.
9697 (Constraints.Clone): Added dummy implementation.
9699 2006-10-04 Raja R Harinath <harinath@gmail.com>
9702 * namespace.cs (LookForAnyGenericType): Avoid nullref on
9703 'declspaces'. Avoid allocating arrays willy-nilly.
9706 * cfold.cs (BinaryFold): Move boolean Equality and Inequality
9707 cases out of the switch.
9709 2006-09-28 Marek Safar <marek.safar@seznam.cz>
9711 * namespace.cs (Namespace.Error_NamespaceDoesNotExist): Better error
9712 message when non-generic type is used with the type arguments.
9713 * expression.cs: Updated.
9715 2006-09-28 Raja R Harinath <rharinath@novell.com>
9718 * convert.cs (Convert.ImplicitStandardConversionExists): Avoid infloop.
9719 * expression.cs (EmptyExpression.Grab, EmptyExpression.Release):
9720 Change semantics slightly. Don't insist on having only one
9721 temporary EmptyExpression -- just throttle the creation of new ones.
9724 * ecore.cs (Expression.MemberLookup): Enable CS0229 errors for
9725 non-interfaces too. If no methods are found, don't try to create
9728 2006-09-28 Marek Safar <marek.safar@seznam.cz>
9730 * ecore.cs (ResolveAsTypeStep): Print better error when type can be
9733 * namespace.cs (Namespace.LookForAnyGenericType): New method to help
9734 us produce better error message.
9736 2006-09-27 Marek Safar <marek.safar@seznam.cz>
9738 * expression.cs (Binary.ResolveOperator): Warn about a side effect
9739 of the `|' operator.
9741 * report.cs: A new warning added.
9743 2006-09-27 Martin Baulig <martin@ximian.com>
9745 * generic.cs (GenericMethod): Don't make this abstract.
9747 2006-09-27 Martin Baulig <martin@ximian.com>
9750 (InternalErrorException): Added overloaded ctor taking a params array.
9752 2006-09-26 Marek Safar <marek.safar@seznam.cz>
9754 * class.cs, codegen.cs, const.cs, cs-tokenizer.cs, driver.cs, ecore.cs:
9755 Fixed the cases when same error was reported twice.
9757 * report.cs (SymbolRelatedToPreviousError): Simplified as all our messages
9758 now report symbol information.
9760 2006-09-25 Martin Baulig <martin@ximian.com>
9762 * class.cs: Completely unified with the gmcs version.
9764 2006-09-25 Martin Baulig <martin@ximian.com>
9766 * typemanager.cs (TypeManager.IsNullableType): New public function.
9767 (TypeManager.IsNullableTypeOf): Likewise.
9768 (TypeManager.IsNullableValueType): Likewise.
9770 * class.cs (MethodCore): Added the `GenericMethod' argument from
9771 gmcs and also unified all classes derived from `MethodCore' with gmcs.
9773 2006-09-24 Raja R Harinath <harinath@gmail.com>
9775 * convert.cs: Unify with gmcs version.
9777 2006-09-24 Marek Safar <marek.safar@seznam.cz>
9779 * decl.cs (DeclSpace.VerifyClsCompliance): When type has type parameters
9780 verify them as well.
9782 * report.cs: New warning.
9784 2006-09-24 Marek Safar <marek.safar@seznam.cz>
9786 * anonymous.cs (AnonymousMethod.Compatible): Cannot generate arguments
9787 for anonymous block with out argument.
9789 2006-09-24 Marek Safar <marek.safar@seznam.cz>
9791 * class.cs (ClassOrStruct.VerifyMembers): Fixed to report correctly
9792 not used private events only.
9794 2006-09-23 Marek Safar <marek.safar@seznam.cz>
9796 * cfold.cs (BinaryFold): On the guest to unify empty constant cast.
9798 * const.cs (Const.Define): Check for constant type.
9799 (Const.IsConstantTypeValid): Looks for valid constant types.
9801 * convert.cs (ImplicitReferenceConversion): NullCast to EmptyConstantCast.
9803 * ecore.cs (EmptyConstantCast): New common class for all constant based
9806 * expression.cs (Is.DoResolve): Handle null constant especially.
9807 (New.DoResolve): Check for new void().
9808 (MemberAccess.DoResolve): Cope with all kind of nulls.
9810 * literal.cs (NullConstant): Uses EmptyConstantCast.
9811 (NullDefault): Based on EmptyConstantCast.
9812 (NullLiteral): Uses EmptyConstantCast.
9814 * statement.cs (Block.ResolveMeta): Check for constant type.
9816 2006-09-22 Martin Baulig <martin@ximian.com>
9818 * delegate.cs, attribute.cs: Merged with the gmcs versions.
9820 2006-09-22 Raja R Harinath <rharinath@novell.com>
9822 * literal.cs (NullDefault): The type of default(IFoo) is 'IFoo',
9826 * typemanager.cs (Closure.Filter): Consider PrivateScope attributes.
9827 * decl.cs (DeclSpace.FindMemberToOverride): Likewise. Reorganize
9830 2006-09-22 Martin Baulig <martin@ximian.com>
9832 * ecore.cs: Merged with the gmcs version.
9834 * generic.cs (ConstructedType): New dummy class.
9835 (TypeArguments): Don't make this abstract.
9838 (TypeManager.IsGenericTypeDefinition): New method.
9839 (TypeManager.GetGenericFieldDefinition): Moved here from gmcs.
9841 2006-09-22 Raja R Harinath <rharinath@novell.com>
9843 * expression.cs (ComposedCast): Check for arrays of TypedReference
9844 before creating the type, not after.
9846 2006-09-21 Marek Safar <marek.safar@seznam.cz>
9848 * cfold.cs, const.cs, enum.cs, statement.cs: Updated
9849 after ToType change.
9851 * constant.cs (Constant.ImplicitConversionRequired): Designed to used
9852 when constant must be implicitly convertible.
9854 * convert.cs (ImplicitReferenceConversion): Reuse ToType.
9856 * ecore.cs (NullCast): Derives from NullConstant.
9858 * expression.cs (Is.DoResolve): Removed useless variables.
9859 (Conditional.DoResolve): Quick hack for `Foo () ? null : null'.
9860 (New.Constantify): Add enum support.
9861 (MemberAccess.DoResolve): Add warning when accessing null constant or
9864 * generic.cs (GenericConstraints.IsReferenceType): Another dummy
9867 * literal.cs (NullConstant): New abstract class with common
9868 functionality for all null specializations.
9869 (NullDefault): Represents default(X) when result can be
9871 (NullLiteral): Updated.
9873 * report.cs: Add new warning.
9875 2006-09-21 Martin Baulig <martin@ximian.com>
9877 * generic.cs (GenericTypeParameterBuilder): Removed this ugly hack.
9879 2006-09-21 Martin Baulig <martin@ximian.com>
9881 * generic.cs (GenericConstraints): New dummy class.
9882 (Constraints): Likewise.
9883 (TypeParameter): Likewise.
9884 (TypeParameterName): Likewise.
9885 (GenericMethod): Likewise.
9887 * typemanager.cs (TypeManager.GetGenericArguments): New method.
9889 * decl.cs: Merged with the gmcs version.
9891 2006-09-21 Raja R Harinath <rharinath@novell.com>
9893 * generic.cs (TypeParameter): Implement IMemberContainer.
9894 (GenericTypeParameterBuilder): New. An abominable repugnant hack.
9896 * rootcontext.cs: Unify with gmcs version.
9898 * report.cs: Unify with gmcs version.
9899 * typemanager.cs (AddTypeParameter, LookupTypeParameter): Move
9900 from gmcs/generics.cs.
9901 * generics.cs (TypeParameter): New dummy class.
9903 * support.cs: Unify with gmcs version.
9905 2006-09-20 Raja R Harinath <rharinath@novell.com>
9907 * ecore.cs (MethodGroupExpr.ResolveGeneric): New dummy method.
9908 * expression.cs (MemberAccess, BaseAccess): Remove GMCS_SOURCE #ifdef.
9910 * decl.cs (MemberName): Unify with gmcs, except for GetTypeExpression.
9911 * generic.cs (TypeArguments): New dummy class to help avoid #ifdefs.
9912 * mcs.exe.sources: Add generic.cs.
9914 * codegen.cs: Unify with gmcs version.
9916 * codegen.cs (IResolveContent.GenericDeclContainer): Copy from gmcs.
9917 (EmitContext): Add GenericDeclContainer implementation.
9918 * decl.cs (MemberCore, DeclSpace): Likewise.
9919 * namespace.cs: Remove #ifdef GMCS_SOURCE.
9921 * namespace.cs (GetTypeInAssembly): Remove #ifdef GMCS_SOURCE.
9922 MCS TypeManager has a corresponding dummy method.
9924 2006-09-19 Martin Baulig <martin@ximian.com>
9926 * expression.cs: Completely merged with the gmcs version.
9928 2006-09-19 Martin Baulig <martin@ximian.com>
9930 * expression.cs (Invocation): Merged with the gmcs version.
9931 (ArrayAccess.GetStoreOpcode): Likewise.
9933 2006-09-19 Martin Baulig <martin@ximian.com>
9936 (TypeManager.IsGenericMethod): Moved here from ../gmcs/generic.cs.
9937 (TypeManager.IsGenericMethodDefinition): Likewise.
9939 2006-09-19 Martin Baulig <martin@ximian.com>
9942 (TypeManager.IsEqual): Moved the gmcs implementation here.
9943 (TypeManager.DropGenericTypeArguments): Likewise.
9944 (TypeManager.DropGenericMethodArguments): Likewise.
9945 (TypeManager.GetTypeArguments): Moved here from gmcs.
9946 (TypeManager.HasGenericArguments): Likewise.
9948 2006-09-19 Martin Baulig <martin@ximian.com>
9950 * expression.cs (Binary): Merged with the gmcs version.
9952 2006-09-19 Martin Baulig <martin@ximian.com>
9954 * expression.cs (Probe, As, Is): Merged with the gmcs version.
9956 2006-09-19 Martin Baulig <martin@ximian.com>
9958 * typemanager.cs: Merged with the gmcs version.
9960 2006-09-16 Raja R Harinath <rharinath@novell.com>
9962 * AssemblyInfo.cs [GMCS_SOURCE]: Unify with gmcs source.
9963 * driver.cs: Likewise.
9965 2006-09-16 Marek Safar <marek.safar@seznam.cz>
9968 * class.cs (MethodCore.VerifyClsCompliance): Do check for abstract members
9969 only if parent type is class.
9970 * decl.cs (MemberCore.GetClsCompliantAttributeValue): Fixed missing cache
9973 2006-09-15 Marek Safar <marek.safar@seznam.cz>
9976 * expression.cs(MemberAccess.DoResolve): Don't crash when not allowed
9978 * typemanager.cs(CSharpName): Converts NullType to null.
9980 2006-09-15 Martin Baulig <martin@ximian.com>
9983 (TypeManager.GetMethodName): Added mcs implementation.
9984 (TypeManager.IsEqual): Likewise.
9987 (SimpleName.RemoveGenericArity): Added dummy implementation.
9989 * pending.cs: Merged with the gmcs version.
9991 2006-09-15 Martin Baulig <martin@ximian.com>
9993 * statement.cs: Merge with the gmcs version.
9995 2006-09-15 Martin Baulig <martin@ximian.com>
9997 * statement.cs (Switch): Merge with the gmcs implementation
9998 (without nullables), which is newer.
10000 2006-09-15 Martin Baulig <martin@ximian.com>
10002 * statement.cs (Block.Variables): Make this public.
10003 (ToplevelBlock.Parameters): Make this a property.
10004 (Throw.Resolve): Use `TypeManager.IsSubclassOf ()'.
10006 2006-09-15 Martin Baulig <martin@ximian.com>
10008 * namespace.cs: Merge with the gmcs version.
10010 2006-09-15 Martin Baulig <martin@ximian.com>
10012 * decl.cs (MemberName): Minor code cleanups.
10014 2006-09-15 Martin Baulig <martin@ximian.com>
10016 * parameter.cs: Merge with the gmcs version.
10018 2006-09-15 Martin Baulig <martin@ximian.com>
10020 * enum.cs: Merge with the gmcs version: 3005 is a warning in gmcs
10021 and an error in mcs.
10023 2006-09-15 Martin Baulig <martin@ximian.com>
10025 * flowanalysis.cs: Merged from GMCS; added the generics code into
10026 a `GMCS_SOURCE' conditional so we can share this file.
10028 2006-09-08 Martin Baulig <martin@ximian.com>
10030 * typemanager.cs (TypeManager.interlocked_type): New public field.
10031 (TypeManager.int_interlocked_compare-exchange): New public field.
10032 (TypeManager.InitEnumUnderlyingTypes): Also initialize the
10033 enumerator types here and call InitGenericCoreTypes().
10034 (TypeManager.InitCoreTypes): Call InitEnumeratorTypes() right
10035 after calling InitEnumUnderlyingTypes().
10038 (RootContext.ResolveCore): Added `System.Threading.Interlocked' to
10039 `classes_second_stage'.
10041 2006-09-14 Marek Safar <marek.safar@seznam.cz>
10043 * assign.cs, ecore.cs, expression.cs: Share error message text.
10044 * class.cs (FieldMember.Define): Check for varible of static type.
10045 * driver.cs (LoadAssembly): Uses error output for errors.
10046 * statement.cs: Updated.
10048 2006-09-08 Marek Safar <marek.safar@seznam.cz>
10050 * expression.cs (Error_OperatorCannotBeApplied): Report type instead of
10053 2006-09-07 Martin Baulig <martin@ximian.com>
10056 (MainDriver): Revert r62663 from Marek; see #70506 for details.
10058 2006-08-29 Miguel de Icaza <miguel@novell.com>
10060 * cs-parser.jay: Turn 1522 into a warning, instead of an error #79210
10062 2006-08-17 Miguel de Icaza <miguel@novell.com>
10064 * cs-tokenizer.cs: Apply patch from Atsushi Enomoto that fixes
10065 #52019 and #79064, the use of the \uXXXX sequence in source code
10066 to represent unicode characters.
10068 2006-08-15 Marek Safar <marek.safar@seznam.cz>
10070 * expression.cs (SizeOf.DoResolve): Check for void type. Fixed enum types
10072 * class.cs, ecore.cs, statement.cs: Merged to one error message.
10074 2006-08-13 Miguel de Icaza <miguel@novell.com>
10076 * assign.cs: Catch attempts to assign to a method groups in += and
10079 2006-08-13 Marek Safar <marek.safar@seznam.cz>
10082 * cs-parser.jay: Don't destroy current array type by typeof of array's.
10084 2006-08-12 Marek Safar <marek.safar@seznam.cz>
10086 * class.cs (Method.Define): Issue a warning when generic method looks like
10088 * decl.cs (MemberCore.GetSignatureForError): Print member type arguments
10091 2006-08-09 Marek Safar <marek.safar@seznam.cz>
10093 * anonymous.cs(AnonymousDelegate.Emit): Uses Constructor filter when
10095 * decl.cs (MemberCache.FindMembers): When container is interface we need to
10096 search all base interfaces as a member can be ambiguous.
10097 * delegate.cs (Delegate.FindMembers): Fixed to return valid data for
10098 Constructor member type filter.
10099 (Delegate.ResolveConstructorMethod) Uses Constructor filter.
10100 * ecore.cs: (Expression.MemberLookup): Implemented ambiguity error/warning
10101 reporting for returned memberinfos.
10102 * report.cs: Updated.
10103 * typemanager.cs (TypeManager.LookupBaseInterfacesCache): Uses TypeManager
10104 version to work on all runtimes.
10105 (TypeManager.RealMemberLookup): Removed members filtering.
10107 2006-08-08 Raja R Harinath <rharinath@novell.com>
10109 * ecore.cs (FieldExpr.EmitAssign): Release temporary.
10110 (PropertyExpr.EmitAssign): Likewise.
10111 * expression.cs (Indirection.EmitAssign): Likewise.
10112 (LocalVariableReference.EmitAssign): Likewise.
10113 (ParameterReference.EmitAssign): Likewise.
10114 (Invocation.EmitArguments): Likewise.
10115 (ArrayAccess.EmitAssign): Likewise.
10116 (IndexerAccess.EmitAssign): Likewise.
10117 (This.EmitAssign): Likewise.
10118 (ConditionalLogicalOperator.Emit): Likewise.
10121 * codegen.cs (EmitContext.GetTemporaryLocal): Simplify. Use Stack
10122 instead of ArrayList. If the hashtable has a LocalBuilder, don't
10123 leave it in after returning it.
10124 (EmitContext.FreeTemporaryLocal): Simplify. Update to changes.
10126 2006-08-06 Marek Safar <marek.safar@seznam.cz>
10128 * expresssion.cs (IndexerAccess.DoResolve): Fixed to report correct error
10131 2006-08-03 Raja R Harinath <rharinath@novell.com>
10133 Fix cs0146-3.cs and cs0146-4.cs.
10134 * class.cs (TypeManager.CheckRecursiveDefinition): Check that
10135 enclosing types don't depend on the current type.
10137 2006-08-02 Raja R Harinath <rharinath@novell.com>
10140 * class.cs (TypeContainer.DoDefineMembers): Use
10141 FindBaseMemberWithSameName on Parent, since we're interested in
10142 whether we hide inherited members or not.
10143 (FindBaseMemberWithSameName): Make slightly more robust.
10145 Fix the non-generic testcase from #77396
10146 * decl.cs (DeclSpace.DeclContainer): Remove override.
10148 * namespace.cs (NamespaceEntry.Doppelganger): Create slave
10149 declspaces for doppelgangers too.
10150 (UsingEntry): Implement IResolveContext.
10151 (UsingEntry.Resolve): Don't set ToplevelTypes.Namespace. Use
10152 'this' as the resolve context.
10153 (LocalAliasEntry): Likewise.
10155 Implement parts of #77403
10156 * roottypes.cs (RootDeclSpace): New. Used to represent the
10157 toplevel declaration space. Each namespace declaration introduces
10158 a "partial" root declaretion space.
10159 * namespace.cs (NamespaceEntry.SlaveDeclSpace): New.
10160 (NamespaceEntry.ctor): Create a SlaveDeclSpace if necessary.
10161 * cs-parser.jay (CSharpParser.ctor): Initialize 'current_class'
10162 from 'current_namespace.SlaveDeclSpace'.
10163 (namespace_declaration): Likewise.
10164 * class.cs (TypeContainer.ctor): Remove parent==ToplevelTypes
10165 check. It can't happen now.
10166 * decl.cs (DeclSpace.LookupType): Likewise.
10167 * driver.cs (MainDriver): Sanity check.
10169 2006-08-01 Raja R Harinath <rharinath@novell.com>
10171 * decl.cs (DeclSpace.FindNestedType): Remove.
10172 (DeclSpace.LookupNestedTypeINHierarchy): Use PartialContainer and
10173 LookupTypeContainer to get the container of the nested type.
10174 * class.cs (TypeContainer.FindNestedType): Make non-override.
10176 2006-07-31 Raja R Harinath <rharinath@novell.com>
10178 * decl.cs (DeclSpace.PartialContainer): Move field from ...
10179 * class.cs (TypeContainer.PartialContainer): ... here.
10180 (TypeContainer.AddBasesForPart): New helper.
10181 (MemberBase.ParentContainer): Remove. Use Parent.PartialContainer
10183 * cs-parser.jay (current_class): Convert to DeclSpace.
10184 (struct_declaration, interface_declaration, class_declaration):
10185 Use AddBasesForPart instead of .Bases directly.
10186 * const.cs, iterators.cs: Update to changes.
10188 2006-07-28 Raja R Harinath <rharinath@novell.com>
10190 * class.cs (TypeContainer.AddMemberType): Rename from
10191 AddToTypeContainer.
10192 (TypeContainer.AddMember): Rename from AddToMemberContainer.
10193 (AddTypeContainer): New. Combine AddClassOrStruct and
10195 (AddPartial): Update. Add 'is_partial' argument.
10196 * roottypes.cs: Update to changes.
10197 * cs-parser.jay (push_current_class): New helper for handling
10198 current_container and current_class.
10199 (struct_declaration, interface_declaration, class_declaration):
10202 2006-07-26 Raja R Harinath <rharinath@novell.com>
10204 * roottypes.cs: Rename from tree.cs.
10206 Rename RootContext.Tree.Types to RootContext.ToplevelTypes.
10207 * tree.cs (Tree, ITreeDump): Remove types.
10208 * rootcontext.cs (tree, Tree): Remove fields.
10209 (root, ToplevelTypes): New.
10210 * *.cs: Update to rename.
10212 * tree.cs (Tree.RecordDecl): Remove.
10213 (RootTypes.AddToTypeContainer): Record the toplevel type in its
10215 * class.cs, cs-parser.jay: Remove mention of RecordDecl.
10217 2006-07-23 Raja R Harinath <harinath@gmail.com>
10219 * codegen.cs (EmitContext.Flags): Move InCatch, InFinally,
10220 DoFlowAnalysis and OmitStructFlowAnalysis here.
10221 (ec.With): Rename from WithUnsafe and generalize.
10222 (ec.WithCheckState): Remove. All users can be handled by 'With'.
10223 (ec.WithFlowAnalyis): New.
10224 * ecore.cs, expression.cs, statement.cs: Update.
10226 2006-07-22 Raja R Harinath <harinath@gmail.com>
10228 * statement.cs (Block.ResolveMeta): Simplify slightly.
10230 * codegen.cs (EmitContext.Flags): New enum. Used to represent the
10231 multiple boolean fields. Convert InUnsafe, constant_check_state,
10232 check_state to flags.
10233 (CheckState, ConstantCheckState): Update.
10234 (InUnsafe): New read-only property.
10235 (FlagsHandle): Rename from CheckStateHandle and convert to handle
10237 (WithUnsafe): New helper similar to WithCheckState.
10238 * statement.cs (Block.ResolveMeta): Use WithUnsafe.
10239 (Unsafe.Resolve, Unsafe.DoEmit): Likewise.
10241 2006-07-21 Raja R Harinath <rharinath@novell.com>
10243 Make comparisons use the same IL irrespective of whether they're
10244 in a 'checked' or 'unchecked' context: one of the issues in #78899
10245 * codegen.cs (EmitContext.CheckState): Make read-only property.
10246 (EmitContext.ConstantCheckState): Likewise.
10247 (EmitContext.CheckStateHandle, EmitContext.WithCheckState): New
10248 helper that implement a save/restore stack for CheckState
10249 values. This is the only way to change check-state.
10250 * ecore.cs (Expression.ExpressionToArrayArgument): Use WithCheckState.
10251 * expression.cs (CheckedExpr.DoResolve, CheckedExpr.Emit): Likewise.
10252 (CheckedExpr.EmitBranchable): New forwarding method.
10253 (UnCheckedExpr): Likewise.
10254 * statement.cs (Block.ResolveMeta): Use WithCheckState.
10255 (Unchecked.Resolve, Unchecked.DoEmit): Likewise.
10256 (Checked.Resolve, checked.DoEmit): Likewise.
10258 2006-07-20 Miguel de Icaza <miguel@novell.com>
10260 * anonymous.cs: Cache the resolved anonymous delegate, and return
10261 this so that the ResolveTopBlock is only triggered once, not
10264 Currently we trigger ResolvetopBlock twice due to a first pass of
10265 argument check compatibility, and a second pass that does the
10268 2006-07-15 Marek Safar <marek.safar@seznam.cz>
10270 * annonymous.cs (AnonymousMethod.CreateScopeType): Fixed nested type
10272 * rootcontext.cs (Reset): Add helper_classes.
10274 2006-07-15 Marek Safar <marek.safar@seznam.cz>
10277 * statement.cs (Switch.SimpleSwitchEmit): Handle case null at any position
10280 2006-07-13 Miguel de Icaza <miguel@novell.com>
10282 * statement.cs (Lock): Handle expressions of type
10283 TypeManager.null_type specially. Fixes #78770
10285 2006-07-08 Marek Safar <marek.safar@seznam.cz>
10287 * expression.cs (Binary.ResolveOperator): Don't crash when null is assigned
10290 2006-07-08 Marek Safar <marek.safar@seznam.cz>
10292 * attribute.cs (AttributeTester.GetMethodObsoleteAttribute): Fixed to look
10293 for accessors as well.
10294 * ecore.cs (EventExpr): Add AccessorTable.
10296 2006-07-01 Marek Safar <marek.safar@seznam.cz>
10299 * attribute.cs, class.cs, ecore.cs : Add missing location of related symbol
10300 for CS0122 where appropriate.
10301 * typemanager.cs (IsNestedChildOf): Type can be null in the case of top
10303 (Filter): Assembly can be null in the case of top level attributes.
10305 2006-06-25 Marek Safar <marek.safar@seznam.cz>
10309 * ecore.cs (Expression.MemberLookupFailed): Don't crash when failed lookup
10310 is done at global level.
10312 2006-06-24 Marek Safar <marek.safar@seznam.cz>
10314 A fix for #77002, Implemented TypeForwarder support.
10316 * attribute.cs (Attribute.GetArgumentType): Reads type argument.
10317 * expression.cs (TypeOf.TypeArgument): Exposes typeof type.
10318 * typemanager.cs (): Add type_forwarder_attr_type.
10320 2006-06-24 Marek Safar <marek.safar@seznam.cz>
10322 * report.cs: Add CS0469 warning.
10324 2006-06-21 Martin Baulig <martin@ximian.com>
10326 * codegen.cs (CodeGen.Save): Moved the symbol file generation into
10327 the `try'-block, so we also report CS0016 etc. there.
10329 2006-06-21 Martin Baulig <martin@ximian.com>
10332 (Delegate.VerifyMethod): Allow `params' methods; fixes #78678.
10334 2006-06-21 Martin Baulig <martin@ximian.com>
10336 * expression.cs (Unary.ResolveOperator): In `Operator.AddressOf',
10337 also report CS1686 for parameters.
10339 2006-06-21 Martin Baulig <martin@ximian.com>
10341 * statement.cs (GotoCase.Resolve): Report a warning (CS0469)
10342 instead of an error if the value is not implicitly convertible to
10343 the switch types; fixes #77964.
10345 2006-06-21 Raja R Harinath <rharinath@novell.com>
10348 * class.cs (FieldBase.ResolveInitializer): Stop resolution if
10349 FieldBuilder is null.
10352 * expression.cs (Binary.CheckShiftArguments): Don't overwrite original
10353 'left' and 'right' before error-checking.
10355 2006-06-16 Juraj Skripsky <js@hotfeet.ch>
10357 * ecore.cs (SimpleName.Error_ObjectRefRequired): Do not truncate the name.
10359 (MemberExpr.EmitInstance): Use GetSignatureForError () to get full name.
10360 (FieldExpr.DoResolve): likewise.
10361 (PropertyExpr.InstanceResolve): likewise.
10362 (EventExpr.InstanceResolve): likewise.
10364 2006-06-04 Marek Safar <marek.safar@seznam.cz>
10366 * parameter.cs (Parameter.ApplyAttributeBuilder): More DefaultValue
10367 attribute applicable tests for attribute argument.
10369 2006-06-02 Raja R Harinath <rharinath@novell.com>
10372 * expression.cs (Binary.DoNumericPromotions): Remove and rewrite.
10373 (Binary.OverloadResolve_PredefinedIntegral): New.
10374 (Binary.OverloadResolve_PredefinedFloating): New.
10375 (Binary.OverloadResolve_PredefinedString): New.
10376 (Binary.ResolveOperator): Use those instead of DoNumericPromotions.
10377 Follow the standard more closely, and treat numeric promotions in
10378 terms of overload resolution.
10379 (Binary.CheckShiftArguments): Simplify.
10381 2006-06-01 Raja R Harinath <rharinath@novell.com>
10383 * flowanalysis.cs (MyBitVector): Simplify representation.
10384 (MyBitVector.Clone): Avoid allocating BitArray.
10385 (MyBitVector.operator&): Rename from MyBitVector.And and make symmetric.
10386 (MyBitVector.operator|): Likewise, with MyBitVector.Or.
10387 (*): Update. Change all references to MyBitVector.And and
10388 MyBitVector.Or to &= and |=.
10390 2006-05-29 Raja R Harinath <rharinath@novell.com>
10392 Fix cs0231-[34].cs.
10393 * cs-parser.jay (formal_parameter_list): Extend the pattern below
10394 to param arguments too.
10396 2006-05-26 Miguel de Icaza <miguel@novell.com>
10398 * cs-parser.jay: Catch another parsing form for arglist being
10399 followed by other arguments. Fixes #78313.
10401 2006-05-24 Raja R Harinath <rharinath@novell.com>
10403 * flowanalysis.cs (FlowBranchingToplevel.AddReturnOrigin): Move
10404 checking of out parameters to ...
10405 (FlowBranchingToplevel.Merge): ... here.
10406 (FlowBranchingException.AddBreakOrigin): If 'finally_vector' is
10407 set, propagate the origin upward, and only complain if there was
10409 (FlowBranchingException.AddContinueOrigin): Likewise.
10410 (FlowBranchingException.AddReturnOrigin): Likewise.
10411 (FlowBranchingException.AddGotoOrigin): Likewise.
10413 2006-05-23 Raja R Harinath <rharinath@novell.com>
10415 * flowanalysis.cs (UsageVector.MergeOrigins): If an origin is
10416 unreachable, skip it.
10417 (FlowBranchingException.Merge): Always propagate jumps, even if
10418 the finally block renders subsequent code unreachable.
10420 2006-05-18 Raja R Harinath <rharinath@novell.com>
10423 * statement.cs (Goto.Resolve): Move responsibility for resolving
10424 'goto' to FlowBranching.AddGotoOrigin.
10425 (Goto.SetResolvedTarget): New. Callback to set the
10426 LabeledStatement that's the target of the goto.
10427 (Goto.DoEmit): Use Leave instead of Br when crossing an
10428 unwind-protect boundary.
10429 * flowanalysis.cs (FlowBranching.AddGotoOrigin): Rename from
10430 LookupLabel and adjust to new semantics.
10431 (FlowBranchingToplevel.AddGotoOrigin): Likewise.
10432 (FlowBranchingBlock.AddGotoOrigin): Likewise. Use
10433 Goto.SetResolvedTarget to update target.
10434 (FlowBranchingLabeled.AddGotoOrigin): Likewise.
10435 (FlowBranchingException.AddGotoOrigin): Rewrite to be similar to
10436 AddBreakOrigin & co. Delay propagation until ...
10437 (FlowBranchingException.Merge): ... this.
10439 * statement.cs (Block.Resolve): Always depend on flow-branching to
10440 determine unreachability. Kill workaround that originally emitted
10441 only one statement after an "unreachable" label (see infloop in
10444 Fix #77869, #76148, #77755, #75255 and a host of other bugs.
10445 This is still "wrong", but anything better would probably need a
10446 multi-pass algorithm.
10447 * flowanalysis.cs (FlowBranchingLabeled): Salt away a copy of the
10448 usage vector. Force current usage vector to be reachable, to
10449 optimistically signify backward jumps.
10450 (FlowBranchingLabeled.LookupLabel): Note if a backward jump is
10452 (FlowBranchingLabeled.Merge): New. If no backward jump was
10453 detected, return the original salted-away usage vector instead,
10454 updated with appropriate changes. Print unreachable warning if
10456 * statement.cs (Block.Resolve): Don't print unreachable warning on
10457 a labeled statement.
10459 2006-05-17 Gert Driesen <drieseng@users.sourceforge.net>
10461 * driver.cs: Pass filename without path to AssemblyBuilder's
10462 AddResourceFile. Fixes bug #78407.
10464 2006-05-17 Raja R Harinath <rharinath@novell.com>
10466 * statement.cs (LabeledStatement.Resolve): Move merging of origins ...
10467 * flowanalysis.cs (FlowBranchingLabeled): ... here.
10468 (FlowBranching.MergeChild): Overwrite
10469 reachability information from Labeled branchings too.
10471 2006-05-16 Raja R Harinath <rharinath@novell.com>
10473 * statement.cs (Goto.Resolve): Merge jump origins here ...
10474 * flowanalysis.cs (FlowBranching.Label): ... rather than here.
10476 * flowanalysis.cs (FlowBranching.LookupLabel): Move CS0159 check ...
10477 (FlowBranchingToplevel.LookupLabel): ... here. Add CS1632 check.
10478 (FlowBranchingGoto.LookupLabel): New. Handle back jumps.
10479 (FlowBranchingBlock.LookupLabel): Call LabeledStatement.AddReference
10481 * statement.cs (Goto.Resolve): ... not here.
10482 (Goto.Emit): Remove CS1632 check.
10484 2006-05-14 Marek Safar <marek.safar@seznam.cz>
10486 * ecore.cs (Expression.ResolveAsTypeTerminal): Fixed type in the obsolete
10489 2006-05-11 Raja R Harinath <rharinath@novell.com>
10491 * flowanalysis.cs (UsageVector.MergeJumpOrigins): Kill.
10492 (FlowBranchingBlock.Label): Use UsageVector.MergeOrigins.
10493 (FlowBranchingException.Label): Likewise.
10495 * flowanalysis.cs (MyBitVector.SetAll): New. Sets all bits to the
10497 (MyBitVector.Or): Use it to avoid losing information (Count).
10498 (FlowBranching.MergeOrigins): Likewise.
10500 * flowanalysis.cs (UsageVector.IsDirty): Remove.
10501 (UsageVector.Parameters, UsageVector.ParameterVector): Likewise.
10502 (UsageVector.Locals, UsageVector.LocalVector): Likewise.
10503 (UsageVector.ToString): Simplify.
10504 (UsageVector.MergeSiblings): Move here from ...
10505 (FlowBranching.Merge): ... here.
10506 (FlowBranchingToplevel.CheckOutParameters): Take an UsageVector,
10509 2006-05-10 Raja R Harinath <rharinath@novell.com>
10511 * flowanalysis.cs (UsageVector.MergeOrigins): Simplify, now that a
10512 null bitvector is treated as all-true.
10514 * flowanalysis.cs (MyBitVector.And, MyBitVector.Or): Make lazier.
10515 (MyBitVector): Rationalize invariants. 'vector != null' implies
10516 that we have our own copy of the bitvector. Otherwise,
10517 'InheritsFrom == null' implies all inherited bits are true.
10519 2006-05-09 Marek Safar <marek.safar@seznam.cz>
10521 * statement.cs (LocalInfo): Add IsConstant.
10522 (LocalInfo.DeclareLocal): Moved from EmitMeta and changed to don't emit
10523 local variable for constants.
10525 2006-05-09 Raja R Harinath <rharinath@novell.com>
10527 * flowanalysis.cs (MyBitVector.Empty): New.
10528 (MyBitVector): Don't allow InheritedFrom to be null.
10529 (MyBitVector.And, MyBitVector.Or): Treat 'null' as all-ones.
10530 (UsageVector, FlowBranching): Update to changes.
10532 * flowanalysis.cs (FlowBranching.InTryWithCatch): Don't terminate
10533 recursion. The 'Parent == null' condition isn't sufficient for
10535 (FlowBranching.AddBreakOrigin): Likewise.
10536 (FlowBranching.AddContinueOrigin): Likewise.
10537 (FlowBranching.AddReturnOrigin): Likewise.
10538 (FlowBranching.StealFinallyClauses): Likewise.
10539 (FlowBranching.MergeTopBlock): Move to FlowBranchingToplevel.
10540 (FlowBranching.CheckOutParameters): Likewise.
10541 (FlowBranchingToplevel): Terminate all the above recursions here.
10542 (FlowBranchingToplevel.End): Rename from MergeTopBlock.
10543 * codegen.cs (EmitContext.ResolveTopBlock): Update to changes.
10545 * flowanalysis.cs (BranchingType.Toplevel): New. Represents a
10547 (FlowBranchingToplevel): New. Empty for now.
10548 (FlowBranching.MergeTopBlock): Update.
10549 * codegen.cs (EmitContext.ResolveTopBlock): Create a Toplevel
10550 branching for the anonymous delegate.
10551 (EmitContext.StartFlowBranching): Add ToplevelBlock variant.
10553 * flowanalysis.cs (UsageVector.MergeOrigins): Reorganize.
10554 (UsageVector.MergeJumpOrigins): Don't ignore current reachability
10555 information at the start of the merge. Reorganize.
10557 2006-05-07 Marek Safar <marek.safar@seznam.cz>
10559 * class.cs (MethodData.Define): Method cannot implement interface accessor.
10561 2006-05-07 Marek Safar <marek.safar@seznam.cz>
10563 * expression.cs (QualifiedAliasMember.ResolveAsTypeStep): Pass location
10564 to newly introduced ctor.
10566 * namespace.cs (Namespace.Error_NamespaceDoesNotExist): Moved an error
10567 message to one place.
10568 (GlobalRootNamespace.Error_NamespaceDoesNotExist): Custom message for
10571 2006-05-07 Marek Safar <marek.safar@seznam.cz>
10573 * const.cs (Const.Error_ExpressionMustBeConstant): Better error message.
10575 * ecore.cs (Expression.ResolveAsConstant): Updated.
10577 * statement.cs (ResolveMeta): Updated.
10579 2006-05-06 Marek Safar <marek.safar@seznam.cz>
10581 * cs-parser.jay: __arglist cannot be used in initializer.
10583 2006-05-06 Marek Safar <marek.safar@seznam.cz>
10586 * namespace.cs (LocalAliasEntry.DoResolve): Don't allow to access nested
10589 2006-05-05 Raja R Harinath <rharinath@novell.com>
10591 * statement.cs (EmptyStatement.ResolveUnreachable): Override.
10592 (LabeledStatement): Add 'name' parameter.
10593 (LabeledStatement.Name, LabeledStatement.JumpOrigins): New.
10594 (Block.AddLabel): Update to changes.
10595 * cs-parser.jay (labeled_statement): Likewise.
10597 * flowanalysis.cs (BranchingType.Labeled): New.
10598 (UsageVector.MergeOrigins): Remove unused 'branching' argument.
10599 (FlowBranchingLabeled): New. Does nothing for now, but will
10600 eventually handle 'goto' flows.
10601 * codegen.cs (StartFlowBranching): Add new LabeledStatement variant.
10602 * statement.cs (LabeledStatement.Resolve): Create a FlowBranching
10603 that's terminated ...
10604 (Block.Resolve): ... here.
10606 * flowanalysis.cs (UsageVector.MergeFinally): Remove.
10607 (UsageVector.MergeFinallyOrigins): Likewise.
10608 (FlowBranching.InTryOrCatch): Likewise.
10609 (FlowBranching.AddFinallyVector): Likewise.
10610 (FlowBranchingException): Update to changes.
10613 * statement.cs (Return.Resolve): Move error checking to ...
10614 * flowbranching.cs (FlowBranching.AddReturnOrigin): ... this.
10615 (FlowBranchingException): Handle return origins like break and
10617 (FlowBranching.UsageVector.CheckOutParameters): Remove.
10619 2006-05-04 Marek Safar <marek.safar@seznam.cz>
10622 * class.cs (TypeContainer.FindMembers): Includes event method in the methods
10625 2006-05-04 Marek Safar <marek.safar@seznam.cz>
10628 * class.cs (MethodData.Define): Do public accessor check only when method
10629 implements an interface.
10631 2006-05-04 Raja R Harinath <rharinath@novell.com>
10633 Remove special handling of 'break'
10634 * flowanalysis.cs (Reachability): Remove all mention of 'breaks'.
10635 (Reachability.Meet): Simplify. Remove 'do_breaks' argument.
10636 (UsageVector.Break): Remove.
10637 (FlowBranching.Merge): Use 'Reachable.IsUnreachable' to determine
10639 (FlowBranchingBreakable.Merge): Don't ResetBreaks.
10641 * statement.cs (Break.Resolve): Call UsageVector.Goto (), not
10642 UsageVector.Breaks (). Don't set NeedsReturnLabel.
10644 2006-05-03 Marek Safar <marek.safar@seznam.cz>
10647 * pending.cs (PendingImplementation.BaseImplements): A found member cannot
10648 be the interface member.
10650 2006-05-03 Marek Safar <marek.safar@seznam.cz>
10653 * constant.cs (LongConstant.EmitLong): Fixed to catch also negative values
10654 for emitting small (int) values.
10656 2006-05-03 Raja R Harinath <rharinath@novell.com>
10659 * flowanalysis.cs (FlowBranchingException.Merge): Ensure
10660 control-flow passes through the 'finally' after merging-in all the
10661 control-flows from 'try' and the 'catch' clauses.
10663 * flowanalysis.cs (FlowBranching.IsLoop): Remove.
10664 (FlowBranching.IsTryOrCatch): Remove 'is_return' parameter. It's
10665 always true at the only non-recursive entry point.
10666 (FlowBranching.CreateBranching) [BranchingType.Loop]: Return a
10667 FlowBranchingBreakable.
10668 (FlowBranchingLoop): Remove.
10669 * statement.cs (Return.DoResolve): Update to changes.
10672 * flowanalysis.cs (FlowBranching.BranchingType.Embedded): New.
10673 (FlowBranching.CreateBranching): Handle it: create a
10674 FlowBranchingContinuable.
10675 (FlowBranching.BreakCrossesExceptionBoundary): Remove.
10676 (FlowBranching.AddContinueOrigin): Similar to AddBreakOrigin,
10677 except that it handles the 'continue' command.
10678 (FlowBranching.UsageVector.MergeOrigins): Rename from
10680 (FlowBranchingContinuable): Similar to FlowBranchingBreakable,
10681 except that it overrides AddContinueOrigin.
10682 (FlowBranchingException): Override AddContinueOrigin, similar to
10684 * statement.cs (While.Resolve, Foreach.ArrayForeach.Resolve):
10685 Create a new branching around the embedded statement.
10686 (Do.Resolve, For.Resolve): Likewise. Do reachability analysis for
10687 control flow after the embedded statement.
10688 (Continue.Resolve): Move all error checking to AddContinueOrigin.
10690 * flowanalysis.cs (FlowBranching.IsSwitch): Remove.
10691 (FlowBranching.CreateBranching) [BranchingType.Switch]: Create a
10692 FlowBranchingBreakable.
10693 (FlowBranchingSwitch): Remove.
10696 * statement.cs (Break.Resolve): Simplify. Move responsibility for
10697 error reporting to ...
10698 * flowanalysis.cs (FlowBranching.AddBreakOrigin) ... this.
10699 Rename from 'AddBreakVector'. Add new location argument. Return
10700 a bool indicating whether the 'break' crosses an unwind-protect.
10701 (FlowBranchingException.AddBreakOrigin): Add.
10702 (FlowBranchingException.Merge): Propagate 'break's to surrounding
10703 flowbranching after updating with the effects of the 'finally'
10705 (FlowBranchingBreakable): New common base class for
10706 FlowBranchingLoop and FlowBranchingSwitch.
10708 * statement.cs (Foreach.ArrayForeach.Resolve): Set barrier after
10709 embedded statement.
10710 (Foreach.CollectionForeach.Resolve): Remove extraneous flowbranching.
10712 2006-05-02 Raja R Harinath <rharinath@novell.com>
10714 * statement.cs (Do.Resolve): If the loop is infinite, set the
10716 (While.Resolve, For.Resolve): Set a barrier after the embedded
10717 statement. There's no direct control flow that goes from the end
10718 of the embedded statement to the end of the loop.
10719 * flowanalysis.cs (FlowBranching.Infinite): Remove.
10720 (FlowBranchingLoop.Merge): Don't look at 'Infinite'. The changes
10721 above ensure that the reachability is correctly computed.
10723 * flowanalysis.cs (Reachability.ResetBarrier): Remove.
10724 (UsageVector.MergeBreakOrigins): If the current path is
10725 unreachable, treat it as if all parameters/locals are initialized.
10726 (FlowBranchingLoop.Merge): Don't clear any barriers. Handle
10727 infinite loops before merging-in break origins.
10729 * flowanalysis.cs (Reachability.Meet): Simplify code handling 'returns'.
10730 (Reachability.Reachable): Split part into ...
10731 (Reachability.Unreachable): ... this. Simplify.
10732 (Reachability.IsUnreachable): Use 'Unreachable' instead.
10734 * flowanalysis.cs (Reachability.SetReturnsSometimes): Remove.
10735 (Reachability.SetThrowsSometimes): Likewise.
10736 (FlowBranchingBlock.MergeTopBlock): Don't compare against
10737 TriState.Always, use corresponding property.
10738 * statement.cs (Lock.Resolve, Try.Resolve, Using.Resolve): Likewise.
10739 (Block.Resolve): Likewise. Remove some redundant checks.
10741 2006-05-02 Raja R Harinath <harinath@gmail.com>
10743 * flowanalysis.cs (UsageVector.Throw): Set barrier too.
10744 (Reachability.Meet): Don't bother checking AlwaysThrows --
10745 barrier is always set.
10746 (FlowBranchingBlock.Merge): Likewise.
10748 2006-05-01 Raja R Harinath <harinath@gmail.com>
10750 * codegen.cs (EmitContext.ResolveTopBlock): Remove redundant
10751 checks for unreachable.
10753 2006-05-01 Marek Safar <marek.safar@seznam.cz>
10756 * flowanalysis.cs (UsageVector.IsAssigned): Add flag to ignore short path.
10758 * statement.cs (Block.UsageWarning): Uses newly introduced flag to detect
10759 whether field is really assigned.
10761 2006-04-30 Raja R Harinath <harinath@gmail.com>
10763 * flowanalysis.cs (Reachability): Make 4-argument constructor
10765 (Reachability.Meet): Rename from 'And'. Remove static variant.
10766 (Reachability.Always): Rename from the highly misleading
10767 'Reachability.Never'.
10768 (FlowBranching.Merge): Update to changes. Mark an impossible
10769 situation with a 'throw'.
10770 (*): Update to changes.
10772 2006-04-29 Raja R Harinath <harinath@gmail.com>
10774 * flowanalysis.cs (TriState): Rename from FlowBranching.FlowReturns.
10775 Remove 'Undefined'.
10776 (FlowBranching.TriState_Meet): Rename from AndFlowReturns. Simplify.
10777 (FlowBranching.TriState_Max): Rename from OrFlowReturns. Simplify.
10778 (*): Update to changes.
10779 * statement.cs: Update to changes.
10781 2006-04-28 Marek Safar <marek.safar@seznam.cz>
10784 *class.cs (Method.FindOutBaseMethod): Base method cannot be property method.
10786 2006-04-28 Raja R Harinath <harinath@gmail.com>
10788 * flowanalysis.cs (FlowBranching.MergeTopBlock): Don't create a
10791 * flowanalysis.cs (UsageVector.MergeChild): Change FlowBranching
10792 argument to two arguments: an usage-vector and a bool. Move call
10793 to FlowBranching.Merge () ...
10794 (FlowBranching.MergeChild, FlowBranching.MergeTopBlock): ... here.
10796 * flowanalysis.cs (UsageVector.MergeChild): Move special-case
10797 handling of loop and switch reachability to ...
10798 (FlowBranchingLoop.Merge, FlowBranchingSwitch.Merge): ... these.
10800 2006-04-27 Raja R Harinath <harinath@gmail.com>
10802 * flowanalysis.cs (FlowBranching.InLoop): Move special-case
10803 handling to FlowBranchingLoop.InLoop.
10804 (FlowBranching.InSwitch): Likewise, to FlowBranchingSwitch.
10806 2006-04-26 Marek Safar <marek.safar@seznam.cz>
10809 * anonymous.cs (AnonymousMethod.DoResolve): Moved the check whether
10810 anonymous method is allowed from AnonymousContainer here.
10812 * attribute.cs, codegen.cs (EmitContext): Add IsAnonymousMethodAllowed.
10814 2006-04-24 Raja R Harinath <rharinath@novell.com>
10817 * flowanalysis.cs (MyBitVector.Or): Add null check on argument.
10819 2006-04-23 Marek Safar <marek.safar@seznam.cz>
10822 * constant.cs (FloatConstant.Reduce): Add range checking for checked context.
10823 (DoubleConstant.Reduce): Ditto.
10825 2006-04-23 Raja R Harinath <rharinath@novell.com>
10827 * expression.cs (LocalVariableReference.DoResolveBase): Simplify.
10828 Remove 'lvalue_right_side' argument. Move parts to ...
10829 (LocalVariableReference.ResolveLocalInfo, LocalVariable.DoResolve)
10830 (LocalVariable.DoResolveLValue): ... these.
10832 2006-04-21 Raja R Harinath <rharinath@novell.com>
10835 * codegen.cs (EmitContext.InRefOutArgumentResolving): Remove.
10836 * expression.cs (EmptyExpression.LValueMemberOutAccess): New.
10837 (LocalVariableReference.DoResolveBase): Use it to implement new
10839 (IndexerAccess.DoResolveLValue): Handle LValueMemberOutAccess.
10840 (Argument.Resolve): Simplify. Move CS1510 check ...
10841 * ecore.cs (Expression.ResolveLValue): ... here.
10842 (UnboxCast.DoResolveLValue): Handle LValueMemberOutAccess.
10843 (PropertyExpr.DoResolveLValue): Likewise.
10844 (FieldExpr.Report_AssignToReadonly): Likewise.
10845 (FieldExpr.DoResolve): Add 'out_access' argument. Use
10846 LValueMemberAccess or LValueMemberOutAccess on instance depending
10848 (FieldExpr.DoResolveLValue): Pass 'out_access' argument to
10849 DoResolve as appropriate.
10851 2006-04-20 Raja R Harinath <rharinath@novell.com>
10854 * expression.cs (Invocation.VerifyArgumentsCompat): Don't try
10855 implicit conversions on 'out' and 'ref' arguments.
10857 * expression.cs (Invocation.VerifyArgumentsCompat): Reorganize to
10858 improve clarity. Remove dead code.
10861 * statement.cs (Block.UsageWarning): Allow VariableInfo to be null.
10862 (Catch.Resolve): Resolve VarBlock if it exists.
10864 2006-04-19 Miguel de Icaza <miguel@novell.com>
10866 * statement.cs (Foreach.EmitFinally): Do not emit the enumerator
10867 twice, this was some residual code, the enumerator was emitted
10868 properly in the two branche of if later.
10870 2006-04-19 Raja R Harinath <rharinath@novell.com>
10872 * expression.cs (Cast.ResolveLValue): Remove. The result of a
10873 cast is never an lvalue.
10874 (Cast.DoResolve, Cast.ResolveRest): Combine.
10875 (Argument.Emit): Simplify slightly. Move 'Expr is
10876 IMemoryLocation' check ...
10877 (Argument.Resolve): ... here.
10878 (Argument.Error_LValueRequired): Remove. Inline into only user.
10880 Simplifications. Fix cs0191-2.cs
10881 * ecore.cs (FieldExpr.DoResolve): Move handling of CS0192, CS0198,
10882 CS1649 and CS1651 to ...
10883 (FieldExpr.Report_AssignToReadonly): ... this. Simplify by moving
10884 the actual selection of the error code and message to a lookup
10885 table. Add a dummy return value to simplify callsites.
10886 (FieldExpr.ResolveLValue): Don't allow a constructor to write to
10887 readonly fields of other instances of the same type. Move CS0197
10889 * expression.cs (Argument.Resolve): ... here. Simplify code.
10890 Ensure that ec.InRefOutArgumentResolving is only set during LValue
10891 resolution of an out or ref argument. The code simplification
10892 above uses this invariant.
10894 2006-04-18 Raja R Harinath <rharinath@novell.com>
10896 Possibly fix #77752. Fix cs1690-[4-7].cs.
10897 * ecore.cs (Expression.CheckMarshalByRefAccess): Renamed from
10898 CheckMarshallByRefAccess. Drop parameter.
10899 (FieldExpr.CheckMarshalByRefAccess): Update. Change CS1690 to a
10901 (FieldExpr.DoResolve): Call CheckMarshalByRefAccess on
10902 InstanceExpression.
10903 * report.cs (AllWarnings): Add CS1690.
10904 * expression.cs (Argument.Resolve): Use EmptyExpression.OutAccess
10905 for ref access too.
10906 (LocalVariableReference.DoResolveBase): Update.
10908 2006-04-09 Marek Safar <marek.safar@seznam.cz>
10910 * class.cs (MethodOrOperator): Moved common parts from method class.
10911 detect obsolete attributes.
10912 (Method.Define): Simplified as it reuses code from base.
10913 (Constructor.ValidAttributeTargets): Fixed issue found during
10915 (Destructor.ValidAttributeTargets): Fixed issue found during
10917 (Operator): Finished refactoring set off by #78020. Operator class is now
10918 ordinary method class.
10920 * anonymous.cs: Updated.
10922 * decl.cs (DeclSpace): Add IsGeneric
10924 2006-04-09 Marek Safar <marek.safar@seznam.cz>
10926 * class.cs (Constructor.Emit): Don't emit the attributes twice.
10928 2006-04-09 Marek Safar <marek.safar@seznam.cz>
10930 * class.cs (Operator.Emit): Extracted code from MethodData to correctly
10931 detect obsolete attributes.
10932 (Method.CreateEmitContext): Moved to MethodOrOperator.
10934 2006-04-09 Marek Safar <marek.safar@seznam.cz>
10937 * class.cs (TypeContainer.MemberCoreArrayList.DefineContainerMembers): Throw
10938 customized exception to make crash detection easier.
10939 (MethodOrOperator): Started to work on new base class for methods and
10941 (Method): Derives from MethodOrOperator.
10942 (Constructor.Emit): Emits its own attributes.
10943 (AbstractPropertyEventMethod.Emit): Ditto.
10944 (Operator): Derives from MethodOrOperator, will refactor fully in extra
10946 (Operator.Emit): It's temporary more tricky than should be.
10948 * doc.cs (GetMethodDocCommentName): Updated after operator changes.
10950 * report.cs (InternalErrorException): Add ctor with inner exception.
10952 2006-04-08 Marek Safar <marek.safar@seznam.cz>
10955 * ecore.cs (SimpleName.ResolveAsTypeStep): Report better error when type is
10958 2006-04-07 Marek Safar <marek.safar@seznam.cz>
10961 * expression.cs (ArrayCreation.GetAttributableValue): Creates correctly typed
10964 2006-04-06 Marek Safar <marek.safar@seznam.cz>
10966 * class.cs (Class.ApplyAttributeBuilder): Report an error when ComImport
10967 attribute is present and Guid not.
10968 (Interface.ApplyAttributeBuilder): Ditto.
10970 * attribute.cs: Add error message.
10972 2006-04-06 Marek Safar <marek.safar@seznam.cz>
10976 * attribute.cs (Attribute.AttachTo): The attribute can have multiple
10977 sources (it's composite) so hold them in extra array as they are used in
10978 Emit phase only. It worked in the previous versions by mistake.
10979 (Attribute.Emit): Emit attribute for more owners when exist.
10981 * codegen.cs, class.cs: Updated to don't re-attach attribute twice as now
10982 it has now different behaviour.
10984 2006-04-04 Marek Safar <marek.safar@seznam.cz>
10986 * constant.cs (Constant.IsDefaultInitializer): New method.
10988 * class.cs: Updated.
10990 * expression.cs (ArrayCreation.CheckIndices): Add an optimization to don't
10991 re-initialize default values. It saves KBs almost for every assembly.
10992 Thanks Zoltan for the idea.
10993 (ArrayCreation.ResolveInitializers): Renamed from ValidateInitializers.
10994 (ArrayCreation.DoResolve): Resolve only once.
10995 (ArrayCreation.Emit): Emit static initializer only when it is faster.
10996 (ArrayCreation.GetAttributableValue): Cope with optimized values.
10998 2006-04-03 Zoltan Varga <vargaz@gmail.com>
11000 * report.cs (Warning, Error): Add 0-, 1-, and 2- argument specializations.
11003 2006-04-01 Marek Safar <marek.safar@seznam.cz>
11005 * assign.cs (Assign.DoResolve): Assignment to same variable can occur
11006 in an embedded statement too.
11008 2006-04-01 Raja R Harinath <rharinath@novell.com>
11011 * statement.cs (Switch.EmitObjectInteger) [ulong]: Remove bad cast.
11013 2006-04-01 Marek Safar <marek.safar@seznam.cz>
11017 * class.cs (TypeContainer.AddPartial): Don't report an error when modifier
11020 * modifiers.cs: Add DEFAULT_ACCESS_MODIFER.
11022 2006-03-31 Marek Safar <marek.safar@seznam.cz>
11024 * assign.cs (LocalTemporary): Don't require ILGenerator in the resolve
11027 * anonymous.cs, assign.cs, ecore.cs, expression.cs: Updated after
11028 LocalTemporary change.
11030 * class.cs (ClassOrStruct.DefineDefaultConstructor): Moved from
11032 (ClassOrStruct.DefineFieldInitializers): Implemented static field
11033 initializers optimization.
11034 (ClassOrStruct.TypeAttr): Moved from modifiers.
11035 (Constructor.CheckBase): Don't crash when static ctor has parameters.
11036 (FieldBase.ResolveInitializer): Resolves initializer.
11037 (FieldBase.HasDefaultInitializer): New property.
11039 * cs-parser.jay: Removed message.
11041 * expression.cs (CompilerGeneratedThis): New specialization.
11043 * modifiers.cs (TypeAttr): Moved to ClassOrStruct.TypeAttr
11045 2006-03-28 Marek Safar <marek.safar@seznam.cz>
11047 * cs-parser.jay, cs-tokenizer.cs: On demand Stack allocation.
11049 2006-03-27 Marek Safar <marek.safar@seznam.cz>
11051 * ecore.cs (Expression.ResolveAsConstant): Clean up, enum constants should
11052 be now EnumConstants only.
11054 2006-03-27 Marek Safar <marek.safar@seznam.cz>
11056 * attribute.cs, driver.cs: Reset more caches.
11058 2006-03-26 Marek Safar <marek.safar@seznam.cz>
11060 * cs-tokenizer.cs (adjust_real): Uses float.Parse for float literals.
11062 2006-03-26 Marek Safar <marek.safar@seznam.cz>
11064 * constant.cs (Constant.Reduce): Replaced EmitContext with single bool
11065 for easier reuse. Updated all overrides.
11066 (IntegralConstant): New base class for all integral constants.
11067 (IntegralConstant.Error_ValueCannotBeConverted): When assigned value if out
11068 of the constant range, report custom error.
11069 (UIntConstant.Reduce): Fixed uint conversion.
11071 * ecore.cs, literal.cs: Reduce updates.
11073 2006-03-26 Marek Safar <marek.safar@seznam.cz>
11077 * class.cs (Constructor.Define): Removed extra if for default ctors.
11078 A patch from Atsushi Enomoto.
11080 2006-03-26 Marek Safar <marek.safar@seznam.cz>
11082 * attribute.cs (Attribute.ResolveConstructor): Conversion was moved to
11083 GetAttributableValue.
11085 * constant.cs (Constant.GetAttributableValue): Does implicit conversion
11088 * convert.cs (ImplicitConversionRequired): Error message moved to
11091 * ecore.cs (Expression.GetAttributableValue): Add type parameter for
11092 automatic implicit conversion of an output value.
11093 (EnumConstant.GetAttributableValue): Don't reduce the enum constants.
11095 * expression.cs (ArrayCreation.GetAttributableValue): Add element type
11097 (TypeOf.GetAttributableValue): Add extra handling for object type.
11099 * literal.cs (DoubleLiteral.Error_ValueCannotBeConverted): Doubles can have
11100 special error message.
11102 2006-03-25 Marek Safar <marek.safar@seznam.cz>
11104 * class.cs (Constructor.Emit): Don't crash when struct ctor is
11106 (Constructor.ApplyAttributeBuilder): Transform MethodImplAttribute to be
11107 compatible with MS runtime.
11109 2006-03-23 Marek Safar <marek.safar@seznam.cz>
11111 * attribute.cs (Attribute.ResolveConstructor): Check for an invalid
11112 attribute arguments here.
11114 * class.cs (Indexer.Define): The check was moved to attribute class.
11116 2006-03-22 Marek Safar <marek.safar@seznam.cz>
11118 * assign.cs, class.cs, codegen.cs, convert.cs, decl.cs, ecore.cs,
11119 expression.cs, typemanager.cs: Minor changes from gmcs to make merging
11122 2006-03-22 Raja R Harinath <rharinath@novell.com>
11124 Support ParameterDefaultValueAttribute in gmcs. Also applied to
11125 mcs to keep code differences small.
11126 * attribute.cs (Attribute.GetParameterDefaultValue): New.
11127 * typemanager.cs (parameter_default_value_attribute_type): New.
11128 * parameter.cs (Parameter.ApplyAttributeBuilder): Use them. Add
11131 2006-03-21 Marek Safar <marek.safar@seznam.cz>
11133 * expression.cs (StringConcat.Append): Reverted back to no warning state.
11135 2006-03-21 Marek Safar <marek.safar@seznam.cz>
11137 * const.cs (Error_ConstantCanBeInitializedWithNullOnly): Share a message.
11139 * statement.cs (Block.ResolveMeta): Look for wrong object constants in
11142 2006-03-21 Atsushi Enomoto <atsushi@ximian.com>
11144 * doc-bootstrap.cs : fix build.
11146 2006-03-20 Marek Safar <marek.safar@seznam.cz>
11148 * expression.cs (StringConcat.Append): Issue a warning when empty string
11149 is going to append.
11151 2006-03-20 Marek Safar <marek.safar@seznam.cz>
11153 * assign.cs (CompoundAssign.ResolveSource): Removed.
11155 * attribute.cs (ResolvePossibleAttributeType): Updated after MemberAccess
11158 * class.cs (TypeContainer.FindMethods): Removed.
11159 (TypeContainer.CheckMemberUsage): Made static.
11161 * codegen.cs (GetAssemblyName): Uses Length for empty string test.
11163 * constant.cs (CheckRange): Removed unused type argument.
11164 (CheckUnsigned): Removed unused type argument.
11166 * cs-parser.jay: Updated after MemberAccess clean up.
11167 Uses Length for empty string test.
11169 * cs-tokenizer.cs: Uses Length for empty string test.
11170 (IsCastToken): Made static.
11171 (is_hex): Made static.
11172 (real_type_suffix): Made static.
11174 * decl.cs (SetupCache): Made static.
11175 (OnGenerateDocComment): Removed unused ds argument.
11177 * delegate.cs (VerifyDelegate): Removed unused argument.
11179 * doc.cs: Uses Length for empty string test.
11181 * driver.cs: Uses Length for empty string test.
11183 * enum.cs (IsValidEnumType): Made static
11185 * expression.cs (EnumLiftUp): Removed unused argument.
11186 (ResolveMethodGroup): Ditto.
11187 (BetterConversion): Ditto.
11188 (GetVarargsTypes): Ditto.
11189 (UpdateIndices): Ditto.
11190 (ValidateInitializers): Ditto.
11191 (MemberAccess.ctor): Ditto.
11192 (GetIndexersForType): Ditto.
11194 * flowanalysis.cs: (MergeFinally): Removed unused argument.
11196 * iterators.cs: Updated after MemberAccess clean up.
11198 * location.cs: Uses Length for empty string test.
11200 * namespace.cs: Uses Length for empty string test.
11202 * report.cs (CheckWarningCode): Made static.
11204 * statement.cs (LabeledStatement): Removed unused argument.
11206 * typemanager.cs (FilterNone): Removed.
11208 2006-03-18 Marek Safar <marek.safar@seznam.cz>
11210 * codegen.cs (EmitContext.TestObsoleteMethodUsage): Removed as it become
11213 * class.cs: Updated.
11215 2006-03-18 Marek Safar <marek.safar@seznam.cz>
11217 * cs-parser.jay.cs: __arglist is not allowed for delegates.
11219 2006-03-18 Marek Safar <marek.safar@seznam.cz>
11223 * expression.cs (VerifyArgumentsCompat): Reverted to double error
11224 reporting, it's more tricky than I thought.
11226 2006-03-18 Marek Safar <marek.safar@seznam.cz>
11230 * anonymous.cs.cs (AnonymousMethod): Add host to allow access to
11232 (AnonymousMethod.ImplicitStandardConversionExists): New method.
11233 (AnonymousMethod.Compatible): Moved parameter resolving to DoResolve.
11234 Add more error reporting; Fixed issue with params.
11236 * convert.cs (ImplicitStandardConversionExists): Returned conversion check.
11238 * cs-parser.jay: AnonymousMethod requires host container.
11240 * delegate.cs (NewDelegate.DoResolve): Updated after Compatible changes.
11242 2006-03-18 Raja R Harinath <harinath@gmail.com>
11244 * class.cs: Change 'TypeContainer ds' constructor argument to
11245 'DeclSpace parent'. Some classes were missed below due to
11246 different naming convention.
11248 * class.cs (MemberCore.Parent): Delete. This makes the
11249 ParentContainer changes below enforceable by the compiler.
11251 Treat pointers to enclosing declaration space as 'DeclSpace', not
11253 * class.cs, const.cs, delegate.cs, enum.cs, iterator.cs: Change
11254 'TypeContainer parent' constructor argument to 'DeclSpace parent'.
11256 * statement.cs (LocalInfo..ctor): Use DeclSpace argument instead
11258 (Block.AddThisVariable): Likewise.
11259 * class.cs (MethodData.Define, MethodData.Emit): Likewise.
11260 (AbstractPropertyEventMethod.Emit): Likewise.
11261 (AbstractPropertyEventMethod.EmitMethod): Likewise.
11262 (GetMethod.Define, SetMethod.Define): Likewise.
11263 (PropertyMethod.Define, DelegateMethod.Define): Likewise.
11264 (DelegateMethod.EmitMethod): Likewise.
11266 Fix regression test-partial-13.cs.
11267 Rationalize use of PartialContainer. Ensure that the partial
11268 class semantics can be tied to type-correctness, i.e., any
11269 violation will cause a compile error.
11270 * class.cs, const.cs: Access all fields that belong to class
11271 TypeContainer via ParentContainer. Arguments of EmitContexts and
11272 Resolve()-like functions still use 'Parent'.
11274 * class.cs (SourceMethod): Use DeclSpace, not TypeContainer.
11275 (*.CreateEmitContext): Change TypeContainer argument to DeclSpace.
11276 (PropertyMethod.CheckModifiers): Remove unused argument.
11277 * codegen.cs (EmitContext..ctor): Change TypeContainer argument to
11280 2006-03-17 Raja R Harinath <harinath@gmail.com>
11282 Make semantics of PartialContainer simpler.
11283 * decl.cs (DeclSpace.IsPartial): Remove.
11284 * class.cs (TypeContainer.IsPartial): Likewise.
11285 (TypeContainer..ctor): Set PartialContainer to point to self.
11286 (TypeContainer.GetClsCompliantAttributeValue): Don't use IsPartial.
11287 (TypeContainer.FindNestedType): Likewise.
11288 (MemberCore.ParentContainer): Simplify. Remove deprecation.
11290 2006-03-17 Marek Safar <marek.safar@seznam.cz>
11292 * typemanager.cs.cs (GetInterfaces): Don't recreate 0-sized arrays.
11294 2006-03-15 Marek Safar <marek.safar@seznam.cz>
11296 * class.cs (FieldMember.Emit): ParentContainer is real parent for partial
11299 2006-03-15 Marek Safar <marek.safar@seznam.cz>
11301 * class.cs (Operator.Define): An error for base conversion was not
11302 reported correctly.
11304 2006-03-14 Atsushi Enomoto <atsushi@ximian.com>
11306 * iterator.cs : yield break is allowed in try statement which has
11307 catch clauses. Fixed bug #77767.
11309 2006-03-13 Marek Safar <marek.safar@seznam.cz>
11311 A fix for #77593, #77574.
11313 * class.cs (MethodCore.CheckBase): Another if for operator.
11315 2006-03-09 Marek Safar <marek.safar@seznam.cz>
11317 * anonymous.cs (AnonymousMethod.Compatible): Don't crash when parameters
11320 * delegate.cs (Delegate.GetInvokeMethod): Use emitcontext free MemberLookup.
11321 (DelegateCreation.ImplicitStandardConversionExists): New method for just
11324 *ecore.cs (Expression.MemberLookup): Don't ask for emitcontext when it's
11327 * assign.cs, constant.cs, convert.cs, delegate.cs, expression.cs:
11328 Updated after another emitcontext usage was clean up. It should help us to
11329 synchronize with gmcs easier.
11331 2006-03-04 Marek Safar <marek.safar@seznam.cz>
11335 * class.cs (SetMethod.DefineParameters): Uses new parameters type ctor.
11336 (Event.Define): ditto
11337 (SetIndexerMethod.DefineParameters): Uses Parameters.MergeGenerated.
11339 * delegate.cs (Delegate.Define): Uses Parameters.MergeGenerated.
11340 Removed redundant code and set NewSlot for Invoke method too.
11342 * parameter.cs (Parameters.ctor): Add custom, type ctor.
11343 (Parameters.MergeGenerated): New method. Use this method when you merge
11344 compiler generated argument with user arguments.
11346 2006-03-03 Marek Safar <marek.safar@seznam.cz>
11348 * attribute.cs (ResolveAsTypeTerminal): Removed.
11350 * ecore.cs (Expression.ResolveAsTypeTerminal): Make virtual to allow
11351 specialization for predefined types; 30% speed up.
11352 Finally placed obsolete check to right place.
11353 (Expression.ResolveType): Removed.
11355 * enum.cs, expression.cs, parameter.cs, statement.cs, typemanager.cs:
11356 Updated after ResolveType was removed.
11358 * expression.cs (Cast.ctor): Check void cast.
11359 (Binary.ResolveAsTypeTerminal): Is never type.
11360 (Conditional.ResolveAsTypeTerminal): Is never type.
11362 * rootcontext.cs (ResolveCore): Set base type to simplify some code later.
11364 2006-03-01 Raja R Harinath <rharinath@novell.com>
11367 * expression.cs (ParameterReference.DoResolveBase): Change return
11369 (ParameterReference.DoResolve, ParameterReference.DoResolveLValue):
11373 * ecore.cs (PropertyExpr.InstanceResolve): Fix CS1540 check.
11376 * typemanager.cs (GetFullNameSignature): Don't nullref on
11377 protected accessors.
11379 2006-02-27 Marek Safar <marek.safar@seznam.cz>
11381 * attribute.cs (Attribute.PosArguments, Attribute.NamedArguments): Use
11382 these two separated members to simplify the code.
11383 (Attribute.Resolve): Refactored to use new fields and methods.
11384 (Attribute.ResolveConstructor): Extracted from ResolveArguments and
11385 implemented obsolete attribute checking.
11386 (Attribute.ResolveNamedArguments): Extracted from ResolveArguments and
11387 implemented obsolete checking again. It look line never ending quest ;-)
11388 (GlobalAttribute.ResolveConstructor): Need to override as the rest.
11390 * cfold.cs (BinaryFold): TryReduce throws an exception to indicate error.
11392 * constanct.cs (TryReduce): Throws OverflowException to indicate error.
11394 *class.cs (Property.Define): Add RegisterProperty call.
11396 * cs-parser.jay: Replaced ArrayList with fixed array for attribute
11397 argument groups (only 2).
11399 * ecore.cs (Expression.GetAttributableValue): New virtual method used for
11400 encoding expression to arguments.
11401 (Expression.ExprClassToResolveFlags): Just turned to property.
11403 * expression.cs (ArrayCreation.ValidateInitializers): Slightly optimized.
11404 (ArrayCreation.GetAttributableValue): Renamed from EncodeAsAttribute and
11405 optimized as well as implemented support for zero-length attributes.
11407 * typemanager.cs (TypeManager.RegisterProperty, TypeManager.GetProperty):
11408 Add caching of PropertyInfo's.
11410 2006-02-25 Marek Safar <marek.safar@seznam.cz>
11412 * delegate.cs (DelegateCreation.ResolveMethodGroupExpr): Don't report
11413 error multiple times.
11415 2006-02-25 Marek Safar <marek.safar@seznam.cz>
11417 New partial class implementation.
11418 A fix for #77027, #77029, #77403
11420 * attribute.cs (Attributable): Made attributes protected.
11422 * class.cs (TypeContainer): Add PartialContainer and partial_parts as
11423 the replacements of ClassPart and PartialContainer.
11424 (TypeContainer.AddClassOrStruct): Call RecordDecl here.
11425 (TypeContainer.AddInterface): Ditto.
11426 (TypeContainer.AddPartial): The main method for partial classes. It checks
11427 for errors and merges ModFlags and attributes. At the end class is added to
11428 partial_parts list.
11429 (TYpeContainer.DefineDefaultConstructor): Checks whether default ctor is
11431 (TypeContainer.GetClsCompliantAttributeValue): Cope with partial class too.
11432 (TypeContainer.GetNormalPartialBases): Resolves base classes and interfaces
11433 from the rest of partial classes.
11434 (TypeContainer.GetClassBases): Simplified.
11435 (TypeContainer.DefineTypeBuilder): New method, mostly extracted from
11437 (TypeContainer.DefineDefaultConstructor): Is used by derived classes.
11438 (TypeContainer.HasExplicitLayout): Uses Flags now.
11439 (PartialContainer): Removed.
11440 (ClassOrStruct.AddToContainer): Moved enclosing member name check here.
11441 (StaticClass): Was merged with Class.
11442 (Class.GetClassBases): class and static class bases are verified here.
11443 (Class.TypeAttr): Added static attributes when class is static.
11444 (Struct.RegisterFieldForInitialization): Moved from TypeContainer.
11445 (MemberBase): In some cases we need to call parent container for partial
11446 class. It should be eliminated but it's not easy now.
11448 * cs-parser.jay: Replaced all PartialContainer with AddPartial.
11450 * decls.cs (MemberCore.DocComment): Introduced new property as is used by
11451 partial classed to accumulate class comments.
11452 (MemberCore.GetClsCompliantAttributeValue): Moved from TypeContainer.
11454 * doc.cs (GenerateTypeDocComment): Partial classes clean up.
11456 * driver.cs (MainDriver): Tree.GetDecl was removed.
11458 * modifiers.cs (Modifiers): Add partial modifier.
11460 * tree.cs (Tree.decl): Removed.
11461 (RootTypes): Started to use this class more often for root types
11464 2006-02-22 Marek Safar <marek.safar@seznam.cz>
11468 * attribute.cs (AttributeTester.GetCoClassAttribute): Don't crash when
11469 external interface does not have an attribute.
11471 2006-02-22 Marek Safar <marek.safar@seznam.cz>
11473 Another prerequisites for new partial classs implementation.
11475 * attribute.cs (Attribute.Equal): Implemented.
11476 (Attribute.Emit): Changed as attributes can be applied more than twice.
11477 (Attributes.Emit): Check for duplicate attributes here.
11479 * class.cs, decl.cs, delegate.cs, doc.cs, enum.cs: Don't pass DeclSpace
11480 as a parameter, clean-up.
11482 2006-02-11 Marek Safar <marek.safar@seznam.cz>
11486 * class.cs (TypeContainer.DefineType): Cannot use ResolveType because it
11487 contains obsolete attribute check which can in some cases look for base
11488 type of current class which is not initialized yet.
11489 (TypeContainer.BaseType): Replacement of ptype.
11491 * decl.cs (MemberCore.CheckObsoleteType): Reuse existing code.
11493 2006-02-11 Marek Safar <marek.safar@seznam.cz>
11495 First of prerequisites for new partial classs implemention.
11497 * attribute.cs (Attributable): Extended by ResolveContext;
11498 Attributes finally have correct context for resolving in all cases.
11499 (AttachTo): Attribute owner is assigned here.
11501 * codegen.cs (IResolveContext): Introduce new interface to hold
11502 all information needed in resolving phase.
11503 (EmitContext): Implements IResolveContext; more clean-up needed here.
11505 * decl.cs (MemberCore): Implemented IResolveContext.
11507 * anonymous.cs, attribute.cs, class.cs, codegen.cs, const.cs,
11508 decl.cs, ecore.cs, enum.cs, expression.cs, iterators.cs, namespace.cs,
11509 parameter.cs, statement.cs, tree.cs, typemanager.cs:
11510 Refactored to use new IResolveContext instead of EmitContext; cleanup
11512 2006-02-06 Miguel de Icaza <miguel@novell.com>
11514 * codegen.cs (EmitScopeInitFromBlock): check here the
11515 capture_context, there is no need to make two calls to the
11518 * anonymous.cs: Add some debugging messages that might help me
11519 track other instances of this problem in the future (the
11520 regression of test 467).
11522 * cs-parser.jay: track the variable block, as we need to initalize
11523 any captured variables declared in this block for the "catch"
11524 portion of the "Try" statement.
11526 * statement.cs (Try.Emit): If the "Catch" has a VarBlock, emit any
11527 scope initialization for captured variables.
11529 Also, move the emit for the variables after the block location has
11532 2006-02-06 Marek Safar <marek.safar@seznam.cz>
11534 * ecore.cs (PropertyExpr.FindAccessors): Just made flags const.
11536 2006-02-02 Miguel de Icaza <miguel@novell.com>
11538 * anonymous.cs (CaptureContext.EmitInitScope): I was wrong in the
11539 commit yesterday, the initialization for the roots is necessary.
11540 What is not necessary is the scope activation.
11542 2006-02-02 Raja R Harinath <rharinath@novell.com>
11544 * ecore.cs (PropertyExpr.DoResolveLValue): Add CS0206 check.
11545 * expression.cs (IndexerAccess.DoResolveLValue): Add CS1612 and
11547 (Argument.Resolve): Remove CS0206 checks.
11549 2006-02-01 Miguel de Icaza <miguel@novell.com>
11551 * anonymous.cs (CaptureContext.EmitInitScope): Do not emit the
11552 scopes for all the roots, the scopes will now be emitted when the
11553 Blocks are entered. [This change was wrong, fixed on 2006-02-02]
11555 (CaptureContext.EmitScopeInitFromBlock): Simply emit the ScopeInfo
11556 code. This reduces a lot of existing cruft.
11558 * statement.cs (Block.Emit): Call EmitScopeInitFromBlock here, so
11559 that the ScopeInfo is generated as we enter the scope, not at the
11560 time of use, which is what we used to do before.
11562 * codegen.cs (EmitScopeInitFromBlock): New routine, this is called
11563 every time a Block is about to be emitted if we have a
11566 2006-02-01 Raja R Harinath <rharinath@novell.com>
11568 * typemanager.cs (NoTypes, NoTypeExprs): Remove.
11570 * *.cs: Use Type.EmptyTypes instead of TypeManager.NoTypes.
11572 * typemanager.cs (cons_param_array_attribute): Make private.
11573 (Reset): Set it to null.
11574 (InitCoreHelpers): Don't initialize it.
11575 (ConsParamArrayAttribute): New. Initialize it as needed.
11576 * parameter.cs (ParamsParameter.ApplyAttribute): Update to change.
11578 2006-01-31 Miguel de Icaza <miguel@novell.com>
11580 * expression.cs: There might be errors reported during the
11581 selection of applicable methods. If there are errors, do not
11582 continue execution as it will lead the compiler to crash.
11584 2006-01-30 Miguel de Icaza <miguel@novell.com>
11586 * expression.cs: Member access is not allowed on anonymous
11587 methods. Fixes #77402.
11589 2006-01-30 Raja R Harinath <rharinath@novell.com>
11592 * cs-parser.jay (VariableDeclaration): Don't set
11593 current_array_type to null.
11594 (field_declaration, event_declaration, declaration_statement):
11595 Set it to null here.
11597 2006-01-28 Raja R Harinath <harinath@gmail.com>
11599 * typemanager.cs (GenericParameterPosition): New.
11602 2006-01-28 Atsushi Enomoto <atsushi@ximian.com>
11604 * doc.cs : To process "include" elements, first we should create
11605 another list than XmlNodeList, because it could result in node
11606 removal, which could result in that the XmlNodeList gives up
11607 yielding next node.
11609 (Also made code identical to gmcs again.)
11611 2006-01-25 Miguel de Icaza <miguel@novell.com>
11613 * ecore.cs: Introduce an error report that we were not catching
11614 before, if not silent, we must report the error. Gonzalo ran into
11617 2006-01-23 Miguel de Icaza <miguel@novell.com>
11619 A fix for bug: #76957
11621 * iterators.cs (MoveNextMethod.CreateMethodHost): call
11622 ComputeMethodHost before creating the method, this is a new
11625 * anonymous.cs (AnonymousContainer): Now we track all the scopes
11626 that this method references (RegisterScope). The actual scope
11627 where the method is hosted is computed with the ComputeMethodHost
11628 before we create the method.
11630 Moved the Deepest routine here.
11632 (AnonymousContainer.ComputeMethodHost): New routine used to
11633 compute the proper ScopeInfo that will host the anonymous method.
11635 (ScopeInfo): Deal with multiple roots. The problem was that we
11636 did not have a unique root where all ScopeInfos could be hanged
11637 from. Remove `topmost' ScopeInfo, and instead keep an arraylist
11640 Remove AdjustMethodScope which is now computed at the end. Remove
11641 LinkScope which did a partial link, instead link all ScopeInfos
11642 before code generation from the new "LinkScopes" routine.
11644 Simplify all the Add* routines as they no longer need to maintain
11645 the tree, they just need to record that they are using variables
11648 (IsAncestor, GetAncestorScopes, GetParentScope, LinkScope): New
11649 routines to produce the forest of ScopeInfo trees.
11651 * class.cs (TypeContainer.AppendMethod): This is just like
11652 AddMethod, but ensures that an interface implementation method
11653 (IEnumerable.XXX) is not inserted at the beginning of the queue of
11654 methods, but at the end.
11656 We use this functionality to ensure that the generated MoveNext
11657 method in the iterator class is resolved/emitted before the
11658 enumerator methods created.
11660 This is required because the MoveNext method computes the right
11661 ScopeInfo for the method. And the other methods will eventually
11662 need to resolve and fetch information computed from the anonymous
11665 2006-01-21 Raja R Harinath <harinath@gmail.com>
11666 Carlos Alberto Cortez <calberto.cortez@gmail.com>
11668 Fix rest of #76995.
11669 * namespace.cs (NamespaceEntry.UsingExternalAliases): Don't add to
11670 the 'aliases' hash.
11671 (NamespaceEntry.LookupAlias): Lookup 'extern_aliases' hash too.
11672 (NamespaceEntry.VerifyUsing): Resolve external aliases too.
11674 2006-01-18 Raja R Harinath <rharinath@novell.com>
11676 Fix #76656, cs0231-2.cs.
11677 * cs-parser.jay (formal_parameter_list): Make error case catch
11679 (parenthesized_expression_0): Add CS1026 check.
11680 (invocation_expression): Remove unused { $$ = lexer.Location }.
11682 2006-01-17 Raja R Harinath <rharinath@novell.com>
11685 * cs-parser.jay (statement_expression): Don't list out the
11686 individual statement-expressions. Convert syntax error into
11689 2006-01-16 Raja R Harinath <rharinath@novell.com>
11692 * ecore.cs (MemberAccess.CheckIntermediateModification): Remove.
11693 (UnboxCast.DoResolveLValue): New. Move CS0445 check from
11694 CheckIntermediateModification.
11695 (FieldExpr.DoResolve): Add new two-argument version that
11696 allows us to resolve the InstanceExpression as an lvalue.
11697 The one-argument variant is now just a wrapper.
11698 (FieldExpr.DoResolveLValue): Use two-argument DoResolve.
11699 Resolve the lhs as an lvalue if the it has a value type.
11700 (FieldExpr.AssignToReadonly): Move CS1648 and CS1650 checks
11701 from Assign.DoResolve.
11702 (PropertyExpr.InstanceResolve): Allow InstanceExpression to be
11703 resolved as an lvalue.
11704 (PropertyExpr.DoResolve): Update.
11705 (PropertyExpr.DoResolveLValue): Resolve the lhs as an lvalue if it
11706 has a value type. Move CS1612 check here from
11707 CheckIntermediateModification.
11708 * assign.cs (Assign.DoResolve): Remove CS1648 and CS1650 checks.
11709 * expression.cs (EmptyExpression.OutAccess): New. Used as the
11710 'right_side' of a ResolveLValue on an 'out' argument.
11711 (EmptyExpression.LValueMemberAccess): New. Used as the
11712 'right_side' of a propagated ResolveLValue on a value type.
11713 (LocalVariableReference.DoResolveBase): Recognize
11714 EmptyExpression.OutAccess and EmptyExpression.LValueMemberAccess.
11716 (Argument.Resolve): Use EmptyExpression.OutAccess rather than
11717 EmptyExpression.Null.
11719 2006-01-16 Atsushi Enomoto <atsushi@ximian.com>
11721 * typemanager.cs : added IsGenericParameter(). In mcs it always
11723 * doc.cs : for generic parameters, use GenericParameterPosition,
11726 2006-01-12 Ben Maurer <bmaurer@andrew.cmu.edu>
11728 * expression.cs: Fix Console.WriteLine ((this = x).foo);
11730 2006-01-12 Miguel de Icaza <miguel@novell.com>
11732 This fixes the problem where we used ldfld instead of ldflda to
11733 load the "THIS" pointer on captured parameters, when THIS is a
11734 value type. See bug #77205.
11736 * iterators.cs (CapturedThisReference.Emit): Pass false to
11737 EmitThis (we do not need the address).
11739 * codegen.cs (EmitThis): it needs to know whether we need the
11740 address of `this' or not. This is used by value types.
11742 * expression.cs (This.AddressOf): Pass true to the EmitThis call,
11743 every other call passes false.
11745 2006-01-12 Raja R Harinath <rharinath@novell.com>
11748 * typemanager.cs (TryGetBaseDefinition): Rename from the mis-named
11750 * expression.cs (Invocation.OverloadResolve): Update.
11751 (Invocation.DoResolve): Avoid double resolution of invocation.
11753 2006-01-11 Raja R Harinath <rharinath@novell.com>
11756 * expression.cs (Unary.Emit): When in /checked+ mode, don't emit
11757 unary negation of floating point types as 0-expr; negation cannot
11758 overflow in floating point types.
11761 * expression.cs (MemberAccess.DoResolve): Disallow the use of '.'
11762 on operands of 'void' type.
11765 * cfold.cs (BinaryFold): Implement folding of BinaryOr, BinaryAnd
11766 and ExclusiveOr for boolean constants too.
11768 2006-01-09 Raja R Harinath <rharinath@novell.com>
11771 * expression.cs (Invocation.OverloadResolve): Replace reflected
11772 override methods with their base virtual methods, rather than
11773 skipping over them.
11774 * typemanager.cs (TypeManager.GetOverride): New.
11776 2006-01-05 Jb Evain <jbevain@gmail.com>
11778 * class.cs (Property.Define, Indexer.Define): do not tag the
11779 properties as SpecialName | RTSpecialName.
11781 2006-01-04 Miguel de Icaza <miguel@novell.com>
11783 * class.cs (MethodCore.IsDuplicateImplementation): This method was
11784 doing a low-level comparission of parameter types. It was lacking
11785 a check for __argslist.
11787 2005-12-30 Miguel de Icaza <miguel@novell.com>
11789 * expression.cs (ParameterReference.DoResolveBase): Allow
11790 reference parameters if they are local to this block.
11792 This allows the ref and out parameters of a delegate to be used in
11793 an anonymous method, for example:
11795 delegate void set (out int x);
11797 set s = delegate (out int x){
11801 This is used by functionality introduced late in the C# language.
11803 * anonymous.cs (AnonymousMethod.Compatible): Allow anonymous
11804 method that take ref and out parameters.
11806 Fixes #77119 which was a late change in the spec.
11808 2005-12-23 Miguel de Icaza <miguel@novell.com>
11810 * anonymous.cs (ScopeInfo.LinkScope): Do not link the scope to its
11811 parent if its the same scope. Fixes #77060.
11813 2005-12-21 Miguel de Icaza <miguel@novell.com>
11815 * driver.cs: Report the case of no source files and no -out:
11818 2005-12-20 Raja R Harinath <rharinath@novell.com>
11821 * expression.cs (ComposedCast.GetSignatureForError): Define.
11823 2005-12-18 Carlos Alberto Cortez <calberto.cortez@gmail.com>
11827 * namespace.cs (NamespaceEntry): Add extern_aliases as a
11828 ListDictionary, to contain the ExternAliasEntry entries (in
11829 addition to the NamespaceEntry.aliases hashtable). This field is
11830 shared between the original entry and its doppelganger (bodyless
11832 (NamespaceEntry.UsingExternalAlias): Add the extern alias entry to
11833 extern_aliases field.
11834 (NamespaceEntry.Lookup): Move the IsImplicit check after the
11835 lookup in extern_aliases.
11837 2005-12-16 Raja R Harinath <rharinath@novell.com>
11840 * class.cs (TypeContainer.Mark_HasEquals): New.
11841 (TypeContainer.Mark_HasGetHashCode): New.
11842 (ClassPart): Override them.
11843 (MethodCore.CheckBase): Use them instead of referring to Parent.Methods.
11846 * enum.cs (EnumMember.EnumMember): Pass the parent_enum as the
11847 'parent' argument to the base constructor.
11849 Remove all mention of TypeContainer from decl.cs.
11850 * decl.cs (MemberCore.Parent): Change into a DeclSpace.
11851 (MemberCore.MemberCore): Change type of 'parent' argument to DeclSpace.
11852 (DeclSpace.DeclSpace): Likewise.
11853 (DeclSpace.DefineMembers): Remove unused argument.
11854 * cs-parser.jay (pop_current_class): Update to changes. Simplify
11855 debugging check -- we don't care if the debug code throws an
11856 InvalidCastException instead of an InternalErrorException.
11857 * class.cs (TypeContainer.DefineMembers): Update to changes.
11858 (TypeContainer.DoDefineMembers): Likewise.
11859 (TypeContainer.GetMethods): Likewise.
11860 (PropertyMember.Define): Likewise.
11861 (MemberBase.Parent): New property that forwards to
11862 MemberCore.Parent, but ensures that we get a TypeContainer.
11863 * rootcontext.cs (RootContext.PopulateCoreType): Update to changes.
11864 (RootContext.PopulateTypes): Likewise. Remove special case code
11865 for !RootContext.StdLib: DefineMembers is idempotent.
11867 2005-12-14 Miguel de Icaza <miguel@novell.com>
11869 * convert.cs (ExplicitConversionCore): Check the return value from
11870 ExplicitConversionCore which can return null on failure. Fixes #76914
11872 2005-12-13 Marek Safar <marek.safar@seznam.cz>
11874 * class.cs (Method.ApplyAttributeBuilder): Test out modifier properly.
11876 2005-12-11 Atsushi Enomoto <atsushi@ximian.com>
11878 * doc.cs : The search for referenced namespace was insufficient to
11879 get global one as it used to do. Fixed bug #76965.
11881 2005-12-10 Atsushi Enomoto <atsushi@ximian.com>
11883 * doc.cs : check name in cref in the last phase that whether it is
11886 2005-12-09 Atsushi Enomoto <atsushi@ximian.com>
11888 * cs-tokenizer.cs : reverted the latest change: it somehow broke
11891 2005-12-09 Atsushi Enomoto <atsushi@ximian.com>
11893 * doc.cs : so it turned out that we cannot skip override check for
11894 interface members. Fixed bug #76954.
11896 2005-12-09 Atsushi Enomoto <atsushi@ximian.com>
11898 * cs-tokenizer.cs : fixed bug #75984:
11899 - #warning and #error should not be handled when the source line
11901 - #line is not checked strictly when the source line is disabled.
11902 - #define and #undef is on the other hand checked strictly at any
11905 2005-12-08 Atsushi Enomoto <atsushi@ximian.com>
11907 * cs-tokenizer.cs : missing Location (actually, filename) in one of
11910 2005-12-05 Marek Safar <marek.safar@seznam.cz>
11912 * attribute.cs (GlobalAttribute.ctor): Pass NamespaceEntry only.
11914 * class.cs (EmitFieldInitializers): Simplified and fixed to work with
11915 event initializers.
11916 (FieldBase.EmitInitializer): Moved from TypeContainer and simplified.
11917 (FieldBase.Initializer): Initializer is now optional.
11918 (EventField.Define): Only event field can have initializer.
11920 * codegen.cs (EmitContext): DeclSpace is not readonly (small hack).
11922 * const.cs (Const): Reuse initializer.
11924 * cs-parser.jay: Updated after FieldBase changes.
11925 Added current_array_type to simplify array initializers.
11927 * ecore.cs (NullCast.IsDefaultValue): Implemented.
11929 * expression.cs, iterators.cs: Updated.
11931 * namespace.cs (NamespaceEntry): Made UsingFound private.
11933 2005-12-05 Marek Safar <marek.safar@seznam.cz>
11935 * parameterCollection.cs: Obsolete, removed.
11936 * parser.cs: Obsolete, removed.
11938 2005-12-05 Marek Safar <marek.safar@seznam.cz>
11941 * class.cs (Constructor.Emit): Set obsolete checking for whole context.
11943 * enum.cs (Enum.Define): Set obsolete context here.
11945 2005-12-05 Atsushi Enomoto <atsushi@ximian.com>
11948 - FindDocumentedMember() now expects 1) paramList as null
11949 when "we don't have to check the number of parameters" and
11950 2) Type.EmptyTypes when "there is no arguments".
11951 - Introduced FoundMember struct to hold the exact type which was
11952 used to find the documented member (the above change broke
11953 test-xml-044; it might be better just to use DeclaringType than
11954 what MS does, like this change does, but it depends on usage.)
11956 2005-12-05 Atsushi Enomoto <atsushi@ximian.com>
11958 * doc.cs : documented member might be from DeclaringType for nested
11959 types. Fixed bug #76782.
11961 2005-12-03 Ben Maurer <bmaurer@ximian.com>
11963 * anonymous.cs: Have the param code handle leaving copies on the
11964 stack etc. Allows anonymous params to take part in the assignment
11965 code (++, +=, etc). Fixes bug #76550
11967 * expression.cs: Handle the prepare_for_load/leave_copy by passing
11968 it down to the anon code.
11970 * iterators.cs: Use dummy var here
11972 * codegen.cs: Handle new vars
11974 2005-12-01 Marek Safar <marek.safar@seznam.cz>
11977 * class.cs (MethodData.Define): Set proper Obsolete context.
11979 * ecore.cs (FieldExpr.ResolveMemberAccess): Don't check [Obsolete] in
11981 (FieldExpr.DoResolve): Ditto.
11983 2005-12-01 Marek Safar <marek.safar@seznam.cz>
11986 * class.cs (MethodCore.DoDefineParameters): Test [Obsolete] only when
11987 parent is not obsolete.
11989 2005-12-01 Atsushi Enomoto <atsushi@ximian.com>
11991 * doc.cs : (FindDocumentedMember) find parameterless members first
11992 and get CS0419 in the early stage. Fixed first case of bug #76727.
11994 2005-11-30 Marek Safar <marek.safar@seznam.cz>
11997 * ecore.cs (Expression.ResolveAsConstant): Report constant error only when
11998 no error was reported.
12000 *expression.cs (Binary.DoResolve): left can be null.
12002 2005-11-22 Marek Safar <marek.safar@seznam.cz>
12005 * class.cs (MethodData.Emit): Parameters should be labeled first.
12007 2005-11-21 Marek Safar <marek.safar@seznam.cz>
12010 * parameter.cs (Parameter.ApplyAttributeBuilder): Fixed `ref' detection.
12012 2005-11-18 Marek Safar <marek.safar@seznam.cz>
12014 * attribute.cs (AreParametersCompliant): Moved to Parameter.
12016 * class.cs (MethodCore): Parameter clean up.
12017 (IMethodData): Added ParameterInfo.
12018 (MethodData): Parameter clean up.
12019 (Indexer.Define): Parameter clean up.
12031 * typemanager.cs: Parameter clean up.
12033 * delegate.cs (Define): Get rid of duplicated code.
12035 * expression.cs (ParameterReference): Removed useless parameters
12037 (Invocation): Ditto.
12039 * parameter.cs (ParamsParameter): New class, params specialization.
12040 (ArglistParameter): Attemp to separate arglist.
12041 (Parameter): Refactored to be reusable and faster.
12042 (Parameter.Modifier): Made understandable.
12043 (Parameters): Changed to be used as a class for `this' assembly
12044 parameters. Refactored to use new specialized classes.
12046 * support.cs (ParameterData): Added Types property.
12047 (InternalParameters): Deleted.
12049 2005-08-20 Martin Baulig <martin@ximian.com>
12051 Merging this patch from GMCS to fix #75867.
12053 * anonymous.cs (CaptureContext.CaptureThis): Create the topmost
12054 scope if we don't already have it.
12056 2005-11-17 Martin Baulig <martin@ximian.com>
12059 (CaptureContext.EmitMethodHostInstance): Use `Ldarg_0' if we
12060 inherit the scope from our parent. Fixes #76653.
12062 2005-11-16 Atsushi Enomoto <atsushi@ximian.com>
12064 * doc.cs : the previous patch does not actually fix the bug.
12065 PropertyInfo override check is now implemented and really fixed it.
12066 * expression.cs : Invocation.IsAncestralType() is used from doc.cs.
12068 2005-11-16 Atsushi Enomoto <atsushi@ximian.com>
12070 * doc.cs : apply "override filter" also to properties.
12073 2005-11-16 Atsushi Enomoto <atsushi@ximian.com>
12075 * doc.cs : renamed FindMembers() to FindMethodBase(). For interfaces,
12076 no need to check overrides. For classes, omit those results from
12077 interfaces since they must exist in the class. Fixed bug #76726.
12079 2005-11-15 Atsushi Enomoto <atsushi@ximian.com>
12081 * typemanager.cs : (GetFullNameSignature) differentiate indexers
12082 with different parameters. Fixed the second problem in #76685.
12084 2005-11-15 Atsushi Enomoto <atsushi@ximian.com>
12086 * doc.cs : (FindDocumentedMember) pass invocation_type as well (to
12087 get expected 'protected' access in CheckValidFamilyAccess()).
12090 2005-11-15 Atsushi Enomoto <atsushi@ximian.com>
12092 * doc.cs : (GenerateTypeDocComment) Fields could be FixedField.
12093 Fixed bug #76705. CS1569 was incorrectly commented out.
12095 2005-11-14 Atsushi Enomoto <atsushi@ximian.com>
12097 * doc.cs : use Invocation.IsOverride() to do real override check.
12098 * expression.cs : made Invocation.IsOverride() internal.
12100 2005-11-14 Atsushi Enomoto <atsushi@ximian.com>
12102 * doc.cs : use TypeManager.FindMembers() instead of (possible)
12103 TypeBuilder.FindMembers() and filter overriden base members out.
12106 2005-11-13 Atsushi Enomoto <atsushi@ximian.com>
12108 * doc.cs : ref/out parameters are represented as '@' (instead of
12109 '&' in type FullName). Fixed bug #76630 (additionally crefs).
12111 2005-11-13 Atsushi Enomoto <atsushi@ximian.com>
12113 * doc.cs : when there was no '.' in cref to methods in doc comment,
12114 then parameters were missing in the output. Fixed bug #76691.
12116 2005-11-13 Atsushi Enomoto <atsushi@ximian.com>
12118 * driver.cs : don't output docs when there is an error.
12121 2005-11-13 Atsushi Enomoto <atsushi@ximian.com>
12124 Now it should detect indexers. Fixed primary concern in bug #76685.
12125 Fixed CS0419 message to not show the identical member signature in
12128 2005-11-13 Atsushi Enomoto <atsushi@ximian.com>
12130 * doc.cs : (FindDocumentedMember) use TypeManager.MemberLookup()
12131 instead of Type.FindMembers() since it does not handle events.
12134 2005-11-12 Gert Driesen <drieseng@users.sourceforge.net>
12136 * codegen.cs: Fixed typo (speficied -> specified).
12138 2005-11-11 Marek Safar <marek.safar@seznam.cz>
12141 * doc.cs (FindDocumentedTypeNonArray): Don't resolve again.
12143 2005-11-11 Marek Safar <marek.safar@seznam.cz>
12145 * attribute.cs: Changed error message.
12147 * cs-tokenizer.cs: One more check.
12149 2005-11-10 Marek Safar <marek.safar@seznam.cz>
12151 * statement.cs (Block.Resolve): Ignore empty statement.
12153 2005-11-10 Marek Safar <marek.safar@seznam.cz>
12155 * report.cs: Made error/warning methods more strict to avoid
12158 * anonymous.cs, attribute.cs, class.cs, codegen.cs, constant.cs,
12159 convert.cs, cs-parser.jay, cs-tokenizer.cs, decl.cs, delegate.cs,
12160 doc.cs, driver.cs, ecore.cs, expression.cs, location.cs,
12161 namespace.cs, parameter.cs, statement.cs, typemanager.cs: Updated.
12163 2005-11-08 Marek Safar <marek.safar@seznam.cz>
12165 * attribute.cs (Attribute.GetCoClassAttributeValue): New method.
12166 (AttributeTester.GetCoClassAttribute): Get CoClassAttribute.
12168 * class.cs (TypeContainer.IsComImport): New property.
12169 (Constructor.Define): Create proper ctor for ComImport types.
12171 * expression.cs (New.CheckComImport): Fixed.
12173 2005-11-07 Miguel de Icaza <miguel@novell.com>
12175 * anonymous.cs (CaptureContext.AddParameterToContext): The fact
12176 that a parameter has been captured does not mean that we do not
12177 have to do the rest of the processing. This fixes the second part
12178 of #76592. If there was another anonymous method capturing
12179 values in the past, the Scope would never be set for the second
12180 method that captured the same parameter.
12182 (CaptureContext.EmitAssignParameter): When `leave_copy' is passed,
12183 properly manipulate the stack. Second part of fix for #76592.
12185 * expression.cs (New): Add support for invoking "new" on
12186 interfaces that have been flagged with the ComImport attribute and
12187 the CoClass. Fixes #76637
12189 * statement.cs (Try.DoEmit): When a variable is captured, do not
12190 try to emit the vi.LocalBuilder variable as it has been captured.
12191 Create a temporary variable and store the results on the
12192 FieldBuilder. Fixes #76642
12194 2005-11-07 Marek Safar <marek.safar@seznam.cz>
12196 * class.cs (CheckPairedOperators): Made compilable with csc 2.0.
12198 * ecore.cs (InstanceResolve): Fixed CS1540 detection.
12200 * expression.cs (Binary.DoResolve): Added && optimalization.
12202 * typemanager.cs (AddUserType): Removed useless argument.
12204 2005-11-04 Marek Safar <marek.safar@seznam.cz>
12206 * statement.cs (Block.variables): Uses ListDictionary.
12208 2005-11-03 Marek Safar <marek.safar@seznam.cz>
12211 * class.cs (PartialContainer.EmitType): Customized to emit
12212 security attributes.
12213 (ClassPart.ApplyAttributeBuilder): Transform security attribute
12214 for partial classes.
12216 2005-11-03 Marek Safar <marek.safar@seznam.cz>
12219 * expression.cs (ElementAccess.DoResolveLValue): Fixed buffer
12220 access has to be fixed.
12222 * typemanager.cs (IsUnmanagedType): Wrong common field type.
12224 2005-11-01 Marek Safar <marek.safar@seznam.cz>
12227 * ecore.cs (NullCast.Reduce): Implemented.
12229 * expression.cs (ArrayCreation.CheckIndices): Correcly check
12232 * statement.cs (SwitchLabel.ResolveAndReduce): Catch null
12234 (Foreach.Resolve): Catch null properly.
12236 2005-10-29 Marek Safar <marek.safar@seznam.cz>
12238 * cs-tokenizer.cs: Warning text fix.
12240 * driver.cs: AllWarningNumbers exposed on public interface.
12242 * report.cs (): Reviewed warning numbers.
12243 (IsValidWarning): Use binary search.
12245 2005-10-29 Marek Safar <marek.safar@seznam.cz>
12247 * driver.cs: Implemeted resource visibility.
12248 (Resources): New class for code sharing between /res: and
12251 2005-10-28 Marek Safar <marek.safar@seznam.cz>
12254 * cfold.cs (ConstantFold.BinaryFold): Implemented null cast
12257 * convert (Convert.ImplicitReferenceConversion): NullCast holds
12260 * ecore.cs (NullCast): Child is contant only.
12262 * literal.cs (NullLiteral.Reduce): null can be converted to any
12265 2005-10-28 Kornél Pál <kornelpal@hotmail.com>
12267 * driver.cs: Use Encoding.Default as default code page instead
12270 2005-10-27 Raja R Harinath <rharinath@novell.com>
12273 * expression.cs (Invocation.Error_InvalidArguments): Handle
12274 __arglist parameters.
12275 (Invocation.VerifyArgumentsCompat): Likewise.
12276 * support.cs (ReflectionParameters.GetSignatureForError): Print
12277 __arglist parameters.
12278 (InternalParamters.GetSignatureForError): Likewise.
12279 * parameter.cs (Parameters.GetSignatureForError): Likewise.
12281 2005-10-26 Marek Safar <marek.safar@seznam.cz>
12283 * attribute.cs (GetPropertyValue): Made public.
12285 * codegen.cs (AssemblyClass): ResolveClsCompliance renamed to
12287 Add new property WrapNonExceptionThrows to handle 2.0 assembly
12289 (AssemblyClass.Emit): Emit RuntimeCompatibilityAttribute when it
12292 * driver.cs: Reflect method name change.
12294 * statement.cs (Try.Resolve): Warn when try has both general
12295 exception handlers.
12297 * typemanager.cs: runtime_compatibility_attr_type new predefined
12300 2005-10-26 Raja R Harinath <harinath@gmail.com>
12303 * pending.cs (InterfaceMethod): Allow tm.args [i] to be null --
12304 treat it as an empty parameter list.
12306 2005-10-26 Raja R Harinath <rharinath@novell.com>
12309 * ecore.cs (SimpleName.DoSimpleNameResolve): Make fall-back
12310 ResolveAsTypeStep silent.
12311 * statement.cs (Block.AddConstant): Mark block as used.
12312 (Block.ResolveMeta): Avoid piling on error messages
12313 if a constant initializer resolution fails.
12315 2005-10-25 Raja R Harinath <rharinath@novell.com>
12317 * namespace.cs (RootNamespace.VerifyUsingForAll, Namespace.VerifyUsing):
12319 (NamespaceEntry.VerifyAllUsing): New.
12320 (NamespaceEntry.AliasEntry.Resolve): New. Handles common error
12321 behaviour. Delegates actual resolution of alias to ...
12322 (NamespaceEntry.DoResolve): ... this. Renamed from Resolve.
12323 (NamespaceEntry.LocalAliasEntry, NamespaceEntry.ExternAliasEntry):
12325 * driver.cs (Driver.MainDriver): Update.
12327 * namespace.cs (NamespaceEntry.DefineNamespace): Remove.
12328 (NamespaceEntry.SymbolFileID): Make into a on-demand computed
12330 (Namespace.DefineNamespaces, RootNamespace.DefineNamespacesForAll):
12332 * symbolwriter.cs (SymbolWriter.Initialize): Don't call
12333 RootNamespace.DefineNamespacesForAll.
12335 2005-10-24 Raja R Harinath <harinath@gmail.com>
12337 * typemanager.cs (assemblies, external_aliases, modules)
12338 (AddAssembly, AddExternAlias, AddModule GetAssemblies, Modules)
12339 (ComputeNamespaces, GetRootNamespace): Remove extra staging
12340 overhead. Move resposibility ...
12341 * namespace.cs (GlobalRootNamespace): ... here. Update to changes.
12342 * driver.cs, attribute.cs, codegen.cs: Update to changes.
12344 2005-10-23 Raja R Harinath <harinath@gmail.com>
12346 * namespace.cs (RootNamespace.all_namespaces): Renamed from
12347 cached_namespaces. Improve usage.
12348 (RootNamespace.Reset, RootNamespace.RegisterNamespace)
12349 (RootNamespace.VerifyUsingForAll, RootNamespace.DefineNamespacesForAll):
12350 Move from GlobalRootNamespace and simplify.
12351 (RootNamespace.Global): Make instance variable.
12352 (RootNamespace.RootNamespace): Add "alias name" parameter.
12353 (GlobalRootNamespace): Simplify drastically.
12354 (Namespace.Lookup): Don't use GetNamespace.
12355 * typemanager.cs (GetRootNamespace): Rename from
12356 ComputeNamespaceForAlias.
12357 (NamespaceClash): Use Global.IsNamespace instead of GetNamespace.
12359 2005-10-23 Marek Safar <marek.safar@seznam.cz>
12361 * anonymous.cs (AnonymousContainer): Don't crash when container
12364 2005-10-23 Marek Safar <marek.safar@seznam.cz>
12366 * expression.cs (Binary.DoResolve): Warn when comparing same
12369 2005-10-23 Marek Safar <marek.safar@seznam.cz>
12372 * expression.cs (Binary.DoResolve): It looks like there are no
12373 convetsion rules in enum context.
12375 2005-10-19 Carlos Alberto Cortez <calberto.cortez@gmail.com>
12377 Add support for extern alias qualifiers.
12378 * typemanager.cs: Move some LookupTypeReflection code
12379 to namespace.cs, to have cleaner code. Added some methods
12380 to help us keep track of the extern aliased references.
12381 * driver.cs: Add suport for extern alias assemblies on command
12382 line and check for their warnings/errors. Also keep track of the
12383 extern aliased assemblies.
12384 * namespace.cs: Move the global functionality of Namespace
12385 to GlobalRootNamespace/RootNamespace. Now the global namespace
12386 is GlobalRootNamespace.Globa. Also the code moved from
12387 typemanager.cs lives in GlobalRootNames.cs/RootNamespace.cs.
12388 Finally added LocalAliasEntry (AliasEntry before) and
12389 ExternAliasEntry, to handle alias statements.
12390 * cs-parser.jay: Add support in the grammar for extern alias
12392 * doc.cs, delegate.cs, expression.cs ecore.cs, symbolwriter.cs:
12393 Update callings to Namespace (now in GlobalRootNamespace).
12395 2005-10-18 Raja R Harinath <rharinath@novell.com>
12398 * class.cs (TypeContainer.DefineType): Move updating of
12399 topological sort earlier in the code.
12400 * decl.cs (DeclSpace.ResolveBaseTypeExpr): Don't use TypeBuilder.
12402 2005-10-18 Marek Safar <marek.safar@seznam.cz>
12405 * cfold.cs (BinaryFold): Reduce constant in enum conversion.
12407 * constant.cs (Constant.TryReduce): Moved from Cast class.
12408 (Reduce): Made little bit more OO and fixed missing conversions.
12410 * ecore.cs (Reduce): Implemented.
12411 (Binary.EnumLiftUp): New method to upgrade values to enum values.
12413 * literal.cs (Reduce): Implemented.
12415 * class.cs: Reverted Miguel's wrong commit.
12417 2005-10-14 Miguel de Icaza <miguel@novell.com>
12419 * ecore.cs (GetMemberType): Report the correct mapping for the MemberCore
12421 2005-10-14 Atsushi Enomoto <atsushi@ximian.com>
12423 * cs-parser.jay, expression.cs : CS0214 was missing error location
12424 for constants. Fixed bug #76404.
12426 2005-10-11 Marek Safar <marek.safar@seznam.cz>
12429 * convert.cs (ExplicitConversionCore): Fixed object->enum
12432 2005-10-10 Raja R Harinath <rharinath@novell.com>
12434 * ecore.cs (PropertyExpr.Emit): Use Invocation.EmitCall to emit
12435 InstanceExpression.
12436 (PropertyExpr.EmitCall): Likewise.
12437 * expression.cs (Invocation.EmitArguments): Handle case where
12439 (Invocation.EmitCall): Avoid allocating temporary variable if
12440 there are no arguments.
12442 2005-10-07 Raja R Harinath <rharinath@novell.com>
12445 * convert.cs (ImplicitConversionStandard): Move conversion of
12446 void* to arbitrary pointer types ...
12447 (ExplicitConversionStandard): .. here.
12448 * ecore.cs (Expression.Error_ValueCannotBeConverted): Fix CS0266
12449 error to always print typenames.
12451 2005-10-07 Raja R Harinath <rharinath@novell.com>
12453 * convert.cs (GetConversionOperator): Rename from
12454 GetConversionOperators. Move operator selection code from ...
12455 (UserDefinedConversion): ... here.
12457 2005-10-06 Marek Safar <marek.safar@seznam.cz>
12459 * convert.cs (ExplicitConversionCore): Removed duplicate enum
12462 2005-10-05 Marek Safar <marek.safar@seznam.cz>
12464 * assign.cs (Assign.DoResolve): Error method changed.
12466 * cfold.cs (DoConstantNumericPromotions): Error method changed.
12468 * const.cs (ResolveValue): Reset in_transit immediately.
12470 * constant.cs: Error method changed.
12472 * convert.cs: Removed useless location parameter.
12473 (ExplicitNumericConversion): Don't do double enum check.
12474 (ExplicitConversionCore): Renamed from ExplicitConversion.
12475 (ExplicitUnsafe): Extracted from ExplicitConversion.
12476 (ExplicitConversion): Uses for error reporting.
12478 * ecore.cs (Error_ValueCannotBeConverted): More logic for more
12480 (ResolveBoolean): Uses common error method.
12481 (CastToDecimal): Get rid of ec.
12482 (CastFromDecimal): Optimized.
12483 (ConvCast): Get rid of ec.
12485 * enum.cs (ResolveValue): Reset in_transit immediately.
12486 (Emit): Return after first error.
12488 * expression.cs: Convert changes.
12490 * literal.cs: Error method changed.
12492 * statement.cs: Error method changed.
12494 2005-10-03 Raja R Harinath <rharinath@novell.com>
12496 * support.cs (SeekableStreamReader.Position): Don't error out when
12497 the requested position is just beyond the end of the current
12500 2005-09-28 Raja R Harinath <rharinath@novell.com>
12502 * support.cs (SeekableStreamReader): Simplify drastically. Don't
12503 try to keep in sync with the byte count of the underlying Stream.
12504 However, this limits us to a window size of 2048 characters: i.e.,
12505 the maximum lookahead of our lexer/parser can be 2048 characters.
12507 2005-09-28 Marek Safar <marek.safar@seznam.cz>
12510 * driver.cs: Fix compilation files with full root path.
12512 2005-09-25 Miguel de Icaza <miguel@novell.com>
12514 * report.cs (SymbolRelatedToPreviousError): Format the output so
12515 it does not use an open parenthesis that is never closed.
12517 * driver.cs: Follow coding guidelines
12519 2005-09-27 Marek Safar <marek.safar@seznam.cz>
12522 * const.cs (Const.ResolveValue): Check for assigning non-null
12523 value to reference type.
12525 2005-09-27 Marek Safar <marek.safar@seznam.cz>
12527 * anonymous.cs: Implemented ExprClassName.
12529 * assign.cs (Assign.DoResolve): Don't chrash when type is not
12532 * attribute.cs (ResolveArguments): Enabled MethodImplOptions
12535 * class.cs (StaticClass.DefineContainerMembers): Report protected
12538 * codegen.cs: if(ed) PRODUCTION.
12540 * convert.cs (Error_CannotImplicitConversion): Better error
12543 * cs-parser.jay: More error checks.
12545 * cs-tokenizer.cs (consume_identifier): Fixed Miguel's revert.
12547 * driver.cs (CSCParseOption): Enabled wrong option check.
12549 * ecore.cs (Expression.ExprClassName): Turned to property.
12550 (MemberExpr.CheckIntermediateModification): For checking boxed
12551 value types modification.
12553 * statement.cs (Fixed.Resolve): Expression type must be
12554 convertible to fixed type.
12555 (CollectionForeach.GetEnumeratorFilter,TryType):
12556 Small refactoring for easier error checking.
12558 2005-09-26 Marek Safar <marek.safar@seznam.cz>
12560 * attribute.cs (Attribute.Resolve): Check Obsolete attribute for
12563 * class.cs (GeneratedBaseInitializer): New class for customization
12564 compiler generated initializers.
12565 (MemberBase.DoDefine): Check Obsolete attribute here.
12566 (FieldMember.DoDefine): Ditto.
12568 * const.cs (ExternalConstant.CreateDecimal): Builder for decimal
12571 * decl.cs (MemberCore.EmitContext): Returns valid current ec.
12572 (MemberCore.GetObsoleteAttribute): Removed argument.
12573 (MemberCore.CheckObsoleteness): Obsolete attributes are hierarchic.
12574 (MemberCore.CheckObsoleteType): New helper.
12578 * statement.cs: Updates after MemberCore changes.
12580 * ecore.cs (TypeExpr.ResolveType): Check type obsoleteness here.
12581 (FieldExpr.ResolveMemberAccess): Fixed decimal constants checks.
12583 * expression.cs (ComposedCast.DoResolveAsTypeStep): Don't check
12584 obsolete attribute for compiler construct.
12585 (As.DoResolve): Cache result.
12587 * iterators.cs (Define_Constructor): Use GeneratedBaseInitializer.
12589 2005-09-26 Raja R Harinath <rharinath@novell.com>
12592 * expression.cs (This.VerifyFixed): In a value type T, the type of
12593 'this' is T&, iow, 'this' is either an out or ref parameter. In a
12594 value type R, 'this' is treated as a value parameter.
12596 2005-09-22 Miguel de Icaza <miguel@novell.com>
12598 * statement.cs (Lock): Use the TemporaryVariable class instead of
12599 manually using local variables as those do not work when variables
12602 * ecore.cs: Moved the TemporaryVariable class from being a nested
12603 class inside Foreach to be a public class that can be employed in
12606 2005-09-19 Marek Safar <marek.safar@seznam.cz>
12608 * cs-parser.jay: interface_accessors replaced by
12609 accessor_declarations.
12611 * ecore.cs, literal.cs, statement.cs: NullLiteral holds null
12614 * statement.cs (GotoCase.Resolve): Convert null constant to
12616 (SwitchLabel.ResolveAndReduce): Ditto.
12617 (SwitchLabel.NullStringCase): Custom null stamp.
12618 (Switch.SimpleSwitchEmit): Fix from NullLiteral to NullStringCase.
12620 typemanager.cs (CSharpSignature): Don't skip first argument
12623 2005-09-18 Miguel de Icaza <miguel@novell.com>
12625 * driver.cs: Set InEmacs based on the environment variable EMACS.
12627 * location.cs (InEmacs): in this mode, do not report column
12628 location as it confuses Emacs.
12630 2005-09-16 Marek Safar <marek.safar@seznam.cz>
12632 * cfold.cs, constant.cs, convert.cs, ecore.cs,
12633 expression.cs, iterators.cs, literal.cs: Store constants and
12636 * class.cs (MemberBase.ShortName): Pass location.
12638 * cs-parser.jay: Some location fixes.
12640 * ecore.cs (Expression.Location): Made virtual.
12642 2005-09-05 Miguel de Icaza <miguel@novell.com>
12644 * expression.cs (Cast.TryReduce): Only reduce to an EnumConstant
12645 if the underlying types are the same, otherwise we need to produce
12646 code that will do the proper cast.
12648 This was exposed by Marek's constant rewrite which produced
12649 invalid code for the call site:
12651 enum X : long { a }
12652 void Method (X v) {}
12656 This fixes test-49.cs
12658 2005-09-05 Atsushi Enomoto <atsushi@ximian.com>
12660 * attribute.cs : (Attribute.IsValidArgumentType): array of string/
12661 Type/Object should be allowed as well. Fixed bug #75968.
12663 2005-09-05 Atsushi Enomoto <atsushi@ximian.com>
12665 * expression.cs : (Binary.DoResolve): when one is enum constant and
12666 another is constant 0, then return enum one *as enum type*.
12669 2005-09-02 Raja R Harinath <rharinath@novell.com>
12671 * attribute.cs (GetMarshal): Work even if "DefineCustom" is
12675 * ecore.cs (SimpleNameResolve.DoSimpleNameResolve): Disable
12676 flow-branching for LocalVariableReferences in case we were invoked
12677 from a MemberAccess.
12678 * expression.cs (LocalVariableReference.VerifyAssigned): New.
12680 (LocalVariableReference.DoResolveBase): ... this.
12681 (MemberAccess.Resolve): Do the check that was disabled during
12684 2005-09-01 Atsushi Enomoto <atsushi@ximian.com>
12687 (PartialContainer.Create): check abstract/sealed/static strictly
12688 but abstract/sealed can exist only at one side. Fixed bug #75883.
12690 2005-09-01 Kornél Pál <kornelpal@hotmail.com>
12693 * attribute.cs (Attribute.GetMarshal): If ArraySubType is not
12694 specified, don't default to UnmanagedType.I4.
12696 2005-09-01 Atsushi Enomoto <atsushi@ximian.com>
12698 * expression.cs : conditional operator should check possibly
12699 incorrect assign expression. Fixed bug #75946.
12701 2005-08-31 Atsushi Enomoto <atsushi@ximian.com>
12703 * cs-tokenizer.cs, cs-parser.jay, driver.cs, support.cs :
12704 Reverting the change. gmcs is much complex than mcs on this matter.
12706 2005-08-31 Atsushi Enomoto <atsushi@ximian.com>
12708 * cs-tokenizer.cs : To read another token ahead of the actual
12709 consumption, use new SavedToken and cache token instead of moving
12710 back the stream with SeekableStreamReader (it seemed problematic).
12712 driver.cs : Thus use StreamReader directly.
12713 * support.cs : Thus removed SeekableStreamReader.
12715 2005-08-30 Raja R Harinath <rharinath@novell.com>
12718 * anonymous.cs (ScopeInfo.MakeFieldName): New helper.
12719 (ScopeInfo.EmitScopeType): Use it to construct field names from
12720 names of captured locals.
12723 * ecore.cs (BoxedCast.BoxedCast) [1-argument variant]: Remove.
12724 * convert.cs (ImplicitReferenceConversion, TryImplicitIntConversion):
12725 Pass 'target_type' to BoxedCast. Don't default to 'object'.
12726 (ExplicitConversion): Remove enum cases already handled by
12727 implicit conversion. Move implicit conversion check to the beginning.
12728 * delegate.cs (DelegateCreation.ResolveMethodGroupExpr): Update.
12729 * expression.cs (ArrayCreation.EmitDynamicInitializers):
12730 Don't treat System.Enum as a struct.
12732 2005-08-30 Jb Evain <jbevain@gmail.com>
12734 * attribute.cs: handles as expression in parameters.
12736 2005-08-30 Raja R Harinath <rharinath@novell.com>
12739 * class.cs (TypeContainer.VerifyClsName): Don't use a
12740 PartialContainer when verifying CLS compliance.
12741 (AbstractPropertyEventMethod): Set Parent here, ...
12742 (PropertyMethod): ... not here.
12744 2005-08-30 Atsushi Enomoto <atsushi@ximian.com>
12746 * attribute.cs : escaped attribute name should not be allowed to be
12747 resolved (e.g. @class as classAttribute). Fixed bug #75930.
12749 2005-08-29 Raja R Harinath <rharinath@novell.com>
12752 * convert.cs (ImplicitStandardConversionExists): Allow zero also
12753 when converting a long constant to unsigned long.
12754 * expression.cs (Invocation.OverloadResolve): Add sanity check to
12755 detect where IsApplicable and VerifyArgumentsCompat disagree.
12757 2005-08-29 Raja R Harinath <rharinath@novell.com>
12758 and Carlos Alberto Cortez <carlos@unixmexico.org>
12761 * class.cs (TypeContainer.CanElideInitializer): New helper.
12762 (TypeContainer.EmitFieldInitializers): Use it to determine if we
12763 can safely emitting the initializer of a field.
12765 2005-08-25 Atsushi Enomoto <atsushi@ximian.com>
12767 * statement.cs : (Continue.Resolve()) Unlike break, continue is not
12768 allowed inside a switch (without loop). Fixed bug #75433.
12770 2005-08-26 Kornél Pál <kornelpal@hotmail.com>
12772 * AssemblyInfo.cs: Using Consts.MonoVersion instead of MonoVersion.cs.
12773 * mcs.exe.sources: Using Consts.MonoVersion instead of MonoVersion.cs.
12775 2005-08-25 Atsushi Enomoto <atsushi@ximian.com>
12777 * driver.cs : kinda reverting the default encoding changes (not exact
12778 revert since I noticed that "codepage:reset" might not work fine).
12780 2005-08-25 Atsushi Enomoto <atsushi@ximian.com>
12782 * class.cs : (AbstractPropertyEventMethod) SetupName() now takes
12783 Location. Now getter and setter store location correctly.
12784 (errors/cs0111-12.cs now reports the expected location.)
12786 2005-08-25 Atsushi Enomoto <atsushi@ximian.com>
12788 * driver.cs : Use default encoding on the environment.
12789 Removed (now that) extra parameter for SeekableStreamReader.
12790 * support.cs : (SeekableStreamReader) third .ctor() argument for
12791 StreamReader is not required (always true). preamble size could
12792 be acquired in simpler and safe way.
12794 2005-08-24 Atsushi Enomoto <atsushi@ximian.com>
12796 * cs-parser.jay: report CS0642 at warning level 3
12797 and report CS0642 for an if else statement also
12798 fixes bug #74745. Patch by John Luke (and a bit
12800 Removed extra CS0642 warning check for "while",
12802 * statement.cs: In Block.Resolve(), CS0642 check
12803 is reimplemented to check a sequence of an empty
12804 statement and a block.
12806 Both fix bug #66777.
12808 2005-08-24 Marek Safar <marek.safar@seznam.cz>
12810 * attribute.cs (GetMethodObsoleteAttribute): Disabled obsolete properties
12811 detection until I fix it.
12813 * cs-tokenizer.cs: Changed error message.
12815 * cs-parser.jay: Fixed 2 error locations.
12817 * ecore.cs (Error_TypeDoesNotContainDefinition): Share error message.
12818 (PropertyExpr.Error_PropertyNotFound): First attempt to detect non C#
12821 * enum.cs (GetSignatureForError): Fixed.
12823 * expression.cs (Invocation.IsSpecialMethodInvocation): Improved special
12827 * typemanager.cs (RegisterProperty): Removed.
12829 * statement.cs (CheckInvariantMeaningInBlock): Changed error message.
12831 2005-08-24 Raja R Harinath <rharinath@novell.com>
12834 * expression.cs (ArrayAccess.EmitLoadOpcode): Emit ldelem.i for pointers.
12835 (ArrayAccess.GetStoreOpcode): Return stelem.i for pointers.
12837 2005-08-23 Atsushi Enomoto <atsushi@ximian.com>
12839 * expression.cs : tiny fix is required for not warning positive ulong.
12842 2005-08-23 Atsushi Enomoto <atsushi@ximian.com>
12844 * expression.cs : add CS0652 check for constant and integral
12845 expression. Fixed bug #53974.
12847 2005-08-23 Atsushi Enomoto <atsushi@ximian.com>
12849 * expression.cs : in DoNumericPromotions(), check if there is implicit
12850 conversion overload for string (to check CS0034). Fixed bug #52492.
12852 2005-08-23 Atsushi Enomoto <atsushi@ximian.com>
12854 * cs-tokenizer.cs : Check newline in char constant. Fixed bug #75245.
12856 2005-08-23 Atsushi Enomoto <atsushi@ximian.com>
12858 * ecore.cs : report location when it is *not* Null.
12860 2005-08-23 Atsushi Enomoto <atsushi@ximian.com>
12866 Added OmitStructFlowAnalysis to EmitContext to handle CS0165 check
12867 correctly. Fixed bug #75721.
12869 2005-08-23 Raja R Harinath <rharinath@novell.com>
12871 * support.cs (SeekableStreamReader.Position): Avoid an expensive
12872 loop that performs 'min (pos, char_count)'.
12875 * expression.cs (Unary.ResolveOperator): Don't discard implicit
12876 converted value in Operator.OnesComplement.
12878 2005-08-22 Ben Maurer <bmaurer@ximian.com>
12880 * anonymous.cs: If the anon method is pulled into a helper class,
12881 it needs to be `internal' not `private'. Fixes runtime behavior on
12884 2005-08-20 Martin Baulig <martin@ximian.com>
12886 * anonymous.cs (CaptureContext.CaptureThis): Create the topmost
12887 scope if we don't already have it.
12889 * expression.cs (Invocation.EmitCall): Use `ec.EmitThis ()' rather
12890 than `ig.Emit (OpCodes.Ldarg_0)' to make it work inside iterators;
12893 2005-08-17 Marek Safar <marek.safar@seznam.cz>
12896 * decl.cs (DeclSpace.VerifyClsCompliance): Skip when collision object
12897 is a partial class.
12899 2005-08-16 Marek Safar <marek.safar@seznam.cz>
12901 The big constants rewrite
12902 Fix #75746, #75685 and more
12903 As a side effect saved 1MB for MWF ;-)
12905 * attribute.cs (GetAttributeArgumentExpression): Use ToType, GetTypedValue.
12906 (GetMarshal, GetMethodImplOptions, GetLayoutKindValue): Values are not
12907 enum based for corlib compilation.
12909 * cfold.cs (BinaryFold): Convert operand for enum additions. Fixed enum
12912 * class.cs (FixedField.Define): Use ResolveAsConstant.
12914 * const.cs (IConstant): Interface constants and enums.
12915 (Const.ResolveValue): New method for constant resolvning.
12916 (ExternalConstant): Constants from imported assemblies.
12918 * constant.cs (Constant.GetTypedValue): Used to get constant with forced
12919 conversion; like enums.
12920 (Constant.ToType): Converts this constant to different type.
12921 (Constant.Increment): Adds 1.
12923 * convert.cs (ImplicitConversionRequired): Simplified.
12925 * cs-parser.jay: Create EnumMember directly.
12927 * decl.cs (MemberCore.CheckObsoleteness): Checks for ObsoleteAttribute presence.
12929 * doc.cs (GenerateEnumDocComment): Removed.
12931 * ecore.cs (Expression.ResolveAsConstant): New constant specific method.
12932 (ConvertIntLiteral): Removed.
12933 (FieldExpr.ResolveMemberAccess): Refactored to remove constant specific if(s).
12935 * enum.cs (EnumMember): Implement IConstant.
12936 (Enum.IsValidEnumConstant): Removed.
12937 (Enum.GetNextDefaultValue): Removed.
12938 (Enum.FindMembers): Updated.
12939 (Enum.GenerateDocComment): Iterate enum members.
12941 * expression.cs (Cast.TryReduce): Handle enums correctly.
12942 (New.Constantify): Made public.
12943 (MemberAccess.DoResolve): Removed contant specific if(s).
12945 * literal.cs (NullLiteral): Implement new abstract methods.
12947 * statement.cs (GotoCase.Resolve): Use new constant methods.
12948 (SwitchLabel.ResolveAndReduce): Use new constant methods.
12950 * typemanager.cs (LookupEnum): Removed.
12951 (IsEnumType): Fixed to work with corlib.
12952 (RegisterConstant): Removed.
12953 (LookupConstant): Removed.
12954 (GetConstant): Changed to work with IConstant.
12956 2005-08-04 Atsushi Enomoto <atsushi@ximian.com>
12958 * location.cs : Fixed overflown (>255) column number.
12960 2005-08-03 Raja R Harinath <rharinath@novell.com>
12962 First cut of the qualified-alias-member feature.
12963 * cs-tokenizer.cs (Tokenizer.is_punct): Recognize the double-colon
12965 * cs-parser.jay (DOUBLE_COLON): New token.
12966 (namespace_or_type_name): Add rule for recognizing
12967 qualified-alias-members.
12968 (primary_expression): Likewise.
12969 (element_access): Allow QualifiedAliasMember as a possible
12970 type-bearing expression.
12971 (local_variable_type, local_variable_pointer_type): Likewise.
12972 * namespace.cs (NamespaceEntry.LookupAlias): New. Looks up
12973 aliases in the current and enclosing namespace declarations.
12974 (NamespaceEntry.UsingAlias): Add CS0440 warning.
12975 * decl.cs (MemberName.is_double_colon): New.
12976 (MemberName.MemberName): Add new constructor for alias-member.
12977 (MemberName.GetTypeExpression): Generate QualifiedAliasMember too.
12978 * expression.cs (QualifiedAliasMember): New expression type.
12980 2005-08-02 Atsushi Enomoto <atsushi@ximian.com>
12982 * location.cs : it borked when no argument was specified.
12984 2005-08-02 Atsushi Enomoto <atsushi@ximian.com>
12986 * location.cs : tiny ToString() format fix.
12988 2005-08-02 Atsushi Enomoto <atsushi@ximian.com>
12990 * statement.cs : oops, it was missing.
12992 2005-08-02 Atsushi Enomoto <atsushi@ximian.com>
12994 A set of fixes for precise line/column location.
12997 "token" field now holds a file/line "delta", a line number offset
12998 from the segment, and a column number. See also:
12999 http://lists.ximian.com/pipermail/mono-devel-list/2004-
13000 December/009508.html
13001 Removed static IsNull. Use instance IsNull property instead.
13002 * cs-tokenizer.cs :
13003 For some tokens it stores Location. For Identifier it stores
13004 LocatedToken which is a pair of string name and location.
13005 Column numbers are adjusted only at getChar().
13007 Use Location.ToString() for reporting (it now contains column).
13009 Largely modified to use LocatedToken instead of
13010 string (IDENTIFIER), and to acquire Location from some tokens.
13011 * namespace.cs, decl.cs, ecore.cs, class.cs, delegate.cs,
13012 iterators.cs, const.cs, anonymous.cs, tree.cs, enum.cs,
13014 Now MemberName holds Location. DeclSpace.ctor() receives Location
13015 as a parameter. Removed extra parameters to all derived classes.
13016 Replaced Location.IsNull() with instance property.
13017 * assign.cs, expression.cs :
13018 Added .ctor() overload that omits Location.
13020 Added "nameEscaped" flag that indicates the identifier was escaped
13021 in the source file. This fixes bug #57047.
13023 2005-08-02 Marek Safar <marek.safar@seznam.cz>
13025 * attribute.cs (AttributeTester.GetImportedIgnoreCaseClsType):
13026 New method, looking for lo-case imported cls type.
13028 * decl.cs (DeclSpace.VerifyClsCompliance): Check CS3005 for types
13031 * driver.cs: Removed VerifyTopLevelNameClsCompliance usage.
13033 * enum (Enum.VerifyClsCompliance): Hardcode non-compliant types.
13035 * typemanager.cs (TypeManager.AllClsTopLevelTypes): Renamed from
13036 all_imported_types.
13037 (TypeManager.LoadAllImportedTypes): Lo-case imported types.
13039 Optimized to save 3.5 MB for SWF compilation.
13041 2005-08-01 Marek Safar <marek.safar@seznam.cz>
13043 * class.cs (AddToTypeContainer): Use inheritance insted of if(s).
13044 (PartialContainer.Create): Moved logic AddToContainer.
13045 (PartialContainer.MarkForDuplicationCheck): Shares name.
13047 * decl.cs (DeclSpace.AddToContainer): Check name collisions at one
13050 * namespace.cs (Namespace.AddDeclSpace): Lazy declspaces
13052 (Namespace.GetSignatureForError): New method.
13054 * tree.cs (Tree.RecordDecl): Moved to AddToContainer.
13055 (RootTypes.AddToTypeContainer): se inheritance insted of if(s).
13057 2005-08-01 Raja R Harinath <rharinath@novell.com>
13060 * ecore.cs (Expression.MemberLookupFailed): Use queried_type for
13061 member lookup rather than qualifier_type, since qualifier_type can
13064 2005-08-01 Marek Safar <marek.safar@seznam.cz>
13066 * enum.cs (Enum.VerifyClsName): Fixed to allow not CLSCompliant
13069 2005-07-31 Miguel de Icaza <miguel@novell.com>
13071 * statement.cs: Copy the local exception into the exception
13072 captured local. Fixes 75674
13074 2005-07-31 Raja R Harinath <harinath@gmail.com>
13077 * expression.cs (Invocation.OverloadResolve): Don't report error
13078 CS1501 if error CS1502 has been reported.
13079 (New.DoResolve): Delegate CS1501 reporting to
13080 Invocation.OverloadResolve.
13083 * statement.cs (Block.CheckInvariantMeaningInBlock): Verify
13084 invariant-meaning-in-block property in an enclosing block if
13087 2005-07-29 Marek Safar <marek.safar@seznam.cz>
13089 * statement.cs (SwitchLabel.ResolveAndReduce): Refactored.
13090 (SwitchLabel.Erorr_AlreadyOccurs): Share error message.
13091 (Switch.CheckSwitch): Just save 50kb for SWF.
13093 2005-07-27 Martin Baulig <martin@ximian.com>
13095 * anonymous.cs (CaptureContext.AddField): Added
13096 `AnonymousContainer am' argument; compute its toplevel scope if
13097 it's not already computed. Fixes #75649.
13099 2005-07-26 Raja R Harinath <rharinath@novell.com>
13102 * class.cs (Constructor.Emit): Reset block to null if the block
13105 2005-07-25 Marek Safar <marek.safar@seznam.cz>
13107 * class.cs (TypeContainer.VerifyMembers): Be compatible in warning 169.
13109 2005-07-25 Marek Safar <marek.safar@seznam.cz>
13111 * class.cs (MethodData.Define): Check whether accessor implementing
13112 interface is public.
13114 * driver.cs (Driver.parse): Try to be smart and check for `MZ' header.
13116 2005-07-22 Marek Safar <marek.safar@seznam.cz>
13119 * namespace.cs (LookupType): Moved same type check to...
13121 * typemanager.cs (LookupTypeReflection): Don't allow to import more types
13122 with the same name.
13124 2005-07-21 Raja R Harinath <rharinath@novell.com>
13126 * namespace.cs (NamespaceLookupType): Avoid a string allocation when we
13127 already found a typebuilder.
13128 * class.cs (MethodCore.IsDuplicateImplementation): Compare
13129 MemberNames, not strings.
13131 * const.cs (Error_ExpressionMustBeConst):
13132 Rename from Error_EpressionMustBeConst.
13133 * const.cs, class.cs, statement.cd: Update.
13135 2005-07-21 Marek Safar <marek.safar@seznam.cz>
13139 * const.cs (Const.LookupConstantValue): Report missing contant expression
13141 (Error_EpressionMustBeConstant): Only one error method.
13143 * class.cs, statement.c: Updated.
13145 2005-07-20 Raja R Harinath <rharinath@novell.com>
13147 * statement.cs (Block.Flags): Add back HasVarargs.
13148 (Block.flags): Make protected.
13149 (ToplevelBlock.HasVarargs): Convert to a property that updates flags.
13151 * typemanager.cs (types, typecontainers, user_types): Remove.
13152 (UserTypes, TypeContainers): Likewise.
13153 (HandleDuplicate, AddDelegateType, AddEnumType): Likewise.
13154 (CleanUp, Reset): Update.
13155 (AddUserType): Combine variants. Now, only updates builder_to_declspace.
13156 (GetNestedType): Use Type.GetNestedType.
13157 (CoreLookupType): Take two arguments, the namespace and the
13158 basename of the type. Update to use the Namespace.Lookup
13160 (InitEnumUnderlyingTypes, InitCoreTypes): Update.
13161 (RealMemberLookup): Use IsNestedChildOf instead of playing with
13162 string concatenation and substring matches.
13163 * class.cs, enum.cs, delegate.cs: Update to changes.
13165 2005-07-20 Marek Safar <marek.safar@seznam.cz>
13167 * constant.cs (Constant.Error_ConstantValueCannotBeConverted): Moved from
13168 Expression and made virtual.
13170 * convert.cs (ImplicitReferenceConversionExists): Skip for value types.
13171 (ImplicitStandardConversionExists): Fixed `byte' typo ?
13173 * ecore.cs (Expression.Error_ConstantValueCannotBeConverted): Moved.
13175 * literal.cs (NullLiteral.Error_ConstantValueCannotBeConverted): Customize
13178 * convert.cs, ecore.cs, enum.cs: Reflect Error_ConstantValueCannotBeConverted
13181 2005-07-18 Marek Safar <marek.safar@seznam.cz>
13184 * codegen.cs (AssemblyClass.ApplyAttributeBuilder): Check whether
13185 AssemblyCultureAttribute is not used on executable.
13188 * typemanager.cs: Add System.Reflection.AssemblyCultureAttribute.
13190 2005-07-16 Raja R Harinath <rharinath@novell.com>
13193 * expression.cs (Binary.Warning_UnintendeReferenceComparison):
13194 New. Reports CS0252/CS0253.
13195 Mostly taken from preliminary patch by Duncak Mak.
13196 (Binary.DoResolveOperator): Store results of operator lookup.
13197 Use them to detect if we need to warn about unintended reference
13200 2005-07-15 Raja R Harinath <rharinath@novell.com>
13203 * namespace.cs (Namespace.Lookup): Add back location parameter.
13204 (Namespace.LookupType): Add CS0436 report. Add location parameter.
13205 * delegate.cs, ecore.cs, expression.cs: Update to changes.
13207 * codegen.cs (EmitContext.DeclSpace): Make readonly.
13208 * namespace.cs (Namespace.Lookup): Carve out type lookup into ...
13209 (Namespace.LookupType): ... this.
13210 (NamespaceEntry.GetUsingTable): Allocate only one zero-sized array
13212 * typemanager.cs (LookupTypeReflection): Remove buggy code that
13213 purported to handle pointers.
13214 (char_ptr_type, void_ptr_type): Use GetPointerType rather than
13217 2005-07-15 Marek Safar <marek.safar@seznam.cz>
13219 * expression.cs (MemberAccess.ResolveNamespaceOrType): Don't report nested
13222 2005-07-15 Raja R Harinath <rharinath@novell.com>
13224 * namespace.cs (Namespace.Lookup): Drop location parameter.
13225 (NamespaceEntry.LookupAlias): Remove. Merge into ...
13226 (NamespaceEntry.Lookup): ... this.
13227 (NamespaceEntry.Error_AmbiguousTypeReference):
13228 Move here from DeclSpace.
13229 (NamespaceEntry.LookupNamespaceOrType): Move support for dotted
13231 * ecore.cs (TypeLookupExpression.DoResolveAsTypeStep): ... here.
13232 * decl.cs (DeclSpace.ErrorAmbiguousTypeReference):
13233 Move to NamespaceEntry.
13234 * delegate.cs, expression.cs: Update to changes.
13236 2005-07-14 Marek Safar <marek.safar@seznam.cz>
13238 * attribute.cs (Attribute.ResolveAttributeType): Renamed from
13239 CheckAttributeType and refactored.
13240 (Attribute.ResolvePossibleAttributeType): Changed to reuse
13241 ResolveAsTypeTerminal error handling.
13242 (ResolveAsTypeTerminal): Introduced because of global attributes extra
13244 (GetSignatureForError): Print errors in same way.
13247 * codegen.cs: Reflect attribute GetSignatureForError change.
13250 * expression.cs: Add silent parameter to ResolveAsTypeStep.
13252 * namespace.cs (UsingEntry): Refactored to make fields private.
13255 statement.cs: Error_UnexpectedKind has extra parameter.
13257 2005-07-14 Raja R Harinath <rharinath@novell.com>
13259 * ecore.cs (IAlias): Remove.
13260 * decl.cs (DeclSpace): Don't derive from IAlias. Remove members
13261 that implement the interface.
13262 * namespace.cs (Namespace): Likewise.
13263 (Namespace.declspaces): Renamed from 'defined_names'.
13264 (Namespace.AddDeclSpace): Renamed from 'DefineName'. Take a
13265 DeclSpace instead of an IAlias.
13266 * tree.cs (Tree.AddDecl): Update.
13268 2005-07-12 Raja R Harinath <rharinath@novell.com>
13270 * statement.cs (Block.Flags); Remove HasVarargs.
13271 (Block.HasVarargs): Move to ToplevelBlock.
13272 (Block.ThisVariable, Block.AddThisVariable): Likewise.
13273 (Block.Variables): Make protected. Initialize variable hashtable
13275 (Block.AddVariable): Update.
13276 (Block.Resolve): Update to changes.
13277 (ToplevelBlock.HasVarargs): New boolean.
13278 (ToplevelBlock.ThisVariable): Move here from Block.
13279 (ToplevelBlock.AddThisVariable): Likewise.
13280 (ToplevelBlock.IsThisAssigned): New. Forwards call to this_variable.
13281 * expression.cs (This.ResolveBase): Update to changes.
13282 (ArglistAccess.DoResolve): Likewise.
13284 2005-07-11 Marek Safar <marek.safar@seznam.cz>
13287 * ecore.cs, class.cs: Use SetAssigned instead of direct access.
13289 * class.cs (TypeContainer.VerifyMembers): Distinguish between
13290 not used and not used & assigned.
13291 (FieldBase.ASSIGNED): Moved to MemberCore.Flags.
13293 2005-07-11 Marek Safar <marek.safar@seznam.cz>
13296 * expression.cs (Is.DoResolve): null is never provided type.
13298 2005-07-08 Marek Safar <marek.safar@seznam.cz>
13301 * cs-parser.jay: Less strict event error rule to catch more errors.
13303 2005-07-08 Martin Baulig <martin@ximian.com>
13305 Fix test-iter-10.cs - distinguish whether we `yield' in a property
13306 gettter (allowed) or setter (not allowed).
13308 * class.cs (Accessor): Implement IIteratorContainer.
13309 (Accessor.Yields): New public field.
13310 (PropertyBase.PropertyMethod.Define): Handle iterators on a
13311 per-accessor basis.
13314 (get_accessor_declaration, set_accessor_declaration): Set the
13315 `yields' flag on the accessor, not the property.
13316 (property_declaration): Do the iterators check on a per-accessor
13317 basis and not for the whole property.
13319 2005-07-08 Martin Baulig <martin@ximian.com>
13321 * anonymous.cs (CaptureContext.EmitParameterInstance): Correctly
13322 handle parameters in nested scopes; fixes #74808; see gtest-188.cs.
13324 2005-07-07 Marek Safar <marek.safar@seznam.cz>
13327 * attribute.cs (orig_sec_assembly): Holds original version of assembly.
13328 (ExtractSecurityPermissionSet): Cope with self referencing security
13329 attributes properly.
13331 * driver.cs (SetOutputFile): Made public property OutputFile.
13333 2005-07-07 Raja R Harinath <rharinath@novell.com>
13336 * class.cs (TypeContainer.first_nonstatic_field): Rename from
13337 has_nonstatic_fields. Make into a FieldBase pointer.
13338 (TypeContainer.AddField): Add CS0282 check.
13339 (TypeContainer.EmitType): Update.
13341 2005-07-06 Miguel de Icaza <miguel@novell.com>
13343 * cs-tokenizer.cs (consume_identifier): Do not create strings to
13344 compare if they start with __.
13346 2005-07-06 Raja R Harinath <rharinath@novell.com>
13348 * statement.cs (Switch.SwitchGoverningType): Only look at
13349 UserCasts that don't need implicit standard conversions to one of
13350 the allowed switch types (Fixes test-322.cs).
13351 (LocalInfo.Resolve): Re-enable sanity-test.
13353 2005-07-06 Marek Safar <marek.safar@seznam.cz>
13355 * cs-tokenizer.cs (consume_identifier): Detect double undescores
13357 * ecore.cs (FieldExpr.AddressOf): Changed volatile error to warning.
13359 * expression.cs (Invocation.DoResolve): Report error CS0245 here.
13361 2005-07-06 Raja R Harinath <rharinath@novell.com>
13364 * ecore.cs (SimpleName.GetSignatureForError): Add.
13365 * expression.cs (MemberAccess.DoResolve): Don't clobber 'expr' field.
13366 (MemberAccess.GetSignatureForError): Add.
13368 2005-07-05 Marek Safar <marek.safar@seznam.cz>
13370 The big error and warning messages review.
13400 * typemanager.cs: Updated.
13402 * class.cs: (MethodCore.SetYields): Moved here to share.
13403 (PropertyMethod.Define): Moved iterator setup here.
13405 * iterators.cs: Add orig_method to have full access to parent
13408 2005-07-05 Raja R Harinath <rharinath@novell.com>
13410 Make 'fixed variable' handling standards compliant. Fix #70807, #72729.
13411 * ecore.cs (IVariable.VerifyFixed): Remove 'is_expression' parameter.
13412 (FieldExpr.VerifyFixed): Ensure that the field is part of a fixed
13413 variable of struct type.
13414 * expression.cs (Unary.ResolveOperator): Update to change.
13415 (Indirection.VerifyFixed): Likewise.
13416 (LocalVariableReference.VerifyFixed): A local variable is always fixed.
13417 (ParameterReference.VerifyFixed): Value parameters are fixed.
13418 (This.VerifyFixed): Treat 'this' as a value parameter.
13419 * statement.cs (LocalInfo.IsFixed): Remove.
13421 2005-07-01 Martin Baulig <martin@ximian.com>
13423 * iterators.cs (Iterator.CapturedThisReference.Emit): Use
13424 `ec.EmitThis ()' to get the correct scope.
13426 2005-07-01 Martin Baulig <martin@ximian.com>
13428 * ecore.cs (FieldExpr.DoResolve): Don't capture the field if it's
13429 instance is a ParameterReference; fixes #75299.
13431 2005-07-01 Martin Baulig <martin@ximian.com>
13433 Reverted Marek's latest patch (r46725):
13434 - it contains structural changes which are neither mentioned in
13435 the ChangeLog nor explained anywhere; for example the additional
13436 argument of EmitContext's and Iterator's .ctor's and the
13437 TypeContainer.DefineMembers() change.
13438 - structural changes like this should go in in seperate patches
13439 and not be hidden in a huge patch which just seems to affect
13440 warnings and errors.
13441 a big and hard to understand patch.
13442 - it breaks iterators and causes regressions, for instance in
13445 2005-06-30 Raja R Harinath <rharinath@novell.com>
13448 * expression.cs (Indexers.map): Remove.
13449 (Indexers.Append): Filter out inaccessible setters and getters.
13450 (IndexerAccess.DoResolve, IndexerAccess.DoResolveLValue): Update.
13453 * ecore.cs (MemberExpr.EmitInstance): New. Add CS0120 check.
13454 Refactored from ...
13455 (FieldExpr.EmitInstance, PropertyExpr.EmitInstance): ... these.
13456 (FieldExpr.Emit, PropertyExpr.Emit): Update.
13457 (FieldExpr.EmitAssign, PropertyExpr.EmitAssign): Update.
13458 * expression.cs (Invocation.EmitCall): Add CS0120 check.
13460 2005-06-30 Marek Safar <marek.safar@seznam.cz>
13463 * class.cs (FieldBase.GetInitializerExpression): One more field
13466 2005-06-28 Miguel de Icaza <miguel@novell.com>
13468 * pending.cs: Do not define a proxy if the base method is virtual,
13469 it will be picked up by the runtime (bug 75270).
13471 2005-06-08 Martin Baulig <martin@ximian.com>
13473 The big Iterators rewrite :-)
13475 * iterators.cs: Rewrite this to use the anonymous methods framework.
13477 * rootcontext.cs (RootContext.DefineTypes): Define Delegates
13478 before the TypeContainers; see 2test-21.cs.
13481 (TypeContainer.DefineType): Don't create a new EmitContext if we
13482 already have one (this only happens if we're an Iterator).
13483 (TypeContainer.Define): Also call Define() on all our iterators.
13484 (Method.CreateEmitContext): Added support for iterators.
13487 (AnonymousContainer): New abstract base class for `AnonymousMethod'.
13488 (AnonymousContainer.CreateMethodHost): Moved here from
13489 AnonymousMethod and made abstract.
13490 (AnonymousContainer.CreateScopeType): New abstract method.
13491 (AnonymousContainer.IsIterator): New public property.
13492 (ScopeInfo.EmitScopeType): Call CreateScopeType() on our Host to
13493 get the ScopeTypeBuilder rather than manually defining it here.
13494 (ScopeInfo.EmitScopeInstance): New public method; correctly handle
13497 * driver.cs (Driver.MainDriver): Call TypeManager.InitCodeHelpers()
13498 before RootContext.DefineTypes().
13500 * codegen.cs (EmitContext.RemapToProxy): Removed.
13501 (EmitContext.CurrentAnonymousMethod): Changed type from
13502 AnonymousMethod -> AnonymousContainer.
13503 (EmitContext.ResolveTopBlock): Protect from being called twice.
13504 (EmitContext.MapVariable, RemapParameter(LValue)): Removed.
13505 (EmitContext.EmitThis): Removed the iterators hacks; use the
13506 anonymous methods framework for that.
13509 (ToplevelBlock.Container): Make this a property, not a field.
13510 (ToplevelBlock.ReParent): New public method; move the
13511 ToplevelBlock into a new container.
13512 (Foreach.TemporaryVariable): Simplify.
13514 2005-06-05 Martin Baulig <martin@ximian.com>
13516 * statement.cs (LocalInfo.CompilerGenerated): New flag.
13517 (Block.AddTemporaryVariable): New public method; creates a new
13518 `LocalInfo' for a temporary variable.
13519 (Block.EmitMeta): Create the LocalBuilders for all the temporary
13521 (Foreach.TemporaryVariable): Use Block.AddTemporaryVariable() for
13522 non-iterator variables.
13524 2005-06-05 Martin Baulig <martin@ximian.com>
13526 * statement.cs (Foreach.TemporaryVariable): Create the
13527 LocalBuilder in the Emit phase and not in Resolve since in some
13528 situations, we don't have an ILGenerator during Resolve; see
13529 2test-19.cs for an example.
13531 2005-06-04 Martin Baulig <martin@ximian.com>
13533 **** Merged r45395 from GCS ****
13535 The big Foreach rewrite - Part II.
13537 * typemanager.cs (TypeManager.object_getcurrent_void): Replaced
13538 with `PropertyInfo ienumerator_getcurrent'.
13540 * codegen.cs (VariableStorage): Removed.
13543 (Foreach): Derive from Statement, not ExceptionStatement.
13544 (Foreach.CollectionForeach): New nested class. Moved all the code
13545 dealing with collection foreach here.
13546 (Foreach.ForeachHelperMethods): Removed.
13547 (Foreach.TemporaryVariable): Implement IMemoryLocation.
13549 2005-05-23 Martin Baulig <martin@ximian.com>
13551 * statement.cs (Try.DoResolve): Don't create a `finally' if we
13552 don't need to. Fix #75014.
13554 2005-05-20 Martin Baulig <martin@ximian.com>
13556 Merged r44808 from GMCS.
13558 * class.cs (TypeContainer.CircularDepException): Removed.
13559 (TypeContainer.DefineType): Removed the `InTransit' stuff.
13560 (TypeContainer.CheckRecursiveDefinition): Check for circular class
13561 (CS0146) and interface (CS0529) dependencies here.
13563 2005-06-21 Raja R Harinath <rharinath@novell.com>
13565 * expression.cs (Invocation.EmitCall): Fix initialization
13566 'this_call' to reflect current behaviour. Fix indentation.
13568 * convert.cs (FindMostEncompassedType): Add two trivial special
13569 cases (number_of_types == 0 || number_of_types == 1).
13570 (FindMostEncompasingType): Likewise.
13572 2005-06-17 Raja R Harinath <rharinath@novell.com>
13574 Some cleanups preparing for the fix of #75283.
13575 * ecore.cs (PropertyExpr.InstanceResolve): Tighten conditions for
13577 (EventExpr.InstanceResolve): Likewise.
13578 (EventExpr.DoResolve): Remove redundant checks.
13580 2005-06-10 Duncan Mak <duncan@novell.com>
13582 * cs-tokenizer.cs (process_directives): New flag for controlling
13583 the processing of preprocessor directives.
13584 (x_token): After seeing a '#', return Token.NONE instead of going
13585 to handle_preprocessing_directive() when not processing
13586 directives. This avoids unnecessary processing during the token peek in
13591 * cs-tokenizer.cs (handle_preprocessing_directive, xtoken): Use
13592 the existing error reporting methods instead of Report.Error.
13594 * convert.cs (priv_fmt_expr): Remove. It's not needed anymore
13595 after Raja's rewrite.
13597 2005-06-08 Miguel de Icaza <miguel@novell.com>
13599 * class.cs: Small fix.
13601 2005-06-08 Raja R Harinath <rharinath@novell.com>
13604 * class.cs (GetPartialBases): Fix return value check of
13605 part.GetClassBases.
13607 2005-06-07 Raja R Harinath <rharinath@novell.com>
13609 Ensure that partial classes are registered in their enclosing
13610 namespace. Initial part of fix of #75160.
13611 * tree.cs (Tree.RecordDecl): Add new namespace argument.
13612 Register declspace with namespace here, not in
13613 DeclSpace.RecordDecl.
13614 * cs-parser.jay: Pass namespace to RecordDecl.
13615 * class.cs (PartialContainer.Create): Likewise.
13616 (ClassPart.DefineType): New sanity-check. Throws an exception if
13618 * decl.cs (Declspace.RecordDecl): Remove.
13619 * namespace.cs (NamespaceEntry.DefineName): Remove.
13621 2005-06-06 Marek Safar <marek.safar@seznam.cz>
13623 * rootcontext.cs: Reset TargetExt as well.
13625 2005-06-03 Raja R Harinath <rharinath@novell.com>
13627 * ecore.cs (Expression.Resolve): Emit CS0654 error when
13628 -langversion:ISO-1.
13630 2005-06-02 Raja R Harinath <rharinath@novell.com>
13632 Fix #75080, cs0119.cs.
13633 * ecore.cs (Expression.ExprClassToResolveFlags): New. Broken out
13635 (Expression.Resolve): ... this. Use it. Remove bogus code
13636 allowing ExprClass.Type and ExprClass.Namespace for
13637 ResolveFlags.VariableOrValue.
13638 (Expression.Resolve) [1-argument variant]: Change default resolve
13639 flags based on language version.
13640 (Expression.Error_UnexpectedKind): Use a simple string array
13641 rather than an ArrayList.
13642 * expression.cs (TypeOf.DoResolve): Set eclass to ExprClass.Value,
13643 not ExprClass.Type.
13644 (TypeOfVoid.DoResolve): Likewise.
13645 (MemberAccess.DoResolve) [3-argument variant]: Make private. Drop
13646 flags argument -- it always has the same value.
13648 2005-05-31 Raja R Harinath <rharinath@novell.com>
13651 * ecore.cs (Expression.ResolveLValue): Add a Location parameter.
13652 Use it in the error message.
13653 * assign.cs, expression.cs, statement.cs: Update.
13655 2005-05-30 Raja R Harinath <rharinath@novell.com>
13658 * ecore.cs (Expression.MemberLookupFailed): Add CS0122 check in
13659 the "almostMatchedMember" case too.
13660 * typemanager.cs (Closure.CheckValidFamilyAccess): Add anything
13661 that failed the accessibility checks to 'almost_match'.
13663 2005-05-27 Vladimir Vukicevic <vladimir@pobox.com>
13665 * attribute.cs: Use internal MethodBuilder methods to set
13666 ExactSpelling and SetLastError on PInvoke methods, instead
13667 of passing them via charset. Fixes #75060.
13669 2005-05-27 Raja R Harinath <rharinath@novell.com>
13671 * parameter.cs (Parameter): Remove TODO comment.
13672 (Parameter.DefineParameter): Remove Location parameter.
13673 (Parameters.LabelParameters): Likewise.
13674 * class.cs (Constructor.Emit): Update to change.
13675 (MethodData.Emit): Likewise.
13676 * anonymous.cs (AnonymousMethod.EmitMethod): Likewise.
13677 * delegate.cs (Delegate.Define, Delegate.Emit): Likewise.
13679 2005-05-27 Atsushi Enomoto <atsushi@ximian.com>
13682 Removed Parameters.Location and added Parameter.Location instead.
13683 Removed Location parameter from Emit() and GetSignature().
13690 Modified all related calls.
13692 2005-05-26 Raja R Harinath <rharinath@novell.com>
13694 Improve user-defined conversion handling.
13695 * convert.cs (GetConversionOperators): Rewrite. Return only the
13696 applicable operators.
13697 (AddConversionOperators): New. Helper for GetConversionOperators.
13698 (FindMostEncompassedType, FindMostEncompassingType): Verify that
13699 there is only one most encompassed/encompassing type.
13700 (FindMostSpecificSource, FindMostSpecificTarget): Remove
13701 "applicable operator" handling.
13702 (UserConversion): Move cache here from GetConversionOperators.
13703 Directly cache the chosen operator, rather than the whole
13705 (ExplicitNumericConversion): Fix buggy implementation of Decimal
13706 case. Allow conversion of decimal to sbyte and byte too.
13707 * expression.cs (EmptyExpression.Grab, EmptyExpression.Release):
13708 New static methods. Used to avoid allocating EmptyExpressions in
13711 2005-05-24 Duncan Mak <duncan@novell.com>
13713 * ecore.cs (CastFromDecimal): New class for casting a decimal to
13714 another class, used in Convert.ExplicitNumericConversion.
13715 (CastToDecimal): New class, similar to above, but casts to
13716 System.Decimal, used in Convert.ImplicitNumericConversion and also
13717 in explicit convesion from double/float to decimal.
13719 * convert.cs (ImplicitNumericConversion): Handle implicit
13720 conversions to System.Decimal.
13721 (ExplicitNumericConversion): handle explicit conversions to
13726 2005-05-20 Miguel de Icaza <miguel@novell.com>
13728 * typemanager.cs (EnumToUnderlying): Do not throw if we do not
13729 know the type at this stage, just break through. Fixes #75008
13731 2005-05-19 Martin Baulig <martin@ximian.com>
13734 (ImplicitDelegateCreation.Check): Added `bool check_only' argument
13735 to disable error reporting.
13737 * convert.cs (Convert.ImplicitStandardConversionExists): Use it
13738 here since we don't want to report an error; see the new test-336.cs.
13740 2005-05-19 Raja R Harinath <rharinath@novell.com>
13742 * statement.cs (ToplevelBlock.GetParameterReference)
13743 (ToplevelBlock.IsParameterReference,ToplevelBlock.IsLocalParameter):
13744 Move here from class Block.
13745 * ecore.cs (SimpleName.SimpleNameResolve): Update to changes.
13746 * expression.cs (ParameterReference.DoResolveBase): Likewise.
13748 2005-05-18 Martin Baulig <martin@ximian.com>
13753 (FlowBranching.Reachability): Add non-static public And() and Or()
13755 (FlowBranchingSwitch): New class; do the `break_origins' thing
13756 like in FlowBranchingLoop.
13757 (FlowBranching.UsageVector.MergeBreakOrigins): Also merge the
13758 reachability, not just locals and parameters.
13759 (FlowBranching.MergeChild): Remove some of the hacks for loop and
13760 switch; MergeBreakOrigins() now takes care of that.
13762 2005-05-18 Martin Baulig <martin@ximian.com>
13764 * flowanalysis.cs (FlowBranching.UsageVector.MergeChild): If we're
13765 a loop and may leave it, reset the barrier; fixes #74974.
13767 2005-05-17 Marek Safar <marek.safar@seznam.cz>
13769 * attribute.cs (Attribute.ResolveArguments): GuidAttribute check
13772 * cs-parser.jay: Catch more lexical errors.
13774 * report.cs: Add one more Error method.
13777 * typemanager.cs: Register System.Runtime.InteropServices.GuidAttribute
13779 2005-05-17 Martin Baulig <martin@ximian.com>
13781 * expression.cs (Argument.Resolve): Turn on flow analysis; fix
13784 2005-05-16 Raja R Harinath <rharinath@novell.com>
13786 Fix test-382.cs. Emit values of decimal constants.
13787 * class.cs (TypeContainer.RegisterFieldForInitialization): New.
13789 (TypeContainer.AddField): ... this.
13790 (TypeContainer.EmitFieldInitializers): Allow the list of fields
13791 with initializers to include 'Const's.
13792 (ClassPart.RegisterFieldForInitialization): Forward to
13794 * const.cs (Const.Const): Pass initializer to base class.
13795 (Const.Define): In case of decimal constants, register them for
13796 initialization in a static constructor.
13798 2005-05-14 Martin Baulig <martin@ximian.com>
13800 * statement.cs (Block.Resolve): Correctly handle unreachable code;
13801 do not call ResolveUnreachable() on unreachable statements in
13802 here, see the comment in the source code.
13804 2005-05-13 Raja R Harinath <rharinath@novell.com>
13807 * expression.cs (BinaryResolveOperator): If one of the operands of
13808 an equality comparison is 'null' and the other is a pointer type,
13809 convert the null to a NullPointer.
13810 * convert.cs (ImplicitReferenceConversion): If the expression is a
13811 NullLiteral and the target type is a pointer type, return a
13812 NullPointer instead.
13813 (ImplicitConversionStandard): Likewise.
13815 2005-05-13 Marek Safar <marek.safar@seznam.cz>
13817 * cs-parser.jay: Set readonly context based on special constructs.
13819 * expression.cs (LocalVariableReference.DoResolveBase): Improved
13820 readonly variable error handling.
13822 * rootcontext.cs (EmitCode): Don't verify members when error
13825 * statement.cs (LocalInfo): Add reaodnly context information.
13826 (SetReadOnlyContext, GetReadOnlyContext): New methods.
13828 2005-05-13 Raja R Harinath <rharinath@novell.com>
13830 * statement.cs (Block.Resolve): Revert change below. Modify fix
13831 for #74041 to initialize 'resolved' to false only for explicit
13832 blocks. Fixes #74873.
13834 2005-05-12 Raja R Harinath <harinath@gmail.com>
13837 * typemanager.cs (unmanaged_enclosing_types): New.
13838 (IsUnmanagedType): Avoid infloops by using
13839 'unmanaged_enclosing_types' to talk with recursive invocations.
13841 2005-05-13 Martin Baulig <martin@ximian.com>
13843 * statement.cs (Block.Resolve): Make the `bool unresolved' flag an
13844 instance variable, not a local. Fix #74873.
13845 (Block.ResolveUnreachable): Set it to true here.
13847 2005-05-11 Duncan Mak <duncan@novell.com>
13849 * cs-tokenizer.cs (get_cmd_arg): Check that 'c' is not -1 before
13850 continuing to process for 'arg'.
13851 (handle_preprocessing_directive): Check the argument of the #endif
13852 directive and report error CS1025 if there are any trailing
13855 According to the C# spec, having even whitespace after the #endif
13856 directive is illegal; however, because we call arg.TrimEnd ()
13857 beforehand, we have the same behavior as csc, allowing whitespace
13858 after the directive.
13862 2005-05-11 Marek Safar <marek.safar@seznam.cz>
13866 * class.cs (ConstructorInitializer.GetOverloadedConstructor): Removed.
13867 (Constructor.GetObsoleteAttribute): Implemented correctly.
13869 2005-05-10 Martin Baulig <martin@ximian.com>
13871 * support.cs (ReflectionParameters.ParameterModifier): Use
13872 `Parameter.Modifier.REF' if we both have `ParameterAttributes.Out'
13873 and `ParameterAttributes.In'. Fixes #74884.
13875 2005-05-10 Marek Safar <marek.safar@seznam.cz>
13877 * class.cs (Method.Define): Catch attempt for Finalizer declaration.
13879 * expression.cs (Argument.GetParameterModifier): Turned to property.
13880 (Invocation.Error_InvalidArguments): Add more descriptive errors.
13882 * parameter.cs (Parameter.GetModifierSignature): Translates modifier to
13885 2005-05-09 Raja R Harinath <rharinath@novell.com>
13888 * decl.cs (MemberCache.AddMethods): Register override methods,
13889 rather than non-override methods.
13890 * typemanager.cs (RegisterOverride): New.
13891 (IsOverride): Update.
13893 2005-05-09 Marek Safar <marek.safar@seznam.cz>
13897 * ecore.cs (SimpleName.SimpleNameResolve): Add in_transit to catch
13898 recursive declaration.
13900 * statement.cs (Block.ResolveMeta): Report any error in resolving.
13902 2005-05-06 Marek Safar <marek.safar@seznam.cz>
13904 * cfold (DoConstantNumericPromotions): Don't try to convert 0 enum.
13906 * expression.cs (Binary.DoResolve): (x && 0) is always 0.
13908 2005-05-05 Raja R Harinath <rharinath@novell.com>
13911 * decl.cs (DeclSpace.FamilyAccessible):
13912 Use TypeManager.IsNestedFamilyAccessible.
13914 Fix reopened #64812.
13915 * typemanager.cs (Closure.Filter): Introduce checks for 'protected
13918 2005-05-04 Raja R Harinath <rharinath@novell.com>
13919 Abin Thomas <projectmonokochi@rediffmail.com>
13920 Anoob V E <projectmonokochi@rediffmail.com>
13921 Harilal P R <projectmonokochi@rediffmail.com>
13924 * typemanager.cs (Closure.CheckValidFamilyAccess): Don't blindly
13925 allow access to all static members.
13927 2005-05-04 Martin Baulig <martin@ximian.com>
13929 * ecore.cs (FieldExpr.DoResolveLValue): Always call fb.SetAssigned().
13931 2005-05-04 Martin Baulig <martin@ximian.com>
13935 * statement.cs (Switch.SimpleSwitchEmit): Always emit the default
13936 section at the end; make things work if `default' is not the last
13939 2005-05-04 Martin Baulig <martin@ximian.com>
13943 * statement.cs (Switch): Replaced the `got_default' field with a
13944 `default_section' one.
13945 (Switch.CheckSwitch): Set `default_section' here.
13946 (Switch.Resolve): If we're a constant switch and the constant is
13947 not found, use the default section.
13949 2005-05-03 Martin Baulig <martin@ximian.com>
13951 * expression.cs (ArrayAccess.EmitGetLength): New public method.
13953 * statement.cs (Foreach.ArrayForeach): New nested class.
13954 (Foreach.TemporaryVariable): New nested class.
13955 (Foreach.EmitArrayForeach): Removed; this is now in the new
13956 ArrayForeach class.
13958 2005-05-03 Raja R Harinath <rharinath@novell.com>
13960 * pending.cs (BaseImplements): Move the #74773 fix here. This is
13962 (VerifyPendingMethods): Revert change below.
13964 * typemanager.cs (IsOverride, RegisterNonOverride): New.
13965 * decl.cs (MemberCache.AddMethod): Register "non-override" methods
13966 that used to trigger warning -28. Remove warning -28.
13967 * expression.cs (Invocation.OverloadResolve): Use
13968 TypeManager.IsOverride to distinguish override methods.
13971 * pending.cs (VerifyPendingMethods): If a base type implements the
13972 requested interface, don't bother checking individual methods of
13973 the base type. As a side-effect, this prevents the creation of
13974 unnecessary proxies.
13976 2005-05-02 Martin Baulig <martin@ximian.com>
13980 * flowanalysis.cs (FlowBranching.UsageVector.MergeJumpOrigins):
13981 Also `And' the locals if the old vector is null.
13982 (FlowBranching.UsageVector.BitVector.And): Allow `vector' being
13983 null; in this case we basically reset all the variables.
13985 2005-05-02 Martin Baulig <martin@ximian.com>
13989 * flowanalysis.cs (FlowBranching.UsageVector.MergeBreakOrigins):
13990 Added `FlowBranching branching' argument; always `and' the
13991 variables instead of `or'ing them unless we're an infinite loop.
13993 * statement.cs (While.Resolve): Create a new sibling unless we're
13996 2005-05-02 Martin Baulig <martin@ximian.com>
14000 * class.cs (ConstructorInitializer.Resolve): Added `Block block'
14001 arguments; use it instead of creating a new TopLevelBlock.
14002 (Constructor.Emit): Call `block.ResolveMeta ()' before resolving
14003 our ConstructorInitializer.
14006 (TopLevelBlock.TopLevelBranching): New public property.
14007 (TopLevelBlock.ResolveMeta): New public method; call ResolveMeta()
14008 and create our `TopLevelBranching'.
14010 * codegen.cs (EmitContext.ResolveTopBlock): If we're not an
14011 anonymous method host, use `block.TopLevelBranching' rather than
14012 creating a new branching.
14014 2005-04-20 Miguel de Icaza <miguel@novell.com>
14016 * anonymous.cs (ScopeInfo.AddChild): when adding a new child to
14017 a ScopeInfo, if any of the current children is a child of the new
14018 entry, move those children there.
14020 2005-04-30 Martin Baulig <martin@ximian.com>
14022 * statement.cs (Switch.SimpleSwitchEmit): Reset `default_at_end'
14023 at the beginning of a SwitchSection. Fix #73335.
14025 2005-04-27 Marek Safar <marek.safar@seznam.cz>
14028 * class.cs (EmitFieldInitializers): Use FieldExpr in initializer.
14030 * ecore.cs (FieldExpr): Add a new ctor with in_initializer.
14031 (FieldExpr.DoResolve): Obsolete members are ignored for field
14034 2005-04-26 Marek Safar <marek.safar@seznam.cz>
14036 * attribute.cs (AreOverloadedMethodParamsClsCompliant): Add array
14037 of arrays detection.
14039 * class.cs (Interface.VerifyClsCompliance): Add base interfaces
14041 (Field.VerifyClsCompliance): Volatile fields are not compliant.
14043 * decl.cs (MemberCache.VerifyClsParameterConflict): Add array of
14046 2005-04-25 Ben Maurer <bmaurer@ximian.com>
14048 * cs-parser.jay: Use the prefered version of -unsafe in error
14051 2005-04-22 Marek Safar <marek.safar@seznam.cz>
14053 * driver.cs (CompilerCallableEntryPoint.Invoke): Reset under any
14056 2005-04-20 John Luke <john.luke@gmail.com>
14058 * driver.cs: fix typo in error message, --outout to --output
14060 2005-04-20 Marek Safar <marek.safar@seznam.cz>
14062 * codegen.cs (InRefOutArgumentResolving): New field.
14064 * ecore.cs (FieldExpr.DoResolve): Check for assigning to readonly
14065 fields outside contructor.
14067 * expression.cs (Argument.Resolve): Set InRefOutArgumentResolving.
14069 2005-04-19 Miguel de Icaza <miguel@novell.com>
14071 * anonymous.cs (CaptureContext.EmitParameterInstance): The
14072 parameter code was not completed ever, so it was not as up-to-date
14073 as local variables. Must finish it.
14075 The bug fix was to compare the Toplevel of the block, not the
14076 current block. Thanks for Ben for pointing this out.
14078 2005-04-19 Raja R Harinath <rharinath@novell.com>
14080 * decl.cs (AddMethods): Use the declaring type of the problem
14081 method to determine if we want to squash a warning.
14083 2005-04-19 Marek Safar <marek.safar@seznam.cz>
14085 * attribute.cs: Removed debug output.
14087 * decl.cs (MemberCache.AddMethods): Fixed Finalize ignoring.
14089 * driver.cs (Driver.parse): Synchronize parser ErrorOutput with
14092 2005-04-18 Raja R Harinath <rharinath@novell.com>
14095 * expression.cs (Binary.EqualsNullIsReferenceEquals): New.
14096 (Binary.DoResolveOperator): Use it to avoid blindly optimizing out
14097 all null comparisons against reference types.
14099 2005-04-18 Marek Safar <marek.safar@seznam.cz>
14102 * class.cs (TypeContainer.CircularDepException) New nested
14104 (GetPartialBases, GetNormalBases, GetClassBases): Removed error.
14105 (TypeContainer.DefineType): Removed error, reset InTransit before
14107 (Class.DefineType): Throw exception when is in Transit.
14108 Catch exception and report error.
14109 (Struct.DefineType): Throw exception when is in Transit.
14110 Catch exception and report error.
14111 (Interface.DefineType): Throw exception when is in Transit.
14112 Catch exception and report error.
14114 * codegen.cs: Add InCatch,InFinally to EmitContext to easily
14115 handle nested exception handlers.
14117 * flowanalysis.cs (InTryWithCatch): New method, search for try with
14120 * iterators.cs (Yield.CheckContext): Add CS1626 report. Updated
14121 InFinally and InCatch storage.
14123 * statement.cs (Throw.Resolve): Use InCatch, InFinally from ec.
14124 (Catch.Resolve): Set and Restore ec.InCatch.
14125 (Try.Resolve): Set and Restore ec.InFinally.
14126 (Try.HasCatch): True when try has catch.
14128 2005-04-17 Atsushi Enomoto <atsushi@ximian.com>
14130 * doc.cs : In some cases FilterName returns MonoEvent and MonoField
14131 for the same event member, so exclude such cases from warning 419.
14134 2005-04-16 Miguel de Icaza <miguel@novell.com>
14136 * expression.cs (Binary.ResolveOperator): Apply patch from John
14137 Luke to fix bug 59864: operators &, | and ^ on enumerations
14138 require that the same enum type on both sides.
14140 * driver.cs: Add warnings to old flag usage, this is to assist
14141 people who produce Makefiles and hope that the Makefiles will be
14144 * class.cs (TypeContainer.EmitType): Moved the definition of the
14145 special $PRIVATE$ field from the resolve phase to the Emit phase.
14146 During resolve we do not know if we are a struct with
14147 HasExplicitLayout, we know this only after the attributes for the
14150 Set the FieldOffset to zero on the dummy field that we create for
14151 the class. Fixes 74590.
14153 2005-04-16 Raja R Harinath <rharinath@novell.com>
14156 * ecore.cs (PropertyExpr.resolved): New.
14157 (DoResolve): Use it to handle a case of double resolution here.
14158 Handle a case of identical-name-and-type-name.
14159 * expression.cs (ArrayCreation.CheckIndices): Avoid double
14160 resolution by storing the results of expression resolution back
14161 into the "probes" array.
14163 2005-04-15 Raja R Harinath <rharinath@novell.com>
14165 Fix cs0208-7.cs and cs0208-8.cs.
14166 * typemanager.cs (IsUnmanagedType): Arrays are not allowed
14167 (cf. ECMA standard, behaviour of CSC 1.1 and CSC 2.0). Improve
14168 error reporting to point out the reason a struct is not unmanaged.
14170 2005-04-13 Atsushi Enomoto <atsushi@ximian.com>
14172 * doc.cs : In FindDocumentedType(), avoid TypeExpr.ResolveType() and
14173 just use TypeExpr.Type. This fixes bug #74595 when merged to gmcs.
14175 2005-04-13 Raja R Harinath <rharinath@novell.com>
14178 * ecore.cs (PropertyExpr.InstanceResolve): Handle a case of
14179 IdenticalNameAndTypeName here.
14180 (EventExpr.InstanceResolve): Likewise.
14182 2005-04-13 Marek Safar <marek.safar@seznam.cz>
14184 C# 2.0 DefaultCharSetAttribute implementation
14186 * attribute.cs (Attribute.ResolveAsTypeStep): New protected method
14187 which allows us to set GlobalNamespace for every resolve.
14188 (Attribute.ResolveArguments): Cut from Resolve.
14189 (Attribute.GetCharSetValue): Returns CharSet named argument.
14190 (Attribute.DefinePInvokeMethod): Gets default charset from
14192 (GlobalAttribute.ResolveAsTypeStep): Override.
14193 (GlobalAttribute.ResolveArguments): Override.
14195 * class.cs (TypeAttr): Is protected.
14197 * codegen.cs (ModuleClass.DefaultCharSet): New member.
14198 (ModuleClass.DefaultCharSetType): New memeber.
14199 (ModuleClass.ResolveAttributes): Resolves DefaultCharSetAttribute.
14201 * decl.cs (Decl.TypeAttr): New protected virtual. Returns default
14202 charset from module.
14204 * delegate.cs (TypeAttr): Override.
14205 (Delegate.DefineType): Use this TypeAttr.
14207 * driver.cs (Driver.MainDriver): Call Module.ResolveAttributes
14208 at very early stage (before types are defined) to resolve model
14209 module attributes. It will probably not work with corlib but it
14212 * enum.cs (Enum.TypeAttr): New protected virtual. Returns default
14213 charset from module.
14215 * typemanager.cs (default_charset_type): New type.
14217 2005-04-13 Raja R Harinath <rharinath@novell.com>
14219 * decl.cs (MemberCache.AddMethods): Don't warn if
14220 System.Object.Finalize has buggy MethodAttributes.
14222 * typemanager.cs (IsUnmanagedType): Restore !IsValueType check
14225 2005-04-13 Atsushi Enomoto <atsushi@ximian.com>
14227 * doc.cs : detect ambiguous reference to overloaded members.
14228 Fixed bug #71603. MS 1.1 csc does not detect it.
14230 2005-04-13 Atsushi Enomoto <atsushi@ximian.com>
14232 * doc.cs : delegates must not be referenced with parameters.
14235 2005-04-12 Miguel de Icaza <miguel@novell.com>
14237 * typemanager.cs (IsUnmanagedType): Arrays are allowed.
14239 2005-04-10 Miguel de Icaza <miguel@novell.com>
14241 * driver.cs (MainDriver): Stop processing if the CLS stage found
14244 (CompilerCallableEntryPoint.InvokeCompiler): Always
14245 reset after execution; Take a TextWriter argument for the
14248 * report.cs: Use the error stream instead of hardcoding stderr.
14250 2005-04-09 Miguel de Icaza <miguel@novell.com>
14252 * class.cs: Reduce code paths to test, too small of an
14253 optimization to make it worth the extra testing. Always perform
14256 2005-04-08 Raja R Harinath <rharinath@novell.com>
14259 * class.cs (OperatorArrayList.CheckPairedOperators): Skip
14260 operators that had errors reported on them.
14262 2005-04-08 Marek Safar <marek.safar@seznam.cz>
14264 * attribute.cs (Attribute.IsValidArgumentType): Test valid named
14266 (Attribute.Resolve): Add named argument type checking.
14268 * class.cs (FixedField.Define): Use IsPrimitiveType
14270 * expression.cs (Binary.ResolveOperator): Reflect IsCLRType renaming.
14272 * iterators.cs (Iterator.DefineIterator): Add check for arglist and
14273 unsafe parameter types.
14275 * statement.cs (Using.ResolveExpression): Add better error description.
14277 * typemanager.cs (IsCLRType): Renamed to IsPrimitiveType.
14279 2005-04-08 Raja R Harinath <rharinath@novell.com>
14282 * attribute.cs (Attribute.GetAttributeUsage): Resolve
14283 AttributeUsageAttribute in the emitcontext of the attribute class,
14284 not in the emitcontext of the attributable entity it was attached to.
14285 * cs-parser.jay: Use 'current_class', not 'current_container',
14286 when creating a GlobalAttribute.
14288 2005-04-08 Alp Toker <alp@atoker.com>
14290 * pending.cs: The fix to #58413 failed to compile methods implementing
14291 interfaces with/without params modifiers and vice versa, even though
14292 params modifiers aren't part of the signature. Make the modifier check
14293 less strict as in csc.
14295 2005-04-07 Abin Thomas <projectmonokochi@rediffmail.com>
14296 Anoob V E <projectmonokochi@rediffmail.com>
14297 Harilal P R <projectmonokochi@rediffmail.com>
14300 * pending.cs (TypeAndMethods.mods): New. Store the parameter
14301 modifiers of pending methods.
14302 (PendingImplementation.PendingImplementation): Initialize it.
14303 Add Parameter.Modifier [][] mods and initialize it with ParameterData.
14304 (PendingImplementation.InterFaceMethod): Repalce Type[] argument
14305 with ParameterData. Add check for modifiers.
14306 * class.cs (MethodData.Define): Update to changes.
14308 2005-04-07 Raja R Harinath <rharinath@novell.com>
14310 * ecore.cs (Expression.IsAccessorAccessible): Clarify code somewhat.
14312 2005-04-07 Marek Safar <marek.safar@seznam.cz>
14314 * class.cs (PropertyMethod.Define): Check private accessor in abstract
14317 * decl.cs (DeclSpace.ApplyAttributeBuilder): Don't allow RequiredAttribute
14320 * typemanager.cs: Registered RequiredAttributeAttribute.
14322 2005-04-06 Marek Safar <marek.safar@seznam.cz>
14324 * class.cs (VerifyMembers): Doesn't need EmitContext argument.
14325 Warning CS0169 is back at level 3.
14326 (IMethodData.SetMemberIsUsed): New method.
14328 * decl.cs (IsUsed): New value; moved from FieldBase.Status
14329 (SetMemberIsUsed, IsUsed): New methods, encapsulate IsUsed.
14331 * delegate.cs (ResolveMethodGroupExpr): Call SetMemberIsUsed.
14333 * ecore.cs (FieldExpr.ResolveMemberAccess): Call SetMemberIsUsed for
14335 (PropertyExpr.ResolveAccessors): Call SetMemberIsUsed when delegate
14338 * expression.cs (OverloadResolve): Call SetMemberIsUsed. when method
14341 * rootcontext.cs (RootContext.EmitCode): Call VerifyMembers in extra run
14342 to avoid the problems with nested types.
14344 2005-04-05 Abin Thomas <projectmonokochi@rediffmail.com>
14345 Anoob V.E <projectmonokochi@rediffmail.com>
14346 Harilal P.R <projectmonokochi@rediffmail.com>
14347 Raja R Harinath <rharinath@novell.com>
14350 * delegate.cs (Define): Emit ParamArrayAttribute for 'params'
14352 * typemanager (GetConstructor): Make public.
14354 2005-04-05 John Luke <john.luke@gmail.com>
14355 Raja R Harinath <rharinath@novell.com>
14358 * typemanager.cs (IsUnmanagedType): Check non-public fields of a
14359 struct too. Return false quicker in a few cases.
14360 (VerifyUnManaged): Use it.
14362 2005-04-05 Raja R Harinath <rharinath@novell.com>
14365 * statement.cs (Block.Resolve): Initialize 'unreachable' to false,
14366 not 'unreachable_seen'.
14368 2005-04-04 Marek Safar <marek.safar@seznam.cz>
14370 * attribute.cs (Attribute.GetValue): Removed unused.
14372 * codegen.cs (CodeGen.TrimExt): Removed unused.
14374 * cs-parser.jay (output): Removed unused.
14376 * cs-tokenizer.cs (hex_digits): Removed unused.
14378 * enum.cs (MapToInternalType, GetEnumeratorName): Removed unused.
14380 * expression.cs (Indirection.LoadExprValue): Removed unused.
14381 (ArrayCreation.ExpressionToArrayArgument): Removed unused.
14383 * iterators.cs (Iterator.param_types): Removed unused.
14385 * statement.cs (Goto.block): Removed unused.
14386 (ToplevelBlock.did): Removed unused.
14387 (Switch.ResolveConstantSwitch): Removed unused.
14389 2005-04-01 Ben Maurer <bmaurer@ximian.com>
14391 * rootcontext.cs: Allow mcs to bootstrap with the compilation
14394 2005-04-01 Raja R Harinath <rharinath@novell.com>
14396 Fix #74232 and cs0208-3.cs.
14397 * expression.cs (ComposedCast.DoResolveAsTypeStep): Add CS0208 check.
14398 * typemanager.cs (IsUnmanagedType): Don't allow 'object' as an
14399 unmanaged type. Don't use FieldBuilders when 't' is a
14400 TypeBuilder. Use ModFlags and MemberType fields.
14401 * class.cs (MemberBase.member_type): Rename from MemberType.
14402 (MemberBase.MemberType): New property. Determines member_type on
14404 (MemberBase.DoDefine): Don't initialize MemberType here.
14405 (FieldMember.Define): Likewise.
14407 2005-04-01 Marek Safar <marek.safar@seznam.cz>
14410 * class.cs (Event.Emit): Call Add/Remove emit even for interfaces.
14411 Attributes are emitted there.
14413 2005-04-01 Raja R Harinath <rharinath@novell.com>
14415 * cs-tokenizer.cs (consume_identifier): Treat 'partial' as a
14416 keyword in 'partial enum' too.
14417 * cs-parser.jay (enum_declaration): Add CS0267 check ('partial enum'
14419 Report from Kamil Skalski <nazgul@omega.pl>.
14422 * rootcontext.cs (ResolveTree): The 'root.Interfaces' list can
14423 have partial containers too.
14425 * ecore.cs (SimpleName.SimpleNameResolve): Move 'invariant meaning
14426 in block' checks to Block.CheckInvariantMeaningInBlock.
14427 * statement.cs (Block.GetKnownVariableInfo): Make private.
14428 (Block.IsVariableUsedInChildBlock): Remove.
14429 (Block.IsVariableUsedInBlock): Likewise.
14430 (Block.CheckInvariantMeaningInBlock): New. Show location of
14431 conflicting declaration.
14432 (Block.AddVariable): Make error messages less long-winded and more
14433 specific. Show location of conflicting declaration.
14434 * parameter.cs (Parameters.Location): New readonly property.
14436 2005-03-31 Raja R Harinath <rharinath@novell.com>
14438 Clean up semantics of invoking ResolveMemberAccess.
14439 * ecore.cs (SimpleName.DoSimpleNameResolve): If a MemberExpression
14440 can have an instance, ensure that we pass in a non-TypeExpression
14441 to ResolveMemberAccess. Tighten up IdenticalNameAndTypeName checks.
14442 (MemberExpr.DoSimpleNameResolve): Remove type_is_inferred
14443 argument. Update to changes and simplify.
14444 (FieldExpr.Emitinstance): Remove CS0120 check.
14445 (PropertyExpr.EmitInstance): Likewise.
14446 * expression.cs (Argument.Resolve): Likewise.
14447 (Invocation.DoResolve): Update to changes in semantics of
14448 InstanceExpression.
14450 2005-03-31 Marek Safar <marek.safar@seznam.cz>
14453 * class.cs (AbstractPropertyEventMethod.EmitMethod): Enable emit method
14456 * decl.cs (MemberCache.AddMethods): Fix infinite loop.
14458 2005-03-31 Raja R Harinath <rharinath@novell.com>
14460 Fix difference in behaviour with commandline invocation.
14461 * driver.cs (Driver.Reset): New.
14462 (CompilerCallableEntryPoint): Call it.
14464 * statement.cs (If.Resolve): Avoid spurious "uninitialized
14465 variable" warnings if the boolean expression failed to resolve.
14467 2005-03-30 Sebastien Pouliot <sebastien@ximian.com>
14469 * attribute.cs: Fix the union of several permissions when some of them
14470 are unrestricted (so the result isn't an unrestricted permission set).
14473 2005-03-30 Raja R Harinath <rharinath@novell.com>
14475 * ecore.cs (MemberExpr): New class. Convert from interface
14477 (MemberExpr.ResolveMemberAccess): Refactor and move here from
14478 MemberAccess.ResolveMemberAccess. Tighten up pre-conditions and
14480 (MethodGroupExpr, FieldExpr, PropertyExpr, EventExpr): Update.
14481 (MethodGroupExpr.IsExplicitImpl): Remove.
14482 (Expression.GetFieldFromEvent): Remove.
14483 (SimpleName.MemberStaticCheck): Remove.
14484 (SimpleName.DoSimpleNameResolve): Update to changes.
14485 * expression.cs (MemberAccess.ResolveMemberAccess): Refactor.
14486 (MemberAccess.IdenticalNameAndTypeName): Remove.
14487 (MemberAccess.error176): Move to MemberExpr.
14488 (MemberAccess.DoResolve): Update to changes.
14489 (BaseAccess.DoResolve): Likewise.
14491 2005-03-30 Marek Safar <marek.safar@seznam.cz>
14493 C# 2.0 Conditional attribute class implementation
14495 * attribute.cs (AttributeTester.IsAttributeExcluded): New method.
14496 Analyzes class whether it has attribute which has ConditionalAttribute
14497 and its condition is not defined.
14499 * class.cs (Class.ApplyAttributeBuilder): Add IsAttributeExcluded check.
14500 (Class.IsExcluded): New method. Search for at least one defined
14501 condition in ConditionalAttribute of attribute class.
14503 2005-03-30 Raja R Harinath <rharinath@novell.com>
14505 * ecore.cs (PropertyExpr): Derive from Expression, not
14506 ExpressionStatement.
14507 (PropertyExpr.EmitStatement): Remove.
14509 2005-03-29 Raja R Harinath <rharinath@novell.com>
14512 * expression.cs (MemberAccess.ResolveMemberAccess): Allow the
14513 internal field "value__" of an enum be private. The examples for
14514 "value__" that I found on MSDN all used FieldAttributes.Private.
14516 * decl.cs (MemberCache.AddMethods): Use C# terminology in warning.
14517 Don't mention IL method attribute names.
14519 Fix #47991. Remove a TODO.
14520 * statement.cs (Block.Toplevel): Make into a field.
14521 (Block.Parameters): Move into ToplevelBlock.
14522 (Block.known_variables): Rename from child_variable_names.
14523 (Block.Block): Remove variants that take Parameters. Initialize
14524 'Toplevel' with the immediately surrounding toplevel block.
14525 (Block.AddKnownVariable): Rename from AddChildVariableName. Add a
14526 LocalInfo parameter.
14527 (Block.GetKnownVariableInfo): New.
14528 (Block.IsVariableNameUsedInChildBlock): Update.
14529 (Block.IsVariableNameUsedInBlock): New. Checks if a name is used in
14530 the block, even though it may not be in scope.
14531 (Block.AddVariable): Remove Parameters parameter. Use
14532 Toplevel.Parameters instead.
14533 (Block.AddConstant): Remove Parameters parameter.
14534 (Block.GetParameterReference): Update to use Toplevel.Parameters.
14535 (Block.IsParamaterReference): Likewise.
14536 (Block.IsLocalParameter): Likewise. Simplify a lot.
14537 (ToplevelBlock.Parameters): New. Moved from Block.
14538 (ToplevelBlock.ToplevelBlock): Update to changes. Always
14539 initialize Parameters to a non-null value.
14540 * cs-parser.jay: Update to changes.
14541 * ecore.cs (SimpleName.SimpleNameResolve): Emit cs0136 error for
14542 simple names that mean different things in the same block. Use
14543 Block.IsVariableNameUsedInBlock.
14545 2005-03-28 Raja R Harinath <rharinath@novell.com>
14547 * typemanager.cs (TypeHandle.BaseType): Make into an IMemberContainer.
14548 (TypeHandle.TypeHandle): Use LookupMemberCache rather than
14549 GetTypeHandle. It is possible for a reflected type to derive from
14550 a TypeBuilder (e.g., int[] derives from the TypeBuilder
14551 System.Array during mscorlib compilation).
14552 * decl.cs (MemberCache.MemberCache): If the base cache doesn't
14553 contain a method_hash, don't create one either. Don't create a
14554 deep copy of the base cache's method_hash.
14555 (MemberCache.SetupCache): Rename back from DeepCopy.
14556 (MemberCache.AddMethods): Rewrite, now that method_hash isn't
14557 already initialized. If we see an override function, add its
14558 underlying base virtual function to the member_hash too.
14560 * enum.cs (Enum.LookupEnumValue): Remove debugging code.
14562 2005-03-26 Raja R Harinath <harinath@acm.org>
14565 * assign.cs (Assign.DoResolve): When the RHS of an assignment
14566 fails to resolve, ensure that the LHS is still resolved as an
14569 2005-03-25 Raja R Harinath <harinath@acm.org>
14571 * enum.cs (Enum.DefineType): Set ec.InEnumContext and
14573 (Enum.current_ec): Remove.
14574 (Enum.LookupEnumValue): Remove EmitContext argument.
14575 Just uses the one created during DefineType.
14576 (Enum.FindMembers): Update.
14577 * expression.cs (MemberAccess.DoResolve): Update.
14579 2005-03-22 Marek Safar <marek.safar@seznam.cz>
14581 * assign.cs (Assign.DoResolve): Check for CS1717 when
14582 source and target are same (uses Equals).
14584 * expression.cs (LocalVariableReference, ParameterReference,
14585 This): Implemented Equals, GetHashCode.
14587 * statement.cs (Block.GetParameterReference): Removed useless
14590 2005-03-22 Raja R Harinath <rharinath@novell.com>
14593 * statement.cs (Block.AddVariable): Ensure that we skip implicit
14594 blocks before deciding whether the error is cs0136 or cs0128.
14596 * cs-parser.jay: Pass MemberName to RootContext.Tree.RecordDecl.
14597 (using_alias_directive, using_namespace_directive): Pass
14598 MemberName, not an expression to Namespace.UsingAlias and
14600 (MakeName): Use the MemberName of the namespace.
14601 * namespace.cs (Namespace.MemberName): New.
14602 (UsingEntry.UsingEntry): Take a MemberName, not an expression.
14603 (AliasEntry.AliasEntry, Namespace.Using, Namespace.UsingAlias):
14605 * decl.cs (MemberName.Name): Make readonly.
14606 (MemberName.FromDotted): New "constructor".
14607 (MemberName.Equals, MemberName.GetHashCode): Implement overrides.
14608 (MemberCore.Name): Compute from MemberName on demand.
14609 (MemberCore.SetMemberName): Provide a way to change the
14611 (MemberCore.AddToContainer): Don't take a fullname parameter.
14612 * class.cs (TypeContainer.AddToMemberContainer): Don't add the
14613 fully qualified name of the container to the member name.
14614 (TypeContainer.AddToTypeContainer): Use a fully qualified name
14615 only if the type is a member of the root container.
14616 (TypeContainer.AddMethod, TypeContainer.AddProperty): Use
14617 MemberName.Left rather than searching for an embedded ".".
14618 (PartialContainer.CreatePart): Update to changes in RootContext.
14619 (MemberBase.ShortName): Turn into a property. Use
14620 MemberCore.SetMemberName.
14621 (MemberBase.ExplicitInterfaceName): Remove.
14622 (MemberBase.UpdateMemberName): Remove.
14623 (AbstractPropertyEventMethod.UpdateName): Use SetMemberName.
14624 (PropertyBase.SetMemberName): New override.
14625 * tree.cs (Tree.RecordDecl): Take a MemberName and use it as hash key.
14626 (Tree.GetDecl): New.
14627 (Tree.AllDecls): Rename from Decls.
14628 * attribute.cs, enum.cs, report.cs: Update to changes.
14629 * driver.cs (MainDriver): Use MemberName.FromDotted on
14630 RootContext.MainClass.
14632 2005-03-21 Marek Safar <marek.safar@seznam.cz>
14634 * class.cs (FixedField.Define): Check for CS1664 and more sanity
14637 * expression.cs (ElementAccess.DoResolveLValue): Check for CS1708.
14639 2005-03-18 Marek Safar <marek.safar@seznam.cz>
14641 * modifiers.cs (Modifiers.PROPERTY_CUSTOM): New constant for
14642 property accessor modifiers.
14644 * class.cs (FieldMember.ApplyAttributeBuilder): Don't allow apply
14645 fixed buffer attribute (CS1716).
14646 (PropertyMethod.HasCustomAccessModifier): When property accessor
14647 has custom modifier.
14649 * ecore (PropertyExpr.DoResolve): Add CS0271 for custom accessor
14651 (PropertyExpr.DoResolveLValue): Add CS0272.
14653 2005-03-17 Miguel de Icaza <miguel@novell.com>
14655 * convert.cs: When converting to a pointer, use the proper Conv.U
14656 or Conv.I depending on the source data type.
14658 * cs-tokenizer.cs: Make the size for large decimal constants,
14661 2005-03-17 Martin Baulig <martin@ximian.com>
14663 * anonymous.cs (AnonymousMethod.method_modifiers): Change default
14664 from `Modifiers.INTERNAL' to `Modifiers.PRIVATE'. Fixes #73260.
14666 2005-03-17 Martin Baulig <martin@ximian.com>
14668 * anonymous.cs (AnonymousMethod.EmitMethod): Changed return type
14669 to bool so we can return an error condition.
14670 (AnonymousDelegate.Emit): Check whether AnonymousMethod.EmitMethod()
14673 2005-03-16 Zoltan Varga <vargaz@freemail.hu>
14675 * attribute.cs: Encode ThrowOnUnmappableChar and BestFitMapping
14678 2005-03-16 Raja R Harinath <rharinath@novell.com>
14680 Remove TypeManager.LookupType and TypeManager.LookupTypeDirect.
14681 Refactor to avoid traversing the list of assemblies, and to avoid
14682 string concatenation.
14683 * typemanager.cs (guid_attr_type): Remove.
14684 (negative_hits, pointers, references): Remove hashes.
14686 (GetConstructedType): New. Uses type_hash to handle constructed
14687 types (arrays, references, pointers).
14688 (GetReferenceType, GetPointerType): Use it.
14689 (GetNestedType): New. Uses type_hash to handle nested types of
14691 (LookupType, LookupTypeDirect): Remove.
14692 (CoreLookupType): Inline parts of old LookupTypeDirect code. Use
14693 'types' hash and LookupTypeReflection directly.
14694 (params_string, params_object): Use GetConstructedType.
14695 * namespace.cs (Namespace.cached_types): New. Cache of reflected
14697 (Namespace.Lookup): Use cached_types.
14698 (NamespaceEntry.LookupNamespaceOrType): Inline the functionality
14699 provided by old TypeManager.LookupType.
14700 * rootcontext.cs (MakeFQN): Remove.
14701 * decl.cs (DeclSpace.MakeFQN): Likewise.
14702 (DeclSpace.LookupType): Use TypeManager.GetNestedType.
14703 * expression.cs (ComposedCast.DoResolveAsTypeStep): Use
14704 TypeManager.GetConstructedType.
14705 * tree.cs (decl_ns_hash, LookupByNamespace): Remove.
14707 2005-03-15 Marek Safar <marek.safar@seznam.cz>
14709 * class.cs (MethodCore.CheckBase): Report CS1715 for properties and
14712 * cs-parser.jay: Reports CS1527 for any namespace element.
14714 * delegate.cs (DelegateCreation.Error_NoMatchingMethodForDelegate):
14717 * expression.cs (ParameterReference.IsAssigned): Changed error to
14719 (Error_WrongNumArguments): Moved CS0245 detection here.
14721 * statement.cs (Return.Resolve): Add CS1622 report.
14723 2005-03-11 Marek Safar <marek.safar@seznam.cz>
14725 * class.cs (StaticClass.DefineContainerMembers): Added CS0720.
14727 2005-03-11 Zoltan Varga <vargaz@freemail.hu>
14729 * attribute.cs expression.cs: Get rid of some allocations.
14731 2004-03-11 Atsushi Enomoto <atsushi@ximian.com>
14733 * doc.cs : just eliminate the latest change.
14735 2004-03-10 Atsushi Enomoto <atsushi@ximian.com>
14737 * doc.cs : commented out the latest change. It breaks xml-030.cs
14739 2004-03-10 Atsushi Enomoto <atsushi@ximian.com>
14741 * doc.cs : When TypeBuilder did not create Type yet, GetEvents() will
14742 fail. So invoke CreateType() in FindDocumentedType().
14744 2004-03-10 Atsushi Enomoto <atsushi@ximian.com>
14746 * cs-tokenizer.cs : added IsKeyword().
14747 * doc.cs : Detect keyword incorrectly used as identifier.
14748 Allow identifiers prefixed by @.
14750 2005-03-10 Marek Safar <marek.safar@seznam.cz>
14752 * attributes.cs (Attributes.Emit): Continue after CheckTargets.
14753 It caused exception in namespace resolving (again!).
14755 * class.cs (Class.ctor): Removed exit.
14756 (PropertyMethod.ctor): ditto.
14758 * codegen.cs (Codegen.Reset): Reset static data.
14759 (Codegen.ResolveTopBlock): Forward error status from ResolveMeta.
14761 * cs-tokenizer.cs (Cleanup): Removed.
14763 * driver.cs (GetSystemDir): Rewrote to one line command.
14764 It caused problem with unloaded dynamic modules.
14765 (UnixParseOption): Removed Exit.
14766 (CompilerCallableEntryPoint.InvokeCompiler): Make static.
14767 (CompilerCallableEntryPoint.Reset): Reset suitable static data.
14768 Now can be mcs used as library.
14770 * ecore.cs (Expression.ResolveBoolean): Use Location.Null for
14773 * location.cs (Reset): Reset static data.
14775 * namespace.cs (Reset): Reset static data.
14777 * report.cs (Report.Reset): Reset static data.
14779 * rootcontext.cs (RootContext.Reset): Reset static data.
14781 * tree.cs (RootTypes.ctor): Use Location.Null
14783 * typemanager.cs (TypeManager.Reset): Reset static data.
14784 (CoreLookupType): Removed Exit.
14785 (TypeHandle.Reset): Reset static data.
14787 2005-03-10 Raja R Harinath <rharinath@novell.com>
14790 * typemanager.cs (ComputeNamespaces): Import namespaces from
14791 referenced modules too.
14793 2005-03-09 Raja R Harinath <rharinath@novell.com>
14795 * class.cs (TypeContainer.AddToMemberContainer): Use "." rather
14798 2005-03-09 Raja R Harinath <rharinath@novell.com>
14800 * decl.cs (DeclSpace.LookupType): Don't loop but recurse into
14801 enclosing DeclSpace. This ensures that a name-lookup populates
14802 more caches and there are fewer 'TypeExpression's. Carve out
14803 nested type lookup into ...
14804 (LookupNestedTypeInHierarchy): ... this.
14806 2005-03-09 Raja R Harinath <rharinath@novell.com>
14808 Clean up a few partial-class semantics.
14809 Fixes test-357.cs and cs1618-2.cs.
14810 * cs-parser.jay (struct_declaration): Use 'current_class' as
14811 parent of newly-created struct. Remove call to Register ().
14812 Use 'pop_current_class' to complete handing the current struct.
14813 (interface_declaration): Likewise.
14814 (class_declaration): Likewise.
14815 (enum_declaration): Use 'current_class' as parent of newly created
14817 (delegate_declaration): Likewise.
14818 (pop_current_class): New function. This is used to handle closing
14819 up the 'current_class' and 'current_container', and pointing them
14820 to the enclosing class/container.
14821 (CSharpParser): Initialize 'current_class' too.
14822 * decl.cs (MemberCore): Add check for invariant: a partial
14823 container is not a parsed entity, and thus does not enclose any
14825 (DeclSpace.TypeResolveEmitContext): Expose 'type_resolve_ec'.
14826 (DeclSpace.BaseTypeExpr): Use it.
14827 (DeclSpace.LookupType): Add check for invariant.
14828 * class.cs (TypeContainer): Add check for invariant: a nested
14829 class should have the same NamespaceEntry as its enclosing class.
14830 (TypeContainer.EmitFieldInitializers): Make virtual.
14831 (TypeContainer.DefineDefaultConstructor): Adhere to invariant in
14833 (TypeContainer.Register): Remove.
14834 (TypeContainer.DefineType): Set the 'ec' of a PartialContainer to
14835 null. Use TypeResolveEmitContext for resolving base types and
14836 interfaces. Move initialization of Parts.TypeBuilder here from
14838 (TypeContainer.DefineNestedTypes): ... here.
14839 (PartialContainer): Take a Namespace not a NamespaceEntry.
14840 (PartialContainer.Create): Don't use Register. Call the
14841 appropriate Add... function directly.
14842 (ClassPart): Take both the PartialContainer and the enclosing
14843 class as constructor arguments.
14844 (ClassPart.EmitFieldInitializers): Override.
14845 (ClassPart.PartFindNestedTypes): Remove.
14846 (FieldBase.GetInitializerExpression): Resolve the initializer
14847 expression in the emit context of the enclosing class.
14848 * tree.cs (RootTypes): Remove Register ().
14850 2005-03-08 Marek Safar <marek.safar@seznam.cz>
14852 * cs-parser.jay: Removed CS0134.
14854 * driver.cs: Removed CS1901.
14856 * expression.cs (SizeOf.DoResolve): Don't report CS0233
14857 for predefined types.
14859 2005-03-07 Duncan Mak <duncan@novell.com>
14861 * codegen.cs (Save): Catch UnauthorizedAccessException as
14862 well. Fixes bug #73454.
14864 2005-03-07 Marek Safar <marek.safar@seznam.cz>
14866 * cs-tokenizer.cs (xtoken): Add CS1035.
14868 * class.cs (MethodData.Define): Add CS0683.
14869 (FieldMember.ctor): Add CS0681.
14871 2005-03-07 Raja R Harinath <rharinath@novell.com>
14873 * ecore.cs (SimpleName.DoResolve): Rename from
14874 SimpleName.DoResolveAllowStatic.
14875 (SimpleName.DoSimpleNameResolve): Remove 'allow_static' argument.
14876 Pass 'intermediate' flag to MemberStaticCheck.
14877 (SimpleName.MemberStaticCheck): Skip "static check" only in case
14878 of "intermediate" lookups via MemberAccess.
14879 (SimpleName.IdenticalNameAndTypeName): New. Carved out of ...
14880 * expression.cs (MemberAccess.IdenticalNameAndTypeName): ... this.
14882 2005-03-07 Raja R Harinath <rharinath@novell.com>
14885 * ecore.cs (FieldExpr.EmitInstance): Catch cases of CS0120 that
14886 slipped in because of variable names that are identical to a
14887 builtin type's BCL equivalent ('string String;', 'int Int32;').
14888 (PropertyExpr.EmitInstance): Likewise.
14890 2005-03-04 Marek Safar <marek.safar@seznam.cz>
14892 * cs-tokenizer.cs (PreProcessPragma): Add warning 1633, 1635.
14894 * report.cs (warning_ignore_table): Made public.
14896 2005-03-04 Raja R Harinath <rharinath@novell.com>
14899 * class.cs (MethodData.Emit): Pass 'container' to
14900 container.GetObsoleteAttribute instead of 'container.Parent'.
14902 2005-03-03 Marek Safar <marek.safar@seznam.cz>
14904 * cs-parser.jay: Add 1534 error test.
14906 * iterators.cs (Yield.CheckContext): Add error 1629.
14907 (Iterator.ctor): Save unsafe modifier.
14908 (MoveNextMethod.DoEmit): Restore unsafe context.
14910 * namespace.cs (UsingAlias): Better error message.
14912 2005-03-03 Dan Winship <danw@novell.com>
14914 * convert.cs (Error_CannotImplicitConversion): fix two bugs in
14915 the warning message [#73219]
14917 2005-03-03 Raja R Harinath <rharinath@novell.com>
14919 Fix compile with MCS 1.0.0.0.
14920 * cs-tokenizer.cs (PreProcessPragma): Simplify w_disable and
14921 w_restore to not depend on string constant folding.
14923 2005-03-03 Raja R Harinath <rharinath@novell.com>
14925 * decl.cs (DeclSpace.LookupType): Remove 'silent' argument. Move
14926 CS0246 check to users who passed 'silent = false'.
14927 * ecore.cs (TypeLookupExpression.DoResolveAsTypeStep): Add CS0246
14929 (SimpleName.SimpleNameResolve): Update.
14930 * expression.cs (ComposedCast.DoResolveAsTypeStep): Add CS0246 check.
14931 (MemberAccess.IdenticalNameAndTypeName): Update.
14932 * doc.cs (FindDocumentedTypeNonArray): Update.
14934 2005-03-03 Raja R Harinath <rharinath@novell.com>
14936 * codegen.cs (EmitContext): Remove ResolvingTypeTree.
14937 * parameters.cs (ComputeAndDefineParameters): Remove.
14938 * decl.cs (ResolveBaseTypeExpr): Don't set ResolvingTypeTree.
14939 * delegate.cs (Define): Don't invoke ComputeAndDefineParameters.
14940 Use GetParameterInfo.
14942 2005-03-02 Marek Safar <marek.safar@seznam.cz>
14944 * report.cs (StaticClass.DefineContainerMembers): Add warning 628.
14946 2005-03-02 Raja R Harinath <rharinath@novell.com>
14948 Unify DeclSpace.LookupType and DeclSpace.FindType.
14949 * decl.cs (DeclSpace.FindNestedType): New virtual function. This
14950 is in charge of defining nested types on demand.
14951 (DeclSpace.LookupType): Use it when the current_type is a
14952 TypeBuilder. Use LookupTypeDirect for reflected types.
14953 (DeclSpace.FindType): Remove.
14954 (DeclSpace.LookupInterfaceOrClass): Likewise.
14955 (DeclSpace.DefineTypeAndParents): Likewise.
14956 * ecore.cs (SimpleName.ResolveAsTypeStep): Just call
14957 DeclSpace.LookupType.
14958 * doc.cs (FindDocumentedTypeNonArray): Use DeclSpace.LookupType.
14959 * typemanager.cs (LookupType): Simplify.
14960 (AddUserType): Remove type from negative_hits.
14961 * namespace.cs (Namespace.Lookup): Use TypeManager.LookupTypeDirect.
14962 * class.cs (TypeContainer.FindMembers): Move handling of nested
14964 (TypeContainer.FindMembers_NestedTypes): ... here.
14965 (TypeContainer.FindNestedType): Implement override.
14966 (ClassPart.FindNestedType): Delegate to PartialContainer.
14967 (ClassPart.PartFindNestedType): Looks up the nested types of the
14970 2005-03-02 Martin Baulig <martin@ximian.com>
14972 * class.cs (TypeContainer.DoDefineMembers): We also need a default
14973 static constructor in static classes.
14975 2005-03-01 Zoltan Varga <vargaz@freemail.hu>
14977 * attribute.cs: Pass -1 to DefineLPArrayInternal if sizeConst or
14978 sizeParamIndex is not specified.
14980 2005-03-01 Marek Safar <marek.safar@seznam.cz>
14983 * report.cs (WarningMessage.IsEnabled): Missing null check.
14985 2005-02-28 Marek Safar <marek.safar@seznam.cz>
14987 * attribute.cs (DefinePInvokeMethod): Fix, all data are stored
14988 in the fields and not in the properties.
14990 2005-02-28 Zoltan Varga <vargaz@freemail.hu>
14992 * attribute.cs (GetMarshal): Marshal SizeConst and SizeParamIndex
14995 2005-02-28 Marek Safar <marek.safar@seznam.cz>
14997 * attribute.cs: Small refactoring (improved robustness).
14998 (ImplOptions, UnmanagedType, UsageAttribute): Removed members.
14999 (ValidateGuid): Removed.
15000 (Resolve): Removed referenced to above mentioned.
15001 (GetAttributeUsage): Made private and changed to work without
15003 (GetIndexerAttributeValue): Don't crash.
15004 (GetConditionalAttributeValue): Ditto.
15005 (GetClsCompliantAttributeValue): Ditto.
15006 (ExtractSecurityPermissionSet): All attributes exceptions are
15008 (GetPropertyValue): New helper.
15009 (GetMethodImplOptions): New method.
15010 (DefinePInvokeMethod): Reuse common code. Implemented handling of
15011 some missing properties.
15013 * class.cs (ClassOrStruct.ApplyAttributeBuilder): Updated.
15014 (Method.ApplyAttributeBuilder): Updated.
15016 * decl.cs (DeclSpace.ApplyAttributeBuilder): Don't catch shared
15019 2005-02-28 Raja R Harinath <rharinath@novell.com>
15022 * report.cs (Report.SymbolRelatedToPreviousError): Handle
15023 non-simple types (array, pointer, reference).
15025 2005-02-28 Marek Safar <marek.safar@seznam.cz>
15027 * cs-parser.jay: Add errors 1617, 650, 1007, 531, 547, 548
15029 * class.cs (MethodCore.IsDuplicateImplementation): Special error
15031 (Method.CheckBase): Catch wrong destructor here.
15032 (MethodData.Define): Add errors 550, 668.
15034 * cs-tokenizer.cs (PreProcessPragma): Add warning 1634.
15036 * ecore.cs (PropertyExpr.DoResolveLValue): Fixed wrong error code.
15038 * pending.cs (VerifyPendingMethods): Add error 551.
15040 * typemanager.cs (CSharpName): Next error report helper.
15042 2005-02-25 Marek Safar <marek.safar@seznam.cz>
15044 * attribute.cs (Atttribute.Resolve): Add cache for parameter-less
15045 attributes. Removed useless attribute double check.
15046 It saves almost 2MBs for corlib.
15048 2005-02-25 Raja R Harinath <rharinath@novell.com>
15051 * statement.cs (ExpressionStatement.Resolve): Make robust to being
15052 called twice in case of error.
15054 2005-02-23 Chris Toshok <toshok@ximian.com>
15056 Fix compiler portions of #72827.
15057 * statement.cs (Block.Emit): call Begin/EndScope on the
15058 EmitContext instead of the ILGenerator.
15060 * codegen.cs (EmitContext.BeginScope): new method, call
15061 ILGenerator.BeginScope as well as the SymbolWriter's OpenScope (if
15063 (EmitContext.BeginScope): same, but EndScope and CloseScope
15065 * symbolwriter.cs (SymbolWriter.OpenScope): get the current il
15066 offset and call the superclass's OpenScope(int) with it.
15067 (SymbolWriter.CloseScope): get the current il
15068 offset and call superclass's CloseScope(int) with it.
15070 2005-02-23 Marek Safar <marek.safar@seznam.cz>
15072 * anonymous.cs (AnonymousMethod.Compatible): Fixed to report
15073 CS1677 for out and ref as well.
15075 * class.cs (Method.Define): Add error CS1599 detection.
15077 * cs-parser.jay: Add CS1609, CS1670, CS1627 detection.
15079 * cs-tokenizer.cs (xtoken): Add error CS1646 detection.
15081 * delegate.cs (Delegate.Define): Add error CS1599 detection.
15083 * support.cs.cs (ModifierDesc): New helper method.
15085 2005-02-23 Raja R Harinath <rharinath@novell.com>
15086 Abin Thomas <projectmonokochi@rediffmail.com>
15087 Anoob V E <projectmonokochi@rediffmail.com>
15088 Harilal P R <projectmonokochi@rediffmail.com>
15090 Fix #57851, #72718.
15091 * class.cs (ConstructorBuilder.Resolve): Make sure that the second
15092 MemberLookup (used for error reporting) actually returns a result.
15093 Fix error report number (122, not 112).
15095 2005-02-22 Abin Thomas <projectmonokochi@rediffmail.com>
15096 Anoob V E <projectmonokochi@rediffmail.com>
15097 Harilal P R <projectmonokochi@rediffmail.com>
15100 * pending.cs (PendingImplementation.GetAbstractMethods):
15101 Find NonPublic members too.
15103 2005-02-22 Marek Safar <marek.safar@seznam.cz>
15105 * expression.cs.cs (ConditionalLogicalOperator.DoResolve):
15108 * class.cs (MethodCore.CheckMethodAgainstBase):
15109 Add error 239 report.
15111 2005-02-21 Raja R Harinath <rharinath@novell.com>
15114 * expression.cs (Invocation.IsApplicable): Make public.
15115 (Invocation.IsParamsMethodApplicable): Likewise.
15116 * delegate.cs (Delegate.VerifyApplicability): Don't use
15117 Invocation.VerifyArgumentCompat for parameter applicability
15118 testing. Use Invocation.IsApplicable and
15119 Invocation.IsParamsMethodApplicable.
15121 2005-02-21 Marek Safar <marek.safar@seznam.cz>
15123 * ecore.cs (PropertyExpr.DoResolve): Add error 214 report.
15125 * class.cs (Operator.Define): Add error 217 report.
15127 2005-02-21 Raja R Harinath <rharinath@novell.com>
15129 * namespace.cs (UsingEntry.Resolve): Undo change below.
15131 2005-02-21 Raja R Harinath <rharinath@novell.com>
15134 * ecore.cs (Expression.MemberLookupFailed): Add argument to
15135 disable the error message when the extended MemberLookup also
15137 (Expression.MemberLookupFinal): Update.
15138 (SimpleName.DoSimpleNameResolve): Update.
15139 * expression.cs (MemberAccess.ResolveNamespaceOrType):
15140 Don't use MemberLookupFinal.
15141 (New.DoResolve): Update.
15142 (BaseAccess.CommonResolve): Update.
15144 2005-02-21 Raja R Harinath <rharinath@novell.com>
15147 * attribute.cs (Attribute.ResolveType): If a 'resolve_error' had
15148 occured previously, don't resolve again.
15150 2005-02-21 Marek Safar <marek.safar@seznam.cz>
15153 * attribute.cs (Attribute.GetAttributeUsage): Add EmitContext
15154 argument. Call ResolveAttributeUsage for unresolved.
15155 when types doesn't match ctor arguments.
15157 * class.cs (DoDefineMembers.TypeContainer): Removed safety check
15158 for nested attribute classes.
15159 (Class.attribute_usage): Removed.
15160 (Class.ResolveAttributeUsage): Resolves AttributeUsageAttribute
15161 for attribute class.
15163 * ecore.cs (IsAttribute): Removed.
15165 * namespace.cs (UsingEntry.Resolve): Don't destroy NamespaceEntry.
15167 * rootcontext.cs (RegisterAttribute): Removed, attributes are
15169 (attribute_types): Removed.
15170 (EmitCode): Global attributes are emited as the latest.
15172 2005-02-18 Marek Safar <marek.safar@seznam.cz>
15174 * class.cs (EmitFieldInitializers): Don't emit field initializer
15175 for default values when optimilization is on.
15177 * constant.cs (Constant.IsDefaultValue): New property.
15179 * driver.cs: Add /optimize handling.
15183 * literal.cs: Implement new IsDefaultValue property.
15185 * rootcontext.cs (Optimize): New field, holds /optimize option.
15187 2005-02-18 Raja R Harinath <rharinath@novell.com>
15189 Fix crasher in re-opened #72347.
15190 * namespace.cs (Namespace.Lookup): Return null if
15191 DeclSpace.DefineType returns null.
15194 * expression.cs (Argument.Resolve): Handle a case of CS0120 here.
15196 2005-02-18 Raja R Harinath <rharinath@novell.com>
15198 Fix remainder of #63202. Change semantics of DoResolveLValue: it
15199 now returns null if it cannot resolve to an lvalue.
15200 * ecore.cs (Expression.DoResolveLValue): Return 'null' by default.
15201 (Expression.ResolveLValue): Emit CS0131 error if DoResolveLValue
15202 returned null. Remove check for SimpleName.
15203 (EventExpr.DoResolveLValue): New.
15204 * iterators.cs (Iterator.FieldExpression.DoResolveLValue): New.
15205 * expression.cs (Argument.Error_LValueRequired): New. Move CS1510
15207 (Argument.Resolve): ... here. Use it. Use DoResolveLValue to
15208 avoid CS0131 error.
15209 (Unary.ResolveOperator): Move CS0211 check ...
15210 (Unary.DoResolve): ... here. Use DoResolveLValue to avoid
15212 (Unary.DoResolveLValue): Simplify.
15213 (AddressOf.DoResolveLValue): New.
15214 (ArrayAccess.DoResolveLValue): New.
15216 2005-02-16 Marek Safar <marek.safar@seznam.cz>
15218 * attribute.cs (Attribute.Resolve): Add arguments casting for
15219 when types doesn't match ctor arguments.
15221 2005-02-16 Raja R Harinath <rharinath@novell.com>
15223 Fix parts of #63202.
15224 * expression.cs (UnaryMutator.ResolveOperator): Remove redundant
15225 lookup of operator in base type. Ensure that all checks happen
15226 when the operator resolves to an "op_..." method.
15228 2005-02-15 Raja R Harinath <rharinath@novell.com>
15231 * namespace.cs (NamespaceEntry.LookupNamespaceOrType): Add
15232 'ignore_cs0104' parameter. Pass it to ...
15233 (NamespaceEntry.Lookup): ... this.
15234 * decl.cs (DeclSpace.LookupType): Add 'ignore_cs0104' parameter.
15235 * ecore.cs (SimpleName.ResolveAsTypeStep): Update.
15236 (TypeLookupExpression.DoResolveAsTypeStep): Update.
15237 * expression.cs (MemberAccess.IdenticalNameAndTypeName):
15238 Update. Request that cs0104 errors be ignored.
15239 (ComposedCast.ResolveAsTypeStep): Update.
15241 2005-02-14 Raja R Harinath <rharinath@novell.com>
15244 * expression.cs (Invocation.BetterFunction): Remove support for
15245 comparing virtual functions and their overrides.
15246 (Invocation.IsOverride): New.
15247 (Invocation.OverloadResolve): Don't consider 'override' functions
15248 during candidate selection. Store them in a lookaside list.
15249 If the selected method is a 'virtual' function, use the list to
15250 find any overrides that are closer to the LHS type.
15252 2005-02-14 Marek Safar <marek.safar@seznam.cz>
15254 * expression.cs (New.DoResolve): Add complex core type reduction.
15255 (New.Constantify): Converts complex core type syntax like 'new int ()'
15256 to simple constant.
15258 2005-02-14 Raja R Harinath <rharinath@novell.com>
15260 * decl.cs (EntryType.EntryType): New constructor to create an
15261 updated copy of a cache entry.
15262 (MemberCache.AddMethods): Use it.
15263 (MemberCache.ClearDeclaredOnly): Remove.
15264 (MemberCache.MemberCache): Update.
15266 2005-02-11 Miguel de Icaza <miguel@novell.com>
15268 * codegen.cs (EmitContext): Introduce the `MethodIsStatic'
15269 variable. This one is represents the actual low-level declaration
15270 of the method, as opposed to the semantic level `IsStatic'.
15272 An anonymous method which is hosted into a static method might be
15273 actually an instance method. IsStatic would reflect the
15274 container, while MethodIsStatic represents the actual code
15277 * expression.cs (ParameterReference): Use the new MethodIsStatic
15278 instead of IsStatic.
15280 * anonymous.cs (AnonymousMethod.Compatible): Pass the
15281 Modifiers.STATIC to the Anonymous' Method EmitContext if static is
15282 set on the current EmitContext.
15284 * expression.cs (Cast): Overload DoResolveLValue so we can pass
15285 resolve our casted expression as an LValue. This triggers the
15286 proper LValue processing that is later required by Assign.
15290 * cs-tokenizer.cs (pp_and): recurse on pp_and, fixes #61903.
15292 2005-02-11 Marek Safar <marek.safar@seznam.cz>
15294 C# 2.0 Fixed buffer implementation
15296 * anonymous.cs: Update after RegisterHelperClass renaming.
15298 * attribute.cs (AttributeTester.fixed_buffer_cache):
15299 Cache of external fixed buffers.
15300 (AttributeTester.GetFixedBuffer): Returns IFixedBuffer
15301 implementation if field is fixed buffer else null.
15304 (TypeContainer.AddField): Accept FieldMember instead of Field.
15305 (FieldBase.IsFieldClsCompliant): Extracted code from
15306 VerifyClsCompliance descendant customization.
15307 (FixedField): New class handles fixed buffer fields.
15308 (FixedFieldExternal): Keeps information about imported fixed
15310 (IFixedField): Make access to internal or external fixed buffer
15313 * cs-parser.jay: Add fixed buffer parsing.
15315 * ecore.cs (FieldExpr.Emit): Add special emit case for fixed
15318 * expression.cs (Indirection): Extended implementation to accept
15319 fixed buffer field.
15320 (PointerArithmetic.Emit): Get element from fixed buffer as well.
15321 (ElementAccess.MakePointerAccess): Get type as parameter.
15322 (DoResolve): Add fixed buffer field expression conversion.
15323 (DoResolveLValue): Ditto.
15324 (FixedBufferPtr): New class. Moved most of original ArrayPtr.
15325 (ArrayPtr): Derives from FixedBufferPtr.
15326 (ArrayPtr.Emit): Add extra emit for array elements.
15328 * flowanalysis.cs.cs (StructInfo): Use FieldMember.
15330 * rootcontext.cs (CloseTypes): Emit CompilerGenerated attribute
15331 for compiler generated types.
15332 (RegisterCompilerGeneratedType): Renamed from RegisterHelperClass.
15334 * statement.cs (Fixed): Refactored to be easier add fixed buffer
15335 and consume less memory.
15336 (Fixed.Resolve): Add fixed buffer case.
15338 * typemanager.cs (compiler_generated_attr_ctor,
15339 fixed_buffer_attr_ctor): Add new 2.0 compiler attributes.
15340 (HasElementType): Add our own implementation to work on every
15343 2005-02-11 Miguel de Icaza <miguel@novell.com>
15345 * anonymous.cs (CaptureContext): Track whether `this' has been
15348 * expression.cs (This.ResolveBase): Call CaptureThis. Before we
15349 only captured `this' if it was implicitly done (instance
15350 methods/variables were used).
15352 * codegen.cs (EmitContext.CaptureThis): New method to flag that
15353 `this' must be captured.
15355 2005-01-30 Miguel de Icaza <miguel@novell.com>
15357 * anonymous.cs (CreateMethodHost): If there Scope.ScopeTypeBuilder
15358 is null it means that there has been no need to capture anything,
15359 so we just create a sibling.
15361 Renamed `EmitHelperClasses' to `EmitAnonymousHelperClasses'
15363 Just a partial fix. The other half is fairly elusive.
15365 2005-02-10 Raja R Harinath <rharinath@novell.com>
15367 Fix #52586, cs0121-4.cs.
15368 * decl.cs (MemberCache.DeepCopy): Rename from SetupCache. Take
15369 and return a hashtable.
15370 (MemberCache.ClearDeclaredOnly): New.
15371 (MemberCache.MemberCache): Update to change. Make a deep copy of
15372 the method_hash of a base type too.
15373 (MemberCache.AddMethods): Adapt to having a deep copy of the base
15374 type methods. Overwrite entries with the same MethodHandle so
15375 that the ReflectedType is correct. The process leaves in base
15376 virtual functions and their overrides as distinct entries.
15377 (CacheEntry): Now a class instead of a struct. It shouldn't alter
15378 matters since it was boxed in a ArrayList before.
15379 (CacheEntry.Member, CacheEntry.EntryType): Remove 'readonly'
15381 * expression.cs (Invocation.BetterFunction): Simplify. Handle the
15382 case of a virtual function and its override (choose the overload
15384 (Invocation.OverloadResolve): Avoid 'override' members during
15385 'applicable_type' calculation.
15387 2005-02-09 Raja R Harinath <rharinath@novell.com>
15389 Combine two near-redundant caches.
15390 * typemanager.cs (method_params): Rename from method_internal_params.
15391 (TypeManager.GetParameterData): New. Replace
15392 Invocation.GetParameterData.
15393 (TypeManager.LookupParametersByBuilder): Remove.
15394 * expression.cs (Invocation.method_parameter_cache): Remove.
15395 (Invocation.GetParameterData): Remove.
15397 * anonymous.cs, attribute.cs, convert.cs, delegate.cs:
15400 2005-02-08 Raja R Harinath <rharinath@novell.com>
15403 * delegate.cs (Delegate.DefineType): When bootstrapping corlib, if
15404 TypeManager.multicast_delegate_type is null, resolve it by looking
15405 up "System.MulticastDelegate".
15406 * rootcontext.cs (RootContext.ResolveCore): Simplify.
15408 2005-02-07 Abin Thomas (NOSIP) <projectmonokochi@rediffmail.com>
15409 Anoob V.E (NOSIP) <projectmonokochi@rediffmail.com>
15410 Harilal P.R (NOSIP) <projectmonokochi@rediffmail.com>
15413 * statement.cs (LabeledStatement.Resolve): Don't set 'referenced'.
15414 (LabeledStatement.AddReference): New. Set 'referenced'.
15415 (Goto.Resolve): Use it.
15417 2005-02-05 John Luke <john.luke@gmail.com>
15419 * driver.cs: remove duplicate -doc line in Usage ()
15421 2005-02-04 Raja R Harinath <rharinath@novell.com>
15423 * location.cs (Location.AddFile): Fix CS2002 error report.
15425 2005-02-02 Martin Baulig <martin@ximian.com>
15427 * delegate.cs (Delegate.DefineType): Report an internal error if
15428 TypeManager.multicast_delegate_type is null. See bug #72015 for
15431 2005-02-02 Raja R Harinath <rharinath@novell.com>
15433 Fix a crasher in a variant of #31984.
15434 * const.cs (Constant.CheckBase): New override that defers the
15435 new-or-override check in case the base type hasn't been populated
15437 (Constant.Define): Ensure the new-or-override check is performed.
15439 2005-02-01 Duncan Mak <duncan@ximian.com>
15441 * const.cs (LookupConstantValue): Check that `ce' is not null
15442 before calling GetValue ().
15444 2005-02-01 Raja R Harinath <rharinath@novell.com>
15446 Fix test-334.cs (#69519).
15447 * cs-parser.jay (using_alias_directive): Pass in an expression to
15448 NamespaceEntry.UsingAlias.
15449 (using_namespace_directive): Pass in an expression to
15450 NamespaceEntry.Using.
15451 (namespace_name): Don't flatten to a string.
15452 * namespace.cs (NamespaceEntry.AliasEntry): Store an expression.
15453 (NamespaceEntry.AliasEntry.Resolve): Lookup using
15455 (NamespaceEntry.UsingEntry): Likewise.
15456 (NamespaceEntry.Using,NamespaceEntry.UsingAlias): Update to
15458 (NamespaceEntry.LookupForUsing): Remove.
15459 (NamespaceEntry.LookupNamespaceOrType): Add support for dotted
15461 (NamespaceEntry.Lookup): Remove support for dotted names.
15463 2005-02-01 Raja R Harinath <rharinath@novell.com>
15465 * namespace.cs (NamespaceEntry.NamespaceEntry): Simplify, and
15467 (NamespaceEntry.ImplicitParent): Compute on demand.
15468 (NamespaceEntry.Doppelganger): New implicit namespace-entry that
15469 parallels the current.
15470 (NamespaceEntry.LookupForUsing): Use it.
15471 (NamespaceEntry.Lookup): If the current namespace-entry is
15472 implicit, don't search aliases and using tables.
15474 2005-02-01 Raja R Harinath <rharinath@novell.com>
15477 * class.cs (TypeContainer.DoDefineMembers): Don't initialize
15479 (TypeContainer.BaseCache): Compute on demand.
15480 (TypeContainer.FindMembers): Define constants and types if they're
15481 not already created.
15482 (FieldMember.Define): Move resetting of ec.InUnsafe before error
15484 * const.cs (Constant.Define): Make idempotent.
15486 2005-01-29 Miguel de Icaza <miguel@novell.com>
15488 * pending.cs: Produce better code (no nops produced by using Ldarg
15491 * pending.cs (PendingImplementation.DefineProxy): It was not `arg
15492 i - 1' it should be arg + 1.
15496 2005-01-28 Raja R Harinath <rharinath@novell.com>
15498 * attribute.cs (Attribute.CheckAttributeType): Make private
15500 (Attribute.ResolveType): Make virtual.
15501 (GlobalAttribute.ResolveType,GlobalAttribute.Resolve): Simplify
15502 handling of RootContext.Tree.Types.
15504 2005-01-27 Raja R Harinath <rharinath@novell.com>
15506 Update attribute-handling to use the SimpleName/MemberAccess
15508 * cs-parser.jay (attribute): Pass in an expression to the
15509 constructors of Attribute and GlobalAttribute.
15510 * attribute.cs (Attribute): Take an expression for the name.
15511 (Attribute.ResolvePossibleAttributeTypes): New. Resolves the
15512 passed in attribute name expression.
15513 (Attribute.CheckAttributeType): Use it.
15514 * ecore.cs (FullNamedExpression.ResolveAsTypeStep): New.
15515 * expression.cs (MemberAccess.ResolveAsTypeStep): Move body to ...
15516 (MemberAccess.ResolveNamespaceOrType): ... here. Add 'silent'
15517 argument to prevent error messages if the lookup fails.
15519 2005-01-27 Marek Safar <marek.safar@seznam.cz>
15521 * expression.cs (Indirection): Implemented IVariable interface
15522 to support indirection in AddressOf operator.
15523 (PointerArithmetic.Emit): Add optimalization for case where
15524 result can be precomputed.
15526 2005-01-26 Martin Baulig <martin@ximian.com>
15528 * class.cs (TypeContainer.AttributeTargets): Return the correct
15529 AttributeTargets depending on our `Kind' instead of throwing an
15530 exception; fixes #71632.
15532 2005-01-26 Marek Safar <marek.safar@seznam.cz>
15535 * expression.cs (MemberAccess.ResolveMemberAccess): Add CS0176 test for
15538 2005-01-25 Raja R Harinath <rharinath@novell.com>
15541 * expression.cs (MemberAccess.DoResolve): Don't complain with
15542 cs0572 when the LHS of a member access has identical name and type
15545 2005-01-25 Marek Safar <marek.safar@seznam.cz>
15548 * attribute.cs (ExtractSecurityPermissionSet): Catch exceptions from
15550 Create custom PermissionSet only for PermissionSetAttribute.
15552 2005-01-24 Marek Safar <marek.safar@seznam.cz>
15555 * class.cs (StaticClass.DefineContainerMembers): Enable enums and
15556 delegates in static class.
15558 2005-01-24 Martin Baulig <martin@ximian.com>
15560 * flowanalysis.cs (FlowBranching.UsageVector.MergeChild): If we're
15561 merging an implicit block, just use its reachability.
15563 * statement.cs (Block.Resolve): Make the unreachable code check
15564 work wrt. implicit blocks; see test-337 from #63842.
15566 2005-01-21 Alp Toker <alp@atoker.com>
15568 * cs-parser.jay: destructor_declaration's container is PartialContainer
15569 not Class when partial types are used, so use Kind prop instead of
15572 2005-01-22 Miguel de Icaza <miguel@ximian.com>
15574 * cs-parser.jay: Improve error reporting when an interface
15575 declares new types.
15577 2005-01-20 Dick Porter <dick@ximian.com>
15579 * support.cs: SeekableStreamReader fix from Sandor Dobos
15580 (dobos_s@ibcnet.hu) to cope with Position setting when multibyte
15581 chars are read. Fixes bug 70369.
15583 2005-01-20 Raja R Harinath <rharinath@novell.com>
15585 * cs-parser.jay (catch_clause): Simplify current_block handling
15588 2005-01-17 Miguel de Icaza <miguel@ximian.com>
15590 * convert.cs (ImplicitStandardConversionExists): Synchronize the
15591 code with ImplicitStandardConversion to handle the implicit
15592 conversion of method groups into valid delegate invocations.
15594 The problem is that in parameter handling we were using this code
15595 path. Fixes bug #64698
15597 2005-01-19 Raja R Harinath <rharinath@novell.com>
15599 * cs-parser.jay: Fix several infelicities.
15600 - Avoid assigning to the parser value stack. Code like
15601 '$3 = null' is unclean. Synthesize a value for the code block
15603 - Avoid using oob_stack for storing location information. Use ...
15604 (_mark_): ... this. New (empty) rule. Saves the current location
15606 (foreach_statement): Avoid using oob_stack for current_block
15607 handling. Use technique used in for_statement and
15608 using_statement. Synthesize a value for the code block to store
15609 additional intermediate information.
15611 2005-01-13 Miguel de Icaza <miguel@ximian.com>
15613 * ecore.cs (IsAccessorAccessible): Accessibility to private fields
15614 of a different type is only allowed to private fields of a
15615 containing type, not on fields of a base class.
15617 See test-174.cs and error cs0122-9.cs
15619 2005-01-13 Raja R Harinath <rharinath@novell.com>
15621 Fix test-335.cs (bug #58126).
15622 * cs-parser.jay (argument): Split out non-expression parts of the
15623 rule into 'non_simple_argument'.
15624 (invocation_expression): Support parenthesized invocations with
15625 multiple arguments, and with single non-simple arguments.
15627 2005-01-13 Raja R Harinath <rharinath@novell.com>
15629 * cs-tokenizer.cs (xtoken): Reset 'comments_seen' in a couple more
15632 2005-01-12 Raja R Harinath <rharinath@novell.com>
15634 Fix cs0038-1.cs, cs1640-6.cs.
15635 * ecore.cs (Expression.Resolve): Remove special-case for
15636 SimpleName in error-handling.
15637 (Expression.almostMatchedMembers): Relax access permission to
15639 (Expression.MemberLookupFailed): Handle duplicates in
15640 almostMatchedMembers list.
15641 (SimpleName.DoSimpleNameResolve): Catch CS0038 errors earlier.
15642 * expression.cs (New.DoResolve): Report CS1540 for more cases.
15643 * typemanager.cs (GetFullNameSignature): Use the MethodBase
15644 overload if the passed in MemberInfo is a MethodBase.
15646 2005-01-12 Marek Safar <marek.safar@seznam.cz>
15649 * attribute.cs (ExtractSecurityPermissionSet): Don't report error
15650 for non-CAS & merge permission sets properly.
15652 2005-01-11 Raja R Harinath <rharinath@novell.com>
15654 Improve standard-compliance of simple name and member access
15655 resolution. Fixes bugs #52697, #57200, #67520, #69519.
15656 * ecore.cs (FullNamedExpression): New abstract base class
15657 for Namespaces and TypeExpressions.
15658 (ResolveFlags.SimpleName): Remove.
15659 (SimpleName): Remove support for dotted names.
15660 (SimpleName.ResolveAsTypeStep): Simplify. Now just a wrapper to
15661 DeclSpace.FindType and DeclSpace.LookupType.
15662 (SimpleName.DoSimpleNameResolve): Remove support for dotted names.
15663 (Expression.ExprClassName): Make member function.
15664 * expression.cs (MemberAccess.ResolveAsTypeStep): Support LHS being
15665 a namespace. Remove creation of dotted "SimpleName"s.
15666 (MemberAccess.DoResolve): Likewise.
15667 * decl.cs (DeclSpace.Cache): Make private.
15668 (DeclSpace.LookupInterfaceOrClass): Return a FullNamedExpression.
15669 (DeclSpace.FindType): Update.
15670 (DeclSpace.LookupType): Move here from RootContext. Return a
15671 FullNamedExpression.
15672 * namespace.cs (Namespace): Derive from FullNamedExpression
15673 so that it can be part of expression resolution.
15674 (Namespace.Lookup): Return an FullNamedExpression.
15675 (NamespaceEntry.LookupAlias): Lookup aliases only in current
15677 * rootcontext.cs (NamespaceLookup): Remove.
15678 (LookupType): Move to DeclSpace.
15679 * attribute.cs (CheckAttributeType): Update.
15680 * doc.cs (FindDocumentedType): Remove allowAlias argument.
15681 (FindDocumentedTypeNonArray): Likewise.
15683 2005-01-11 Raja R Harinath <rharinath@novell.com>
15685 Fix cs0509.cs, cs1632.cs.
15686 * class.cs (TypeContainer.GetNormalBases): Don't assume !IsClass
15687 is the same as IsInterface.
15688 (TypeContainer.GetClassBases): Likewise.
15689 * statement.cs (LabeledStatement.ig): New field.
15690 (LabeledStatement.LabelTarget): Save ILGenerator which created the
15692 (LabeledStatement.DoEmit): Check that the label was created with
15693 the same ILGenerator.
15695 2005-01-10 Marek Safar <marek.safar@seznam.cz>
15698 * attribute.cs (GetMethodObsoleteAttribute): Need to transform
15699 accessors to its properties.
15701 * ecore.cs (PropertyExpr): Add AccessorTable to help track back
15702 from accessors to property.
15704 2005-01-10 Marek Safar <marek.safar@seznam.cz>
15707 * class.cs (MethodCore.CheckBase): Test base method obsoleteness
15708 only for overrides.
15710 2005-01-08 Miguel de Icaza <miguel@ximian.com>
15712 * attribute.cs: Check for null and empty strings.
15714 I have lost another battle to Paolo.
15716 2005-01-07 Marek Safar <marek.safar@seznam.cz>
15719 * class.cs (PropertyMethod): Set Parent field in ctors.
15720 (SetMethod.InternalParameters): Add unsafe switch hack.
15721 Override MarkForDuplicationCheck where it is appropriate.
15723 * decl.cs (MemberCore.MarkForDuplicationCheck): New method.
15724 It says whether container allows members with the same name.
15725 Base default is no.
15726 (DeclSpace.AddToContainer): Use MarkForDuplicationCheck.
15727 Removed is_method parameter.
15729 2005-01-06 Duncan Mak <duncan@ximian.com>
15731 * cs-tokenizer.cs (xtoken): Redo the work for signaling CS1040
15732 because the previous change led to incorrect reporting of CS1032
15733 ("Cannot define/undefine preprocessor symbols after first token in
15734 file"). Instead of using `tokens_seen' as the only flag that
15735 triggers CS1040, introduce `comments_seen'. This new flag is used
15736 to signify having seen comments on the current line, so it is
15737 unset after a newline.
15739 2005-01-06 Atsushi Enomoto <atsushi@ximian.com>
15741 * doc.cs : When searching for a type, find nested type too.
15742 This fixes bug #71040.
15744 2005-01-06 Atsushi Enomoto <atsushi@ximian.com>
15747 - Warn missing member comment on those classes which also does not
15748 have doc comments. Fixed bug #71041.
15749 - Don't warn missing doc comment on default constructor.
15752 2005-01-06 Duncan Mak <duncan@ximian.com>
15754 * cs-tokenizer.cs (xtoken): After handling traditional C-style
15755 comments, set `tokens_seen' to true. This allows us to detect
15756 misplaced preprocessor directives (i.e. not at the beginning of
15757 the a line, nor after whitespaces). In that case, report error
15758 CS1040. This fixes bug #56460.
15760 * cs-parser.jay (interface_member_declaration): Add checks for
15761 IsExplicitImpl, and report CS0541 error if an interface member is
15762 defined as an explicit interface declaration.
15764 2005-01-06 Marek Safar <marek.safar@seznam.cz>
15767 * class.cs (PropertyMethod): Set Parent field in ctors.
15768 (SetMethod.InternalParameters): Add unsafe switch hack.
15770 * decl.cs (MemberCore.Parent): Cannot be readonly.
15772 2005-01-06 Raja R Harinath <rharinath@novell.com>
15774 * decl.cs (DeclSpace.ResolveType): Remove.
15775 (DeclSpace.ResolveBaseTypeExpr): Rename from ResolveTypeExpr.
15776 Merge in code from ...
15777 (DeclSpace.GetTypeResolvingEmitContext): ... here. Remove.
15778 * class.cs, enum.cs: Update to changes.
15780 2005-01-06 Miguel de Icaza <miguel@ximian.com>
15782 * anonymous.cs: Ensure that we init the scope of our parent if it
15783 has not been initialized yet.
15785 2004-12-30 Duncan Mak <duncan@ximian.com>
15787 * typemanager.cs (TypeManager.CheckStructCycles): Don't crash here
15788 if field.FieldBuilder is null. Fixes #70758.
15790 * convert.cs: Fixed some typos and updated some of the comments.
15791 (ImplicitStandardConversionExists):
15792 (TryImplicitIntConversion): If `target_type' is an interface and
15793 the type of `ic' implements this interface, return true or a new
15794 BoxedCast instead of null. This fixes #70468.
15796 2004-12-29 Duncan Mak <duncan@ximian.com>
15798 * expression.cs (Argument.Emit): Check that Expr is
15799 IMemoryLocation before casting to it, and report CS1510 otherwise.
15803 2004-12-21 Ben Maurer <bmaurer@ximian.com>
15805 * statement.cs (Block.ThisVariable): remove the recursion here, to
15806 make the --profile more sane.
15808 2004-12-17 Carlos Cortez <calberto.cortez@gmail.com>
15810 * driver.cs: Patch to handle a xsp bug that prevents to reference an .exe
15811 assembly, by JB Evain.
15813 2004-12-17 Raja R Harinath <rharinath@novell.com>
15815 * class.cs, decl.cs, ecore.cs, iterators.cs, pending.cs,
15816 rootcontext.cs, typemanager.cs: Make nomenclature consistent.
15817 "parent" refers to enclosing type/class. "base" refers to superclass.
15819 2004-12-17 Raja R Harinath <rharinath@novell.com>
15821 * codegen.cs (CommonAssemblyModulClass.GetClsCompliantAttribute):
15822 Ensure that we only have GlobalAttributes.
15823 * attribute.cs (Attribute.Emit): Make non-virtual.
15824 (GlobalAttribute.Emit): Remove.
15825 (Attribute.Resolve): Make virtual.
15826 (GlobalAttribute.Resolve): New. Set Rootcontext.Tree.Types.NamespaceEntry.
15827 (Attribute.GetConditionalAttributeValue): Take an EmitContext as
15828 the argument. Don't create one.
15829 (Attribute.GetObsoleteAttribute): Likewise.
15830 (Attribute.GetClsCompliantAttributeValue): Likewise.
15831 * class.cs, decl.cs: Update to changes.
15833 2004-12-17 Marek Safar <marek.safar@seznam.cz>
15835 * delegate.cs (NewDelegate.DoResolve): Add error 149 report.
15837 * ecore.cs (Expression.MemberLookupFailed): Fixed error 143.
15839 * statement.cs (Foreach.Resolve): Add error 186 report.
15841 2004-12-16 Marek Safar <marek.safar@seznam.cz>
15843 * expression.cs (Conditional.DoResolve): Add warning 429.
15845 * statement.cs (If.Resolve): Add warning 665.
15847 2004-12-16 Raja R Harinath <rharinath@novell.com>
15849 New invariant: RootContext.Tree.Types.NamespaceEntry == null
15850 except when in the parser, and in GlobalAttribute.
15851 * driver.cs (MainDriver): Reset RootContext.Tree.Types.NamespaceEntry.
15852 * attribute.cs (GlobalAttribute.CheckAttributeType): Reset
15853 RootContext.Tree.Types.NamespaceEntry once work is done.
15854 (GlobalAttribute.Emit): New. Wrapper for Attribute.Emit, but sets
15855 and resets RootContext.Tree.Types.NamespaceEntry.
15857 2004-12-15 Marek Safar <marek.safar@seznam.cz>
15859 * cs-parser.jay: Don't create a block for every variable.
15861 2004-12-14 Miguel de Icaza <miguel@ximian.com>
15863 * location.cs: Provide extra information.
15865 * statement.cs: The instance is not `ldarg_0.THIS' when accessing
15866 variables from the captured environment, it is the ldarg_0.
15868 2004-12-14 Marek Safar <marek.safar@seznam.cz>
15870 * cs-parser.jay: Changed warning level for 642 to 4 until Miguel
15873 * class.cs: Changed warning level for 169 to avoid developer
15874 displeasure from warning flooding. It will be changed back when they
15875 fix most of current BCL warnings.
15877 * RootContext.cs: Pushed default WarningLevel to 3.
15879 * statement.cs: Removed unused variable.
15881 2004-12-14 Marek Safar <marek.safar@seznam.cz>
15883 * class.cs (TypeContainer.GetClassBases): Add error 1521 report.
15884 (TypeContainer.MethodModifiersValid): Refactored to use MemberCore.
15885 Add error 502 report.
15886 (StaticClass.DefineType): Add error 441 report.
15887 (Class.AllowedModifiersProp): New virtual property as temporary
15888 extension to AllowedModifiers.
15889 (Class.DefineType): Add error 418 report. Moved ModFlags check here
15890 to share implementation with StaticClass and don't call virtual
15893 * driver.cs (MainDriver): Add error 1558 test.
15895 * parameter.cs (Parameter.ApplyAttributeBuilder): Add error 662
15896 report. Moved error 36 test here.
15898 * statement.cs (Throw.Resolve): Add error 724 report.
15900 * typemanager.cs: Add out_attribute_type core type.
15902 2004-12-13 Marek Safar <marek.safar@seznam.cz>
15904 * class.cs (TypeContainer.VerifyClsCompliance): Add error
15906 (PropertyBase.VerifyClsCompliance): Add errror 3025 report.
15908 * codegen.cs (ModuleClass.ApplyAttributeBuilder): Add error
15911 * decl.cs (MemberCore.VerifyClsCompliance): Add warning 3021.
15913 * parameter.cs (ReturnParameter.ApplyAttributeBuilder):
15914 Add error 3023 report.
15915 (Parameter.ApplyAttributeBuilder): Add error 3022 report.
15917 * tree.cs (RootTypes.IsClsCompliaceRequired): Add fake
15920 2004-12-12 John Luke <john.luke@gmail.com>
15922 * driver.cs (AddArgs): take -- into account when
15923 adding arguments, fixes bug 65710
15925 2004-12-12 Martin Baulig <martin@ximian.com>
15927 * expression.cs (Unary.TryReduceNegative): Added support for
15928 SByteConstant and ByteConstant.
15929 (Unary.Reduce): Check error values from TryReduceNegative().
15931 2004-12-10 Marek Safar <marek.safar@seznam.cz>
15933 * attributes.cs (Attribute.Resolve): Avoid multiple error report
15934 and report exception as error 182.
15936 2004-12-10 Raja R Harinath <rharinath@novell.com>
15938 * driver.cs (Main): Fix message when there are warnings.
15940 2004-12-09 Miguel de Icaza <miguel@ximian.com>
15942 * delegate.cs: Fixed my fix from yesterday, sorry about that.
15944 2004-12-09 Marek Safar <marek.safar@seznam.cz>
15946 * anonymous.cs, class.cs, convert.cs, doc.cs, support.cs:
15947 Reduced number of warnings.
15949 * class.cs (TypeContainer.VerifyClsCompliance): One if is enough.
15951 2004-12-08 Miguel de Icaza <miguel@ximian.com>
15953 * driver.cs: Removed message.
15955 * delegate.cs: Fix bug introduced in 1.1.x: 70219.
15957 2004-12-08 <vargaz@freemail.hu>
15959 * cs-tokenizer.cs: Add workaround for NET 2.0 beta 1 csc bug.
15961 2004-12-08 Martin Baulig <martin@ximian.com>
15963 * class.cs (TypeContainer.VerifyClsCompliance): Report a CS3003
15964 instead of a CS3002 for properties and indexer.
15966 2004-12-08 Martin Baulig <martin@ximian.com>
15968 * decl.cs (MemberName.ToString): Make this work again.
15970 2004-12-08 Marek Safar <marek.safar@seznam.cz>
15972 * attribute.cs (Resolve): Add error 591 detection.
15974 * class.cs (FieldMember.Define): Add error 1547 detection.
15975 (Indexer.Define): Add error 620 detection.
15976 (Operator.Define): Add error 590 detection.
15978 * ecore.cs: Missing argument for error 79.
15980 * expression.cs (ComposedCast.DoResolveAsTypeStep): Add error 611
15983 2004-12-07 Marek Safar <marek.safar@seznam.cz>
15986 * assign.cs.cs (Assign.DoResolve): Reports error 1648 for value types
15989 2004-12-07 Atsushi Enomoto <atsushi@ximian.com>
15991 * cs-parser.jay : handle doc comments on implicit/explicit operators.
15992 Some operator comments were suppressed.
15993 * doc.cs : Implicit/explicit operator name in doc comments are like
15994 "op_Explicit(type)~returnType", so added suffix handling.
15996 2004-12-07 Martin Baulig <martin@ximian.com>
15999 (MemberCore.GetObsoleteAttribute): Don't create a new EmitContext.
16000 (MemberCore.GetClsCompliantAttributeValue): Likewise.
16001 (DeclSpace.ec): New protected field; store the EmitContext here.
16002 (DeclSpace.EmitContext): New public property; moved here from
16004 (DeclSpace.GetClsCompliantAttributeValue): Don't create a new
16007 * enum.cs (Enum.Define): Store the EmitContext in the `ec' field.
16008 (Enum.Emit): Don't create a new EmitContext.
16010 * delegate.cs (Delegate.DefineType): Always create the
16013 * iterators.cs (Iterators.DefineIterator): Create a new
16014 EmitContext and store it in `ec'.
16016 2004-08-24 Martin Baulig <martin@ximian.com>
16019 (TypeManager.IsSubclassOf): Renamed to IsFamilyAccessible; use
16020 this for accessibility checks.
16021 (TypeManager.IsSubclassOrNestedChildOf): Renamed to
16022 IsNestedFamilyAccessible.
16023 (TypeManager.IsSubclassOf): New method, do what the name actually
16026 2004-12-06 Raja R Harinath <rharinath@novell.com>
16028 Fix crash on cs0657-17.cs.
16029 * codegen.cs (CommonAssemblyModulClass.GetClsCompliantAttribute):
16030 Use RootContext.Tree.Types, not 'new RootTypes ()'.
16031 * attribute.cs (GlobalAttribute.CheckAttributeType): Narrow down
16032 the case where the NamespaceEntry gets overwritten.
16034 2004-12-06 Marek Safar <marek.safar@seznam.cz>
16036 Fixed #69195, #56821
16037 * ecore.cs (ResolveBoolean): Tiny refactoring.
16039 * expression.cs (Binary.DoResolve): Add warning 429 and skipping
16040 of right expression resolving when left is false constant and
16041 operator is LogicalAnd OR true constant and operator is LogicalOr.
16043 * statement.cs (ResolveUnreachable): Always reports warning.
16045 2004-12-05 Miguel de Icaza <miguel@ximian.com>
16047 * class.cs: Distinguish between 1721 and 1722 (just a little help
16048 for the programmer).
16050 2004-12-03 Miguel de Icaza <miguel@ximian.com>
16052 * delegate.cs: Only allow this on new versions of the language.
16054 2004-12-02 Duncan Mak <duncan@ximian.com>
16056 * ecore.cs (PropertyExpr.IsAccessorAccessible): Moved to
16058 (Expression.IsAccessorAccessible): Moved from the PropertyExpr to
16059 here as a static method. Take an additional bool out parameter
16060 `must_do_cs1540_check' for signaling to InstanceResolve.
16061 (PropertyExpr.InstanceResolve): Removed the `must_do_cs1540_check'
16062 member field from PropertyExpr class and made it an argument of
16063 the method instead.
16064 (EventExpr.InstanceResolve): Copied from PropertyExpr, removed the
16065 check for MarshalByRefObject, and report CS0122 instead of CS1540.
16066 (EventExpr.DoResolve): Call IsAccessorAccessible on `add_accessor'
16067 and `remove_accessor' as well as InstanceResolve: report CS0122
16072 2004-12-03 Raja R Harinath <rharinath@novell.com>
16074 Fix test-327.cs, test-328.cs, and put in early infrastructure
16075 for eventually fixing #52697.
16076 * namespace.cs (NamespaceEntry.LookupForUsing): New method.
16077 (NamespaceEntry.LookupNamespaceOrType): New method, refactored
16078 from other methods.
16079 (NamespaceEntry.Lookup): Remove 'ignore_using' flag.
16080 (AliasEntry.Resolve, UsingEntry.Resolve): Use 'LookupForUsing'.
16081 (VerifyUsing, error246): Update.
16082 * rootcontext.cs (RootContext.NamespaceLookup): Just use
16083 'NamespaceEntry.LookupNamespaceOrType'.
16085 2004-12-03 Martin Baulig <martin@ximian.com>
16087 * delegate.cs (NewDelegate.DoResolve): If we have an anonymous
16088 method as our child, call AnonymousMethod.Compatible() on it.
16090 2004-12-03 Raja R Harinath <rharinath@novell.com>
16092 Disable XML documentation support in 'basic' profile.
16093 * decl.cs, class.cs [BOOTSTRAP_WITH_OLDLIB]: Don't import System.Xml.
16094 Redirect XmlElement to System.Object.
16095 * driver.cs, enum.cs, rootcontext.cs: Don't reference System.Xml.
16096 * doc.cs [BOOTSTRAP_WITH_OLDLIB]: Disable compile.
16097 * mcs.exe.sources: Add doc-bootstrap.cs.
16098 * doc-bootstrap.cs: New file. Contains empty stub implementation
16101 2004-12-03 Atsushi Enomoto <atsushi@ximian.com>
16103 * cs-tokenizer.cs : Only '////' is rejected. Other non-whitespace
16104 comments are allowed.
16106 2004-12-03 Carlos Alberto Cortez <calberto.cortez@gmail.com>
16108 * delegate.cs: Add checks for subtypes in paramaters and return values
16109 in VerifyMethod () to add support for Covariance/Contravariance
16112 2004-12-02 Miguel de Icaza <miguel@ximian.com>
16114 * report.cs: Remove extra closing parenthesis.
16116 * convert.cs (Error_CannotImplicitConversion): If the name of the
16117 types are the same, provide some extra information.
16119 * class.cs (FieldBase): Use an unused bit field from the field to
16120 encode the `has_offset' property from the FieldMember. This saves
16121 a couple of Ks on bootstrap compilation.
16123 * delegate.cs (NewDelegate.DoResolve): If we have an anonymous
16124 method as our child, return the AnonymousMethod resolved
16127 * expression.cs (New.DoResolve): Allow return values from
16128 NewDelegate to also include AnonymousMethods.
16132 2004-12-02 Marek Safar <marek.safar@seznam.cz>
16135 * attribute.cs (Resolve): Improved implementation of params
16136 attribute arguments.
16138 * support.cs (ParameterData): Add HasParams to be faster.
16140 2004-12-02 Atsushi Enomoto <atsushi@ximian.com>
16142 all things are for /doc support:
16144 * doc.cs: new file that supports XML documentation generation.
16145 * mcs.exe.sources: added doc.cs.
16147 Handle /doc command line option.
16148 Report error 2006 instead of 5 for missing file name for /doc.
16149 Generate XML documentation when required, after type resolution.
16151 Added support for picking up documentation (/// and /** ... */),
16152 including a new XmlCommentState enumeration.
16154 Added lines to fill Documentation element for field, constant,
16155 property, indexer, method, constructor, destructor, operator, event
16156 and class, struct, interface, delegate, enum.
16157 Added lines to warn incorrect comment.
16159 Added Documentation field (passed only when /doc was specified).
16161 Added DocComment, DocCommentHeader, GenerateDocComment() and
16162 OnGenerateDocComment() and some supporting private members for
16163 /doc feature to MemberCore.
16165 Added GenerateDocComment() on TypeContainer, MethodCore and Operator.
16167 Added overriden DocCommentHeader.
16169 Added overriden DocCommentHeader and GenerateDocComment().
16171 2004-12-01 Miguel de Icaza <miguel@ximian.com>
16173 * cfold.cs (ConstantFold.DoConstantNumericPromotions): After
16174 unwrapping the enumeration values, chain to
16175 DoConstantNumericPromotions again, so we can promote things to the
16176 fundamental types (takes care of enums that are bytes, sbytes).
16180 2004-12-01 Raja R Harinath <rharinath@novell.com>
16182 * attribute.cs (Attribute.CheckAttributeType): Remove complain flag.
16183 Fix long-standing bug in type-lookup. Use FindType instead of
16184 LookupType when ec.ResolvingTypeTree.
16185 (Attribute.ResolveType, Attribute.Resolve)
16186 (Attribute.DefinePInvokeMethod,GlobalAttribute.CheckAttributeType):
16188 (Attributes.Search): Remove internal version. Update.
16189 (Attributes.SearchMulti): Update.
16190 (Attributes.GetClsCompliantAttribute): Remove.
16191 (Attributes.GetIndexerNameAttribute): Remove.
16192 * decl.cs (MemberCore.GetClsCompliantAttributeValue): Update to changes.
16193 (DeclSpace.GetClsCompliantAttributeValue): Likewise.
16194 * class.cs (Indexer.Define): Likewise.
16196 2004-12-01 Marek Safar <marek.safar@seznam.cz>
16199 * ecore.cs: CheckMarshallByRefAccess new virtual method for testing
16200 MarshallByReference members access.
16202 * expression.cs: Use CheckMarshallByRefAccess;
16203 Better error CS0197 message.
16205 * report.cs: Print whole related error message.
16207 2004-11-30 Raja R Harinath <rharinath@novell.com>
16209 * Makefile (mcs.exe) [PROFILE=default]: Keep a copy of mcs.exe in
16210 the current directory to help debugging.
16212 2004-11-29 Marek Safar <marek.safar@seznam.cz>
16214 * class (GetClassBases): Better error 60 report.
16215 (EventProperty): Disabled warning 67 detection.
16217 2004-11-29 Marek Safar <marek.safar@seznam.cz>
16220 * cfold.cs (Assign.DoResolve): Add subtraction for DecimalConstant.
16222 * constant.cs (DecimalConstant.Emit): Don't use int ctor for
16225 2004-11-29 Marek Safar <marek.safar@seznam.cz>
16228 * assign.cs (Assign.DoResolve): Add error 1648, 1650 report.
16230 * decl.cs (MemberCore.MemberName): Error 1648 in compiler.
16232 2004-11-26 Miguel de Icaza <miguel@ximian.com>
16234 * attribute.cs (Attribute.Resolve): Refine error reporting and
16235 report a cs0117 if the identifier does not exist, to distinguish
16236 from 0617 which is a miss-use of the actual identifier.
16238 * ecore.cs (EventExpr.Emit): Refine error report and distinguish
16239 between cs0070 and cs0079.
16241 * class.cs (MemberBase.DoDefine): When reporting a wrong
16242 accessibility level, we use MethodCore to compare instead of
16243 Method (this was a regression in some refactoring effort).
16245 So now we correctly report cs0056 again.
16247 * convert.cs (ImplicitReferenceConversion): Corrected typo, I was
16248 testing the target_type (which was known to be object_type) and
16249 not the source type (which is anonymous_method).
16251 Fixed reporting of error cs1660.
16253 * expression.cs (UserCast.Source): Expose the underlying cast.
16255 * statement.cs (Switch.SwitchGoverningType): Sort the list of
16256 allowed types to find a match to int32 first (most common).
16258 In addition, it ignores any ImplicitUserConversions that did an
16259 internal implicit conversion (as the switch statement allows only
16260 one integral conversion to exist).
16262 * class.cs (PartialContainer.Create): rename `name' to
16263 `member_name' for clarity. Then replace the string calls with a
16264 call to MemberName.GetPartialName, as now using
16265 MemberName.ToString is an error (this is due to the side effects
16266 it had, that were fixed in the past).
16268 This will restore the error reporting on a number of partial class
16269 errors that were missusing this (and getting an exception as a
16270 results, which is now just a plain textual warning, because
16271 yyparse debug output would crash otherwise).
16273 2004-11-26 Raja R Harinath <rharinath@novell.com>
16275 * Makefile (PROGRAM_INSTALL_DIR): Remove.
16277 2004-11-25 Ben Maurer <bmaurer@ximian.com>
16279 * rootcontext.cs (LookupType): Make sure to cache lookups that
16280 don't give us a negative result. This saves about 5% of corlib
16283 2004-11-25 Miguel de Icaza <miguel@ximian.com>
16285 * report.cs (AbstractMessage.Print): messages are sent to stderr
16287 * class.cs (TypeContainer.GetClassBases): It is an error to have a
16288 non-interface in the list of interfaces (at this point, either
16289 parent was properly set, or a base class is being listed in the
16290 interfaces section).
16292 This flags error 1722, and resolves the crash from bug 69259.
16294 2004-11-25 Ben Maurer <bmaurer@ximian.com>
16296 * statement.cs (Using.EmitExpressionFinally): make this work right
16297 for valuetypes. Fixes 69926.
16299 2004-11-25 Miguel de Icaza <miguel@ximian.com>
16301 * const.cs (Const.ChangeType): Cope with the "0 literal can be
16302 converted to an enum" here, before we try to change the underlying
16303 type. This code exists, but it is a different code path than the
16304 one used while encoding constants.
16306 * convert.cs (ImplicitReferenceConversionExists): A surprisingly
16307 old bug: when converting from the null literal to a pointer,
16308 return an EmptyCast, not the NullLiteral.
16310 This fixes #69921, the recent null_type changes probably made this
16311 bug more prominent.
16313 (ImplicitReferenceConversionExists): In addition, resynchronized
16314 the code here, so it matches the same code in
16315 ImplicitReferenceConversionExists for the `from any class-type S
16316 to any interface-type T'.
16319 2004-11-25 Marek Safar <marek.safar@seznam.cz>
16321 * cfold.cs (BinaryFold): Add addition for DecimalConstant.
16323 2004-11-24 Miguel de Icaza <miguel@ximian.com>
16325 * cs-parser.jay: Use verbosity accordingly.
16327 2004-11-24 Marek Safar <marek.safar@seznam.cz>
16329 * expression.cs (Unary.ResolveOperator): Do not report warning;
16330 AddressOf reads from variable.
16332 (LocalVariableReferences.DoResolveBase): Improved my previous fix.
16334 2004-11-24 Marek Safar <marek.safar@seznam.cz>
16338 * attribute.cs (Attributable): Removed CheckTargets.
16339 (Attributes.Emit): Explicit attribute targets are tested here.
16341 * class.cs (EventField.ValidAttributeTargets): Explicit target "field" is
16342 not enabled for interfaces.
16344 * codegen.cs (CommonAssemblyModulClass.AddAttributes): Removed CheckTargets.
16345 (GetAssemblyName): Ouch next bug there.
16347 2004-11-23 Carlos Alberto Cortez <calberto.cortez@gmail.com>
16349 * expression.cs: Error 275 added.
16351 2004-11-23 Marek Safar <marek.safar@seznam.cz>
16353 Fix bug #69177 (Implemented decimal constant support)
16355 * cfold.cs (DoConstantNumericPromotions: Add DecimalConstant.
16356 (BinaryFold): Add DecimalConstant.
16358 * const.cs (Define): Decimal constant
16360 (ChangeType): Add decimal type handling.
16361 (LookupConstantValue): Don't set value for decimal type but
16362 emit DecimalConstantAttribute. Needed for constant optimization.
16364 * constant.cs (ToDecimal): New method.
16365 (ConvertToDecimal): New method.
16366 (IntConstant): Implemented ConvertToDecimal.
16367 (DecimalConstant.Emit): Emit optimized version for decimals in
16370 * expression.cs (ResolveOperator): Changed order of constant
16371 reduction to work correctly with native types which have
16372 overloaded operators.
16373 (ResolveMemberAccess): Extract constant value from attribute
16376 * rootcontext.cs (ResolveCore): Add DecimalConstantAttribute.
16378 * typemanager.cs (TypeManager): Add decimal_constant_attribute_type,
16379 void_decimal_ctor_int_arg, decimal_constant_attribute_ctor.
16380 (ChangeType): Decimal is special.
16381 (TypeToCoreType): Add decimal type.
16383 2004-11-22 Marek Safar <marek.safar@seznam.cz>
16385 * convert.cs (ImplicitConversionRequired): Add error cs0642 for
16388 2004-11-22 Marek Safar <marek.safar@seznam.cz>
16390 * class.cs (EventField.ApplyAttributeBuilder): Fix error
16393 2004-11-19 Marek Safar <marek.safar@seznam.cz>
16395 * class.cs (MemberBase.DoDefine): Fix error cs0508 report.
16397 * pending.cs (PendingImplementation): Grab only interfaces.
16399 2004-11-19 Marek Safar <marek.safar@seznam.cz>
16401 * statement.cs (ForeachHelperMethods): Add location member and
16402 error 202 detection.
16404 2004-11-19 Raja R Harinath <rharinath@novell.com>
16406 * Makefile (EXTRA_DISTFILES): Remove mcs.exe.config. It's
16407 automatically handled by executable.make.
16408 (PROGRAM): Make profile-specific.
16410 2004-11-18 Marek Safar <marek.safar@seznam.cz>
16412 * expression.cs (DoResolveBase): Fixed wrong warning for out
16415 2004-11-18 Martin Baulig <martin@ximian.com>
16417 Merged latest changes into gmcs. Please keep this comment in
16418 here, it makes it easier for me to see what changed in MCS since
16419 the last time I merged.
16421 2004-11-17 Raja R Harinath <rharinath@novell.com>
16423 * typemanager.cs (TypeHandle.GetTypeHandle): Make private.
16424 (TypeHandle.GetMemberCache): New.
16425 (TypeHandle.TypeHandle): Update.
16426 (TypeManager.LookupMemberCache): Rewritten from LookupMemberContainer.
16427 (TypeManager.LookupParentInterfacesCache):
16428 Rename from LookupInterfaceCache. Optimize slightly.
16429 (TypeManager.MemberLookup_FindMembers): Update.
16430 * decl.cs (MemberCache.MemberCache): Set Container to null in the
16431 multi-type variant.
16432 (AddCacheContents): Rename from AddHashtable.
16433 * class.cs (TypeContainer.parent_container): Remove.
16434 (TypeContainer.VerifyClsCompliance): Don't use parent_container.
16435 (TypeContainer.DoDefineMembers): Don't initialize it.
16436 Update to name changes.
16438 2004-11-17 Miguel de Icaza <miguel@ximian.com>
16440 * class.cs (MethodCore.CheckAccessModifiers): New helper routine
16441 that factors the code to check access modifiers on override.
16443 (PropertyBase): Use the code here.
16445 Patch from Lluis S'anchez, fixes bug #69361.
16447 2004-11-15 Miguel de Icaza <miguel@ximian.com>
16449 * anonymous.cs (AnonymousMethod.Error_AddressOfCapturedVar): New
16450 routine that is used to report the use of a captured variable
16451 whose address has been taken.
16453 There are two checks: one when variables are being captured and
16454 the other check is when the address of a variable is taken.
16456 (because an anonymous methods might be resolved before *or* after
16457 the address has been taken) and
16459 * expression.cs (Conditional.DoResolve): Remove the special
16460 casing that Martin added to trueExpr and falseExpr being both
16461 NullLiteral. We get the right behavior now just by introducing
16462 the null_type into the compiler.
16464 * convert.cs (ExplicitConversion): Change the code to use
16465 null_type instead of testing `expr is NullLiteral'.
16466 (ImplicitConversionStandard): use null_type too.
16467 (ImplicitReferenceConversionExists): use null_type too.
16468 (ImplicitReferenceConversion): use null_type too.
16470 * literal.cs: The type of `NullLiteral' is now null_type instead
16472 (Resolve): Set the type here.
16474 * typemanager.cs: Introduce null_type.
16476 2004-11-17 Martin Baulig <martin@ximian.com>
16478 * decl.cs (MemberCache.AddHashtable): Add entries in the opposite
16479 direction, like FindMembers() does. Fixes #69546, testcase is in
16482 2004-11-16 Martin Baulig <martin@ximian.com>
16484 This is based on a patch from Marek Safar, see bug #69082.
16485 Fixes bugs #63705 and #67130.
16487 * typemanager.cs (TypeManager.LookupInterfaceCache): New public
16488 method; create a MemberCache for an interface type and cache the
16491 * decl.cs (IMemberContainer.ParentContainer): Removed.
16492 (IMemberContainer.ParentCache): New property.
16493 (MemberCache.SetupCacheForInterface): Removed.
16494 (MemberCache..ctor): Added .ctor which takes a `Type[]'; use this
16495 to create a cache for an interface's "parent".
16497 * class.cs (TypeContainer.DoDefineMembers): Setup cache for
16500 2004-11-16 Martin Baulig <martin@ximian.com>
16502 Merged back from gmcs; these changes already went into gmcs a
16503 couple of weeks ago.
16506 (TypeManager.AddUserType): Removed the `ifaces' argument.
16507 (TypeManager.RegisterBuilder): Take a `Type []' instead of a
16509 (TypeManager.AddUserInterface): Removed.
16510 (TypeManager.ExpandInterfaces): Return a `Type []' instead of a
16512 (TypeManager.GetInterfaces): Likewise.
16513 (TypeManager.GetExplicitInterfaces): Likewise.
16515 * ecore.cs (TypeExpr.GetInterfaces): Removed.
16517 * class.cs (TypeContainer.base_class_type): Replaced with `ptype'.
16518 (TypeContainer.base_inteface_types): Replaced with `ifaces'.
16520 2004-11-14 Ben Maurer <bmaurer@ximian.com>
16522 * statement.cs: Avoid adding bools to a hashtable.
16524 2004-11-07 Miguel de Icaza <miguel@ximian.com>
16526 * expression.cs (Invocation.OverloadResolve): Flag error if we are
16527 calling an unsafe method from a safe location.
16529 2004-11-06 Marek Safar <marek.safar@seznam.cz>
16532 * codegen.cs (ApplyAttributeBuilder): Do not return; it is only warning.
16534 2004-11-06 Miguel de Icaza <miguel@ximian.com>
16536 * namespace.cs (VerifyUsing): use GetPartialName instead of
16539 2004-11-05 Miguel de Icaza <miguel@ximian.com>
16541 * statement.cs (Return.Resolve): Fix regression in typo: if
16542 `in_exc', we have to request a NeedReturnLabel, this was a typo
16543 introduced in the anonymous method check-in. Fixes #69131.
16545 * Indexers were using the ShortName when defining themselves,
16546 causing a regression in the compiler bootstrap when applying the
16547 patch from 2004-11-02 (first part), now they use their full name
16548 and the bug is gone.
16550 2004-11-04 Zoltan Varga <vargaz@freemail.hu>
16552 * driver.cs: Strip the path from the names of embedded resources. Fixes
16555 2004-11-04 Raja R Harinath <rharinath@novell.com>
16557 Fix error message regression: cs0104-2.cs.
16558 * namespace.cs (NamespaceEntry.Lookup): Remove 'silent' flag.
16559 (AliasEntry.Resolve): Update.
16560 * rootcontext.cs (RootContext.NamespaceLookup): Update. Remove
16562 (RootContext.LookupType): Update.
16564 2004-11-03 Carlos Alberto Cortez <carlos@unixmexico.org>
16566 * cs-parser.jay: Add support for handling accessor modifiers
16567 * class: Add support port accessor modifiers and error checking,
16568 define PropertyMethod.Define as virtual (not abstract anymore)
16569 * ecore.cs: Add checking for proeprties access with access modifiers
16570 * iterators.cs: Modify Accessor constructor call based in the modified
16572 2004-11-02 Ben Maurer <bmaurer@ximian.com>
16574 * expression.cs (StringConcat): Handle being called twice,
16575 as when we have a concat in a field init with more than two
16578 2004-11-02 Miguel de Icaza <miguel@ximian.com>
16580 * class.cs (Event.Define, Indexer.Define, Property.Define): Do not
16581 special case explicit implementations, we should always produce
16582 the .property or .event declaration.
16584 * decl.cs (MemberName): Renamed GetFullName to GetPartialName
16585 since it will not return correct data if people use this
16586 unresolved in the presence of using statements (see test-313).
16588 * class.cs (MethodData.Define): If we are an explicit interface
16589 implementation, set the method name to the full name of the
16590 interface plus the name of the method.
16592 Notice that using the method.MethodName.GetFullName() does not
16593 work, as it will only contain the name as declared on the source
16594 file (it can be a shorthand in the presence of using statements)
16595 and not the fully qualifed type name, for example:
16599 class D : ICloneable {
16600 object ICloneable.Clone () {
16604 Would produce a method called `ICloneable.Clone' instead of
16605 `System.ICloneable.Clone'.
16607 * namespace.cs (Alias.Resolve): Use GetPartialName.
16609 2004-11-01 Marek Safar <marek.safar@seznam.cz>
16611 * cs-parser.jay: Add error 1055 report.
16613 2004-11-01 Miguel de Icaza <miguel@ximian.com>
16615 * assign.cs (Assign.DoResolve): Only do the transform of
16616 assignment into a New if the types are compatible, if not, fall
16617 through and let the implicit code deal with the errors and with
16618 the necessary conversions.
16620 2004-11-01 Marek Safar <marek.safar@seznam.cz>
16622 * cs-parser.jay: Add error 1031 report.
16624 * cs-tokenizer.cs: Add location for error 1038.
16626 2004-10-31 Marek Safar <marek.safar@seznam.cz>
16628 * cs-parser.jay: Add error 1016 report.
16630 2004-10-31 Marek Safar <marek.safar@seznam.cz>
16632 * cs-parser.jay: Add errors 1575,1611 report.
16634 2004-10-31 Marek Safar <marek.safar@seznam.cz>
16636 * cs-parser.jay: Add error 1001 report.
16638 2004-10-31 Marek Safar <marek.safar@seznam.cz>
16641 * attribute.cs (GetMarshal): Add method argument for
16642 caller identification.
16644 * class.cs, codegen.cs, enum.cs, parameter.cs: Added
16645 agument for GetMarshal and RuntimeMissingSupport.
16647 2004-10-31 Marek Safar <marek.safar@seznam.cz>
16649 * attribute.cs (ExtractSecurityPermissionSet): Removed
16650 TypeManager.code_access_permission_type.
16652 * typemanager.cs: Removed TypeManager.code_access_permission_type.
16654 2004-10-27 Miguel de Icaza <miguel@ximian.com>
16656 * expression.cs (LocalVariableReference.DoResolveLValue): Check
16657 for obsolete use of a variable here. Fixes regression on errors
16658 cs0619-25 and cs0619-26.
16660 2004-10-27 Marek Safar <marek.safar@seznam.cz>
16662 Fix #62358, implemented security attribute encoding.
16664 * attribute.cs (Attribute.CheckSecurityActionValididy): New method.
16665 Tests permitted SecurityAction for assembly or other types.
16666 (Assembly.ExtractSecurityPermissionSet): New method. Transforms
16667 data from SecurityPermissionAttribute to PermisionSet class.
16669 * class.cs (ApplyAttributeBuilder): Added special handling
16670 for System.Security.Permissions.SecurityAttribute based types.
16672 * codegen.cs (AssemblyClass.ApplyAttributeBuilder): Added
16673 special handling for System.Security.Permissions.SecurityAttribute
16676 * enum.cs (ApplyAttributeBuilder): Added special handling
16677 for System.Security.Permissions.SecurityAttribute based types.
16679 * parameter.cs (ApplyAttributeBuilder): Added special handling
16680 for System.Security.Permissions.SecurityAttribute based types.
16682 * rootcontext.cs: Next 2 core types.
16684 * typemanager.cs (TypeManager.security_permission_attr_type):
16685 Built in type for the SecurityPermission Attribute.
16686 (code_access_permission_type): Build in type.
16688 2004-10-17 Miguel de Icaza <miguel@ximian.com>
16690 * expression.cs (LocalVariableReference.DoResolveBase, Emit):
16691 Remove the tests for `ec.RemapToProxy' from here, and encapsulate
16692 all of this information into
16693 EmitContext.EmitCapturedVariableInstance.
16695 * codegen.cs (EmitCapturedVariableInstance): move here the
16696 funcionality of emitting an ldarg.0 in the presence of a
16697 remapping. This centralizes the instance emit code.
16699 (EmitContext.EmitThis): If the ScopeInfo contains a THIS field,
16700 then emit a load of this: it means that we have reached the
16701 topmost ScopeInfo: the one that contains the pointer to the
16702 instance of the class hosting the anonymous method.
16704 * anonymous.cs (AddField, HaveCapturedFields): Propagate field
16705 captures to the topmost CaptureContext.
16707 2004-10-12 Miguel de Icaza <miguel@ximian.com>
16709 * expression.cs (LocalVariableReference): Move the knowledge about
16710 the iterators into codegen's EmitCapturedVariableInstance.
16712 2004-10-11 Miguel de Icaza <miguel@ximian.com>
16714 * codegen.cs (EmitContext.ResolveTopBlock): Emit a 1643 when not
16715 all code paths return a value from an anonymous method (it is the
16716 same as the 161 error, but for anonymous methods).
16718 2004-10-08 Miguel de Icaza <miguel@ximian.com>
16720 The introduction of anonymous methods in the compiler changed
16721 various ways of doing things in the compiler. The most
16722 significant one is the hard split between the resolution phase
16723 and the emission phases of the compiler.
16725 For instance, routines that referenced local variables no
16726 longer can safely create temporary variables during the
16727 resolution phase: they must do so from the emission phase,
16728 since the variable might have been "captured", hence access to
16729 it can not be done with the local-variable operations from the runtime.
16733 (Block.Flags): New flag `IsTopLevel' to indicate that this block
16734 is a toplevel block.
16736 (ToplevelBlock): A new kind of Block, these are the blocks that
16737 are created by the parser for all toplevel method bodies. These
16738 include methods, accessors and anonymous methods.
16740 These contain some extra information not found in regular blocks:
16741 A pointer to an optional CaptureContext (for tracking captured
16742 local variables and parameters). A pointer to the parent
16745 (Return.Resolve): Catch missmatches when returning a value from an
16746 anonymous method (error 1662).
16747 Invoke NeedReturnLabel from the Resolve phase instead of the emit
16750 (Break.Resolve): ditto.
16752 (SwitchLabel): instead of defining the labels during the
16753 resolution phase, we now turned the public ILLabel and ILLabelCode
16754 labels into methods called GetILLabelCode() and GetILLabel() that
16755 only define the label during the Emit phase.
16757 (GotoCase): Track the SwitchLabel instead of the computed label
16758 (its contained therein). Emit the code by using
16759 SwitchLabel.GetILLabelCode ().
16761 (LocalInfo.Flags.Captured): A new flag has been introduce to track
16762 whether the Local has been captured or not.
16764 (LocalInfo.IsCaptured): New property, used to tell whether the
16765 local has been captured.
16767 * anonymous.cs: Vastly updated to contain the anonymous method
16770 The main classes here are: CaptureContext which tracks any
16771 captured information for a toplevel block and ScopeInfo used to
16772 track the activation frames for various local variables.
16774 Each toplevel block has an optional capture context associated
16775 with it. When a method contains an anonymous method both the
16776 toplevel method and the anonymous method will create a capture
16777 context. When variables or parameters are captured, they are
16778 recorded on the CaptureContext that owns them, for example:
16782 MyDelegate d = delegate {
16787 Here `a' will be recorded as captured on the toplevel
16788 CapturedContext, the inner captured context will not have anything
16789 (it will only have data if local variables or parameters from it
16790 are captured in a nested anonymous method.
16792 The ScopeInfo is used to track the activation frames for local
16793 variables, for example:
16795 for (int i = 0; i < 10; i++)
16796 for (int j = 0; j < 10; j++){
16797 MyDelegate d = delegate {
16802 At runtime this captures a single captured variable `i', but it
16803 captures 10 different versions of the variable `j'. The variable
16804 `i' will be recorded on the toplevel ScopeInfo, while `j' will be
16805 recorded on a child.
16807 The toplevel ScopeInfo will also track information like the `this'
16808 pointer if instance variables were referenced (this is necessary
16809 as the anonymous method lives inside a nested class in the host
16810 type of the method).
16812 (AnonymousMethod): Expanded to track the Toplevel, implement
16813 `AnonymousMethod.Compatible' to tell whether an anonymous method
16814 can be converted to a target delegate type.
16816 The routine now also produces the anonymous method content
16818 (AnonymousDelegate): A helper class that derives from
16819 DelegateCreation, this is used to generate the code necessary to
16820 produce the delegate for the anonymous method that was created.
16822 * assign.cs: API adjustments for new changes in
16823 Convert.ImplicitStandardConversionExists.
16825 * class.cs: Adjustments to cope with the fact that now toplevel
16826 blocks are of type `ToplevelBlock'.
16828 * cs-parser.jay: Now we produce ToplevelBlocks for toplevel blocks
16829 insteda of standard blocks.
16831 Flag errors if params arguments are passed to anonymous methods.
16833 * codegen.cs (EmitContext): Replace `InAnonymousMethod' with
16834 `CurrentAnonymousMethod' which points to the current Anonymous
16835 Method. The variable points to the AnonymousMethod class that
16836 holds the code being compiled. It is set in the new EmitContext
16837 created for the anonymous method.
16839 (EmitContext.Phase): Introduce a variable and an enumeration to
16840 assist in enforcing some rules about when and where we are allowed
16841 to invoke certain methods (EmitContext.NeedsReturnLabel is the
16842 only one that enfonces this right now).
16844 (EmitContext.HaveCaptureInfo): new helper method that returns
16845 whether we have a CapturedContext initialized.
16847 (EmitContext.CaptureVariable): New method used to register that a
16848 LocalInfo must be flagged for capturing.
16850 (EmitContext.CapturedParameter): New method used to register that a
16851 parameters must be flagged for capturing.
16853 (EmitContext.CapturedField): New method used to register that a
16854 field must be flagged for capturing.
16856 (EmitContext.HaveCapturedVariables,
16857 EmitContext.HaveCapturedFields): Return whether there are captured
16858 variables or fields.
16860 (EmitContext.EmitMethodHostInstance): This is used to emit the
16861 instance for the anonymous method. The instance might be null
16862 (static methods), this (for anonymous methods that capture nothing
16863 and happen to live side-by-side with the current method body) or a
16864 more complicated expression if the method has a CaptureContext.
16866 (EmitContext.EmitTopBlock): Routine that drives the emission of
16867 code: it will first resolve the top block, then emit any metadata
16868 and then emit the code. The split is done so that we can extract
16869 any anonymous methods and flag any captured variables/parameters.
16871 (EmitContext.ResolveTopBlock): Triggers the resolution phase,
16872 during this phase, the ILGenerator should not be used as labels
16873 and local variables declared here might not be accessible to any
16874 code that is part of an anonymous method.
16876 Exceptions to this include the temporary variables that are
16877 created by some statements internally for holding temporary
16880 (EmitContext.EmitMeta): New routine, in charge of emitting all the
16883 (EmitContext.TemporaryReturn): This method is typically called
16884 from the Emit phase, and its the only place where we allow the
16885 ReturnLabel to be defined other than the EmitMeta. The reason is
16886 that otherwise we would have to duplicate a lot of logic in the
16887 Resolve phases of various methods that today is on the Emit
16890 (EmitContext.NeedReturnLabel): This no longer creates the label,
16891 as the ILGenerator is not valid during the resolve phase.
16893 (EmitContext.EmitThis): Extended the knowledge in this class to
16894 work in anonymous methods in addition to iterators.
16896 (EmitContext.EmitCapturedVariableInstance): This emits whatever
16897 code is necessary on the stack to access the instance to a local
16898 variable (the variable will be accessed as a field).
16900 (EmitContext.EmitParameter, EmitContext.EmitAssignParameter,
16901 EmitContext.EmitAddressOfParameter): Routines to support
16902 parameters (not completed at this point).
16904 Removals: Removed RemapLocal and RemapLocalLValue. We probably
16905 will also remove the parameters.
16907 * convert.cs (Convert): Define a `ConstantEC' which points to a
16908 null. This is just to prefity some code that uses
16909 ImplicitStandardConversion code and do not have an EmitContext
16912 The idea is to flag explicitly that at that point in time, it is
16913 known that the conversion will not trigger the delegate checking
16914 code in implicit conversions (which requires a valid
16917 Everywhere: pass new EmitContext parameter since
16918 ImplicitStandardConversionExists now requires it to check for
16919 anonymous method conversions.
16921 (Convert.ImplicitStandardConversionExists): If the type of an
16922 expression is the anonymous_method_type, and the type is a
16923 delegate, we invoke the AnonymousMethod.Compatible method to check
16924 whether an implicit conversion is possible.
16926 (Convert.ImplicitConversionStandard): Only do implicit method
16927 group conversions if the language level is not ISO_1.
16929 * delegate.cs (Delegate.GetInvokeMethod): Common method to get the
16930 MethodInfo for the Invoke method. used by Delegate and
16933 * expression.cs (Binary.DoNumericPromotions): only allow anonymous
16934 method conversions if the target type is a delegate.
16936 Removed extra debugging nops.
16938 (LocalVariableReference): Turn the `local_info' into a public
16941 Add `prepared' field, the same hack used for FieldExprs to cope
16942 with composed assignments, as Local variables do not necessarily
16943 operate purely on the stack as they used to: they can be captured
16946 Add `temp' for a temporary result, like fields.
16948 Refactor DoResolve and DoResolveLValue into DoResolveBase.
16950 It now copes with Local variables that are captured and emits the
16951 proper instance variable to load it from a field in the captured
16954 (ParameterReference.DoResolveBase): During the resolve phase,
16955 capture parameters if we are in an anonymous method.
16957 (ParameterReference.Emit, ParameterReference.AddressOf): If in an
16958 anonymous method, use the EmitContext helper routines to emit the
16959 parameter reference.
16961 * iterators.cs: Set RemapToProxy to true/false during the
16964 * parameters.cs (GetParameterByName): New helper method.
16966 * typemanager.cs (anonymous_method_type) a new type that
16967 represents an anonyous method. This is always an internal type,
16968 used as a fencepost to test against the anonymous-methodness of an
16971 2004-10-20 Marek Safar <marek.safar@seznam.cz>
16973 * class.cs (MethodCore.CheckBase): Add errors 505, 533, 544,
16975 (PropertyBase.FindOutParentMethod): Add errors 545, 546 report.
16977 2004-10-18 Martin Baulig <martin@ximian.com>
16979 * statement.cs (Fixed.Resolve): Don't access the TypeExpr's
16980 `Type' directly, but call ResolveType() on it.
16981 (Catch.Resolve): Likewise.
16982 (Foreach.Resolve): Likewise.
16984 2004-10-18 Martin Baulig <martin@ximian.com>
16986 * expression.cs (Cast.DoResolve): Don't access the TypeExpr's
16987 `Type' directly, but call ResolveType() on it.
16988 (Probe.DoResolve): Likewise.
16989 (ArrayCreation.LookupType): Likewise.
16990 (TypeOf.DoResolve): Likewise.
16991 (SizeOf.DoResolve): Likewise.
16993 2004-10-18 Martin Baulig <martin@ximian.com>
16995 * expression.cs (Invocation.BetterFunction): Put back
16996 TypeManager.TypeToCoreType().
16998 2004-10-18 Raja R Harinath <rharinath@novell.com>
17000 * class.cs (FieldMember.DoDefine): Reset ec.InUnsafe after doing
17003 2004-10-18 Martin Baulig <martin@ximian.com>
17005 * parameter.cs (Parameter.Resolve): Don't access the TypeExpr's
17006 `Type' directly, but call ResolveType() on it.
17008 2004-10-18 Martin Baulig <martin@ximian.com>
17010 * class.cs (FieldMember.Define): Don't access the TypeExpr's
17011 `Type' directly, but call ResolveType() on it.
17012 (MemberBase.DoDefine): Likewise.
17014 * expression.cs (New.DoResolve): Don't access the TypeExpr's
17015 `Type' directly, but call ResolveType() on it.
17016 (ComposedCast.DoResolveAsTypeStep): Likewise.
17018 * statement.cs (LocalInfo.Resolve): Don't access the TypeExpr's
17019 `Type' directly, but call ResolveType() on it.
17021 2004-10-17 John Luke <john.luke@gmail.com>
17023 * class.cs (Operator.GetSignatureForError): use CSharpName
17025 * parameter.cs (Parameter.GetSignatureForError): Returns
17026 correct name even if was not defined.
17028 2004-10-13 Raja R Harinath <rharinath@novell.com>
17031 * class.cs (TypeContainer.EmitContext): New property.
17032 (DefineNestedTypes): Create an emitcontext for each part.
17033 (MethodCore.DoDefineParameters): Use container's emitcontext.
17034 Pass type array to InternalParameters.
17035 (MemberBase.DoDefine): Use container's emitcontext.
17036 (FieldMember.Define): Likewise.
17037 (Event.Define): Likewise.
17038 (SetMethod.GetParameterInfo): Change argument to EmitContext.
17039 Pass type array to InternalParameters.
17040 (SetIndexerMethod.GetParameterInfo): Likewise.
17041 (SetMethod.Define): Pass emitcontext to GetParameterInfo.
17042 * delegate.cs (Define): Pass emitcontext to
17043 ComputeAndDefineParameterTypes and GetParameterInfo. Pass type
17044 array to InternalParameters.
17045 * expression.cs (ParameterReference.DoResolveBase): Pass
17046 emitcontext to GetParameterInfo.
17047 (ComposedCast.DoResolveAsTypeStep): Remove check on
17048 ec.ResolvingTypeTree.
17049 * parameter.cs (Parameter.Resolve): Change argument to
17050 EmitContext. Use ResolveAsTypeTerminal.
17051 (Parameter.GetSignature): Change argument to EmitContext.
17052 (Parameters.ComputeSignature): Likewise.
17053 (Parameters.ComputeParameterTypes): Likewise.
17054 (Parameters.GetParameterInfo): Likewise.
17055 (Parameters.ComputeAndDefineParameterTypes): Likewise.
17056 Re-use ComputeParameterTypes. Set ec.ResolvingTypeTree.
17057 * support.cs (InternalParameters..ctor): Remove variant that takes
17059 * typemanager.cs (system_intptr_expr): New.
17060 (InitExpressionTypes): Initialize it.
17062 2004-10-12 Chris Toshok <toshok@ximian.com>
17064 * cs-parser.jay: fix location for try_statement and catch_clause.
17066 2004-10-11 Martin Baulig <martin@ximian.com>
17068 * report.cs: Don't make --fatal abort on warnings, we have
17069 -warnaserror for that.
17071 2004-10-07 Raja R Harinath <rharinath@novell.com>
17073 More DeclSpace.ResolveType avoidance.
17074 * decl.cs (MemberCore.InUnsafe): New property.
17075 * class.cs (MemberBase.DoDefine): Use ResolveAsTypeTerminal
17076 with newly created EmitContext.
17077 (FieldMember.Define): Likewise.
17078 * delegate.cs (Delegate.Define): Likewise.
17079 * ecore.cs (SimpleName.ResolveAsTypeStep): Lookup with alias
17080 only if normal name-lookup fails.
17081 (TypeExpr.DoResolve): Enable error-checking.
17082 * expression.cs (ArrayCreation.DoResolve): Use ResolveAsTypeTerminal.
17083 (SizeOf.DoResolve): Likewise.
17084 (ComposedCast.DoResolveAsTypeStep): Likewise.
17085 (StackAlloc.DoResolve): Likewise.
17086 * statement.cs (Block.Flags): Add new flag 'Unsafe'.
17087 (Block.Unsafe): New property.
17088 (Block.EmitMeta): Set ec.InUnsafe as appropriate.
17089 (Unsafe): Set 'unsafe' flag of contained block.
17090 (LocalInfo.Resolve): Use ResolveAsTypeTerminal.
17091 (Fixed.Resolve): Likewise.
17092 (Catch.Resolve): Likewise.
17093 (Using.ResolveLocalVariableDecls): Likewise.
17094 (Foreach.Resolve): Likewise.
17096 2004-10-05 John Luke <john.luke@gmail.com>
17098 * cs-parser.jay: add location to error CS0175
17100 2004-10-04 Miguel de Icaza <miguel@ximian.com>
17102 * ecore.cs (Expression.Constantity): Add support for turning null
17105 * const.cs (Const.Define): Allow constants to be reference types
17106 as long as the value is Null.
17108 2004-10-04 Juraj Skripsky <js@hotfeet.ch>
17110 * namespace.cs (NamespaceEntry.Using): No matter which warning
17111 level is set, check if this namespace name has already been added.
17113 2004-10-03 Ben Maurer <bmaurer@ximian.com>
17115 * expression.cs: reftype [!=]= null should always use br[true,false].
17118 2004-10-03 Marek Safar <marek.safar@seznam.cz>
17121 * attribute.cs: Enum conversion moved to
17122 GetAttributeArgumentExpression to be applied to the all
17125 2004-10-01 Raja R Harinath <rharinath@novell.com>
17127 Fix #65833, test-300.cs, cs0122-5.cs, cs0122-6.cs.
17128 * class.c (TypeContainer.DefineType): Flag error if
17129 base types aren't accessible due to access permissions.
17130 * decl.cs (DeclSpace.ResolveType): Move logic to
17131 Expression.ResolveAsTypeTerminal.
17132 (DeclSpace.ResolveTypeExpr): Thin layer over
17133 Expression.ResolveAsTypeTerminal.
17134 (DeclSpace.CheckAccessLevel, DeclSpace.FamilyAccess):
17135 Refactor code into NestedAccess. Use it.
17136 (DeclSpace.NestedAccess): New.
17137 * ecore.cs (Expression.ResolveAsTypeTerminal): Add new
17138 argument to silence errors. Check access permissions.
17139 (TypeExpr.DoResolve, TypeExpr.ResolveType): Update.
17140 * expression.cs (ProbeExpr.DoResolve): Use ResolveAsTypeTerminal.
17141 (Cast.DoResolve): Likewise.
17142 (New.DoResolve): Likewise.
17143 (InvocationOrCast.DoResolve,ResolveStatement): Likewise.
17144 (TypeOf.DoResolve): Likewise.
17146 * expression.cs (Invocation.BetterConversion): Return the Type of
17147 the better conversion. Implement section 14.4.2.3 more faithfully.
17148 (Invocation.BetterFunction): Make boolean. Make correspondence to
17149 section 14.4.2.2 explicit.
17150 (Invocation.OverloadResolve): Update.
17151 (Invocation): Remove is_base field.
17152 (Invocation.DoResolve): Don't use is_base. Use mg.IsBase.
17153 (Invocation.Emit): Likewise.
17155 2004-09-27 Raja R Harinath <rharinath@novell.com>
17157 * README: Update to changes.
17159 2004-09-24 Marek Safar <marek.safar@seznam.cz>
17161 * cs-parser.jay: Reverted 642 warning fix.
17163 2004-09-23 Marek Safar <marek.safar@seznam.cz>
17166 * decl.cs (FindMemberWithSameName): Indexer can have more than
17169 2004-09-23 Marek Safar <marek.safar@seznam.cz>
17171 * expression.cs (LocalVariableReference.DoResolveLValue):
17172 Do not report warning 219 for out values.
17173 (EmptyExpression.Null): New member to avoid extra allocations.
17175 2004-09-23 Marek Safar <marek.safar@seznam.cz>
17177 * cs-parser.jay: Fix wrong warning 642 report.
17179 * cs-tokenizer.cs (CheckNextToken): New helper;
17180 Inspect next character if is same as expected.
17182 2004-09-23 Martin Baulig <martin@ximian.com>
17184 * convert.cs (Convert.ImplicitReferenceConversion): Some code cleanup.
17185 (Convert.ImplicitReferenceConversionExists): Likewise.
17187 2004-09-23 Marek Safar <marek.safar@seznam.cz>
17189 * class.cs (Operator.Define): Add error 448 and 559 report.
17191 2004-09-22 Marek Safar <marek.safar@seznam.cz>
17193 * class.cs (MemberBase.IsTypePermitted): New protected
17194 method for checking error CS0610.
17196 2004-09-22 Marek Safar <marek.safar@seznam.cz>
17198 * class.cs (TypeContainer.HasExplicitLayout): New property
17199 Returns whether container has StructLayout attribute set Explicit.
17200 (FieldMember): New abstract class for consts and fields.
17201 (FieldMember.ApplyAttributeBuilder): Add error 636 and 637 report.
17202 (Field): Reuse FieldMember.
17204 * const.cs (Const): Reuse FieldMember.
17206 * rootcontext.cs: EmitConstants call moved to class.
17208 2004-09-22 Martin Baulig <martin@ximian.com>
17210 Thanks to Peter Sestoft for this bug report.
17212 * expression.cs (Conditional): If both the `trueExpr' and the
17213 `falseExpr' is a NullLiteral, return a NullLiteral.
17215 2004-09-22 Martin Baulig <martin@ximian.com>
17217 * statement.cs (Foreach.EmitCollectionForeach): If we're in an
17218 iterator, use `enumerator.EmitThis()' instead of `ec.EmitThis()'
17219 for the "get_Current" call.
17221 2004-09-22 Martin Baulig <martin@ximian.com>
17223 Marek and me just fixed one of our oldest bugs: #28562 :-)
17225 * ecore.cs (EnumConstant.GetValueAsEnumType): New public method.
17227 * attribute.cs (Attribute.GetAttributeArgumentExpression): If
17228 we're an EnumConstant, just return that.
17229 (Attribute.Resolve): GetAttributeArgumentExpression() may give us
17230 an EnumConstant. In this case, we need to use GetValueAsEnumType()
17231 to get the value which'll actually be written into the attribute.
17232 However, we have to use GetValue() to access the attribute's value
17235 2004-09-22 Marek Safar <marek.safar@seznam.cz>
17237 * constant.cs (Constant.IsNegative): New abstract property
17240 * expression.cs (ArrayAccess.DoResolve): Add warning 251.
17241 (StackAlloc.DoResolve): Reused IsNegative.
17243 2004-09-21 Martin Baulig <martin@ximian.com>
17245 * codegen.cs (VariableStorage): Don't store the ILGenerator here;
17246 if we're used in an iterator, we may be called from different
17249 * statement.cs (Foreach.EmitFinally): Only emit an `Endfinally' if
17250 we actually have an exception block.
17252 2004-09-20 John Luke <jluke@cfl.rr.com>
17254 * class.cs, cs-parser.jay: Improve the error report for 1520:
17255 report the actual line where the error happens, not where the
17256 class was declared.
17258 * assign.cs, delegate.cs, ecore.cs, expression.cs, statement.cs:
17259 Pass location information that was available elsewhere.
17261 2004-09-19 Sebastien Pouliot <sebastien@ximian.com>
17263 * codegen.cs: Fix bug #56621. It is now possible to use MCS on the MS
17264 runtime to delay sign assemblies.
17266 2004-09-19 Miguel de Icaza <miguel@ximian.com>
17268 * cs-parser.jay: Do not report the stack trace, this is barely
17271 2004-08-22 John Luke <john.luke@gmail.com>
17273 * driver.cs : check that a resource id is not already used
17274 before adding it, report CS1508 if it is, bug #63637
17276 2004-09-19 Miguel de Icaza <miguel@ximian.com>
17278 * ecore.cs: Removed dead code.
17280 2004-09-18 Marek Safar <marek.safar@seznam.cz>
17282 * class.cs: Do not report warning CS0067 on the interfaces.
17284 2004-09-16 Marek Safar <marek.safar@seznam.cz>
17286 * cs-parser.jay: Add error 504 report.
17288 2004-09-16 Marek Safar <marek.safar@seznam.cz>
17290 * rootcontext.cs: WarningLevel is 4 by default now.
17292 * statement.cs (Fixed.Resolve): Do not null
17295 2004-09-16 Marek Safar <marek.safar@seznam.cz>
17298 * ecore.cs (PropertyExpr.FindAccessors): Do not perform
17299 deep search when property is not virtual.
17300 (PropertyExpr.ResolveAccessors): Make one call for both
17303 2004-09-15 Marek Safar <marek.safar@seznam.cz>
17306 * statement.cs: Error 152 report constains also location.
17308 2004-09-15 Marek Safar <marek.safar@seznam.cz>
17311 * const.cs: Explicitly set constant as static.
17313 2004-09-15 Marek Safar <marek.safar@seznam.cz>
17316 * cs-parser.jay: Add error 1017 report.
17318 2004-09-15 Marek Safar <marek.safar@seznam.cz>
17320 Fixed bug #59980, #64224
17321 * expression.cs (Invocation.DoResolve): Fixed error CS0571 test.
17323 * typemanager.cs (IsSpecialMethod): Simplified
17325 2004-09-14 Marek Safar <marek.safar@seznam.cz>
17327 * decl.cs (MemberCore.Emit): Resuscitated VerifyObsoleteAttribute
17328 condition with better params.
17330 2004-09-14 Marek Safar <marek.safar@seznam.cz>
17333 * attribute.cs (Resolve): Property has to have both
17336 2004-09-14 Martin Baulig <martin@ximian.com>
17338 * decl.cs (MemberCore.Emit): Always call VerifyObsoleteAttribute().
17340 2004-09-14 Marek Safar <marek.safar@seznam.cz>
17343 * codegen.cs (TestObsoleteMethodUsage): Trace when method is
17344 called and is obsolete then this member suppress message
17345 when call is inside next [Obsolete] method or type.
17347 * expression.cs: Use TestObsoleteMethodUsage member.
17349 2004-09-14 Martin Baulig <martin@ximian.com>
17351 * cs-parser.jay: Sync a bit with the GMCS version.
17353 2004-09-14 Martin Baulig <martin@ximian.com>
17355 * cs-parser.jay (CSharpParser): Don't derive from GenericsParser.
17356 (CSharpParser.yacc_verbose_flag): New public field.
17358 * genericparser.cs: Removed.
17360 2004-09-14 Raja R Harinath <rharinath@novell.com>
17362 * cs-parser.jay (event_declaration): Re-enable cs0071 error.
17364 2004-09-13 Marek Safar <marek.safar@seznam.cz>
17366 * class.cs (MethodCore.CheckBase): Fix bug #65757.
17368 2004-09-10 Martin Baulig <martin@ximian.com>
17370 Backported my MemberName changes from GMCS into MCS.
17372 - we are now using a special `MemberName' class instead of using
17373 strings; in GMCS, the `MemberName' also contains the type
17376 - changed the grammar rules a bit:
17377 * the old `member_name' is now a `namespace_or_type_name':
17378 The rule is that we use `namespace_or_type_name' everywhere
17379 where we expect either a "member name" (GetEnumerator) or a
17380 "member name" with an explicit interface name
17381 (IEnumerable.GetEnumerator).
17382 In GMCS, the explicit interface name may include type arguments
17383 (IEnumerable<T>.GetEnumerator).
17384 * we use `member_name' instead of just `IDENTIFIER' for
17386 The rule is that we use `member_name' wherever a member may
17387 have type parameters in GMCS.
17389 * decl.cs (MemberName): New public class.
17390 (MemberCore.MemberName): New public readonly field.
17391 (MemberCore.ctor): Take a `MemberName' argument, not a string.
17392 (DeclSpace): Likewise.
17394 * delegate.cs (Delegate.ctor): Take a MemberName, not a string.
17395 * enum.cs (Enum.ctor): Likewise.
17397 * namespace.cs (AliasEntry.Alias): Changed type from Expression to
17399 (AliasEntry.ctor): Take a MemberName, not an Expression.
17400 (AliasEntry.UsingAlias): Likewise.
17402 * class.cs (TypeContainer.ctor): Take a MemberName, not a string.
17403 (IMethodData.MemberName): Changed type from string to MemberName.
17404 (MemberBase.ExplicitInterfaceName): Likewise.
17405 (AbstractPropertyEventMethod.SetupName): Make this private.
17406 (AbstractPropertyEventMethod.ctor): Added `string prefix'
17407 argument; compute the member name here.
17408 (AbstractPropertyEventMethod.UpdateName): Recompute the name based
17409 on the `member.MemberName' and the `prefix'.
17411 * cs-parser.jay (attribute_name): Use `namespace_or_type_name',
17413 (struct_declaration): Use `member_name' instead of `IDENTIFIER';
17414 thus, we get a `MemberName' instead of a `string'. These
17415 declarations may have type parameters in GMCS.
17416 (interface_method_declaration, delegate_declaration): Likewise.
17417 (class_declaration, interface_declaration): Likewise.
17418 (method_header): Use `namespace_or_type_name' instead of
17419 `member_name'. We may be an explicit interface implementation.
17420 (property_declaration, event_declaration): Likewise.
17421 (member_name): This is now just an `IDENTIFIER', not a
17422 `namespace_or_type_name'.
17423 (type_name, interface_type): Removed.
17424 (namespace_or_type_name): Return a MemberName, not an Expression.
17425 (primary_expression): Use `member_name' instead of `IDENTIFIER';
17426 call GetTypeExpression() on the MemberName to get an expression.
17427 (IndexerDeclaration.interface_type): Changed type from string to
17429 (MakeName): Operate on MemberName's instead of string's.
17431 2004-09-13 Raja R Harinath <rharinath@novell.com>
17434 * namespace.cs (AliasEntry.Resolve): Implement section 16.3.1.
17435 (NamespaceEntry.Lookup): Add new argument to flag if we want the
17436 lookup to avoid symbols introduced by 'using'.
17437 * rootcontext.cs (NamespaceLookup): Update.
17439 2004-09-12 Marek Safar <marek.safar@seznam.cz>
17441 * class.cs (TypeContainer.DoDefineMembers): Do not call
17442 DefineDefaultConstructor for static classes.
17444 2004-09-12 Marek Safar <marek.safar@seznam.cz>
17446 * attribute.cs (Attribute.Resolve): Add error 653 report.
17448 * class.cs (Class.ApplyAttributeBuilder): Add error 641
17450 (Method.ApplyAttributeBuilder): Add error 685 report.
17451 (Operator.Define): Add error 564 report.
17453 * cs-tokenizer.cs (handle_hex): Add error 1013 report.
17455 * expression.cs (Invocation.DoResolve): Add error
17456 245 and 250 report.
17458 * parameter.cs (Parameter.ApplyAttributeBuilder): Add
17461 2004-09-11 Marek Safar <marek.safar@seznam.cz>
17463 * class.cs (ConstructorInitializer.Resolve):
17464 Wrong error number (515->516).
17466 2004-09-11 Marek Safar <marek.safar@seznam.cz>
17468 * class.cs (Indexer.Define): Add error 631 report.
17470 2004-09-11 Marek Safar <marek.safar@seznam.cz>
17472 * ecore.cs (Error_NegativeArrayIndex): Fix 248 error.
17474 2004-09-11 Marek Safar <marek.safar@seznam.cz>
17476 * expression.cs (Probe.DoResolve): Add error CS0241 report.
17478 2004-09-10 Marek Safar <marek.safar@seznam.cz>
17480 * cs-parser.jay: Added error CS0241 report.
17482 2004-09-10 Raja R Harinath <rharinath@novell.com>
17484 * cs-parser.jay (fixed_statement): Introduce a scope for the
17485 declaration in the 'fixed' statement.
17487 2004-09-09 Marek Safar <marek.safar@seznam.cz>
17489 * cs-parser.jay: Added CS0230 error report.
17491 2004-09-09 Marek Safar <marek.safar@seznam.cz>
17493 * cs-parser.jay: Added errors CS0231 and CS0257 report.
17495 2004-09-09 Marek Safar <marek.safar@seznam.cz>
17497 * expression.cs (Argument.Resolve): Added error CS0192 and
17500 2004-09-09 Marek Safar <marek.safar@seznam.cz>
17502 C# 2.0 #pragma warning feature
17504 * cs-tokenizer.cs (PreProcessPragma): New method;
17505 Handles #pragma directive.
17507 * report.cs (WarningRegions): New class; Support
17508 class for #pragma warning directive. It tests whether
17509 warning is enabled for a given line.
17511 2004-09-08 Miguel de Icaza <miguel@ximian.com>
17513 * const.cs: Add more descriptive error report, tahnks to
17516 2004-09-08 Marek Safar <marek.safar@seznam.cz>
17518 * ecore.cs (FieldExpr.DoResolveLValue): Fixed CS0198 report.
17520 2004-09-07 Miguel de Icaza <miguel@ximian.com>
17522 * expression.cs: Apply patch from Ben: Remove dead code from
17523 ArrayCreation, and remove the TurnintoConstant call in const.cs,
17524 as that code just threw an exception anwyays.
17526 * const.cs: Remove the call to the turnintoconstant, for details
17529 * literal.cs: The type of the null-literal is the null type; So
17530 we use a placeholder type (literal.cs:System.Null, defined here)
17533 * expression.cs (Conditional.DoResolve): Remove some old code that
17534 is no longer needed, conversions have been fixed.
17536 (ArrayCreationExpression.DoResolve): Return false if we fail to
17537 resolve the inner expression.
17539 2004-09-07 Raja R Harinath <rharinath@novell.com>
17542 * cs-parser.jay (delegate_declaration): Record a delegate
17543 declaration as a type declaration.
17544 Reported by Jo Vermeulen <jo@lumumba.luc.ac.be>.
17546 2004-09-06 Miguel de Icaza <miguel@ximian.com>
17548 * parameter.cs: Do not crash if the type can not be resolved.
17550 * expression.cs: Report errors with unsafe pointers, fixes #64896
17552 2004-09-06 Ben Maurer <bmaurer@users.sourceforge.net>
17554 * expression.cs: Pointer arith always needs to do a conv.i
17555 if the operand is a long. fix 65320
17557 2004-09-04 Marek Safar <marek.safar@seznam.cz>
17559 Fixed cs0619-37.cs, cs0619-38.cs
17561 * enum.cs (GetObsoleteAttribute): Removed.
17563 * expression.cs (MemberAccess.DoResolve): Test for [Obsolete]
17564 on Enum member is double staged. The first is tested member
17567 2004-09-04 Marek Safar <marek.safar@seznam.cz>
17569 Fixed #56986, #63631, #65231
17571 * class.cs: (TypeContainer.AddToMemberContainer): New method,
17572 adds member to name container.
17573 (TypeContainer.AddToTypeContainer): New method, adds type to
17575 (AddConstant, AddEnum, AddClassOrStruct, AddDelegate, AddMethod,
17576 AddConstructor, AddInterface, AddField, AddProperty, AddEvent,
17577 AddOperator): Simplified by reusing AddToMemberContainer.
17578 (TypeContainer.UserDefinedStaticConstructor): Changed to property
17580 (Method.CheckForDuplications): Fixed implementation to test all
17582 (MemberBase): Detection whether member is explicit interface
17583 implementation is now in constructor.
17584 (MemberBase.UpdateMemberName): Handles IndexerName.
17585 (Accessor): Changed to keep also location information.
17586 (AbstractPropertyEventMethod): Is derived from MemberCore.
17587 (AbstractPropertyEventMethod.IsDummy): Says whether accessor
17588 will be emited or not.
17589 (PropertyBase.AreAccessorsDuplicateImplementation):
17590 Tests whether accessors are not in collision with some method.
17591 (Operator): Is derived from MethodCore to simplify common
17594 * decl.cs (Flags.TestMethodDuplication): Test for duplication
17596 (DeclSpace.AddToContainer): Adds the member to defined_names
17597 table. It tests for duplications and enclosing name conflicts.
17599 * enum.cs (EnumMember): Clean up to reuse the base structures
17601 2004-09-03 Martin Baulig <martin@ximian.com>
17603 * class.cs (TypeContainer.DefineDefaultConstructor): Put this back
17604 into TypeContainer, to make partial classes work again.
17606 2004-09-03 Martin Baulig <martin@ximian.com>
17608 * rootcontext.cs (RootContext.V2): Removed.
17610 2004-03-23 Martin Baulig <martin@ximian.com>
17612 * expression.cs (Invocation.OverloadResolve): Added `bool
17613 may_fail' argument and use it instead of the Location.IsNull() hack.
17615 2004-09-03 Martin Baulig <martin@ximian.com>
17617 Merged latest changes into gmcs. Please keep this comment in
17618 here, it makes it easier for me to see what changed in MCS since
17619 the last time I merged.
17621 2004-09-03 Raja R Harinath <rharinath@novell.com>
17624 * expression.cs (BetterConversion): Don't allow either conversion
17625 to be null. Remove redundant implicit conversion test when 'q ==
17626 null' -- when this function is invoked, we already know that the
17627 implicit conversion exists.
17628 (BetterFunction): Assume that 'best' is non-null. Remove
17629 redundant reimplementation of IsApplicable when 'best' is null.
17630 (IsParamsMethodApplicable, IsApplicable): Add new parameter for
17631 number of arguments.
17632 (IsAncestralType): Extract from OverloadResolve.
17633 (OverloadResolve): Make robust to the MethodGroupExpr being
17634 unsorted. Implement all the logic of Section 14.5.5.1, and
17635 support overloading of methods from multiple applicable types.
17636 Clean up logic somewhat. Don't pass null methods to BetterFunction.
17638 * report.cs (SymbolRelatedToPreviousError): Cleanup output.
17639 (RealError, Warning): Append type of report to related symbol.
17641 2004-09-03 Marek Safar <marek.safar@seznam.cz>
17643 * enum.cs: Fixed CLS-Compliance checks for enum members.
17644 Error tests cs3008-8.cs, cs3014-8.cs
17646 2004-09-02 Marek Safar <marek.safar@seznam.cz>
17648 Fixed bug #62342, #63102
17649 * class.cs: ImplementIndexer uses member.IsExplicitImpl
17650 like ImplementMethod.
17652 2004-09-02 Marek Safar <marek.safar@seznam.cz>
17654 * attribute.cs (Attribute.GetAttributeArgumentExpression):
17657 2004-09-02 Martin Baulig <martin@ximian.com>
17659 * statement.cs (Using.EmitLocalVariableDeclFinally): Use
17660 TypeManager.GetArgumentTypes() rather than calling GetParameters()
17663 2004-09-01 Marek Safar <marek.safar@seznam.cz>
17665 C# 2.0 Static classes implemented
17667 * class.cs (TypeContainer): instance_constructors,
17668 initialized_fields, initialized_static_fields,
17669 default_constructor, base_inteface_types are protected to be
17670 accessible from StaticClass.
17671 (TypeContainer.DefineDefaultConstructor): New virtual method
17672 for custom default constructor generating
17673 (StaticClass): New class to handle "Static classes" feature.
17675 * cs-parser.jay: Handle static keyword on class like instance
17678 * driver.cs: Added "/langversion" command line switch with two
17679 options (iso-1, default).
17681 2004-08-31 Marek Safar <marek.safar@seznam.cz>
17683 * ecore.cs (FieldExpr.Resolve): Fixed bug #64689.
17685 2004-08-31 Miguel de Icaza <miguel@ximian.com>
17687 * delegate.cs: Style.
17689 2004-08-31 Ben Maurer <bmaurer@users.sourceforge.net>
17691 * delegate.cs: Add seperate instance expr field for miguel.
17693 2004-08-29 Ben Maurer <bmaurer@users.sourceforge.net>
17695 * PointerArithmetic (Resolve): make sure we are not doing
17696 pointer arith on void*. Also, make sure we are resolved
17697 by not setting eclass until resolve.
17699 All callers: Make sure that PointerArithmetic gets resolved.
17701 2004-08-29 Ben Maurer <bmaurer@users.sourceforge.net>
17703 * ArrayCreation (LookupType): If the type does not resolve
17704 to an array, give an error.
17706 2004-08-27 Marek Safar <marek.safar@seznam.cz>
17708 * statement.cs (Try.Resolve): Fixed bug #64222
17710 2004-08-27 Martin Baulig <martin@ximian.com>
17713 (TC.OperatorArrayList.OperatorEntry.CheckPairedOperators): Don't
17716 2004-08-26 Marek Safar <marek.safar@seznam.cz>
17718 * ecore.cs (Constantify): Get underlying type via
17719 System.Enum.GetUnderlyingType to avoid StackOverflow on the
17720 Windows in special cases.
17722 2004-08-26 Marek Safar <marek.safar@seznam.cz>
17724 * typemanager.cs (GetAddMethod): Used GetAddMethod (true)
17725 for obtaining also private methods.
17726 (GetRemoveMethod): Used GetRemoveMethod (true)
17727 for obtaining also private methods.
17729 2004-08-24 Martin Baulig <martin@ximian.com>
17731 * class.cs (Method.Define): Set MethodAttributes.SpecialName and
17732 MethodAttributes.HideBySig for operators.
17734 2004-08-23 Martin Baulig <martin@ximian.com>
17736 Back to the old error reporting system :-)
17738 * report.cs (Message): Removed.
17739 (Report.MessageData, ErrorData, WarningData): Removed.
17740 (Report.Error, Warning): Back to the old system.
17742 2004-08-23 Martin Baulig <martin@ximian.com>
17744 * decl.cs (IMemberContainer.Parent): Renamed to ParentContainer.
17746 * class.cs (TypeContainer.ParentContainer): New public virtual
17747 method; replaces the explicit interface implementation.
17748 (ClassPart.ParentContainer): Override.
17750 2004-08-23 Martin Baulig <martin@ximian.com>
17752 * statement.cs (Switch): Added support for constant switches; see
17753 #59428 or test-285.cs.
17755 2004-08-22 Marek Safar <marek.safar@seznam.cz>
17758 * statement.cs (GetEnumeratorFilter): Removed useless
17759 logic because C# specs is strict. GetEnumerator must be
17762 2004-08-22 Martin Baulig <martin@ximian.com>
17764 * flowanalysis.cs (FlowBranching.UsageVector.MergeChild): If we're
17765 a switch and may break, reset the barrier. Fixes #59867.
17767 2004-08-22 Marek Safar <marek.safar@seznam.cz>
17769 CLS-Compliance speed up (~5% for corlib)
17771 * attribute.cs (AttributeTester.VerifyTopLevelNameClsCompliance):
17772 New method. Tests container for CLS-Compliant names
17774 * class.cs (TypeContainer.VerifyClsName): New method.
17775 Checks whether container name is CLS Compliant.
17776 (Constructor): Implements IMethodData.
17778 * decl.cs (MemberCache.GetPublicMembers ): New method. Builds
17779 low-case table for CLS Compliance test.
17780 (MemberCache.VerifyClsParameterConflict): New method.
17781 Checks method parameters for CS3006 error.
17783 * enum.cs (EnumMember): Is derived from MemberCore.
17784 (Enum.VerifyClsName): Optimized for better performance.
17786 2004-08-06 Marek Safar <marek.safar@seznam.cz>
17788 * report.cs: Renamed Error_T to Error and changed all
17791 2004-08-06 Marek Safar <marek.safar@seznam.cz>
17793 * class.cs (TypeContainer.IndexerArrayList): New inner class
17794 container for indexers.
17795 (TypeContainer.DefaultIndexerName): New constant for default
17796 indexer name. Replaced all "Item" with this constant.
17797 (TypeContainer.DefineIndexers): Moved to IndexerArrayList class.
17799 * typemanager.cs (TypeManager.default_member_ctor): Cache here
17800 DefaultMemberAttribute constructor.
17802 2004-08-05 Martin Baulig <martin@ximian.com>
17804 * flowanalysis.cs (FlowBranching.UsageVector.MergeJumpOrigins):
17807 2004-08-05 Marek Safar <marek.safar@seznam.cz>
17809 * mcs.exe.sources: $(EXTRA_SOURCES) are now here to avoid
17810 multi platforms problem.
17812 * compiler.csproj: Included shared files.
17814 2004-08-04 Marek Safar <marek.safar@seznam.cz>
17816 Fix bug 60333, 55971 in the more general way
17817 * attribute.cs (Attribute.GetAttributeArgumentExpression):
17818 Added arg_type argument for constant conversion.
17819 (Attribute.Resolve): Reuse GetAttributeArgumentExpression.
17821 2004-08-04 Marek Safar <marek.safar@seznam.cz>
17824 * class.cs (TypeContainer ): New inner classes MethodArrayList,
17825 OperatorArrayList, MethodCoreArrayList for typecontainer
17826 containers. Changed class member types to these new types.
17827 (MethodArrayList.DefineMembers): Added test for CS0659.
17829 2004-08-04 Miguel de Icaza <miguel@ximian.com>
17831 * cfold.cs: Synchronize the folding with the code in expression.cs
17832 Binary.DoNumericPromotions for uint operands.
17834 * attribute.cs: Revert patch from Raja, it introduced a regression
17835 while building Blam-1.2.1 (hard to isolate a test case).
17837 2004-08-04 Marek Safar <marek.safar@seznam.cz>
17841 (TypeContainer.Define): Renamed to DefineContainerMembers because of
17843 (MethodCore.parent_method): New member. The method we're overriding
17844 if this is an override method.
17845 (MethodCore.CheckBase): Moved from Method class and made common.
17846 (MethodCore.CheckMethodAgainstBase): Moved from MemberBase and made
17848 (MethodCore.CheckForDuplications): New abstract method. For custom
17849 member duplication search in a container
17850 (MethodCore.FindOutParentMethod): New abstract method. Gets parent
17851 method and its return type.
17852 (Event.conflict_symbol): New member. Symbol with same name in the
17856 (MemberCache.FindMemberWithSameName): New method. The method
17857 is looking for conflict with inherited symbols.
17859 2004-08-04 Martin Baulig <martin@ximian.com>
17861 * codegen.cs (VariableStorage.EmitLoadAddress): New public method.
17863 * statement.cs (Foreach.EmitFinally): Make this work for valuetypes.
17865 2004-08-03 Marek Safar <marek.safar@seznam.cz>
17867 * report.cs (Message): New enum for better error, warning reference in
17869 (MessageData): New inner abstract class. It generally handles printing of
17870 error and warning messages.
17871 Removed unused Error, Warning, Message methods.
17873 2004-08-03 Marek Safar <marek.safar@seznam.cz>
17875 Fix for cs0592-8.cs test
17877 (Attributable.ValidAttributeTargets): Made public.
17878 (Attribute.ExplicitTarget): New member for explicit target value.
17879 (Attribute.CheckTargets): Now we translate explicit attribute
17880 target to Target here.
17882 2004-08-03 Ben Maurer <bmaurer@ximian.com>
17884 * ecore.cs (MethodGroupExpr): new IsBase property.
17886 * expression.cs (BaseAccess): Set IsBase on MethodGroupExpr.
17888 * delegate.cs (DelegateCreation): store a MethodGroupExpr
17889 rather than an instance expr.
17891 (DelegateCreation.Emit): Use the method group rather than
17892 the instance expression. Also, if you have base.Foo as the
17893 method for a delegate, make sure to emit ldftn, not ldftnvirt.
17895 (ResolveMethodGroupExpr): Use the MethodGroupExpr.
17897 (NewDelegate.DoResolve): Only check for the existance of Invoke
17898 if the method is going to be needed. Use MethodGroupExpr.
17900 (NewDelegate.Emit): Remove, DelegateCreation implements this.
17902 * expression.cs: For pointer arith., make sure to use
17903 the size of the type, not the size of the pointer to
17906 2004-08-03 Marek Safar <marek.safar@seznam.cz>
17909 * class.cs (Class): Added error CS0502 test.
17911 2004-08-03 John Luke <jluke@cfl.rr.com>
17912 Raja R Harinath <rharinath@novell.com>
17915 * attribute.cs (Attribute.complained_before): New flag.
17916 (Attribute.ResolveType, Attribute.Resolve),
17917 (Attribute.DefinePInvokeMethod): Set it.
17918 (Attributes.Search): Pass 'complain' to Attribute.ResolveType.
17920 2004-08-03 Martin Baulig <martin@ximian.com>
17922 * expression.cs (Binary.ResolveOperator): Don't abort if we can't
17923 use a user-defined operator; we still need to do numeric
17924 promotions in case one argument is a builtin type and the other
17925 one has an implicit conversion to that type. Fixes #62322.
17927 2004-08-02 Martin Baulig <martin@ximian.com>
17929 * statement.cs (LocalInfo.Flags): Added `IsThis'.
17930 (LocalInfo.IsThis): New public property.
17931 (Block.EmitMeta): Don't create a LocalBuilder for `this'.
17933 2004-08-01 Martin Baulig <martin@ximian.com>
17935 * class.cs (TypeContainer.GetClassBases): Don't set the default
17936 here since we may get called from GetPartialBases().
17937 (TypeContainer.DefineType): If GetClassBases() didn't return a
17938 parent, use the default one.
17940 2004-07-30 Duncan Mak <duncan@ximian.com>
17942 * Makefile (mcs2.exe, mcs3.exe): add $(EXTRA_SOURCES).
17944 2004-07-30 Martin Baulig <martin@ximian.com>
17946 * Makefile (EXTRA_SOURCES): List the symbol writer's sources here.
17948 * class.cs (SourceMethod): New public class, derive from the
17949 symbol writer's ISourceMethod.
17950 (Method): Use the new symbol writer API.
17952 * codegen.cs (CodeGen.InitializeSymbolWriter): Take the filename
17953 as argument and use the new symbol writer.
17956 (SourceFile): Implement the symbol writer's ISourceFile.
17957 (Location.SymbolDocument): Removed.
17958 (Location.SourceFile): New public property.
17960 * symbolwriter.cs: Use the new symbol writer API.
17962 2004-07-30 Raja R Harinath <rharinath@novell.com>
17964 * Makefile (install-local): Remove. Functionality moved to
17967 2004-07-28 Lluis Sanchez Gual <lluis@novell.com>
17969 * Makefile: Install mcs.exe.config file together with mcs.exe.
17970 * mcs.exe.config: Added supportedRuntime entry to make sure it runs in the
17971 correct runtime version.
17973 2004-07-25 Martin Baulig <martin@ximian.com>
17976 (TypeContainer.RegisterOrder): Removed, this was unused.
17977 (TypeContainer, interface_order): Removed.
17978 (TypeContainer.AddClass, AddStruct, AddInterface): Take a
17979 TypeContainer as argument since we can also be called with a
17980 `PartialContainer' for a partial class/struct/interface.
17981 (TypeContainer.IsInterface): Use `Kind == Kind.Interface' instead
17982 of checking whether we're an `Interface' - we could be a
17983 `PartialContainer'.
17984 (PartialContainer.Register): Override; call
17985 AddClass()/AddStruct()/AddInterface() on our parent.
17987 * cs-parser.jay (interface_member_declaration): Add things to the
17988 `current_container', not the `current_class'.
17990 * rootcontext.cs (RegisterOrder): The overloaded version which
17991 takes an `Interface' was unused, removed.
17993 * typemanager.cs (TypeManager.LookupInterface): Return a
17994 `TypeContainer', not an `Interface'.
17995 (TypeManager.IsInterfaceType): The `builder_to_declspace' may
17996 contain a `PartialContainer' for an interface, so check it's
17997 `Kind' to figure out what it is.
17999 2004-07-25 Martin Baulig <martin@ximian.com>
18001 * class.cs (Class.DefaultTypeAttributes): New public constant.
18002 (Struct.DefaultTypeAttributes): Likewise.
18003 (Interface.DefaultTypeAttributes): Likewise.
18004 (PartialContainer.TypeAttr): Override this and add the
18005 DefaultTypeAttributes.
18007 2004-07-25 Martin Baulig <martin@ximian.com>
18009 * decl.cs (DeclSpace.Emit): Removed the `TypeContainer' argument,
18010 we can just use the `Parent' field instead.
18012 2004-07-25 Martin Baulig <martin@ximian.com>
18014 * class.cs (TypeContainer.Emit): Renamed to EmitType().
18016 2004-07-25 Martin Baulig <martin@ximian.com>
18018 * class.cs (TypeContainer.DefineMembers): Call DefineMembers() on
18019 our parts before defining any methods.
18020 (TypeContainer.VerifyImplements): Make this virtual.
18021 (ClassPart.VerifyImplements): Override and call VerifyImplements()
18022 on our PartialContainer.
18024 2004-07-25 Martin Baulig <martin@ximian.com>
18026 * iterators.cs (Iterator.Define): Renamed to DefineIterator().
18028 * decl.cs (DeclSpace.Define): Removed the `TypeContainer'
18029 argument, we can just use the `Parent' field instead.
18032 (MemberBase.CheckBase): Removed the `TypeContainer' argument.
18033 (MemberBase.DoDefine): Likewise.
18035 2004-07-24 Martin Baulig <martin@ximian.com>
18037 * decl.cs (MemberCore.Parent): New public field.
18038 (DeclSpace.Parent): Moved to MemberCore.
18040 * class.cs (MethodCore.ds): Removed; use `Parent' instead.
18041 (MemberBase.ctor): Added TypeContainer argument, pass it to our
18043 (FieldBase, Field, Operator): Likewise.
18044 (EventProperty.ctor): Take a TypeContainer instead of a DeclSpace.
18045 (EventField, Event): Likewise.
18047 2004-07-23 Martin Baulig <martin@ximian.com>
18049 * class.cs (PartialContainer): New public class.
18050 (ClassPart): New public class.
18051 (TypeContainer): Added support for partial classes.
18052 (TypeContainer.GetClassBases): Splitted some of the functionality
18053 out into GetNormalBases() and GetPartialBases().
18055 * cs-tokenizer.cs (Token.PARTIAL): New token.
18056 (Tokenizer.consume_identifier): Added some hacks to recognize
18057 `partial', but only if it's immediately followed by `class',
18058 `struct' or `interface'.
18060 * cs-parser.jay: Added support for partial clases.
18062 2004-07-23 Martin Baulig <martin@ximian.com>
18064 * class.cs (MethodCore.ds): Made this a `TypeContainer' instead of
18065 a `DeclSpace' and also made it readonly.
18066 (MethodCore.ctor): Take a TypeContainer instead of a DeclSpace.
18067 (Method.ctor, Constructor.ctor, Destruktor.ctor): Likewise.
18068 (PropertyBase.ctor, Property.ctor, Indexer.ctor): Likewise.
18070 * cs-parser.jay: Pass the `current_class', not the
18071 `current_container' (at the moment, this is still the same thing)
18072 to a new Method, Property, Event, Indexer or Constructor.
18074 2004-07-23 Martin Baulig <martin@ximian.com>
18076 * cs-parser.jay (CSharpParser): Added a new `current_class' field
18077 and removed the `current_interface' one.
18078 (struct_declaration, class_declaration, interface_declaration):
18079 Set `current_class' to the newly created class/struct/interface;
18080 set their `Bases' and call Register() before parsing their body.
18082 2004-07-23 Martin Baulig <martin@ximian.com>
18084 * class.cs (Kind): New public enum.
18085 (TypeContainer): Made this class abstract.
18086 (TypeContainer.Kind): New public readonly field.
18087 (TypeContainer.CheckDef): New public method; moved here from
18089 (TypeContainer.Register): New public abstract method.
18090 (TypeContainer.GetPendingImplementations): New public abstract
18092 (TypeContainer.GetClassBases): Removed the `is_class' and
18093 `is_iface' parameters.
18094 (TypeContainer.DefineNestedTypes): Formerly known as
18096 (ClassOrStruct): Made this class abstract.
18098 * tree.cs (RootTypes): New public type.
18100 2004-07-20 Martin Baulig <martin@ximian.com>
18102 * tree.cs (Tree.RecordNamespace): Removed.
18103 (Tree.Namespaces): Removed.
18105 * rootcontext.cs (RootContext.IsNamespace): Removed.
18107 * cs-parser.jay (namespace_declaration): Just create a new
18108 NamespaceEntry here.
18110 2004-07-20 Martin Baulig <martin@ximian.com>
18112 * statement.cs (ExceptionStatement): New abstract class. This is
18113 now used as a base class for everyone who's using `finally'.
18114 (Using.ResolveLocalVariableDecls): Actually ResolveLValue() all
18115 our local variables before using them.
18117 * flowanalysis.cs (FlowBranching.StealFinallyClauses): New public
18118 virtual method. This is used by Yield.Resolve() to "steal" an
18119 outer block's `finally' clauses.
18120 (FlowBranchingException): The .ctor now takes an ExceptionStatement
18123 * codegen.cs (EmitContext.StartFlowBranching): Added overloaded
18124 version which takes an ExceptionStatement. This version must be
18125 used to create exception branchings.
18128 (Yield.Resolve): "Steal" all `finally' clauses from containing blocks.
18129 (Iterator.EmitMoveNext): Added exception support; protect the
18130 block with a `fault' clause, properly handle 'finally' clauses.
18131 (Iterator.EmitDispose): Run all the `finally' clauses here.
18133 2004-07-20 Martin Baulig <martin@ximian.com>
18135 * iterator.cs: This is the first of a set of changes in the
18136 iterator code. Match the spec more closely: if we're an
18137 IEnumerable, then GetEnumerator() must be called. The first time
18138 GetEnumerator() is called, it returns the current instance; all
18139 subsequent invocations (if any) must create a copy.
18141 2004-07-19 Miguel de Icaza <miguel@ximian.com>
18143 * expression.cs: Resolve the constant expression before returning
18146 2004-07-19 Martin Baulig <martin@ximian.com>
18148 * iterators.cs (Iterator.MapVariable): Don't define fields twice.
18149 (Iterator.MoveNextMethod.DoEmit): Use `TypeManager.int32_type' as
18150 the return type of the new EmitContext.
18152 2004-07-18 Martin Baulig <martin@ximian.com>
18154 * class.cs (Property.Define): Fix iterators.
18156 * iterators.cs (Iterator.Define): Moved the
18157 `container.AddInterator (this)' call here from the .ctor; only do
18158 it if we resolved successfully.
18160 2004-07-17 Miguel de Icaza <miguel@ximian.com>
18162 * cs-tokenizer.cs (handle_preprocessing_directive): Do not return
18163 `true' for preprocessing directives that we parse. The return
18164 value indicates whether we should return to regular tokenizing or
18165 not, not whether it was parsed successfully.
18167 In the past if we were in: #if false ... #line #endif, we would
18168 resume parsing after `#line'. See bug 61604.
18170 * typemanager.cs: Removed an old hack from Gonzalo to get corlib
18171 building: IsEnumType should return true only for enums, not for
18172 enums or System.Enum itself. This fixes #61593.
18174 Likely what happened is that corlib was wrong: mcs depended on
18175 this bug in some places. The bug got fixed, we had to add the
18176 hack, which caused bug 61593.
18178 * expression.cs (ArrayAccess.GetStoreOpCode): Remove an old hack
18179 that was a workaround for the older conditions.
18181 2004-07-16 Ben Maurer <bmaurer@ximian.com>
18183 * assign.cs: IAssignMethod has a new interface, as documented
18184 inline. All assignment code now uses this new api.
18186 * ecore.cs, expression.cs: All classes which implement
18187 IAssignMethod now use the new interface.
18189 * expression.cs (Invocation): add a hack to EmitCall so that
18190 IndexerAccess can be the target of a compound assignment without
18191 evaluating its arguments twice.
18193 * statement.cs: Handle changes in Invocation api.
18195 2004-07-16 Martin Baulig <martin@ximian.com>
18197 * iterators.cs: Rewrote this. We're now using one single Proxy
18198 class for both the IEnumerable and the IEnumerator interface and
18199 `Iterator' derives from Class so we can use the high-level API.
18201 * class.cs (TypeContainer.AddIterator): New method.
18202 (TypeContainer.DoDefineType): New protected virtual method, which
18203 is called from DefineType().
18204 (TypeContainer.DoDefineMembers): Call DefineType() and
18205 DefineMembers() on all our iterators.
18206 (TypeContainer.Emit): Call Emit() on all our iterators.
18207 (TypeContainer.CloseType): Call CloseType() on all our iterators.
18209 * codegen.cs (EmitContext.CurrentIterator): New public field.
18211 2004-07-15 Martin Baulig <martin@ximian.com>
18214 (TypeManager.not_supported_exception_type): New type.
18216 2004-07-14 Martin Baulig <martin@ximian.com>
18218 * iterators.cs: Use real error numbers.
18220 2004-07-14 Martin Baulig <martin@ximian.com>
18222 * iterator.cs (IteratorHandle.IsIEnumerable): The spec explicitly
18223 requires this to be a System.Collection.IEnumerable and not a
18224 class implementing that interface.
18225 (IteratorHandle.IsIEnumerator): Likewise, for IEnumerator.
18227 2004-07-13 Marek Safar <marek.safar@seznam.cz>
18229 * class.cs: Fixed previous fix, it broke some error tests.
18231 2004-07-12 Martin Baulig <martin@ximian.com>
18233 * enum.cs (Enum.Define): Call Emit() to emit the attributes.
18236 2004-07-09 Miguel de Icaza <miguel@ximian.com>
18238 * assign.cs (LocalTemporary): Add new argument: is_address,If
18239 `is_address' is true, then the value that we store is the address
18240 to the real value, and not the value itself.
18242 * ecore.cs (PropertyExpr): use the new local temporary
18243 stuff to allow us to handle X.Y += z (where X is a struct)
18245 2004-07-08 Martin Baulig <martin@ximian.com>
18247 * statement.cs (Lock.Resolve): Set ec.NeedReturnLabel() if we do
18248 not always return, just like we're doing in Using.Resolve().
18250 2004-07-07 Miguel de Icaza <miguel@ximian.com>
18252 * cs-parser.jay (fixed_statement): flag this as Pinned.
18254 2004-07-06 Miguel de Icaza <miguel@ximian.com>
18256 * typemanager.cs (TypeManager): Removed MakePinned method, this
18257 mechanism is replaced with the .NET 2.x compatible mechanism of
18258 calling `ILGenerator.DeclareLocal (Type t, bool pinned)'.
18260 * statement.cs (LocalInfo): Remove MakePinned, add Pinned property
18261 Rename `Fixed' to `Pinned' as a flag, to distinguish from the
18262 `IsFixed' property which has a different meaning.
18264 2004-07-02 Raja R Harinath <rharinath@novell.com>
18266 * ecore.cs (DoSimpleNameResolve): Expand CS0038 check to all names
18267 visible from inside a nested class, not just the names of the
18268 immediately enclosing class.
18269 Fix for bug #60730.
18271 2004-06-24 Raja R Harinath <rharinath@novell.com>
18273 * expression.cs (BetterConversion): Remove buggy special-case
18274 handling of "implicit constant expression conversions". At this
18275 point, we already know that the conversion is possible -- we're
18276 only checking to see which is better.
18278 2004-06-24 Marek Safar <marek.safar@seznam.cz>
18280 * cs-parser.jay: Added error CS0210 test.
18282 2004-06-24 Marek Safar <marek.safar@seznam.cz>
18284 * cs-parser.jay: Added error CS0134 test.
18286 2004-06-24 Marek Safar <marek.safar@seznam.cz>
18289 * cs-parser.jay: Added error CS0145 test.
18291 2004-06-24 Marek Safar <marek.safar@seznam.cz>
18293 * class.cs (Operator.Define): Added test for errors CS0553, CS0554.
18295 2004-06-23 Ben Maurer <bmaurer@ximian.com>
18297 * expression.cs (StackAlloc.Resolve): The argument may not
18298 be a constant; deal with this case.
18300 2004-06-23 Marek Safar <marek.safar@seznam.cz>
18302 * attribute.cs (IndexerName_GetIndexerName): Renamed to
18303 GetIndexerAttributeValue.
18304 (ScanForIndexerName): Renamed to GetIndexerNameAttribute.
18306 * class.cs (Indexer.Define): Added error tests for CS0415,
18309 2004-06-23 Miguel de Icaza <miguel@ximian.com>
18311 * attribute.cs (Attribute.Resolve): Keep field code in sync with
18314 2004-06-23 Martin Baulig <martin@ximian.com>
18316 * flowanalysis.cs (UsageVector.MergeChild): If we're a loop and we
18317 neither return nor throw, reset the barrier as well. Fixes #60457.
18319 2004-06-22 Atsushi Enomoto <atsushi@ximian.com>
18321 * class.cs : EventAttributes is now set to None by default.
18322 This fixes bug #60459.
18324 2004-06-18 Marek Safar <marek.safar@seznam.cz>
18327 * class.cs (ConstructorInitializer.GetOverloadedConstructor):
18328 Don't throw exception but return null (it's sufficient now).
18330 2004-06-18 Marek Safar <marek.safar@seznam.cz>
18332 * typemanager.cs (GetArgumentTypes): Faster implementation.
18334 2004-06-18 Martin Baulig <martin@ximian.com>
18336 * attribute.cs (Attribute.Resolve): Check whether we're an
18337 EmptyCast which a Constant child. Fixes #60333.
18339 2004-06-17 Ben Maurer <bmaurer@ximian.com>
18341 * statement.cs (EmitCollectionForeach): Account for the fact that
18342 not all valuetypes are in areas which we can take the address of.
18343 For these variables, we store to a temporary variable. Also, make
18344 sure that we dont emit a `callvirt' on a valuetype method.
18346 2004-06-15 Marek Safar <marek.safar@seznam.cz>
18348 * expression.cs (StackAlloc.DoReSolve): Added test for
18349 negative parameter (CS0247).
18351 2004-06-15 Marek Safar <marek.safar@seznam.cz>
18354 * class.cs: (Event.DelegateMethod.Emit): Added synchronization flag.
18356 2004-06-15 Marek Safar <marek.safar@seznam.cz>
18359 * expression.cs: (Binary.DoNumericPromotions): Added conversion for
18362 2004-06-14 Marek Safar <marek.safar@seznam.cz>
18364 Fix bug #58254 & cs1555.cs, cs1556.cs
18365 * driver.cs (MainDriver): Added tests for errors CS1555, CS1556.
18367 2004-06-14 Marek Safar <marek.safar@seznam.cz>
18369 * cs-parser.jay: Added error CS1669 test for indexers.
18371 2004-06-11 Martin Baulig <martin@ximian.com>
18373 * expression.cs (Invocation.IsParamsMethodApplicable): We need to
18374 call this twice: for params and varargs methods.
18376 2004-06-11 Marek Safar <marek.safar@seznam.cz>
18379 (FieldBase.DoDefine, PropertyBase.DoDefine): Added error test CS0610.
18381 2004-06-11 Marek Safar <marek.safar@seznam.cz>
18383 * attribute.cs (Attribute.GetValidTargets): Made public.
18386 (AbstractPropertyEventMethod): New class for better code sharing.
18387 (AbstractPropertyEventMethod.ApplyAttributeBuilder): Add error
18389 (PropertyMethod, DelegateMethod): Derived from AbstractPropertyEventMethod
18391 2004-06-11 Raja R Harinath <rharinath@novell.com>
18394 * ecore.cs (ResolveFlags): Add new 'Intermediate' flag to tell
18395 that the call to Resolve is part of a MemberAccess.
18396 (Expression.Resolve): Use it for SimpleName resolution.
18397 (SimpleName.SimpleNameResolve, SimpleName.DoResolveAllowStatic):
18398 Add 'intermediate' boolean argument.
18399 (SimpleName.DoSimpleNameResolve): Likewise. Use it to disable an
18400 error message when the SimpleName can be resolved ambiguously
18401 between an expression and a type.
18402 * expression.cs (MemberAccess.IdenticalNameAndTypeName): Make
18404 (MemberAccess.Resolve): Pass 'Intermediate' flag to the Resolve()
18405 call on the left-side.
18407 2004-06-11 Marek Safar <marek.safar@seznam.cz>
18410 (MethodCore.VerifyClsCompliance): Added test for error CS3000.
18412 2004-06-11 Marek Safar <marek.safar@seznam.cz>
18414 * attribute.cs (Attribute.Emit): Fixed error CS0579 reporting.
18416 2004-06-11 Martin Baulig <martin@ximian.com>
18418 * expression.cs (Invocation.EmitCall): Use OpCodes.Callvirt for
18419 varargs methods if applicable.
18421 2004-06-11 Martin Baulig <martin@ximian.com>
18423 * expression.cs (Invocation.EmitCall): Don't use
18424 `method.CallingConvention == CallingConventions.VarArgs' since the
18425 method could also have `CallingConventions.HasThis'.
18427 2004-06-11 Marek Safar <marek.safar@seznam.cz>
18429 * class.cs (Event.GetSignatureForError): Implemented.
18430 Fixed crash in error test cs3010.cs
18432 2004-06-10 Miguel de Icaza <miguel@ximian.com>
18434 * cs-tokenizer.cs: Change the way we track __arglist to be
18435 consistent with the other keywords.
18437 2004-06-09 Miguel de Icaza <miguel@ximian.com>
18439 * codegen.cs: FAQ avoider: turn 1577 into a warning for now until
18442 2004-06-09 Sebastien Pouliot <sebastien@ximian.com>
18444 * codegen.cs: Check that all referenced assemblies have a strongname
18445 before strongnaming the compiled assembly. If not report error CS1577.
18446 Fix bug #56563. Patch by Jackson Harper.
18447 * typemanager.cs: Added a method to return all referenced assemblies.
18448 Fix bug #56563. Patch by Jackson Harper.
18450 2004-06-08 Marek Safar <marek.safar@seznam.cz>
18453 (Method.ApplyAttributeBuilder): Moved and added conditional
18454 attribute error tests (CS0577, CS0578, CS0243, CS0582, CS0629).
18457 (DelegateCreation.ResolveMethodGroupExpr): Added error CS1618 test.
18459 2004-06-08 Marek Safar <marek.safar@seznam.cz>
18462 * class.cs: (EventField.attribute_targets): Changed default target.
18464 2004-06-08 Martin Baulig <martin@ximian.com>
18466 * expression.cs (Invocation.EmitCall): Enable varargs methods.
18468 2004-06-08 Martin Baulig <martin@ximian.com>
18470 * rootcontext.cs (ResolveCore): Added "System.RuntimeArgumentHandle".
18472 2004-06-07 Martin Baulig <martin@ximian.com>
18474 Added support for varargs methods.
18476 * cs-tokenizer.cs (Token.ARGLIST): New token for the `__arglist'
18479 * cs-parser.jay: Added support for `__arglist'.
18481 * decl.cs (MemberCache.AddMethods): Don't ignore varargs methods.
18483 * expression.cs (Argument.AType): Added `ArgList'.
18484 (Invocation): Added support for varargs methods.
18485 (ArglistAccess): New public class.
18486 (Arglist): New public class.
18488 * parameter.cs (Parameter.Modifier): Added `ARGLIST'.
18490 * statement.cs (Block.Flags): Added `HasVarargs'. We set this on
18491 a method's top-level block if the method has varargs.
18493 * support.cs (ReflectionParameters, InternalParameters): Added
18494 support for varargs methods.
18496 2004-06-07 Miguel de Icaza <miguel@ximian.com>
18498 * class.cs: Provide location in indexer error report.
18500 * driver.cs: Use standard names.
18502 * namespace.cs: Catch the use of using after a namespace has been
18503 declared also on using aliases.
18505 2004-06-03 Raja R Harinath <rharinath@novell.com>
18508 * typemanager.cs (closure_private_ok, closure_invocation_type)
18509 (closure_qualifier_type, closure_invocation_assembly)
18510 (FilterWithClosure): Move to ...
18511 (Closure): New internal nested class.
18512 (Closure.CheckValidFamilyAccess): Split out from Closure.Filter.
18513 (MemberLookup, RealMemberLookup): Add new almost_match parameter.
18514 * ecore.cs (almostMatchedMembers): New variable to help report CS1540.
18515 (MemberLookup, MemberLookupFailed): Use it.
18516 * expression.cs (New.DoResolve): Treat the lookup for the
18517 constructor as being qualified by the 'new'ed type.
18518 (Indexers.GetIndexersForTypeOrInterface): Update.
18520 2004-06-03 Marek Safar <marek.safar@seznam.cz>
18523 (GetConditionalAttributeValue): New method. Returns
18524 condition of ConditionalAttribute.
18525 (SearchMulti): New method. Returns all attributes of type 't'.
18526 Use it when attribute is AllowMultiple = true.
18527 (IsConditionalMethodExcluded): New method.
18530 (Method.IsExcluded): Implemented. Returns true if method has conditional
18531 attribute and the conditions is not defined (method is excluded).
18532 (IMethodData): Extended interface for ConditionalAttribute support.
18533 (PropertyMethod.IsExcluded): Implemented.
18536 (MemberCore.Flags): Excluded_Undetected, Excluded new caching flags.
18539 (Invocation.IsMethodExcluded): Checks the ConditionalAttribute
18542 2004-06-02 Ben Maurer <bmaurer@users.sourceforge.net>
18544 * expression.cs (ArrayCreationExpression): Make this just an
18545 `expression'. It can't be a statement, so the code here was
18548 2004-06-02 Marek Safar <marek.safar@seznam.cz>
18551 * typemanager.cs (GetFullNameSignature): New method for
18554 2004-06-02 Marek Safar <marek.safar@seznam.cz>
18557 * class.cs (MemberBase.GetSignatureForError): New virtual method.
18558 Use this method when MethodBuilder is null.
18559 (MethodData.DefineMethodBuilder): Encapsulated code to the new method.
18560 Added test for error CS0626 (MONO reports error for this situation).
18561 (IMethodData.GetSignatureForError): Extended interface.
18563 2004-06-01 Marek Safar <marek.safar@seznam.cz>
18566 (AttributeTester.GetObsoleteAttribute): Returns instance of
18567 ObsoleteAttribute when type is obsolete.
18570 (TypeContainer.VerifyObsoleteAttribute): Override.
18571 (Method.GetSignatureForError): New method for usage when MethodBuilder is null.
18572 (MethodCode.VerifyObsoleteAttribute): Override.
18573 (MemberBase.VerifyObsoleteAttribute): Override.
18576 (MemberCore.CheckUsageOfObsoleteAttribute): Tests presence of ObsoleteAttribute
18577 and report proper error.
18580 Delegate.VerifyObsoleteAttribute): Override.
18583 (Expression.CheckObsoleteAttribute): Tests presence of ObsoleteAttribute
18584 and report proper error.
18585 (FieldExpr.DoResolve): Added tests for ObsoleteAttribute.
18588 (Enum.GetObsoleteAttribute): Returns ObsoleteAttribute for both enum type
18592 (Probe.DoResolve, Cast.DoResolve, LocalVariableReference.DoResolve,
18593 New.DoResolve, SizeOf.DoResolve, TypeOf.DoResolce, MemberAccess.DoResolve):
18594 Added test for ObsoleteAttribute.
18597 (Catch): Derived from Statement.
18599 2004-06-01 Marek Safar <marek.safar@seznam.cz>
18601 Fixed bug #59071 & cs0160.cs
18603 * statement.cs (Try.Resolve): Check here whether order of catch
18604 clauses matches their dependencies.
18606 2004-05-31 Miguel de Icaza <miguel@ximian.com>
18608 * Reverted patch to namespace.cs (Use lookuptypedirect). This
18609 caused a regression: #59343. Referencing nested classes from an
18610 assembly stopped working.
18612 2004-05-31 Martin Baulig <martin@ximian.com>
18614 MCS is now frozen for beta 2.
18616 2004-05-30 Ben Maurer <bmaurer@users.sourceforge.net>
18618 * convert.cs: add a trivial cache for overload operator resolution.
18620 2004-05-30 Ben Maurer <bmaurer@users.sourceforge.net>
18622 * decl.cs: If possible, use lookuptypedirect here. We can only do
18623 this if there is no `.' after the namespace. Avoids using
18624 LookupType, which does lots of slow processing.
18625 (FindNestedType) New method, does what it says :-).
18626 * namespace.cs: use LookupTypeDirect.
18627 * rootcontext.cs: use membercache, if possible.
18628 * typemanager.cs (LookupTypeDirect): Cache negative hits too.
18630 2004-05-30 Ben Maurer <bmaurer@users.sourceforge.net>
18633 According to the spec,
18635 In a member access of the form E.I, if E is a single identifier,
18636 and if the meaning of E as a simple-name (§7.5.2) is a constant,
18637 field, property, localvariable, or parameter with the same type as
18638 the meaning of E as a type-name (§3.8), then both possible
18639 meanings of E are permitted.
18641 We did not check that E as a simple-name had the same type as E as
18644 This trivial check gives us 5-7% on bootstrap time.
18646 2004-05-30 Ben Maurer <bmaurer@users.sourceforge.net>
18648 * expression.cs (Invocation.OverloadResolve): Avoid the
18649 use of hashtables and boxing here by allocating on demand.
18651 2004-05-30 Martin Baulig <martin@ximian.com>
18653 * rootcontext.cs (RootContext.LookupType): Don't cache things if
18654 we're doing a silent lookup. Don't try to lookup nested types in
18655 TypeManager.object_type (thanks to Ben Maurer).
18657 2004-05-30 Martin Baulig <martin@ximian.com>
18659 Committing a patch from Ben Maurer.
18661 * rootcontext.cs (RootContext.LookupType): Cache negative results.
18663 2004-05-29 Martin Baulig <martin@ximian.com>
18665 * class.cs (IMethodData.ShouldIgnore): New method.
18667 * typemanager.cs (TypeManager.MethodFlags): Don't take a
18668 `Location' argument, we don't need it anywhere. Use
18669 `IMethodData.ShouldIgnore ()' instead of
18670 `MethodData.GetMethodFlags ()'.
18671 (TypeManager.AddMethod): Removed.
18672 (TypeManager.AddMethod2): Renamed to AddMethod.
18674 2004-05-29 Martin Baulig <martin@ximian.com>
18676 Committing a patch from Benjamin Jemlich <pcgod@gmx.net>.
18678 * convert.cs (Convert.ImplicitReferenceConversion): If we're
18679 converting from a class type S to an interface type and we already
18680 have an object on the stack, don't box it again. Fixes #52578.
18682 2004-05-29 Martin Baulig <martin@ximian.com>
18684 * class.cs (ConstructorInitializer.GetOverloadedConstructor):
18685 Added support for `params' parameters. Fixes #59267.
18687 2004-05-29 Martin Baulig <martin@ximian.com>
18689 * literal.cs (NullPointer): Provide a private .ctor which sets
18690 `type' to TypeManager.object_type. Fixes #59048.
18692 2004-05-29 Martin Baulig <martin@ximian.com>
18694 * expression.cs (MemberAccess.ResolveMemberAccess): If we're an
18695 EventExpr, set `ee.InstanceExpression = left'. Fixes #59188.
18697 * ecore.cs (EventExpr.instance_expr): Make the field private.
18699 2004-05-26 Marek Safar <marek.safar@seznam.cz>
18701 Fixed bug #50080 & cs0214-2.cs
18702 * expression.cs (Cast.DoResolve): Check unsafe context here.
18704 * statement.cs (Resolve.DoResolve): Likewise.
18706 2004-05-26 Martin Baulig <martin@ximian.com>
18708 * namespace.cs (NamespaceEntry.Lookup): Added `bool silent'.
18710 * rootcontext.cs (RootContext.NamespaceLookup): Added `bool silent'.
18711 (RootContext.LookupType): Pass down the `silent' flag.
18713 2004-05-25 Martin Baulig <martin@ximian.com>
18716 (MethodGroupExpr.IdenticalTypeName): New public property.
18717 (Invocation.DoResolve): Don't report a CS0176 if the "instance"
18718 expression actually refers to a type.
18720 2004-05-25 Martin Baulig <martin@ximian.com>
18722 * expression.cs (Invocation.DoResolve): Applied Ben Maurer's patch
18723 for #56176 and made it actually work.
18725 2004-05-25 Martin Baulig <martin@ximian.com>
18727 * ecore.cs (Expression.CacheTemporaries): Make this virtual.
18728 (FieldExpr, PropertyExpr): Override and implement
18729 CacheTemporaries. Fixes #52279.
18731 2004-05-25 Miguel de Icaza <miguel@ximian.com>
18733 * location.cs: In the new compiler listing a file twice is a
18734 warning, not an error.
18736 2004-05-24 Martin Baulig <martin@ximian.com>
18738 * enum.cs (Enum.DefineType): For the `BaseType' to be a
18739 TypeLookupExpression; otherwise, report a CS1008. Fixes #58571.
18741 2004-05-24 Martin Baulig <martin@ximian.com>
18743 * decl.cs (DeclSpace.FindType): Try doing an alias lookup before
18744 walking the `using' list. Fixes #53921.
18746 2004-05-24 Martin Baulig <martin@ximian.com>
18748 * const.cs (Const.LookupConstantValue): Added support for
18749 EmptyCast's; fixes #55251.
18751 2004-05-24 Martin Baulig <martin@ximian.com>
18753 * ecore.cs (SimpleName.SimpleNameResolve): Renamed to
18754 DoSimpleNameResolve() and provide a SimpleNameResolve() wrapper
18755 which does the CS0135 check. The reason is that we first need to
18756 check whether the variable actually exists.
18758 2004-05-24 Martin Baulig <martin@ximian.com>
18760 * class.cs (MemberBase.DoDefine): Use DeclSpace.FindType() rather
18761 than RootContext.LookupType() to find the explicit interface
18762 type. Fixes #58584.
18764 2004-05-24 Raja R Harinath <rharinath@novell.com>
18766 * Makefile: Simplify. Use executable.make.
18767 * mcs.exe.sources: New file. List of sources of mcs.exe.
18769 2004-05-24 Anders Carlsson <andersca@gnome.org>
18773 Use the invariant culture when doing String.Compare for CLS case
18776 2004-05-23 Martin Baulig <martin@ximian.com>
18778 * decl.cs (DeclSpace.FindType): Only check the `using' list if we
18779 don't have any dots. Fixes #52622, added cs0246-8.cs.
18781 * namespace.cs (NamespaceEntry.Lookup): Likewise.
18783 2004-05-23 Marek Safar <marek.safar@seznam.cz>
18785 * class.cs (MemberBase.Define): Reuse MemberType member for
18786 resolved type. Other methods can use it too.
18788 2004-05-23 Martin Baulig <martin@ximian.com>
18790 * ecore.cs (SimpleName.SimpleNameResolve): Only report a CS0135 if
18791 the variable also exists in the current block (otherwise, we need
18792 to report a CS0103). Fixes #58670.
18794 2004-05-23 Martin Baulig <martin@ximian.com>
18796 * flowanalysis.cs (Reachability.Reachable): Compute this
18797 on-the-fly rather than storing it as a field.
18799 2004-05-23 Martin Baulig <martin@ximian.com>
18801 * flowanalysis.cs (Reachability.And): Manually compute the
18802 resulting `barrier' from the reachability.
18804 2004-05-23 Marek Safar <marek.safar@seznam.cz>
18807 * attribute.cs (AttributeTester.GetMethodObsoleteAttribute): Returns
18808 instance of ObsoleteAttribute when symbol is obsolete.
18811 (IMethodData): Extended interface for ObsoleteAttribute support.
18813 2004-05-22 Marek Safar <marek.safar@seznam.cz>
18815 * attribute.cs: Fix bug #55970
18817 2004-05-22 Marek Safar <marek.safar@seznam.cz>
18821 (GetObsoleteAttribute): New method. Creates the instance of
18823 (AttributeTester.GetMemberObsoleteAttribute): Returns instance of
18824 ObsoleteAttribute when member is obsolete.
18825 (AttributeTester.Report_ObsoleteMessage): Common method for
18826 Obsolete error/warning reporting.
18829 (TypeContainer.base_classs_type): New member for storing parent type.
18832 (MemberCore.GetObsoleteAttribute): Returns instance of ObsoleteAttribute
18833 for this MemberCore.
18835 2004-05-21 Marek Safar <marek.safar@seznam.cz>
18837 * attribute.cs, const.cs: Fix bug #58590
18839 2004-05-21 Martin Baulig <martin@ximian.com>
18841 * flowanalysis.cs (FlowBranching.MergeTopBlock): Don't check for
18842 out parameters if the end of the method is unreachable. Fixes
18845 2004-05-21 Marek Safar <marek.safar@seznam.cz>
18847 * codegen.cs, cs-parser.jay: Removed SetAttributes method.
18848 Hari was right, why extra method.
18850 2004-05-21 Marek Safar <marek.safar@seznam.cz>
18852 * attribute.cs, cs-parser.jay: Fix errors/cs0579-7.cs.
18854 2004-05-20 Martin Baulig <martin@ximian.com>
18856 Merged this back from gmcs to keep the differences to a minumum.
18858 * attribute.cs (Attribute.CheckAttributeType): Take an EmitContext
18859 instead of a Declspace.
18860 (Attribute.ResolveType): Likewise.
18861 (Attributes.Search): Likewise.
18862 (Attributes.Contains): Likewise.
18863 (Attributes.GetClsCompliantAttribute): Likewise.
18865 * class.cs (TypeContainer.VerifyMembers): Added EmitContext
18867 (MethodData.ApplyAttributes): Take an EmitContext instead of a
18870 2004-05-19 Marek Safar <marek.safar@seznam.cz>
18872 Fix bug #58688 (MCS does not report error when the same attribute
18875 * attribute.cs (Attribute.Emit): Distinction between null and default.
18877 2004-05-19 Raja R Harinath <rharinath@novell.com>
18879 * cs-parser.jay (attribute): Create a GlobalAttribute for the case
18880 of a top-level attribute without an attribute target.
18881 * attribute.cs (Attribute.Error_AttributeConstructorMismatch):
18883 (Attribute.Conditional_GetConditionName),
18884 (Attribute.Obsolete_GetObsoleteMessage): Update.
18885 (Attribute.IndexerName_GetIndexerName): New. Attribute-specific
18886 part of ScanForIndexerName.
18887 (Attribute.CanIgnoreInvalidAttribute): New function.
18888 (Attribute.ScanForIndexerName): Move to ...
18889 (Attributes.ScanForIndexerName): ... here.
18890 (Attributes.Attrs): Rename from now-misnamed AttributeSections.
18891 (Attributes.Search): New internal variant that can choose not to
18892 complain if types aren't resolved. The original signature now
18894 (Attributes.GetClsCompliantAttribute): Use internal variant, with
18895 complaints suppressed.
18896 (GlobalAttribute.CheckAttributeType): Overwrite ds.NamespaceEntry
18897 only if it not useful.
18898 (CanIgnoreInvalidAttribute): Ignore assembly attribute errors at
18899 top-level for attributes that are shared between the assembly
18900 and a top-level class.
18901 * parameter.cs (ImplicitParameter): Rename from ParameterAtribute.
18902 * class.cs: Update to reflect changes.
18903 (DefineIndexers): Fuse loops.
18904 * codegen.cs (GetAssemblyName): Update to reflect changes. Accept
18905 a couple more variants of attribute names.
18907 2004-05-18 Marek Safar <marek.safar@seznam.cz>
18909 Fix bug #52585 (Implemented explicit attribute declaration)
18912 (Attributable.ValidAttributeTargets): New abstract method. It gets
18913 list of valid attribute targets for explicit target declaration.
18914 (Attribute.Target): It holds target itself.
18915 (AttributeSection): Removed.
18916 (Attribute.CheckTargets): New method. It checks whether attribute
18917 target is valid for the current element.
18920 (EventProperty): New class. For events that are declared like
18921 property (with add and remove accessors).
18922 (EventField): New class. For events that are declared like field.
18925 * cs-parser.jay: Implemented explicit attribute target declaration.
18927 * class.cs, decl.cs, delegate.cs, enum.cs, parameter.cs:
18928 Override ValidAttributeTargets.
18931 (ReturnParameter): Class for applying custom attributes on
18933 (ParameterAtribute): New class. Class for applying custom
18934 attributes on the parameter type.
18936 2004-05-17 Miguel de Icaza <miguel@ximian.com>
18938 * class.cs (MemberBase.DoDefine): Pass UNSAFE on interface
18941 (Method): Allow UNSAFE here.
18943 * modifiers.cs: Support unsafe reporting.
18945 2004-05-17 Marek Safar <marek.safar@seznam.cz>
18947 * decl.cs: Fix bug #58478.
18949 2004-05-17 Gonzalo Paniagua Javier <gonzalo@ximian.com>
18951 * statement.cs: When checking for unreachable code on an EmptyStatement,
18952 set the location. Fixes bug #58488.
18954 2004-05-13 Miguel de Icaza <miguel@ximian.com>
18956 * driver.cs: Add -pkg handling.
18958 From Gonzalo: UseShelLExecute=false
18960 2004-05-12 Marek Safar <marek.safar@seznam.cz>
18963 (Attribute.GetAttributeTargets): New method. Gets AttributeTargets
18965 (Attribute.IsClsCompliaceRequired): Moved to base for better
18967 (Attribute.UsageAttribute): New property for AttributeUsageAttribute
18968 when attribute is AttributeUsageAttribute.
18969 (Attribute.GetValidTargets): Simplified.
18970 (Attribute.GetAttributeUsage): New method returns AttributeUsage
18971 attribute for this type.
18972 (Attribute.ApplyAttributes): Method renamed to Emit and make
18974 (GlobalAttributeSection): New class for special handling of global
18975 attributes (assembly, module).
18976 (AttributeSection.Emit): New method.
18978 * class.cs: Implemented Attributable abstract methods.
18979 (MethodCore.LabelParameters): Moved to Parameter class.
18980 (Accessor): Is back simple class.
18981 (PropertyMethod): Implemented Attributable abstract class.
18982 (DelegateMethod): Implemented Attributable abstract class.
18983 (Event): New constructor for disctintion between normal Event
18984 and Event with accessors.
18986 * cs-parser.jay: Used new Event ctor and GlobalAttributeSection.
18988 * codegen.cs, const.cs, decl.cs, delegate.cs:
18989 (CommonAssemblyModulClass): Implemented Attributable abstract class
18992 * enum.cs: Implement IAttributeSupport interface.
18993 (EnumMember): New class for emum members. Implemented Attributable
18997 (ParameterBase): Is abstract.
18998 (ReturnParameter): New class for easier [return:] attribute handling.
19000 * typemanager.cs: Removed builder_to_attr.
19002 2004-05-11 Raja R Harinath <rharinath@novell.com>
19005 * attribute.cs (Attribute.GetPositionalValue): New function.
19006 * class.cs (TypeContainer.VerifyMembers): New function.
19007 (TypeContainer.Emit): Use it.
19008 (ClassOrStruct): New base class for Class and Struct.
19009 (ClassOrStruct.ApplyAttributeBuilder): New function. Note if
19010 StructLayout(LayoutKind.Explicit) was ascribed to the struct or
19012 (ClassOrStruct.VerifyMembers): If the struct is explicitly laid out,
19013 then each non-static field should have a FieldOffset attribute.
19014 Otherwise, none of the fields should have a FieldOffset attribute.
19015 * rootcontext.cs (RootContext.ResolveCore): Resolve StructLayout
19016 and FieldOffset attributes.
19017 * typemanager.cs (TypeManager.struct_layout_attribute_type)
19018 (TypeManager.field_offset_attribute_type): New core types.
19019 (TypeManager.InitCoreTypes): Initialize them.
19021 2004-05-11 Michal Moskal <malekith@pld-linux.org>
19023 * class.cs (Event.RemoveDelegateMethod.DelegateMethodInfo):
19024 Return correct type.
19027 2004-05-09 Miguel de Icaza <miguel@ximian.com>
19029 * expression.cs (Binary.DoNumericPromotions): 0 long constant can
19030 be implicitly converted to ulong.
19032 * expression.cs: The logic for allowing operator &, | and ^ worked
19033 was wrong, it worked before because we did not report an error in
19034 an else branch. Fixes 57895.
19036 * class.cs: Applied patch from iain@mccoy.id.au Iain McCoy to
19037 allow volatile fields to be reference types.
19039 2004-05-07 Miguel de Icaza <miguel@ximian.com>
19041 * driver.cs: Add support for /debug-
19043 2004-05-07 Raja R Harinath <rharinath@novell.com>
19045 * attribute.cs (Attribute.CheckAttributeType, Attribute.ResolveType):
19046 Add a 'complain' parameter to silence errors.
19047 (Attribute.Resolve): Update to changes. Put in sanity check to catch
19048 silently overlooked type-resolutions.
19049 (Attribute.ScanForIndexerName, Attribute.DefinePInvokeMethod): Update
19050 to reflect changes.
19051 (Attributes.Search): New function.
19052 (Attributes.Contains, Attributes.GetClsCompliantAttribute): Use Search.
19053 (Attributes.GetAttributeFullName): Remove hack.
19054 * class.cs (MethodCore.LabelParameters, MethodData.ApplyAttributes):
19055 Update to reflect changes.
19056 * codegen.cs (CommonAssemblyModulClass.GetClsCompliantAttribute):
19057 Use Attributes.Search instead of nested loops.
19059 2004-05-07 Marek Safar <marek.safar@seznam.cz>
19062 (MemberCore.Flags): Extended for caching presence of CLSCompliantAttribute.
19063 (MemberCore.VerifyClsCompliance): Implemented CS3019 error report.
19064 (DeclSpace.GetClsCompliantAttributeValue): Returns simple bool.
19066 * report.cs: (Report.Warning): Renamed to Warning_T because of
19067 parameter collision.
19069 2004-05-05 Raja R Harinath <rharinath@novell.com>
19071 * expression.cs (MemberAccess.ResolveMemberAccess):
19072 Exit with non-zero status after Report.Error.
19073 * rootcontext.cs (RootContext.BootstrapCorlib_ResolveDelegate):
19075 * typemanager.cs (TypeManager.CoreLookupType): Likewise.
19077 2004-05-04 Lluis Sanchez Gual <lluis@ximian.com>
19079 * support.cs: Don't hang when the file is empty.
19081 2004-05-04 Lluis Sanchez Gual <lluis@ximian.com>
19083 * support.cs: In SeekableStreamReader, compute the preamble size of the
19084 underlying stream. Position changes should take into account that initial
19087 2004-05-03 Todd Berman <tberman@sevenl.net>
19089 * driver.cs: remove unused GetSysVersion function.
19091 2004-05-03 Todd Berman <tberman@sevenl.net>
19093 * driver.cs: Remove the hack from saturday, as well as the hack
19094 from jackson (LoadAssemblyFromGac), also adds the CWD to the
19095 link_paths to get that bit proper.
19097 2004-05-01 Todd Berman <tberman@sevenl.net>
19099 * driver.cs: Try a LoadFrom before a Load, this checks the current
19100 path. This is currently a bug in mono that is be fixed, however, this
19101 provides a workaround for now. This will be removed when the bug
19104 2004-05-01 Sebastien Pouliot <sebastien@ximian.com>
19106 * CryptoConvert.cs: Updated to latest version. Fix issue with
19107 incomplete key pairs (#57941).
19109 2004-05-01 Todd Berman <tberman@sevenl.net>
19111 * driver.cs: Remove '.' from path_chars, now System.* loads properly
19114 2004-04-30 Jackson Harper <jackson@ximian.com>
19116 * codegen.cs: Open keys readonly.
19118 2004-04-30 Gonzalo Paniagua Javier <gonzalo@ximian.com>
19120 * typemanager.cs: don't report cyclic struct layout when a struct
19121 contains 2 or more fields of the same type. Failed for Pango.AttrShape
19122 which has 2 Pango.Rectangle fields.
19124 2004-04-29 Ben Maurer <bmaurer@users.sourceforge.net>
19126 * expression.cs: Handle IntPtr comparisons with IL code
19127 rather than a method call.
19129 2004-04-29 Martin Baulig <martin@ximian.com>
19131 * ecore.cs (PropertyExpr.FindAccessor): New private method. Walk
19132 the list of PropertyInfo's in class hierarchy and find the
19133 accessor. Fixes #56013.
19135 2004-04-29 Martin Baulig <martin@ximian.com>
19137 * typemanager.cs (TypeManager.CheckStructCycles): Fixed.
19139 2004-04-29 Martin Baulig <martin@ximian.com>
19141 Applying a patch from Benjamin Jemlich <pcgod@gmx.net>.
19143 * ecore.cs (FieldExpr.AddressOf): Make this work for valuetypes.
19145 2004-04-29 Martin Baulig <martin@ximian.com>
19147 * class.cs (ConstructorInitializer.Resolve): Check whether the
19148 parent .ctor is accessible. Fixes #52146.
19150 2004-04-29 Martin Baulig <martin@ximian.com>
19152 Applying a patch from Benjamin Jemlich <pcgod@gmx.net>.
19154 * statement.cs (Using.EmitLocalVariableDecls): Use
19155 TypeManager.idisposable_type, not typeof (IDisposable).
19156 (Foreach.EmitCollectionForeach): Added support for valuetypes.
19158 2004-04-29 Martin Baulig <martin@ximian.com>
19160 * class.cs (Event.Define): Don't emit the field and don't set
19161 RTSpecialName and SpecialName for events on interfaces. Fixes
19164 2004-04-29 Raja R Harinath <rharinath@novell.com>
19166 Refactor Attribute.ApplyAttributes.
19167 * attribute.cs (Attributable): New base class for objects that can
19168 have Attributes applied on them.
19169 (Attribute): Make AttributeUsage fields public.
19170 (Attribute.GetFieldValue, Attribute.GetMarshal): Make non-static.
19171 (Attribute.IsInternalCall): New property.
19172 (Attribute.UsageAttr): Convert to a public read-only property.
19173 (Attribute.CheckAttributeType): Use a DeclSpace, not an EmitContext.
19174 (Attribute.ResolveType, Attribute.Resolve)
19175 (Attribute.ScanForIndexerName): Update to reflect changes.
19176 (Attribute.CheckAttributeTarget): Re-format.
19177 (Attribute.ApplyAttributes): Refactor, to various
19178 Attributable.ApplyAttributeBuilder methods.
19179 * decl.cs (MemberCore): Make Attributable.
19180 * class.cs (Accessor): Make Attributable.
19181 (MethodData.ApplyAttributes): Use proper attribute types, not
19183 (TypeContainer.LabelParameters): Pass Parameter to ApplyAttributes.
19184 (TypeContainer.ApplyAttributeBuilder)
19185 (Method.ApplyAttributeBuilder, Constructor.ApplyAttributeBuilder)
19186 (Field.ApplyAttributeBuilder, Accessor.ApplyAttributeBuilder)
19187 (PropertyBase.ApplyAttributeBuilder, Event.ApplyAttributeBuilder)
19188 (Operator.ApplyAttributeBuilder): New factored-out methods.
19189 * const.cs (Const.ApplyAttributeBuilder): Likewise.
19190 * delegate.cs (Delegate.ApplyAttributeBuilder): Likewise.
19191 * enum.cs (Enum.ApplyAttributeBuilder): Likewise.
19192 * parameter.cs (ParameterBase): New Attributable base class
19193 that can also represent Return types.
19194 (Parameter): Update to the changes.
19196 2004-04-29 Jackson Harper <jackson@ximian.com>
19198 * driver.cs: Prefer the corlib system version when looking for
19199 assemblies in the GAC. This is still a hack, but its a better hack
19202 2004-04-29 Marek Safar <marek.safar@seznam.cz>
19204 * decl.cs, enum.cs: Improved error 3005 reporting.
19206 * report.cs (SymbolRelatedToPreviousError): New method for error reporting.
19207 (related_symbols): New private member for list of symbols
19208 related to reported error/warning.
19210 * tree.cs: Do not use now obsolete Report.LocationOfPreviousError.
19212 2004-04-29 Martin Baulig <martin@ximian.com>
19214 * ecore.cs (Expression.Constantify): If we're an enum and
19215 TypeManager.TypeToCoreType() doesn't give us another type, use
19216 t.UnderlyingSystemType. Fixes #56178.
19218 2004-04-29 Martin Baulig <martin@ximian.com>
19220 * decl.cs (MemberCache.SetupCacheForInterface): Look over all our
19221 interfaces and for each interface, only add members directly
19222 declared in that interface. Fixes #53255.
19224 2004-04-28 Martin Baulig <martin@ximian.com>
19226 * expression.cs (ConditionalLogicalOperator): Use a temporary
19227 variable for `left' to avoid that we evaluate it more than once;
19230 2004-04-28 Martin Baulig <martin@ximian.com>
19232 * expression.cs (ComposedCast.DoResolveAsTypeStep): Don't allow
19235 2004-04-28 Martin Baulig <martin@ximian.com>
19237 * statement.cs (LocalInfo.Resolve): Check whether the type is not
19240 * class.cs (MemberBase.CheckParameters, FieldBase.DoDefine): Check
19241 whether the type is not void (CS1547).
19243 2004-04-28 Martin Baulig <martin@ximian.com>
19245 * expression.cs (Unary.DoResolveLValue): Override this and report
19246 CS0131 for anything but Operator.Indirection.
19248 2004-04-28 Martin Baulig <martin@ximian.com>
19250 Committing a patch from Ben Maurer; see bug #50820.
19252 * typemanager.cs (TypeManager.FilterWithClosure): Added CS1540
19255 * ecore.cs (Expression.MemberLookupFailed): Added CS1540 check for
19258 2004-04-28 Martin Baulig <martin@ximian.com>
19260 Committing a patch from Ben Maurer; see bug #50820.
19262 * typemanager.cs (TypeManager.FilterWithClosure): Added CS1540
19265 * ecore.cs (Expression.MemberLookupFailed): Added CS1540 check for
19268 2004-04-28 Martin Baulig <martin@ximian.com>
19270 * statement.cs (Block.LookupLabel): Also lookup in implicit child blocks.
19271 (Block.AddLabel): Call DoLookupLabel() to only search in the
19274 2004-04-28 Martin Baulig <martin@ximian.com>
19276 * cfold.cs (ConstantFold.BinaryFold): Added special support for
19277 comparing StringConstants and NullLiterals in Equality and Inequality.
19279 2004-04-28 Jackson Harper <jackson@ximian.com>
19281 * driver.cs: Attempt to load referenced assemblies from the
19282 GAC. This is the quick and dirty version of this method that
19283 doesnt take into account versions and just takes the first
19284 canidate found. Will be good enough for now as we will not have more
19285 then one version installed into the GAC until I update this method.
19287 2004-04-28 Martin Baulig <martin@ximian.com>
19289 * typemanager.cs (TypeManager.CheckStructCycles): New public
19290 static method to check for cycles in the struct layout.
19292 * rootcontext.cs (RootContext.PopulateTypes): Call
19293 TypeManager.CheckStructCycles() for each TypeContainer.
19294 [Note: We only need to visit each type once.]
19296 2004-04-28 Martin Baulig <martin@ximian.com>
19298 * constant.cs (StringConstant.Emit): Emit Ldnull if we're null.
19300 * const.cs (Const.LookupConstantValue): Return a `bool' signalling
19301 success and added `out object value'. Use a `bool resolved' field
19302 to check whether we've already been called rather than
19303 `ConstantValue != null' since this breaks for NullLiterals.
19305 2004-04-28 Raja R Harinath <rharinath@novell.com>
19307 * driver.cs (Driver.MainDriver) [IsModuleOnly]: Open code the
19308 setting of this flag, since the 'set' method may be non-public.
19310 2004-04-28 Raja R Harinath <rharinath@novell.com>
19312 * flowanalysis.cs (FlowBranchingException.LookupLabel): Add a null
19313 check on current_vector.Block.
19315 2004-04-27 Martin Baulig <martin@ximian.com>
19317 * expression.cs (BaseAccess.CommonResolve): Don't allow `base' in
19318 a field initializer. Fixes #56459.
19320 2004-04-27 Martin Baulig <martin@ximian.com>
19322 * ecore.cs (PropertyExpr.DoResolve/DoResolveLValue): Check whether
19323 we're not attempting to use an indexer. Fixes #52154.
19325 2004-04-27 Martin Baulig <martin@ximian.com>
19327 * statement.cs (Return): Don't create a return label if we don't
19328 need it; reverts my change from January 20th. Thanks to Ben
19331 2004-04-27 Martin Baulig <martin@ximian.com>
19333 According to the spec, `goto' can only leave a nested scope, but
19336 * statement.cs (Block.LookupLabel): Only lookup in the current
19337 block, don't recurse into parent or child blocks.
19338 (Block.AddLabel): Check in parent and child blocks, report
19339 CS0140/CS0158 if we find a duplicate.
19340 (Block): Removed this indexer for label lookups.
19341 (Goto.Resolve): Call LookupLabel() on our current FlowBranching;
19342 this already does the error reporting for us.
19345 (FlowBranching.UsageVector.Block): New public variable; may be null.
19346 (FlowBranching.CreateSibling): Added `Block' argument.
19347 (FlowBranching.LookupLabel): New public virtual method. Lookup a
19348 label for the target of a `goto' and check whether we're not
19349 leaving a `finally'.
19351 2004-04-27 Martin Baulig <martin@ximian.com>
19353 * flowanalysis.cs (FlowBranching.UsageVector.MergeChild): If we're
19354 a finite loop block, also do the ALWAYS->SOMETIMES for throws (not
19357 2004-04-27 Martin Baulig <martin@ximian.com>
19359 * statement.cs (Block.AddLabel): Also check for implicit blocks
19360 and added a CS0158 check.
19362 2004-04-27 Martin Baulig <martin@ximian.com>
19364 * flowanalysis.cs (FlowBranchingLoop): New class.
19365 (FlowBranching.UsageVector.MergeJumpOrigins): Take a list of
19366 UsageVector's instead of an ArrayList.
19367 (FlowBranching.Label): Likewise.
19368 (FlowBranching.UsageVector.MergeBreakOrigins): New method.
19369 (FlowBranching.AddBreakVector): New method.
19371 2004-04-27 Miguel de Icaza <miguel@ximian.com>
19373 * attribute.cs: Small regression fix: only convert the type if we
19374 the type is different, fixes System.Drawing build.
19376 2004-04-27 Martin Baulig <martin@ximian.com>
19378 * attribute.cs (Attribute.Resolve): If we have a constant value
19379 for a named field or property, implicity convert it to the correct
19382 2004-04-27 Raja R Harinath <rharinath@novell.com>
19384 * statement.cs (Block.Block): Implicit blocks share
19385 'child_variable_names' fields with parent blocks.
19386 (Block.AddChildVariableNames): Remove.
19387 (Block.AddVariable): Mark variable as "used by a child block" in
19388 every surrounding block.
19389 * ecore.cs (SimpleName.SimpleNameResolve): If the name has already
19390 been used in a child block, complain about violation of "Invariant
19391 meaning in blocks" rule.
19392 * cs-parser.jay (declare_local_variables): Don't use
19393 AddChildVariableNames.
19394 (foreach_statement): Don't create an implicit block: 'foreach'
19395 introduces a scope.
19397 2004-04-23 Miguel de Icaza <miguel@ximian.com>
19399 * convert.cs (ImplicitNumericConversion): 0 is also positive when
19400 converting from 0L to ulong. Fixes 57522.
19402 2004-04-22 Marek Safar <marek.safar@seznam.cz>
19404 * decl.cs (FindMemberToOverride): Fix wrong warning for case when
19405 derived class hides via 'new' keyword field from base class (test-242.cs).
19406 TODO: Handle this in the more general way.
19408 * class.cs (CheckBase): Ditto.
19410 2004-04-22 Marek Safar <marek.safar@seznam.cz>
19412 * decl.cs (caching_flags): New member for storing cached values
19414 (MemberCore.Flags): New enum where bit flags for caching_flags
19416 (MemberCore.cls_compliance): Moved to caching_flags.
19417 (DeclSpace.Created): Moved to caching_flags.
19419 * class.cs: Use caching_flags instead of DeclSpace.Created
19421 2004-04-21 Miguel de Icaza <miguel@ximian.com>
19423 * ecore.cs (PropertyExpr.GetAccesor): Only perform the 1540 check
19424 if we are only a derived class, not a nested class.
19426 * typemanager.cs: Same as above, but do this at the MemberLookup
19427 level (used by field and methods, properties are handled in
19428 PropertyExpr). Allow for the qualified access if we are a nested
19431 2004-04-21 Marek Safar <marek.safar@seznam.cz>
19433 * class.cs: Refactoring.
19434 (IMethodData): New inteface; Holds links to parent members
19435 to avoid member duplication (reduced memory allocation).
19436 (Method): Implemented IMethodData interface.
19437 (PropertyBase): New inner classes for get/set methods.
19438 (PropertyBase.PropertyMethod): Implemented IMethodData interface
19439 (Event): New inner classes for add/remove methods.
19440 (Event.DelegateMethod): Implemented IMethodData interface.
19442 * cs-parser.jay: Pass DeclSpace to Event class for creation of valid
19443 EmitContext (related to class.cs refactoring).
19445 2004-04-21 Raja R Harinath <rharinath@novell.com>
19447 * delegate.cs (Delegate.VerifyApplicability): If the number of
19448 arguments are the same as the number of parameters, first try to
19449 verify applicability ignoring any 'params' modifier on the last
19453 2004-04-16 Raja R Harinath <rharinath@novell.com>
19455 * class.cs (TypeContainer.AddIndexer): Use
19456 'ExplicitInterfaceName' to determine if interface name was
19457 explicitly specified. 'InterfaceType' is not initialized at this time.
19458 (TypeContainer.DefineIndexers): Remove use of temporary list. The
19459 Indexers array is already in the required order. Initialize
19460 'IndexerName' only if there are normal indexers.
19461 (TypeContainer.DoDefineMembers): Don't initialize IndexerName.
19462 (TypeContainer.Emit): Emit DefaultMember attribute only if
19463 IndexerName is initialized.
19466 2004-04-15 Benjamin Jemlich <pcgod@gmx.net>
19468 * enum.cs (Enum.DefineType): Don't allow char as type for enum.
19471 2004-04-15 Raja R Harinath <rharinath@novell.com>
19473 * attribute.cs (Attribute.CheckAttributeType): Check for ambiguous
19477 * attribute.cs (Attribute.Resolve): Check for duplicate named
19481 2004-04-15 Miguel de Icaza <miguel@ximian.com>
19483 * iterators.cs (MarkYield): track whether we are in an exception,
19484 and generate code accordingly. Use a temporary value to store the
19485 result for our state.
19487 I had ignored a bit the interaction of try/catch with iterators
19488 since their behavior was not entirely obvious, but now it is
19489 possible to verify that our behavior is the same as MS .NET 2.0
19493 2004-04-14 Miguel de Icaza <miguel@ximian.com>
19495 * iterators.cs: Avoid creating temporaries if there is no work to
19498 * expression.cs (ArrayAccess.EmitLoadOpcode): If dealing with
19499 Enumerations, use TypeManager.EnumToUnderlying and call
19502 Based on the patch from Benjamin Jemlich (pcgod@gmx.net), fixes
19505 (This.Emit): Use EmitContext.EmitThis to emit our
19508 (This.EmitAssign): Ditto.
19510 * ecore.cs (FieldExpr.Emit): Remove RemapToProxy special
19511 codepaths, we will move all the functionality into
19514 (FieldExpr.EmitAssign): Ditto.
19516 This fixes several hidden bugs that I uncovered while doing a code
19517 review of this today.
19519 * codegen.cs (EmitThis): reworked so the semantics are more clear
19520 and also support value types "this" instances.
19522 * iterators.cs: Changed so that for iterators in value types, we
19523 do not pass the value type as a parameter.
19525 Initialization of the enumerator helpers is now done in the caller
19526 instead of passing the parameters to the constructors and having
19527 the constructor set the fields.
19529 The fields have now `assembly' visibility instead of private.
19531 2004-04-11 Miguel de Icaza <miguel@ximian.com>
19533 * expression.cs (Argument.Resolve): Check if fields passed as ref
19534 or out are contained in a MarshalByRefObject.
19536 * typemanager.cs, rootcontext.cs: Add System.Marshalbyrefobject as
19537 another compiler type.
19539 2004-04-06 Ben Maurer <bmaurer@users.sourceforge.net>
19541 * class.cs (Indexer.Define): use the new name checking method.
19542 Also, return false on an error.
19543 * cs-tokenizer.cs (IsValidIdentifier): Checks for a valid identifier.
19544 (is_identifier_[start/part]_character): make static.
19546 2004-04-10 Miguel de Icaza <miguel@ximian.com>
19548 * expression.cs (Binary.ResolveOperator): Do no append strings
19549 twice: since we can be invoked more than once (array evaluation)
19550 on the same concatenation, take care of this here. Based on a fix
19551 from Ben (bug #56454)
19553 2004-04-08 Sebastien Pouliot <sebastien@ximian.com>
19555 * codegen.cs: Fix another case where CS1548 must be reported (when
19556 delay-sign isn't specified and no private is available #56564). Fix
19557 loading the ECMA "key" to delay-sign an assembly. Report a CS1548
19558 error when MCS is used on the MS runtime and we need to delay-sign
19559 (which seems unsupported by AssemblyBuilder - see #56621).
19561 2004-04-08 Marek Safar <marek.safar@seznam.cz>
19563 * typemanager.cs (TypeManager.TypeToCoreType): Handle IntPtr too.
19564 (TypeManager.ComputeNamespaces): Faster implementation for
19567 * compiler.csproj: Updated AssemblyName to mcs.
19569 2004-04-07 Miguel de Icaza <miguel@ximian.com>
19571 * rootcontext.cs: Add new types to the boot resolution.
19573 * ecore.cs (TypeExpr.CanInheritFrom): Inheriting from
19574 MulticastDelegate is not allowed.
19576 * typemanager.cs: Add new types to lookup: System.TypedReference
19579 * paramter.cs (Parameter.Resolve): if we are an out/ref parameter,
19580 check for TypedReference or ArgIterator, they are not allowed.
19582 * ecore.cs (BoxedCast): Set the eclass to ExprClass.Value, this
19583 makes us properly catch 1510 in some conditions (see bug 56016 for
19586 2004-04-06 Bernie Solomon <bernard@ugsolutions.com>
19588 * CryptoConvert.cs: update from corlib version
19591 2004-04-05 Miguel de Icaza <miguel@ximian.com>
19593 * class.cs (Indexer.Define): Check indexername declaration
19595 2004-04-05 Marek Safar <marek.safar@seznam.cz>
19597 * attribute.cs (IsClsCompliant): Fixed problem with handling
19598 all three states (compliant, not-compliant, undetected).
19600 2004-03-30 Marek Safar <marek.safar@seznam.cz>
19602 * attribute.cs (Attribute): Location is now public.
19603 (Resolve): Store resolved arguments (pos_values) in attribute class.
19604 Attribute extractors (now GetClsCompliantAttributeValue) can reuse them.
19605 (GetClsCompliantAttributeValue): New method that gets
19606 CLSCompliantAttribute value.
19607 (GetClsCompliantAttribute): Returns CLSCompliantAttribute for DeclSpace
19608 if exists else null.
19609 (AttributeTester): New class for CLS-Compliant verification routines.
19611 * class.cs (Emit): Add CLS-Compliant verification.
19612 (Method.GetSignatureForError): Implemented.
19613 (Constructor.GetSignatureForError): Implemented
19614 (Constructor.HasCompliantArgs): Returns if constructor has
19615 CLS-Compliant arguments.
19616 (Constructor.Emit): Override.
19617 (Construcor.IsIdentifierClsCompliant): New method; For constructors
19618 is needed to test only parameters.
19619 (FieldBase.GetSignatureForError): Implemented.
19620 (TypeContainer): New member for storing base interfaces.
19621 (TypeContainer.FindMembers): Search in base interfaces too.
19623 * codegen.cs (GetClsComplianceAttribute): New method that gets
19624 assembly or module CLSCompliantAttribute value.
19625 (ResolveClsCompliance): New method that resolve CLSCompliantAttribute
19627 (ModuleClass.Emit): Add error 3012 test.
19629 * const.cs (Emit): Override and call base for CLS-Compliant tests.
19631 * decl.cs (ClsComplianceValue): New enum that holds CLS-Compliant
19632 state for all decl types.
19633 (MemberCore.Emit): Emit is now virtual and call VerifyClsCompliance
19634 if CLS-Compliant tests are required.
19635 (IsClsCompliaceRequired): New method. Analyze whether code
19636 must be CLS-Compliant.
19637 (IsExposedFromAssembly): New method. Returns true when MemberCore
19638 is exposed from assembly.
19639 (GetClsCompliantAttributeValue): New method. Resolve CLSCompliantAttribute
19640 value or gets cached value.
19641 (HasClsCompliantAttribute): New method. Returns true if MemberCore
19642 is explicitly marked with CLSCompliantAttribute.
19643 (IsIdentifierClsCompliant): New abstract method. This method is
19644 used to testing error 3005.
19645 (IsIdentifierAndParamClsCompliant): New method. Common helper method
19646 for identifier and parameters CLS-Compliant testing.
19647 (VerifyClsCompliance): New method. The main virtual method for
19648 CLS-Compliant verifications.
19649 (CheckAccessLevel): In one special case (System.Drawing) was TypeBuilder
19650 null. I don't know why is null (too many public members !).
19651 (GetClsCompliantAttributeValue). New method. Goes through class hierarchy
19652 and get value of first CLSCompliantAttribute that found.
19654 * delegate.cs (Emit): Override and call base for CLS-Compliant tests.
19655 (VerifyClsCompliance): Override and add extra tests.
19657 * driver.cs (CSCParseOption): New command line options (clscheck[+|-]).
19658 clscheck- disable CLS-Compliant verification event if assembly is has
19659 CLSCompliantAttribute(true).
19661 * enum.cs (Emit): Override and call base for CLS-Compliant tests.
19662 ApllyAttribute is now called in emit section as in the other cases.
19663 Possible future Emit integration.
19664 (IsIdentifierClsCompliant): New override.
19665 (VerifyClsCompliance): New override.
19666 (GetEnumeratorName): Returns full enum name.
19668 * parameter.cs (GetSignatureForError): Implemented.
19670 * report.cs (WarningData): New struct for Warning message information.
19671 (LocationOfPreviousError): New method.
19672 (Warning): New method. Reports warning based on the warning table.
19673 (Error_T): New method. Reports error based on the error table.
19675 * rootcontext.cs (EmitCode): Added new Emit(s) because CLS-Compliant
19676 verifications are done here.
19678 * tree.cs (RecordDecl): Used new LocationOfPreviousError method.
19680 * typemanager.cs (cls_compliant_attribute_type): New member thath holds
19681 CLSCompliantAttribute.
19682 (all_imported_types): New member holds all imported types from other
19684 (LoadAllImportedTypes): New method fills static table with exported types
19685 from all referenced assemblies.
19686 (Modules): New property returns all assembly modules.
19688 2004-03-30 Miguel de Icaza <miguel@ximian.com>
19690 * cs-parser.jay: Add a rule to catch wrong event syntax instead of
19691 throwing a parser error.
19693 * ecore.cs (PropertyExpr.GetAccessor): Apply patch from Patrik Reali
19694 which removes the hardcoded get_/set_ prefixes for properties, as
19695 IL allows for the properties to be named something else.
19699 * expression.cs: Do not override operand before we know if it is
19700 non-null. Fix 56207
19702 2004-03-29 Ben Maurer <bmaurer@users.sourceforge.net>
19704 * typemanager.cs: support for pinned variables.
19706 2004-03-29 Ben Maurer <bmaurer@users.sourceforge.net>
19708 * decl.cs, typemanager.cs: Avoid using an arraylist
19709 as a buffer if there is only one result set.
19711 2004-03-29 Ben Maurer <bmaurer@users.sourceforge.net>
19713 * expression.cs: Make sure you cant call a static method
19714 with an instance expression, bug #56174.
19716 2004-03-29 Miguel de Icaza <miguel@ximian.com>
19718 * class.cs (IsDuplicateImplementation): Improve error reporting to
19719 flag 663 (method only differs in parameter modifier).
19721 * cs-tokenizer.cs: Do not require whitespace when a ( or " will do
19722 in preprocessor directives.
19724 * location.cs (LookupFile): Allow for the empty path.
19726 * attribute.cs (DefinePInvokeMethod): Fix 56148; I would like a
19727 better approach for some of that patch, but its failing with the
19728 CharSet enumeration. For now try/catch will do.
19730 * typemanager.cs: Do not crash if a struct does not have fields.
19733 2004-03-28 Ben Maurer <bmaurer@users.sourceforge.net>
19735 * expression.cs: cs0213, cant fix a fixed expression.
19738 2004-03-28 Ben Maurer <bmaurer@users.sourceforge.net>
19740 * cs-parser.jay: detect invalid embeded statements gracefully.
19743 2004-03-28 Ben Maurer <bmaurer@users.sourceforge.net>
19745 * ecore.cs, typemanager.cs: Correct impl of cs1540 check.
19748 the invocation type may not be a subclass of the tye of the item/
19749 The type of the item must be a subclass of the invocation item.
19754 2004-03-25 Sebastien Pouliot <sebastien@ximian.com>
19756 * attribute.cs: Added methods to get a string and a bool from an
19757 attribute. Required to information from AssemblyKeyFileAttribute,
19758 AttributeKeyNameAttribute (string) and AssemblyDelaySign (bool).
19759 * codegen.cs: Modified AssemblyName creation to include support for
19760 strongnames. Catch additional exceptions to report them as CS1548.
19761 * compiler.csproj: Updated include CryptoConvert.cs.
19762 * compiler.csproj.user: Removed file - user specific configuration.
19763 * CryptoConvert.cs: New. A COPY of the class CryptoConvert from
19764 Mono.Security assembly. The original class is maintained and tested in
19765 /mcs/class/Mono.Security/Mono.Security.Cryptography/CryptoConvert.cs.
19766 * drivers.cs: Added support for /keyfile, /keycontainer and /delaysign
19767 like CSC 8.0 (C# v2) supports.
19768 * Makefile: Added CryptoConvert.cs to mcs sources.
19769 * rootcontext.cs: Added new options for strongnames.
19771 2004-03-24 Ben Maurer <bmaurer@users.sourceforge.net>
19773 * driver.cs: For --expect-error, report error code `2'
19774 if the program compiled with no errors, error code `1' if
19775 it compiled with an error other than the one expected.
19777 2004-03-24 Sebastien Pouliot <sebastien@ximian.com>
19779 * compiler.csproj: Updated for Visual Studio .NET 2003.
19780 * compiler.csproj.user: Updated for Visual Studio .NET 2003.
19781 * compiler.sln: Updated for Visual Studio .NET 2003.
19783 2004-03-24 Ravi Pratap M <ravi@ximian.com>
19785 * expression.cs: Fix bug #47234. We basically need to apply the
19786 rule that we prefer the conversion of null to a reference type
19787 when faced with a conversion to 'object' (csc behaviour).
19789 2004-03-23 Ben Maurer <bmaurer@users.sourceforge.net>
19791 * statement.cs: Shorter form for foreach, eliminates
19792 a local variable. r=Martin.
19794 2004-03-23 Ben Maurer <bmaurer@users.sourceforge.net>
19796 * constant.cs, ecore.cs, literal.cs: New prop IsZeroInteger that
19797 checks if we can use brtrue/brfalse to test for 0.
19798 * expression.cs: use the above in the test for using brtrue/brfalse.
19799 cleanup code a bit.
19801 2004-03-23 Ben Maurer <bmaurer@users.sourceforge.net>
19803 * expression.cs: Rewrite string concat stuff. Benefits:
19805 - "a" + foo + "b" + "c" becomes "a" + foo + "bc"
19806 - "a" + foo + "b" + bar + "c" + baz ... uses concat (string []).
19807 rather than a concat chain.
19809 * typemanager.cs: Add lookups for more concat overloads.
19811 2004-03-23 Ben Maurer <bmaurer@users.sourceforge.net>
19813 * expression.cs: Emit shorter il code for array init.
19830 2004-03-22 Ben Maurer <bmaurer@users.sourceforge.net>
19832 * statement.cs: Before, two switch blocks would be merged if the
19833 total size of the blocks (end_item - begin_item + 1) was less than
19834 two times the combined sizes of the blocks.
19836 Now, it will only merge if after the merge at least half of the
19841 2004-03-20 Atsushi Enomoto <atsushi@ximian.com>
19843 * class.cs : csc build fix for GetMethods(). See bug #52503.
19845 2004-03-20 Ben Maurer <bmaurer@users.sourceforge.net>
19847 * expression.cs: Make sure fp comparisons work with NaN.
19848 This fixes bug #54303. Mig approved this patch a long
19849 time ago, but we were not able to test b/c the runtime
19852 2004-03-19 Miguel de Icaza <miguel@ximian.com>
19854 * ecore.cs (TypExpr.GetHashCode): implement this overload.
19856 2004-03-19 Martin Baulig <martin@ximian.com>
19858 * class.cs (MemberCore.IsDuplicateImplementation): Report the
19859 error here and not in our caller.
19861 2004-03-19 Martin Baulig <martin@ximian.com>
19863 * interface.cs: Completely killed this file.
19864 (Interface): We're now a TypeContainer and live in class.cs.
19866 * class.cs (TypeContainer.GetClassBases): Added `bool is_iface'
19867 argument; we're now also called for interfaces.
19868 (TypeContainer.DefineMembers): Allow this method being called
19870 (TypeContainer.GetMethods): New public method; formerly known as
19871 Interface.GetMethod(). This is used by PendingImplementation.
19872 (TypeContainer.EmitDefaultMemberAttr): Moved here from Interface;
19873 it's now private and non-static.
19874 (Interface): Moved this here; it's now implemented similar to
19876 (Method, Property, Event, Indexer): Added `bool is_interface'
19877 argument to their .ctor's.
19878 (MemberBase.IsInterface): New public field.
19880 * cs-parser.jay: Create normal Method, Property, Event, Indexer
19881 instances instead of InterfaceMethod, InterfaceProperty, etc.
19882 (opt_interface_base): Removed; we now use `opt_class_base' instead.
19883 (InterfaceAccessorInfo): Create `Get' and `Set' Accessor's.
19885 2004-03-19 Martin Baulig <martin@ximian.com>
19887 * class.cs (MethodCore.IsDuplicateImplementation): New private
19888 method which does the CS0111 checking.
19889 (Method.CheckBase, Constructor.CheckBase, PropertyBase.CheckBase):
19890 Use IsDuplicateImplementation().
19892 2004-03-17 Ben Maurer <bmaurer@users.sourceforge.net>
19894 * decl.cs (FindMemberToOverride): New method to find the correct
19895 method or property to override in the base class.
19897 - Make Method/Property use the above method to find the
19898 version in the base class.
19899 - Remove the InheritableMemberSignatureCompare as it is now
19902 This patch makes large code bases much faster to compile, as it is
19903 O(n) rather than O(n^2) to do this validation.
19905 Also, it fixes bug 52458 which is that nested classes are not
19906 taken into account when finding the base class member.
19908 Reviewed/Approved by Martin.
19910 2004-03-17 Marek Safar <marek.safar@seznam.cz>
19912 * interface.cs: In all interface classes removed redundant
19913 member initialization.
19915 2004-03-16 Martin Baulig <martin@ximian.com>
19917 * class.cs (TypeContainer.GetClassBases): Fix the CS0528 check.
19919 2004-03-15 Miguel de Icaza <miguel@ximian.com>
19921 * decl.cs (DefineTypeAndParents): New helper method to define a
19922 type's containers before the type itself is defined; This is a
19923 bug exposed by the recent changes to Windows.Forms when an
19924 implemented interface was defined inside a class that had not been
19927 * modifiers.cs (MethodAttr): All methods in C# are HideBySig.
19929 (Check): Loop correctly to report errors modifiers
19930 (UNSAFE was not in the loop, since it was the same as TOP).
19932 * interface.cs: Every interface member now takes a ModFlags,
19933 instead of a "is_new" bool, which we set on the base MemberCore.
19935 Every place where we called "UnsafeOk" in the interface, now we
19936 call the proper member (InterfaceMethod.UnsafeOK) instead to get
19937 the unsafe settings from the member declaration instead of the
19938 container interface.
19940 * cs-parser.jay (opt_new): Allow unsafe here per the spec.
19942 * pending.cs (TypeAndMethods): Add `get_indexer_name' and
19943 `set_indexer_name' to the pending bits (one per type).
19945 We fixed a bug today that was picking the wrong method to
19946 override, since for properties the existing InterfaceMethod code
19947 basically ignored the method name. Now we make sure that the
19948 method name is one of the valid indexer names.
19950 2004-03-14 Gustavo Giráldez <gustavo.giraldez@gmx.net>
19952 * support.cs (SeekableStreamReader): Keep track of stream byte
19953 positions and don't mix them with character offsets to the buffer.
19955 Patch from Gustavo Giráldez
19957 2004-03-15 Marek Safar <marek.safar@seznam.cz>
19959 * interface.cs (InterfaceSetGetBase): Removed double member
19960 initialization, base class does it as well.
19962 2004-03-13 Martin Baulig <martin@ximian.com>
19964 * class.cs: Reverted Miguel's latest commit; it makes mcs crash
19965 when compiling corlib.
19967 2004-03-13 Miguel de Icaza <miguel@ximian.com>
19969 * convert.cs (ExplicitConversion): We were reporting an error on
19970 certain conversions (object_type source to a value type, when the
19971 expression was `null') before we had a chance to pass it through
19972 the user defined conversions.
19974 * driver.cs: Replace / and \ in resource specifications to dots.
19977 * class.cs: Add check for duplicate operators. Fixes 52477
19979 2004-03-11 Miguel de Icaza <miguel@ximian.com>
19981 * statement.cs (Switch.SimpleSwitchEmit): Deal with default labels
19982 that are in the middle of the statements, not only at the end.
19985 * class.cs (TypeContainer.AddField): No longer set the
19986 `HaveStaticConstructor' flag, now we call it
19987 `UserDefineStaticConstructor' to diferentiate the slightly
19988 semantic difference.
19990 The situation is that we were not adding BeforeFieldInit (from
19991 Modifiers.TypeAttr) to classes that could have it.
19992 BeforeFieldInit should be set to classes that have no static
19997 http://www.yoda.arachsys.com/csharp/beforefieldinit.html
19999 And most importantly Zoltan's comment:
20001 http://bugzilla.ximian.com/show_bug.cgi?id=44229
20003 "I think beforefieldinit means 'it's ok to initialize the type sometime
20004 before its static fields are used', i.e. initialization does not need
20005 to be triggered by the first access to the type. Setting this flag
20006 helps the JIT to compile better code, since it can run the static
20007 constructor at JIT time, and does not need to generate code to call it
20008 (possibly lots of times) at runtime. Unfortunately, mcs does not set
20009 this flag for lots of classes like String.
20011 csc sets this flag if the type does not have an explicit static
20012 constructor. The reasoning seems to be that if there are only static
20013 initalizers for a type, and no static constructor, then the programmer
20014 does not care when this initialization happens, so beforefieldinit
20017 This bug prevents the AOT compiler from being usable, since it
20018 generates so many calls to mono_runtime_class_init that the AOT code
20019 is much slower than the JITted code. The JITted code is faster,
20020 because it does not generate these calls if the vtable is type is
20021 already initialized, which is true in the majority of cases. But the
20022 AOT compiler can't do this."
20024 2004-03-10 Miguel de Icaza <miguel@ximian.com>
20026 * class.cs (MethodData.Emit): Refactor the code so symbolic
20027 information is generated for destructors; For some reasons we
20028 were taking a code path that did not generate symbolic information
20031 2004-03-11 Ben Maurer <bmaurer@users.sourceforge.net>
20033 * class.cs: Create a Constructor.CheckBase method that
20034 takes care of all validation type code. The method
20035 contains some code that was moved from Define.
20037 It also includes new code that checks for duplicate ctors.
20038 This fixes bug #55148.
20040 2004-03-09 Joshua Tauberer <tauberer@for.net>
20042 * expression.cs (ArrayCreation): Fix: More than 6 nulls in
20043 a { ... }-style array creation invokes EmitStaticInitializers
20044 which is not good for reference-type arrays. String, decimal
20045 and now null constants (NullCast) are not counted toward
20046 static initializers.
20048 2004-03-05 Martin Baulig <martin@ximian.com>
20050 * location.cs (SourceFile.HasLineDirective): New public field;
20051 specifies whether the file contains or is referenced by a "#line"
20053 (Location.DefineSymbolDocuments): Ignore source files which
20054 either contain or are referenced by a "#line" directive.
20056 2004-02-29 Ben Maurer <bmaurer@users.sourceforge.net>
20058 * class.cs (Method.CheckBase): Avoid using FindMembers, we have
20059 direct access to our parent, so check the method inline there.
20061 2004-02-27 Ben Maurer <bmaurer@users.sourceforge.net>
20063 * expression.cs (Invocation.EmitCall): Miguel's last commit
20064 caused a regression. If you had:
20069 In Foo the implict this would be null.
20071 2004-02-27 Miguel de Icaza <miguel@ximian.com>
20073 * expression.cs (Invocation.EmitCall): If the method is not
20074 virtual, do not emit a CallVirt to it, use Call.
20076 * typemanager.cs (GetFullNameSignature): Improve the method to
20077 cope with ".ctor" and replace it with the type name.
20079 * class.cs (ConstructorInitializer.Resolve): Now the method takes
20080 as an argument the ConstructorBuilder where it is being defined,
20081 to catch the recursive constructor invocations.
20083 2004-02-26 Miguel de Icaza <miguel@ximian.com>
20085 * iterators.cs (IteratorHandler.IsIEnumerator, IsIEnumerable): New
20086 routines to check if a type is an enumerable/enumerator allow
20087 classes that implement the IEnumerable or IEnumerator interfaces.
20089 * class.cs (Property, Operator): Implement IIteratorContainer, and
20090 implement SetYields.
20092 (Property.Define): Do the block swapping for get_methods in the
20093 context of iterators. We need to check if Properties also
20094 include indexers or not.
20096 (Operator): Assign the Block before invoking the
20097 OperatorMethod.Define, so we can trigger the Iterator code
20100 * cs-parser.jay (SimpleIteratorContainer): new helper class. Both
20101 Property and Operator classes are not created when we parse the
20102 declarator but until we have the block completed, so we use a
20103 singleton SimpleIteratorContainer.Simple to flag whether the
20104 SetYields has been invoked.
20106 We propagate this setting then to the Property or the Operator to
20107 allow the `yield' to function.
20109 2004-02-25 Marek Safar <marek.safar@seznam.cz>
20111 * codegen.cs: Implemented attribute support for modules.
20112 New AssemblyClass, ModuleClass and CommonAssemblyModulClass for
20113 Assembly/Module functionality.
20115 * attribute.cs, class.cs, cs-parser.jay, delegate.cs, driver.cs, enum.cs
20116 interface.cs, rootcontext.cs, statement.cs, typemanager.cs:
20117 Updated dependencies on CodeGen.ModuleBuilder and CodeGen.AssemblyBuilder.
20119 2004-02-16 Marek Safar <marek.safar@seznam.cz>
20121 * interface.cs (FindMembers): The operation is performed on all base
20122 interfaces and not only on the first. It is required for future CLS Compliance patch.
20124 2004-02-12 Ben Maurer <bmaurer@users.sourceforge.net>
20126 * statement.cs, codegen.cs:
20127 This patch deals with patterns such as:
20129 public class List : IEnumerable {
20131 public MyEnumerator GetEnumerator () {
20132 return new MyEnumerator(this);
20135 IEnumerator IEnumerable.GetEnumerator () {
20139 public struct MyEnumerator : IEnumerator {
20144 Before, there were a few things we did wrong:
20145 1) we would emit callvirt on a struct, which is illegal
20146 2) we emited ldarg when we needed to emit ldarga
20147 3) we would mistakenly call the interface methods on an enumerator
20148 type that derived from IEnumerator and was in another assembly. For example:
20150 public class MyEnumerator : IEnumerator
20152 Would have the interface methods called, even if there were public impls of the
20153 method. In a struct, this lead to invalid IL code.
20155 2004-02-11 Marek Safar <marek.safar@seznam.cz>
20157 * const.cs: Const is now derived from FieldBase. Method EmitConstant name
20160 * delegate.cs (Define): Fixed crash when delegate type is undefined.
20162 2004-02-11 Miguel de Icaza <miguel@ximian.com>
20164 * cs-parser.jay: Fix small regression: we were not testing V2
20165 compiler features correctly.
20167 * interface.cs: If the emit context is null, then create one
20169 2004-02-09 Marek Safar <marek.safar@seznam.cz>
20171 * decl.cs (GetSignatureForError): New virtual method to get full name
20172 for error messages.
20174 * attribute.cs (IAttributeSupport): New interface for attribute setting.
20175 Now it is possible to rewrite ApplyAttributes method to be less if/else.
20177 * interface.cs : All InterfaceXXX classes are now derived from MemberCore.
20178 Duplicated members and code in these classes has been removed.
20179 Better encapsulation in these classes.
20181 2004-02-07 Miguel de Icaza <miguel@ximian.com>
20183 * assign.cs (Assign.DoResolve): When dealing with compound
20184 assignments, there is a new rule in ECMA C# 2.4 (might have been
20185 there before, but it is documented here) that states that in:
20189 If b is of type int, and the `op' is a shift-operator, then the
20190 above is evaluated as:
20194 * expression.cs (Binary.ResolveOperator): Instead of testing for
20195 int/uint/long/ulong, try to implicitly convert to any of those
20196 types and use that in pointer arithmetic.
20198 * delegate.cs (Error_NoMatchingMethodForDelegate): Compute the
20199 method to print information for from the type, not from the
20200 null-method we were given.
20202 2004-02-01 Duncan Mak <duncan@ximian.com>
20204 * cs-tokenizer.cs (get_cmd_arg): Skip over whitespace before
20205 parsing for cmd, fixes bug #53694.
20207 2004-02-04 Marek Safar <marek.safar@seznam.cz>
20209 * class.cs, decl.cs: Fixed problem where IndexerName attribute was ignored
20210 in the member name duplication tests. Property and operator name duplication
20211 was missing too (error tests cs0102-{2,3,4,5}.cs, cs0111-{3,4}.cs).
20213 2004-02-03 Marek Safar <marek.safar@seznam.cz>
20215 * interface.cs (PopulateMethod): Fixed crash when interface method
20216 returns not existing type (error test cs0246-3.cs).
20218 2004-02-02 Ravi Pratap M <ravi@ximian.com>
20220 * cs-parser.jay (interface_accessors): Re-write actions to also
20221 store attributes attached to get and set methods. Fix spelling
20224 (inteface_property_declaration): Modify accordingly.
20226 (InterfaceAccessorInfo): New helper class to store information to pass
20227 around between rules that use interface_accessors.
20229 * interface.cs (Emit): Apply attributes on the get and set
20230 accessors of properties and indexers too.
20232 * attribute.cs (ApplyAttributes): Modify accordingly to use the
20233 right MethodBuilder when applying attributes to the get and set accessors.
20235 2004-01-31 Miguel de Icaza <miguel@ximian.com>
20237 * cs-tokenizer.cs: Applied patch from Marek Safar to fix bug 53386
20239 2004-01-26 Miguel de Icaza <miguel@ximian.com>
20241 * cs-tokenizer.cs: Handle #line hidden from PDC bits.
20243 2004-01-25 Miguel de Icaza <miguel@ximian.com>
20245 * cs-parser.jay: Remove YIELD token, instead use the new grammar
20246 changes that treat `yield' specially when present before `break'
20247 or `return' tokens.
20249 * cs-tokenizer.cs: yield is no longer a keyword.
20251 2004-01-23 Marek Safar <marek.safar@seznam.cz>
20253 * cs-parser.jay, class.cs (DefineDefaultConstructor): Fixed ModFlags
20254 setting for default constructors.
20255 For default constructors are almost every time set wrong Modifier. The
20256 generated IL code has been alright. But inside mcs this values was
20257 wrong and this was reason why several of my CLS Compliance tests
20260 2004-01-22 Martin Baulig <martin@ximian.com>
20262 * cs-parser.jay (namespace_or_type_name): Return an Expression,
20263 not a QualifiedIdentifier. This is what `type_name_expression'
20264 was previously doing.
20265 (type_name_expression): Removed; the code is now in
20266 `namespace_or_type_name'.
20267 (qualified_identifier): Removed, use `namespace_or_type_name'
20269 (QualifiedIdentifier): Removed this class.
20271 2004-01-22 Martin Baulig <martin@ximian.com>
20273 * namespace.cs (NamespaceEntry.UsingAlias): Take an Expression,
20274 not a string as alias name.
20276 2004-01-21 Miguel de Icaza <miguel@ximian.com>
20278 * ecore.cs (FieldInfo.AddressOf): Revert patch from previous
20279 #52730 bug, and instead compute correctly the need to use a
20280 temporary variable when requesting an address based on the
20281 static/instace modified of the field and the constructor.
20283 2004-01-21 Martin Baulig <martin@ximian.com>
20285 * ecore.cs (SimpleName.ResolveAsTypeStep): Lookup in the current
20286 class and namespace before looking up aliases. Fixes #52517.
20288 2004-01-21 Martin Baulig <martin@ximian.com>
20290 * flowanalysis.cs (UsageVector.Merge): Allow variables being
20291 assinged in a 'try'; fixes exception4.cs.
20293 2004-01-21 Marek Safar <marek.safar@seznam.cz>
20294 * class.cs : Implemented parameter-less constructor for TypeContainer
20296 * decl.cs: Attributes are now stored here. New property OptAttributes
20298 * delegate.cs, enum.cs, interface.cs: Removed attribute member.
20300 * rootcontext.cs, tree.cs: Now use parameter-less constructor of TypeContainer
20302 2004-01-21 Marek Safar <marek.safar@seznam.cz>
20304 * typemanager.cs (CSharpSignature): Now reports also inner class name.
20305 (CSharpSignature): New method for indexer and property signature.
20307 2004-01-21 Marek Safar <marek.safar@seznam.cz>
20309 * pending.cs (IsVirtualFilter): Faster implementation.
20311 2004-01-21 Marek Safar <marek.safar@seznam.cz>
20313 * typemanager.cs: Avoid inclusion of same assembly more than once.
20315 2004-01-21 Marek Safar <marek.safar@seznam.cz>
20317 * cs-parser.jay: Fixed problem where the last assembly attribute
20318 has been applied also to following declaration (class, struct, etc.)
20320 2004-01-21 Marek Safar <marek.safar@seznam.cz>
20322 * class.cs: Added error CS0538, CS0539 reporting.
20323 Fixed crash on Microsoft runtime when field type is void.
20325 * cs-parser.jay: Added error CS0537 reporting.
20327 * pending.cs: Added error CS0535 reporting.
20328 Improved error report for errors CS0536, CS0534.
20330 2004-01-20 Miguel de Icaza <miguel@ximian.com>
20332 Merge a few bits from the Anonymous Method MCS tree.
20334 * statement.cs (ToplevelBlock): New class for toplevel methods,
20335 will hold anonymous methods, lifted variables.
20337 * cs-parser.jay: Create toplevel blocks for delegates and for
20338 regular blocks of code.
20340 2004-01-20 Martin Baulig <martin@ximian.com>
20342 * codegen.cs (EmitContext): Removed `InTry', `InCatch',
20343 `InFinally', `InLoop', `TryCatchLevel', `LoopBeginTryCatchLevel'
20344 and `NeedExplicitReturn'; added `IsLastStatement'.
20345 (EmitContext.EmitTopBlock): Emit the explicit "ret" if we either
20346 have a `ReturnLabel' or we're not unreachable.
20348 * flowanalysis.cs (FlowBranching.MergeChild): Actually merge the
20349 child's reachability; don't just override ours with it. Fixes
20350 #58058 (lluis's example).
20351 (FlowBranching): Added public InTryOrCatch(), InCatch(),
20352 InFinally(), InLoop(), InSwitch() and
20353 BreakCrossesTryCatchBoundary() methods.
20355 * statement.cs (Return): Do all error checking in Resolve().
20356 Unless we are the last statement in a top-level block, always
20357 create a return label and jump to it.
20358 (Break, Continue): Do all error checking in Resolve(); also make
20359 sure we aren't leaving a `finally'.
20360 (Block.DoEmit): Set `ec.IsLastStatement' when emitting the last
20361 statement in a top-level block.
20362 (Block.Flags): Added `IsDestructor'.
20363 (Block.IsDestructor): New public property.
20365 2004-01-20 Martin Baulig <martin@ximian.com>
20367 * statement.cs (Break.DoEmit): Set ec.NeedExplicitReturn; fixes #52427.
20369 2004-01-20 Martin Baulig <martin@ximian.com>
20371 * statement.cs (Statement.ResolveUnreachable): New public method.
20372 (If, While): Do the dead-code elimination in Resolve(), not in Emit().
20373 (Block.Resolve): Resolve unreachable statements.
20375 2004-01-19 Ben Maurer <bmaurer@users.sourceforge.net>
20377 * expression.cs: We need to fix the case where we do
20378 not have a temp variable here.
20380 * assign.cs: Only expression compound assignments need
20381 temporary variables.
20383 2004-01-19 Ben Maurer <bmaurer@users.sourceforge.net>
20385 * flowanalysis.cs: Reduce memory allocation in a few ways:
20386 - A block with no variables should not allocate a bit
20388 - A method with no out parameters does not need any tracking
20389 for assignment of the parameters, so we need not allocate
20392 public readonly Type[] VariableTypes;
20393 public readonly string[] VariableNames;
20394 Are redundant. The data is already stored in the variable
20395 map, so we need not allocate another array for it.
20396 - We need to add alot of checks for if (params | locals) == null
20397 due to the first two changes.
20399 2004-01-18 Miguel de Icaza <miguel@ximian.com>
20401 * ecore.cs (FieldExpr.AddressOf): For ValueTypes that do not
20402 implement IMemoryLocation, we store a copy on a local variable and
20403 take the address of it. Patch from Benjamin Jemlich
20405 * cs-parser.jay: Applied patch from Ben Maurer to the "type" rule
20406 to use a special "type_name_expression" rule which reduces the
20407 number of "QualifiedIdentifier" classes created, and instead
20408 directly creates MemberAccess expressions.
20410 2004-01-17 Miguel de Icaza <miguel@ximian.com>
20412 * convert.cs: Applied patch from Benjamin Jemlich (pcgod@gmx.net)
20413 that fixes #52853. Null literal assignment to ValueType
20415 * class.cs (MethodData.Emit): Instead of checking the name of the
20416 method to determine if its a destructor, create a new derived
20417 class from Method called Destructor, and test for that.
20419 * cs-parser.jay: Create a Destructor object instead of a Method.
20421 Based on a fix from Benjamin Jemlich (pcgod@gmx.net)
20425 2004-01-16 Miguel de Icaza <miguel@ximian.com>
20427 * expression.cs (Binary.ResolveOperator): Perform an implicit
20428 conversion from MethodGroups to their delegate types on the
20429 Addition operation.
20431 * delegate.cs: Introduce a new class DelegateCreation that is the
20432 base class for `NewDelegate' and `ImplicitDelegateCreation',
20433 factor some code in here.
20435 * convert.cs (Convert.ImplicitConversionStandard): Add an implicit
20436 conversion from MethodGroups to compatible delegate types.
20438 * ecore.cs (Expression.Resolve): Do not flag error 654
20439 (Methodgroupd needs parenthesis) if running on the V2 compiler, as
20440 we allow conversions from MethodGroups to delegate types now.
20442 * assign.cs (Assign.DoResolve): Do not flag errors on methodgroup
20443 assignments in v2 either.
20445 2004-01-10 Miguel de Icaza <miguel@ximian.com>
20447 * ecore.cs (FieldExpr.AddressOf): Fix generated IL for accessing
20448 static read-only fields in ctors.
20450 Applied patch from Benjamin Jemlich
20452 * expression.cs (UnaryMutator): Avoid leaking local variables.
20454 2004-01-09 Miguel de Icaza <miguel@ximian.com>
20456 * cs-tokenizer.cs (IsCastToken): Allow the various native types
20457 here to return true, as they can be used like this:
20459 (XXX) int.MEMBER ()
20461 Fixed 49836 and all the other dups
20463 2004-01-09 Zoltan Varga <vargaz@freemail.hu>
20465 * driver.cs: Implement /win32res and /win32icon.
20467 2004-01-08 Miguel de Icaza <miguel@ximian.com>
20469 * cs-parser.jay: Add a rule to improve error handling for the
20470 common mistake of placing modifiers after the type.
20472 2004-01-07 Miguel de Icaza <miguel@ximian.com>
20474 * cs-parser.jay (interface_event_declaration): Catch
20475 initialization of events on interfaces, and report cs0068
20477 * cs-parser.jay (interface_event_declaration): Catch
20478 initialization of events.
20480 * ecore.cs: Better report missing constructors.
20482 * expression.cs (Binary.ResolveOperator): My previous bug fix had
20483 the error reporting done in the wrong place. Fix.
20485 * expression.cs (Binary.ResolveOperator): Catch the
20486 operator + (E x, E y) error earlier, and later allow for implicit
20487 conversions in operator +/- (E e, U x) from U to the underlying
20490 * class.cs (TypeContainer.DefineDefaultConstructor): Fix bug
20491 52596, if the container class is abstract, the default constructor
20492 is protected otherwise its public (before, we were always public).
20494 * statement.cs (Fixed.Resolve): Catch a couple more errors in the
20497 (Using.EmitLocalVariableDecls): Applied patch from Benjamin
20498 Jemlich that fixes bug #52597, MCS was generating invalid code for
20499 idisposable structs. Thanks to Ben for following up with this
20502 2004-01-06 Miguel de Icaza <miguel@ximian.com>
20504 * driver.cs: Allow assemblies without code to be generated, fixes
20507 2004-01-07 Nick Drochak <ndrochak@gol.com>
20509 * attribute.cs: Remove unneeded catch variables. Eliminates a warning.
20511 2004-01-05 Miguel de Icaza <miguel@ximian.com>
20513 * cs-parser.jay: Add rules to improve error reporting if fields or
20514 methods are declared at the namespace level (error 116)
20516 * Add rules to catch event add/remove
20518 2004-01-04 David Sheldon <dave-mono@earth.li>
20520 * expression.cs: Added matching ")" to error message for
20523 2004-01-03 Todd Berman <tberman@gentoo.org>
20525 * ecore.cs, attribute.cs:
20526 Applying fix from #52429.
20528 2004-01-03 Ben Maurer <bmaurer@users.sourceforge.net>
20530 * ecore.cs, expression.cs, statement.cs:
20531 Total rewrite of how we handle branching. We
20532 now handle complex boolean expressions with fewer
20533 jumps. As well if (x == 0) no longer emits a ceq.
20535 if (x is Foo) is much faster now, because we generate
20538 Overall, we get a pretty big improvement on our benchmark
20539 tests. The code we generate is smaller and more readable.
20541 I did a full two-stage bootstrap. The patch was reviewed
20542 by Martin and Miguel.
20544 2004-01-03 Ben Maurer <bmaurer@users.sourceforge.net>
20546 * cs-parser.jay: Make primary_expression not take a QI.
20547 we dont need this because the member_access rule covers
20548 us here. So we replace the rule with just IDENTIFIER.
20550 This has two good effects. First, we remove a s/r conflict.
20551 Second, we allocate many fewer QualifiedIdentifier objects.
20553 2004-01-03 Ben Maurer <bmaurer@users.sourceforge.net>
20555 * attribute.cs: Handle MarshalAs attributes as pseudo, and
20556 set the correct information via SRE. This prevents
20557 hanging on the MS runtime. Fixes #29374.
20559 2004-01-03 Ben Maurer <bmaurer@users.sourceforge.net>
20561 * convert.cs: correctly handle conversions to value types
20562 from Enum and ValueType as unboxing conversions.
20564 Fixes bug #52569. Patch by Benjamin Jemlich.
20566 2004-01-02 Ravi Pratap <ravi@ximian.com>
20568 * expression.cs (BetterConversion): Prefer int -> uint
20569 over int -> ulong (csc's behaviour). This fixed bug #52046.
20571 2004-01-02 Ben Maurer <bmaurer@users.sourceforge.net>
20573 * decl.cs (MemberCache.FindMembers): now returns a
20576 * typemanager.cs: In general, go with with ^^.
20577 (CopyNewMethods): take an IList.
20578 (RealMemberLookup): Only allocate an arraylist
20579 if we copy from two sets of methods.
20581 This change basically does two things:
20582 1) Fewer array lists allocated due to CopyNewMethods.
20583 2) the explicit cast in MemberList costed ALOT.
20585 2004-01-02 Zoltan Varga <vargaz@freemail.hu>
20587 * cs-tokenizer.cs (consume_identifier) driver.cs: Cache identifiers in
20588 a hashtable to avoid needless string allocations when an identifier is
20589 used more than once (the common case).
20591 2004-01-01 Ben Maurer <bmaurer@users.sourceforge.net>
20593 * pending.cs: MS's TypeBuilder.GetInterfaces ()
20594 is broken, it will not return anything. So, we
20595 have to use the information we have in mcs to
20598 * typemanager.cs: Add a cache for GetInterfaces,
20599 since this will now be used more often (due to ^^)
20601 (GetExplicitInterfaces) New method that gets the
20602 declared, not effective, interfaces on a type
20603 builder (eg, if you have interface IFoo, interface
20604 IBar, Foo : IFoo, Bar : Foo, IBar, GetExplInt (Bar) ==
20607 This patch makes MCS able to bootstrap itself on
20610 2004-01-01 Ben Maurer <bmaurer@users.sourceforge.net>
20612 * expression.cs: Remove the Nop's that Miguel put
20615 2003-12-31 Ben Maurer <bmaurer@users.sourceforge.net>
20617 * report.cs, codegen.cs: Give the real stack trace to
20618 the error when an exception is thrown.
20620 2003-12-31 Ben Maurer <bmaurer@users.sourceforge.net>
20622 * decl.cs: only allocate hashtables for ifaces if
20625 2003-12-31 Ben Maurer <bmaurer@users.sourceforge.net>
20627 * expression.cs: fix the error from cs0121-2.cs
20628 (a parent interface has two child interfaces that
20629 have a function with the same name and 0 params
20630 and the function is called through the parent).
20632 2003-12-30 Ben Maurer <bmaurer@users.sourceforge.net>
20634 * class.cs, rootcontext.cs, typmanager.cs: do not
20637 2003-12-28 Ben Maurer <bmaurer@users.sourceforge.net>
20639 * codegen.cs: remove stack for the ec flow branching.
20640 It is already a linked list, so no need.
20642 2003-12-27 Ben Maurer <bmaurer@users.sourceforge.net>
20644 * Makefile: Allow custom profiler here.
20646 2003-12-26 Ben Maurer <bmaurer@users.sourceforge.net>
20648 * typemanager.cs (LookupType):
20649 - Use a static char [], because split takes
20650 a param array for args, so it was allocating
20652 - Do not store true in a hashtable, it boxes.
20654 2003-12-26 Ben Maurer <bmaurer@users.sourceforge.net>
20656 * flowanalysis.cs: bytify common enums.
20658 2003-12-25 Ben Maurer <bmaurer@users.sourceforge.net>
20660 * modifiers.cs: Add a new set of flags for the
20661 flags allowed on explicit interface impls.
20662 * cs-parser.jay: catch the use of modifiers in
20663 interfaces correctly.
20664 * class.cs: catch private void IFoo.Blah ().
20666 All related to bug #50572.
20668 2003-12-25 Ben Maurer <bmaurer@users.sourceforge.net>
20670 * decl.cs: Rewrite the consistant accessability checking.
20671 Accessability is not linear, it must be implemented in
20672 a tableish way. Fixes #49704.
20674 2003-12-25 Ben Maurer <bmaurer@users.sourceforge.net>
20676 * expression.cs: Handle negation in a checked context.
20677 We must use subtraction from zero. Fixes #38674.
20679 2003-12-23 Ben Maurer <bmaurer@users.sourceforge.net>
20681 * class.cs: Ignore static void main in DLLs.
20682 * rootcontext.cs: Handle the target type here,
20683 since we are have to access it from class.cs
20684 * driver.cs: account for the above.
20686 2003-12-23 Ben Maurer <bmaurer@users.sourceforge.net>
20688 * report.cs: Give line numbers and files if available.
20690 2003-12-20 Zoltan Varga <vargaz@freemail.hu>
20692 * driver.cs: Implement /addmodule.
20694 * typemanager.cs: Change 'modules' field so it now contains Modules not
20697 2003-12-20 Martin Baulig <martin@ximian.com>
20699 * class.cs (TypeContainer.DefineMembers): Don't do the CS0649 check here.
20700 (FieldBase.IsAssigned): Removed this field.
20701 (FieldBase.SetAssigned): New public method.
20702 (TypeContainer.Emit): Make the CS0169/CS0649 checks actually work.
20704 2003-12-20 Martin Baulig <martin@ximian.com>
20706 * expression.cs (LocalVariableReference.DoResolve): Don't set
20707 `vi.Used' if we're called from DoResolveLValue().
20709 * statement.cs (Block.DoResolve): `ec.DoEndFlowBranching()' now
20710 returns the usage vector it just merged into the current one -
20711 pass this one to UsageWarning().
20712 (Block.UsageWarning): Take the `FlowBranching.UsageVector' instead
20713 of the `EmitContext', don't call this recursively on our children.
20715 2003-12-19 Zoltan Varga <vargaz@freemail.hu>
20717 * driver.cs: Implement /target:module.
20719 2003-12-18 Zoltan Varga <vargaz@freemail.hu>
20721 * support.cs (CharArrayHashtable): New helper class.
20723 * cs-tokenizer.cs: Store keywords in a hashtable indexed by
20724 char arrays, not strings, so we can avoid creating a string in
20725 consume_identifier if the identifier is a keyword.
20727 2003-12-16 Martin Baulig <martin@ximian.com>
20729 * statement.cs (LocalInfo.Assigned): Removed this property.
20730 (LocalInfo.Flags): Removed `Assigned'.
20731 (LocalInfo.IsAssigned): New public method; takes the EmitContext
20732 and uses flow analysis.
20733 (Block.UsageWarning): Made this method private.
20734 (Block.Resolve): Call UsageWarning() if appropriate.
20736 * expression.cs (LocalVariableReference.DoResolve): Always set
20737 LocalInfo.Used here.
20739 2003-12-13 Martin Baulig <martin@ximian.com>
20741 * statement.cs (Statement.DoEmit, Statement.Emit): Don't return
20742 any value here; we're now using flow analysis to figure out
20743 whether a statement/block returns a value.
20745 2003-12-13 Martin Baulig <martin@ximian.com>
20747 * flowanalysis.cs (UsageVector.MergeFinallyOrigins): Made this
20749 (FlowBranching.MergeFinally): Don't call
20750 `branching.CheckOutParameters()' here, this is called in
20752 (FlowBranchingException.AddSibling): Call MergeFinallyOrigins()
20753 when adding the `finally' vector.
20755 2003-12-13 Martin Baulig <martin@ximian.com>
20758 (UsageVector.MergeJumpOrigins, FlowBranching.Label): Make this
20759 actually work and also fix #48962.
20761 2003-12-12 Ben Maurer <bmaurer@users.sourceforge.net>
20763 * decl.cs: Do not check System.Object for nested types,
20764 since we know it does not have any. Big bang for buck:
20767 Run 1: 8.35 seconds
20768 Run 2: 8.32 seconds
20769 corlib: 17.99 seconds
20771 Run 1: 8.17 seconds
20772 Run 2: 8.17 seconds
20773 corlib: 17.39 seconds
20775 2003-12-11 Ben Maurer <bmaurer@users.sourceforge.net>
20777 * class.cs (FindMembers): Allocate arraylists on demand. Most of the
20778 time we are returning 0 members, so we save alot here.
20780 2003-12-11 Martin Baulig <martin@ximian.com>
20782 * flowanalysis.cs (UsageVector.MergeResult): Renamed this back to
20783 `MergeChild()', also just take the `FlowBranching' as argument;
20784 call Merge() on it and return the result.
20785 (FlowBranching.Merge): We don't need to do anything if we just
20788 2003-12-11 Martin Baulig <martin@ximian.com>
20790 * flowanalysis.cs: Use a list of `UsageVector's instead of storing
20791 them in an `ArrayList' to reduce memory usage. Thanks to Ben
20792 Maurer for this idea.
20794 2003-12-11 Martin Baulig <martin@ximian.com>
20796 * flowanalysis.cs (MergeResult): This class is now gone; we now
20797 use the `UsageVector' for this. The reason for this is that if a
20798 branching just has one sibling, we don't need to "merge" them at
20799 all - that's the next step to do.
20800 (FlowBranching.Merge): We now return a `UsageVector' instead of a
20803 2003-12-11 Martin Baulig <martin@ximian.com>
20805 Reworked flow analyis and made it more precise and bug-free. The
20806 most important change is that we're now using a special `Reachability'
20807 class instead of having "magic" meanings of `FlowReturns'. I'll
20808 do some more cleanups and optimizations and also add some more
20809 documentation this week.
20811 * flowanalysis.cs (Reachability): Added `Throws' and `Barrier';
20812 largely reworked this class.
20813 (FlowReturns): Removed `Unreachable' and `Exception'; we now use
20814 the new `Reachability' class instead of having "magic" values here.
20815 (FlowBranching): We're now using an instance of `Reachability'
20816 instead of having separate `Returns', `Breaks' etc. fields.
20818 * codegen.cs (EmitContext.EmitTopBlock): Set `has_ret' solely
20819 based on flow analysis; ignore the return value of block.Emit ().
20821 2003-12-10 Zoltan Varga <vargaz@freemail.hu>
20823 * driver.cs typemanager.cs: Find the mono extensions to corlib even
20824 if they are private.
20826 2003-12-09 Martin Baulig <martin@ximian.com>
20828 * flowanalyis.cs (FlowBranching.Return, Goto, Throw): Removed;
20829 call them directly on the UsageVector.
20831 2003-12-09 Martin Baulig <martin@ximian.com>
20833 * flowanalysis.cs (FlowBranching.MergeChild, MergeTopBlock):
20834 Changed return type from `FlowReturns' to `Reachability'.
20836 2003-12-09 Martin Baulig <martin@ximian.com>
20838 * flowanalysis.cs (FlowBranching.Reachability): New sealed class.
20839 (FlowBranching.MergeResult): Replaced the `Returns', `Breaks' and
20840 `Reachable' fields with a single `Reachability' one.
20842 2003-12-08 Ben Maurer <bmaurer@users.sourceforge.net>
20844 * class.cs (FindMembers): Remove foreach's.
20849 Run 1: 8.74 seconds
20850 Run 2: 8.71 seconds
20853 Run 1: 8.64 seconds
20854 Run 2: 8.58 seconds
20857 2003-12-08 Ben Maurer <bmaurer@users.sourceforge.net>
20862 This patch does a few things:
20863 1. EmptyStatement is now a singleton, so it is never reallocated.
20864 2. All blah is EmptyStatement constructs have been changed to
20865 blah == EmptyStatement.Value, which is much faster and valid
20866 now that EmptyStatement is a singleton.
20867 3. When resolving a block, rather than allocating a new array for
20868 the non-empty statements, empty statements are replaced with
20869 EmptyStatement.Value
20870 4. Some recursive functions have been made non-recursive.
20871 Mainly the performance impact is from (3), however (1) and (2) are needed for
20872 this to work. (4) does not make a big difference in normal situations, however
20873 it makes the profile look saner.
20878 9.25user 0.23system 0:10.28elapsed 92%CPU (0avgtext+0avgdata 0maxresident)k
20879 9.34user 0.13system 0:10.23elapsed 92%CPU (0avgtext+0avgdata 0maxresident)k
20880 Total memory allocated: 56397 KB
20883 9.13user 0.09system 0:09.64elapsed 95%CPU (0avgtext+0avgdata 0maxresident)k
20884 8.96user 0.24system 0:10.13elapsed 90%CPU (0avgtext+0avgdata 0maxresident)k
20885 Total memory allocated: 55666 KB
20887 2003-12-08 Ben Maurer <bmaurer@users.sourceforge.net>
20889 * support.cs: Rewrite DoubleHash to use its own impl. Is faster
20890 than the hashtable in a hashtable version
20892 * decl.cs: Right now, whenever we try to lookup a type inside a namespace,
20893 we always end up concating a string. This results in a huge perf
20894 loss, because many strings have to be tracked by the GC. In this
20895 patch, we first use a hashtable that works with two keys, so that
20896 the strings do not need to be concat'ed.
20900 Run 1: 8.74 seconds
20901 Run 2: 8.71 seconds
20904 Run 1: 8.65 seconds
20905 Run 2: 8.56 seconds
20907 2003-12-08 Ben Maurer <bmaurer@users.sourceforge.net>
20909 * Makefile: Add a new target `do-time' that does a quick and simple
20910 profile, leaving easy to parse output.
20912 2003-12-08 Zoltan Varga <vargaz@freemail.hu>
20914 * codegen.cs (Init): Create the dynamic assembly with
20915 AssemblyBuilderAccess.Save, to enable some optimizations in the runtime.
20917 2003-12-02 Ben Maurer <bmaurer@users.sourceforge.net>
20919 * support.cs: Make the PtrHashtable use only one
20920 instance of its comparer.
20922 2003-11-30 Zoltan Varga <vargaz@freemail.hu>
20924 * typemanager.cs: Fix lookup of GetNamespaces.
20926 2003-11-29 Miguel de Icaza <miguel@ximian.com>
20928 * expression.cs: Removed redundant line.
20930 * statement.cs (Block.Resolve, Block.Emit): Avoid foreach on
20931 ArrayLists, use for loops with bounds.
20933 * flowanalysis.cs (FlowBranching.Merge): Avoid foreach on
20936 * expression.cs (Invocation.OverloadResolve): Avoid foreach on
20937 arraylists, use for loop with bounds.
20939 The above three changes give us a 0.071 second performance
20940 improvement out of 3.294 seconds down to 3.223. On my machine
20941 the above changes reduced the memory usage by 1,387 KB during
20942 compiler bootstrap.
20944 * cs-parser.jay (QualifiedIdentifier): New class used to represent
20945 QualifiedIdentifiers. Before we created a new string through
20946 concatenation, and mostly later on, the result would be
20947 manipulated by DecomposeQI through string manipulation.
20949 This reduced the compiler memory usage for bootstrapping from
20950 59380 KB to 59007 KB on my machine, 373 KB, and also reduced the
20951 compile times in 0.05 seconds.
20953 2003-11-28 Dick Porter <dick@ximian.com>
20955 * support.cs: Do string compares with the Invariant culture.
20963 * class.cs: Use the char forms of IndexOf and LastIndexOf, so that
20964 the comparison is done with the Invariant culture.
20966 2003-11-27 Miguel de Icaza <miguel@ximian.com>
20968 * statement.cs (Foreach.TryType): Use DeclaredOnly to find the
20969 GetEnumerator method.
20971 (ProbeCollectionType): Iterate starting at the most specific type
20972 upwards looking for a GetEnumerator
20974 * expression.cs: Shift count can be up to 31 for int/uint and 63
20977 2003-11-26 Miguel de Icaza <miguel@ximian.com>
20979 * statement.cs (Block.LookupLabel): Also look for the label on the
20980 children blocks. Use a hash table to keep track of visited
20983 * cfold.cs (IntConstant to UIntConstant mapping): Only return if
20984 we actually did transform the other operand, otherwise fall back
20985 to the common codepath that casts to long.
20987 * cs-tokenizer.cs: Use the same code pattern as the int case.
20988 Maybe I should do the parsing myself, and avoid depending on the
20989 Parse routines to get this done.
20991 2003-11-25 Miguel de Icaza <miguel@ximian.com>
20993 * expression.cs: Apply fix from l_m@pacbell.net (Laurent Morichetti),
20994 which fixes bug 51347. This time test it.
20996 * expression.cs: Make TypeOfVoid derive from TypeOf, so code in
20997 attributes for example can not tell the difference between these.
20998 The difference was only a syntax feature of the language.
21000 * attribute.cs: Apply attributes to delegates.
21002 * delegate.cs: Call the apply attributes method.
21004 2003-11-24 Miguel de Icaza <miguel@ximian.com>
21006 * convert.cs (TryImplicitIntConversion): One line bug fix: we were
21007 comparing 0 vs Byte.MinValue, not the value
21009 (ImplicitConversionRequired): When reporting a conversion error,
21010 use error 31 to print out the constant error instead of the
21013 * expression.cs: Apply fix from l_m@pacbell.net (Laurent Morichetti),
21014 which fixes bug 51347.
21016 2003-11-22 Miguel de Icaza <miguel@ximian.com>
21018 * driver.cs: Applied patch from gert.driesen@pandora.be (Gert Driesen)
21019 which fixes the -warnaserror command line option.
21021 2003-11-21 Miguel de Icaza <miguel@ximian.com>
21023 * cfold.cs (DoNumericPromotions): During constant folding of
21024 additions on UIntConstant, special case intconstants with
21025 IntConstants like we do on the expression binary operator.
21027 2003-11-12 Miguel de Icaza <miguel@ximian.com>
21029 * convert.cs (ImplicitReferenceConversion): We were missing a case
21030 (System.Enum are not value types or class types, so we need to
21031 classify them separatedly).
21033 * driver.cs: We do not support error 2007.
21035 2003-11-12 Jackson Harper <jackson@ximian.com>
21037 * driver.cs: Use corlib.dll or mscorlib.dll when looking up the
21038 system directory. Also use the full file name so users can
21039 libraries names mscorlib-o-tron.dll in a non system dir.
21041 2003-11-10 Martin Baulig <martin@ximian.com>
21043 * typemanager.cs (TypeManager.ResolveExpressionTypes): Removed.
21044 (TypeManager.InitCoreTypes): Initialize them here, but instead of
21045 calling `ResolveType()' on them, directly assign their `Type'.
21047 2003-11-08 Martin Baulig <martin@ximian.com>
21049 * class.cs (TypeContainer.GetClassBases): Use TypeExpr's for the
21050 return value and the `out parent' parameter.
21051 (TypeContainer.DefineType): Moved the CS0644 check into
21052 GetClassBases(). Don't pass the interface types to the
21053 `builder.DefineType()'/`builder.DefineNestedType()', but resolve
21054 them later and then call `TypeBuilder.AddInterfaceImplementation()'.
21056 * ecore.cs (TypeExpr.IsAttribute): New property.
21057 (TypeExpr.GetInterfaces): New method.
21059 * interface.cs (Interface.GetInterfaceTypeByName): Return a
21060 TypeExpr instead of a Type.
21061 (Interface.GetInterfaceBases): Return TypeExpr's instead of Type's.
21062 (Interface.DefineType): Don't pass the interface types to the
21063 `builder.Definetype()'/`builder.DefineNestedType()', but resolve
21064 them later and then call `TypeBulider.AddInterfaceImplementation()'.
21066 * typemanager.cs (TypeManager.AddUserType): Take a `TypeExpr[]'
21067 instead of a `Type[]'.
21068 (TypeManager.RegisterBuilder): Likewise.
21069 (TypeManager.AddUserInterface): Likewise.
21070 (TypeManager.ExpandInterfaces): Take a `Type[]' instead of a
21071 `Type[]' and also return a `TypeExpr[]'.
21072 (TypeManager.GetInterfaces): Return a `TypeExpr[]'.
21074 2003-11-08 Martin Baulig <martin@ximian.com>
21076 * decl.cs (DeclSpace.ResolveTypeExpr): Return a TypeExpr, not an
21079 2003-11-08 Martin Baulig <martin@ximian.com>
21081 * decl.cs (DeclSpace.GetTypeResolveEmitContext): Call
21082 TypeManager.ResolveExpressionTypes().
21084 * ecore.cs (Expression.ResolveAsTypeTerminal): Return a TypeExpr
21085 instead of an Expression.
21086 (TypeExpr): This is now an abstract base class for `TypeExpression'.
21087 (TypeExpression): New public class; formerly known as `TypeExpr'.
21089 * expression.cs (ComposedCast): Derive from TypeExpr.
21091 * typemanager.cs (TypeManager.system_*_expr): These are now
21092 TypExpr's instead of Expression's.
21093 (TypeManager.ResolveExpressionTypes): New public static function;
21094 called from DeclSpace.GetTypeResolveEmitContext() to resolve all
21097 2003-11-06 Miguel de Icaza <miguel@ximian.com>
21099 * expression.cs (New.DoResolve): Do not dereference value that
21100 might be a null return.
21102 * statement.cs (Block.EmitMeta): Use the Const.ChangeType to make
21103 sure that the constant value has the right type. Fixes an
21104 unreported bug, similar to 50425.
21106 * const.cs (Const.LookupConstantValue): Call
21107 ImplicitStandardConversionExists before doing a conversion to
21108 avoid havng the TypeManager.ChangeType do conversions.
21110 Reduced the number of casts used
21112 (Const.ChangeType): New routine to enable reuse of the constant
21113 type changing code from statement.
21115 * typemanager.cs (ChangeType): Move common initialization to
21116 static global variables.
21120 * convert.cs (ImplicitReferenceConversion): Somehow we allowed
21121 every value type to go through, even if it was void. Fix that.
21123 * cs-tokenizer.cs: Use is_identifier_start_character on the start
21124 character of the define, and the is_identifier_part_character for
21125 the rest of the string.
21127 2003-11-05 Miguel de Icaza <miguel@ximian.com>
21129 * expression.cs (UnaryMutator.EmitCode): When I updated
21130 LocalVariableReference.DoResolve, I overdid it, and dropped an
21131 optimization done on local variable references.
21133 2003-11-04 Miguel de Icaza <miguel@ximian.com>
21135 * ecore.cs: Convert the return from Ldlen into an int.
21137 2003-10-20 Miguel de Icaza <miguel@ximian.com>
21139 * decl.cs (DeclSpace.GetAccessLevel): Handle NotPublic case for
21140 the accessibility, this is a special case for toplevel non-public
21141 classes (internal for instance).
21143 2003-10-20 Nick Drochak <ndrochak@gol.com>
21145 * ecore.cs: Fix typo and build. Needed another right paren.
21147 2003-10-19 Miguel de Icaza <miguel@ximian.com>
21149 * ecore.cs: Applied fix from Ben Maurer. We were handling in the
21150 `internal' case regular and protected, but not allowing protected
21151 to be evaluated later. Bug 49840
21153 2003-10-15 Miguel de Icaza <miguel@ximian.com>
21155 * statement.cs (Switch.TableSwitchEmit): Compare the upper bound
21156 to kb.Nlast, and not the kb.nFirst to isolate the switch
21159 Extract the underlying type, so enumerations of long/ulong are
21160 treated like long/ulong.
21162 2003-10-14 Miguel de Icaza <miguel@ximian.com>
21164 * expression.cs (New): Overload the meaning of RequestedType to
21165 track the possible creation of the NewDelegate type, since
21166 DoResolve is invoked more than once for new constructors on field
21169 See bugs: #48800 and #37014
21171 * cs-parser.jay (declare_local_constants): Take an arraylist
21172 instead of a single constant.
21174 (local_constant_declaration): It should take a
21175 constant_declarators, not a constant_declarator. Fixes 49487
21177 * convert.cs: Fix error report.
21179 2003-10-13 Jackson Harper <jackson@ximian.com>
21181 * typemanager.cs (TypeToCoreType): Add float and double this fixes
21184 2003-10-09 Martin Baulig <martin@ximian.com>
21186 * class.cs (MethodCore): Added additional `DeclSpace ds' argument
21188 (MethodCore.DoDefineParameters): Removed the TypeContainer
21189 argument; use the DeclSpace which was passed to the .ctor instead.
21190 (MethodCore.CheckParameter): Take a DeclSpace instead of a
21191 TypeContainer; we only need a DeclSpace here.
21193 2003-10-09 Martin Baulig <martin@ximian.com>
21195 * class.cs (MethodData): Added additional `DeclSpace ds' argument
21197 (MethodData.Define, MethodData.Emit): Pass the `ds' to the
21198 EmitContext's .ctor.
21200 2003-10-09 Martin Baulig <martin@ximian.com>
21202 * decl.cs (DeclSpace.AsAccessible): Moved here from TypeContainer.
21203 (AccessLevel, CheckAccessLevel, GetAccessLevel): They're used by
21204 AsAccessible(), moved them as well.
21206 * class.cs (TypeContainer.AsAccessible): Moved to DeclSpace.
21208 2003-10-08 Atsushi Enomoto <ginga@kit.hi-ho.ne.jp>
21210 * cs-parser.jay : Renamed yyName to yyNames related to jay.
21212 2003-10-07 Miguel de Icaza <miguel@ximian.com>
21214 * expression.cs (Binary.Emit.GreatherThanOrEqual): Fix the code
21215 generation for >=, as spotted by Paolo, bug 48679.
21216 Patch from David Waite.
21218 * cs-tokenizer.cs: Add handling for #pragma.
21220 * cs-parser.jay: Allow for both yield and yield return in the
21221 syntax. The anti-cobolization of C# fight will go on!
21223 * class.cs (TypeBuilder.DefineType): Catch error condition here
21224 (Parent.DefineType erroring out and returning null).
21226 * expression.cs (ArrayCreation.EmitDynamicInitializers): When
21227 coping with enumerations variables, we were mistakenly processing
21228 them as a regular value type instead of built-in types. Fixes the
21231 * typemanager.cs (IsBuiltinOrEnum): New method.
21233 2003-09-30 Miguel de Icaza <miguel@ximian.com>
21235 * cs-parser.jay: Upgrade: yield now needs the return clause.
21237 2003-09-19 Martin Baulig <martin@ximian.com>
21239 * decl.cs (MemberCache.SetupCacheForInterface): Take a
21240 `MemberCache parent' argument. Normally, an interface doesn't
21241 have a parent type except System.Object, but we use this in gmcs
21242 for generic type parameters.
21244 2003-09-18 Martin Baulig <martin@ximian.com>
21246 * typemanager.cs (TypeHandle.ctor): Set `IsInterface' solely based
21247 on `type.IsInterface'; don't check whether the type has a parent
21248 to determine whether it's an interface.
21250 2003-09-15 Martin Baulig <martin@ximian.com>
21252 * class.cs (TypeContainer.DefineType): Added an error flag to
21253 avoid reporting duplicate CS0146's ("class definition is
21256 * driver.cs (Driver.MainDriver): Abort if
21257 RootContext.ResolveTree() reported any errors.
21259 2003-09-07 Martin Baulig <martin@ximian.com>
21261 * report.cs (Error, Warning): Added overloaded versions which take
21262 a `params object[] args' and call String.Format().
21264 2003-09-07 Martin Baulig <martin@ximian.com>
21266 * decl.cs (DeclSpace..ctor): Don't call
21267 NamespaceEntry.DefineName() here; do it in RecordDecl() which is
21268 called from Tree.RecordDecl(). Fixes the CS0101 reporting.
21269 (DeclSpace.RecordDecl): New method.
21271 * tree.cs (Tree.RecordDecl): Call ds.RecordDecl().
21273 2003-09-02 Ravi Pratap <ravi@ximian.com>
21275 * attribute.cs (CheckAttributeTarget): Ensure that we allow return
21276 value attributes to be applied to ParameterBuilders.
21278 * class.cs (MethodCore.LabelParameters): Make static and more
21279 generic so that it can be used from other places - like interface
21280 methods, for instance.
21282 * interface.cs (Interface.Emit): Call LabelParameters before
21283 emitting attributes on the InterfaceMethod.
21285 2003-08-26 Martin Baulig <martin@ximian.com>
21287 * ecore.cs (SimpleName.SimpleNameResolve): Look for members before
21288 resolving aliases; fixes #47927.
21290 2003-08-26 Martin Baulig <martin@ximian.com>
21292 * statement.cs (Using.DoResolve): This is internally emitting a
21293 try/finally clause, so we need to set ec.NeedExplicitReturn if we
21294 do not always return. Fixes #47681.
21296 2003-08-26 Martin Baulig <martin@ximian.com>
21298 * decl.cs (MemberCore): Moved WarningNotHiding(),
21299 Error_CannotChangeAccessModifiers() and CheckMethodAgainstBase()
21301 (AdditionResult): Make this nested in DeclSpace.
21302 (DeclSpace.ctor): The .ctor now takes an additional NamespaceEntry
21303 argument; call NamespaceEntry.Define() unless we're nested in a
21306 * namespace.cs (Namespace.DefineName): New public function. This
21307 is called from DeclSpace's .ctor to add
21308 (Namespace.Lookup): Include DeclSpaces in the lookup.
21310 * class.cs (Operator): Derive from MemberBase, not MemberCore.
21312 * const.cs (Const): Derive from MemberBase, not MemberCore.
21314 2003-08-25 Martin Baulig <martin@ximian.com>
21316 * convert.cs (Convert.ExplicitReferenceConversion): When
21317 converting from an interface type to a class, unbox if the target
21318 type is a struct type. Fixes #47822.
21320 2003-08-24 Gonzalo Paniagua Javier <gonzalo@ximian.com>
21322 * typemanager.cs: fixed the values of MethodFlags. Closes #47855 and
21325 2003-08-22 Martin Baulig <martin@ximian.com>
21327 * class.cs (TypeManager.DefineType): When defining a nested type,
21328 call DefineType() on our parent; fixes #47801.
21330 2003-08-22 Martin Baulig <martin@ximian.com>
21332 * class.cs (MethodData.Define): While checking if a method is an
21333 interface implementation, improve the test a bit more to fix #47654.
21335 2003-08-22 Martin Baulig <martin@ximian.com>
21337 * expression.cs (Probe.DoResolve): Check whether `expr' resolved
21338 correctly; fixes #47722.
21340 2003-08-22 Martin Baulig <martin@ximian.com>
21342 * expression.cs (UnaryMutator.ResolveVariable): If the target is a
21343 LocalVariableReference, ensure it's not read-only. Fixes #47536.
21345 * statement.cs (Fixed.DoResolve): Make all variables read-only.
21347 2003-08-22 Martin Baulig <martin@ximian.com>
21349 * ecore.cs (FieldExpr.DoResolveLValue): Static read-only fields
21350 can only be assigned in static constructors. Fixes #47161.
21352 2003-08-22 Martin Baulig <martin@ximian.com>
21354 Rewrote and improved the flow analysis code.
21356 * flowbranching.cs (FlowBranching): Make this class abstract.
21357 (FlowBranching.CreateBranching): New static function to create a
21358 new flow branching.
21359 (FlowBranchingBlock, FlowBranchingException): New classes.
21360 (FlowBranching.UsageVector.Type): New public readonly field.
21361 (FlowBranching.UsageVector.Breaks): Removed the setter.
21362 (FlowBranching.UsageVector.Returns): Removed the setter.
21363 (FlowBranching.UsageVector): Added Break(), Return(),
21364 NeverReachable() and Throw() methods to modify the reachability.
21365 (FlowBranching.UsageVector.MergeChildren): Removed, this is now
21366 done by FlowBranching.Merge().
21367 (FlowBranching.UsageVector.MergeChild): New method; merges the
21368 merge result into the current vector.
21369 (FlowBranching.Merge): New abstract method to merge a branching.
21371 2003-08-12 Martin Baulig <martin@ximian.com>
21373 * expression.cs (Indirection.CacheTemporaries): Create the
21374 LocalTemporary with the pointer type, not its element type.
21376 2003-08-10 Miguel de Icaza <miguel@ximian.com>
21378 * cs-parser.jay: FIRST_KEYWORD, LAST_KEYWORD: used to know if a
21379 token was a keyword or not.
21381 Add `error' options where an IDENTIFIER was expected; Provide
21382 CheckToken and CheckIdentifierToken convenience error reporting
21385 Do not use `DeclSpace.Namespace', use `DeclSpace.NamespaceEntry'.
21387 * decl.cs: Rename `NamespaceEntry Namespace' public field into
21388 NameSpaceEntry NameSpaceEntry.
21390 (LookupInterfaceOrClass): Avoid creating a full qualified name
21391 from namespace and name: avoid doing lookups when we know the
21392 namespace is non-existant. Use new Tree.LookupByNamespace which
21393 looks up DeclSpaces based on their namespace, name pair.
21395 * driver.cs: Provide a new `parser verbose' to display the
21396 exception thrown during parsing. This is turned off by default
21397 now, so the output of a failure from mcs is more graceful.
21399 * namespace.cs: Track all the namespaces defined in a hashtable
21402 (IsNamespace): New method
21404 2003-08-09 Miguel de Icaza <miguel@ximian.com>
21406 * namespace.cs: Remove redundant call; Avoid using MakeFQN when
21407 we know that we need to concatenate (full typename can never be
21412 * statement.cs: Use a bitfield; Do not initialize to null things
21413 which are done by the constructor by default.
21415 * cs-parser.jay: bug fix, parameter was 4, not 3.
21417 * expression.cs: Just use the property;
21419 * statement.cs: No need for GetVariableInfo method.
21421 2003-08-08 Martin Baulig <martin@ximian.com>
21423 * flowanalysis.cs (FlowReturns): This is now nested in the
21424 `FlowBranching' class.
21425 (MyBitVector): Moved this here from statement.cs.
21426 (FlowBranching.SiblingType): New enum type.
21427 (FlowBranching.CreateSibling): Added `SiblingType' argument.
21429 2003-08-07 Martin Baulig <martin@ximian.com>
21431 * flowanalysis.cs (FlowBranchingType): This is now nested in the
21432 `FlowBranching' class and called `BranchingType'.
21434 2003-08-07 Martin Baulig <martin@ximian.com>
21436 * flowanalysis.cs: Moved all the control flow analysis code into
21439 2003-08-07 Martin Baulig <martin@ximian.com>
21441 * assign.cs (Assign.DoResolve): `target' must either be an
21442 IAssignMethod or an EventAccess; report a CS0131 otherwise. Fixes
21445 2003-08-07 Miguel de Icaza <miguel@ximian.com>
21447 * expression.cs (BinaryMethod): This kind of expression is created by the
21448 Binary class if it determines that the operator has to be handled
21451 (BinaryDelegate): This kind of expression is created if we are
21452 dealing with a + or - operator on delegates.
21454 (Binary): remove method, argumetns, and DelegateOperator: when
21455 dealing with methods,
21457 * ecore.cs (EventExpr.EmitAddOrRemove): Update to new layout.
21459 * statement.cs (Block): use bitfields for the three extra booleans
21460 we had in use. Remove unused topblock parameter.
21462 * codegen.cs: Remove unecessary argument to Block.EmitTopBlock
21464 * assign.cs: Drop extra unneeded tests.
21466 2003-08-06 Miguel de Icaza <miguel@ximian.com>
21468 * iterators.cs (Mapvariable): provide a mechanism to use prefixes.
21470 * statement.cs (Foreach): Use VariableStorage instead of
21473 * codegen.cs (VariableStorage): New class used by clients that
21474 require a variable stored: locals or fields for variables that
21475 need to live across yield.
21477 Maybe provide a convenience api for EmitThis+EmitLoad?
21479 (GetTemporaryLocal, FreeTemporaryLocal): Recycle
21482 2003-08-05 Miguel de Icaza <miguel@ximian.com>
21484 * codegen.cs (RemapLocal, RemapLocalLValue, RemapParameter,
21485 RemapParameterLValue): New methods that are used to turn a
21486 precomputed FieldInfo into an expression like this:
21490 The idea is to use this instead of making LocalVariableReference
21491 have more than one meaning.
21493 * cs-parser.jay: Add error production to BASE.
21495 * ecore.cs: Deal with TypeManager.GetField returning null, which
21496 is now a valid return value.
21498 (FieldExprNoAddress): New expression for Fields whose address can
21501 * expression.cs (LocalVariableReference): During the resolve
21502 phases, create new expressions if we are in a remapping context.
21503 Remove code that dealt with remapping here.
21505 (ParameterReference): same.
21507 (ProxyInstance): New expression, like the `This' expression, but
21508 it is born fully resolved. We know what we are doing, so remove
21509 the errors that are targeted to user-provided uses of `this'.
21511 * statement.cs (Foreach): our variable is now stored as an
21512 Expression; During resolution, follow the protocol, dont just
21513 assume it will return this.
21515 2003-08-06 Martin Baulig <martin@ximian.com>
21517 * support.cs (SeekableStreamReader.cs): New public class.
21519 * cs-tokenizer.cs, cs-parser.jay, driver.cs: Use the new
21520 SeekableStreamReader instead of the normal StreamReader.
21522 2003-08-04 Martin Baulig <martin@ximian.com>
21524 * cs-parser.jay (CLOSE_PARENS_CAST, CLOSE_PARENS_NO_CAST,
21525 CLOSE_PARENS_OPEN_PARENS, CLOSE_PARENS_MINUS): New tokens to
21526 deambiguate casts and delegate invocations.
21527 (parenthesized_expression): Use the new tokens to ensure this is
21528 not a cast of method invocation.
21530 * cs-tokenizer.cs (is_punct): Return one of the new special tokens
21531 when reading a `)' and Deambiguate_CloseParens () was previously
21534 * expression.cs (ParenthesizedExpression): New class. This is
21535 just used for the CS0075 test.
21536 (Binary.DoResolve): Check for CS0075.
21538 2003-07-29 Ravi Pratap <ravi@ximian.com>
21540 * expression.cs (Invocation.MakeUnionSet): Patch from Lluis
21541 Sanchez : use TypeManager.ArrayContainsMethod instead of a direct
21542 reference comparison.
21544 (TypeManager.ArrayContainsMethod): When we have a MethodInfo, also
21545 examine the ReturnType for equality - this is necessary in the
21546 cases of implicit and explicit operators whose signature also
21547 includes the return type.
21549 2003-07-26 Miguel de Icaza <miguel@ximian.com>
21551 * namespace.cs: Cache the result of the namespace computation,
21552 instead of computing it every time.
21554 2003-07-24 Miguel de Icaza <miguel@ximian.com>
21556 * decl.cs: Use a global arraylist that we reuse over invocations
21557 to avoid excesive memory consumption. Reduces memory usage on an
21558 mcs compile by one meg (45 average).
21560 * typemanager.cs (LookupTypeReflection): In .NET pointers are
21561 private, work around that.
21563 2003-07-23 Miguel de Icaza <miguel@ximian.com>
21565 * literal.cs (IntLiteral): Define Zero and One static literals.
21567 * cs-parser.jay (integer_literal): use static literals to reduce
21568 memory usage for the most used literals (0, 1 and -1). 211kb
21569 reduced in memory usage.
21571 Replace all calls to `new ArrayList' with `new
21572 ArrayList(4)' which is a good average number for most allocations,
21573 and also requires only 16 bytes of memory for its buffer by
21576 This reduced MCS memory usage in seven megabytes for the RSS after
21579 2003-07-28 Ravi Pratap <ravi@ximian.com>
21581 * expression.cs (Invocation.OverloadResolve): Fix the algorithm to
21582 handle params methods the correct way by forming only one
21583 applicable set with params and normal methods in them. Earlier we
21584 were looking at params methods only if we found no normal methods
21585 which was not the correct thing to do.
21587 (Invocation.BetterFunction): Take separate arguments indicating
21588 when candidate and the best method are params methods in their
21591 This fixes bugs #43367 and #46199.
21593 * attribute.cs: Documentation updates.
21595 (CheckAttribute): Rename to CheckAttributeTarget.
21596 (GetValidPlaces): Rename to GetValidTargets.
21598 * expression.cs (Invocation.IsParamsMethodApplicable): Fix trivial
21599 bug - use Convert.ImplicitConversion, not ImplicitUserConversion!
21603 2003-07-28 Martin Baulig <martin@ximian.com>
21605 * class.cs (TypeContainer.DefineMembers): Use the base type's full
21606 name when looking up the base class of a nested class. Fixes #46977.
21608 2003-07-26 Martin Baulig <martin@ximian.com>
21610 * expression.cs (Indexers.Indexer): New nested struct; contains
21611 getter, setter and the indexer's type.
21612 (Indexers.Properties): This is now an ArrayList of
21613 Indexers.Indexer's.
21614 (IndexerAccess.DoResolveLValue): Correctly set the type if the
21615 indexer doesn't have any getters.
21617 * assign.cs (Assign.DoResolve): Also do the implicit conversions
21618 for embedded property and indexer assignments.
21620 2003-07-26 Martin Baulig <martin@ximian.com>
21622 * cs-tokenizer.cs (Tokenizer.xtoken): Report a CS1040 if a
21623 preprocessor directive is not the first non-whitespace character
21626 2003-07-26 Martin Baulig <martin@ximian.com>
21628 * namespace.cs (NamespaceEntry.Lookup): New method; rewrote the
21629 namespace parsing, follow the spec more closely.
21631 * rootcontext.cs (RootContext.NamespaceLookup): Use the new
21632 NamespaceEntry.Lookup().
21634 2003-07-25 Martin Baulig <martin@ximian.com>
21636 * MethodCore.cs (OverridesSomething): New public field; it's set
21637 from TypeContainer.DefineMembers if this method overrides
21638 something (which doesn't need to be a method). Fix #39462.
21640 2003-07-25 Ravi Pratap <ravi@ximian.com>
21642 * typemanager.cs (GetMembers): Ensure that the list of members is
21643 reversed. This keeps things in sync.
21645 * attribute.cs (Attribute.CheckAttribute): Break as soon as we
21646 find an AttributeUsage attribute.
21648 * expression.cs (Invocation.OverloadResolve): Perform the check
21649 which disallows Invoke to be directly called on a Delegate.
21651 (Error_InvokeOnDelegate): Report error cs1533.
21653 2003-07-25 Martin Baulig <martin@ximian.com>
21655 * expression.cs (Indexers.GetIndexersForType): Only look in the
21656 interface hierarchy if the requested type is already an
21657 interface. Fixes #46788 while keeping #46502 fixed.
21659 2003-07-25 Martin Baulig <martin@ximian.com>
21661 * class.cs (TypeContainer.DefineMembers): Check whether all
21662 readonly fields have been assigned and report warning CS0649 if
21665 * statement.cs (LocalInfo.IsFixed): Always return true if this is
21668 2003-07-24 Ravi Pratap <ravi@ximian.com>
21670 * decl.cs (MemberCache.AddMethods): Reverse the order of the array
21671 returned from GetMethods to make things consistent with the
21672 assumptions MCS makes about ordering of methods.
21674 This should comprehensively fix bug #45127 and it does :-)
21676 * ecore.cs (MethodGroupExpr.DeclaringType): Correct bug - the
21677 ordering is actually reverse.
21679 * Clean up some debug messages I left lying around.
21681 * interface.cs (Populate*): Get rid of code which emits attributes
21682 since the stage in which we emit attributes is the 'Emit' stage,
21683 not the define stage.
21685 (Emit): Move attribute emission for interface members here.
21687 2003-07-22 Ravi Pratap <ravi@ximian.com>
21689 * expression.cs (Invocation.OverloadResolve): Follow the spec more
21690 closely: we eliminate methods in base types when we have an
21691 applicable method in a top-level type.
21693 Please see section 14.5.5.1 for an exact description of what goes
21696 This fixes bug #45127 and a host of other related to corlib compilation.
21698 * ecore.cs (MethodGroupExpr.DeclaringType): The element in the
21699 array is the method corresponding to the top-level type (this is
21700 because of the changes made to icall.c) so we change this
21703 (MethodGroupExpr.Name): This too.
21705 * typemanager.cs (GetElementType): New method which does the right
21706 thing when compiling corlib.
21708 * everywhere: Make use of the above in the relevant places.
21710 2003-07-22 Martin Baulig <martin@ximian.com>
21712 * cs-parser.jay (invocation_expression): Moved
21713 `OPEN_PARENS expression CLOSE_PARENS unary_expression' here from
21714 `cast_expression', but create a InvocationOrCast which later
21715 resolves to either an Invocation or a Cast.
21717 * ecore.cs (ExpressionStatement.ResolveStatement): New virtual
21718 method; call this before EmitStatement() to make sure that this
21719 expression can be used as a statement.
21721 * expression.cs (InvocationOrCast): New class; resolves to either
21722 an Invocation or a Cast.
21724 * statement.cs (StatementExpression): Call ResolveStatement() on
21725 the ExpressionStatement before emitting it.
21727 2003-07-21 Martin Baulig <martin@ximian.com>
21729 * expression.cs (Invocation.VerifyArgumentsCompat): Check whether
21730 `ref' and `out' attributes match; fixes #46220.
21731 (MemberAccess.ResolveMemberAccess): You can't reference a type
21732 through an expression; fixes #33180.
21733 (Indexers.GetIndexersForType): Don't return the indexers from
21734 interfaces the class implements; fixes #46502.
21736 2003-07-21 Martin Baulig <martin@ximian.com>
21738 * class.cs (TypeContainer.CheckPairedOperators): Added CS0660 and
21739 CS0661 checks; fixes bug #30442.
21741 2003-07-21 Martin Baulig <martin@ximian.com>
21743 * decl.cs (AdditionResult): Added `Error'.
21745 * enum.cs (AddEnumMember): Report a CS0076 if name is `value__'.
21747 * typemanager.cs (TypeManager.ChangeType): Catch exceptions;
21748 makes cs0031.cs actually work.
21750 2003-07-20 Martin Baulig <martin@ximian.com>
21752 * namespace.cs: Fixed that bug which caused a crash when compiling
21753 the debugger's GUI.
21755 2003-07-20 Miguel de Icaza <miguel@ximian.com>
21757 * typemanager.cs (LookupTypeReflection): Never expose types which
21758 are NotPublic, NestedPrivate, NestedAssembly, or
21759 NestedFamANDAssem. We used to return these, and later do a check
21760 that would report a meaningful error, but the problem is that we
21761 would not get the real match, if there was a name override.
21763 2003-07-18 Miguel de Icaza <miguel@ximian.com>
21765 * namespace.cs (Namespace, Name): Do not compute the namespace
21766 name dynamically, compute it in the constructor. This reduced
21767 memory usage by 1697 KB.
21769 * driver.cs: Use --pause to pause at the end.
21771 2003-07-17 Peter Williams <peter@newton.cx>
21773 * Makefile: Change the name of the test target so that it doesn't
21774 conflict with the recursive test target.
21776 2003-07-17 Miguel de Icaza <miguel@ximian.com>
21778 * expression.cs (LocalVariableReference.Emit, EmitAssign,
21779 AddressOf): Do not use EmitThis, that was wrong, use the actual
21782 2003-07-15 Miguel de Icaza <miguel@ximian.com>
21784 * class.cs (MethodData.Define): While checking if a method is an
21785 interface implementation, improve the test: If we are not public
21786 (use new test here: use the computed MethodAttributes directly,
21787 instead of the parsed modifier flags) check if the `implementing'
21788 method comes from an interface or not.
21790 * pending.cs (VerifyPendingMethods): Slightly better error
21793 * makefile: add test target that does the mcs bootstrap.
21795 2003-07-16 Ravi Pratap <ravi@ximian.com>
21797 * interface.cs (Define): Do nothing here since there are no
21798 members to populate etc. Move the attribute emission out of here
21799 since this was just totally the wrong place to put it. Attribute
21800 application happens during the 'Emit' phase, not in the 'Define'
21803 (Emit): Add this method and move the attribute emission here
21805 * rootcontext.cs (EmitCode): Call the Emit method on interface
21808 2003-07-14 Ravi Pratap M <ravi@ximian.com>
21810 * expression.cs (OverloadResolve): Report error only if Location
21811 is not 'Null' which means that there was a probe going on.
21813 2003-07-14 Martin Baulig <martin@ximian.com>
21815 * expression.cs (ConditionalLogicalOperator): New public class to
21816 implement user defined conditional logical operators.
21817 This is section 14.11.2 in the spec and bug #40505.
21819 2003-07-14 Martin Baulig <martin@ximian.com>
21821 * ecore.cs (FieldExpr.DoResolveLValue): Fixed bug #46198.
21823 2003-07-14 Martin Baulig <martin@ximian.com>
21825 * codegen.cs (EmitContext.InFixedInitializer): New public field.
21827 * ecore.cs (IVariable.VerifyFixed): New interface method.
21829 * expression.cs (Unary.ResolveOperator): When resolving the `&'
21830 operator, check whether the variable is actually fixed. Fixes bug
21831 #36055. Set a variable definitely assigned when taking its
21832 address as required by the spec.
21834 * statement.cs (LocalInfo.IsFixed): New field.
21835 (LocalInfo.MakePinned): Set `IsFixed' to true.
21837 2003-07-14 Ravi Pratap M <ravi@ximian.com>
21839 * attribute.cs (Attribute.Resolve): While doing a Member lookup
21840 for .ctors, ensure that we only ask for members declared in the
21841 attribute type (BindingFlags.DeclaredOnly).
21845 * expression.cs (Error_WrongNumArguments): Report error 1501
21846 correctly the way CSC does.
21848 2003-07-13 Martin Baulig <martin@ximian.com>
21850 * expression.cs (MemberAccess.ResolveAsTypeStep): Try to do a type
21851 lookup on the fully qualified name, to make things like "X.X" work
21852 where "X.X" is a fully qualified type name, but we also have a
21853 namespace "X" in the using list. Fixes #41975.
21855 2003-07-13 Martin Baulig <martin@ximian.com>
21857 * assign.cs (Assign.GetEmbeddedAssign): New protected virtual
21858 function. If we're a CompoundAssign, we need to create an embedded
21859 CompoundAssign, not an embedded Assign.
21860 (Assign.DoResolve): Make this work for embedded CompoundAssign's.
21863 2003-07-13 Martin Baulig <martin@ximian.com>
21865 * typemanager.cs (TypeManager.IsNestedChildOf): Make this actually
21866 work to fix bug #46088.
21868 2003-07-13 Ravi Pratap <ravi@ximian.com>
21870 * class.cs (Operator.Emit): Do not emit attributes here - it is
21871 taken care of by the Method class that we delegate too. This takes
21872 care of bug #45876.
21874 2003-07-10 Martin Baulig <martin@ximian.com>
21876 * expression.cs (TypeOfVoid): New class.
21877 (TypeOf): Report a CS0673 if it's System.Void. Fixes #42264.
21879 2003-07-10 Martin Baulig <martin@ximian.com>
21881 * class.cs (MethodCore.DoDefineParameters): Added CS0225 check;
21884 2003-07-10 Martin Baulig <martin@ximian.com>
21886 * rootcontext.cs (RootContext.NamespaceLookup): Take a DeclSpace,
21887 not a NamespaceEntry, so we can use DeclSpace.CheckAccessLevel().
21889 * decl.cs (DeclSpace.FindType): Use DeclSpace.CheckAccessLevel().
21891 * typemanager.cs (TypeManager.IsAccessibleFrom): Removed.
21893 2003-07-10 Martin Baulig <martin@ximian.com>
21895 * expression.cs (ArrayCreation): Don't use a byte blob for arrays
21896 of decimal. Fixes #42850.
21898 NOTE: I also fixed the created byte blob, but this doesn't work on
21899 the MS runtime and csc never produces any byte blobs for decimal
21902 2003-07-10 Martin Baulig <martin@ximian.com>
21904 * statement.cs (StructInfo.GetStructInfo): Catch deep cycles in
21905 structs; fixes #32068.
21906 (Block.AddChildVariableNames): Fixed #44302.
21908 2003-07-07 Gonzalo Paniagua Javier <gonzalo@ximian.com>
21910 * namespace.cs: fixed compilation with csc. It's bugzilla #44302.
21912 2003-07-07 Miguel de Icaza <miguel@ximian.com>
21914 * attribute.cs: And this test is onger needed.
21916 2003-07-08 Martin Baulig <martin@ximian.com>
21918 * rootcontext.cs (RootContext.NamespaceLookup): Ignore
21919 inaccessible types. Fixes #36313.
21921 * decl.cs (DeclSpace.FindType): Ignore inaccessible types.
21923 * namespace.cs (NamespaceEntry): Create implicit entries for all
21924 namespaces; ie. if we have `namespace N1.N2.N3 { ... }', we create
21925 implicit entries for N1.N2 and N1.
21927 2003-07-08 Martin Baulig <martin@ximian.com>
21929 Rewrote the handling of namespaces to fix a lot of the issues
21930 wrt. `using' aliases etc.
21932 * namespace.cs (Namespace): Splitted this class into a
21933 per-assembly `Namespace' and a per-file `NamespaceEntry'.
21935 * typemanager.cs (TypeManager.IsNamespace): Removed.
21936 (TypeManager.ComputeNamespaces): Only compute namespaces from
21937 loaded assemblies here, not the namespaces from the assembly we're
21938 currently compiling.
21940 2003-07-08 Martin Baulig <martin@ximian.com>
21942 * rootcontext.cs, class.cs: Fixed the CS1530 reporting.
21944 2003-07-07 Miguel de Icaza <miguel@ximian.com>
21946 * typemanager.cs: Reverted patch from Gonzalo, my previous patch
21949 I thought about the memory savings here, but LookupTypeReflection
21950 is used under already very constrained scenarios. Compiling
21951 corlib or mcs only exposes one hit, so it would not really reduce
21952 any memory consumption.
21954 2003-07-07 Gonzalo Paniagua Javier <gonzalo@ximian.com>
21956 * typemanager.cs: fixes bug #45889 by only adding public types from
21957 other assemblies to the list of known types.
21959 2003-07-07 Miguel de Icaza <miguel@ximian.com>
21961 * attribute.cs (Attribute.Resolve): Add call to CheckAccessLevel
21962 on the type we resolved.
21964 2003-07-05 Martin Baulig <martin@ximian.com>
21966 * pending.cs (PendingImplementation.ParentImplements): Don't
21967 create the proxy if the parent is abstract.
21969 * class.cs (TypeContainer.DefineIndexers): Process explicit
21970 interface implementations first. Fixes #37714.
21972 2003-07-04 Miguel de Icaza <miguel@ximian.com>
21974 * expression.cs (MemberAccess.ResolveMemberAccess): Events are
21975 defined recursively; but since we modify the input parameters
21976 (left is set to `this' temporarily), we reset this value if the
21977 left_is_explicit is false, which gives the original semantics to
21980 * literal.cs (NullPointer): new class used to represent a null
21981 literal in a pointer context.
21983 * convert.cs (Convert.ImplicitReferenceConversion): Is the target
21984 type is a pointer, use a NullPointer object instead of a
21985 NullLiteral. Closes 43687
21987 (ExplicitConversion): Convert pointer values using
21988 the conv opcode to the proper type.
21990 * ecore.cs (New): change ValueTypeVariable property into a method,
21991 that returns whether the valuetype is suitable for being used.
21993 * expression.cs (Binary.DoNumericPromotions): Only return if we
21994 the int constant was a valid uint, and we can return both left and
21995 right as uints. If not, we continue processing, to trigger the
21996 type conversion. This fixes 39018.
21998 * statement.cs (Block.EmitMeta): During constant resolution, set
21999 the CurrentBlock property on the emitcontext, so that we resolve
22000 constants propertly.
22002 2003-07-02 Martin Baulig <martin@ximian.com>
22004 * codegen.cs (EmitContext.NeedExplicitReturn): New public variable.
22005 (EmitContext.EmitTopBlock): Emit an explicit return if it's set.
22007 * statement.cs (Try.Resolve): Set ec.NeedExplicitReturn rather
22008 than emitting it here.
22010 * statement.cs: Fixed some more flow analysis bugs.
22012 2003-07-02 Martin Baulig <martin@ximian.com>
22014 * class.cs (MethodData.Define): When implementing interface
22015 methods, set Final unless we're Virtual.
22017 * decl.cs (MemberCore.CheckMethodAgainstBase): Make the CS0506
22018 check work for interface methods.
22020 2003-07-01 Martin Baulig <martin@ximian.com>
22022 * ecore.cs (EmitContext.This): Replaced this property with a
22023 GetThis() method which takes a Location argument. This ensures
22024 that we get the correct error location for a CS0188.
22026 2003-07-01 Miguel de Icaza <miguel@ximian.com>
22028 * ecore.cs: (Convert.ConvertIntLiteral): Add test for
22029 ImplicitStandardConversion.
22031 * class.cs (TypeContainer.GetClassBases): Small bug fix for 45649.
22033 2003-07-01 Zoltan Varga <vargaz@freemail.hu>
22035 * expression.cs (ResolveOperator): Fix Concat (string, string, string)
22038 2003-06-30 Miguel de Icaza <miguel@ximian.com>
22040 * class.cs (Constructor.Define): Turn off initlocals for unsafe
22043 (MethodData.Define): Turn off initlocals for unsafe methods.
22045 2003-06-29 Miguel de Icaza <miguel@ximian.com>
22047 * decl.cs (DeclSpace.CheckAccessLevel): Make this routine
22048 complete; Fixes #37521.
22050 * delegate.cs: Use Modifiers.TypeAttr to compute the
22051 TypeAttributes, instead of rolling our own. This makes the flags
22052 correct for the delegates.
22054 2003-06-28 Miguel de Icaza <miguel@ximian.com>
22056 * class.cs (Constructor.Define): Set the private flag for static
22057 constructors as well.
22059 * cs-parser.jay (statement_expression): Set the return value to
22060 null, to avoid a crash when we catch an error.
22062 2003-06-24 Miguel de Icaza <miguel@ximian.com>
22064 * cs-parser.jay: Applied patch from Jackson that adds support for
22065 extern and unsafe modifiers to destructor declarations.
22067 * expression.cs: Report error 21 if the user is trying to index a
22070 * driver.cs: Add an error message, suggested by the bug report.
22072 * class.cs (TypeContainer.Emit): Only call EmitFieldInitializers
22073 if we do not have a ": this ()" constructor initializer. Fixes 45149
22075 2003-06-14 Miguel de Icaza <miguel@ximian.com>
22077 * namespace.cs: Add some information to reduce FAQs.
22079 2003-06-13 Miguel de Icaza <miguel@ximian.com>
22081 * cfold.cs (BinaryFold): BitwiseAnd, BitwiseOr: handle other
22082 underlying enumeration types. Fixes #43915.
22084 * expression.cs: Treat ushort/short as legal values to be used in
22085 bitwise operations.
22087 Wed Jun 4 13:19:04 CEST 2003 Paolo Molaro <lupus@ximian.com>
22089 * delegate.cs: transfer custom attributes for paramenters from
22090 the delegate declaration to Invoke and BeginInvoke.
22092 Tue Jun 3 11:11:08 CEST 2003 Paolo Molaro <lupus@ximian.com>
22094 * attribute.cs: handle custom marshalers and emit marshal info
22097 2003-05-28 Hector E. Gomez Morales <hgomez_36@flashmail.com>
22099 * makefile.gnu: Added anonymous.cs to the compiler sources.
22101 2003-05-28 Miguel de Icaza <miguel@ximian.com>
22103 * iterators.cs: Change the name of the proxy class to include two
22106 * cs-parser.jay: Update grammar to include anonymous methods.
22108 * anonymous.cs: new file.
22110 2003-05-27 Miguel de Icaza <miguel@ximian.com>
22112 * class.cs (Field.Define): Add missing test for pointers and
22115 2003-05-27 Ravi Pratap <ravi@ximian.com>
22117 * expression.cs (ArrayAccess.GetStoreOpCode): For System.IntPtr,
22118 we use the stobj opcode.
22120 (ArrayCreation.EmitDynamicInitializers): Revert Miguel's patch
22121 since it wasn't the correct fix.
22123 It still is puzzling that we are required to use stobj for IntPtr
22124 which seems to be a ValueType.
22126 2003-05-26 Miguel de Icaza <miguel@ximian.com>
22128 * ecore.cs (SimpleName.SimpleNameResolve): Consider using aliases
22129 during regular simple name resolution. Now, the trick is that
22130 instead of returning for processing the simplename, we do a
22131 TypeManager.LookupType (ie, a rooted lookup as opposed to a
22132 contextual lookup type). If a match is found, return that, if
22133 not, return for further composition.
22135 This fixes long-standing 30485.
22137 * expression.cs (ArrayCreation.EmitDynamicInitializers): When
22138 using the address to initialize an object, do an Stobj instead of
22139 using the regular Stelem.
22141 (IndexerAccess.Emit, IndexerAccess.EmitAssign):
22142 Pass `is_base_indexer' to Invocation.EmitCall instead of false.
22143 Because if we are a BaseIndexerAccess that value will be true.
22146 * statement.cs (GotoCase.Resolve): Return after reporting an
22147 error, do not attempt to continue.
22149 * expression.cs (PointerArithmetic.Emit): If our operand is a
22150 long, convert our constants to match the operand before
22151 multiplying. Convert to I type before adding. Fixes 43670.
22153 2003-05-14 Ravi Pratap <ravi@ximian.com>
22155 * enum.cs (ImplicitConversionExists) : Rename to
22156 ImplicitEnumConversionExists to remove ambiguity.
22158 * ecore.cs (NullCast): New type of cast expression class which
22159 basically is very similar to EmptyCast with the difference being
22160 it still is a constant since it is used only to cast a null to
22162 (eg. (string) null)
22164 * convert.cs (ImplicitReferenceConversion): When casting a null
22165 literal, we return a NullCast.
22167 * literal.cs (NullLiteralTyped): Remove - I don't see why this
22168 should be around anymore.
22170 The renaming (reported was slightly wrong). Corrections:
22172 ConvertImplicitStandard -> ImplicitConversionStandard
22173 ConvertExplicitStandard -> ExplicitConversionStandard
22175 * expression.cs (StaticCallExpr.MakeSimpleCall): Resolve arguments
22176 before passing them in !
22178 * convert.cs (ImplicitConversionStandard): When comparing for
22179 equal expr and target types, ensure that expr is not a
22182 In general, we must not be checking (expr_type ==
22183 target_type) in the top level conversion methods
22184 (ImplicitConversion, ExplicitConversion etc). This checking is
22185 done in the methods that they delegate to.
22187 2003-05-20 Miguel de Icaza <miguel@ximian.com>
22189 * convert.cs: Move Error_CannotConvertType,
22190 ImplicitReferenceConversion, ImplicitReferenceConversionExists,
22191 ImplicitNumericConversion, ImplicitConversionExists,
22192 ImplicitUserConversionExists, StandardConversionExists,
22193 FindMostEncompassedType, FindMostSpecificSource,
22194 FindMostSpecificTarget, ImplicitUserConversion,
22195 ExplicitUserConversion, GetConversionOperators,
22196 UserDefinedConversion, ConvertImplicit, ConvertImplicitStandard,
22197 TryImplicitIntConversion, Error_CannotConvertImplicit,
22198 ConvertImplicitRequired, ConvertNumericExplicit,
22199 ExplicitReferenceConversionExists, ConvertReferenceExplicit,
22200 ConvertExplicit, ConvertExplicitStandard from the ecore.cs into
22203 Perform the following renames:
22205 StandardConversionExists -> ImplicitStandardConversionExists
22206 ConvertImplicit -> ImplicitConversion
22207 ConvertImplicitStandard -> ImplicitStandardConversion
22208 TryImplicitIntConversion -> ImplicitIntConversion
22209 ConvertImplicitRequired -> ImplicitConversionRequired
22210 ConvertNumericExplicit -> ExplicitNumericConversion
22211 ConvertReferenceExplicit -> ExplicitReferenceConversion
22212 ConvertExplicit -> ExplicitConversion
22213 ConvertExplicitStandard -> ExplicitStandardConversion
22215 2003-05-19 Martin Baulig <martin@ximian.com>
22217 * statement.cs (TypeInfo.StructInfo): Made this type protected.
22218 (TypeInfo): Added support for structs having structs as fields.
22220 * ecore.cs (FieldExpr): Implement IVariable.
22221 (FieldExpr.DoResolve): Call VariableInfo.GetSubStruct() to get the
22222 VariableInfo for the field.
22224 2003-05-18 Martin Baulig <martin@ximian.com>
22226 * expression.cs (This.DoResolve): Report a CS0027 if we're
22227 emitting a field initializer.
22229 2003-05-18 Martin Baulig <martin@ximian.com>
22231 * expression.cs (This.ResolveBase): New public function.
22232 (This.DoResolve): Check for CS0188.
22234 * codegen.cs (EmitContext.This): Just call This.ResolveBase(), not
22237 * ecore.cs (MethodGroupExpr.DoResolve): Set the
22238 `instance_expression' to null if we don't have any non-static
22241 2003-05-18 Martin Baulig <martin@ximian.com>
22243 Reworked the way how local variables and parameters are handled by
22244 the flow analysis code.
22246 * statement.cs (TypeInfo, VariableMap): New public classes.
22247 (VariableInfo): New public class. This is now responsible for
22248 checking whether a variable has been assigned. It is used for
22249 parameters and local variables.
22250 (Block.EmitMeta): Take the InternalParameters as argument; compute
22251 the layout of the flow vectors here.
22252 (Block.LocalMap, Block.ParameterMap): New public properties.
22253 (FlowBranching): The .ctor doesn't get the InternalParameters
22254 anymore since Block.EmitMeta() now computes the layout of the flow
22256 (MyStructInfo): This class is now known as `StructInfo' and nested
22257 in `TypeInfo'; we don't access this directly anymore.
22259 * ecore.cs (IVariable): Added `VariableInfo VariableInfo'
22260 property and removed IsAssigned(), IsFieldAssigned(),
22261 SetAssigned() and SetFieldAssigned(); we now call them on the
22262 VariableInfo so we don't need to duplicate this code everywhere.
22264 * expression.cs (ParameterReference): Added `Block block' argument
22266 (LocalVariableReference, ParameterReference, This): The new
22267 VariableInfo class is now responsible for all the definite
22270 * codegen.cs (EmitContext.IsVariableAssigned, SetVariableAssigned,
22271 IsParameterAssigned, SetParameterAssigned): Removed.
22273 2003-05-18 Martin Baulig <martin@ximian.com>
22275 * typemanager.cs (InitCoreTypes): Try calling
22276 SetCorlibTypeBuilders() with 4 args; if that fails, fall back to
22277 the 3-args-version. Corlib now also needs our `void_type'.
22278 (GetMethod): Added overloaded version which takes an optional
22279 `bool report_errors' to allow lookups of optional methods.
22281 2003-05-12 Martin Baulig <martin@ximian.com>
22283 * statement.cs (VariableInfo): Renamed to LocalInfo since it's
22284 only used for locals and not for parameters.
22286 2003-05-12 Miguel de Icaza <miguel@ximian.com>
22288 * support.cs (InternalParameters.ParameterType): Return the
22289 ExternalType of the parameter.
22291 * parameter.cs (Parameter.ExternalType): drop the two arguments,
22294 2003-05-11 Miguel de Icaza <miguel@ximian.com>
22296 * class.cs (MethodData.Define): Do not set the `newslot' on
22297 interface members, if they are also flagged as "override".
22299 * expression.cs (UnaryMutator.EmitCode): Simple workaround to emit
22300 better code for ++i and i++. This only works for static fields
22301 and local variables.
22303 * typemanager.cs (LookupDeclSpace): Add new method, sometimes we
22304 want to pull the DeclSpace out of the builder_to_declspace instead
22305 of the TypeBuilder (like in TypeContainer.FindMembers).
22307 * class.cs (TypeContainer.FindMembers): Use LookupDeclSpace
22308 instead of LookupTypeContainer. Fixes the crash on .NET for
22309 looking up interface members.
22311 * const.cs: Create our own emit context during the Definition
22312 stage, so that constants are evaluated in the proper context, when
22313 a recursive definition happens.
22315 2003-05-11 Martin Baulig <martin@ximian.com>
22317 * statement.cs (Block.CreateSwitchBlock): New method. Creates a
22318 new block for a switch section.
22319 (Block.AddLabel, Block.LookupLabel): If we're a switch section, do
22320 the adding/lookup in the switch block. Fixes #39828.
22322 2003-05-09 Miguel de Icaza <miguel@ximian.com>
22324 * expression.cs (UnaryMutator.LoadOneAndEmitOp): Missing
22325 functionality: I needed to convert the data after I had performed
22326 the add/sub operation into the operands type size.
22328 * ecore.cs (ImplicitReferenceConversion): When boxing an interface
22329 pass the type for the box operation, otherwise the resulting
22330 object would have been of type object.
22332 (BoxedCast): Add constructor to specify the type to box as.
22334 2003-05-07 Miguel de Icaza <miguel@ximian.com>
22336 * iterators.cs: I was reusing the `count' variable inadvertently,
22337 take steps to not allow this to happen.
22339 2003-05-06 Miguel de Icaza <miguel@ximian.com>
22341 * attribute.cs (Attribute.Resolve): Params attributes are encoded
22342 by creating an array at the point where the params starts and
22343 putting all those arguments there, then adjusting the size of the
22346 2003-05-05 Miguel de Icaza <miguel@ximian.com>
22348 * expression.cs (New.AddressOf): Implement interface
22349 IMemoryLocation. This is used when the `new' operator is used in
22350 the context of an invocation to a method on a value type.
22352 See http://bugzilla.ximian.com/show_bug.cgi?id=#42390 for an
22355 * namespace.cs: Also check the using aliases here.
22357 * driver.cs: Move the test for using validity after the types have
22358 been entered, so we do a single pass that also includes the using
22361 * statement.cs (Try.Resolve): Avoid crashing if there is a failure
22362 in the regular case. CreateSiblingForFinally is doing extra
22365 * attribute.cs (GetAttributeArgumentExpression): Store the result
22366 on an out value, and use the return value to indicate failure
22367 instead of using null (which is a valid return for Constant.GetValue).
22369 * statement.cs: Perform the analysis flow for the increment
22370 portion after the statement, because this will be the real flow of
22371 execution. Fixes #42385
22373 * codegen.cs (EmitContext.EmitArgument,
22374 EmitContext.EmitStoreArgument): New helper functions when the
22375 RemapToProxy flag is set.
22377 * expression.cs (ParameterReference.EmitLdarg): Expose this useful
22380 Add support for remapping parameters.
22382 * iterators.cs: Propagate parameter values; Store parameter
22383 values in the proxy classes.
22385 2003-05-04 Miguel de Icaza <miguel@ximian.com>
22387 * ecore.cs (FieldExpr): Fix an obvious bug. static fields do not
22388 need a proxy reference; I do not know what I was thinking
22390 * cs-parser.jay (constructor_initializer): catch another error,
22391 and display nice message.
22393 (field_declaration): catch void field declaration
22394 to flag a better error.
22396 * class.cs (MemberBase.CheckBase): Report an error instead of a
22397 warning if a new protected member is declared in a struct.
22398 (Field.Define): catch the error of readonly/volatile.
22400 * ecore.cs (FieldExpr.EmitAssign): reuse the field lookup.
22402 (FieldExpr.AddressOf): ditto. Catch error where the address of a
22403 volatile variable is taken
22405 2003-05-02 Miguel de Icaza <miguel@ximian.com>
22407 * statement.cs (Fixed.Resolve): Report an error if we are not in
22410 2003-05-01 Miguel de Icaza <miguel@ximian.com>
22412 * typemanager.cs: reuse the code that handles type clashes for
22413 delegates and enumerations.
22415 * class.cs (Report28): Always report.
22417 * expression.cs (EncodeAsAttribute): Allow nulls here.
22419 2003-04-28 Miguel de Icaza <miguel@ximian.com>
22421 * attribute.cs (Attribute.GetAttributeArgumentExpression): Moved
22422 the functionality for testing whether an expression is valid for
22423 an attribute here. Also handle the case of arrays of elements
22426 * expression.cs (ArrayCreation.EncodeAsAttribute): Add support for
22427 encoding a linear array into an array of objects that are suitable
22428 to be passed to an CustomAttributeBuilder.
22430 * delegate.cs: Check unsafe types being used outside of an Unsafe context.
22432 * ecore.cs: (FieldExpr): Handle field remapping here.
22434 * iteratators.cs: Pass the instance variable (if the method is an
22435 instance method) to the constructors, so we can access the field
22436 variables on the class.
22438 TODO: Test this with structs. I think the THIS variable on
22439 structs might have to be a pointer, and not a refenrece
22441 2003-04-27 Miguel de Icaza <miguel@ximian.com>
22443 * codegen.cs (EmitContext.Mapvariable): Adds a mechanism to map
22444 local variables to fields in a proxy class.
22446 * iterators.cs (PopulateProxy): Rename our internal fields to
22448 Create a <THIS> field if we are an instance method, so we can
22449 reference our parent container variables.
22450 (MapVariable): Called back from the EmitContext code to enter a
22451 new variable to field mapping into the proxy class (we just create
22455 (LocalVariableReference.{Emit,EmitAssign,AddressOf}): Add support
22456 for using the remapped locals to fields.
22458 I placed the code here, because that gives the same semantics to
22459 local variables, and only changes the Emit code.
22461 * statement.cs (Fixed.Resolve): it is not allowed to have fixed
22462 statements inside iterators.
22463 (VariableInfo): Add a FieldBuilder for the cases when we are
22464 remapping local variables to fields in a proxy class
22466 * ecore.cs (SimpleNameResolve): Avoid testing two times for
22467 current_block != null.
22469 * statement.cs (Swithc.SimpleSwitchEmit): Removed code that did
22470 not cope with strings, as it has been moved to the
22471 TableSwitchEmit. Fixed bug in switch generation.
22473 * expression.cs (New.DoResolve): Provide more context for the user
22474 when reporting an error.
22476 * ecore.cs (Expression.LoadFromPtr): Use ldind_i when loading
22479 * expression.cs (MemberAccess.DoResolve): When we get a type back,
22480 check the permissions for it. Note than in a type-resolution
22481 context the check was already present in DeclSpace.ResolveType,
22482 but was missing from the MemberAccess.
22484 (ArrayCreation.CheckIndices): warn if the user has
22485 more nested levels of expressions, but there are no more
22486 dimensions specified. Avoids crash on bug 41906.
22488 2003-04-26 Miguel de Icaza <miguel@ximian.com>
22490 * statement.cs (Block): replace Implicit bool, for a generic
22492 New flag: `Unchecked'. This is used during the EmitMeta phase
22493 (which is out-of-line with the regular Resolve/Emit process for a
22494 statement, as this is done ahead of time, but still gets a chance
22495 to call constant resolve).
22497 (Block.Flags): new enum for adding a new flag.
22499 (Block.EmitMeta): track the state of unchecked.
22501 (Unchecked): Set the "UnChecked" flags on any blocks we enclose,
22502 to enable constant resolution to work there as well.
22504 2003-04-22 Miguel de Icaza <miguel@ximian.com>
22506 * typemanager.cs (ienumerable_type): Also look up
22507 System.Collections.IEnumerable.
22509 2003-04-21 Miguel de Icaza <miguel@ximian.com>
22511 TODO: Test more than one conditional per method.
22513 * class.cs (Indexer.Define): Report the location where the user is
22514 referencing the unsupported feature.
22516 (MethodData): Overload the use of `conditionals' to
22517 minimize the creation of needless ArrayLists. This saves roughly
22518 212kb on my machine.
22520 (Method): Implement the new IIteratorContainer interface.
22521 (Method.SetYields): Implement the method by setting the ModFlags
22522 to contain METHOD_YIELDS.
22524 * expression.cs (Unary.ResolveOperator): Use expr_type, not Expr,
22525 which just got set to null.
22527 * iterators.cs: New file.
22529 (Yield, YieldBreak): New statements.
22531 * statement.cs (Return.Resolve): Flag an error if we are used in
22532 an iterator method.
22534 * codegen.cs (InIterator): New flag set if the code is being
22535 compiled in an iterator method.
22537 * modifiers.cs: New flag METHOD_YIELDS. This modifier is an
22538 internal modifier, and we just use it to avoid adding extra
22539 fields, as this is seldom used.
22541 * cs-parser.jay: Add yield_statement (yield and yield break).
22543 * driver.cs: New flag -v2 to turn on version 2 features.
22545 * cs-tokenizer.cs (Tokenizer): Add yield and __yield to the
22546 hashtable when v2 is enabled.
22548 2003-04-20 Miguel de Icaza <miguel@ximian.com>
22550 * typemanager.cs (TypeManager.NamespaceClash): Use to check if
22551 there is already a namespace defined with this name.
22553 (TypeManager.InitCoreTypes): Remove the temporary workaround, as
22554 people upgraded their corlibs.
22556 (TypeManager.CoreLookupType): Use LookupTypeDirect, as we
22557 always use fully qualified types, no need to use the compiler
22560 (TypeManager.IsNamespace): Use binarysearch.
22562 * class.cs (AddClass, AddStruct, AddInterface, AddEvent,
22563 AddDelegate): I did not quite use the new IsValid API properly: I
22564 have to pass the short-name and the fullname. I was passing only
22565 the basename instead of the fullname sometimes.
22567 (TypeContainer.DefineType): call NamespaceClash.
22569 * interface.cs (Interface.DefineType): use NamespaceClash before
22572 * delegate.cs (Delegate.DefineType): use NamespaceClash before
22575 * enum.cs: (Enum.DefineType): use NamespaceClash before
22578 * typemanager.cs (: 3-line patch that gives us some tasty 11%
22579 speed increase. First, use the negative_hits cache when we get a
22580 negative. Second, add the type with its full original name
22581 instead of the new . and + encoded name (reflection uses + to
22582 separate type from a nested type). Use LookupTypeReflection
22583 directly which bypasses the type->name hashtable (that we already
22584 know does not contain the type.
22586 * decl.cs (DeclSpace.ResolveTypeExpr): track the
22587 location/container type.
22589 * driver.cs: When passing utf8, use directly the UTF8Encoding.
22591 2003-04-19 Miguel de Icaza <miguel@ximian.com>
22593 * decl.cs (ResolveTypeExpr): Mirror check acess here too.
22595 * delegate.cs (NewDelegate.Resolve): Test whether an instance
22596 method is being referenced in the method group from a static
22597 context, and report error 120 if so.
22599 * expression.cs, ecore.cs (Error_UnexpectedKind): New name for
22602 * typemanager.cs: Add intermediate namespaces (if a namespace A.B
22603 is created, we create the A namespace).
22605 * cs-parser.jay: A namespace also introduces a DeclarationFound.
22608 2003-04-18 Miguel de Icaza <miguel@ximian.com>
22610 * typemanager.cs (GetReferenceType, GetPointerType): In .NET each
22611 invocation to ModuleBuilder.GetType with the same values will
22612 return a new type instance, so we need to cache its return
22615 * expression.cs (Binary.ResolveOperator): Only allow the compare
22616 operators on enums if they are of the same type.
22618 * ecore.cs (Expression.ImplicitReferenceConversion): handle target
22619 types of ValueType on their own case. Before we were giving them
22620 the same treatment as objects.
22622 * decl.cs (DeclSpace.IsValid): IsValid takes the short name and
22623 fullname. Short name is used to compare against container name.
22624 Fullname is used to check against defined namespace names.
22626 * class.cs (AddProperty, AddField, AddClass, AddStruct, AddEnum,
22627 AddDelegate, AddEvent): Pass new parameter to DeclSpace.IsValid
22629 (Method.CheckBase): Call parent.
22630 (MemberBase.CheckBase): Check for protected members on sealed
22632 (PropertyBase.CheckBase): Call parent.
22633 (Field.Define): Call parent.
22635 * report.cs: Negative error codes are now mapped to 8000 - code,
22636 so that the display is render more nicely.
22638 * typemanager.cs: Do not use try/catch, instead report a regular
22641 (GetPointerType, GetReferenceType): These methods provide
22642 mechanisms to obtain the T* and T& from a T. We had the code
22643 previously scattered around the code base, and it also used
22644 TypeManager.LookupType that would go through plenty of caches.
22645 This one goes directly to the type source.
22647 In some places we did the Type.GetType followed by
22648 ModuleBuilder.GetType, but not in others, so this unifies the
22649 processing as well.
22651 * namespace.cs (VerifyUsing): Perform a non-lazy approach to using
22652 statements now that we have namespace information.
22654 * typemanager.cs (IsNamespace): New method, returns whether the
22655 string presented is a namespace or not.
22657 (ComputeNamespaces): New public entry point, computes the list of
22658 available namespaces, using the GetNamespaces API call in Mono, or
22659 the slower version in MS.NET.
22661 Now before we start the semantic analysis phase, we have a
22662 complete list of namespaces including everything that the user has
22665 Deleted old code to cache namespaces in .nsc files.
22667 2003-04-17 Miguel de Icaza <miguel@ximian.com>
22669 * class.cs: (TypeContainer.DefineDefaultConstructor): Use the
22670 class/struct location definition Location for the implicit
22671 constructor location.
22673 (Operator.Define): Use the location of the operator for the
22674 implicit Method definition.
22676 (Constructor.Emit): use the constructor location for the implicit
22677 base initializer constructor.
22679 * ecore.cs: Remove ITypeExpression. This interface is now gone,
22680 and the Expression class now contains two new methods:
22682 ResolveAsTypeStep and ResolveAsTypeTerminal. This is used to
22683 isolate type lookup from the rest of the resolution process.
22685 Since we use Expressions to hold type definitions due to the way
22686 we parse the input we have historically overloaded Resolve to
22687 perform the Type lookups if a special flag is passed. Now this is
22688 eliminated and two methods take their place.
22690 The differences in the two methods between xStep and xTerminal is
22691 that xStep is involved in our current lookup system that uses
22692 SimpleNames to compose a name, while xTerminal is used just to
22693 catch the case where the simplename lookup failed.
22695 2003-04-16 Miguel de Icaza <miguel@ximian.com>
22697 * expression.cs (ResolveMemberAccess): Remove redundant code.
22698 TypeExpr expressions are always born fully resolved.
22700 * interface.cs (PopulateMethod): Do not lookup the types twice.
22701 We were doing it once during SemanticAnalysis and once during
22704 * cs-parser.jay: Due to our hack in the grammar, things like A.B[]
22705 in local variable type definitions, were being returned as a
22706 SimpleName (we decomposed everything into a string), that is
22707 because primary_expression was being used instead of a type in the
22708 grammar (reduce/reduce conflicts).
22710 The part that was wrong is that we converted the expression into a
22711 string (an oversimplification in one hand, compounded with primary
22712 expressions doing string concatenation).
22718 Would return "A.B.C[]" as a SimpleName. This stopped things like
22719 using clauses from working on this particular context. And a type
22720 was being matched directly against "A.B.C[]".
22722 We now use the correct approach, and allow for ComposedCast to be
22723 part of the unary expression. So the "A.B.C []" become a composed
22724 cast of "A.B.C" (as a nested group of MemberAccess with a
22725 SimpleName at the end) plus the rank composition "[]".
22729 2003-04-10 Miguel de Icaza <miguel@ximian.com>
22731 * decl.cs (CheckAccessLevel): Implement the NestedPrivate rules
22732 for the access level checking.
22734 * class.cs: Cosmetic changes. Renamed `TypeContainer parent' to
22735 `TypeContainer container', because I kept getting confused when I
22736 was debugging this code.
22738 * expression.cs (Indexers): Instead of tracking getters/setters,
22739 we now track them in parallel. We create one arraylist less, but
22740 most importantly it is possible now for the LValue code to find a
22741 matching get for a set.
22743 (IndexerAccess.DoResolveLValue): Update the code.
22744 GetIndexersForType has been modified already to extract all the
22745 indexers from a type. The code assumed it did not.
22747 Also make the code set the correct return type for the indexer.
22748 This was fixed a long time ago for properties, but was missing for
22749 indexers. It used to be void_type.
22751 (Binary.Emit): Test first for doubles instead of
22752 floats, as they are more common.
22754 (Binary.EmitBranchable): Use the .un version of the branch opcodes
22755 when dealing with floats and the <=, >= operators. This fixes bug
22758 * statement.cs (Foreach.EmitArrayForeach): bug fix: The code used
22759 to load the array value by emitting a load on the foreach variable
22760 type. This was incorrect.
22762 We now emit the code to load an element using the the array
22763 variable type, and then we emit the conversion operator.
22767 2003-04-10 Zoltan Varga <vargaz@freemail.hu>
22769 * attribute.cs: Avoid allocation of ArrayLists in the common case.
22771 2003-04-09 Miguel de Icaza <miguel@ximian.com>
22773 * class.cs (MethodSignature.InheritableMemberSignatureCompare):
22774 test for protection before we test for signatures.
22776 (MethodSignature.ToString): implement.
22778 * expression.cs (Unary.TryReduceNegative): Add missing minus sign
22779 to the case where we reduced into a LongConstant.
22781 * decl.cs (CheckAccessLevel): If the type is an array, we can not
22782 depend on whether the information is acurrate, because the
22783 Microsoft runtime will always claim that the array type is public,
22784 regardless of the real state.
22786 If the type is a pointer, another problem happens: the type is
22787 reported as non-public in Microsoft.
22789 In both cases we have to call CheckAccessLevel recursively with
22790 the underlying type as the argument to be tested.
22792 2003-04-08 Miguel de Icaza <miguel@ximian.com>
22794 * assign.cs (Assign.Emit): If we are dealing with a compound
22795 assignment expression, we should use the code path that stores the
22796 intermediate result in a temporary value. This fixes #40903.
22798 *expression.cs (Indirection.ToString): Provide ToString method for
22801 2003-04-08 Zoltan Varga <vargaz@freemail.hu>
22803 * class.cs: Null out fields holding references to Block objects so
22804 they can be garbage collected.
22806 * expression.cs (OverloadResolve): Remove unused local.
22808 2003-04-07 Martin Baulig <martin@ximian.com>
22810 * codegen.cs (EmitContext.CurrentFile): New public field.
22811 (EmitContext.Mark): Use the CurrentFile to check whether the
22812 location is in the correct file.
22813 (EmitContext.EmitTopBlock): Initialize CurrentFile here.
22815 2003-04-07 Martin Baulig <martin@ximian.com>
22817 * ecore.cs (Expression.ResolveBoolean): Don't call ec.Mark().
22819 * codegen.cs (EmitContext.EmitTopBlock): Don't call Mark() on the
22820 location. [FIXME: The location argument which gets passed to this
22821 method is sometimes wrong!]
22823 2003-04-07 Nick Drochak <ndrochak@gol.com>
22825 * codegen.cs: Be more verbose when we can't find the symbol writer dll.
22827 2003-04-07 Miguel de Icaza <miguel@ximian.com>
22829 * expression.cs (Indirection.EmitAssign): We were using the
22830 temporary, but returning immediately instead of continuing the
22833 2003-04-06 Martin Baulig <martin@ximian.com>
22835 * ecore.cs (SimpleName.SimpleNameResolve): Don't report an error
22836 if it's a nested child, but also deriving from the outer class.
22839 * typemanager.cs (IsNestedChildOf): Make this work if it's a
22840 nested child, but also deriving from the outer class. See
22842 (FilterWithClosure): We may access private members of the outer
22843 class if we're a nested child and deriving from the outer class.
22844 (RealMemberLookup): Only set `closure_private_ok' if the
22845 `original_bf' contained BindingFlags.NonPublic.
22847 2003-04-05 Martin Baulig <martin@ximian.com>
22849 * statement.cs (FlowBranching.UsageVector.MergeChildren): Fix bug #40670.
22851 2003-04-02 Miguel de Icaza <miguel@ximian.com>
22853 * class.cs (Event.Define): Do not allow abstract events to have
22856 2003-04-01 Miguel de Icaza <miguel@ximian.com>
22858 * cs-parser.jay: Add error productions for ADD/REMOVE missing a
22859 block in event declarations.
22861 * ecore.cs (FieldExpr.AddressOf): If our instance expression is a
22862 value type, get its address.
22864 * expression.cs (Is.Emit): For action `LeaveOnStack' we were
22865 leaving a class on the stack instead of a boolean value (int
22866 0/1). Change the code so we compare against null, and then the
22867 result against zero.
22869 * class.cs (TypeContainer.GetClassBases): We were checking for the
22870 parent class being sealed too late.
22872 * expression.cs (Binary.Emit): For <= and >= when dealing with
22873 floating point values, use cgt.un and clt.un instead of cgt and
22876 2003-04-01 Zoltan Varga <vargaz@freemail.hu>
22878 * statement.cs: Apply the same optimization as MS: skip the
22879 GetEnumerator returning an IEnumerator, and use the one returning a
22880 CharEnumerator instead. This allows us to avoid the try-finally block
22883 2003-03-31 Gaurav Vaish <gvaish_mono@lycos.com>
22885 * cs-parser.jay: Attributes cannot be applied to
22886 namespaces. Fixes #40473
22888 2003-03-31 Gonzalo Paniagua Javier <gonzalo@ximian.com>
22891 (Add*): check if the name is valid using the full name for constants,
22892 fields, properties and events.
22894 2003-03-28 Miguel de Icaza <miguel@ximian.com>
22896 * enum.cs (Enum.DefineType, Enum.IsValidEnumConstant): Also allow
22897 char constants to be part of the enumeration.
22899 * expression.cs (Conditional.DoResolve): Add support for operator
22900 true. Implements the missing functionality from 14.12
22902 * class.cs (TypeContainer.CheckPairedOperators): Report error for missmatch on
22903 operator true/false as required by the spec.
22905 * expression.cs (Unary.ResolveOperator): In LogicalNot, do an
22906 implicit conversion to boolean.
22908 * statement.cs (Statement.ResolveBoolean): A boolean expression is
22909 also one where the type implements `operator true'.
22911 * ecore.cs (Expression.GetOperatorTrue): New helper routine to
22912 get an expression that will invoke operator true based on an
22915 (GetConversionOperators): Removed the hack that called op_True
22918 (Expression.ResolveBoolean): Move this from Statement.
22920 2003-03-17 Miguel de Icaza <miguel@ximian.com>
22922 * ecore.cs (FieldExpr): do not allow initialization of initonly
22923 fields on derived classes
22925 2003-03-13 Martin Baulig <martin@ximian.com>
22927 * statement.cs (Block.Emit): Call ig.BeginScope() and
22928 ig.EndScope() when compiling with debugging info; call
22929 LocalBuilder.SetLocalSymInfo _after_ opening the scope.
22931 2003-03-08 Miguel de Icaza <miguel@ximian.com>
22933 * expression.cs (Indexers): Do not construct immediately, allow
22934 for new members to be appended as we go. Fixes 38143
22936 2003-03-07 Gonzalo Paniagua Javier <gonzalo@ximian.com>
22938 * expression.cs: save/restore context when resolving an unchecked
22941 2003-03-05 Miguel de Icaza <miguel@ximian.com>
22943 * cfold.cs: Catch division by zero in modulus operator during
22946 2003-03-03 Miguel de Icaza <miguel@ximian.com>
22948 * interface.cs (Interface.DefineMembers): Avoid defining members
22951 2003-02-27 Miguel de Icaza <miguel@ximian.com>
22953 * driver.cs: handle the +/- options for -noconfig
22955 * statement.cs (Unckeched.Resolve): Also track the state of
22956 unchecked in the Resolve phase.
22958 2003-02-27 Martin Baulig <martin@ximian.com>
22960 * ecore.cs (Expression.MemberLookup): Don't create a
22961 MethodGroupExpr for something which is not a method. Fixes #38291.
22963 2003-02-25 Miguel de Icaza <miguel@ximian.com>
22965 * class.cs (MemberBase.CheckParameters): Also check that the type
22966 is unmanaged if it is a pointer.
22968 * expression.cs (SizeOf.Resolve): Add location information.
22970 * statement.cs (Block.EmitMeta): Flag error (208) if a pointer to
22971 a managed type is declared.
22973 * expression.cs (Invocation.VerifyArgumentsCompat): Check for the
22974 parameter modifiers as well. Fixes bug 38606
22976 * class.cs: Very sad. Am backing out the speed up changes
22977 introduced by the ArrayList -> Array in the TypeContainer, as they
22978 were not actually that much faster, and introduced a bug (no error
22979 reports on duplicated methods).
22981 * assign.cs (CompoundAssign.DoLResolve): Resolve the original
22982 source first, this will guarantee that we have a valid expression
22983 before calling in lower levels functions that will require a
22984 resolved object. Then use this original_source in the
22985 target.ResolveLValue instead of the original source that was
22988 Another change. Use target.Resolve instead of LValueResolve.
22989 Although we are resolving for LValues, we will let the Assign code
22990 take care of that (it will be called again from Resolve). This
22991 basically allows code like this:
22993 class X { X operator + (X x, object o) {} X this [int idx] { get; set; } }
22994 class Y { void A (X x) { x [0] += o; }
22996 The problem was that the indexer was trying to resolve for
22997 set_Item (idx, object o) and never finding one. The real set_Item
22998 was set_Item (idx, X). By delaying the process we get the right
23003 2003-02-23 Martin Baulig <martin@ximian.com>
23005 * statement.cs (Block.Emit): Override this and set ec.CurrentBlock
23006 while calling DoEmit ().
23008 * codegen.cs (EmitContext.Mark): Don't mark locations in other
23009 source files; if you use the #line directive inside a method, the
23010 compiler stops emitting line numbers for the debugger until it
23011 reaches the end of the method or another #line directive which
23012 restores the original file.
23014 2003-02-23 Martin Baulig <martin@ximian.com>
23016 * statement.cs (FlowBranching.UsageVector.MergeChildren): Fix bug #37708.
23018 2003-02-23 Martin Baulig <martin@ximian.com>
23020 * statement.cs (Block.AddChildVariableNames): We need to call this
23021 recursively, not just for our immediate children.
23023 2003-02-23 Martin Baulig <martin@ximian.com>
23025 * class.cs (Event.Define): Always make the field private, like csc does.
23027 * typemanager.cs (TypeManager.RealMemberLookup): Make events
23028 actually work, fixes bug #37521.
23030 2003-02-23 Miguel de Icaza <miguel@ximian.com>
23032 * delegate.cs: When creating the various temporary "Parameters"
23033 classes, make sure that we call the ComputeAndDefineParameterTypes
23034 on those new parameters (just like we do with the formal ones), to
23035 allow them to be resolved in the context of the DeclSpace.
23037 This fixes the bug that Dick observed in Bugzilla #38530.
23039 2003-02-22 Miguel de Icaza <miguel@ximian.com>
23041 * expression.cs (ResolveMemberAccess): When resolving a constant,
23042 do not attempt to pull a constant if the value was not able to
23043 generate a valid constant.
23045 * const.cs (LookupConstantValue): Do not report more errors than required.
23047 2003-02-19 Gonzalo Paniagua Javier <gonzalo@ximian.com>
23049 * expression.cs: fixes bug #38328.
23051 2003-02-18 Miguel de Icaza <miguel@ximian.com>
23053 * class.cs: Changed all the various members that can be part of a
23054 class from being an ArrayList to be an Array of the right type.
23055 During the DefineType type_list, interface_list, delegate_list and
23056 enum_list are turned into types, interfaces, delegates and enums
23059 And during the member population, indexer_list, event_list,
23060 constant_list, field_list, instance_constructor_list, method_list,
23061 operator_list and property_list are turned into their real arrays.
23063 Although we could probably perform this operation earlier, for
23064 good error reporting we need to keep the lists and remove the
23065 lists for longer than required.
23067 This optimization was triggered by Paolo profiling the compiler
23068 speed on the output of `gen-sample-program.pl' perl script.
23070 * decl.cs (DeclSpace.ResolveType): Set the ContainerType, so we do
23071 not crash in methods like MemberLookupFailed that use this field.
23073 This problem arises when the compiler fails to resolve a type
23074 during interface type definition for example.
23076 2003-02-18 Miguel de Icaza <miguel@ximian.com>
23078 * expression.cs (Indexers.GetIndexersForType): Interfaces do not
23079 inherit from System.Object, so we have to stop at null, not only
23080 when reaching System.Object.
23082 2003-02-17 Miguel de Icaza <miguel@ximian.com>
23084 * expression.cs: (Indexers.GetIndexersForType): Martin's fix used
23085 DeclaredOnly because the parent indexer might have had a different
23086 name, but did not loop until the top of the hierarchy was reached.
23088 The problem this one fixes is 35492: when a class implemented an
23089 indexer from an interface, we were getting the interface method
23090 (which was abstract) and we were flagging an error (can not invoke
23093 This also keeps bug 33089 functioning, and test-148 functioning.
23095 * typemanager.cs (IsSpecialMethod): The correct way of figuring
23096 out if a method is special is to see if it is declared in a
23097 property or event, or whether it is one of the predefined operator
23098 names. This should fix correctly #36804.
23100 2003-02-15 Miguel de Icaza <miguel@ximian.com>
23102 The goal here is to remove the dependency on EmptyCast.Peel ().
23103 Killing it completely.
23105 The problem is that currently in a number of places where
23106 constants are expected, we have to "probe" for an EmptyCast, and
23107 Peel, which is not the correct thing to do, as this will be
23108 repetitive and will likely lead to errors.
23110 The idea is to remove any EmptyCasts that are used in casts that
23111 can be reduced to constants, so we only have to cope with
23114 This bug hunt was triggered by Bug 37363 and the desire to remove
23115 the duplicate pattern where we were "peeling" emptycasts to check
23116 whether they were constants. Now constants will always be
23119 * ecore.cs: Use an enumconstant here instead of wrapping with
23122 * expression.cs (Cast.TryReduce): Ah, the tricky EnumConstant was
23123 throwing me off. By handling this we can get rid of a few hacks.
23125 * statement.cs (Switch): Removed Peel() code.
23127 2003-02-14 Miguel de Icaza <miguel@ximian.com>
23129 * class.cs: Location information for error 508
23131 * expression.cs (New.DoResolve): Add a guard against double
23132 resolution of an expression.
23134 The New DoResolve might be called twice when initializing field
23135 expressions (see EmitFieldInitializers, the call to
23136 GetInitializerExpression will perform a resolve on the expression,
23137 and later the assign will trigger another resolution
23139 This leads to bugs (#37014)
23141 * delegate.cs: The signature for EndInvoke should contain any ref
23142 or out parameters as well. We were not doing this in the past.
23144 * class.cs (Field.Define): Do not overwrite the type definition
23145 inside the `volatile' group. Turns out that volatile enumerations
23146 were changing the type here to perform a validity test, which
23149 2003-02-12 Miguel de Icaza <miguel@ximian.com>
23151 * ecore.cs (FieldExpr.AddressOf): In the particular case of This
23152 and structs, we do not want to load the instance variable
23154 (ImplicitReferenceConversion, ImplicitReferenceConversionExists):
23155 enum_type has to be handled like an object reference (implicit
23156 conversions exists from this to object), but the regular IsClass
23157 and IsValueType tests will never return true for this one.
23159 Also we use TypeManager.IsValueType instead of type.IsValueType,
23160 just for consistency with the rest of the code (this is only
23161 needed if we ever use the construct exposed by test-180.cs inside
23162 corlib, which we dont today).
23164 2003-02-12 Zoltan Varga <vargaz@freemail.hu>
23166 * attribute.cs (ApplyAttributes): apply all MethodImplAttributes, not
23169 2003-02-09 Martin Baulig <martin@ximian.com>
23171 * namespace.cs (Namespace..ctor): Added SourceFile argument.
23172 (Namespace.DefineNamespaces): New static public method; this is
23173 called when we're compiling with debugging to add all namespaces
23174 to the symbol file.
23176 * tree.cs (Tree.RecordNamespace): Added SourceFile argument and
23177 pass it to the Namespace's .ctor.
23179 * symbolwriter.cs (SymbolWriter.OpenMethod): Added TypeContainer
23180 and MethodBase arguments; pass the namespace ID to the symwriter;
23181 pass the MethodBase instead of the token to the symwriter.
23182 (SymbolWriter.DefineNamespace): New method to add a namespace to
23185 2003-02-09 Martin Baulig <martin@ximian.com>
23187 * symbolwriter.cs: New file. This is a wrapper around
23188 ISymbolWriter with a cleaner API. We'll dynamically Invoke()
23189 methods here in near future.
23191 2003-02-09 Martin Baulig <martin@ximian.com>
23193 * codegen.cs (EmitContext.Mark): Just pass the arguments to
23194 ILGenerator.MarkSequencePoint() which are actually used by the
23197 2003-02-09 Martin Baulig <martin@ximian.com>
23199 * location.cs (SourceFile): New public sealed class. This
23200 contains the name and an index which is used in the location's token.
23201 (Location): Reserve an appropriate number of bits in the token for
23202 the source file instead of walking over that list, this gives us a
23203 really huge performance improvement when compiling with debugging.
23205 * driver.cs (Driver.parse, Driver.tokenize_file): Take a
23206 `SourceFile' argument instead of a string.
23207 (Driver.ProcessFile): Add all the files via Location.AddFile(),
23208 but don't parse/tokenize here, we need to generate the list of all
23209 source files before we do that.
23210 (Driver.ProcessFiles): New static function. Parses/tokenizes all
23213 * cs-parser.jay (CSharpParser): Take a `SourceFile' argument
23214 instead of a string.
23216 * cs-tokenizer.cs (Tokenizer): Take `SourceFile' argument instead
23219 2003-02-09 Martin Baulig <martin@ximian.com>
23221 * cs-tokenizer.cs (Tokenizer.PreProcessLine): Also reset the
23222 filename on `#line default'.
23224 Sat Feb 8 17:03:16 CET 2003 Paolo Molaro <lupus@ximian.com>
23226 * statement.cs: don't clear the pinned var when the fixed statement
23227 returns from the method (fixes bug#37752).
23229 Sat Feb 8 12:58:06 CET 2003 Paolo Molaro <lupus@ximian.com>
23231 * typemanager.cs: fix from mathpup@mylinuxisp.com (Marcus Urban)
23234 2003-02-07 Martin Baulig <martin@ximian.com>
23236 * driver.cs: Removed the `--debug-args' command line argument.
23238 * codegen.cs (CodeGen.SaveSymbols): Removed, this is now done
23239 automatically by the AsssemblyBuilder.
23240 (CodeGen.InitializeSymbolWriter): We don't need to call any
23241 initialization function on the symbol writer anymore. This method
23242 doesn't take any arguments.
23244 2003-02-03 Miguel de Icaza <miguel@ximian.com>
23246 * driver.cs: (AddAssemblyAndDeps, LoadAssembly): Enter the types
23247 from referenced assemblies as well.
23249 2003-02-02 Martin Baulig <martin@ximian.com>
23251 * class.cs (MethodData.Emit): Generate debugging info for external methods.
23253 2003-02-02 Martin Baulig <martin@ximian.com>
23255 * class.cs (Constructor.Emit): Open the symbol writer before
23256 emitting the constructor initializer.
23257 (ConstructorInitializer.Emit): Call ec.Mark() to allow
23258 single-stepping through constructor initializers.
23260 2003-01-30 Miguel de Icaza <miguel@ximian.com>
23262 * class.cs: Handle error 549: do not allow virtual methods in
23265 2003-02-01 Jackson Harper <jackson@latitudegeo.com>
23267 * decl.cs: Check access levels when resolving types
23269 2003-01-31 Jackson Harper <jackson@latitudegeo.com>
23271 * statement.cs: Add parameters and locals set in catch blocks that might
23272 return to set vector
23274 2003-01-29 Miguel de Icaza <miguel@ximian.com>
23276 * class.cs (Operator): Set the SpecialName flags for operators.
23278 * expression.cs (Invocation.DoResolve): Only block calls to
23279 accessors and operators on SpecialName methods.
23281 (Cast.TryReduce): Handle conversions from char constants.
23284 Tue Jan 28 17:30:57 CET 2003 Paolo Molaro <lupus@ximian.com>
23286 * statement.cs: small memory and time optimization in FlowBranching.
23288 2003-01-28 Pedro Mart <yoros@wanadoo.es>
23290 * expression.cs (IndexerAccess.DoResolveLValue): Resolve the same
23291 problem that the last fix but in the other sid (Set).
23293 * expression.cs (IndexerAccess.DoResolve): Fix a problem with a null
23294 access when there is no indexer in the hierarchy.
23296 2003-01-27 Jackson Harper <jackson@latitudegeo.com>
23298 * class.cs: Combine some if statements.
23300 2003-01-27 Gonzalo Paniagua Javier <gonzalo@ximian.com>
23302 * driver.cs: fixed bug #37187.
23304 2003-01-27 Pedro Martinez Juliá <yoros@wanadoo.es>
23306 * expression.cs (IndexerAccess.DoResolve): Before trying to resolve
23307 any indexer, it's needed to build a list with all the indexers in the
23308 hierarchy (AllGetters), else we have problems. Fixes #35653.
23310 2003-01-23 Miguel de Icaza <miguel@ximian.com>
23312 * class.cs (MethodData.Define): It is wrong for an interface
23313 implementation to be static in both cases: explicit and implicit.
23314 We were only handling this in one case.
23316 Improve the if situation there to not have negations.
23318 * class.cs (Field.Define): Turns out that we do not need to check
23319 the unsafe bit on field definition, only on usage. Remove the test.
23321 2003-01-22 Gonzalo Paniagua Javier <gonzalo@ximian.com>
23323 * driver.cs: use assembly.Location instead of Codebase (the latest
23324 patch made mcs fail when using MS assemblies).
23326 2003-01-21 Tim Haynes <thaynes@openlinksw.com>
23328 * driver.cs: use DirectorySeparatorChar instead of a hardcoded "/" to
23329 get the path to *corlib.dll.
23331 2003-01-21 Nick Drochak <ndrochak@gol.com>
23335 * typemanager.cs: Remove compiler warnings
23337 2003-01-20 Duncan Mak <duncan@ximian.com>
23339 * AssemblyInfo.cs: Bump the version number to 0.19.
23341 2003-01-20 Gonzalo Paniagua Javier <gonzalo@ximian.com>
23343 * cs-tokenizer.cs: little fixes to line numbering when #line is used.
23345 2003-01-18 Zoltan Varga <vargaz@freemail.hu>
23347 * class.cs (Constructor::Emit): Emit debugging info for constructors.
23349 2003-01-17 Miguel de Icaza <miguel@ximian.com>
23351 * cs-parser.jay: Small fix: we were not comparing the constructor
23352 name correctly. Thanks to Zoltan for the initial pointer.
23354 2003-01-16 Jackson Harper <jackson@latitudegeo.com>
23356 * cs-tokenizer.cs: Set file name when specified with #line
23358 2003-01-15 Miguel de Icaza <miguel@ximian.com>
23360 * cs-parser.jay: Only perform the constructor checks here if we
23361 are named like the class; This will help provider a better
23362 error. The constructor path is taken when a type definition is
23363 not found, but most likely the user forgot to add the type, so
23364 report that rather than the constructor error.
23366 Tue Jan 14 10:36:49 CET 2003 Paolo Molaro <lupus@ximian.com>
23368 * class.cs, rootcontext.cs: small changes to avoid unnecessary memory
23371 2003-01-13 Jackson Harper <jackson@latitudegeo.com>
23373 * cs-parser.jay: Add cleanup call.
23375 2003-01-13 Duncan Mak <duncan@ximian.com>
23377 * cs-tokenizer.cs (Cleanup): Rename to 'cleanup' to make it more
23378 consistent with other methods.
23380 2003-01-13 Jackson Harper <jackson@latitudegeo.com>
23382 * cs-tokenizer.cs: Add Cleanup method, also fix #region error messages.
23384 Sun Jan 12 19:58:42 CET 2003 Paolo Molaro <lupus@ximian.com>
23386 * attribute.cs: only set GuidAttr to true when we have a
23389 2003-01-09 Gonzalo Paniagua Javier <gonzalo@ximian.com>
23393 * typemanager.cs: fixes to allow mcs compile corlib with the new
23394 Type.IsSubclassOf fix.
23396 2003-01-08 Miguel de Icaza <miguel@ximian.com>
23398 * expression.cs (LocalVariableReference.DoResolve): Classify a
23399 constant as a value, not as a variable. Also, set the type for
23402 * cs-parser.jay (fixed_statement): take a type instead of a
23403 pointer_type, so we can produce a better error message later.
23405 * statement.cs (Fixed.Resolve): Flag types that are not pointers
23408 (For.DoEmit): Make inifinite loops have a
23409 non-conditional branch back.
23411 (Fixed.DoEmit): First populate the pinned variables, then emit the
23412 statement, then clear the variables. Before I was emitting the
23413 code once for each fixed piece.
23416 2003-01-08 Martin Baulig <martin@ximian.com>
23418 * statement.cs (FlowBranching.MergeChild): A break in a
23419 SWITCH_SECTION does not leave a loop. Fixes #36155.
23421 2003-01-08 Martin Baulig <martin@ximian.com>
23423 * statement.cs (FlowBranching.CheckOutParameters): `struct_params'
23424 lives in the same number space than `param_map'. Fixes #36154.
23426 2003-01-07 Miguel de Icaza <miguel@ximian.com>
23428 * cs-parser.jay (constructor_declaration): Set the
23429 Constructor.ModFlags before probing for it. This makes the
23430 compiler report 514, 515 and 132 (the code was there, but got
23433 * statement.cs (Goto.Resolve): Set `Returns' to ALWAYS.
23434 (GotoDefault.Resolve): Set `Returns' to ALWAYS.
23435 (GotoCase.Resolve): Set `Returns' to ALWAYS.
23437 Tue Jan 7 18:32:24 CET 2003 Paolo Molaro <lupus@ximian.com>
23439 * enum.cs: create the enum static fields using the enum type.
23441 Tue Jan 7 18:23:44 CET 2003 Paolo Molaro <lupus@ximian.com>
23443 * class.cs: don't try to create the ParamBuilder for the return
23444 type if it's not needed (and handle it breaking for the ms runtime
23447 2003-01-06 Jackson Harper <jackson@latitudegeo.com>
23449 * cs-tokenizer.cs: Add REGION flag to #region directives, and add checks to make sure that regions are being poped correctly
23451 2002-12-29 Miguel de Icaza <miguel@ximian.com>
23453 * cs-tokenizer.cs (get_cmd_arg): Fixups to allow \r to terminate
23454 the command. This showed up while compiling the JANET source
23455 code, which used \r as its only newline separator.
23457 2002-12-28 Miguel de Icaza <miguel@ximian.com>
23459 * class.cs (Method.Define): If we are an operator (because it
23460 reuses our code), then set the SpecialName and HideBySig. #36128
23462 2002-12-22 Miguel de Icaza <miguel@ximian.com>
23464 * ecore.cs (FieldExpr.DoResolve): Instead of throwing an
23465 exception, report error 120 `object reference required'.
23467 * driver.cs: Add --pause option, used during to measure the size
23468 of the process as it goes with --timestamp.
23470 * expression.cs (Invocation.DoResolve): Do not allow methods with
23471 SpecialName to be invoked.
23473 2002-12-21 Miguel de Icaza <miguel@ximian.com>
23475 * cs-tokenizer.cs: Small fix to the parser: compute the ascii
23476 number before adding it.
23478 2002-12-21 Ravi Pratap <ravi@ximian.com>
23480 * ecore.cs (StandardImplicitConversion): When in an unsafe
23481 context, we allow conversion between void * to any other pointer
23482 type. This fixes bug #35973.
23484 2002-12-20 Jackson Harper <jackson@latitudegeo.com>
23486 * codegen.cs: Use Path.GetFileNameWithoutExtension so an exception
23487 is not thrown when extensionless outputs are used
23489 2002-12-20 Gonzalo Paniagua Javier <gonzalo@ximian.com>
23491 * rootcontext.cs: fixed compilation of corlib.
23493 2002-12-19 Miguel de Icaza <miguel@ximian.com>
23495 * attribute.cs (Attributes.Contains): Add new method.
23497 * class.cs (MethodCore.LabelParameters): if the parameter is an
23498 `out' parameter, check that no attribute `[In]' has been passed.
23500 * enum.cs: Handle the `value__' name in an enumeration.
23502 2002-12-14 Jaroslaw Kowalski <jarek@atm.com.pl>
23504 * decl.cs: Added special case to allow overrides on "protected
23507 2002-12-18 Ravi Pratap <ravi@ximian.com>
23509 * attribute.cs (Attributes.AddAttributeSection): Rename to this
23510 since it makes much more sense.
23512 (Attributes.ctor): Don't require a Location parameter.
23514 * rootcontext.cs (AddGlobalAttributeSection): Rename again.
23516 * attribute.cs (ApplyAttributes): Remove extra Location parameters
23517 since we already have that information per attribute.
23519 * everywhere : make appropriate changes.
23521 * class.cs (LabelParameters): Write the code which actually
23522 applies attributes to the return type. We can't do this on the MS
23523 .NET runtime so we flag a warning in the case an exception is
23526 2002-12-18 Miguel de Icaza <miguel@ximian.com>
23528 * const.cs: Handle implicit null conversions here too.
23530 2002-12-17 Ravi Pratap <ravi@ximian.com>
23532 * class.cs (MethodCore.LabelParameters): Remove the extra
23533 Type [] parameter since it is completely unnecessary. Instead
23534 pass in the method's attributes so that we can extract
23535 the "return" attribute.
23537 2002-12-17 Miguel de Icaza <miguel@ximian.com>
23539 * cs-parser.jay (parse): Use Report.Error to flag errors instead
23540 of ignoring it and letting the compile continue.
23542 * typemanager.cs (ChangeType): use an extra argument to return an
23543 error condition instead of throwing an exception.
23545 2002-12-15 Miguel de Icaza <miguel@ximian.com>
23547 * expression.cs (Unary.TryReduce): mimic the code for the regular
23548 code path. Perform an implicit cast in the cases where we can
23549 implicitly convert to one of the integral types, and then reduce
23550 based on that constant. This fixes bug #35483.
23552 2002-12-14 Gonzalo Paniagua Javier <gonzalo@ximian.com>
23554 * typemanager.cs: fixed cut & paste error in GetRemoveMethod.
23556 2002-12-13 Gonzalo Paniagua Javier <gonzalo@ximian.com>
23558 * namespace.cs: fixed bug #35489.
23560 2002-12-12 Miguel de Icaza <miguel@ximian.com>
23562 * class.cs: Remove some dead code.
23564 * cs-parser.jay: Estimate the number of methods needed
23565 (RootContext.MethodCount);
23567 * cs-tokenizer.cs: Use char arrays for parsing identifiers and
23568 numbers instead of StringBuilders.
23570 * support.cs (PtrHashtable): Add constructor with initial size;
23571 We can now reduce reallocations of the method table.
23573 2002-12-10 Ravi Pratap <ravi@ximian.com>
23575 * attribute.cs (ApplyAttributes): Keep track of the emitted
23576 attributes on a per-target basis. This fixes bug #35413.
23578 2002-12-10 Miguel de Icaza <miguel@ximian.com>
23580 * driver.cs (MainDriver): On rotor encoding 28591 does not exist,
23581 default to the Windows 1252 encoding.
23583 (UnixParseOption): Support version, thanks to Alp for the missing
23586 * AssemblyInfo.cs: Add nice assembly information.
23588 * cs-tokenizer.cs: Add fix from Felix to the #if/#else handler
23591 * cs-parser.jay: Allow a trailing comma before the close bracked
23592 in the attribute_section production.
23594 * ecore.cs (FieldExpr.AddressOf): Until I figure out why the
23595 address of the instance was being taken, I will take this out,
23596 because we take the address of the object immediately here.
23598 2002-12-09 Ravi Pratap <ravi@ximian.com>
23600 * typemanager.cs (AreMultipleAllowed): Take care of the most
23601 obvious case where attribute type is not in the current assembly -
23604 2002-12-08 Miguel de Icaza <miguel@ximian.com>
23606 * ecore.cs (SimpleName.DoResolve): First perform lookups on using
23607 definitions, instead of doing that afterwards.
23609 Also we use a nice little hack, depending on the constructor, we
23610 know if we are a "composed" name or a simple name. Hence, we
23611 avoid the IndexOf test, and we avoid
23613 * codegen.cs: Add code to assist in a bug reporter to track down
23614 the source of a compiler crash.
23616 2002-12-07 Ravi Pratap <ravi@ximian.com>
23618 * attribute.cs (Attribute.ApplyAttributes) : Keep track of which attribute
23619 types have been emitted for a given element and flag an error
23620 if something which does not have AllowMultiple set is used more
23623 * typemanager.cs (RegisterAttributeAllowMultiple): Keep track of
23624 attribute types and their corresponding AllowMultiple properties
23626 (AreMultipleAllowed): Check the property for a given type.
23628 * attribute.cs (Attribute.ApplyAttributes): Register the AllowMultiple
23629 property in the case we have a TypeContainer.
23631 (Attributes.AddAttribute): Detect duplicates and just skip on
23632 adding them. This trivial fix catches a pretty gross error in our
23633 attribute emission - global attributes were being emitted twice!
23635 Bugzilla bug #33187 is now fixed.
23637 2002-12-06 Miguel de Icaza <miguel@ximian.com>
23639 * cs-tokenizer.cs (pp_expr): Properly recurse here (use pp_expr
23640 instead of pp_and).
23642 * expression.cs (Binary.ResolveOperator): I can only use the
23643 Concat (string, string, string) and Concat (string, string,
23644 string, string) if the child is actually a concatenation of
23647 2002-12-04 Miguel de Icaza <miguel@ximian.com>
23649 * cs-tokenizer.cs: Small fix, because decimal_digits is used in a
23650 context where we need a 2-character lookahead.
23652 * pending.cs (PendingImplementation): Rework so we can keep track
23653 of interface types all the time, and flag those which were
23654 implemented by parents as optional.
23656 2002-12-03 Miguel de Icaza <miguel@ximian.com>
23658 * expression.cs (Binary.ResolveOperator): Use
23659 String.Concat(string,string,string) or
23660 String.Concat(string,string,string,string) when possible.
23662 * typemanager: More helper methods.
23665 Tue Dec 3 19:32:04 CET 2002 Paolo Molaro <lupus@ximian.com>
23667 * pending.cs: remove the bogus return from GetMissingInterfaces()
23668 (see the 2002-11-06 entry: the mono runtime is now fixed in cvs).
23670 2002-12-02 Gonzalo Paniagua Javier <gonzalo@ximian.com>
23672 * namespace.cs: avoid duplicated 'using xxx' being added to
23673 using_clauses. This prevents mcs from issuing and 'ambiguous type' error
23674 when we get more than one 'using' statement for the same namespace.
23675 Report a CS0105 warning for it.
23677 2002-11-30 Miguel de Icaza <miguel@ximian.com>
23679 * cs-tokenizer.cs (consume_identifier): use read directly, instead
23680 of calling getChar/putback, uses internal knowledge of it.
23682 (xtoken): Reorder tokenizer so most common patterns are checked
23683 first. This reduces the compilation time in another 5% (from 8.11s
23684 average to 7.73s for bootstrapping mcs on my Mobile p4/1.8ghz).
23686 The parsing time is 22% of the compilation in mcs, and from that
23687 64% is spent on the tokenization process.
23689 I tried using a binary search for keywords, but this is slower
23690 than the hashtable. Another option would be to do a couple of
23693 * Not use a StringBuilder, instead use an array of chars,
23694 with a set value. Notice that this way we could catch
23695 the 645 error without having to do it *afterwards*.
23697 * We could write a hand-parser to avoid the hashtable
23698 compares altogether.
23700 The identifier consumption process takes 37% of the tokenization
23701 time. Another 15% is spent on is_number. 56% of the time spent
23702 on is_number is spent on Int64.Parse:
23704 * We could probably choose based on the string length to
23705 use Int32.Parse or Int64.Parse and avoid all the 64-bit
23708 Another 3% is spend on wrapping `xtoken' in the `token' function.
23710 Handle 0xa0 as whitespace (#34752)
23712 2002-11-26 Miguel de Icaza <miguel@ximian.com>
23714 * typemanager.cs (IsCLRType): New routine to tell whether a type
23715 is one of the builtin types.
23717 Maybe it needs to use TypeCodes to be faster. Maybe we could use
23718 typecode in more places instead of doing pointer comparissions.
23719 We could leverage some knowledge about the way the typecodes are
23722 New code to cache namespaces in assemblies, it is currently not
23723 invoked, to be used soon.
23725 * decl.cs (DeclSpace.MakeFQN): Simple optimization.
23727 * expression.cs (Binary.ResolveOperator): specially handle
23728 strings, and do not perform user-defined operator overloading for
23731 2002-11-24 Miguel de Icaza <miguel@ximian.com>
23733 * cs-tokenizer.cs: Avoid calling Char.IsDigit which is an
23734 internalcall as it is a pretty simple operation; Avoid whenever
23735 possible to call Char.IsLetter.
23737 (consume_identifier): Cut by half the number of
23738 hashtable calls by merging the is_keyword and GetKeyword behavior.
23740 Do not short-circuit, because if we do, we
23741 report errors (ie, #if false && true would produce an invalid
23745 2002-11-24 Martin Baulig <martin@ximian.com>
23747 * expression.cs (Cast.TryReduce): If we're in checked syntax,
23748 check constant ranges and report a CS0221. Fixes #33186.
23750 2002-11-24 Martin Baulig <martin@ximian.com>
23752 * cs-parser.jay: Make this work for uninitialized variable
23753 declarations in the `for' initializer. Fixes #32416.
23755 2002-11-24 Martin Baulig <martin@ximian.com>
23757 * ecore.cs (Expression.ConvertExplicit): Make casting from/to
23758 System.Enum actually work. Fixes bug #32269, added verify-6.cs.
23760 2002-11-24 Martin Baulig <martin@ximian.com>
23762 * expression.cs (Binary.DoNumericPromotions): Added `check_user_conv'
23763 argument; if true, we also check for user-defined conversions.
23764 This is only needed if both arguments are of a user-defined type.
23765 Fixes #30443, added test-175.cs.
23766 (Binary.ForceConversion): Pass the location argument to ConvertImplicit.
23768 * ecore.cs (Expression.ImplicitUserConversionExists): New method.
23770 2002-11-24 Martin Baulig <martin@ximian.com>
23772 * expression.cs (ArrayAccess.GetStoreOpcode): New public static
23773 function to get the store opcode.
23774 (Invocation.EmitParams): Call ArrayAccess.GetStoreOpcode() and
23775 only emit the Ldelema if the store opcode is Stobj. You must run
23776 both test-34 and test-167 to test this. Fixes #34529.
23778 2002-11-23 Martin Baulig <martin@ximian.com>
23780 * ecore.cs (Expression.MemberLookup): Added additional
23781 `qualifier_type' argument which is used when we're being called
23782 from MemberAccess.DoResolve() and null if we're called from a
23784 (Expression.MemberLookupFailed): New method to report errors; this
23785 does the CS1540 check and reports the correct error message.
23787 * typemanager.cs (MemberLookup): Added additional `qualifier_type'
23788 argument for the CS1540 check and redone the way how we're dealing
23789 with private members. See the comment in the source code for details.
23790 (FilterWithClosure): Reverted this back to revision 1.197; renamed
23791 `closure_start_type' to `closure_qualifier_type' and check whether
23792 it's not null. It was not this filter being broken, it was just
23793 being called with the wrong arguments.
23795 * expression.cs (MemberAccess.DoResolve): use MemberLookupFinal()
23796 and pass it the correct `qualifier_type'; this also does the error
23799 2002-11-22 Miguel de Icaza <miguel@ximian.com>
23801 * expression.cs (Invocation.EmitParams): If the we are dealing
23802 with a non-built-in value type, load its address as well.
23804 (ArrayCreation): Use a a pretty constant instead
23805 of the hardcoded value 2. Use 6 instead of 2 for the number of
23806 static initializers.
23808 (ArrayCreation.EmitDynamicInitializers): Peel enumerations,
23809 because they are not really value types, just glorified integers.
23811 * driver.cs: Do not append .exe, the CSC compiler does not do it.
23813 * ecore.cs: Remove redundant code for enumerations, make them use
23814 the same code path as everything else, fixes the casting issue
23815 with enumerations in Windows.Forms.
23817 * attribute.cs: Do only cast to string if it is a string, the
23818 validation happens later.
23820 * typemanager.cs: Temproary hack to avoid a bootstrap issue until
23821 people upgrade their corlibs.
23823 * ecore.cs: Oops, enumerations were not following the entire code path
23825 2002-11-21 Miguel de Icaza <miguel@ximian.com>
23827 * typemanager.cs (FilterWithClosure): Commented out the test for
23828 1540 in typemanager.cs, as it has problems when accessing
23829 protected methods from a parent class (see test-174.cs).
23831 * attribute.cs (Attribute.ValidateGuid): new method.
23832 (Attribute.Resolve): Use above.
23834 2002-11-19 Miguel de Icaza <miguel@ximian.com>
23836 * enum.cs: In FindMembers, perform a recursive lookup for values. (34308)
23838 * ecore.cs (SimpleName.SimpleNameResolve): Remove the special
23839 handling for enumerations, as we only needed the TypeContainer
23840 functionality to begin with (this is required for the fix below to
23841 work for enums that reference constants in a container class for
23844 * codegen.cs (EmitContext): Make TypeContainer a DeclSpace.
23846 * enum.cs (Enum.Define): Use `this' instead of parent, so we have
23847 a valid TypeBuilder to perform lookups on.o
23849 * class.cs (InheritableMemberSignatureCompare): Use true in the
23850 call to GetGetMethod and GetSetMethod, because we are comparing
23851 the signature, and we need to get the methods *even* if they are
23854 (PropertyBase.CheckBase): ditto.
23856 * statement.cs (Switch.ResolveAndReduce, Block.EmitMeta,
23857 GotoCase.Resolve): Use Peel on EmpytCasts.
23859 * ecore.cs (EmptyCast): drop child, add Peel method.
23861 2002-11-17 Martin Baulig <martin@ximian.com>
23863 * ecore.cs (EmptyCast.Child): New public property.
23865 * statement.cs (SwitchLabel.ResolveAndReduce): Check whether the
23866 label resolved to an EmptyCast. Fixes #34162.
23867 (GotoCase.Resolve): Likewise.
23868 (Block.EmitMeta): Likewise.
23870 2002-11-17 Martin Baulig <martin@ximian.com>
23872 * expression.cs (Invocation.BetterConversion): Prefer int over
23873 uint; short over ushort; long over ulong for integer literals.
23874 Use ImplicitConversionExists instead of StandardConversionExists
23875 since we also need to check for user-defined implicit conversions.
23876 Fixes #34165. Added test-173.cs.
23878 2002-11-16 Martin Baulig <martin@ximian.com>
23880 * expression.cs (Binary.EmitBranchable): Eliminate comparisions
23881 with the `true' and `false' literals. Fixes #33151.
23883 2002-11-16 Martin Baulig <martin@ximian.com>
23885 * typemanager.cs (RealMemberLookup): Reverted Miguel's patch from
23886 October 22nd; don't do the cs1540 check for static members.
23888 * ecore.cs (PropertyExpr.ResolveAccessors): Rewrote this; we're
23889 now using our own filter here and doing the cs1540 check again.
23891 2002-11-16 Martin Baulig <martin@ximian.com>
23893 * support.cs (InternalParameters): Don't crash if we don't have
23894 any fixed parameters. Fixes #33532.
23896 2002-11-16 Martin Baulig <martin@ximian.com>
23898 * decl.cs (MemberCache.AddMethods): Use BindingFlags.FlattenHierarchy
23899 when looking up static methods to make this work on Windows.
23902 2002-11-16 Martin Baulig <martin@ximian.com>
23904 * ecore.cs (PropertyExpr.VerifyAssignable): Check whether we have
23905 a setter rather than using PropertyInfo.CanWrite.
23907 2002-11-15 Nick Drochak <ndrochak@gol.com>
23909 * class.cs: Allow acces to block member by subclasses. Fixes build
23912 2002-11-14 Martin Baulig <martin@ximian.com>
23914 * class.cs (Constructor.Emit): Added the extern/block check.
23917 2002-11-14 Martin Baulig <martin@ximian.com>
23919 * expression.cs (IndexerAccess.DoResolve): Do a DeclaredOnly
23920 iteration while looking for indexers, this is needed because the
23921 indexer may have a different name in our base classes. Fixed the
23922 error reporting (no indexers at all, not get accessor, no
23923 overloaded match). Fixes bug #33089.
23924 (IndexerAccess.DoResolveLValue): Likewise.
23926 2002-11-14 Martin Baulig <martin@ximian.com>
23928 * class.cs (PropertyBase.CheckBase): Make this work for multiple
23929 indexers. Fixes the first part of bug #33089.
23930 (MethodSignature.InheritableMemberSignatureCompare): Added support
23933 2002-11-13 Ravi Pratap <ravi@ximian.com>
23935 * attribute.cs (Attribute.Resolve): Catch the
23936 NullReferenceException and report it since it isn't supposed to
23939 2002-11-12 Miguel de Icaza <miguel@ximian.com>
23941 * expression.cs (Binary.EmitBranchable): Also handle the cases for
23942 LogicalOr and LogicalAnd that can benefit from recursively
23943 handling EmitBranchable. The code now should be nice for Paolo.
23945 2002-11-08 Miguel de Icaza <miguel@ximian.com>
23947 * typemanager.cs (LookupType): Added a negative-hit hashtable for
23948 the Type lookups, as we perform quite a number of lookups on
23949 non-Types. This can be removed once we can deterministically tell
23950 whether we have a type or a namespace in advance.
23952 But this might require special hacks from our corlib.
23956 * ecore.cs (TryImplicitIntConversion): Handle conversions to float
23957 and double which avoids a conversion from an integer to a double.
23959 * expression.cs: tiny optimization, avoid calling IsConstant,
23960 because it effectively performs the lookup twice.
23962 2002-11-06 Miguel de Icaza <miguel@ximian.com>
23964 But a bogus return here to keep the semantics of the old code
23965 until the Mono runtime is fixed.
23967 * pending.cs (GetMissingInterfaces): New method used to remove all
23968 the interfaces that are already implemented by our parent
23969 classes from the list of pending methods.
23971 * interface.cs: Add checks for calls after ResolveTypeExpr.
23973 2002-11-05 Miguel de Icaza <miguel@ximian.com>
23975 * class.cs (Class.Emit): Report warning 67: event not used if the
23976 warning level is beyond 3.
23978 * ecore.cs (Expression.ConvertExplicit): Missed a check for expr
23979 being a NullLiteral.
23981 * cs-parser.jay: Fix, Gonzalo reverted the order of the rank
23984 * class.cs (TypeContainer.GetClassBases): Cover a missing code
23985 path that might fail if a type can not be resolved.
23987 * expression.cs (Binary.Emit): Emit unsigned versions of the
23990 * driver.cs: use error 5.
23992 2002-11-02 Gonzalo Paniagua Javier <gonzalo@gnome-db.org>
23994 * cs-parser.jay: simplified a rule and 5 SR conflicts dissapeared.
23996 2002-11-01 Miguel de Icaza <miguel@ximian.com>
23998 * cs-parser.jay (switch_section): A beautiful patch from Martin
23999 Baulig that fixed 33094.
24001 2002-10-31 Miguel de Icaza <miguel@ximian.com>
24003 * ecore.cs (PropertyExpr.DoResolveLValue, PropertyExpr.DoResolve):
24004 Check whether the base is abstract and report an error if so.
24006 * expression.cs (IndexerAccess.DoResolveLValue,
24007 IndexerAccess.DoResolve): ditto.
24009 (Invocation.DoResolve): ditto.
24011 (Invocation.FullMethodDesc): Improve the report string.
24013 * statement.cs (Block): Eliminate IsVariableDefined as it is
24014 basically just a wrapper for GetVariableInfo.
24016 * ecore.cs (SimpleName): Use new
24018 * support.cs (ReflectionParamter.ParameterType): We unwrap the
24019 type, as we return the actual parameter ref/unref state on a
24022 2002-10-30 Miguel de Icaza <miguel@ximian.com>
24024 * support.cs: Return proper flags REF/OUT fixing the previous
24027 * expression.cs: Reverted last patch, that was wrong. Is_ref is
24028 not used to mean `ref' but `ref or out' in ParameterReference
24030 * delegate.cs (FullDelegateDesc): use ParameterDesc to get the
24031 full type signature instead of calling TypeManger.CSharpName
24034 * support.cs (InternalParameters.ParameterDesc): Do not compare
24035 directly to the modflags, because REF/OUT will actually be bitsets
24038 * delegate.cs (VerifyMethod): Check also the modifiers.
24040 * cs-tokenizer.cs: Fix bug where floating point values with an
24041 exponent where a sign was missing was ignored.
24043 * driver.cs: Allow multiple assemblies to be specified in a single
24046 2002-10-28 Miguel de Icaza <miguel@ximian.com>
24048 * cs-parser.jay: Ugly. We had to add a multiplicative_expression,
24049 because identifiers after a parenthesis would end up in this kind
24050 of production, and we needed to desamiguate it for having casts
24053 (UserDefinedType *) xxx
24055 2002-10-24 Miguel de Icaza <miguel@ximian.com>
24057 * typemanager.cs (RealMemberLookup): when we deal with a subclass,
24058 we should set on the Bindingflags.NonPublic, but not turn on
24059 private_ok. private_ok controls whether a Private member is
24060 returned (this is chekced on the filter routine), while the
24061 BindingFlags.NonPublic just controls whether private/protected
24062 will be allowed. This fixes the problem part of the problem of
24063 private properties being allowed to be used in derived classes.
24065 * expression.cs (BaseAccess): Provide an DoResolveLValue method,
24066 so we can call the children DoResolveLValue method (this will
24067 properly signal errors on lvalue assignments to base properties)
24069 * ecore.cs (PropertyExpr.ResolveAccessors): If both setter and
24070 getter are null, and we have a property info, we know that this
24071 happened because the lookup failed, so we report an error 122 for
24072 protection level violation.
24074 We also silently return if setter and getter are null in the
24075 resolve functions, this condition only happens if we have flagged
24076 the error before. This is the other half of the problem.
24078 (PropertyExpr.ResolveAccessors): Turns out that PropertyInfo does
24079 not have accessibility information, that is why we were returning
24080 true in the filter function in typemanager.cs.
24082 To properly report 122 (property is inaccessible because of its
24083 protection level) correctly, we report this error in ResolveAccess
24084 by failing if both the setter and the getter are lacking (ie, the
24087 DoResolve and DoLResolve have been modified to check for both
24088 setter/getter being null and returning silently, the reason being
24089 that I did not want to put the knowledge about this error in upper
24092 int old = Report.Errors;
24093 x = new PropertyExpr (...);
24094 if (old != Report.Errors)
24099 So the property expr is returned, but it is invalid, so the error
24100 will be flagged during the resolve process.
24102 * class.cs: Remove InheritablePropertySignatureCompare from the
24103 class, as we no longer depend on the property signature to compute
24104 whether it is possible to implement a method or not.
24106 The reason is that calling PropertyInfo.GetGetMethod will return
24107 null (in .NET, in Mono it works, and we should change this), in
24108 cases where the Get Method does not exist in that particular
24113 class X { public virtual int A { get { return 1; } } }
24115 class Z : Y { public override int A { get { return 2; } } }
24117 Would fail in Z because the parent (Y) would not have the property
24118 defined. So we avoid this completely now (because the alternative
24119 fix was ugly and slow), and we now depend exclusively on the
24122 (PropertyBase.CheckBase): Use a method-base mechanism to find our
24123 reference method, instead of using the property.
24125 * typemanager.cs (GetPropertyGetter, GetPropertySetter): These
24126 routines are gone now.
24128 * typemanager.cs (GetPropertyGetter, GetPropertySetter): swap the
24129 names, they were incorrectly named.
24131 * cs-tokenizer.cs: Return are more gentle token on failure.
24133 * pending.cs (PendingImplementation.InterfaceMethod): This routine
24134 had an out-of-sync index variable, which caused it to remove from
24135 the list of pending methods the wrong method sometimes.
24137 2002-10-22 Miguel de Icaza <miguel@ximian.com>
24139 * ecore.cs (PropertyExpr): Do not use PropertyInfo.CanRead,
24140 CanWrite, because those refer to this particular instance of the
24141 property, and do not take into account the fact that we can
24142 override single members of a property.
24144 Constructor requires an EmitContext. The resolution process does
24145 not happen here, but we need to compute the accessors before,
24146 because the resolution does not always happen for properties.
24148 * typemanager.cs (RealMemberLookup): Set private_ok if we are a
24149 subclass, before we did not update this flag, but we did update
24152 (GetAccessors): Drop this routine, as it did not work in the
24153 presence of partially overwritten set/get methods.
24155 Notice that this broke the cs1540 detection, but that will require
24158 2002-10-22 Gonzalo Paniagua Javier <gonzalo@ximian.com>
24162 * driver.cs: issue a warning instead of an error if we don't support
24163 debugging for the platform. Also ignore a couple of errors that may
24164 arise when trying to write the symbols. Undo my previous patch.
24166 2002-10-22 Gonzalo Paniagua Javier <gonzalo@ximian.com>
24168 * driver.cs: ignore /debug switch except for Unix platforms.
24170 2002-10-23 Nick Drochak <ndrochak@gol.com>
24172 * makefile: Remove mcs2.exe and mcs3.exe on 'make clean'
24174 2002-10-21 Miguel de Icaza <miguel@ximian.com>
24176 * driver.cs: Do not make mcs-debug conditional, so we do not break
24177 builds that use it.
24179 * statement.cs (UsageVector.MergeChildren): I would like Martin to
24180 review this patch. But basically after all the children variables
24181 have been merged, the value of "Breaks" was not being set to
24182 new_breaks for Switch blocks. I think that it should be set after
24183 it has executed. Currently I set this to the value of new_breaks,
24184 but only if new_breaks is FlowReturn.ALWAYS, which is a bit
24185 conservative, but I do not understand this code very well.
24187 I did not break anything in the build, so that is good ;-)
24189 * cs-tokenizer.cs: Also allow \r in comments as a line separator.
24191 2002-10-20 Mark Crichton <crichton@gimp.org>
24193 * cfold.cs: Fixed compile blocker. Really fixed it this time.
24195 2002-10-20 Nick Drochak <ndrochak@gol.com>
24197 * cfold.cs: Fixed compile blocker.
24199 2002-10-20 Miguel de Icaza <miguel@ximian.com>
24201 * driver.cs: I was chekcing the key, not the file.
24203 2002-10-19 Ravi Pratap <ravi@ximian.com>
24205 * ecore.cs (UserDefinedConversion): Get rid of the bogus error
24206 message that we were generating - we just need to silently return
24209 2002-10-19 Miguel de Icaza <miguel@ximian.com>
24211 * class.cs (Event.Define): Change my previous commit, as this
24212 breaks the debugger. This is a temporary hack, as it seems like
24213 the compiler is generating events incorrectly to begin with.
24215 * expression.cs (Binary.ResolveOperator): Added support for
24216 "U operator - (E x, E y)"
24218 * cfold.cs (BinaryFold): Added support for "U operator - (E x, E
24221 * ecore.cs (FieldExpr.AddressOf): We had a special code path for
24222 init-only variables, but this path did not take into account that
24223 there might be also instance readonly variables. Correct this
24226 This fixes bug 32253
24228 * delegate.cs (NewDelegate.DoResolve): Catch creation of unsafe
24231 * driver.cs: Change the extension for modules to `netmodule'
24233 * cs-parser.jay: Improved slightly the location tracking for
24234 the debugger symbols.
24236 * class.cs (Event.Define): Use Modifiers.FieldAttr on the
24237 modifiers that were specified instead of the hardcoded value
24238 (FamAndAssem). This was basically ignoring the static modifier,
24239 and others. Fixes 32429.
24241 * statement.cs (Switch.SimpleSwitchEmit): Simplified the code, and
24242 fixed a bug in the process (32476)
24244 * expression.cs (ArrayAccess.EmitAssign): Patch from
24245 hwang_rob@yahoo.ca that fixes bug 31834.3
24247 2002-10-18 Miguel de Icaza <miguel@ximian.com>
24249 * driver.cs: Make the module extension .netmodule.
24251 2002-10-16 Miguel de Icaza <miguel@ximian.com>
24253 * driver.cs: Report an error if the resource file is not found
24254 instead of crashing.
24256 * ecore.cs (PropertyExpr.EmitAssign): Pass IsBase instead of
24257 false, like Emit does.
24259 2002-10-16 Nick Drochak <ndrochak@gol.com>
24261 * typemanager.cs: Remove unused private member. Also reported mcs
24262 bug to report this as a warning like csc.
24264 2002-10-15 Martin Baulig <martin@gnome.org>
24266 * statement.cs (Statement.Emit): Made this a virtual method; emits
24267 the line number info and calls DoEmit().
24268 (Statement.DoEmit): New protected abstract method, formerly knows
24269 as Statement.Emit().
24271 * codegen.cs (EmitContext.Mark): Check whether we have a symbol writer.
24273 2002-10-11 Miguel de Icaza <miguel@ximian.com>
24275 * class.cs: Following the comment from 2002-09-26 to AddMethod, I
24276 have fixed a remaining problem: not every AddXXXX was adding a
24277 fully qualified name.
24279 Now everyone registers a fully qualified name in the DeclSpace as
24280 being defined instead of the partial name.
24282 Downsides: we are slower than we need to be due to the excess
24283 copies and the names being registered this way.
24285 The reason for this is that we currently depend (on the corlib
24286 bootstrap for instance) that types are fully qualified, because
24287 we dump all the types in the namespace, and we should really have
24288 types inserted into the proper namespace, so we can only store the
24289 basenames in the defined_names array.
24291 2002-10-10 Martin Baulig <martin@gnome.org>
24293 * expression.cs (ArrayAccess.EmitStoreOpcode): Reverted the patch
24294 from bug #31834, see the bug report for a testcase which is
24297 2002-10-10 Martin Baulig <martin@gnome.org>
24299 * codegen.cs (EmitContext.Breaks): Removed, we're now using the
24300 flow analysis code for this.
24302 * statement.cs (Do, While, For): Tell the flow analysis code about
24304 (FlowBranching.UsageVector): Added support for infinite loops.
24305 (Block.Resolve): Moved the dead code elimination here and use flow
24308 2002-10-09 Miguel de Icaza <miguel@ximian.com>
24310 * class.cs (Field.Define): Catch cycles on struct type
24313 * typemanager.cs (IsUnmanagedtype): Do not recursively check
24314 fields if the fields are static. We only need to check instance
24317 * expression.cs (As.DoResolve): Test for reference type.
24319 * statement.cs (Using.ResolveExpression): Use
24320 ConvertImplicitRequired, not ConvertImplicit which reports an
24322 (Using.ResolveLocalVariableDecls): ditto.
24324 * expression.cs (Binary.ResolveOperator): Report errors in a few
24325 places where we had to.
24327 * typemanager.cs (IsUnmanagedtype): Finish implementation.
24329 2002-10-08 Miguel de Icaza <miguel@ximian.com>
24331 * expression.cs: Use StoreFromPtr instead of extracting the type
24332 and then trying to use Stelem. Patch is from hwang_rob@yahoo.ca
24334 * ecore.cs (ImplicitReferenceConversion): It is possible to assign
24335 an enumeration value to a System.Enum, but System.Enum is not a
24336 value type, but an class type, so we need to box.
24338 (Expression.ConvertExplicit): One codepath could return
24339 errors but not flag them. Fix this. Fixes #31853
24341 * parameter.cs (Resolve): Do not allow void as a parameter type.
24343 2002-10-06 Martin Baulig <martin@gnome.org>
24345 * statemenc.cs (FlowBranching.SetParameterAssigned): Don't crash
24346 if it's a class type and not a struct. Fixes #31815.
24348 2002-10-06 Martin Baulig <martin@gnome.org>
24350 * statement.cs: Reworked the flow analysis code a bit to make it
24351 usable for dead code elimination.
24353 2002-10-06 Gonzalo Paniagua Javier <gonzalo@ximian.com>
24355 * cs-parser.jay: allow empty source files. Fixes bug #31781.
24357 2002-10-04 Miguel de Icaza <miguel@ximian.com>
24359 * expression.cs (ComposedCast.DoResolveType): A quick workaround
24360 to fix the test 165, will investigate deeper.
24362 2002-10-04 Martin Baulig <martin@gnome.org>
24364 * statement.cs (FlowBranching.UsageVector.MergeChildren): Make
24365 finally blocks actually work.
24366 (Try.Resolve): We don't need to create a sibling for `finally' if
24367 there is no finally block.
24369 2002-10-04 Martin Baulig <martin@gnome.org>
24371 * class.cs (Constructor.Define): The default accessibility for a
24372 non-default constructor is private, not public.
24374 2002-10-04 Miguel de Icaza <miguel@ximian.com>
24376 * class.cs (Constructor): Make AllowedModifiers public, add
24379 * cs-parser.jay: Perform the modifiers test here, as the
24380 constructor for the Constructor class usually receives a zero
24381 because of the way we create it (first we create, later we
24382 customize, and we were never checking the modifiers).
24384 * typemanager.cs (Typemanager.LookupTypeDirect): This new function
24385 is a version of LookupTypeReflection that includes the type-name
24386 cache. This can be used as a fast path for functions that know
24387 the fully qualified name and are only calling into *.GetType() to
24388 obtain a composed type.
24390 This is also used by TypeManager.LookupType during its type
24393 (LookupType): We now also track the real type name, as sometimes
24394 we can get a quey for the real type name from things like
24395 ComposedCast. This fixes bug 31422.
24397 * expression.cs (ComposedCast.Resolve): Since we are obtaining a
24398 complete type fullname, it does not have to go through the type
24399 resolution system to obtain the composed version of the type (for
24400 obtaining arrays or pointers).
24402 (Conditional.Emit): Use the EmitBoolExpression to
24403 generate nicer code, as requested by Paolo.
24405 (ArrayCreation.CheckIndices): Use the patch from
24406 hwang_rob@yahoo.ca to validate the array initializers.
24408 2002-10-03 Miguel de Icaza <miguel@ximian.com>
24410 * class.cs (ConstructorInitializer.Emit): simplify code by using
24411 Invocation.EmitCall, and at the same time, fix the bugs in calling
24412 parent constructors that took variable arguments.
24414 * ecore.cs (Expression.ConvertNumericExplicit,
24415 Expression.ImplicitNumericConversion): Remove the code that
24416 manually wrapped decimal (InternalTypeConstructor call is now gone
24419 * expression.cs (Cast.TryReduce): Also handle decimal types when
24420 trying to perform a constant fold on the type.
24422 * typemanager.cs (IsUnmanagedtype): Partially implemented.
24424 * parameter.cs: Removed ResolveAndDefine, as it was not needed, as
24425 that only turned off an error report, and did nothing else.
24427 2002-10-02 Miguel de Icaza <miguel@ximian.com>
24429 * driver.cs: Handle and ignore /fullpaths
24431 2002-10-01 Miguel de Icaza <miguel@ximian.com>
24433 * expression.cs (Binary.ResolveOperator): Catch the case where
24434 DoNumericPromotions returns true,
24436 (Binary.DoNumericPromotions): Simplify the code, and the tests.
24438 2002-09-27 Miguel de Icaza <miguel@ximian.com>
24440 * ecore.cs (EventExpr.Emit): Instead of emitting an exception,
24443 2002-09-26 Miguel de Icaza <miguel@ximian.com>
24445 * ecore.cs (ConvertNumericExplicit): It is not enough that the
24446 conversion exists, but it is also required that the conversion be
24447 performed. This manifested in "(Type64Enum) 2".
24449 * class.cs (TypeManager.AddMethod): The fix is not to change
24450 AddEnum, because that one was using a fully qualified name (every
24451 DeclSpace derivative does), but to change the AddMethod routine
24452 that was using an un-namespaced name. This now correctly reports
24453 the duplicated name.
24455 Revert patch until I can properly fix it. The issue
24456 is that we have a shared Type space across all namespaces
24457 currently, which is wrong.
24459 Options include making the Namespace a DeclSpace, and merge
24460 current_namespace/current_container in the parser.
24462 2002-09-25 Miguel de Icaza <miguel@ximian.com>
24464 * cs-parser.jay: Improve error reporting when we get a different
24465 kind of expression in local_variable_type and
24466 local_variable_pointer_type.
24468 Propagate this to avoid missleading errors being reported.
24470 * ecore.cs (ImplicitReferenceConversion): treat
24471 TypeManager.value_type as a target just like object_type. As
24476 Is valid, and needs to result in the int 1 being boxed before it
24477 is assigned to the value type v.
24479 * class.cs (TypeContainer.AddEnum): Use the basename, not the name
24480 to validate the enumeration name.
24482 * expression.cs (ArrayAccess.EmitAssign): Mimic the same test from
24483 EmitDynamicInitializers for the criteria to use Ldelema. Thanks
24484 to hwang_rob@yahoo.ca for finding the bug and providing a patch.
24486 * ecore.cs (TryImplicitIntConversion): When doing an
24487 implicit-enumeration-conversion, check if the type is 64-bits and
24488 perform a conversion before passing to EnumConstant.
24490 2002-09-23 Miguel de Icaza <miguel@ximian.com>
24492 * decl.cs (Error_AmbiguousTypeReference); New routine used to
24493 report ambiguous type references. Unlike the MS version, we
24494 report what the ambiguity is. Innovation at work ;-)
24496 (DeclSpace.FindType): Require a location argument to
24497 display when we display an ambiguous error.
24499 * ecore.cs: (SimpleName.DoResolveType): Pass location to FindType.
24501 * interface.cs (GetInterfaceTypeByName): Pass location to FindType.
24503 * expression.cs (EmitDynamicInitializers): Apply patch from
24504 hwang_rob@yahoo.ca that fixes the order in which we emit our
24507 2002-09-21 Martin Baulig <martin@gnome.org>
24509 * delegate.cs (Delegate.VerifyApplicability): Make this work if the
24510 delegate takes no arguments.
24512 2002-09-20 Miguel de Icaza <miguel@ximian.com>
24514 * constant.cs: Use Conv_U8 instead of Conv_I8 when loading longs
24517 * expression.cs: Extract the underlying type.
24519 * ecore.cs (StoreFromPtr): Use TypeManager.IsEnumType instad of IsEnum
24521 * decl.cs (FindType): Sorry about this, fixed the type lookup bug.
24523 2002-09-19 Miguel de Icaza <miguel@ximian.com>
24525 * class.cs (TypeContainer.DefineType): We can not use the nice
24526 PackingSize with the size set to 1 DefineType method, because it
24527 will not allow us to define the interfaces that the struct
24530 This completes the fixing of bug 27287
24532 * ecore.cs (Expresion.ImplicitReferenceConversion): `class-type S'
24533 means also structs. This fixes part of the problem.
24534 (Expresion.ImplicitReferenceConversionExists): ditto.
24536 * decl.cs (DeclSparce.ResolveType): Only report the type-not-found
24537 error if there were no errors reported during the type lookup
24538 process, to avoid duplicates or redundant errors. Without this
24539 you would get an ambiguous errors plus a type not found. We have
24540 beaten the user enough with the first error.
24542 (DeclSparce.FindType): Emit a warning if we have an ambiguous
24545 * ecore.cs (SimpleName.DoResolveType): If an error is emitted
24546 during the resolution process, stop the lookup, this avoids
24547 repeated error reports (same error twice).
24549 * rootcontext.cs: Emit a warning if we have an ambiguous reference.
24551 * typemanager.cs (LookupType): Redo the type lookup code to match
24552 the needs of System.Reflection.
24554 The issue is that System.Reflection requires references to nested
24555 types to begin with a "+" sign instead of a dot. So toplevel
24556 types look like: "NameSpace.TopLevelClass", and nested ones look
24557 like "Namespace.TopLevelClass+Nested", with arbitrary nesting
24560 2002-09-19 Martin Baulig <martin@gnome.org>
24562 * codegen.cs (EmitContext.EmitTopBlock): If control flow analysis
24563 says that a method always returns or always throws an exception,
24564 don't report the CS0161.
24566 * statement.cs (FlowBranching.UsageVector.MergeChildren): Always
24567 set `Returns = new_returns'.
24569 2002-09-19 Martin Baulig <martin@gnome.org>
24571 * expression.cs (MemberAccess.ResolveMemberAccess): When resolving
24572 to an enum constant, check for a CS0176.
24574 2002-09-18 Miguel de Icaza <miguel@ximian.com>
24576 * class.cs (TypeContainer.CheckPairedOperators): Now we check
24577 for operators that must be in pairs and report errors.
24579 * ecore.cs (SimpleName.DoResolveType): During the initial type
24580 resolution process, when we define types recursively, we must
24581 check first for types in our current scope before we perform
24582 lookups in the enclosing scopes.
24584 * expression.cs (MakeByteBlob): Handle Decimal blobs.
24586 (Invocation.VerifyArgumentsCompat): Call
24587 TypeManager.TypeToCoreType on the parameter_type.GetElementType.
24588 I thought we were supposed to always call this, but there are a
24589 few places in the code where we dont do it.
24591 2002-09-17 Miguel de Icaza <miguel@ximian.com>
24593 * driver.cs: Add support in -linkres and -resource to specify the
24594 name of the identifier.
24596 2002-09-16 Miguel de Icaza <miguel@ximian.com>
24598 * ecore.cs (StandardConversionExists): Sync with the conversion
24599 code: allow anything-* to void* conversions.
24601 (FindMostSpecificSource): Use an Expression argument
24602 instead of a Type, because we might be handed over a Literal which
24603 gets a few more implicit conversions that plain types do not. So
24604 this information was being lost.
24606 Also, we drop the temporary type-holder expression when not
24609 2002-09-17 Martin Baulig <martin@gnome.org>
24611 * class.cs (PropertyBase.CheckBase): Don't check the base class if
24612 this is an explicit interface implementation.
24614 2002-09-17 Martin Baulig <martin@gnome.org>
24616 * class.cs (PropertyBase.CheckBase): Make this work for indexers with
24617 different `IndexerName' attributes.
24619 * expression.cs (BaseIndexerAccess): Rewrote this class to use IndexerAccess.
24620 (IndexerAccess): Added special protected ctor for BaseIndexerAccess and
24621 virtual CommonResolve().
24623 2002-09-16 Miguel de Icaza <miguel@ximian.com>
24625 * enum.cs (LookupEnumValue): Use the EnumConstant declared type,
24626 and convert that to the UnderlyingType.
24628 * statement.cs (Foreach.Resolve): Indexers are just like variables
24629 or PropertyAccesses.
24631 * cs-tokenizer.cs (consume_string): Track line numbers and columns
24632 inside quoted strings, we were not doing this before.
24634 2002-09-16 Martin Baulig <martin@gnome.org>
24636 * ecore.cs (MethodGroupExpr.DoResolve): If we have an instance expression,
24637 resolve it. This is needed for the definite assignment check of the
24638 instance expression, fixes bug #29846.
24639 (PropertyExpr.DoResolve, EventExpr.DoResolve): Likewise.
24641 2002-09-16 Nick Drochak <ndrochak@gol.com>
24643 * parameter.cs: Fix compile error. Cannot reference static member
24644 from an instance object. Is this an mcs bug?
24646 2002-09-14 Martin Baulig <martin@gnome.org>
24648 * decl.cs (MemberCache.SetupCacheForInterface): Don't add an interface
24649 multiple times. Fixes bug #30295, added test-166.cs.
24651 2002-09-14 Martin Baulig <martin@gnome.org>
24653 * statement.cs (Block.Emit): Don't emit unreachable code.
24654 (Switch.SimpleSwitchEmit, Switch.TableSwitchEmit): Check for missing
24655 `break' statements.
24656 (Goto.Emit, Continue.Emit): Set ec.Breaks = true.
24658 2002-09-14 Martin Baulig <martin@gnome.org>
24660 * parameter.cs (Parameter.Attributes): Make this work if Modifier.ISBYREF
24663 2002-09-14 Martin Baulig <martin@gnome.org>
24665 * typemanager.cs (TypeManager.IsNestedChildOf): This must return false
24666 if `type == parent' since in this case `type.IsSubclassOf (parent)' will
24667 be false on the ms runtime.
24669 2002-09-13 Martin Baulig <martin@gnome.org>
24671 * ecore.cs (SimpleName.SimpleNameResolve): Include the member name in
24672 the CS0038 error message.
24674 2002-09-12 Miguel de Icaza <miguel@ximian.com>
24676 * expression.cs (CheckedExpr, UnCheckedExpr): If we have a
24677 constant inside, return it.
24679 2002-09-12 Martin Baulig <martin@gnome.org>
24681 * cfold.cs (ConstantFold.DoConstantNumericPromotions): Check whether an
24682 implicit conversion can be done between enum types.
24684 * enum.cs (Enum.LookupEnumValue): If the value is an EnumConstant,
24685 check whether an implicit conversion to the current enum's UnderlyingType
24686 exists and report an error if not.
24688 * codegen.cs (CodeGen.Init): Delete the symbol file when compiling
24689 without debugging support.
24691 * delegate.cs (Delegate.CloseDelegate): Removed, use CloseType instead.
24692 Fixes bug #30235. Thanks to Ricardo Fernández Pascual.
24694 2002-09-12 Martin Baulig <martin@gnome.org>
24696 * typemanager.cs (TypeManager.IsNestedChildOf): New method.
24698 * ecore.cs (IMemberExpr.DeclaringType): New property.
24699 (SimpleName.SimpleNameResolve): Check whether we're accessing a
24700 nonstatic member of an outer type (CS0038).
24702 2002-09-11 Miguel de Icaza <miguel@ximian.com>
24704 * driver.cs: Activate the using-error detector at warning level
24705 4 (at least for MS-compatible APIs).
24707 * namespace.cs (VerifyUsing): Small buglett fix.
24709 * pending.cs (PendingImplementation): pass the container pointer.
24711 * interface.cs (GetMethods): Allow for recursive definition. Long
24712 term, I would like to move every type to support recursive
24713 definitions, not the current ordering mechanism that we have right
24716 The situation is this: Attributes are handled before interfaces,
24717 so we can apply attributes to interfaces. But some attributes
24718 implement interfaces, we will now handle the simple cases
24719 (recursive definitions will just get an error).
24721 * parameter.cs: Only invalidate types at the end if we fail to
24724 2002-09-09 Martin Baulig <martin@gnome.org>
24726 * ecore.cs (PropertyExpr.Emit): Also check for
24727 TypeManager.system_int_array_get_length so this'll also work when
24728 compiling corlib. Fixes #30003.
24730 2002-09-09 Martin Baulig <martin@gnome.org>
24732 * expression.cs (ArrayCreation.MakeByteBlob): Added support for enums
24733 and throw an exception if we can't get the type's size. Fixed #30040,
24736 2002-09-09 Martin Baulig <martin@gnome.org>
24738 * ecore.cs (PropertyExpr.DoResolve): Added check for static properies.
24740 * expression.cs (SizeOf.DoResolve): Sizeof is only allowed in unsafe
24741 context. Fixes bug #30027.
24743 * delegate.cs (NewDelegate.Emit): Use OpCodes.Ldvirtftn for
24744 virtual functions. Fixes bug #30043, added test-164.cs.
24746 2002-09-08 Ravi Pratap <ravi@ximian.com>
24748 * attribute.cs : Fix a small NullRef crash thanks to my stupidity.
24750 2002-09-08 Nick Drochak <ndrochak@gol.com>
24752 * driver.cs: Use an object to get the windows codepage since it's not a
24755 2002-09-08 Miguel de Icaza <miguel@ximian.com>
24757 * statement.cs (For.Emit): for infinite loops (test == null)
24758 return whether there is a break inside, not always "true".
24760 * namespace.cs (UsingEntry): New struct to hold the name of the
24761 using definition, the location where it is defined, and whether it
24762 has been used in a successful type lookup.
24764 * rootcontext.cs (NamespaceLookup): Use UsingEntries instead of
24769 2002-09-06 Ravi Pratap <ravi@ximian.com>
24771 * attribute.cs : Fix incorrect code which relied on catching
24772 a NullReferenceException to detect a null being passed in
24773 where an object was expected.
24775 2002-09-06 Miguel de Icaza <miguel@ximian.com>
24777 * statement.cs (Try): flag the catch variable as assigned
24779 * expression.cs (Cast): Simplified by using ResolveType instead of
24780 manually resolving.
24782 * statement.cs (Catch): Fix bug by using ResolveType.
24784 2002-09-06 Ravi Pratap <ravi@ximian.com>
24786 * expression.cs (BetterConversion): Special case for when we have
24787 a NullLiteral as the argument and we have to choose between string
24788 and object types - we choose string the way csc does.
24790 * attribute.cs (Attribute.Resolve): Catch the
24791 NullReferenceException and report error #182 since the Mono
24792 runtime no more has the bug and having this exception raised means
24793 we tried to select a constructor which takes an object and is
24796 2002-09-05 Ravi Pratap <ravi@ximian.com>
24798 * expression.cs (Invocation.OverloadResolve): Flag a nicer error
24799 message (1502, 1503) when we can't locate a method after overload
24800 resolution. This is much more informative and closes the bug
24803 * interface.cs (PopulateMethod): Return if there are no argument
24804 types. Fixes a NullReferenceException bug.
24806 * attribute.cs (Attribute.Resolve): Ensure we allow TypeOf
24807 expressions too. Previously we were checking only in one place for
24808 positional arguments leaving out named arguments.
24810 * ecore.cs (ImplicitNumericConversion): Conversion from underlying
24811 type to the enum type is not allowed. Remove code corresponding to
24814 (ConvertNumericExplicit): Allow explicit conversions from
24815 the underlying type to enum type. This precisely follows the spec
24816 and closes a bug filed by Gonzalo.
24818 2002-09-04 Gonzalo Paniagua Javier <gonzalo@ximian.com>
24821 * compiler.csproj.user: patch from Adam Chester (achester@bigpond.com).
24823 2002-09-03 Miguel de Icaza <miguel@ximian.com>
24825 * statement.cs (SwitchLabel.ResolveAndReduce): In the string case,
24826 it was important that we stored the right value after the
24827 reduction in `converted'.
24829 2002-09-04 Martin Baulig <martin@gnome.org>
24831 * location.cs (Location.SymbolDocument): Use full pathnames for the
24834 2002-08-30 Miguel de Icaza <miguel@ximian.com>
24836 * expression.cs (ComposedCast): Use DeclSparce.ResolveType instead
24837 of the expression resolve mechanism, because that will catch the
24838 SimpleName error failures.
24840 (Conditional): If we can not resolve the
24841 expression, return, do not crash.
24843 2002-08-29 Gonzalo Paniagua Javier <gonzalo@ximian.com>
24846 (location): display token name instead of its number.
24848 2002-08-28 Martin Baulig <martin@gnome.org>
24850 * expression.cs (Binary.ResolveOperator): Don't silently return
24851 but return an error if an operator cannot be applied between two
24854 2002-08-28 Martin Baulig <martin@gnome.org>
24856 * class.cs (Constructor.Define): Set the permission attributes
24857 correctly instead of making all constructors public.
24859 2002-08-28 Martin Baulig <martin@gnome.org>
24861 * ecore.cs (Expression.DoResolve): Do a TypeManager.MemberLook
24862 for private members before reporting a CS0103; if we find anything,
24865 2002-08-28 Martin Baulig <martin@gnome.org>
24867 * typemanager.cs (TypeManager.FilterWithClosure): It's not enough
24868 to check whether `closure_start_type == closure_invocation_type',
24869 we also need to check whether `m.DeclaringType == closure_invocation_type'
24870 before bypassing the permission checks. We might be accessing
24871 protected/private members from the base class.
24872 (TypeManager.RealMemberLookup): Only set private_ok if private
24873 members were requested via BindingFlags.NonPublic.
24875 * ecore.cs (MethodGroupExpr.IsExplicitImpl): New property.
24877 * expression.cs (MemberAccess.ResolveMemberAccess): Set
24878 MethodGroupExpr.IsExplicitImpl if appropriate.
24879 (Invocation.DoResolve): Don't report the CS0120 for explicit
24880 interface implementations.
24882 2002-08-27 Martin Baulig <martin@gnome.org>
24884 * expression.cs (Invocation.DoResolve): If this is a static
24885 method and we don't have an InstanceExpression, we must report
24888 2002-08-25 Martin Baulig <martin@gnome.org>
24890 * expression.cs (Binary.ResolveOperator): Don't allow `!=' and
24891 `==' between a valuetype and an object.
24893 2002-08-25 Miguel de Icaza <miguel@ximian.com>
24895 * ecore.cs (TypeExpr): Provide a ToString method.
24897 2002-08-24 Martin Baulig <martin@gnome.org>
24899 * codegen.cs (CodeGen.InitMonoSymbolWriter): The symbol file is
24900 now called proggie.dbg and it's a binary file.
24902 2002-08-23 Martin Baulig <martin@gnome.org>
24904 * decl.cs (MemberCache.AddMethods): Ignore varargs methods.
24906 2002-08-23 Martin Baulig <martin@gnome.org>
24908 * struct.cs (MyStructInfo.ctor): Make this work with empty
24909 structs; it's not allowed to use foreach() on null.
24911 2002-08-23 Martin Baulig <martin@gnome.org>
24913 * codegen.cs (CodeGen.InitMonoSymbolWriter): Tell the symbol
24914 writer the full pathname of the generated assembly.
24916 2002-08-23 Martin Baulig <martin@gnome.org>
24918 * statements.cs (FlowBranching.UsageVector.MergeChildren):
24919 A `finally' block never returns or breaks; improved handling of
24922 2002-08-23 Martin Baulig <martin@gnome.org>
24924 * statement.cs (Throw.Resolve): Allow `throw null'.
24926 2002-08-23 Martin Baulig <martin@gnome.org>
24928 * expression.cs (MemberAccess.ResolveMemberAccess): If this is an
24929 EventExpr, don't do a DeclaredOnly MemberLookup, but check whether
24930 `ee.EventInfo.DeclaringType == ec.ContainerType'. The
24931 MemberLookup would return a wrong event if this is an explicit
24932 interface implementation and the class has an event with the same
24935 2002-08-23 Martin Baulig <martin@gnome.org>
24937 * statement.cs (Block.AddChildVariableNames): New public method.
24938 (Block.AddChildVariableName): Likewise.
24939 (Block.IsVariableNameUsedInChildBlock): Likewise.
24940 (Block.AddVariable): Check whether a variable name has already
24941 been used in a child block.
24943 * cs-parser.jay (declare_local_variables): Mark all variable names
24944 from the current block as being used in a child block in the
24947 2002-08-23 Martin Baulig <martin@gnome.org>
24949 * codegen.cs (CodeGen.InitializeSymbolWriter): Abort if we can't
24950 find the symbol writer.
24952 * driver.cs: csc also allows the arguments to /define being
24953 separated by commas, not only by semicolons.
24955 2002-08-23 Martin Baulig <martin@gnome.org>
24957 * interface.cs (Interface.GetMembers): Added static check for events.
24959 2002-08-15 Martin Baulig <martin@gnome.org>
24961 * class.cs (MethodData.EmitDestructor): In the Expression.MemberLookup
24962 call, use ec.ContainerType.BaseType as queried_type and invocation_type.
24964 * ecore.cs (Expression.MemberLookup): Added documentation and explained
24965 why the MethodData.EmitDestructor() change was necessary.
24967 2002-08-20 Martin Baulig <martin@gnome.org>
24969 * class.cs (TypeContainer.FindMembers): Added static check for events.
24971 * decl.cs (MemberCache.AddMembers): Handle events like normal members.
24973 * typemanager.cs (TypeHandle.GetMembers): When queried for events only,
24974 use Type.GetEvents(), not Type.FindMembers().
24976 2002-08-20 Martin Baulig <martin@gnome.org>
24978 * decl.cs (MemberCache): Added a special method cache which will
24979 be used for method-only searched. This ensures that a method
24980 search will return a MethodInfo with the correct ReflectedType for
24983 2002-08-20 Martin Baulig <martin@gnome.org>
24985 * decl.cs (DeclSpace.FindMembers): Made this public.
24987 2002-08-20 Gonzalo Paniagua Javier <gonzalo@ximian.com>
24989 * delegate.cs: fixed build on windows.
24990 [FIXME: Filed as bug #29150: MCS must report these errors.]
24992 2002-08-19 Ravi Pratap <ravi@ximian.com>
24994 * ecore.cs (StandardConversionExists): Return a false
24995 if we are trying to convert the void type to anything else
24996 since that is not allowed.
24998 * delegate.cs (DelegateInvocation.DoResolve): Ensure that
24999 we flag error 70 in the event an event is trying to be accessed
25000 directly from outside the declaring type.
25002 2002-08-20 Martin Baulig <martin@gnome.org>
25004 * typemanager.cs, decl.cs: Moved MemberList, IMemberContainer and
25005 MemberCache from typemanager.cs to decl.cs.
25007 2002-08-19 Martin Baulig <martin@gnome.org>
25009 * class.cs (TypeContainer): Implement IMemberContainer.
25010 (TypeContainer.DefineMembers): Create the MemberCache.
25011 (TypeContainer.FindMembers): Do better BindingFlags checking; only
25012 return public members if BindingFlags.Public was given, check
25013 whether members are static.
25015 2002-08-16 Martin Baulig <martin@gnome.org>
25017 * decl.cs (DeclSpace.Define): Splitted this in Define and
25018 DefineMembers. DefineMembers is called first and initializes the
25021 * rootcontext.cs (RootContext.DefineMembers): New function. Calls
25022 DefineMembers() on all our DeclSpaces.
25024 * class.cs (TypeContainer.Define): Moved all code to DefineMembers(),
25025 but call DefineMembers() on all nested interfaces. We call their
25026 Define() in our new Define() function.
25028 * interface.cs (Interface): Implement IMemberContainer.
25029 (Interface.Define): Moved all code except the attribute stuf to
25031 (Interface.DefineMembers): Initialize the member cache.
25033 * typemanager.cs (IMemberFinder): Removed this interface, we don't
25034 need this anymore since we can use MemberCache.FindMembers directly.
25036 2002-08-19 Martin Baulig <martin@gnome.org>
25038 * typemanager.cs (MemberCache): When creating the cache for an
25039 interface type, add all inherited members.
25040 (TypeManager.MemberLookup_FindMembers): Changed `ref bool searching'
25041 to `out bool used_cache' and documented it.
25042 (TypeManager.MemberLookup): If we already used the cache in the first
25043 iteration, we don't need to do the interfaces check.
25045 2002-08-19 Martin Baulig <martin@gnome.org>
25047 * decl.cs (DeclSpace.FindMembers): New abstract method. Moved this
25048 here from IMemberFinder and don't implement this interface anymore.
25049 (DeclSpace.MemberCache): Moved here from IMemberFinder.
25051 * typemanager.cs (IMemberFinder): This interface is now only used by
25052 classes which actually support the member cache.
25053 (TypeManager.builder_to_member_finder): Renamed to builder_to_declspace
25054 since we only put DeclSpaces into this Hashtable.
25055 (MemberLookup_FindMembers): Use `builder_to_declspace' if the type is
25056 a dynamic type and TypeHandle.GetTypeHandle() otherwise.
25058 2002-08-16 Martin Baulig <martin@gnome.org>
25060 * typemanager.cs (ICachingMemberFinder): Removed.
25061 (IMemberFinder.MemberCache): New property.
25062 (TypeManager.FindMembers): Merged this with RealFindMembers().
25063 This function will never be called from TypeManager.MemberLookup()
25064 so we can't use the cache here, just the IMemberFinder.
25065 (TypeManager.MemberLookup_FindMembers): Check whether the
25066 IMemberFinder has a MemberCache and call the cache's FindMembers
25068 (MemberCache): Rewrote larger parts of this yet another time and
25069 cleaned it up a bit.
25071 2002-08-15 Miguel de Icaza <miguel@ximian.com>
25073 * driver.cs (LoadArgs): Support quoting.
25075 (Usage): Show the CSC-like command line arguments.
25077 Improved a few error messages.
25079 2002-08-15 Martin Baulig <martin@gnome.org>
25081 * typemanager.cs (IMemberContainer.Type): New property.
25082 (IMemberContainer.IsInterface): New property.
25084 The following changes are conditional to BROKEN_RUNTIME, which is
25085 defined at the top of the file.
25087 * typemanager.cs (MemberCache.MemberCache): Don't add the base
25088 class'es members, but add all members from TypeHandle.ObjectType
25089 if we're an interface.
25090 (MemberCache.AddMembers): Set the Declared flag if member.DeclaringType
25091 is the current type.
25092 (MemberCache.CacheEntry.Container): Removed this field.
25093 (TypeHandle.GetMembers): Include inherited members.
25095 2002-08-14 Gonzalo Paniagua Javier <gonzalo@ximian.com>
25097 * typemanager.cs: fixed compilation and added a comment on a field that
25100 2002-08-15 Martin Baulig <martin@gnome.org>
25102 * class.cs (ConstructorInitializer.Resolve): In the
25103 Expression.MemberLookup call, use the queried_type as
25106 * typemanager.cs (IMemberContainer.GetMembers): Removed the `bool
25107 declared' attribute, it's always true.
25108 (IMemberContainer.Parent, IMemberContainer.Name): New properties.
25109 (TypeManager.MemberLookup_FindMembers): [FIXME FIXME FIXME] Added
25110 temporary wrapper for FindMembers which tells MemberLookup whether
25111 members from the base classes are included in the return value.
25112 This will go away soon.
25113 (TypeManager.MemberLookup): Use this temporary hack here; once the
25114 new MemberCache is completed, we don't need to do the DeclaredOnly
25115 looping here anymore since the MemberCache will take care of this.
25116 (TypeManager.IsSubclassOrNestedChildOf): Allow `type == parent'.
25117 (MemberCache): When creating the MemberCache for a class, get
25118 members from the current class and all its base classes.
25119 (MemberCache.CacheEntry.Container): New field. This is a
25120 temporary hack until the Mono runtime is fixed to distinguish
25121 between ReflectedType and DeclaringType. It allows us to use MCS
25122 with both the MS runtime and the unfixed Mono runtime without
25123 problems and without accecting performance.
25124 (MemberCache.SearchMembers): The DeclaredOnly looping from
25125 TypeManager.MemberLookup is now done here.
25127 2002-08-14 Martin Baulig <martin@gnome.org>
25129 * statement.cs (MyStructInfo.MyStructInfo): Don't call
25130 Type.GetFields on dynamic types but get the fields from the
25131 corresponding TypeContainer.
25132 (MyStructInfo.GetStructInfo): Added check for enum types.
25134 * typemanager.cs (MemberList.IsSynchronized): Implemented.
25135 (MemberList.SyncRoot): Implemented.
25136 (TypeManager.FilterWithClosure): No need to check permissions if
25137 closure_start_type == closure_invocation_type, don't crash if
25138 closure_invocation_type is null.
25140 2002-08-13 Martin Baulig <martin@gnome.org>
25142 Rewrote TypeContainer.FindMembers to use a member cache. This
25143 gives us a speed increase of about 35% for the self-hosting MCS
25144 build and of about 15-20% for the class libs (both on GNU/Linux).
25146 * report.cs (Timer): New class to get enhanced profiling. This
25147 whole class is "TIMER" conditional since it remarkably slows down
25150 * class.cs (MemberList): New class. This is an IList wrapper
25151 which we're now using instead of passing MemberInfo[]'s around to
25152 avoid copying this array unnecessarily.
25153 (IMemberFinder.FindMember): Return a MemberList, not a MemberInfo [].
25154 (ICachingMemberFinder, IMemberContainer): New interface.
25155 (TypeManager.FilterWithClosure): If `criteria' is null, the name
25156 has already been checked, otherwise use it for the name comparision.
25157 (TypeManager.FindMembers): Renamed to RealMemberFinder and
25158 provided wrapper which tries to use ICachingMemberFinder.FindMembers
25159 if possible. Returns a MemberList, not a MemberInfo [].
25160 (TypeHandle): New class, implements IMemberContainer. We create
25161 one instance of this class per type, it contains a MemberCache
25162 which is used to do the member lookups.
25163 (MemberCache): New class. Each instance of this class contains
25164 all members of a type and a name-based hash table.
25165 (MemberCache.FindMembers): This is our new member lookup
25166 function. First, it looks up all members of the requested name in
25167 the hash table. Then, it walks this list and sorts out all
25168 applicable members and returns them.
25170 2002-08-13 Martin Baulig <martin@gnome.org>
25172 In addition to a nice code cleanup, this gives us a performance
25173 increase of about 1.4% on GNU/Linux - not much, but it's already
25174 half a second for the self-hosting MCS compilation.
25176 * typemanager.cs (IMemberFinder): New interface. It is used by
25177 TypeManager.FindMembers to call FindMembers on a TypeContainer,
25178 Enum, Delegate or Interface.
25179 (TypeManager.finder_to_member_finder): New PtrHashtable.
25180 (TypeManager.finder_to_container): Removed.
25181 (TypeManager.finder_to_delegate): Removed.
25182 (TypeManager.finder_to_interface): Removed.
25183 (TypeManager.finder_to_enum): Removed.
25185 * interface.cs (Interface): Implement IMemberFinder.
25187 * delegate.cs (Delegate): Implement IMemberFinder.
25189 * enum.cs (Enum): Implement IMemberFinder.
25191 * class.cs (TypeContainer): Implement IMemberFinder.
25193 2002-08-12 Martin Baulig <martin@gnome.org>
25195 * ecore.cs (TypeExpr.DoResolveType): Mark this as virtual.
25197 2002-08-12 Martin Baulig <martin@gnome.org>
25199 * ecore.cs (ITypeExpression): New interface for expressions which
25201 (TypeExpression): Renamed to TypeLookupExpression.
25202 (Expression.DoResolve): If we're doing a types-only lookup, the
25203 expression must implement the ITypeExpression interface and we
25204 call DoResolveType() on it.
25205 (SimpleName): Implement the new ITypeExpression interface.
25206 (SimpleName.SimpleNameResolve): Removed the ec.OnlyLookupTypes
25207 hack, the situation that we're only looking up types can't happen
25208 anymore when this method is called. Moved the type lookup code to
25209 DoResolveType() and call it.
25210 (SimpleName.DoResolveType): This ITypeExpression interface method
25211 is now doing the types-only lookup.
25212 (TypeExpr, TypeLookupExpression): Implement ITypeExpression.
25213 (ResolveFlags): Added MaskExprClass.
25215 * expression.cs (MemberAccess): Implement the ITypeExpression
25217 (MemberAccess.DoResolve): Added support for a types-only lookup
25218 when we're called via ITypeExpression.DoResolveType().
25219 (ComposedCast): Implement the ITypeExpression interface.
25221 * codegen.cs (EmitContext.OnlyLookupTypes): Removed. Call
25222 Expression.Resolve() with ResolveFlags.Type instead.
25224 2002-08-12 Martin Baulig <martin@gnome.org>
25226 * interface.cs (Interface.Define): Apply attributes.
25228 * attribute.cs (Attribute.ApplyAttributes): Added support for
25229 interface attributes.
25231 2002-08-11 Martin Baulig <martin@gnome.org>
25233 * statement.cs (Block.Emit): Only check the "this" variable if we
25234 do not always throw an exception.
25236 * ecore.cs (PropertyExpr.DoResolveLValue): Implemented, check
25237 whether the property has a set accessor.
25239 2002-08-11 Martin Baulig <martin@gnome.org>
25241 Added control flow analysis support for structs.
25243 * ecore.cs (ResolveFlags): Added `DisableFlowAnalysis' to resolve
25244 with control flow analysis turned off.
25245 (IVariable): New interface.
25246 (SimpleName.SimpleNameResolve): If MemberAccess.ResolveMemberAccess
25247 returns an IMemberExpr, call DoResolve/DoResolveLValue on it.
25248 (FieldExpr.DoResolve): Resolve the instance expression with flow
25249 analysis turned off and do the definite assignment check after the
25250 resolving when we know what the expression will resolve to.
25252 * expression.cs (LocalVariableReference, ParameterReference):
25253 Implement the new IVariable interface, only call the flow analysis
25254 code if ec.DoFlowAnalysis is true.
25255 (This): Added constructor which takes a Block argument. Implement
25256 the new IVariable interface.
25257 (MemberAccess.DoResolve, MemberAccess.DoResolveLValue): Call
25258 DoResolve/DoResolveLValue on the result of ResolveMemberLookup().
25259 This does the definite assignment checks for struct members.
25261 * class.cs (Constructor.Emit): If this is a non-static `struct'
25262 constructor which doesn't have any initializer, call
25263 Block.AddThisVariable() to tell the flow analysis code that all
25264 struct elements must be initialized before control returns from
25267 * statement.cs (MyStructInfo): New public class.
25268 (UsageVector.this [VariableInfo vi]): Added `int field_idx'
25269 argument to this indexer. If non-zero, check an individual struct
25270 member, not the whole struct.
25271 (FlowBranching.CheckOutParameters): Check struct members.
25272 (FlowBranching.IsVariableAssigned, SetVariableAssigned): Added
25273 overloaded versions of these methods which take an additional
25274 `int field_idx' argument to check struct members.
25275 (FlowBranching.IsParameterAssigned, SetParameterAssigned): Added
25276 overloaded versions of these methods which take an additional
25277 `string field_name' argument to check struct member.s
25278 (VariableInfo): Implement the IVariable interface.
25279 (VariableInfo.StructInfo): New public property. Returns the
25280 MyStructInfo instance of the variable if it's a struct or null.
25281 (Block.AddThisVariable): New public method. This is called from
25282 Constructor.Emit() for non-static `struct' constructor which do
25283 not have any initializer. It creates a special variable for the
25284 "this" instance variable which will be checked by the flow
25285 analysis code to ensure that all of the struct's fields are
25286 initialized before control returns from the constructor.
25287 (UsageVector): Added support for struct members. If a
25288 variable/parameter is a struct with N members, we reserve a slot
25289 in the usage vector for each member. A struct is considered fully
25290 initialized if either the struct itself (slot 0) or all its
25291 members are initialized.
25293 2002-08-08 Martin Baulig <martin@gnome.org>
25295 * driver.cs (Driver.MainDriver): Only report an error CS5001
25296 if there were no compilation errors.
25298 * codegen.cs (EmitContext.EmitContext): Use the DeclSpace's
25299 `UnsafeContext' property to determine whether the parent is in
25300 unsafe context rather than checking the parent's ModFlags:
25301 classes nested in an unsafe class are unsafe as well.
25303 2002-08-08 Martin Baulig <martin@gnome.org>
25305 * statement.cs (UsageVector.MergeChildren): Distinguish between
25306 `Breaks' and `Returns' everywhere, don't set `Breaks' anymore if
25307 we return. Added test17() and test18() to test-154.cs.
25309 2002-08-08 Martin Baulig <martin@gnome.org>
25311 * typemanager.cs (TypeManager.FilterWithClosure): If we have
25312 Family access, make sure the invoking type isn't a subclass of the
25313 queried type (that'd be a CS1540).
25315 * ecore.cs (Expression.MemberLookup): Added overloaded version of
25316 this method which takes an additional `Type invocation_type'.
25318 * expression.cs (BaseAccess.DoResolve): Use the base type as
25319 invocation and query type.
25320 (MemberAccess.DoResolve): If the lookup failed and we're about to
25321 report a CS0122, try a lookup with the ec.ContainerType - if this
25322 succeeds, we must report a CS1540.
25324 2002-08-08 Martin Baulig <martin@gnome.org>
25326 * ecore.cs (IMemberExpr): Added `bool IsInstance' property.
25327 (MethodGroupExpr): Implement the IMemberExpr interface.
25329 * expression (MemberAccess.ResolveMemberAccess): No need to have
25330 any special code for MethodGroupExprs anymore, they're now
25333 2002-08-08 Martin Baulig <martin@gnome.org>
25335 * typemanager.cs (TypeManager.FilterWithClosure): Check Assembly,
25336 Family, FamANDAssem and FamORAssem permissions.
25337 (TypeManager.IsSubclassOrNestedChildOf): New public method.
25339 2002-08-08 Martin Baulig <martin@gnome.org>
25341 * statement.cs (FlowBranchingType): Added LOOP_BLOCK.
25342 (UsageVector.MergeChildren): `break' breaks unless we're in a switch
25345 Thu Aug 8 10:28:07 CEST 2002 Paolo Molaro <lupus@ximian.com>
25347 * driver.cs: implemented /resource option to embed managed resources.
25349 2002-08-07 Martin Baulig <martin@gnome.org>
25351 * class.cs (FieldBase.Initializer): Renamed to `init' and made private.
25352 (FieldBase.HasFieldInitializer): New public property.
25353 (FieldBase.GetInitializerExpression): New public method. Resolves and
25354 returns the field initializer and makes sure it is only resolved once.
25355 (TypeContainer.EmitFieldInitializers): Call
25356 FieldBase.GetInitializerExpression to get the initializer, this ensures
25357 that it isn't resolved multiple times.
25359 * codegen.cs (EmitContext): Added `bool IsFieldInitialier'. This tells
25360 the resolving process (SimpleName/MemberLookup) that we're currently
25361 emitting a field initializer (which must not access any instance members,
25362 this is an error CS0236).
25364 * ecore.cs (SimpleName.Error_ObjectRefRequired): Added EmitContext
25365 argument, if the `IsFieldInitializer' flag is set, we must report and
25366 error CS0236 and not an error CS0120.
25368 2002-08-07 Martin Baulig <martin@gnome.org>
25370 * ecore.cs (IMemberExpr): New public interface.
25371 (FieldExpr, PropertyExpr, EventExpr): Implement IMemberExpr.
25372 (SimpleName.SimpleNameResolve): Call MemberAccess.ResolveMemberAccess
25373 if the expression is an IMemberExpr.
25375 * expression.cs (MemberAccess.ResolveMemberAccess): Allow `left'
25376 to be null, implicitly default to `this' if we're non-static in
25377 this case. Simplified the code a lot by using the new IMemberExpr
25378 interface. Also fixed bug #28176 here.
25380 2002-08-06 Martin Baulig <martin@gnome.org>
25382 * cs-parser.jay (SimpleLookup): Removed. We need to create
25383 ParameterReferences during semantic analysis so that we can do a
25384 type-only search when resolving Cast, TypeOf and SizeOf.
25385 (block): Pass the `current_local_parameters' to the Block's
25388 * class.cs (ConstructorInitializer): Added `Parameters parameters'
25389 argument to the constructor.
25390 (ConstructorInitializer.Resolve): Create a temporary implicit
25391 block with the parameters.
25393 * ecore.cs (SimpleName.SimpleNameResolve): Resolve parameter
25394 references here if we aren't doing a type-only search.
25396 * statement.cs (Block): Added constructor which takes a
25397 `Parameters parameters' argument.
25398 (Block.Parameters): New public property.
25400 * support.cs (InternalParameters.Parameters): Renamed `parameters'
25401 to `Parameters' and made it public readonly.
25403 2002-08-06 Martin Baulig <martin@gnome.org>
25405 * ecore.cs (Expression.Warning): Made this public as well.
25407 * report.cs (Report.Debug): Print the contents of collections.
25409 2002-08-06 Martin Baulig <martin@gnome.org>
25411 * ecore.cs (Expression.ResolveFlags): New [Flags] enum. This is
25412 used to tell Resolve() which kinds of expressions it may return.
25413 (Expression.Resolve): Added overloaded version of this method which
25414 takes a `ResolveFlags flags' argument. This can be used to tell
25415 Resolve() which kinds of expressions it may return. Reports a
25417 (Expression.ResolveWithSimpleName): Removed, use Resolve() with
25418 ResolveFlags.SimpleName.
25419 (Expression.Error118): Added overloaded version of this method which
25420 takes a `ResolveFlags flags' argument. It uses the flags to determine
25421 which kinds of expressions are allowed.
25423 * expression.cs (Argument.ResolveMethodGroup): New public method.
25424 Resolves an argument, but allows a MethodGroup to be returned.
25425 This is used when invoking a delegate.
25427 * TODO: Updated a bit.
25429 2002-08-06 Gonzalo Paniagua Javier <gonzalo@ximian.com>
25431 Fixed compilation with csc.
25433 * ecore.cs: Expression.Error made public. Is this correct? Should
25434 Warning be made public too?
25436 * expression.cs: use ea.Location instead of ea.loc.
25437 [FIXME: Filed as bug #28607: MCS must report these errors.]
25439 2002-08-06 Martin Baulig <martin@gnome.org>
25441 * ecore.cs (Expression.loc): Moved the location here instead of
25442 duplicating it in all derived classes.
25443 (Expression.Location): New public property.
25444 (Expression.Error, Expression.Warning): Made them non-static and
25445 removed the location argument.
25446 (Expression.Warning): Added overloaded version which takes an
25447 `int level' argument.
25448 (Expression.Error118): Make this non-static and removed the
25449 expression and location arguments.
25450 (TypeExpr): Added location argument to the constructor.
25452 * expression.cs (StaticCallExpr): Added location argument to
25454 (Indirection, PointerArithmetic): Likewise.
25455 (CheckedExpr, UnCheckedExpr): Likewise.
25456 (ArrayAccess, IndexerAccess, UserCast, ArrayPtr): Likewise.
25457 (StringPtr): Likewise.
25460 2002-08-05 Martin Baulig <martin@gnome.org>
25462 * expression.cs (BaseAccess.DoResolve): Actually report errors.
25464 * assign.cs (Assign.DoResolve): Check whether the source
25465 expression is a value or variable.
25467 * statement.cs (Try.Resolve): Set ec.InTry/InCatch/InFinally
25468 while resolving the corresponding blocks.
25470 * interface.cs (Interface.GetInterfaceTypeByName): Actually report
25471 an error, don't silently return null.
25473 * statement.cs (Block.AddVariable): Do the error reporting here
25474 and distinguish between CS0128 and CS0136.
25475 (Block.DoResolve): Report all unused labels (warning CS0164).
25476 (LabeledStatement): Pass the location to the constructor.
25477 (LabeledStatement.HasBeenReferenced): New property.
25478 (LabeledStatement.Resolve): Set it to true here.
25480 * statement.cs (Return.Emit): Return success even after reporting
25481 a type mismatch error (CS0126 or CS0127), this is what csc does and
25482 it avoids confusing the users with any consecutive errors.
25484 2002-08-05 Martin Baulig <martin@gnome.org>
25486 * enum.cs (Enum.LookupEnumValue): Catch circular definitions.
25488 * const.cs (Const.LookupConstantValue): Catch circular definitions.
25490 * expression.cs (MemberAccess.DoResolve): Silently return if an
25491 error has already been reported.
25493 * ecore.cs (Expression.MemberLookupFinal): Silently return if an
25494 error has already been reported.
25496 2002-08-05 Martin Baulig <martin@gnome.org>
25498 * statement.cs (UsageVector): Only initialize the `parameters'
25499 vector if we actually have any "out" parameters.
25501 2002-08-05 Martin Baulig <martin@gnome.org>
25503 * expression.cs (Binary.ResolveOperator): When combining delegates,
25504 they must have the same type.
25506 2002-08-05 Martin Baulig <martin@gnome.org>
25508 * typemanager.cs (TypeManager.GetArgumentTypes): Don't call
25509 PropertyInfo.GetIndexParameters() on dynamic types, this doesn't
25510 work with the ms runtime and we also don't need it: if we're a
25511 PropertyBuilder and not in the `indexer_arguments' hash, then we
25512 are a property and not an indexer.
25514 * class.cs (TypeContainer.AsAccessible): Use Type.IsArray,
25515 Type.IsPointer and Type.IsByRef instead of Type.HasElementType
25516 since the latter one doesn't work with the ms runtime.
25518 2002-08-03 Martin Baulig <martin@gnome.org>
25520 Fixed bugs #27998 and #22735.
25522 * class.cs (Method.IsOperator): New public field.
25523 (Method.CheckBase): Report CS0111 if there's already a method
25524 with the same parameters in the current class. Report CS0508 when
25525 attempting to change the return type of an inherited method.
25526 (MethodData.Emit): Report CS0179 if a method doesn't have a body
25527 and it's not marked abstract or extern.
25528 (PropertyBase): New abstract base class for Property and Indexer.
25529 (PropertyBase.CheckBase): Moved here from Property and made it work
25531 (PropertyBase.Emit): Moved here from Property.Emit, Indexer.Emit is
25532 the same so we can reuse it there.
25533 (Property, Indexer): Derive from PropertyBase.
25534 (MethodSignature.inheritable_property_signature_filter): New delegate
25535 to find properties and indexers.
25537 * decl.cs (MemberCore.CheckMethodAgainstBase): Added `string name'
25538 argument and improved error reporting.
25540 * parameter.cs (Parameters.GetEmptyReadOnlyParameters): Renamed to
25541 EmptyReadOnlyParameters and made it a property.
25543 * typemanager.cs (TypeManager.GetArgumentTypes): Added overloaded
25544 version of this method which takes a `PropertyInfo indexer'.
25545 (TypeManager.RegisterIndexer): New method.
25547 * class.cs: Added myself as author of this file :-)
25549 2002-08-03 Gonzalo Paniagua Javier <gonzalo@ximian.com>
25551 * class.cs: fixed compilation on windoze.
25553 2002-08-03 Martin Baulig <martin@gnome.org>
25555 * interface.cs (Interface.GetInterfaceBases): Check whether all
25556 base interfaces are at least as accessible than the current one.
25558 * class.cs (TypeContainer.GetClassBases): Check whether base types
25559 are at least as accessible than the current type.
25560 (TypeContainer.AsAccessible): Implemented and made non-static.
25561 (MemberBase.CheckParameters): Report errors if the accessibility
25564 * delegate.cs (Delegate.Delegate): The default visibility is
25565 internal for top-level types and private for nested types.
25566 (Delegate.Define): Report errors if the accessibility checks fail.
25568 * enum.cs (Enum.Enum): The default visibility is internal for
25569 top-level types and private for nested types.
25570 (Enum.DefineType): Compute the correct visibility.
25572 * modifiers.cs (Modifiers.TypeAttr): Added a version of this
25573 function which takes a `bool is_toplevel' instead of a TypeContainer.
25575 * typemanager.cs (TypeManager.IsBuiltinType): `void' is also a
25578 2002-08-02 Martin Baulig <martin@gnome.org>
25580 * expression.cs (LocalVariableReferenc): Added constructor which
25581 takes additional `VariableInfo vi' and `bool is_readonly' arguments.
25582 (LocalVariableReference.IsReadOnly): New property.
25583 (LocalVariableReference.DoResolveLValue): Report a CS1604 if the
25584 variable is readonly, use our own readonly flag to do this; you can
25585 use the new constructor to get a writable reference to a read-only
25588 * cs-parser.jay (foreach_statement, using_statement): Get a writable
25589 reference to the local variable.
25591 2002-08-01 Miguel de Icaza <miguel@ximian.com>
25593 * rootcontext.cs (ResolveCore): Also include System.Exception
25595 * statement.cs (Block.Emit): Do not emit the dead-code warnings if
25596 we reach an EmptyStatement.
25598 (Catch.DoResolve, Throw.DoResolve): Throwing the System.Exception
25601 * expression.cs (Binary.ResolveOperator): Check error result in
25604 use brtrue/brfalse directly and avoid compares to null.
25606 2002-08-02 Martin Baulig <martin@gnome.org>
25608 * class.cs (TypeContainer.Define): Define all nested interfaces here.
25609 Fixes bug #28407, added test-155.cs.
25611 2002-08-01 Martin Baulig <martin@gnome.org>
25613 * class.cs (Event.EmitDefaultMethod): Make this work with static
25614 events. Fixes #28311, added verify-3.cs.
25616 2002-08-01 Martin Baulig <martin@gnome.org>
25618 * statement.cs (ForeachHelperMethods): Added `enumerator_type' and
25619 `is_disposable' fields.
25620 (Foreach.GetEnumeratorFilter): Set `hm.enumerator_type' and
25621 `hm.is_disposable' if we're using the collection pattern.
25622 (Foreach.EmitCollectionForeach): Use the correct type for the
25623 enumerator's local variable, only emit the try/finally block if
25624 necessary (fixes #27713).
25626 2002-08-01 Martin Baulig <martin@gnome.org>
25628 * ecore.cs (Expression.report118): Renamed to Error118 and made
25631 * statement.cs (Throw.Resolve): Check whether the expression is of
25632 the correct type (CS0118) and whether the type derives from
25633 System.Exception (CS0155).
25634 (Catch.Resolve): New method. Do the type lookup here and check
25635 whether it derives from System.Exception (CS0155).
25636 (Catch.CatchType, Catch.IsGeneral): New public properties.
25638 * typemanager.cs (TypeManager.exception_type): Added.
25640 2002-07-31 Miguel de Icaza <miguel@ximian.com>
25642 * driver.cs: Updated About function.
25644 2002-07-31 Martin Baulig <martin@gnome.org>
25646 Implemented Control Flow Analysis.
25648 * codegen.cs (EmitContext.DoFlowAnalysis): New public variable.
25649 (EmitContext.CurrentBranching): Added.
25650 (EmitContext.StartFlowBranching): Added.
25651 (EmitContext.EndFlowBranching): Added.
25652 (EmitContext.KillFlowBranching): Added.
25653 (EmitContext.IsVariableAssigned): Added.
25654 (EmitContext.SetVariableAssigned): Added.
25655 (EmitContext.IsParameterAssigned): Added.
25656 (EmitContext.SetParameterAssigned): Added.
25657 (EmitContext.EmitTopBlock): Added `InternalParameters ip' argument.
25658 Added control flow analysis stuff here.
25660 * expression.cs (Unary.DoResolve): If the operator is Oper.AddressOf,
25661 resolve the expression as lvalue.
25662 (LocalVariableReference.DoResolve): Check whether the variable has
25663 already been assigned.
25664 (ParameterReference.DoResolveLValue): Override lvalue resolve to mark
25665 the parameter as assigned here.
25666 (ParameterReference.DoResolve): Check whether the parameter has already
25668 (Argument.Resolve): If it's a `ref' or `out' argument, resolve the
25669 expression as lvalue.
25671 * statement.cs (FlowBranching): New class for the flow analysis code.
25672 (Goto): Resolve the label in Resolve, not in Emit; added flow analysis.
25673 (LabeledStatement.IsDefined): New public property.
25674 (LabeledStatement.AddUsageVector): New public method to tell flow
25675 analyis that the label may be reached via a forward jump.
25676 (GotoCase): Lookup and resolve the label in Resolve, not in Emit; added
25678 (VariableInfo.Number): New public field. This is used by flow analysis
25679 to number all locals of a block.
25680 (Block.CountVariables): New public property. This is the number of
25681 local variables in this block (including the locals from all parent
25683 (Block.EmitMeta): Number all the variables.
25685 * statement.cs: Added flow analysis support to all classes.
25687 2002-07-31 Martin Baulig <martin@gnome.org>
25689 * driver.cs: Added "--mcs-debug" argument if MCS_DEBUG is defined.
25690 To get debugging messages, compile mcs with /define:MCS_DEBUG and
25691 then use this argument.
25693 * report.cs (Report.Debug): Renamed to conditional to "MCS_DEBUG".
25695 * makefile.gnu (MCS_FLAGS): Include $(MCS_DEFINES), the user may
25696 use this to specify /define options.
25698 2002-07-29 Martin Baulig <martin@gnome.org>
25700 * statement.cs (Fixed): Moved all code that does variable lookups
25701 and resolvings from Emit to Resolve.
25703 * statement.cs (For): Moved all code that does variable lookups
25704 and resolvings from Emit to Resolve.
25706 * statement.cs (Using): Moved all code that does variable lookups
25707 and resolvings from Emit to Resolve.
25709 2002-07-29 Martin Baulig <martin@gnome.org>
25711 * attribute.cs (Attribute.Resolve): Explicitly catch a
25712 System.NullReferenceException when creating the
25713 CustromAttributeBuilder and report a different warning message.
25715 2002-07-29 Martin Baulig <martin@gnome.org>
25717 * support.cs (ParameterData.ParameterName): Added method to
25718 get the name of a parameter.
25720 * typemanager.cs (TypeManager.IsValueType): New public method.
25722 2002-07-29 Martin Baulig <martin@gnome.org>
25724 * parameter.cs (Parameter.Modifier): Added `ISBYREF = 8'. This
25725 is a flag which specifies that it's either ref or out.
25726 (Parameter.GetParameterInfo (DeclSpace, int, out bool)): Changed
25727 the out parameter to `out Parameter.Modifier mod', also set the
25728 Parameter.Modifier.ISBYREF flag on it if it's either ref or out.
25730 * support.cs (InternalParameters.ParameterModifier): Distinguish
25731 between Parameter.Modifier.OUT and Parameter.Modifier.REF, set the
25732 Parameter.Modifier.ISBYREF flag if it's either ref or out.
25734 * expression.cs (Argument.GetParameterModifier): Distinguish
25735 between Parameter.Modifier.OUT and Parameter.Modifier.REF, set the
25736 Parameter.Modifier.ISBYREF flag if it's either ref or out.
25738 2002-07-29 Martin Baulig <martin@gnome.org>
25740 * expression.cs (ParameterReference.ParameterReference): Added
25741 `Location loc' argument to the constructor.
25743 * cs-parser.jay: Pass location to ParameterReference.
25745 2002-07-28 Miguel de Icaza <miguel@ximian.com>
25747 * statement.cs (Try): Initialize the location.
25749 * cs-parser.jay: pass location to Try.
25751 * expression.cs (Unary.Reduce): Change the prototype to return
25752 whether a constant fold could be performed or not. The result is
25753 returned in an out parameters. In the case of Indirection and
25754 AddressOf, we want to perform the full tests.
25756 2002-07-26 Miguel de Icaza <miguel@ximian.com>
25758 * statement.cs (Statement.Emit): Flag dead code.
25760 2002-07-27 Andrew Birkett <andy@nobugs.org>
25762 * expression.cs (Unary.Reduce): Handle AddressOf and Indirection.
25764 2002-07-27 Martin Baulig <martin@gnome.org>
25766 * class.cs (MethodData.Define): Put back call to
25767 TypeManager.AddMethod(), accidentally commented this out.
25769 * report.cs (Debug): New public method to print debugging information,
25770 this is `[Conditional ("DEBUG")]'.
25772 2002-07-26 Martin Baulig <martin@gnome.org>
25774 * cs-parser.jay (CSharpParser): Added `Stack switch_stack'.
25775 (switch_statement): Push the current_block to the switch_stack and
25776 pop it again when we're done with the switch.
25777 (switch_section): The new block is a child of the current_block.
25778 Fixes bug #24007, added test-152.cs.
25780 2002-07-27 Martin Baulig <martin@gnome.org>
25782 * expression.cs (Invocation.EmitArguments): When calling a varargs
25783 function with only its fixed arguments, we need to pass an empty
25786 2002-07-27 Martin Baulig <martin@gnome.org>
25788 Mono 0.13 has been released.
25790 2002-07-25 Miguel de Icaza <miguel@ximian.com>
25792 * driver.cs: Rename --resource to --linkres, because that is what
25793 we do currently, we dont support --resource yet.
25795 * cs-tokenizer.cs: Fix test for reporting endif mismatches.
25797 2002-07-25 Martin Baulig <martin@gnome.org>
25799 * class.cs (MethodData): New public class. This is a `method builder'
25800 class for a method or one accessor of a Property/Indexer/Event.
25801 (MethodData.GetMethodFlags): Moved here from MemberBase.
25802 (MethodData.ApplyAttributes): Likewise.
25803 (MethodData.ApplyObsoleteAttribute): Likewise.
25804 (MethodData.ApplyConditionalAttribute): Likewise.
25805 (MethodData.ApplyDllImportAttribute): Likewise.
25806 (MethodData.CheckAbstractAndExternal): Likewise.
25807 (MethodData.Define): Formerly knows as MemberBase.DefineMethod().
25808 (MethodData.Emit): Formerly known as Method.Emit().
25809 (MemberBase): Moved everything which was specific to a single
25810 accessor/method to MethodData.
25811 (Method): Create a new MethodData and call Define() and Emit() on it.
25812 (Property, Indexer, Event): Create a new MethodData objects for each
25813 accessor and call Define() and Emit() on them.
25815 2002-07-25 Martin Baulig <martin@gnome.org>
25817 Made MethodCore derive from MemberBase to reuse the code from there.
25818 MemberBase now also checks for attributes.
25820 * class.cs (MethodCore): Derive from MemberBase, not MemberCore.
25821 (MemberBase.GetMethodFlags): Moved here from class Method and marked
25823 (MemberBase.DefineAccessor): Renamed to DefineMethod(), added
25824 `CallingConventions cc' and `Attributes opt_attrs' arguments.
25825 (MemberBase.ApplyAttributes): New virtual method; applies the
25826 attributes to a method or accessor.
25827 (MemberBase.ApplyObsoleteAttribute): New protected virtual method.
25828 (MemberBase.ApplyConditionalAttribute): Likewise.
25829 (MemberBase.ApplyDllImportAttribute): Likewise.
25830 (MemberBase.CheckAbstractAndExternal): Likewise.
25831 (MethodCore.ParameterTypes): This is now a property instead of a
25832 method, it's initialized from DoDefineParameters().
25833 (MethodCore.ParameterInfo): Removed the set accessor.
25834 (MethodCore.DoDefineParameters): New protected virtual method to
25835 initialize ParameterTypes and ParameterInfo.
25836 (Method.GetReturnType): We can now simply return the MemberType.
25837 (Method.GetMethodFlags): Override the MemberBase version and add
25838 the conditional flags.
25839 (Method.CheckBase): Moved some code from Define() here, call
25840 DoDefineParameters() here.
25841 (Method.Define): Use DoDefine() and DefineMethod() from MemberBase
25842 here to avoid some larger code duplication.
25843 (Property.Emit, Indexer.Emit): Call CheckAbstractAndExternal() to
25844 ensure that abstract and external accessors don't declare a body.
25846 * attribute.cs (Attribute.GetValidPieces): Make this actually work:
25847 `System.Attribute.GetCustomAttributes (attr.Type)' does a recursive
25848 lookup in the attribute's parent classes, so we need to abort as soon
25849 as we found the first match.
25850 (Attribute.Obsolete_GetObsoleteMessage): Return the empty string if
25851 the attribute has no arguments.
25853 * typemanager.cs (TypeManager.AddMethod): Now takes a MemberBase instead
25856 2002-07-24 Gonzalo Paniagua Javier <gonzalo@ximian.com>
25858 * cs-parser.jay: reverted previous patch.
25860 2002-07-24 Gonzalo Paniagua Javier <gonzalo@ximian.com>
25862 * cs-parser.jay: fixed bug #22119.
25864 2002-07-24 Gonzalo Paniagua Javier <gonzalo@ximian.com>
25866 * attribute.cs: fixed compilation. The error was:
25867 "attribute.cs(571,17): error CS0177: The out parameter 'is_error' must
25868 be assigned to before control leaves the current method."
25869 [FIXME: Filed as bug #28186: MCS must report this error.]
25871 2002-07-25 Martin Baulig <martin@gnome.org>
25873 * attribute.cs (Attribute.Conditional_GetConditionName): New static
25874 method to pull the condition name ouf of a Conditional attribute.
25875 (Attribute.Obsolete_GetObsoleteMessage): New static method to pull
25876 the obsolete message and error flag out of an Obsolete attribute.
25878 * class.cs (Method.GetMethodFlags): New public method to get the
25879 TypeManager.MethodFlags for this method.
25880 (Method.ApplyConditionalAttribute, Method.ApplyObsoleteAttribute): New
25882 (Method.Define): Get and apply the Obsolete and Conditional attributes;
25883 if we're overriding a virtual function, set the new private variable
25884 `parent_method'; call the new TypeManager.AddMethod().
25886 * typemanager.cs (TypeManager.AddMethod): New static method. Stores
25887 the MethodBuilder and the Method in a PtrHashtable.
25888 (TypeManager.builder_to_method): Added for this purpose.
25889 (TypeManager.MethodFlags): Added IsObsoleteError.
25890 (TypeManager.GetMethodFlags): Added `Location loc' argument. Lookup
25891 Obsolete and Conditional arguments in MethodBuilders. If we discover
25892 an Obsolete attribute, emit an appropriate warning 618 / error 619 with
25893 the message from the attribute.
25895 2002-07-24 Martin Baulig <martin@gnome.org>
25897 * cs-tokenizer.cs: Eat up trailing whitespaces and one-line comments in
25898 preprocessor directives, ensure that the argument to #define/#undef is
25899 exactly one identifier and that it's actually an identifier.
25901 Some weeks ago I did a `#define DEBUG 1' myself and wondered why this
25904 2002-07-24 Martin Baulig <martin@gnome.org>
25906 * statement.cs (Foreach.ForeachHelperMethods): Added `Type element_type',
25907 initialize it to TypeManager.object_type in the constructor.
25908 (Foreach.GetEnumeratorFilter): Set `hm.element_type' to the return type
25909 of the `hm.get_current' method if we're using the collection pattern.
25910 (Foreach.EmitCollectionForeach): Use `hm.element_type' as the source type
25911 for the explicit conversion to make it work when we're using the collection
25912 pattern and the `Current' property has a different return type than `object'.
25915 2002-07-24 Martin Baulig <martin@gnome.org>
25917 * delegate.cs (Delegate.VerifyMethod): Simply return null if the method
25918 does not match, but don't report any errors. This method is called in
25919 order for all methods in a MethodGroupExpr until a matching method is
25920 found, so we don't want to bail out if the first method doesn't match.
25921 (NewDelegate.DoResolve): If none of the methods in the MethodGroupExpr
25922 matches, report the 123. Fixes #28070.
25924 2002-07-24 Martin Baulig <martin@gnome.org>
25926 * expression.cs (ArrayAccess.EmitStoreOpcode): Moved the
25927 TypeManager.TypeToCoreType() to the top of the method so the
25928 following equality checks will work. Fixes #28107.
25930 2002-07-24 Martin Baulig <martin@gnome.org>
25932 * cfold.cs (ConstantFold.DoConstantNumericPromotions): "If either
25933 operand is of type uint, and the other operand is of type sbyte,
25934 short or int, the operands are converted to type long." -
25935 Actually do what this comment already told us. Fixes bug #28106,
25938 2002-07-24 Martin Baulig <martin@gnome.org>
25940 * class.cs (MethodBase): New abstract class. This is now a base
25941 class for Property, Indexer and Event to avoid some code duplication
25942 in their Define() and DefineMethods() methods.
25943 (MethodBase.DoDefine, MethodBase.DefineAccessor): Provide virtual
25944 generic methods for Define() and DefineMethods().
25945 (FieldBase): Derive from MemberBase, not MemberCore.
25946 (Property): Derive from MemberBase, not MemberCore.
25947 (Property.DefineMethod): Moved all the code from this method to the
25948 new MethodBase.DefineAccessor(), just call it with appropriate
25950 (Property.Define): Call the new Property.DoDefine(), this does some
25951 sanity checks and we don't need to duplicate the code everywhere.
25952 (Event): Derive from MemberBase, not MemberCore.
25953 (Event.Define): Use the new MethodBase.DefineAccessor() to define the
25954 accessors, this will also make them work with interface events.
25955 (Indexer): Derive from MemberBase, not MemberCore.
25956 (Indexer.DefineMethod): Removed, call MethodBase.DefineAccessor() insstead.
25957 (Indexer.Define): Use the new MethodBase functions.
25959 * interface.cs (InterfaceEvent.InterfaceEvent): Added `Location loc'
25960 argument to the constructor.
25961 (Interface.FindMembers): Added support for interface events.
25962 (Interface.PopluateEvent): Implemented.
25964 Added test-149.cs for this. This also fixes bugs #26067 and #24256.
25966 2002-07-22 Miguel de Icaza <miguel@ximian.com>
25968 * class.cs (TypeContainer.AddMethod): Adding methods do not use IsValid,
25969 but this is required to check for a method name being the same as
25970 the containing class.
25974 2002-07-22 Gonzalo Paniagua Javier <gonzalo@ximian.com>
25976 * interface.cs: initialize variable.
25978 2002-07-23 Martin Baulig <martin@gnome.org>
25980 Implemented the IndexerName attribute in interfaces.
25982 * class.cs (TypeContainer.DefineIndexers): Don't set the indexer
25983 name if this is an explicit interface implementation.
25984 (Indexer.InterfaceIndexerName): New public variable. If we're
25985 implementing an interface indexer, this is the IndexerName in that
25986 interface. Otherwise, it's the IndexerName.
25987 (Indexer.DefineMethod): If we're implementing interface indexer,
25988 set InterfaceIndexerName. Use the new Pending.IsInterfaceIndexer
25989 and Pending.ImplementIndexer methods.
25990 (Indexer.Define): Also define the PropertyBuilder if we're
25991 implementing an interface indexer and this is neither an explicit
25992 interface implementation nor do the IndexerName match the one in
25995 * pending.cs (TypeAndMethods): Added `MethodInfo [] need_proxy'.
25996 If a method is defined here, then we always need to create a proxy
25997 for it. This is used when implementing interface indexers.
25998 (Pending.IsInterfaceIndexer): New public method.
25999 (Pending.ImplementIndexer): New public method.
26000 (Pending.InterfaceMethod): Added `MethodInfo need_proxy' argument.
26001 This is used when implementing interface indexers to define a proxy
26003 (Pending.VerifyPendingMethods): Look in the `need_proxy' array and
26004 define a proxy if necessary.
26006 * interface.cs (Interface.IndexerName): New public variable.
26007 (Interface.PopulateIndexer): Set the IndexerName.
26008 (Interface.DefineIndexers): New private method. Populate all the
26009 indexers and make sure their IndexerNames match.
26011 * typemanager.cs (IndexerPropertyName): Added support for interface
26014 2002-07-22 Martin Baulig <martin@gnome.org>
26016 * codegen.cs (EmitContext.HasReturnLabel): New public variable.
26017 (EmitContext.EmitTopBlock): Always mark the ReturnLabel and emit a
26018 ret if HasReturnLabel.
26019 (EmitContext.TryCatchLevel, LoopBeginTryCatchLevel): New public
26022 * statement.cs (Do.Emit, While.Emit, For.Emit, Foreach.Emit): Save
26023 and set the ec.LoopBeginTryCatchLevel.
26024 (Try.Emit): Increment the ec.TryCatchLevel while emitting the block.
26025 (Continue.Emit): If the ec.LoopBeginTryCatchLevel is smaller than
26026 the current ec.TryCatchLevel, the branch goes out of an exception
26027 block. In this case, we need to use Leave and not Br.
26029 2002-07-22 Martin Baulig <martin@gnome.org>
26031 * statement.cs (Try.Emit): Emit an explicit ret after the end of the
26032 block unless the block does not always return or it is contained in
26033 another try { ... } catch { ... } block. Fixes bug #26506.
26034 Added verify-1.cs to the test suite.
26036 2002-07-22 Martin Baulig <martin@gnome.org>
26038 * statement.cs (Switch.TableSwitchEmit): If we don't have a default,
26039 then we do not always return. Fixes bug #24985.
26041 2002-07-22 Martin Baulig <martin@gnome.org>
26043 * expression.cs (Invocation.OverloadedResolve): Do the BetterFunction()
26044 lookup on a per-class level; ie. walk up the class hierarchy until we
26045 found at least one applicable method, then choose the best among them.
26046 Fixes bug #24463 and test-29.cs.
26048 2002-07-22 Martin Baulig <martin@gnome.org>
26050 * typemanager.cs (TypeManager.ArrayContainsMethod): Don't check the
26051 return types of the methods. The return type is not part of the
26052 signature and we must not check it to make the `new' modifier work.
26053 Fixes bug #27999, also added test-147.cs.
26054 (TypeManager.TypeToCoreType): Added TypeManager.type_type.
26056 * expression.cs (Invocation.DoResolve): Call TypeManager.TypeToCoreType()
26057 on the method's return type.
26059 2002-07-21 Martin Baulig <martin@gnome.org>
26061 * assign.cs: Make this work if the rightmost source is a constant and
26062 we need to do an implicit type conversion. Also adding a few more tests
26063 to test-38.cs which should have caught this.
26065 * makefile.gnu: Disable debugging, there's already the mcs-mono2.exe
26066 target in the makefile for this. The makefile.gnu is primarily intended
26067 for end-users who don't want to debug the compiler.
26069 2002-07-21 Martin Baulig <martin@gnome.org>
26071 * assign.cs: Improved the Assign class so it can now handle embedded
26072 assignments (X = Y = Z = something). As a side-effect this'll now also
26073 consume less local variables. test-38.cs now passes with MCS, added
26074 a few new test cases to that test.
26076 2002-07-20 Martin Baulig <martin@gnome.org>
26078 * expression.cs (Binary.EmitBranchable): Emit correct unsigned branch
26079 instructions. Fixes bug #27977, also added test-146.cs.
26081 2002-07-19 Gonzalo Paniagua Javier <gonzalo@ximian.com>
26083 * cs-tokenizer.cs: fixed getHex ().
26085 2002-07-19 Martin Baulig <martin@gnome.org>
26087 * expression.cs (Invocation.EmitParams): Use TypeManager.LookupType(),
26088 not Type.GetType() to lookup the array type. This is needed when
26089 we're constructing an array of a user-defined type.
26090 (ArrayAccess.EmitDynamicInitializers): Only emit the Ldelema for
26091 single-dimensional arrays, but also for single-dimensial arrays of
26094 2002-07-19 Martin Baulig <martin@gnome.org>
26096 * expression.cs (New.DoEmit): Create a new LocalTemporary each time
26097 this function is called, it's not allowed to share LocalBuilders
26098 among ILGenerators.
26100 2002-07-19 Martin Baulig <martin@gnome.org>
26102 * expression.cs (Argument.Resolve): Report an error 118 when trying
26103 to pass a type as argument.
26105 2002-07-18 Martin Baulig <martin@gnome.org>
26107 * ecore.cs (Expression.ImplicitNumericConversion): Don't emit a
26108 Conv_R_Un for the signed `long' type.
26110 2002-07-15 Miguel de Icaza <miguel@ximian.com>
26112 * expression.cs (MemberAccess.DoResolve): Do not reuse the field
26113 `expr' for the temporary result, as that will fail if we do
26114 multiple resolves on the same expression.
26116 2002-07-05 Miguel de Icaza <miguel@ximian.com>
26118 * ecore.cs (SimpleNameResolve): Use ec.DeclSpace instead of
26119 ec.TypeContainer for looking up aliases.
26121 * class.cs (TypeContainer): Remove LookupAlias from here.
26123 * decl.cs (DeclSpace); Move here.
26125 2002-07-01 Miguel de Icaza <miguel@ximian.com>
26127 * class.cs (FindMembers): Only call filter if the constructor
26128 bulider is not null.
26130 Also handle delegates in `NestedTypes' now. Now we will perform
26131 type lookups using the standard resolution process. This also
26134 * decl.cs (DeclSpace.ResolveType): New type resolution routine.
26135 This uses Expressions (the limited kind that can be parsed by the
26136 tree) instead of strings.
26138 * expression.cs (ComposedCast.ToString): Implement, used to flag
26139 errors since now we have to render expressions.
26141 (ArrayCreation): Kill FormElementType. Use ComposedCasts in
26144 * ecore.cs (SimpleName.ToString): ditto.
26146 * cs-parser.jay: Instead of using strings to assemble types, use
26147 Expressions to assemble the type (using SimpleName, ComposedCast,
26148 MemberAccess). This should fix the type lookups in declarations,
26149 because we were using a different code path for this.
26151 * statement.cs (Block.Resolve): Continue processing statements
26152 even when there is an error.
26154 2002-07-17 Miguel de Icaza <miguel@ximian.com>
26156 * class.cs (Event.Define): Also remove the `remove' method from
26157 the list of pending items.
26159 * expression.cs (ParameterReference): Use ldarg.N (0..3) to
26160 generate more compact code.
26162 2002-07-17 Martin Baulig <martin@gnome.org>
26164 * const.cs (Const.LookupConstantValue): Add support for constant
26165 `unchecked' and `checked' expressions.
26166 Also adding test case test-140.cs for this.
26168 2002-07-17 Martin Baulig <martin@gnome.org>
26170 * statement.cs (Foreach.GetEnumeratorFilter): When compiling corlib,
26171 check whether mi.ReturnType implements the IEnumerator interface; the
26172 `==' and the IsAssignableFrom() will fail in this situation.
26174 2002-07-16 Ravi Pratap <ravi@ximian.com>
26176 * ecore.cs (SimpleName.SimpleNameResolve) : Apply Gonzalo's fix
26179 2002-07-16 Gonzalo Paniagua Javier <gonzalo@ximian.com>
26181 * expression.cs: fixed bug #27811.
26183 2002-07-14 Miguel de Icaza <miguel@ximian.com>
26185 * expression.cs (ParameterReference.AddressOf): Patch from Paolo
26186 Molaro: when we are a ref, the value already contains a pointer
26187 value, do not take the address of it.
26189 2002-07-14 Rafael Teixeira <rafaelteixeirabr@hotmail.com>
26190 * removed mb-parser.jay and mb-tokenizer.cs
26192 Sat Jul 13 19:38:03 CEST 2002 Paolo Molaro <lupus@ximian.com>
26194 * expression.cs: check against the building corlib void type.
26196 Sat Jul 13 19:35:58 CEST 2002 Paolo Molaro <lupus@ximian.com>
26198 * ecore.cs: fix for valuetype static readonly fields: when
26199 initializing them, we need their address, not the address of a copy.
26201 Sat Jul 13 17:32:53 CEST 2002 Paolo Molaro <lupus@ximian.com>
26203 * typemanager.cs: register also enum_type in corlib.
26205 Sat Jul 13 15:59:47 CEST 2002 Paolo Molaro <lupus@ximian.com>
26207 * class.cs: allow calling this (but not base) initializers in structs.
26209 Sat Jul 13 15:12:06 CEST 2002 Paolo Molaro <lupus@ximian.com>
26211 * ecore.cs: make sure we compare against the building base types
26214 Sat Jul 13 15:10:32 CEST 2002 Paolo Molaro <lupus@ximian.com>
26216 * typemanager.cs: fix TypeToCoreType() to handle void and object
26217 (corlib gets no more typerefs after this change).
26219 2002-07-12 Miguel de Icaza <miguel@ximian.com>
26221 * expression.cs (ArrayCreation.EmitArrayArguments): use
26222 Conv.Ovf.U4 for unsigned and Conv.Ovf.I4 for signed.
26224 (ArrayAccess.LoadArrayAndArguments): Use Conv_Ovf_I and
26225 Conv_Ovf_I_Un for the array arguments. Even if C# allows longs as
26226 array indexes, the runtime actually forbids them.
26228 * ecore.cs (ExpressionToArrayArgument): Move the conversion code
26229 for array arguments here.
26231 * expression.cs (EmitLoadOpcode): System.Char is a U2, use that
26232 instead of the default for ValueTypes.
26234 (New.DoEmit): Use IsValueType instead of
26235 IsSubclassOf (value_type)
26236 (New.DoResolve): ditto.
26237 (Invocation.EmitCall): ditto.
26239 * assign.cs (Assign): ditto.
26241 * statement.cs (Unsafe): Ok, so I got the semantics wrong.
26242 Statements *are* currently doing part of their resolution during
26245 Expressions do always resolve during resolve, but statements are
26246 only required to propagate resolution to their children.
26248 2002-07-11 Miguel de Icaza <miguel@ximian.com>
26250 * driver.cs (CSCParseOption): Finish the /r: and /lib: support.
26252 (LoadAssembly): Do not add the dll if it is already specified
26254 (MainDriver): Add the System directory to the link path at the end,
26255 after all the other -L arguments.
26257 * expression.cs (ArrayAccess.EmitLoadOpcode): I was using the
26258 wrong opcode for loading bytes and bools (ldelem.i1 instead of
26259 ldelem.u1) and using the opposite for sbytes.
26261 This fixes Digger, and we can finally run it.
26263 * driver.cs (UnixParseOption): Move the option parsing here.
26264 (CSCParseOption): Implement CSC-like parsing of options.
26266 We now support both modes of operation, the old Unix way, and the
26267 new CSC-like way. This should help those who wanted to make cross
26268 platform makefiles.
26270 The only thing broken is that /r:, /reference: and /lib: are not
26271 implemented, because I want to make those have the same semantics
26272 as the CSC compiler has, and kill once and for all the confussion
26273 around this. Will be doing this tomorrow.
26275 * statement.cs (Unsafe.Resolve): The state is checked during
26276 resolve, not emit, so we have to set the flags for IsUnsfe here.
26278 2002-07-10 Miguel de Icaza <miguel@ximian.com>
26280 * expression.cs (MemberAccess.ResolveMemberAccess): Since we can
26281 not catch the Error_ObjectRefRequired in SimpleName (as it is
26282 possible to have a class/instance variable name that later gets
26283 deambiguated), we have to check this here.
26285 2002-07-10 Ravi Pratap <ravi@ximian.com>
26287 * class.cs (TypeContainer.GetFieldFromEvent): Move away from here,
26288 make static and put into Expression.
26290 (Event.Define): Register the private field of the event with the
26291 TypeManager so that GetFieldFromEvent can get at it.
26293 (TypeManager.RegisterPrivateFieldOfEvent): Implement to
26294 keep track of the private field associated with an event which
26297 (TypeManager.GetPrivateFieldOfEvent): Implement to get at the
26300 * ecore.cs (GetFieldFromEvent): RE-write to use the above methods.
26302 2002-07-10 Miguel de Icaza <miguel@ximian.com>
26304 * expression.cs (Binary.EmitBranchable): this routine emits the
26305 Binary expression in a branchable context. This basically means:
26306 we need to branch somewhere, not just get the value on the stack.
26308 This works together with Statement.EmitBoolExpression.
26310 * statement.cs (Statement.EmitBoolExpression): Use
26313 2002-07-09 Miguel de Icaza <miguel@ximian.com>
26315 * statement.cs (For): Reduce the number of jumps in loops.
26317 (For): Implement loop inversion for the For statement.
26319 (Break): We can be breaking out of a Try/Catch controlled section
26320 (foreach might have an implicit try/catch clause), so we need to
26321 use Leave instead of Br.
26323 * ecore.cs (FieldExpr.AddressOf): Fix for test-139 (augmented
26324 now). If the instace expression supports IMemoryLocation, we use
26325 the AddressOf method from the IMemoryLocation to extract the
26326 address instead of emitting the instance.
26328 This showed up with `This', as we were emitting the instance
26329 always (Emit) instead of the Address of This. Particularly
26330 interesting when This is a value type, as we dont want the Emit
26331 effect (which was to load the object).
26333 2002-07-08 Miguel de Icaza <miguel@ximian.com>
26335 * attribute.cs: Pass the entry point to the DefinePInvokeMethod
26337 * statement.cs (Checked): Set the CheckedState during the resolve
26338 process too, as the ConvCast operations track the checked state on
26339 the resolve process, and not emit.
26341 * cs-parser.jay (namespace_member_declaration): Flag that we have
26342 found a declaration when we do. This is used to flag error 1529
26344 * driver.cs: Report ok when we display the help only.
26346 2002-07-06 Andrew Birkett <adb@tardis.ed.ac.uk>
26348 * cs-tokenizer.cs (xtoken): Improve handling of string literals.
26350 2002-07-04 Miguel de Icaza <miguel@ximian.com>
26352 * cs-tokenizer.cs (define): We also have to track locally the
26353 defines. AllDefines is just used for the Conditional Attribute,
26354 but we also need the local defines for the current source code.
26356 2002-07-03 Miguel de Icaza <miguel@ximian.com>
26358 * statement.cs (While, For, Do): These loops can exit through a
26359 Break statement, use this information to tell whether the
26360 statement is the last piece of code.
26362 (Break): Flag that we break.
26364 * codegen.cs (EmitContexts): New `Breaks' state variable.
26366 2002-07-03 Martin Baulig <martin@gnome.org>
26368 * class.cs (TypeContainer.MethodModifiersValid): Allow override
26369 modifiers in method declarations in structs. Otherwise, you won't
26370 be able to override things like Object.Equals().
26372 2002-07-02 Miguel de Icaza <miguel@ximian.com>
26374 * class.cs (Method, Property, Indexer): Do not allow the public
26375 modifier to be used in explicit interface implementations.
26377 (TypeContainer.MethodModifiersValid): Catch virtual, abstract and
26378 override modifiers in method declarations in structs
26380 2002-07-02 Andrew Birkett <adb@tardis.ed.ac.uk>
26382 * cs-tokenizer.cs (adjust_int, adjust_real): Do not abort on
26383 integer or real overflow, report an error
26385 2002-07-02 Martin Baulig <martin@gnome.org>
26387 * typemanager.cs (TypeManager.InitCoreTypes): When compiling
26388 corlib, dynamically call AssemblyBuilder.SetCorlibTypeBuilders()
26389 to tell the runtime about our newly created System.Object and
26390 System.ValueType types.
26392 2002-07-02 Miguel de Icaza <miguel@ximian.com>
26394 * expression.cs (This): Use Stobj/Ldobj when we are a member of a
26395 struct instead of Ldarg/Starg.
26397 2002-07-02 Martin Baulig <martin@gnome.org>
26399 * expression.cs (Indirection.Indirection): Call
26400 TypeManager.TypeToCoreType() on `expr.Type.GetElementType ()'.
26402 2002-07-02 Martin Baulig <martin@gnome.org>
26404 * expression.cs (ArrayAccess.EmitStoreOpcode): If the type is a
26405 ValueType, call TypeManager.TypeToCoreType() on it.
26406 (Invocations.EmitParams): Call TypeManager.TypeToCoreType() on
26407 the OpCodes.Newarr argument.
26409 2002-07-02 Martin Baulig <martin@gnome.org>
26411 * expression.cs (Invocation.EmitCall): When compiling corlib,
26412 replace all calls to the system's System.Array type to calls to
26413 the newly created one.
26415 * typemanager.cs (TypeManager.InitCodeHelpers): Added a few more
26416 System.Array methods.
26417 (TypeManager.InitCoreTypes): When compiling corlib, get the methods
26418 from the system's System.Array type which must be replaced.
26420 Tue Jul 2 19:05:05 CEST 2002 Paolo Molaro <lupus@ximian.com>
26422 * typemanager.cs: load unverifiable_code_ctor so we can build
26423 corlib using the correct type. Avoid using GetTypeCode() with
26425 * rootcontext.cs: uses TypeManager.unverifiable_code_ctor and
26426 TypeManager.object_type to allow building corlib.
26428 Tue Jul 2 19:03:19 CEST 2002 Paolo Molaro <lupus@ximian.com>
26430 * ecore.cs: handle System.Enum separately in LoadFromPtr().
26432 2002-07-01 Martin Baulig <martin@gnome.org>
26434 * class.cs: Make the last change actually work, we need to check
26435 whether `ifaces != null' to avoid a crash.
26437 Mon Jul 1 16:15:03 CEST 2002 Paolo Molaro <lupus@ximian.com>
26439 * class.cs: when we build structs without fields that implement
26440 interfaces, we need to add the interfaces separately, since there is
26441 no API to both set the size and add the interfaces at type creation
26444 Mon Jul 1 14:50:47 CEST 2002 Paolo Molaro <lupus@ximian.com>
26446 * expression.cs: the dimension arguments to the array constructors
26447 need to be converted if they are a long.
26449 Mon Jul 1 12:26:12 CEST 2002 Paolo Molaro <lupus@ximian.com>
26451 * class.cs: don't emit ldarg.0 if there is no parent constructor
26452 (fixes showstopper for corlib).
26454 2002-06-29 Martin Baulig <martin@gnome.org>
26456 MCS now compiles corlib on GNU/Linux :-)
26458 * attribute.cs (Attribute.ApplyAttributes): Treat Accessors like Method,
26459 ie. check for MethodImplOptions.InternalCall.
26461 * class.cs (TypeContainer.DefineType): When compiling corlib, both parent
26462 and TypeManager.attribute_type are null, so we must explicitly check
26463 whether parent is not null to find out whether it's an attribute type.
26464 (Property.Emit): Always call Attribute.ApplyAttributes() on the GetBuilder
26465 and SetBuilder, not only if the property is neither abstract nor external.
26466 This is necessary to set the MethodImplOptions on the accessor methods.
26467 (Indexer.Emit): Call Attribute.ApplyAttributes() on the GetBuilder and
26468 SetBuilder, see Property.Emit().
26470 * rootcontext.cs (RootContext.PopulateTypes): When compiling corlib, don't
26471 populate "System.Object", "System.ValueType" and "System.Attribute" since
26472 they've already been populated from BootCorlib_PopulateCoreTypes().
26474 2002-06-29 Martin Baulig <martin@gnome.org>
26476 * ecore.cs (Expression.ImplicitReferenceConversionExists): If expr
26477 is the NullLiteral, we also need to make sure that target_type is not
26480 2002-06-29 Martin Baulig <martin@gnome.org>
26482 * rootcontext.cs (RootContext.ResolveCore): We must initialize
26483 `TypeManager.multicast_delegate_type' and `TypeManager.delegate_type'
26484 before calling BootstrapCorlib_ResolveDelegate ().
26486 2002-06-27 Gonzalo Paniagua Javier <gonzalo@ximian.com>
26488 * statement.cs: fixed build-breaker. All tests passed ok.
26490 2002-06-27 Martin Baulig <martin@gnome.org>
26492 * typemanager.cs (TypeManager.VerifyUnManaged): Added explicit check
26493 for System.Decimal when compiling corlib.
26495 2002-06-27 Martin Baulig <martin@gnome.org>
26497 * statement.cs (Switch.TableSwitchEmit): Make this work with empty
26498 switch blocks which contain nothing but a default clause.
26500 2002-06-26 Andrew <adb@tardis.ed.ac.uk>
26502 * ../errors/cs1501-3.cs: Added new test for struct ctr typechecks.
26504 2002-06-27 Martin Baulig <martin@gnome.org>
26506 * ecore.cs (PropertyExpr.PropertyExpr): Call
26507 TypeManager.TypeToCoreType() on the `pi.PropertyType'.
26509 * typemanager.cs (TypeManager.TypeToCoreType): Return if the type
26510 is already a TypeBuilder.
26512 2002-06-27 Martin Baulig <martin@gnome.org>
26514 * ecore.cs (Expression.ImplicitReferenceConversionExists): Use
26515 `target_type == TypeManager.array_type', not IsAssignableFrom() in
26516 the "from an array-type to System.Array" case. This makes it work
26517 when compiling corlib.
26519 2002-06-27 Martin Baulig <martin@gnome.org>
26521 * ecore.cs (Expression.SimpleNameResolve): If the expression is a
26522 non-static PropertyExpr, set its InstanceExpression. This makes
26523 the `ICollection.Count' property work in System/Array.cs.
26525 2002-06-25 Andrew Birkett <adb@tardis.ed.ac.uk>
26527 * driver.cs: Made error handling more consistent. Errors now
26528 tracked by Report class, so many methods which used to return int
26529 now return void. Main() now prints success/failure and
26530 errors/warnings message.
26532 Renamed '--probe' compiler argument to '--expect-error'. Removed
26533 the magic number return values (123 and 124). Now, if the
26534 expected error occurs, the compiler exits with success (exit value
26535 0). If the compilation completes without seeing that particular
26536 error, the compiler exits with failure (exit value 1). The
26537 makefile in mcs/errors has been changed to handle the new behaviour.
26539 * report.cs: Made 'expected error' number a property and renamed
26540 it from 'Probe' to 'ExpectedError'.
26542 * genericparser.cs: Removed error handling support, since it is
26543 now all done by Report class.
26545 * cs-parser.jay, mb-parser.jay: Errors are tracked by Report
26546 class, so parse() no longer returns an int.
26548 * namespace.cs: Use Report.Error instead of GenericParser.error
26550 2002-06-22 Miguel de Icaza <miguel@ximian.com>
26552 * class.cs (TypeContainer.AddMethod, TypeContainer.AddIndexer,
26553 TypeContainer.AddOperator): At the front of the list put the
26554 explicit implementations, so they get resolved/defined first.
26556 2002-06-21 Miguel de Icaza <miguel@ximian.com>
26558 * class.cs (TypeContainer.VerifyImplements): Verifies that a given
26559 interface type is implemented by this TypeContainer. Used during
26560 explicit interface implementation.
26562 (Property.Define, Indexer.Define, Method.Define): Validate that
26563 the given interface in the explicit implementation is one of the
26564 base classes for the containing type.
26566 Also if we are explicitly implementing an interface, but there is
26567 no match in the pending implementation table, report an error.
26569 (Property.Define): Only define the property if we are
26570 not explicitly implementing a property from an interface. Use the
26571 correct name also for those properties (the same CSC uses,
26572 although that is really not needed).
26574 (Property.Emit): Do not emit attributes for explicitly implemented
26575 properties, as there is no TypeBuilder.
26577 (Indexer.Emit): ditto.
26579 Hiding then means that we do not really *implement* a pending
26580 implementation, which makes code fail.
26582 2002-06-22 Martin Baulig <martin@gnome.org>
26584 * ecore.cs (Expression.Constantify): Call TypeManager.TypeToCoreType() on
26585 the return value of Object.GetType(). [FIXME: we need to do this whenever
26586 we get a type back from the reflection library].
26588 Fri Jun 21 13:37:57 CEST 2002 Paolo Molaro <lupus@ximian.com>
26590 * typemanager.cs: make ExpandInterfaces() slip duplicated interfaces.
26592 2002-06-20 Miguel de Icaza <miguel@ximian.com>
26594 * attribute.cs: Return null if we can not look up the type.
26596 * class.cs (TypeContainer.GetClassBases): Use ExpandInterfaces on
26597 the interface types found.
26599 * interface.cs (Interface.GetInterfaceBases): Use ExpandInterfaces on the
26600 interface types found.
26602 * typemanager.cs (GetInterfaces): Make this routine returns alll
26603 the interfaces and work around the lame differences between
26604 System.Type and System.Reflection.Emit.TypeBuilder in the results
26605 result for GetInterfaces.
26607 (ExpandInterfaces): Given an array of interface types, expand and
26608 eliminate repeated ocurrences of an interface. This expands in
26609 context like: IA; IB : IA; IC : IA, IB; the interface "IC" to
26612 2002-06-21 Martin Baulig <martin@gnome.org>
26614 * typemanager.cs (TypeManager.EnumToUnderlying): It's now safe to call this function
26617 2002-06-21 Martin Baulig <martin@gnome.org>
26619 * typemanager.cs (TypeManager.TypeToCoreType): New function. When compiling corlib
26620 and called with one of the core types, return the corresponding typebuilder for
26623 * expression.cs (ArrayAccess.DoResolve): Call TypeManager.TypeToCoreType() on the
26626 2002-06-21 Martin Baulig <martin@gnome.org>
26628 * ecore.cs (Expression.ExplicitReferenceConversionExists): Use
26629 `target_type.IsArray' instead of `target_type.IsSubclassOf (TypeManager.array_type)'.
26630 (Expression.ConvertReferenceExplicit): Likewise.
26632 * expression.cs (ElementAccess.DoResolve): Likewise.
26633 (ElementAccess.DoResolveLValue): Likewise.
26635 2002-06-10 Martin Baulig <martin@gnome.org>
26637 * interface.cs (Interface.PopulateIndexer): When creating the setter, we need to
26638 add the "value" parameter to the parameter list.
26640 * statement.cs (Fixed.Emit): Pass the return value of the child block's Emit()
26643 2002-06-19 Miguel de Icaza <miguel@ximian.com>
26645 * expression.cs (ArrayCreation.ExpressionToArrayArgument): Convert
26646 the argument to an int, uint, long or ulong, per the spec. Also
26647 catch negative constants in array creation.
26649 Thu Jun 20 17:56:48 CEST 2002 Paolo Molaro <lupus@ximian.com>
26651 * class.cs: do not allow the same interface to appear twice in
26652 the definition list.
26654 Wed Jun 19 22:33:37 CEST 2002 Paolo Molaro <lupus@ximian.com>
26656 * ecore.cs: don't use ldlen with System.Array.
26658 Wed Jun 19 20:57:40 CEST 2002 Paolo Molaro <lupus@ximian.com>
26660 * ecore.cs: stobj requires a type argument. Handle indirect stores on enums.
26662 Wed Jun 19 20:17:59 CEST 2002 Paolo Molaro <lupus@ximian.com>
26664 * modifiers.cs: produce correct field attributes for protected
26665 internal. Easy fix so miguel can work on ther harder stuff:-)
26667 2002-06-18 Miguel de Icaza <miguel@ximian.com>
26669 * pending.cs: New file. Move the code from class.cs here.
26670 Support clearning the pending flag for all methods (when not doing
26671 explicit interface implementation).
26673 Tue Jun 18 10:36:22 CEST 2002 Paolo Molaro <lupus@ximian.com>
26675 * rootcontext.cs: added a couple more types needed to bootstrap.
26677 2002-06-17 Miguel de Icaza <miguel@ximian.com>
26679 * typemanager.cs (GetConstructor): Use DeclaredOnly to look the
26680 constructor in the type, instead of any constructor in the type
26681 hierarchy. Thanks to Paolo for finding this bug (it showed up as
26682 a bug in the Mono runtime when applying the params attribute).
26684 2002-06-16 Rafael Teixeira <rafaelteixeirabr@hotmail.com>
26685 * changed namespace.cs to use "GenericParser.error(...)" instead of "CSharpParser.error(...)"
26687 2002-06-14 Rachel Hestilow <hestilow@ximian.com>
26689 * expression.cs (Unary.ResolveOperator): Use TypeManager
26690 to resolve the type.
26692 2002-06-13 Ravi Pratap <ravi@ximian.com>
26694 * cs-parser.jay (enum_member_declaration): Pass in the attributes
26697 * enum.cs (AddEnumMember): Add support to store the attributes associated
26698 with each member too.
26700 * attribute.cs (CheckAttribute, ApplyAttributes): Update to handle
26701 field builders too - this takes care of the enum member case.
26703 2002-06-10 Rachel Hestilow <hestilow@ximian.com>
26705 * typemanager.cs (TypeManager.VerifyUnManaged): Allow
26706 address-of operator on both value types and pointers.
26708 2002-06-10 Martin Baulig <martin@gnome.org>
26710 * interface.cs (Interface.PopulateIndexer): Add the indexer's
26711 PropertyBuilder to the `property_builders' list.
26713 * expression.cs (Indexers.GetIndexersForTypeOrInterface): New private method.
26714 (Indexers.GetIndexersForType): Call GetIndexersForTypeOrInterface() on the
26715 `lookup_type' and all its interfaces. Unfortunately, Type.FindMembers() won't
26716 find any indexers which are inherited from an interface.
26718 2002-06-09 Martin Baulig <martin@gnome.org>
26720 * const.cs (Const.LookupConstantValue): Convert `Expr' to a literal of
26721 the same type as the constant if necessary. There's also a test-130.cs
26724 * enum.cs (Enum.ChangeEnumType): Moved to typemanager.cs and made public.
26726 * typemanager.cs (TypeManager.ChangeType): Previously known as
26727 Enum.ChangeEnumType().
26729 2002-06-09 Martin Baulig <martin@gnome.org>
26731 * expression.cs (Cast.TryReduce): Added support for consts.
26733 2002-06-08 Ravi Pratap <ravi@ximian.com>
26735 * class.cs (Accessor): Hold attributes information so we can pass
26738 * cs-parser.jay (get_accessor_declaration, set_accessor_declaration):
26739 Modify to pass in attributes attached to the methods.
26741 (add_accessor_declaration, remove_accessor_declaration): Ditto.
26743 * attribute.cs (ApplyAttributes, CheckAttribute): Update accordingly
26744 to handle the Accessor kind :-)
26746 * class.cs (Property.Emit, Event.Emit): Apply attributes to the accessors
26748 2002-06-08 Martin Baulig <martin@gnome.org>
26750 * expression.cs (Unary.TryReduceNegative): Added support for
26753 2002-06-08 Martin Baulig <martin@gnome.org>
26755 * enum.cs (Enum.LookupEnumValue): Don't report an error if the
26756 name can't be found in the `defined_names' - the caller will do a
26757 MemberLookup in this case and thus find methods in System.Enum
26758 such as Enum.IsDefined().
26760 2002-06-08 Martin Baulig <martin@gnome.org>
26762 * enum.cs (Enum.ChangeEnumType): This is a custom version of
26763 Convert.ChangeType() which works with TypeBuilder created types.
26764 (Enum.LookupEnumValue, Enum.Define): Use it here.
26766 * class.cs (TypeContainer.RegisterRequiredImplementations): Added
26767 `TypeBuilder.BaseType != null' check.
26768 (TypeContainer.FindMembers): Only lookup parent members if we
26769 actually have a parent.
26770 (Method.EmitDestructor): Added `ec.ContainerType.BaseType != null' check.
26771 (ConstructorInitializer.Resolve): Likewise.
26773 * interface.cs (Interface.FindMembers): Added
26774 `TypeBuilder.BaseType != null' check.
26776 * rootcontext.cs (RootContext.ResolveCore): Added
26777 "System.Runtime.CompilerServices.IndexerNameAttribute" to
26778 classes_second_stage.
26780 * typemanager.cs (TypeManager.InitCoreTypes): Don't initialize
26781 debug_type and trace_type when compiling with --nostdlib.
26783 2002-06-07 Martin Baulig <martin@gnome.org>
26785 * class.cs (TypeContainer): Added `have_nonstatic_fields' field.
26786 (AddField): Set it to true when adding a non-static field.
26787 (DefineType): Use `have_nonstatic_fields' to find out whether we
26788 have non-static fields, not `Fields != null'.
26790 2002-06-02 Miguel de Icaza <miguel@ximian.com>
26792 * ecore.cs (SimpleNameResolve): Removed simple bug (we were
26793 dereferencing a null on the static-field code path)
26795 2002-05-30 Martin Baulig <martin@gnome.org>
26797 * codegen.cs (InitMonoSymbolWriter): Added `string[] args' argument
26798 to take command line arguments. Use reflection to call the new
26799 custom `Initialize' function on the symbol writer and pass it the
26800 command line arguments.
26802 * driver.cs (--debug-args): New command line argument to pass command
26803 line arguments to the symbol writer.
26805 2002-05-28 Miguel de Icaza <miguel@ximian.com>
26807 * assign.cs (DoResolve): Forgot to do the implicit conversion to
26808 the target type for indexers and properties. Thanks to Joe for
26811 2002-05-27 Miguel de Icaza <miguel@ximian.com>
26813 * typemanager.cs (MethodFlags): returns the method flags
26814 (Obsolete/ShouldIgnore) that control warning emission and whether
26815 the invocation should be made, or ignored.
26817 * expression.cs (Invocation.Emit): Remove previous hack, we should
26818 not do this on matching a base type, we should do this based on an attribute
26820 Only emit calls to System.Diagnostics.Debug and
26821 System.Diagnostics.Trace if the TRACE and DEBUG defines are passed
26822 on the command line.
26824 * rootcontext.cs: Global settings for tracing and debugging.
26826 * cs-tokenizer.cs (define): New utility function to track
26827 defines. Set the global settings for TRACE and DEBUG if found.
26829 2002-05-25 Ravi Pratap <ravi@ximian.com>
26831 * interface.cs (Populate*): Pass in the TypeContainer as well as
26832 the DeclSpace as parameters so that we can create EmitContexts and
26833 then use that to apply attributes etc.
26835 (PopulateMethod, PopulateEvent, PopulateProperty)
26836 (PopulateIndexer): Apply attributes everywhere.
26838 * attribute.cs (CheckAttribute): Include InterfaceMethod, InterfaceEvent
26841 (ApplyAttributes): Update accordingly.
26843 We now apply interface attributes for all members too.
26845 2002-05-26 Miguel de Icaza <miguel@ximian.com>
26847 * class.cs (Indexer.Define); Correctly check if we are explicit
26848 implementation (instead of checking the Name for a ".", we
26849 directly look up if the InterfaceType was specified).
26851 Delay the creation of the PropertyBuilder.
26853 Only create the PropertyBuilder if we are not an explicit
26854 interface implementation. This means that explicit interface
26855 implementation members do not participate in regular function
26856 lookups, and hence fixes another major ambiguity problem in
26857 overload resolution (that was the visible effect).
26859 (DefineMethod): Return whether we are doing an interface
26862 * typemanager.cs: Temporary hack until we get attributes in
26863 interfaces (Ravi is working on that) and we get IndexerName
26864 support in interfaces.
26866 * interface.cs: Register the indexers as properties.
26868 * attribute.cs (Attribute.Resolve): Catch the error, and emit a
26869 warning, I have verified that this is a bug in the .NET runtime
26870 (JavaScript suffers of the same problem).
26872 * typemanager.cs (MemberLookup): When looking up members for
26873 interfaces, the parent of an interface is the implicit
26874 System.Object (so we succeed in searches of Object methods in an
26875 interface method invocation. Example: IEnumerable x; x.ToString
26878 2002-05-25 Miguel de Icaza <miguel@ximian.com>
26880 * class.cs (Event): Events should also register if they do
26881 implement the methods that an interface requires.
26883 * typemanager.cs (MemberLookup); use the new GetInterfaces
26886 (GetInterfaces): The code used to lookup interfaces for a type is
26887 used in more than one place, factor it here.
26889 * driver.cs: Track the errors at the bottom of the file, we kept
26892 * delegate.cs (NewDelegate.Emit): We have to emit a null as the
26893 instance if the method we are calling is static!
26895 2002-05-24 Miguel de Icaza <miguel@ximian.com>
26897 * attribute.cs (ApplyAttributes): Make this function filter out
26898 the IndexerName attribute (as that attribute in reality is never
26899 applied) and return the string constant for the IndexerName
26902 * class.cs (TypeContainer.Emit): Validate that all the indexers
26903 have the same IndexerName attribute, and if so, set the
26904 DefaultName attribute on the class.
26906 * typemanager.cs: The return value might contain other stuff (not
26907 only methods). For instance, consider a method with an "Item"
26908 property and an Item method.
26910 * class.cs: If there is a problem with the parameter types,
26913 2002-05-24 Ravi Pratap <ravi@ximian.com>
26915 * ecore.cs (ImplicitConversionExists): Wrapper function which also
26916 looks at user defined conversion after making a call to
26917 StandardConversionExists - we need this for overload resolution.
26919 * expression.cs : Update accordingly the various method calls.
26921 This fixes 2 bugs filed against implicit user defined conversions
26923 2002-05-22 Miguel de Icaza <miguel@ximian.com>
26925 * statement.cs: Track the result of the assignment.
26927 2002-05-21 Miguel de Icaza <miguel@ximian.com>
26929 * expression.cs (MemberAccess): Improved error reporting for
26930 inaccessible members.
26932 2002-05-22 Martin Baulig <martin@gnome.org>
26934 * makefile (mcs-mono2.exe): New target. This is mcs compiled with
26935 itself with debugging support.
26937 2002-05-22 Martin Baulig <martin@gnome.org>
26939 * typemanager.cs ("System.Runtime.InteropServices.StructLayoutAttribute"):
26940 Removed, this isn't needed anymore.
26942 2002-05-20 Martin Baulig <martin@gnome.org>
26944 * typemanager.cs (InitEnumUnderlyingTypes): "System.Char" can't
26945 be underlying type for an enum.
26947 2002-05-20 Miguel de Icaza <miguel@ximian.com>
26949 * typemanager.cs (InitEnumUnderlyingTypes): New helper function
26950 that splits out the loading of just the core types.
26952 * rootcontext.cs (ResolveCore): Split the struct resolution in
26953 two, so we can load the enumeration underlying types before any
26956 * expression.cs (Is): Bandaid until we fix properly Switch (see
26957 bug #24985 for details).
26959 * typemanager.cs (ImplementsInterface): The hashtable will contain
26960 a null if there are no interfaces implemented.
26962 2002-05-18 Miguel de Icaza <miguel@ximian.com>
26964 * cs-parser.jay (indexer_declarator): It is fine to have array
26967 2002-05-17 Miguel de Icaza <miguel@ximian.com>
26969 * typemanager.cs: (RegisterBuilder): New function used to register
26970 TypeBuilders that implement interfaces. Since
26971 TypeBuilder.GetInterfaces (as usual) does not work with lame
26973 (AddUserType): register interfaces.
26975 (ImplementsInterface): Use the builder_to_ifaces hash if we are
26976 dealing with TypeBuilder. Also, arrays are showing up as
26977 SymbolTypes, which are not TypeBuilders, but whose GetInterfaces
26978 methods can not be invoked on them!
26980 * ecore.cs (ExplicitReferenceConversionExists): Made public.
26981 (ImplicitReferenceConversionExists): Split out from
26982 StandardConversionExists.
26984 * expression.cs (As): We were only implementing one of the three
26985 cases for the as operator. We now implement them all.
26986 (Is): Implement the various other cases for Is as well.
26988 * typemanager.cs (CACHE): New define used to control if we want or
26989 not the FindMembers cache. Seems to have a negative impact on
26990 performance currently
26992 (MemberLookup): Nested types have full acess to
26993 enclosing type members
26995 Remove code that coped with instance/static returns for events, we
26996 now catch this in RealFindMembers.
26998 (RealFindMembers): only perform static lookup if the instance
26999 lookup did not return a type or an event.
27001 2002-05-17 Miguel de Icaza <miguel@ximian.com>
27003 * assign.cs (CompoundAssign): We pass more semantic information
27004 now to Compound Assignments than we did before: now we have all
27005 the information at hand, and now we resolve the target *before* we
27006 do the expression expansion, which allows the "CacheValue" method
27007 to have the effect we intended (before, a [x] += 1 would generate
27008 two differen ArrayAccess expressions from the ElementAccess,
27009 during the resolution process).
27011 (CompoundAssign.DoResolve): Resolve target and original_source here.
27013 2002-05-16 Miguel de Icaza <miguel@ximian.com>
27015 * expression.cs (ArrayAccess): dropped debugging information.
27017 * typemanager.cs: Small bug fix: I was always returning i_members,
27018 instead of one of i_members or s_members (depending on which had
27021 * assign.cs (IAssignMethod.CacheTemporaries): New method. This
27022 method is invoked before any code generation takes place, and it
27023 is a mechanism to inform that the expression will be invoked more
27024 than once, and that the method should use temporary values to
27025 avoid having side effects
27027 (Assign.Emit): Call CacheTemporaries in the IAssignMethod.
27029 * ecore.cs (Expression.CacheTemporaries): Provide empty default
27032 * expression.cs (Indirection, ArrayAccess): Add support for
27033 CacheTemporaries in these two bad boys.
27035 * ecore.cs (LoadFromPtr): figure out on our own if we need to use
27036 ldobj or ldind_ref.
27037 (StoreFromPtr): Handle stobj as well.
27039 * expression.cs (UnaryMutator): Share more code.
27041 * typemanager.cs (FindMembers): Thanks to Paolo for tracking this
27042 down: I was not tracking the Filter function as well, which
27043 was affecting the results of the cache.
27045 2002-05-15 Miguel de Icaza <miguel@ximian.com>
27047 * attribute.cs: Remove the hack to handle the CharSet property on
27050 2002-05-14 Miguel de Icaza <miguel@ximian.com>
27052 * attribute.cs (DoResolve): More uglyness, we now only try to
27053 resolve the attribute partially, to extract the CharSet
27054 information (only if we are a StructLayout attribute). Otherwise
27056 (GetExtraTypeInfo): Add some code to conditionally kill in the
27057 future this. I am more and more convinced that the .NET
27058 framework has special code to handle the attribute setting on
27061 * expression.cs (IsParamsMethodApplicable): Revert my previous
27062 foreach change here, it was wrong.
27064 2002-05-13 Miguel de Icaza <miguel@ximian.com>
27066 * cs-tokenizer.cs: (pp_primary): Eat the ')' at the end.
27067 (pp_expr): do not abort on unknown input, just return.
27068 (eval): abort if there are pending chars.
27070 * attribute.cs (Attribute.Resolve): Positional parameters are
27071 optional. Deal with that case.
27073 * class.cs (DefineType): Call Attribute.GetExtraTypeInfo to fetch
27074 the Ansi/Unicode/Auto information for the type.
27076 (TypeContainer.DefineType): instantiate the EmitContext here, as
27077 we will be using it during the type definition (to resolve
27078 attributes) and during the emit phase.
27080 * attribute.cs (Attribute.GetExtraTypeInfo): This routine is used
27081 to pull type information out of the attributes
27083 (Attribute.Resolve): track the constructor builder, and allow for
27084 multiple invocations (structs and classes will use this).
27086 * ecore.cs (MemberLookupFinal): new version with all the
27087 parameters customizable.
27089 * expression.cs (New.DoResolve): Use MemberLookupFinal to locate
27090 constructors. Return if the result value is null (as the error
27091 would have been flagged already by MemberLookupFinal)
27093 Do not allow instances of abstract classes or interfaces to be
27096 * class.cs: (MethodSignature.InheritableMemberSignatureCompare):
27097 We have to compare the assembly property here when dealing with
27098 FamANDAssem and Assembly access modifiers, because we might be
27099 creating an assembly from *modules* (that means that we are not
27100 getting TypeBuilders for types defined in other modules that are
27101 part of this assembly).
27103 (Method.Emit): If the method is marked abstract and has a body,
27106 (TypeContainer.DefineMembers): If both the defined member and the
27107 parent name match are methods, then do not emit any warnings: let
27108 the Method.Define routine take care of flagging warnings. But if
27109 there is a mismatch (method overrides something else, or method is
27110 overriwritten by something, then emit warning).
27112 (MethodSignature.MemberSignatureCompare): If the sig.ret_type is
27113 set to null, this means `do not check for the return type on the
27116 (Method.Define): set the return type for the method signature to
27117 null, so that we get methods with the same name and parameters and
27118 different return types. This is used to flag warning 114 (you are
27119 hiding a method, and you probably want to use the new/override
27122 * typemanager.cs (MemberLookup): Implemented proper access
27123 control, closing a long standing set of bug reports. The problem
27124 was that the Framework only has two bits: Public and NonPublic,
27125 and NonPublic includes private and protected methods, but we need
27126 to enforce the FamANDAssem, FamOrAssem and Family.
27128 2002-05-11 Miguel de Icaza <miguel@ximian.com>
27130 * statement.cs (GotoCase): Return true: Ammounts to giving up
27131 knowledge on whether we return or not, and letting the other case
27132 be responsible for it.
27134 2002-05-10 Miguel de Icaza <miguel@ximian.com>
27136 * driver.cs: Do not load directories for each file processed, only
27137 do it if there is a pattern.
27139 * ecore.cs: Report readonly assigns here as well, as we might have
27140 been resolved only by MemberAccess.
27142 (SimpleName.SimpleNameResolve): Also be useful for LValue
27143 resolution. We need this to propagate assign to local readonly variables
27145 * typemanager.cs: Use a ptrhashtable for the criteria, because we
27146 do not want to reuse potential criteria memory.
27148 * class.cs (MyEventBuilder): Set reflected_type;
27150 * ecore.cs (Constantify): Added support for constifying bools.
27152 (RootContext.LookupType): Added a cache for values looked up in
27153 the declaration space.
27155 * typemanager.cs (FindMembers): Now is a front-end to
27156 RealFindMembers, and provides a two-level hashtable-based cache to
27159 15% performance improvement: from 22.5 to 19.2 seconds.
27161 * expression.cs (IsParamsMethodApplicable): use foreach.
27162 (Invocation.DoResolve): ditto.
27163 (New.DoResolve): ditto.
27164 (ArrayCreation.DoResolve): ditto.
27166 * ecore.cs (FindMostEncompassingType): use foreach.
27168 * delegate.cs (NewDelegate.DoResolve): Use foreach
27170 * ecore.cs (Expression.FindMostSpecificSource): Use foreach.
27171 (RemoveMethods): use foreach.
27173 * expression.cs (Invocation.MakeUnionSet): Optimization: Use two
27174 nested foreach statements instead of for, and also break out of
27175 the inner loop once a match is found.
27177 (Invocation.OverloadResolve): Use foreach, simplify the code.
27179 2002-05-08 Miguel de Icaza <miguel@ximian.com>
27181 * cfold.cs (BinaryFold): During an enumeration evaluation context,
27182 we actually unwrap the expression to allow for extra information
27185 * expression.cs: Use Shr_Un on unsigned operations.
27187 2002-05-08 Ravi Pratap <ravi@ximian.com>
27189 * ecore.cs (FindMostEncompass*): Fix trivial bug where the set of
27190 applicable operators was not being considered correctly. This closes
27191 the bug Miguel reported.
27193 Wed May 8 16:40:50 CEST 2002 Paolo Molaro <lupus@ximian.com>
27195 * attribute.cs: check that the type derives from System.Attribute
27196 and report the correct error in that case (moved the duplicate code to
27197 its own method, too).
27199 Wed May 8 11:50:31 CEST 2002 Paolo Molaro <lupus@ximian.com>
27201 * attribute.cs: lookup attribute type name as the spec says: first the
27202 bare attribute name and then name + "Attribute" (nant compiles with
27203 mcs after this fix).
27205 2002-05-07 Miguel de Icaza <miguel@ximian.com>
27207 * expression.cs (Unary.TryReduceNegative): Ah! Tricky! Tricky!
27208 Because of the way we parse things, we should try to see if a
27209 UIntConstant can fit in an integer.
27211 2002-05-07 Ravi Pratap <ravi@ximian.com>
27213 * ecore.cs (GetConversionOperators): Do not pick up op_True operators
27214 when we are in an explicit context.
27216 (ConvertReferenceExplicit): When converting from Iface type S to Class
27217 T make sure the rules are implemented as an OR.
27219 * parameter.cs (ParameterType): Make it a property for now although the
27220 purpose really isn't anything immediate.
27222 * expression.cs (Is*Applicable): Do better checking on the parameter type
27223 of a ref/out parameter. The ones from the system assemblies are already
27224 marked with the correct type so we don't need to do any correction.
27226 * ecore.cs (StandardConversionExists): Conversion from Interface types to
27227 the object type is standard too so include that.
27229 2002-05-06 Miguel de Icaza <miguel@ximian.com>
27231 * ecore.cs (StandardConversionExists): Augment with missing code:
27232 deal with IntConstant, LongConstants and Enumerations.
27234 * assign.cs: Report the error, instead of failing silently
27236 * rootcontext.cs (AddGlobalAttributes): Track attributes on the
27237 typecontainer that they are declared, because the
27238 typecontainer/namespace will have the list of using clauses that
27239 need to be applied.
27241 Assembly Attributes were escaping the normal registration
27244 (EmitCode): Apply attributes within an EmitContext that represents
27245 the container they were declared on.
27247 * cs-parser.jay: Track bases for structs. How did I get this wrong?
27249 2002-05-06 Ravi Pratap <ravi@ximian.com>
27251 * ecore.cs (FindMostEncompassingType, FindMostEncompassedType):
27252 Revamp completely - make much cleaner as we now operate only
27255 (FindMostSpecificSource, FindMostSpecificTarget): New methods
27256 to implement the logic detailed in the spec more correctly.
27258 (UserDefinedConversion): Update accordingly.
27260 2002-05-06 Miguel de Icaza <miguel@ximian.com>
27262 * statement.cs: Return flow analysis information up.
27264 * cs-tokenizer.cs (adjust_real): Share code between LITERAL_DOUBLE
27267 (token): Do not consume an extra character before calling
27270 2002-05-06 Piers Haken <piersh@friskit.com>
27272 * cs-parser.jay: add 'override' attribute to System.Object.Finalize
27274 2002-05-06 Miguel de Icaza <miguel@ximian.com>
27276 * class.cs (Constructor.Emit): Set the IsStatic flag in the
27277 EmitContext during the instance constructor initializer
27278 resolution, to stop access to instance variables.
27280 This is mandated by the spec, last paragraph of the `constructor
27281 initializers' section.
27283 2002-05-05 Miguel de Icaza <miguel@ximian.com>
27285 * cs-parser.jay, class.cs (Accessor): new class used to represent
27286 an accessor (get or set). In the past we used `null' to represent
27287 a missing accessor. But this is ambiguous because there was no
27288 way to tell in abstract indexers/properties if one of them was
27291 Now there is a way of addressing that.
27293 * expression.cs (Indexers.GetIndexersForType): Use TypeManager.MemberLookup
27294 instead of FindMembers.
27296 * class.cs (TypeContainer.EmitFieldInitializer): Do not typecast
27297 the result of Assign.Resolve as Assign, but rather as ExpressionStatement.
27299 * attribute.cs: Treat indexers and properties as the same in terms
27300 of applying attributes
27302 * ecore.cs (FindMostEncompassedType): Use statically initialized
27303 EmptyExpressions()s like we do elsewhere to avoid creating useless
27304 objects (and we take this out of the tight loop).
27306 (GetConversionOperators): Move the code to extract the actual
27307 operators to a separate routine to clean things up.
27309 2002-05-04 Miguel de Icaza <miguel@ximian.com>
27311 * ecore.cs (FieldExpr): Remove un-needed tests for null, since now
27312 events are always registered FieldBuilders.
27314 * class.cs (FieldBase): New class shared by Fields
27316 * delegate.cs: If we are a toplevel delegate, use our full name.
27317 If we are a nested delegate, then only use our tail name.
27319 2002-05-02 Ravi Pratap <ravi@ximian.com>
27321 * expression.cs (IsApplicable): Ensure that we add the "&" to
27322 ref/out types before comparing it with the type of the argument.
27324 (IsParamsMethodApplicable): Ditto.
27326 (Argument.Type): Use TypeManager.LookupType instead of Type.GetType -
27329 * delegate.cs : Handle the case when we have more than one applicable
27330 method. Flag an error only when we finish checking all.
27332 2002-05-02 Miguel de Icaza <miguel@ximian.com>
27334 * expression.cs: Add support for boolean static initializers.
27336 2002-05-01 Miguel de Icaza <miguel@ximian.com>
27338 * attribute.cs: Use proper cast for Events, since we use a MyEventBuilder.
27340 * parameter.cs (ComputeParameterTypes,
27341 ComputeAndDefineParameterTypes): Better error handling: now we
27342 clear the `types' cache if we fail during any of the type lookups.
27343 We also return the status code correctly to our caller
27345 * delegate.cs: If we fail to define a delegate, abort the extra
27348 * expression.cs (Binary.ResolveOperator): for
27349 operator==(object,object) and operator !=(object, object) we also
27350 have to verify that there is an implicit conversion from one to
27353 (ArrayAccess.DoResolve): Array Access can operate on
27356 2002-04-30 Miguel de Icaza <miguel@ximian.com>
27358 * assign.cs (CompoundAssign): A new class used as a "flag" that
27359 the assignment actually is happening as part of a compound
27360 assignment operator.
27362 During compound assignment, a few new rules exist to enable things
27369 x op= y can be evaluated as x = (T) (x op y) (ie, an explicit cast
27370 to the type of x) if y is implicitly convertible to the type of x,
27371 and the operator is a builtin operator and the return type of the
27372 operator is explicitly convertible to the type of x.
27374 * rootcontext.cs: Reset warning level to 2. 4 catches various
27375 "interesting" features in mcs, we must clean this up at some
27376 point, but currently am trying to kill other bugs ;-)
27378 * ecore.cs (SimpleName.SimpleNameResolve): Perform member lookups
27379 in container classes as well.
27381 * expression.cs (Binary.ResolveOperator): Handle string case
27382 before anything else (as operator overloading does emit an error
27383 before doing anything else).
27385 This code could go away when we move to a table driven model, but
27386 i could not come up with a good plan last night.
27388 2002-04-30 Lawrence Pit <loz@cable.a2000.nl>
27390 * typemanager.cs (CSharpName): reimplementation using regex.
27391 * class.cs: added null check for fields in Emit
27392 * rootcontext.cs: set warninglevel to 4
27394 2002-04-29 Miguel de Icaza <miguel@ximian.com>
27396 * typemanager.cs (CSharpName): reimplemented with Lupus
27399 2002-04-28 Miguel de Icaza <miguel@ximian.com>
27401 * statement.cs (If): correclty implement Resolve, because we were
27402 not catching sem errors in there. The same process is needed
27404 (Return, StatementExpression, For, While, Do, Throw, Lock): Implement Resolve
27407 (Statement.Warning_DeadCodeFound): Factorize code.
27408 (While): Report dead code here too.
27410 (Statement): Added Resolve virtual method to allow
27411 for resolution split from the emit code.
27413 2002-04-26 Miguel de Icaza <miguel@ximian.com>
27415 * statement.cs (EmitBoolExpression): No longer try to resolve the
27417 (MakeBoolean): New utility function that resolve, implicitly
27418 converts to boolean and tags the expression.
27421 (If, Do): Implement dead code elimination.
27422 (While): Implement loop inversion
27424 (Do, While, For, If): Resolve the expression prior to calling our
27427 2002-04-22 Lawrence Pit <loz@cable.a2000.nl>
27430 - added method Report28 (warning: program has more than one entry point)
27431 - added method IsEntryPoint, implements paragraph 10.1 of the spec
27432 - modified method Method.Define, the part at the end of the method
27434 * rootcontext.cs: added static public Location EntryPointLocation;
27436 * ../errors/cs0028.cs : Add test case for the above warning.
27439 - modified method CSharpName to allow arrays of primitive type to
27440 be printed nicely (e.g. instead of System.Int32[][] it now prints
27442 - added method CSharpSignature: returns the signature of a method
27443 in string format to be used in reporting errors, warnings, etc.
27445 * support.cs: InternalParameters.ParameterDesc variable tmp initialized
27448 2002-04-26 Ravi Pratap <ravi@ximian.com>
27450 * delegate.cs (Define): Fix extremely silly bug where I was
27451 setting the type of the 'object' parameter of the BeginInvoke
27452 method to System.IAsyncResult instead of System.Object ;-)
27454 2002-04-26 Miguel de Icaza <miguel@ximian.com>
27456 * class.cs (ConstructorInitializer.Resolve): Also use DeclaredOnly
27459 (Constructor.Emit): return if we fail to initialize the
27460 constructor. Another door closed!
27462 * expression.cs (New.DoResolve): Improve error message (from -6 to
27463 1501). Use DeclaredOnly lookup to find the exact constructor.
27465 * typemanager.cs (MemberLookup): If DeclaredOnly is set, do not
27466 loop. This is useful.
27468 * cs-parser.jay: Adjust the default parameters so that destructors
27469 have the proper signature.
27471 2002-04-26 Martin Baulig <martin@gnome.org>
27473 * driver.cs (LoadAssembly): If `assembly' contains any characters
27474 which are only valid in path names and not in assembly names
27475 (currently slash, backslash and point), use Assembly.LoadFrom ()
27476 instead of Assembly.Load () on the `assembly' (before iteration
27477 over the link_paths).
27479 2002-04-26 Martin Baulig <martin@gnome.org>
27481 * cs-tokenizer.cs (is_hex): Correctly handle lowercase chars.
27483 2002-04-25 Miguel de Icaza <miguel@ximian.com>
27485 * class.cs (Property): use the new typemanager.MemberLookup
27487 (TypeContainer.MemberLookup): Implement using the
27488 TypeManager.MemberLookup now.
27490 * typemanager.cs: Make MemberLookup a function of the TypeManager,
27491 and return MemberInfos, so that these can be used without an
27492 EmitContext (what we had before).
27494 2002-04-24 Miguel de Icaza <miguel@ximian.com>
27496 * expression.cs: Fix the case where the argument to params if the
27497 type of the params. I omitted handling this before. Fixed
27499 2002-04-22 Miguel de Icaza <miguel@ximian.com>
27501 * driver.cs: Call BootCorlib_PopulateCoreType
27503 * class.cs (Property.CheckBase): Check for properties only, not
27506 * interface.cs: Temporary hack: try/catch around the
27507 CustomAttributeBuilder, because I am getting an exception that I
27510 * rootcontext.cs (BootCorlib_PopulateCoreType): Populate some
27511 types whose definitions are required to be there (attributes are
27512 defined before standard types).
27514 Compute definitions as we boot the various types, as they are used
27515 immediately (value_type class will need object_type, but if we do
27516 not initialize object_type, we will pass a null, which will let
27517 the runtime pick the System.Object from the existing corlib, which
27518 is not what we want).
27520 2002-04-22 Patrik Torstensson <totte@labs2.com>
27522 * cs-tokenizer.cs: fixed a number of trim() issues.
27524 2002-04-22 Ravi Pratap <ravi@ximian.com>
27526 * expression.cs (Argument.Type): Ensure that we return the correct
27527 type when we have out or ref parameters [in which case we
27530 2002-04-22 Miguel de Icaza <miguel@ximian.com>
27532 * class.cs (Property, Indexer): Allow extern modifier in there.
27534 * typemanager.cs (InitBaseTypes): Initializes object_type and
27535 value_type, since those will be used early on during the bootstrap
27536 process to compile corlib.
27538 (InitCoreTypes): Move code from here to InitBaseTypes.
27540 2002-04-21 Miguel de Icaza <miguel@ximian.com>
27542 * ecore.cs (PropertyExpr): Optimize calls to Array::get_Length on
27543 single-dimension arrays as using the ldlen opcode.
27545 Daniel Lewis discovered this optimization.
27547 * typemanager.cs: Add signature for System.Array::get_Length
27549 2002-04-20 Gonzalo Paniagua Javier <gonzalo@ximian.com>
27551 * statement.cs: report the error when the foreach does not apply to an
27552 array nor a collection.
27554 2002-04-19 Miguel de Icaza <miguel@ximian.com>
27556 * expression.cs: Add implicit conversions to the operator ~.
27558 * constant.cs (DecimalConstant.Emit): Emit decimal value.
27560 * typemanager.cs: Locate the decimal constructor.
27562 2002-04-17 Gonzalo Paniagua Javier <gonzalo@ximian.com>
27564 * attribute.cs: use the new property of TypeOf.
27565 * expression.cs: added 'get' property around typearg.
27567 These changes fix a build breaker reported by NickD. Is this the
27568 correct way to fix? If not, please, revert my changes and make it
27571 2002-04-17 Miguel de Icaza <miguel@ximian.com>
27573 * attribute.cs: Add support for typeof in attribute invocations.
27574 I am not sure that this is right though.
27576 2002-04-14 Duncan Mak <duncan@ximian.com>
27578 * cfold.cs (BinaryFold): Catch DivideByZeroException in the
27579 Binary.Operator.Division case.
27581 2002-04-13 Ravi Pratap <ravi@ximian.com>
27583 * class.cs (DefineType): Ensure that we do a proper check on
27584 attribute types and also register it with the TypeManager.
27586 (TypeContainer.Targets): The default for attribute types is
27587 AttributeTargets.All.
27589 * attribute.cs (ApplyAttributes): Registering the attribute type
27590 is done elsewhere, not when we discover we have a Usage attribute.
27592 2002-04-12 Ravi Pratap <ravi@ximian.com>
27594 * expression.cs (VerifyArgumentsCompat): Implement Miguel's suggestion
27595 and get rid of is_delegate parameter.
27597 * everywhere : update.
27599 2002-04-12 Ravi Pratap <ravi@ximian.com>
27601 * cs-parser.jay (compilation_unit): Revamp completely to use
27602 some new ideas that I got from Rhys' grammar to solve the problems
27603 with assembly level attributes.
27605 (outer_declaration): New grammar production.
27607 (attribute_sections): Add.
27609 (opt_attributes): Base on attribute_sections
27611 (namespace_declaration): Allow opt_attributes to tackle the case
27612 when we have assembly level attributes - we are clever in this
27615 * attribute.cs (ApplyAttributes): Do not worry about assembly
27616 attributes in the non-global context.
27618 * rootcontext.cs (AddGlobalAttributes): Go back to using this
27619 instead of SetGlobalAttributes.
27621 * class.cs, rootcontext.cs : Ensure we define and generate
27622 attribute types before anything else.
27624 * attribute.cs (CheckAttribute and GetValidPlaces): Handle the exception
27625 and flag the new error -20 for the case when the attribute type
27626 does not have valid targets specified. csc does not catch this.
27628 * ../errors/errors.txt : update for error # -20
27630 2002-04-11 Ravi Pratap <ravi@ximian.com>
27632 * support.cs (InternalParameters.ParameterModifier): Do some null
27633 checking and return sane values.
27635 * class.cs (Method.Define): If we are a PInvoke method, ensure
27636 that we are static and extern. Report error # 601
27638 * ../errors/cs0601.cs : Add test case for the above error.
27640 2002-04-07 Ravi Pratap <ravi@ximian.com>
27642 * rootcontext.cs (attribute_types): We need to keep type of
27643 all attribute types separately and emit code for them first.
27645 (RegisterAttribute) : Implement.
27647 * class.cs (DefineType): Check if the current Type is a custom
27648 attribute type and register it accordingly.
27650 * rootcontext.cs (AddGlobalAttributes): Fix silly bug where we were
27651 adding the first attribute twice and rename to
27653 (SetGlobalAttributes): this.
27655 * rootcontext.cs (NamespaceLookup): Run through the aliases too and perform
27658 * attribute.cs (ApplyAttributes): Take an additional argument telling us
27659 if we are processing global arguments. Hmm, I am unsure of this.
27661 2002-04-12 Gonzalo Paniagua Javier <gonzalo@ximian.com>
27663 * expression.cs: added static array of strings to avoid calling
27664 Enum.ToString () for Operator in Binary. Significant recover of
27667 2002-04-10 Miguel de Icaza <miguel@ximian.com>
27669 * class.cs (FindMembers): Allow the Builders of the various
27670 members to be null. If they are skip them. This only happens
27671 during the PInvoke declaration.
27673 2002-04-09 Miguel de Icaza <miguel@ximian.com>
27675 * parameter.cs (Parameters.ComputeParameterTypes): Flag the
27676 failure, so we do not keep going afterwards.
27678 * expression.cs: (Invocation.OverloadResolve): I believe Ravi
27679 wanted to pass `false' as the `is_delegate' argument. If this is
27680 the case, why not use delegate_type == null to mean `is_delegate =
27681 false' and anything else as is_delegate = true.
27683 Tue Apr 9 05:40:12 2002 Piers Haken <piersh@friskit.com>
27685 * statement.cs: fixed SimpleSwitchEmit to make 'goto case' goto the
27686 code for the section, not the beginning of the tests.
27688 2002-04-08 Miguel de Icaza <miguel@ximian.com>
27690 * cfold.cs: Handle operator + (Enum x, Underlying x)
27692 * expression.cs (Binary): same. Warn about errors where we have
27693 Enum/Enum in operator + as well.
27695 Mon Apr 8 06:29:03 2002 Piers Haken <piersh@friskit.com>
27698 - added support for switch(bool)
27699 - optimize loading of I8/U8 constants (ldc.i4, iconv_i8)
27700 - add TableSwitchEmit() to handle table-based switch statements
27702 2002-04-05 Ravi Pratap <ravi@ximian.com>
27704 * expression.cs (Invocation.OverloadResolve): Factor out code which
27705 does parameter compatibility checking with arguments so that we can
27706 re-use the code even from Delegate.VerifyApplicability
27708 (VerifyArgumentsCompat): Move above code here.
27710 * delegate.cs (VerifyApplicability): Get rid of duplicate code
27711 and instead make a call to the above method.
27713 2002-03-31 Ravi Pratap <ravi@ximian.com>
27715 * typemanager.cs (attribute_type): Corresponds to System.Attribute.
27716 We use it to keep track of classes which are attribute types.
27718 2002-04-02 Miguel de Icaza <miguel@ximian.com>
27720 * delegate.cs (Delegate.Define): Correctly define the types in the
27721 presence of fixed and array parameters.
27723 * class.cs (TypeContainers.FindMembers): Use NonPublic flag while
27726 * ecore.cs (Expression.MemberLookup): Reset binding flags to not
27727 include NonPublic after the first iteration.
27729 * class.cs (Indexer.CheckBase): Only check if both parents are
27732 * cs-parser.jay (accessor_body): If empty, set to null.
27734 * ecore.cs (SimpleName.SimpleNameResolve): We did not have the
27735 same code path here to resolve constants names that we did have in
27736 MemberAccess.DoResolve. There is too much code duplicated here.
27738 2002-04-01 Miguel de Icaza <miguel@ximian.com>
27740 * statement.cs, makefile: Drop Statementcollection and just use ArrayLists
27742 * ecore.cs: Optimize UserDefinedConversion by minimizing the calls
27745 * cs-tokenizer.cs: Reuse a single StringBuilder for assembling
27746 tokens, numbers and strings.
27748 * ecore.cs (MethodGroupExpr): Make Emit warn about missing
27751 * delegate.cs: Use ComputeAndDefineParameterTypes for both the
27752 asyncronous parameters and the regular parameters.
27754 * codegen.cs (CodeGen.Init): Use the constructor that allows us to
27755 specify the target directory.
27757 * expression.cs: (This.DoResolve): Simplify
27758 (As.Emit): Optimize, do not generate IsInst if the expression is
27759 always of the given type.
27761 (Is.DoResolve): Bug fix, we were reporting both always/never for
27764 * (Invocation.MakeUnionSet): Simplify vastly and optimize, we were
27765 creating too many unnecessary arrays.
27767 2002-03-31 Miguel de Icaza <miguel@ximian.com>
27769 * class.cs (EmitFieldInitializer): Use Assign expression to assign
27770 fields instead of rolling our own initializer. Takes care of all
27771 implicit conversions, and drops unnecessary static checks/argument.
27773 2002-03-31 Dick Porter <dick@ximian.com>
27775 * driver.cs: use the GetDirectories() return values properly, and
27776 use "/" as path separator.
27778 2002-03-30 Miguel de Icaza <miguel@ximian.com>
27780 * expression.cs (Unary): Optimize - - expr into expr.
27781 (Binary): Optimize a + (-b) into a -b.
27783 * codegen.cs (CodeGen): Made all methods static.
27785 2002-03-29 Miguel de Icaza <miguel@ximian.com>
27789 * decl.cs: Rename `definition' into `TypeBuilder' and drop the
27790 TypeBuilder property.
27792 * cs-parser.jay: Drop the use of RecordXXX and use RecordDecl
27795 * tree.cs: Removed the various RecordXXXX, and replaced with a
27796 single RecordDecl. Removed all the accessor methods, and just
27797 left a single access point Type
27799 * enum.cs: Rename DefineEnum to DefineType.
27801 * decl.cs: New abstract method `DefineType' used to unify the
27802 Defines for Enumerations, Interfaces, TypeContainers and
27805 (FindType): Moved LookupInterfaceOrClass here. Moved the
27806 LookupBaseClasses method that used to live in class.cs and
27807 interface.cs here, and renamed to FindType.
27809 * delegate.cs: Implement DefineType. Take advantage of the
27810 refactored pattern for locating the parent builder without taking
27811 the parent_builder argument (which we know does not work if we are
27812 nested, and triggering a toplevel definition).
27814 2002-03-28 Miguel de Icaza <miguel@ximian.com>
27816 * decl.cs (MemberCore.CheckMethodAgainstBase): Test if the
27817 accessibility of a member has changed during override and report
27820 * class.cs (Method.Define, Property.Define): Only complain on
27821 overrides if the method is private, any other accessibility is
27822 fine (and since we just checked the permission is the same, we are
27825 * cs-tokenizer.cs: only line, region, endregion, if, endif, else
27826 and elif are processed always. The other pre-processing
27827 directives are only processed if we are "taking" the path
27829 2002-03-29 Martin Baulig <martin@gnome.org>
27831 * class.cs (Method.Emit): Only emit symbolic debugging info if the
27832 current location is not Null.
27834 * codegen.cs (CodeGen.SaveSymbols): Split out symbol writing code into
27835 a separate method so we can profile it.
27837 * driver.cs (ShowTime): We need to use `(int) span.TotalSeconds' since
27838 `span.Seconds' are just seconds, but no minutes or hours.
27839 (MainDriver): Profile the CodeGen.SaveSymbols calls.
27841 2002-03-28 Miguel de Icaza <miguel@ximian.com>
27843 * class.cs (Method.Define), (Property.Define), (Indexer.Define):
27844 Remove the gratuitous set of Final:
27846 // If an interface implementation, then we can set Final.
27847 if (((flags & MethodAttributes.Abstract) == 0) &&
27848 implementing.DeclaringType.IsInterface)
27849 flags |= MethodAttributes.Final;
27851 I do not know what I was smoking when I used that.
27854 * cs-parser.jay, delegate.cs: Make Delegate be a DeclSpace, first
27855 step into fixing the name resolution issues for delegates and
27856 unifying the toplevel name resolution.
27858 2002-03-28 Martin Baulig <martin@gnome.org>
27860 * class.cs (Method.Emit): If we have a symbol writer, call its
27861 OpenMethod(), CloseMethod() and SetMethodSourceRange() methods to
27862 tell it about the current method.
27864 * codegen.cs (EmitContext.Mark): New public method. Tell the symbol
27865 writer that we're going to emit the first byte of IL code for a new
27866 statement (a new source line).
27867 (EmitContext.EmitTopBlock): If we have a symbol writer, call
27868 EmitContext.Mark() before emitting any code.
27870 * location.cs (SymbolDocument): Return null when we're Null.
27872 * statement.cs (Statement): Moved the `Location loc' variable here.
27873 (Statement.EmitBoolExpression): If we have a symbol writer, call
27874 ec.Mark() before emitting any code to tell it that we're at the
27875 beginning of a new statement.
27876 (StatementExpression): Added `Location' argument to the constructor.
27877 (Block): Added public readonly variable `StartLocation' and public
27878 variable `EndLocation'. The latter is to be set using SetEndLocation().
27879 (Block): Added constructor which takes a start and end location.
27880 (Block.SetEndLocation): New method. This sets the end location.
27881 (Block.EmitMeta): If we have a symbol writer, tell it the names of the
27882 local variables we create.
27883 (Block.Emit): If we have a symbol writer, call ec.Mark() before emitting
27884 each statement and do also mark the begin and end of the block.
27886 * cs-parser.jay (block : OPEN_BRACE): Use the new `Block' constructor to
27887 tell it the current lexer.Location, use Location.Null for the end of the
27889 (block : OPEN_BRACE opt_statement_list CLOSE_BRACE): When closing the
27890 current block, set its end location using SetEndLocation().
27891 (statement_expression): StatementExpression constructor now takes the
27892 lexer.Location as additional argument.
27893 (for_statement, declare_local_variables): Likewise.
27894 (declare_local_variables): When creating a new implicit block, use the
27895 new Block constructor and pass it the lexer.Location.
27897 2002-03-28 Miguel de Icaza <miguel@ximian.com>
27899 * ecore.cs (Expression.MemberLookup): On interfaces, lookup
27900 members also on the parent interfaces recursively.
27902 2002-03-27 Miguel de Icaza <miguel@ximian.com>
27904 * report.cs: Use new formats, since Gonzalo finished the missing
27907 * expression.cs (Binary.ResolveOperator): added missing operator|
27908 operator& and operator^ for bool/bool.
27910 * cs-parser.jay: CheckDef now takes a Location argument that is
27911 used to report errors more precisly (instead of reporting the end
27912 of a definition, we try to track something which is a lot closer
27913 to the source of the problem).
27915 * cs-tokenizer.cs: Track global token use, so we can properly flag
27916 the use of #define/#undef after the first token has been seen.
27918 Also, rename the reportXXXX to Error_DescriptiveName
27920 * decl.cs (DeclSpace.IsTopLevel): Move property here from
27921 TypeContainer, so that Enum and Interface can use this too.
27923 * class.cs (TypeContainer.LookupInterfaceOrClass,
27924 GetInterfaceOrClass, GetClassBases, DefineType): Drop the
27925 `builder' argument. Typically this was used to pass the parent
27926 builder (a ModuleBuilder or a TypeBuilder from whoever triggered
27929 The problem is that a nested class could trigger the definition of
27930 a toplevel class, and the builder would be obviously wrong in that
27933 So we drop this argument, and we compute dynamically the
27934 TypeBuilder/ModuleBuilder (the correct information was available
27935 to us anyways from DeclSpace.Parent)
27937 * interface.cs (Interface.DefineInterface): Drop builder
27938 parameter cleanup like class.cs
27940 * enum.cs (Enum.DefineEnum): Drop builder parameter. Clean up
27943 * statement.cs (Switch.EmitObjectInteger): Emit short/ushort
27946 (Try.Emit): Propagate the returns value from the statement.
27948 (Return.Emit): Even if we are leavning
27950 * driver.cs: Catch IOExpcetion for Directory.GetFiles as well.
27952 * modifiers.cs: Fix the computation of MethodAttributes flags.
27954 Tue Mar 26 21:14:36 CET 2002 Paolo Molaro <lupus@ximian.com>
27956 * driver.cs: allow compilation of files that start with '/'.
27957 Add a default case when checking the argument of --target.
27959 2002-03-25 Miguel de Icaza <miguel@ximian.com>
27961 * interface.cs: Implement the same search algorithm for types in
27962 the interface code.
27964 * delegate.cs: Do not allow multiple definition.
27966 * Recovered ChangeLog that got accidentally amputated
27968 * interface.cs (Interface.DefineInterface): Prevent from double definitions.
27970 * rootcontext.cs: Load manually enum to allow core classes to
27971 contain enumerations.
27973 * enum.cs, ecore.cs, driver.cs, attribute.cs, class.cs, expression.cs:
27974 Update to new static methods in TypeManager.
27976 * typemanager.cs (GetMethod, GetConstructor): Use our
27977 implementation of FindMembers to find the members, since during
27978 corlib compilation, the types are TypeBuilders and GetMethod and
27979 GetConstructor do not work.
27981 Make all methods in TypeManager static.
27983 (InitCodeHelpers): Split the functionality from
27984 the InitCodeTypes function.
27986 * driver.cs: Call InitCodeHelpers after we have populated the
27989 * cs-parser.jay (delegate_declaration): we did not used to compute
27990 the delegate name correctly for void delegates.
27992 2002-03-24 Miguel de Icaza <miguel@ximian.com>
27994 * rootcontext.cs (RootContext): Init the interface_resolve_order
27995 and type_container_resolve_order always.
27997 (ResolveCore, BootstrapCorlib_ResolveClass,
27998 BootstrapCorlib_ResolveStruct): New functions to bootstrap the
27999 compiler when compiling with --nostdlib
28001 * class.cs (TypeContainer.DefineType): Check that our parent is
28002 not null. This test is most important when we are bootstraping
28005 * codegen.cs: Split out the symbol writing code.
28007 2002-03-25 Martin Baulig <martin@gnome.org>
28009 * driver.cs (-g): Made -g an alias for --debug.
28011 2002-03-24 Martin Baulig <martin@gnome.org>
28013 * codegen.cs (SymbolWriter): New public variable. Returns the
28014 current symbol writer.
28015 (CodeGen): Added `bool want_debugging_support' argument to the
28016 constructor. If true, tell the ModuleBuild that we want debugging
28017 support and ask it for the ISymbolWriter.
28018 (Save): If we have a symbol writer, call it's Close() method after
28019 saving the assembly.
28021 * driver.c (--debug): New command line argument to create a
28022 debugger information file.
28024 * location.cs (SymbolDocument): New public property. Returns an
28025 ISymbolDocumentWriter object for the current source file or null
28026 if we don't have a symbol writer.
28028 2002-03-21 Miguel de Icaza <miguel@ximian.com>
28030 * driver.cs (LoadAssembly): Correctly return when all the paths
28031 have been tried and not before.
28033 * statement.cs (Switch.Emit): return the actual coverage for this
28034 statement (returns/not-returns)
28036 (Switch.SimpleSwitchEmit): Do not generate jumps to the end of the
28037 switch of the statement if we are the last switch section. That
28038 kills two problems: try/catch problems (we used to emit an empty
28039 nop at the end) and switch statements where all branches would
28042 2002-03-19 Miguel de Icaza <miguel@ximian.com>
28044 * driver.cs: Add default assemblies (the equivalent to the
28045 Microsoft CSC.RSP file)
28047 * cs-tokenizer.cs: When updating `cols and setting it to zero,
28048 also update tokens_seen and set it to false.
28050 * driver.cs: Implement --recurse for Mike.
28052 * driver.cs (SplitPathAndPattern): Small bug fix, I was not
28053 correctly splitting out the paths.
28055 2002-03-18 Miguel de Icaza <miguel@ximian.com>
28057 * interface.cs (Interface.PopulateProperty): Instead of using
28058 `parent' as the declaration space for the set parameters, use
28061 * support.cs (InternalParameters): InternalParameters constructor
28062 takes a DeclSpace instead of a TypeContainer.
28064 * expression.cs (ArrayCreation.EmitDynamicInitializers): If value
28065 types are being initialized, load the address of it before calling
28068 (New): Provide a mechanism to disable the generation of local
28069 value type temporaries when the caller will be providing us with
28070 an address to store it.
28072 (ArrayCreation.EmitDynamicInitializers): Use it.
28074 2002-03-17 Miguel de Icaza <miguel@ximian.com>
28076 * expression.cs (Invocation.EmitArguments): Only probe for array
28077 property if there is more than one argument. Sorry about that.
28079 * class.cs (Invocation.EmitArguments): Fix to emit arguments for
28080 empty param arrays.
28082 * class.cs (Method.LabelParameters): Fix incorrect code path that
28083 prevented the `ParamArrayAttribute' from being applied to the
28086 2002-03-16 Miguel de Icaza <miguel@ximian.com>
28088 * support.cs (ReflectionParameters): Correctly compute whether the
28089 last argument is a params array. Fixes the problem with
28092 * typemanager.cs: Make the assemblies array always be non-null
28093 (empty, but non-null)
28095 * tree.cs (RecordDecl): New function that abstracts the recording
28096 of names. This reports error 101, and provides a pointer to the
28097 previous declaration. Fixes a crash in the compiler.
28099 * cs-parser.jay (constructor_declaration): Update to new grammar,
28100 and provide a constructor_body that can be empty.
28102 2002-03-15 Miguel de Icaza <miguel@ximian.com>
28104 * driver.cs: Add support for --resources.
28106 * expression.cs: (FetchGetMethod, FetchAddressMethod, EmitAssign):
28107 Make all types for the various array helper methods be integer.
28109 * ecore.cs (Expression.ConvertNumericExplicit): Pass the
28110 CheckState to ConvCast.
28112 (ConvCast): Now it takes a `checked' state argument, to avoid
28113 depending on the emit context for the conversion, and just using
28114 the resolve time setting.
28116 * expression.cs (ArrayCreation.EmitArrayArguments): New function,
28117 instead of Invocation.EmitArguments. We do not emit the original
28118 arguments, instead we emit those which have been converted to
28119 unsigned int expressions.
28121 * statement.cs (Block.EmitMeta): Drop tracking of indexes.
28123 * codegen.cs: ditto.
28125 * expression.cs (LocalVariableReference): Drop the use of the
28126 Store function that depended on the variable index.
28128 * statement.cs (VariableInfo): Drop the `Idx' property from this
28129 class, as this is not taking into account the indexes for
28130 temporaries tat we generate during the execution, getting the
28133 * class.cs: First emit class initializers, then call the parent
28136 * expression.cs (Binary): Fix opcode emision.
28137 (UnaryMutator.EmitCode): Support checked code generation
28139 * ecore.cs (MemberLookup): TypeManager.FindMembers will return
28140 matches for events for both the Static and Instance scans,
28141 pointing to the same element. Fix that.
28143 2002-03-14 Miguel de Icaza <miguel@ximian.com>
28145 * rootcontext.cs (ResolveTree): Always set the
28146 interface_resolve_order, because nested interfaces will be calling
28149 * class.cs (GetInterfaceOrClass): Track the same resolution
28150 process used by TypeManager.LookupType. This fixes the nested
28151 type lookups in class declarations (separate path from
28154 (TypeContainer.DefineType): Also define nested interfaces.
28155 (TypeContainer.RegisterOrder): New public function used to
28156 register the order in which child interfaces need to be closed.
28158 Nested interfaces need to be closed after their parents have been
28161 * interface.cs (InterfaceAttr): Put all the logic for computing
28162 the interface attribute here.
28164 (DefineInterface): Register our interface order with the
28165 RootContext or with the TypeContainer depending on the case.
28167 2002-03-12 Miguel de Icaza <miguel@ximian.com>
28169 * cs-parser.jay: rework foreach statement to work with the new
28170 changes to the policy on SimpleNames.
28172 * report.cs: support Stacktrace on warnings as well.
28174 * makefile: drop --unsafe and /unsafe from the compile.
28176 2002-03-13 Ravi Pratap <ravi@ximian.com>
28178 * ecore.cs (StandardConversionExists): Modify to take an Expression
28179 as the first parameter. Ensure we do null -> reference type conversion
28182 * Everywhere : update calls accordingly, making use of MyEmptyExpr to store
28183 temporary Expression objects.
28185 Wed Mar 13 12:32:40 CET 2002 Paolo Molaro <lupus@ximian.com>
28187 * interface.cs: workaround bug in method overloading resolution
28188 (there is already a bugzilla bug for it).
28190 2002-03-12 Miguel de Icaza <miguel@ximian.com>
28192 We could also solve this problem by having a separate path for
28193 performing type lookups, instead of DoResolve, we could have a
28194 ResolveType entry point, and only participating pieces of the
28195 production (simplename, deref, array) would implement this.
28197 * codegen.cs (EmitContext): New field OnlyLookupTypes used to
28198 signal SimpleName to only resolve type names and not attempt to
28199 resolve anything else.
28201 * expression.cs (Cast): Set the flag.
28203 * ecore.cs (SimpleName): Use the OnlyLookupTypes flag
28205 * class.cs: Only report 108 if there is no `new' modifier.
28207 * cs-parser.jay: rework foreach statement to work with the new
28208 changes to the policy on SimpleNames.
28210 * report.cs: support Stacktrace on warnings as well.
28212 * makefile: drop --unsafe and /unsafe from the compile.
28214 2002-03-11 Miguel de Icaza <miguel@ximian.com>
28216 * ecore.cs (SimpleName.SimpleNameResolve): Perform local variable
28217 lookups here, instead of doing that at parse time. This means
28218 that our grammar will not introduce `LocalVariableReferences' as
28219 expressions at this point. That solves the problem of code like
28223 static void Main ()
28227 This is only half the fix. The full fix requires parameters to
28228 also be handled in this way.
28230 * Everywhere: Use ec.DeclSpace on calls to LookupType, as this
28231 makes the use more obvious of the DeclSpace. The
28232 ec.TypeContainer.TypeBuilder is now only used to pull the
28233 TypeBuilder for it.
28235 My theory is that I can get rid of the TypeBuilder completely from
28236 the EmitContext, and have typecasts where it is used (from
28237 DeclSpace to where it matters).
28239 The only pending problem is that the code that implements Aliases
28240 is on TypeContainer, and probably should go in DeclSpace.
28242 * ecore.cs (SimpleName.SimpleNameResolve): Perform local variable
28243 lookups here, instead of doing that at parse time. This means
28244 that our grammar will not introduce `LocalVariableReferences' as
28245 expressions at this point. That solves the problem of code like
28249 static void Main ()
28253 This is only half the fix. The full fix requires parameters to
28254 also be handled in this way.
28256 * class.cs (Property.DefineMethod): When implementing an interface
28257 method, set newslot, when implementing an abstract method, do not
28258 set the flag (before we tried never setting it, or always setting
28259 it, which is the difference).
28260 (Indexer.DefineMethod): same.
28261 (Method.DefineMethod): same.
28263 * ecore.cs: Only set the status used flag if we get back a Field.
28265 * attribute.cs: Temporary hack, so Paolo can keep working.
28267 2002-03-08 Ravi Pratap <ravi@ximian.com>
28269 * attribute.cs (Attribute.UnmanagedType): This is to keep track of
28270 the unmanaged type in the case we have a MarshalAs attribute.
28272 (Resolve): Handle the case when we are parsing the special MarshalAs
28273 attribute [we need to store the unmanaged type to use later]
28275 * typemanager.cs (marshal_as_attr_type): Built in type for the
28276 MarshalAs Attribute.
28278 * attribute.cs (ApplyAttributes): Recognize the MarshalAs attribute
28279 on parameters and accordingly set the marshalling info.
28281 2002-03-09 Miguel de Icaza <miguel@ximian.com>
28283 * class.cs: Optimizing slightly by removing redundant code after
28284 we switched to the `NoTypes' return value.
28285 (Property.DefineMethod): use NoTypes here too.
28287 This fixes the bug I introduced in my last batch of changes.
28289 2002-03-05 Ravi Pratap <ravi@ximian.com>
28291 * tree.cs (RecordEnum): Add. We now keep track of enums too.
28293 * class.cs (LookupInterfaceOrClass): Check against the list of recorded
28294 Enums since those are types too.
28296 * cs-parser.jay (enum_declaration): Record enums as we parse them.
28298 * enum.cs (DefineEnum): Return if the TypeBuilder has already been defined
28299 thanks to a call during the lookup process.
28301 2002-03-07 Miguel de Icaza <miguel@ximian.com>
28303 * statement.cs (Foreach): Lots of work to accomodate a particular
28304 kind of foreach statement that I had not kept in mind. It is
28305 possible to have foreachs on classes that provide a GetEnumerator
28306 method that return objects that implement the "pattern" for using
28307 a foreach, there is no need to support GetEnumerator
28310 This is needed to compile nant.
28312 * decl.cs: Only report 114 if the member is not `Finalize' and if
28313 the warning level is at least 2.
28315 * class.cs: Moved the compare function from Method to
28318 (MethodSignature.InheritableMemberSignatureCompare): Add new
28319 filter function that is used to extract inheritable methods from a
28322 (Method.Define): Use the new `inheritable_method_signature_filter'
28325 * cs-tokenizer.cs (get_cmd_arg): Do not add white space to the
28328 2002-03-06 Miguel de Icaza <miguel@ximian.com>
28330 * ecore.cs (Expression.ConvertReferenceExplicit): Removed dead code.
28332 * cs-parser.jay: Add opt_semicolon to the interface declaration.
28334 * expression.cs: Pass location information to
28335 ConvertImplicitStandard.
28337 * class.cs: Added debugging code to track return values from
28340 2002-03-05 Miguel de Icaza <miguel@ximian.com>
28342 * expression.cs (Is.DoResolve): If either side of the `is' is an
28343 interface, do not flag the warning.
28345 * ecore.cs (ImplicitReferenceConversion): We need a separate test
28348 * report.cs: Allow for --fatal to be used with --probe.
28350 * typemanager.cs (NoTypes): Move the definition for the empty Type
28353 * class.cs (TypeContainer.FindMembers): Also look for methods defined by
28355 (TypeContainer.DefineProxy): New function used to proxy to parent
28356 implementations when implementing interfaces.
28357 (TypeContainer.ParentImplements): used to lookup if our parent
28358 implements a public function that is required by an interface.
28359 (TypeContainer.VerifyPendingMethods): Hook this up.
28361 * typemanager.cs (TypeManager, AddModule, AddAssembly): Make the
28362 `modules' and `assemblies' arraylists into arrays. We only grow
28363 these are the very early start up of the program, so this improves
28364 the speedof LookupType (nicely measured).
28366 * expression.cs (MakeByteBlob): Replaced unsafe code with
28367 BitConverter, as suggested by Paolo.
28369 * cfold.cs (ConstantFold.Binary): Special case: perform constant
28370 folding of string concatenation, but if either side is a string,
28371 and the other is not, then return null, and let the runtime use
28372 the concatenation on the string plus the object (using
28373 `Object.ToString').
28375 2002-03-04 Miguel de Icaza <miguel@ximian.com>
28377 Constant Folding has been implemented now.
28379 * expression.cs (Unary.Reduce): Do not throw an exception, catch
28380 the error instead on types that are not supported in one's
28383 * constant.cs (Constant and all children): New set of functions to
28384 perform implict and explicit conversions.
28386 * ecore.cs (EnumConstant): Implement the new functions to perform
28387 conversion by proxying to the child expression.
28389 * codegen.cs: (ConstantCheckState): Constant evaluation has its
28390 own separate setting that can not be turned off from the command
28391 line using --unchecked or --checked and is only controlled using
28392 the checked/unchecked statements and expressions. This setting is
28393 used by the constant folder to flag errors.
28395 * expression.cs (CheckedExpr, UncheckedExpr): Set the
28396 ConstantCheckState as well.
28398 During Resolve, they also have to flag the state, because the
28399 constant folder runs completely in the Resolve phase.
28401 * statement.cs (Checked, Unchecked): Set the ConstantCheckState as
28404 2002-03-01 Miguel de Icaza <miguel@ximian.com>
28406 * cfold.cs: New file, this file contains the constant folder.
28408 * ecore.cs (IMemoryLocation.AddressOf): Now takes an extra
28409 argument to track whether we are using the resulting address to
28410 load or store a value and provide better error messages.
28412 (FieldExpr.Emit, FieldExpr.EmitAssign, FieldExpr.AddressOf): Use
28413 new AddressOf arguments.
28415 * statement.cs (Foreach.EmitCollectionForeach): Update
28417 * expression.cs (Argument.Emit): Call AddressOf with proper
28418 arguments to track usage.
28420 (New.DoEmit): Call AddressOf with new arguments.
28422 (Unary.Emit): Adjust AddressOf call.
28424 2002-03-01 Ravi Pratap <ravi@ximian.com>
28426 * cs-parser.jay (member_access): Change the case for pre-defined types
28427 to use a MemberAccess instead of a SimpleName. Thanks to Felix again for
28430 * class.cs (Operator::Emit): If we are abstract or extern, we don't have
28433 * attribute.cs (CheckAttribute, ApplyAttribute): Ensure that we treat operators
28434 essentially like methods and apply attributes like MethodImplOptions to them too.
28436 * ecore.cs (SimpleName.SimpleNameResolve): Perform a check on ec.TypeContainer.TypeBuilder
28439 * codegen.cs (EmitContext): The constructor now takes in an extra argument specifying the
28440 DeclSpace as the distinction is important. We provide sane defaults as usually the TypeContainer
28443 * Update code everywhere accordingly.
28445 * ecore.cs : Change references to ec.TypeContainer to ec.DeclSpace where appropriate.
28447 * cs-parser.jay (enum_declaration): Set the current namespace of the enum.
28449 2002-02-28 Ravi Pratap <ravi@ximian.com>
28451 * rootcontext.cs (LookupType): As we cycle through the chain of namespaces
28452 try performing lookups against those instead of jumping straight into using
28453 the 'using' clauses.
28455 (ImplicitParent): Add. Thanks to Felix Arrese-Igor for this idea.
28457 (LookupType): Perform lookups in implicit parents too.
28459 * class.cs (GetInterfaceOrClass): Modify to perform the exact same lookup
28460 sequence as RootContext.LookupType.
28462 * rootcontext.cs (NamespaceLookup): Split out code from LookupType which tries
28463 the various cases of namespace lookups into this method.
28465 2002-03-01 Miguel de Icaza <miguel@ximian.com>
28467 * cs-parser.jay: Add support for [Attribute ()] (empty arguments
28468 in positional arguments)
28470 * class.cs (Operator): Update the AllowedModifiers to contain
28473 * cs-parser.jay: Update operator declaration to allow for the
28474 operator body to be empty.
28476 * cs-tokenizer.cs: Added '\u' unicode support in strings and hex
28479 2002-02-27 Miguel de Icaza <miguel@ximian.com>
28481 * class.cs (Method.Emit): Label parameters.
28483 * driver.cs: Return 1 or 0 as the program exit code.
28485 2002-02-26 Miguel de Icaza <miguel@ximian.com>
28487 * expression.cs: Special case the `null' object when trying to
28488 auto-compute the type, as anything can be explicitly converted to
28491 * ecore.cs (Expression.ConvertExplicit): Bug fix, thanks for
28492 spotting this Paolo.
28494 (Expression.ImplicitNumericConversion): Perform comparissions of
28495 the type using the underlying type in the case of an enumeration
28496 rather than using the enumeration type for the compare.
28498 Cope with the underlying == type case, which is not possible to
28501 (Expression.ConvertNumericExplicit): Perform comparissions of
28502 the type using the underlying type in the case of an enumeration
28503 rather than using the enumeration type for the compare.
28505 * driver.cs: If the user does not supply an extension, assume .exe
28507 * cs-parser.jay (if_statement): Rewrote so that we can track the
28508 location for the if statement.
28510 * expression.cs (Binary.ConstantFold): Only concat strings when
28511 the operation is "+", not everything ;-)
28513 * statement.cs (Statement.EmitBoolExpression): Take a location
28515 (If, While, Do): Track location.
28517 * expression.cs (Binary.ResolveOperator): In the object + string
28518 case, I was missing a call to ConvertImplicit
28520 2002-02-25 Ravi Pratap <ravi@ximian.com>
28522 * parameter.cs (Parameter.ExternalType): Take in extra DeclSpace and
28523 Location arguments. Ensure we use RootContext.LookupType to do our work
28524 and not try to do a direct Type.GetType and ModuleBuilder.GetType
28526 * interface.cs (PopulateMethod): Handle the type of the parameter being
28529 * expression.cs (Invocation.BetterFunction): Handle the case when we
28530 have a params method with no fixed arguments and a call is made with no
28533 2002-02-25 Miguel de Icaza <miguel@ximian.com>
28535 * cs-tokenizer.cs: Add support for the quote-escape-sequence in
28536 the verbatim-string-literal
28538 * support.cs (InternalParameters.ParameterModifier): handle null
28540 (InternalParameters.ParameterType): ditto.
28542 * parameter.cs (VerifyArgs): Also check if the fixed parameter is
28543 duplicating the name of the variable parameter.
28544 (GetParameterByName): Fix bug where we were not looking up array
28545 paramters if they were the only present (thanks Paolo!).
28546 (GetParameterInfo): We only have an empty set of types if both
28547 fixed and array are set to null.
28548 (GetParameterInfo-idx): Handle FixedParameter == null
28550 * cs-parser.jay: Handle the case where there is no catch
28551 statements (missing null test).
28553 2002-02-22 Miguel de Icaza <miguel@ximian.com>
28555 * driver.cs (MainDriver): Be conservative on our command line
28558 Catch DirectoryNotFoundException when calling GetFiles.
28560 (SplitPathAndPattern): Used to split the input specification into
28561 a path and a pattern that we can feed to Directory.GetFiles.
28563 2002-02-21 Miguel de Icaza <miguel@ximian.com>
28565 * statement.cs (Fixed): Implement the last case of the Fixed
28566 statement (string handling).
28568 * expression.cs (StringPtr): New class used to return a char * to
28569 a string; Used by the Fixed statement.
28571 * typemanager.cs: Add char_ptr_type. Add get_OffsetToStringData method.
28573 * expression.cs (Binary.ResolveOperator): Remove redundant
28574 MemberLookup pn parent type.
28575 Optimize union call, we do not need a union if the types are the same.
28576 (Unary.ResolveOperator): REmove redundant MemberLookup on parent
28579 Specialize the use of MemberLookup everywhere, instead of using
28580 the default settings.
28582 (StackAlloc): Implement stackalloc keyword.
28584 * cs-parser.jay: Add rule to parse stackalloc.
28586 * driver.cs: Handle /h, /help, /?
28588 * expression.cs (MakeByteBlob): Removed the hacks we had in place
28589 before we supported unsafe code.
28591 * makefile: add --unsafe to the self compilation of mcs.
28593 2002-02-20 Miguel de Icaza <miguel@ximian.com>
28595 * expression.cs (PointerArithmetic): New class that is used to
28596 perform pointer arithmetic.
28597 (Binary.Resolve): Handle pointer arithmetic
28598 Handle pointer comparission.
28599 (ArrayPtr): Utility expression class that is used to take the
28600 address of an array.
28602 (ElementAccess): Implement array access for pointers
28604 * statement.cs (Fixed): Implement fixed statement for arrays, we
28605 are missing one more case before we are done.
28607 * expression.cs (Indirection): Implement EmitAssign and set the
28608 ExprClass to Variable. This allows pointer dereferences to be
28609 treated as variables, and to have values assigned to them.
28611 * ecore.cs (Expression.StoreFromPtr): New utility function to
28612 store values dereferencing.
28614 2002-02-20 Ravi Pratap <ravi@ximian.com>
28616 * expression.cs (Binary.ResolveOperator): Ensure that we are
28617 not trying to operate on a void type - this fixes the reported
28620 * decl.cs (CheckMethodAgainstBase): Do not allow overriding if
28621 the parent implementation is sealed.
28623 * ../errors/cs0239.cs : Add.
28625 * attribute.cs (ApplyAttributes): Handle Modulebuilders too.
28627 * typemanager.cs (unverifiable_code_type): Corresponds to
28628 System.Security.UnverifiableCodeAttribute. We need to emit this for modules
28629 which have unsafe code in them.
28631 * rootcontext.cs (EmitCode): Emit the above attribute when we are in an
28634 2002-02-19 Miguel de Icaza <miguel@ximian.com>
28636 * cs-tokenizer.cs: Add support for @"litreal strings"
28638 Make tokenizer accept pre-processor directives
28639 on any column (remove the old C-like limitation).
28641 * rootcontext.cs (EmitCode): Emit any global attributes.
28642 (AddGlobalAttributes): Used to keep track of assembly attributes.
28644 * attribute.cs (ApplyAttributes): Support AssemblyAttributes.
28646 * cs-parser.jay: Add support for global attributes.
28648 2002-02-17 Miguel de Icaza <miguel@ximian.com>
28650 * expression.cs (Indirection): New helper class. Unary will
28651 create Indirection classes to be able to implement the
28652 IMemoryLocation interface on it.
28654 2002-02-16 Miguel de Icaza <miguel@ximian.com>
28656 * cs-parser.jay (fixed_statement): reference the right statement.
28658 * statement.cs (Fixed.Emit): Finish implementing the fixed
28659 statement for the &x case.
28661 2002-02-14 Miguel de Icaza <miguel@ximian.com>
28663 * class.cs (Property.Define, Method.Define): Remove newslot when
28666 * modifiers.cs: My use of NewSlot when `Abstract' was set was
28667 wrong. NewSlot should only be used if the `new' keyword is present.
28669 * driver.cs (GetSystemDir): Use CodeBase instead of FullName for
28670 locating our system dir. Sorry about this.
28672 2002-02-13 Miguel de Icaza <miguel@ximian.com>
28674 * driver.cs (GetSystemDir): Compute correctly the location of our
28675 system assemblies. I was using the compiler directory instead of
28676 the library directory.
28678 2002-02-13 Ravi Pratap <ravi@ximian.com>
28680 * expression.cs (BetterFunction): Put back in what Miguel commented out
28681 since it is the correct fix. The problem is elsewhere ;-)
28683 (IsParamsMethodApplicable): Fix bug where we were not checking that the fixed
28684 parameters of the parms method are themselves compatible or not !
28686 (StandardConversionExists): Fix very dangerous bug where we were forgetting
28687 to check that a class implements an interface before saying that an implicit
28688 conversion was allowed. Use ImplementsInterface to do the checking.
28690 2002-02-13 Miguel de Icaza <miguel@ximian.com>
28692 * class.cs (Method.Define): Track whether we are an explicit
28693 implementation or not. And only call DefineMethodOverride if we
28694 are an explicit implementation.
28696 (Property.DefineMethod): Ditto.
28698 2002-02-11 Ravi Pratap <ravi@ximian.com>
28700 * expression.cs (BetterFunction): Catch hideous bug which was
28701 preventing us from detecting ambiguous calls due to implicit casts i.e
28704 2002-01-29 Miguel de Icaza <miguel@ximian.com>
28706 * support.cs (Pair): Remove un-needed method. I figured why I was
28707 getting the error in cs-parser.jay, the variable in a foreach loop
28708 is readonly, and the compiler does not really treat this as a variable.
28710 * cs-parser.jay (fixed_statement): Fix grammar. Use ASSIGN
28711 instead of EQUALS in grammar.
28713 * typemanager.cs (VerifyUnmanaged): Report correct error (208)
28715 * expression.cs (Unary.DoResolve): Check whether the argument is
28718 2002-01-28 Miguel de Icaza <miguel@ximian.com>
28720 * support.cs: Api for Pair to set a value. Despite the fact that
28721 the variables are public the MS C# compiler refuses to compile
28722 code that accesses the field if the variable is part of a foreach
28725 * statement.cs (Fixed): Begin implementation of the fixed
28728 (Block.AddVariable): Return the VariableInfo on success and null
28729 on failure instead of true/false.
28731 * cs-parser.jay (foreach): Catch errors on variables already
28732 defined (we were ignoring this value before) and properly unwind
28733 the block hierarchy
28735 (fixed_statement): grammar for the fixed statement.
28737 2002-01-25 Miguel de Icaza <miguel@ximian.com>
28739 * expression.cs (UnaryMutator.IsIncrementableNumber): Allow also
28740 pointer types to be incretemented.
28742 (SizeOf): Implement.
28744 * cs-parser.jay (pointer_member_access): Implement
28745 expr->IDENTIFIER production.
28747 * expression.cs (IndexerAccess.DoResolve, ArrayAccess.DoResolve,
28748 MemberAccess.DoResolve, Invocation.DoResolve): Check for pointers
28751 (Unary): Implement indirection.
28753 * ecore.cs (Expression.UnsafeError): Reports error 214 (pointer
28754 use in non-unsafe context).
28756 (SimpleName.DoResolve): Check for pointers in field access on safe
28759 (Expression.LoadFromPtr): Factor the load-indirect code in this
28760 function. This was duplicated in UnboxCast and ParameterReference
28762 2002-01-24 Miguel de Icaza <miguel@ximian.com>
28764 * expression.cs (ComposedCast): report an error if a pointer cast
28765 is used in a safe region.
28767 * ecore.cs (Expression.ConvertExplicit): Add rules for implicit
28768 pointer type casts in unsafe context.
28770 * codegen.cs (EmitContext): Set up IsUnsafe.
28772 * cs-parser.jay (non_expression_type): Add productions for pointer
28775 * expression.cs (Invocation.EmitCall): Remove chunk of buggy
28776 code. We should not use force into static mode if the method is
28777 not virtual. Fixes bug in MIS
28779 * statement.cs (Do.Emit, While.Emit, For.Emit,
28780 Statement.EmitBoolExpression): Add support to Do and While to
28781 propagate infinite loop as `I do return' semantics.
28783 Improve the For case to also test for boolean constants.
28785 * attribute.cs (Attribute.ApplyAttributes): Add ParameterBuilder
28786 to the list of attributes we can add.
28788 Remove `EmitContext' argument.
28790 * class.cs (Method.Define): Apply parameter attributes.
28791 (Constructor.Define): Apply parameter attributes.
28792 (MethodCore.LabelParameters): Move here the core of labeling
28795 * support.cs (ReflectionParameters.ParameterModifier,
28796 InternalParameters.ParameterModifier): Use IsByRef on the type and
28797 only return the OUT bit for these parameters instead of in/out/ref
28800 This is because I miss-understood things. The ParameterInfo.IsIn
28801 and IsOut represent whether the parameter has the [In] and [Out]
28804 2002-01-22 Miguel de Icaza <miguel@ximian.com>
28806 * ecore.cs (FieldExpr.Emit): Release temporaries.
28808 * assign.cs (LocalTemporary.Release): new function.
28810 * codegen.cs (EmitContext.GetTemporaryStorage,
28811 EmitContext.FreeTemporaryStorage): Rework the way we deal with
28812 temporary storage. Now we can "put back" localbuilders when we
28815 2002-01-21 Miguel de Icaza <miguel@ximian.com>
28817 * ecore.cs (FieldExpr.Emit): Handle initonly fields specially: we
28818 need to make a copy of the variable to generate verifiable code.
28820 2002-01-19 Miguel de Icaza <miguel@ximian.com>
28822 * driver.cs: Compute dynamically the system directory.
28824 * ecore.cs (CopyNewMethods): reworked, exposed, made public.
28825 Slower, but more generally useful. Used by the abstract
28826 registering implementation.
28828 * expression.cs (ResolveMemberAccess): Reorder the way we evaluate
28829 the rules for the special rule on Type/instances. First check if
28830 we have the same name, and if so, try that special static path
28831 rather than the instance path.
28833 2002-01-18 Miguel de Icaza <miguel@ximian.com>
28835 * cs-parser.jay: Emit 642 (warning: possible empty statement) for
28838 * class.cs (TypeBuilder.DefineType): Do not allow inheritance from
28839 Enum, ValueType, Delegate or Array for non-corlib compiles.
28841 * cs-tokenizer.cs: Catch long identifiers (645)
28843 * typemanager.cs (IndexerPropetyName): Ravi never tested this
28846 * class.cs (TypeContainer.RegisterRequiredImplementations): Bug
28847 fix, we were returning too early, so we were not registering
28848 pending methods from abstract classes.
28850 Do not register pending methods if the class is abstract.
28852 * expression.cs (Conditional.DoResolve): Report circular implicit
28853 conversions when we neecd to compute it for conditional
28856 (Is.DoResolve): If the expression is always of the provided type,
28857 flag warning 183. If the expression can not ever be of the
28858 provided type flag warning 184.
28860 * class.cs: Catch 169 as well.
28862 * ecore.cs (FieldExpr): For now in AddressOf mark as assigned and
28865 2002-01-18 Nick Drochak <ndrochak@gol.com>
28867 * makefile: remove path to beta2 csc.exe. path to csc.exe must be in PATH instead.
28869 2002-01-17 Miguel de Icaza <miguel@ximian.com>
28871 * interface.cs: (PopulateMethod): Check for pointers being defined
28872 only if the unsafe context is active.
28873 (PopulateProperty): ditto.
28874 (PopulateIndexer): ditto.
28876 * class.cs (Method, Method.Define): Allow `unsafe' modifier to be
28877 specified. If pointers are present, make sure that they are
28878 present in an unsafe context.
28879 (Constructor, Constructor.Define): ditto.
28880 (Field, Field.Define): ditto.
28881 (Property, Property.Define): ditto.
28882 (Event, Event.Define): ditto.
28884 * interface.cs (Interface.GetInterfaceTypeByName): Only lookup the
28885 hashtable if there are classes or structs defined.
28887 * expression.cs (LocalVariableReference.DoResolve): Simplify this
28888 code, as the constant resolution moved.
28890 * statement.cs (Block.EmitMeta): Resolve all constants as we emit
28891 the metadata, so we can flag error 133.
28893 * decl.cs (MemberCore.UnsafeOK): New function to test that a
28894 pointer is being declared in an unsafe context.
28896 2002-01-16 Miguel de Icaza <miguel@ximian.com>
28898 * modifiers.cs (Modifiers.Check): Require a Location argument.
28899 Report error 227 for Unsafe use.
28901 * typemanager.cs: Remove IsPointerType, we should be using Type.IsPointer
28903 * statement.cs (For.Emit): If the test is null, then report that
28904 we do `return', as we wont reach anything afterwards.
28906 (Switch.SwitchGoverningType): Track the expression that matched
28909 * driver.cs: Allow negative numbers as an error code to flag.
28911 * cs-parser.jay: Handle 1551.
28913 * namespace.cs: Add 1537 checking (repeated using alias namespaces).
28915 2002-01-15 Miguel de Icaza <miguel@ximian.com>
28917 * cs-parser.jay: Report 1518 (type declaration can only contain
28918 class, struct, interface, enum or delegate)
28920 (switch_label): Report 1523 (keywords `case' or `default' must
28923 (opt_switch_sections): Report 1522 (empty switch)
28925 * driver.cs: Report 1515 (response file specified multiple times)
28926 Report 1516 (Source file specified multiple times).
28928 * expression.cs (Argument.Resolve): Signal 1510
28930 (BaseAccess.Resolve, BaseIndexer.Resolve): Signal 1511 (base
28931 access not allowed in static code)
28933 2002-01-11 Ravi Pratap <ravi@ximian.com>
28935 * typemanager.cs (IsPointerType): Utility method which we are going
28938 * ecore.cs (ImplicitReferenceConversion): A pointer type cannot be cast to
28939 the object type, so we take care of that.
28941 * expression.cs (FullMethodDesc): Also include the return type in descriptions.
28943 * support.cs (ParameterDesc): Fix minor bug which was causing params tags to be
28944 added to non-params parameters :-)
28946 * typemanager.cs (CSharpName): Include 'void' type too.
28948 (void_ptr_type): Include in the set of core types.
28950 * ecore.cs (ConvertImplicit): Make use of ConvertImplicitStandard instead of
28953 (ConvertImplicitStandard): Handle standard implicit pointer conversions when we have
28956 * cs-parser.jay (local_variable_pointer_type): Add support for 'void *' as I had
28957 completely forgotten about it.
28959 2002-01-10 Ravi Pratap <ravi@ximian.com>
28961 * cs-parser.jay (pointer_type): Add. This begins our implementation
28962 of parsing rules for unsafe code.
28964 (unsafe_statement): Implement.
28966 (embedded_statement): Modify to include the above.
28968 * statement.cs (Unsafe): Implement new class for unsafe blocks.
28970 * codegen.cs (EmitContext.InUnsafe): Add. This determines
28971 if the current context is an unsafe one.
28973 * cs-parser.jay (local_variable_pointer_type): Since local variable types
28974 are handled differently, we need separate rules for them.
28976 (local_variable_declaration): Update to use local_variable_pointer_type
28977 to allow variable declarations of unmanaged pointer types.
28979 * expression.cs (Unary.ResolveOperator): Ensure that the '&' operator is used only
28980 in unsafe contexts.
28982 * ../errors/cs0214.cs : Add.
28984 2002-01-16 Nick Drochak <ndrochak@gol.com>
28986 * makefile: remove 'response' file when cleaning.
28988 2002-01-15 Miguel de Icaza <miguel@ximian.com>
28990 * cs-parser.jay: Report 1524.
28992 2002-01-14 Miguel de Icaza <miguel@ximian.com>
28994 * typemanager.cs (RegisterMethod): drop checking if we have
28995 registered this from here
28997 2002-01-12 Miguel de Icaza <miguel@ximian.com>
28999 * class.cs (Method.EmitDestructor): Implement calling our base
29002 * statement.cs (Try.Emit): Fix to reset the InFinally to the old
29003 value of InFinally.
29005 * codegen.cs (EmitContext.EmitTopBlock): Destructors will call
29006 this routine and will wrap the call in a try/catch block. Deal
29009 2002-01-11 Miguel de Icaza <miguel@ximian.com>
29011 * ecore.cs (Expression.MemberLookup): instead of taking a
29012 parameter `same_type' that was used to tell whether we could
29013 access private members we compute our containing type from the
29016 (FieldExpr): Added partial support for volatile fields. This does
29017 not work for volatile fields exposed from assemblies, as I can not
29018 figure out how to extract the modreq from it.
29020 Updated all the source files to use this.
29022 * codegen.cs (EmitContext): Compute ContainerType ahead of time,
29023 because it is referenced by MemberLookup very often.
29025 2002-01-09 Ravi Pratap <ravi@ximian.com>
29027 * typemanager.cs (IndexerPropertyName): If we have a TypeBuilder, use
29028 TypeBuilder.GetCustomAttributes to retrieve what we need.
29030 Get rid of redundant default_member_attr_type as this is the same as
29031 default_member_type which already exists.
29033 * interface.cs, attribute.cs : Update accordingly.
29035 2002-01-08 Miguel de Icaza <miguel@ximian.com>
29037 * typemanager.cs: Enable IndexerPropertyName again. It does not
29038 work for TYpeBuilders though. Ravi, can you please fix this?
29040 * cs-tokenizer.cs: Accept _ as a name in pp-expressions.
29042 * expression.cs (Argument.Emit): Handle the case of ref objects
29043 being passed to ref functions;
29045 (ParameterReference.EmitLoad): Loads the content of the pointer
29046 without dereferencing.
29048 2002-01-07 Miguel de Icaza <miguel@ximian.com>
29050 * cs-tokenizer.cs: Implemented the pre-processing expressions.
29052 2002-01-08 Ravi Pratap <ravi@ximian.com>
29054 * class.cs (Indexer.DefineMethod): Incorporate the interface
29055 type in the name of the method if we are doing explicit interface
29058 * expression.cs (ConversionExists): Remove as it is completely obsolete.
29060 (BetterConversion): Fix extremely trivial bug where we were referring to
29061 ConversionExists instead of StandardConversionExists ! Hooray, things are fine
29064 * ../errors/bug16.cs : Add although we have fixed it.
29066 2002-01-07 Miguel de Icaza <miguel@ximian.com>
29068 * expression.cs (BaseIndexer): Begin implementation.
29070 * class.cs (TypeContainer.IsInterfaceMethod): Bug fix.
29072 * cs-parser.jay (indexer_declarator): Use qualified_identifier
29073 production directly to remove a shift/reduce, and implement
29074 explicit interface implementation.
29076 * cs-tokenizer.cs: Fix tokenizer, it was consuming one extra char
29077 after a floating point suffix.
29079 * expression.cs (DoNumericPromotions): Improved the conversion for
29080 uint/uint. If we have a constant, we avoid doing a typecast to a
29083 * class.cs (Indexer): Implement explicit interface implementation
29086 Sat Jan 5 16:08:23 CET 2002 Paolo Molaro <lupus@ximian.com>
29088 * class.cs: make the default instance constructor public and hidebysig.
29090 2001-01-03 Ravi Pratap <ravi@ximian.com>
29092 * interface.cs (EmitDefaultMemberAttr): Make this helper method static
29093 so we can call it from elsewhere.
29095 * class.cs (TypeContainer.Emit): Emit the attribute here too. The rule is that
29096 we emit it internally if the class has a defined indexer; otherwise the user
29097 emits it by decorating the class definition with the DefaultMemberAttribute.
29099 * attribute.cs (ApplyAttributes): Perform checks to see that the DefaultMember
29100 attribute is not used on a type which defines an indexer.
29102 * cs-tokenizer.cs (get_cmd_arg): Ensure we trim whitespace and also include the tab
29103 character when we skip whitespace.
29105 * ../errors/cs0646.cs : Add.
29107 2002-01-03 Miguel de Icaza <miguel@ximian.com>
29109 * ecore.cs (SimpleName.ResolveSimpleName): Report error 120
29112 * makefile: Add practical target `mcs3.exe' which builds the third
29113 generation compiler.
29115 * expression.cs (New): Fix structures constructor calling.
29117 * class.cs (Property, Method, Indexer): Emit Final flag on the
29118 method if we are an interface implementation and we are not
29121 * ecore.cs (PropertyExpr): New public field `IsBase', tells
29122 whether this property is referencing a `base' method.
29124 * expression.cs (Invocation.EmitCall): take an extra argument:
29125 is_base, this is used to determine whether the `call' or
29126 `callvirt' opcode should be used.
29129 * delegate.cs: update EmitCall.
29131 * class.cs (Method.Define): Set NewSlot for the cases where we are
29132 not implementing an interface method.
29134 (Property.Define): ditto.
29136 2002-01-02 Miguel de Icaza <miguel@ximian.com>
29138 * cs-tokenizer.cs: (Tokenizer.escape): Escape '\r' as '\r' not as
29139 'r'. Allows mcs to parse itself fully.
29141 2002-01-02 Ravi Pratap <ravi@ximian.com>
29143 * expression.cs (ArrayCreation.num_automatic_initializers): Keep track
29144 of the number of initializers that require the InitializeArray method.
29146 (CheckIndices): Store the Expression in all cases - not the plain value. Also
29147 update the above field where necessary.
29149 (MakeByteBlob): Update accordingly.
29151 (DoEmit): Call EmitStaticInitializers only if the number of initializers is
29154 (EmitDynamicInitializers): Update in accordance with the new optimization.
29156 (ArrayAccess.EmitStoreOpcode): Include char type along with short and ushort - the
29157 same OpCode applies.
29159 * cs-parser.jay : Fix some glaring errors I introduced.
29161 2002-01-01 Ravi Pratap <ravi@ximian.com>
29163 * parameters.cs (AddVariable, AddConstant): Pass in current_local_parameters
29164 so that we can check for name clashes there too.
29166 * typemanager.cs (default_member_attr_type): The attribute that we need to emit
29167 for interface indexers.
29169 * interfaces.cs (Define): Emit the default member attribute.
29171 * expression.cs (MakeByteBlob): Fix extremely trivial bug where the wrong
29172 variable was being referred to while setting the value ;-)
29174 2002-01-01 Miguel de Icaza <miguel@ximian.com>
29176 * expression.cs (MakeByteBlob): Optimize: we do not need to fill
29177 byte-by-byte information when we know the data is zero.
29179 Make the block always a multiple of 4, because
29180 DefineInitializedData has a bug.
29182 * assign.cs: Fix, we should assign from the temporary, not from
29185 * expression.cs (MakeByteBlob): Fix my incorrect code.
29187 2001-12-31 Miguel de Icaza <miguel@ximian.com>
29189 * typemanager.cs (EnumToUnderlying): This function is used to get
29190 the underlying type from an enumeration, because it does not
29193 * constant.cs: Use the I4_S form for values between -128 and 127.
29195 * statement.cs (Block.LookupLabel): Looks up a label.
29196 (Block): Drop support for labeled blocks.
29198 (LabeledStatement): New kind of statement that represents a label
29201 (Goto): Finally implement this bad boy.
29203 * cs-parser.jay: Update to reflect new mechanism to implement
29206 2001-12-30 Miguel de Icaza <miguel@ximian.com>
29208 * codegen.cs (EmitContext.This): a codegen property that keeps the
29209 a single instance of this instead of creating many different this
29212 * delegate.cs (Delegate.DoResolve): Update to use the property;
29214 * ecore.cs (SimpleName.SimpleNameResolve): Ditto
29216 * expression.cs (BaseAccess.DoResolve): Ditto.
29218 2001-12-29 Ravi Pratap <ravi@ximian.com>
29220 * typemanager.cs (methodimpl_attr_type): Add to hold the type
29221 corresponding to System.Runtime.CompilerServices.MethodImplAttribute.
29223 (InitCoreTypes): Update accordingly.
29225 * attribute.cs (Resolve): Remember if the attribute is a MethodImplAttribute
29226 so we can quickly store the state.
29228 (ApplyAttributes): Set the correct implementation flags
29229 for InternalCall methods.
29231 2001-12-29 Miguel de Icaza <miguel@ximian.com>
29233 * expression.cs (EmitCall): if a method is not virtual, then do
29234 not use callvirt on it.
29236 (ArrayAccess.EmitAssign): storing non-builtin value types (ie,
29237 user defined stuff) requires the use of stobj, which takes an
29238 address on the stack instead of an array and an index. So emit
29239 the Ldelema operation for it.
29241 (EmitStoreOpcode): Use stobj for valuetypes.
29243 (UnaryMutator.EmitCode): Use the right 1 value depending on
29244 whether we are dealing with int64/uint64, float or doubles.
29246 * class.cs (TypeContainer.AddConstructor): Fix the logic to define
29247 constructors that I implemented last night.
29249 (Constructor.IsDefault): Fix to work properly for static
29252 * cs-parser.jay (CheckDef): report method signature errors.
29253 Update error number 103 to be 132.
29255 * decl.cs: New AdditionResult enumeration value: MethodExists.
29256 Although we do this check for methods later on in the semantic
29257 analysis, catching repeated default constructors is so easy that
29258 we catch these here.
29260 * expression.cs (Binary.DoNumericPromotions): Fix the uint64 type
29263 (ParameterReference.EmitAssign, Emit): handle
29266 (ArrayAccess.EmitLoadOpcode): Handle bool type here.
29267 (ArrayAccess.EmitStoreOpcode): ditto.
29269 * cs-tokenizer.cs (is_punct): Eliminated empty computation.
29271 * expression.cs (MakeByteBlob): Complete all the missing types
29272 (uint, short, ushort, byte, sbyte)
29274 * class.cs: Only init instance field initializers on instance
29277 Rename `constructors' to instance_constructors.
29279 (TypeContainer.AddConstructor): Only add constructors to the list
29280 if it is not static.
29282 Make sure that we handle default_static_constructor independently
29283 everywhere where we handle instance_constructors
29285 2001-12-28 Miguel de Icaza <miguel@ximian.com>
29287 * class.cs: Do not lookup or create a base initializer for a
29288 static constructor.
29290 (ConstructorInitializer.Resolve): use the proper type to lookup
29293 * cs-parser.jay: Report error 1585 (modifiers between type and name).
29295 * enum.cs, interface.cs: Remove CloseType, this is taken care by
29298 * decl.cs: CloseType is now an virtual method, the default
29299 implementation just closes this type.
29301 2001-12-28 Ravi Pratap <ravi@ximian.com>
29303 * attribute.cs (DefinePInvokeMethod): Set the implementation flags
29304 to PreserveSig by default. Also emit HideBySig on such methods.
29306 Basically, set the defaults to standard values.
29308 * expression.cs (Invocation.BetterFunction): We need to make sure that for each
29309 argument, if candidate is better, it can't be worse than the best !
29311 (Invocation): Re-write bits to differentiate between methods being
29312 applicable in their expanded form and their normal form - for params
29315 Get rid of use_standard everywhere as only standard conversions are allowed
29316 in overload resolution.
29318 More spec conformance.
29320 2001-12-27 Miguel de Icaza <miguel@ximian.com>
29322 * driver.cs: Add --timestamp, to see where the compiler spends
29325 * ecore.cs (SimpleName.DoResolve): Do not create an implicit
29326 `this' in static code.
29328 (SimpleName.DoResolve): Implement in terms of a helper function
29329 that allows static-references to be passed upstream to
29332 (Expression.ResolveWithSimpleName): Resolve specially simple
29333 names when called by MemberAccess to implement the special
29336 (Expression.ImplicitReferenceConversion): Handle conversions from
29337 Null to reference types before others, as Null's type is
29340 * expression.cs (Invocation.EmitCall): Handle the special case of
29341 calling methods declared on a reference type from a ValueType
29342 (Base classes System.Object and System.Enum)
29344 (MemberAccess.Resolve): Only perform lookups on Enumerations if
29345 the left hand side is a TypeExpr, not on every enumeration.
29347 (Binary.Resolve): If types are reference types, then do a cast to
29348 object on operators != and == of both arguments.
29350 * typemanager.cs (FindMembers): Extract instance and static
29351 members if requested.
29353 * interface.cs (PopulateProperty): Use void_type instead of null
29354 as the return type for the setter method.
29356 (PopulateIndexer): ditto.
29358 2001-12-27 Ravi Pratap <ravi@ximian.com>
29360 * support.cs (ReflectionParameters): Fix minor bug where we
29361 were examining the wrong parameter for the ParamArray attribute.
29363 Cope with requests for the type of the parameter at position
29364 greater than the params parameter's. We now return the element
29365 type of the params array as that makes more sense.
29367 * expression.cs (Invocation.IsParamsMethodApplicable): Update
29368 accordingly as we no longer have to extract the element type
29371 (Invocation.OverloadResolve): Update.
29373 2001-12-27 Miguel de Icaza <miguel@ximian.com>
29375 * statement.cs (Foreach.GetEnumeratorFilter): Do not compare
29376 against IEnumerator, test whether the return value is a descendant
29377 of the IEnumerator interface.
29379 * class.cs (Indexer.Define): Use an auxiliary method to implement
29380 the other bits of the method definition. Begin support for
29381 explicit interface implementation.
29383 (Property.DefineMethod): Use TypeManager.void_type instead of null
29384 for an empty return value.
29386 2001-12-26 Miguel de Icaza <miguel@ximian.com>
29388 * expression.cs (MemberAccess.ResolveMemberAccess): if we are
29389 dealing with a FieldExpr which is composed of a FieldBuilder, in
29390 the code path we did extract the constant, but we should have
29391 obtained the underlying value to be able to cast it (otherwise we
29392 end up in an infinite loop, this is what Ravi was running into).
29394 (ArrayCreation.UpdateIndices): Arrays might be empty.
29396 (MemberAccess.ResolveMemberAccess): Add support for section
29397 14.5.4.1 that deals with the special case of E.I when E is a type
29398 and something else, that I can be a reference to a static member.
29400 (ArrayCreation.MakeByteBlob): It is not an error to not be able to
29401 handle a particular array type to create byte blobs, it is just
29402 something we dont generate byteblobs for.
29404 * cs-tokenizer.cs (get_cmd_arg): Ignore \r in commands and
29407 * location.cs (Push): remove the key from the hashtable that we
29408 are about to add. This happens for empty files.
29410 * driver.cs: Dispose files after we have parsed them.
29412 (tokenize): new function that only runs the tokenizer on its
29413 input, for speed testing.
29415 2001-12-26 Ravi Pratap <ravi@ximian.com>
29417 * class.cs (Event.Define): Define the private field only if there
29418 are no accessors defined.
29420 * expression.cs (ResolveMemberAccess): If there is no associated
29421 field with the event, that means we have an event defined with its
29422 own accessors and we should flag error cs0070 since transforming
29423 ourselves into a field is not valid in that case.
29425 * ecore.cs (SimpleName.DoResolve): Same as above.
29427 * attribute.cs (DefinePInvokeMethod): Set the default calling convention
29428 and charset to sane values.
29430 2001-12-25 Ravi Pratap <ravi@ximian.com>
29432 * assign.cs (DoResolve): Perform check on events only if they
29433 are being accessed outside the declaring type.
29435 * cs-parser.jay (event_declarations): Update rules to correctly
29436 set the type of the implicit parameter etc.
29438 (add_accessor, remove_accessor): Set current local parameters.
29440 * expression.cs (Binary): For delegate addition and subtraction,
29441 cast the return value from the method into the appropriate delegate
29444 2001-12-24 Ravi Pratap <ravi@ximian.com>
29446 * typemanager.cs (RegisterDelegateData, GetDelegateData): Get rid
29447 of these as the workaround is unnecessary.
29449 * delegate.cs (NewDelegate.DoResolve): Get rid of bits which registered
29450 delegate data - none of that is needed at all.
29452 Re-write bits to extract the instance expression and the delegate method
29455 * expression.cs (Binary.ResolveOperator): Handle the '-' binary operator
29458 * attribute.cs (ApplyAttributes): New method to take care of common tasks
29459 of attaching attributes instead of duplicating code everywhere.
29461 * everywhere : Update code to do attribute emission using the above method.
29463 2001-12-23 Miguel de Icaza <miguel@ximian.com>
29465 * expression.cs (IsParamsMethodApplicable): if there are not
29466 parameters, return immediately.
29468 * ecore.cs: The 0 literal can be implicity converted to an enum
29471 (SimpleName.DoResolve): First lookup the type, then lookup the
29474 (FieldExpr.Emit): If the InstanceExpression is a ValueType, we
29475 want to get its address. If the InstanceExpression is not
29476 addressable, store the result in a temporary variable, then get
29479 * codegen.cs: Only display 219 errors on warning level or above.
29481 * expression.cs (ArrayAccess): Make it implement the
29482 IMemoryLocation interface.
29484 (Binary.DoResolve): handle the operator == (object a, object b)
29485 and operator != (object a, object b) without incurring into a
29486 BoxedCast (because 5 != o should never be performed).
29488 Handle binary enumerator operators.
29490 (EmitLoadOpcode): Use Ldelema if the object we are loading is a
29491 value type, otherwise use Ldelem_ref.
29493 Use precomputed names;
29495 (AddressOf): Implement address of
29497 * cs-parser.jay (labeled_statement): Fix recursive block
29498 addition by reworking the production.
29500 * expression.cs (New.DoEmit): New has a special case:
29502 If we are dealing with a ValueType, we have a few
29503 situations to deal with:
29505 * The target of New is a ValueType variable, that is
29506 easy, we just pass this as the variable reference
29508 * The target of New is being passed as an argument,
29509 to a boxing operation or a function that takes a
29512 In this case, we need to create a temporary variable
29513 that is the argument of New.
29516 2001-12-23 Ravi Pratap <ravi@ximian.com>
29518 * rootcontext.cs (LookupType): Check that current_type is not null before
29519 going about looking at nested types.
29521 * ecore.cs (EventExpr.EmitAddOrRemove): Rename from EmitAssign as we do
29522 not implement the IAssignMethod interface any more.
29524 * expression.cs (MemberAccess.ResolveMemberAccess): Handle EventExprs specially
29525 where we tranform them into FieldExprs if they are being resolved from within
29526 the declaring type.
29528 * ecore.cs (SimpleName.DoResolve): Do the same here.
29530 * assign.cs (DoResolve, Emit): Clean up code considerably.
29532 * ../errors/bug10.cs : Add.
29534 * ../errors/cs0070.cs : Add.
29536 * typemanager.cs : Use PtrHashtable for Delegate data hashtable etc.
29538 * assign.cs : Get rid of EventIsLocal everywhere.
29540 2001-12-23 Miguel de Icaza <miguel@ximian.com>
29542 * ecore.cs (ConvertIntLiteral): finished the implementation.
29544 * statement.cs (SwitchLabel): Convert the value we are using as a
29545 key before looking up the table.
29547 2001-12-22 Miguel de Icaza <miguel@ximian.com>
29549 * codegen.cs (EmitTopBlock): Require a Location argument now.
29551 * cs-parser.jay (constructor_declarator): We need to setup
29552 current_local_parameters before we parse the
29553 opt_constructor_initializer, to allow the variables to be bound
29554 to the constructor arguments.
29556 * rootcontext.cs (LookupType): First lookup nested classes in our
29557 class and our parents before we go looking outside our class.
29559 * expression.cs (ConstantFold): Extract/debox the values at the
29562 * rootcontext.cs (EmitCode): Resolve the constants first before we
29563 resolve the types. This is not really needed, but it helps debugging.
29565 * statement.cs: report location.
29567 * cs-parser.jay: pass location to throw statement.
29569 * driver.cs: Small bug fix.
29571 * report.cs: Updated format to be 4-zero filled digits.
29573 2001-12-22 Ravi Pratap <ravi@ximian.com>
29575 * expression.cs (CheckIndices): Fix minor bug where the wrong
29576 variable was being referred to ;-)
29578 (DoEmit): Do not call EmitStaticInitializers when the
29579 underlying type is System.Object.
29581 2001-12-21 Ravi Pratap <ravi@ximian.com>
29583 * ecore.cs (EventExpr.Resolve): Implement to correctly set the type
29584 and do the usual workaround for SRE.
29586 * class.cs (MyEventBuilder.EventType): New member to get at the type
29587 of the event, quickly.
29589 * expression.cs (Binary.ResolveOperator): Handle delegate addition.
29591 * assign.cs (Assign.DoResolve): Handle the case when the target
29592 is an EventExpr and perform the necessary checks.
29594 * ecore.cs (EventExpr.EmitAssign): Implement the IAssignMethod
29597 (SimpleName.MemberStaticCheck): Include check for EventExpr.
29599 (EventExpr): Set the type in the constructor itself since we
29600 are meant to be born fully resolved.
29602 (EventExpr.Define): Revert code I wrote earlier.
29604 * delegate.cs (NewDelegate.Resolve): Handle the case when the MethodGroup's
29605 instance expression is null. The instance expression is a This in that case
29606 or a null, depending on whether it is a static method or not.
29608 Also flag an error if the reference to a method is ambiguous i.e the MethodGroupExpr
29609 refers to more than one method.
29611 * assign.cs (DoResolve): Check whether the event belongs to the same Type container
29612 and accordingly flag errors.
29614 2001-12-21 Miguel de Icaza <miguel@ximian.com>
29616 * statement.cs (Throw.Emit): Add support for re-throwing exceptions.
29618 2001-12-22 Miguel de Icaza <miguel@ximian.com>
29620 * location.cs (ToString): Provide useful rutine.
29622 2001-12-21 Miguel de Icaza <miguel@ximian.com>
29624 * ecore.cs (Expression.ConvertIntLiteral): Do not return Constant
29625 objects, return the actual integral boxed.
29627 * statement.cs (SwitchLabel): define an ILLabel for each
29630 (Switch.CheckSwitch): If the value is a Literal, extract
29631 the underlying literal.
29633 Also in the unused hashtable we had, add the SwitchLabel so we can
29634 quickly look this value up.
29636 * constant.cs: Implement a bunch of new constants. Rewrite
29637 Literal based on this. Made changes everywhere to adapt to this.
29639 * expression.cs (Expression.MakeByteBlob): Optimize routine by
29640 dereferencing array only once, and also copes with enumrations.
29642 bytes are two bytes wide, not one.
29644 (Cast): Perform constant conversions.
29646 * ecore.cs (TryImplicitIntConversion): Return literals instead of
29647 wrappers to the literals here.
29649 * expression.cs (DoNumericPromotions): long literals can converted
29650 to ulong implicity (this is taken care of elsewhere, but I was
29651 missing this spot).
29653 * ecore.cs (Expression.Literalize): Make the return type Literal,
29654 to improve type checking.
29656 * rootcontext.cs: Lookup for nested classes in our class hierarchy.
29658 2001-12-20 Miguel de Icaza <miguel@ximian.com>
29660 * literal.cs: Revert code from ravi that checked the bounds. The
29661 bounds are sane by the definition of the type itself.
29663 * typemanager.cs: Fix implementation of ImplementsInterface. We
29664 need to actually look up in our parent hierarchy for interfaces
29667 * const.cs: Use the underlying type for enumerations
29669 * delegate.cs: Compute the basename for the delegate creation,
29670 that should fix the delegate test case, and restore the correct
29671 Type Lookup semantics in rootcontext
29673 * rootcontext.cs: Revert Ravi's last patch. The correct way of
29674 referencing a nested type with the Reflection API is using the "+"
29677 * cs-parser.jay: Do not require EOF token at the end.
29679 2001-12-20 Ravi Pratap <ravi@ximian.com>
29681 * rootcontext.cs (LookupType): Concatenate type names with
29682 a '.' instead of a '+' The test suite passes again.
29684 * enum.cs (Enum.DefineEnum): Set RTSpecialName on the 'value__'
29685 field of the enumeration.
29687 * expression.cs (MemberAccess.ResolveMemberAccess): Add support for
29688 the case when the member is an EventExpr.
29690 * ecore.cs (EventExpr.InstanceExpression): Every event which is not
29691 static has an associated instance expression.
29693 * typemanager.cs (RegisterEvent): The usual workaround, now for events.
29695 (GetAddMethod, GetRemoveMethod): Workarounds, as usual.
29697 * class.cs (Event.Define): Register event and perform appropriate checks
29700 We define the Add and Remove methods even if the use provides none because
29701 in that case, we provide default implementations ourselves.
29703 Define a private field of the type of the event. This is done by the CSC compiler
29704 and we should be doing it too ;-)
29706 * typemanager.cs (delegate_combine_delegate_delegate, delegate_remove_delegate_delegate):
29707 More methods we use in code we generate.
29709 (multicast_delegate_type, delegate_type): Two separate types since the distinction
29712 (InitCoreTypes): Update accordingly for the above.
29714 * class.cs (Event.Emit): Generate code for default accessors that we provide
29716 (EmitDefaultMethod): Do the job in the above.
29718 * delegate.cs (DefineDelegate): Use TypeManager.multicast_delegate_type in the
29721 2001-12-20 Miguel de Icaza <miguel@ximian.com>
29723 * class.cs (Indexer.Define): Fix bug, we were setting both Get/Set
29724 builders even if we were missing one.
29726 * interface.cs, class.cs, enum.cs: When calling DefineNestedType
29727 pass the Basename as our class name instead of the Name. The
29728 basename will be correctly composed for us.
29730 * parameter.cs (Paramters): Now takes a Location argument.
29732 * decl.cs (DeclSpace.LookupType): Removed convenience function and
29733 make all the code call directly LookupType in RootContext and take
29734 this chance to pass the Location information everywhere.
29736 * Everywhere: pass Location information.
29738 2001-12-19 Miguel de Icaza <miguel@ximian.com>
29740 * class.cs (Constructor.Define): Updated way of detecting the
29741 length of the parameters.
29743 (TypeContainer.DefineType): Use basename as the type name for
29746 (TypeContainer.Define): Do not recursively define types here, as
29747 definition is taken care in order by the RootContext.
29749 * tree.cs: Keep track of namespaces in a per-file basis.
29751 * parameter.cs (Parameter.ComputeSignature): Update to use
29754 (Parameters.GetSignature): ditto.
29756 * interface.cs (InterfaceMethod.GetSignature): Take a DeclSpace
29757 instead of a TypeContainer.
29759 (Interface.SemanticAnalysis): Use `this' instead of our parent to
29760 resolve names. Because we need to be resolve in our context, not
29763 * driver.cs: Implement response files.
29765 * class.cs (TypeContainer.DefineType): If we are defined, do not
29766 redefine ourselves.
29768 (Event.Emit): Emit the code for add/remove handlers.
29769 (Event.Define): Save the MethodBuilders for add/remove.
29771 * typemanager.cs: Use pair here too.
29773 * cs-parser.jay: Replaced use of DictionaryEntry for Pair because
29774 DictionaryEntry requires the first argument to be non-null.
29776 (enum_declaration): Compute full name for registering the
29779 (delegate_declaration): Instead of using
29780 formal_parameter_list, use opt_formal_parameter_list as the list
29783 * cs-tokenizer.cs (PropertyParsing): renamed from `properties'
29784 (EventParsing): New property that controls whether `add' and
29785 `remove' are returned as tokens or identifiers (for events);
29787 2001-12-19 Ravi Pratap <ravi@ximian.com>
29789 * class.cs (Event.Define): Revamp use of EventBuilder completely. We now
29790 use MyEventBuilder only and let it wrap the real builder for us.
29792 (MyEventBuilder): Revamp constructor etc.
29794 Implement all operations that we perform on EventBuilder in precisely the same
29797 (FindMembers): Update to use the EventBuilder member.
29799 (Event.Emit): Update accordingly.
29801 2001-12-18 Ravi Pratap <ravi@ximian.com>
29803 * class.cs (MyEventBuilder.Set*): Chain to the underlying builder
29804 by calling the appropriate methods.
29806 (GetCustomAttributes): Make stubs as they cannot possibly do anything
29809 (Event.Emit): Use MyEventBuilder everywhere - even to set attributes.
29811 2001-12-17 Ravi Pratap <ravi@ximian.com>
29813 * delegate.cs (Delegate.Populate): Check that the return type
29814 and various parameters types are indeed accessible.
29816 * class.cs (Constructor.Define): Same here.
29818 (Field.Define): Ditto.
29820 (Event.Define): Ditto.
29822 (Operator.Define): Check that the underlying Method defined itself
29823 correctly - so it's MethodBuilder should not be null.
29825 * delegate.cs (DelegateInvocation.DoResolve): Bale out if the type of the Instance
29826 expression happens to be null.
29828 * class.cs (MyEventBuilder): Workaround for SRE lameness. Implement various abstract
29829 members but as of now we don't seem to be able to do anything really useful with it.
29831 (FindMembers): Handle events separately by returning the MyEventBuilder of the event,
29832 not the EventBuilder.
29834 2001-12-18 Miguel de Icaza <miguel@ximian.com>
29836 * cs-tokenizer.cs: Add support for defines.
29837 Add support for #if, #elif, #else, #endif
29839 (eval_var): evaluates a variable.
29840 (eval): stubbed for evaluating functions.
29842 * cs-parser.jay: Pass the defines information
29844 * driver.cs: Add --define command line option.
29846 * decl.cs: Move MemberCore here.
29848 Make it the base class for DeclSpace. This allows us to catch and
29849 report 108 and 109 for everything now.
29851 * class.cs (TypeContainer.Define): Extract all the members
29852 before populating and emit the warning 108 (new keyword required
29853 to override) instead of having each member implement this.
29855 (MemberCore.Define): New abstract method, we will be using this in
29856 the warning reporting engine in Populate.
29858 (Operator.Define): Adjust to new MemberCore protocol.
29860 * const.cs (Const): This does not derive from Expression, it is a
29861 temporary object we use to create fields, it is a MemberCore.
29863 * class.cs (Method.Define): Allow the entry point to be in a
29866 * driver.cs: Rewrite the argument handler to clean it up a bit.
29868 * rootcontext.cs: Made it just an auxiliary namespace feature by
29869 making everything static.
29871 * driver.cs: Adapt code to use RootContext type name instead of
29874 * delegate.cs: Remove RootContext argument.
29876 * class.cs: (Struct, TypeContainer, Class): Remove RootContext
29879 * class.cs (Event.Define): The lookup can fail.
29881 * cs-tokenizer.cs: Begin implementation of pre-procesor.
29883 * expression.cs: Resolve the this instance before invoking the code.
29885 2001-12-17 Miguel de Icaza <miguel@ximian.com>
29887 * cs-parser.jay: Add a production in element_access that allows
29888 the thing to become a "type" reference. This way we can parse
29889 things like "(string [])" as a type.
29891 Note that this still does not handle the more complex rules of
29895 * delegate.cs (Delegate.Populate): Register the delegage constructor builder here.
29897 * ecore.cs: (CopyNewMethods): new utility function used to
29898 assemble the list of methods from running FindMembers.
29900 (MemberLookup): Rework FindMembers so that
29902 2001-12-16 Miguel de Icaza <miguel@ximian.com>
29904 * class.cs (TypeContainer): Remove Delegates who fail to be
29907 * delegate.cs (Populate): Verify that we dont get null return
29908 values. TODO: Check for AsAccessible.
29910 * cs-parser.jay: Use basename to emit error 574 (destructor should
29911 have the same name as container class), not the full name.
29913 * cs-tokenizer.cs (adjust_int): Fit the integer in the best
29914 possible representation.
29916 Also implements integer type suffixes U and L.
29918 2001-12-15 Miguel de Icaza <miguel@ximian.com>
29920 * expression.cs (ArrayCreation.DoResolve): We need to do the
29921 argument resolution *always*.
29923 * decl.cs: Make this hold the namespace. Hold the root context as
29925 (LookupType): Move here.
29927 * enum.cs, class.cs, interface.cs: Adapt to new hierarchy.
29929 * location.cs (Row, Name): Fixed the code, it was always returning
29930 references to the first file.
29932 * interface.cs: Register properties defined through interfaces.
29934 * driver.cs: Add support for globbing on the command line
29936 * class.cs (Field): Make it derive from MemberCore as well.
29939 2001-12-15 Ravi Pratap <ravi@ximian.com>
29941 * class.cs (Event::Define): Check that the type of the event is a delegate
29942 type else flag error #66.
29944 Also, re-use TypeContainer.MethodModifiersValid here too as the rules are the
29947 * attribute.cs (DefinePInvokeMethod): Handle named arguments and process
29948 values of EntryPoint, CharSet etc etc.
29950 Pass in the values to TypeBuilder.DefinePInvokeMethod; determine Type etc neatly.
29952 * class.cs (FindMembers): If a method is in transit, its MethodBuilder will
29953 be null and we should ignore this. I am not sure if this is really clean. Apparently,
29954 there's no way of avoiding hitting this because the call is coming from SimpleName.DoResolve,
29955 which needs this to do its work.
29957 * ../errors/cs0066.cs : Add.
29959 2001-12-14 Miguel de Icaza <miguel@ximian.com>
29961 * typemanager.cs: (GetPropertyGetter, GetPropertyGetter): New
29964 * class.cs: (MethodSignature.MethodSignature): Removed hack that
29965 clears out the parameters field.
29966 (MemberSignatureCompare): Cleanup
29968 (MemberCore): New base class used to share code between MethodCore
29971 (RegisterRequiredImplementations) BindingFlags.Public requires
29972 either BindingFlags.Instace or Static. Use instance here.
29974 (Property): Refactored code to cope better with the full spec.
29976 * parameter.cs (GetParameterInfo): Return an empty array instead
29979 * class.cs (Property): Abstract or extern properties have no bodies.
29981 * parameter.cs (GetParameterInfo): return a zero-sized array.
29983 * class.cs (TypeContainer.MethodModifiersValid): Move all the
29984 method modifier validation to the typecontainer so we can reuse
29985 this on properties.
29987 (MethodCore.ParameterTypes): return an empty sized array of types.
29989 (Property.Define): Test property modifier validity.
29991 Add tests for sealed/override too.
29993 (Method.Emit): abstract or extern methods have no bodies.
29995 2001-12-14 Ravi Pratap <ravi@ximian.com>
29997 * class.cs (Method.IsPInvoke): Get rid of it as it is an expensive
30000 (Method::Define, ::Emit): Modify accordingly.
30002 * expression.cs (Invocation::OverloadResolve): Handle error # 121.
30004 (ArrayCreation::MakeByteBlob): Handle floats and doubles.
30006 * makefile: Pass in /unsafe.
30008 2001-12-13 Miguel de Icaza <miguel@ximian.com>
30010 * class.cs (MakeKey): Kill routine.
30012 * class.cs (TypeContainer.Define): Correctly define explicit
30013 method implementations (they require the full interface name plus
30016 * typemanager.cs: Deply the PtrHashtable here and stop using the
30017 lame keys. Things work so much better.
30019 This of course broke everyone who depended on `RegisterMethod' to
30020 do the `test for existance' test. This has to be done elsewhere.
30022 * support.cs (PtrHashtable): A hashtable that avoid comparing with
30023 the object stupid Equals method (because, that like fails all over
30024 the place). We still do not use it.
30026 * class.cs (TypeContainer.SetRequiredInterface,
30027 TypeContainer.RequireMethods): Killed these two routines and moved
30028 all the functionality to RegisterRequiredImplementations.
30030 (TypeContainer.RegisterRequiredImplementations): This routine now
30031 registers all the implementations required in an array for the
30032 interfaces and abstract methods. We use an array of structures
30033 which can be computed ahead of time to reduce memory usage and we
30034 also assume that lookups are cheap as most classes will not
30035 implement too many interfaces.
30037 We also avoid creating too many MethodSignatures.
30039 (TypeContainer.IsInterfaceMethod): Update and optionally does not
30040 clear the "pending" bit if we find that there are problems with
30043 (TypeContainer.VerifyPendingMethods): Update to report errors of
30044 methods that look like implementations but are not.
30046 (TypeContainer.Define): Add support for explicit interface method
30049 2001-12-12 Miguel de Icaza <miguel@ximian.com>
30051 * typemanager.cs: Keep track of the parameters here instead of
30052 being a feature of the TypeContainer.
30054 * class.cs: Drop the registration of parameters here, as
30055 InterfaceMethods are also interface declarations.
30057 * delegate.cs: Register methods with the TypeManager not only with
30058 the TypeContainer. This code was buggy.
30060 * interface.cs: Full registation here.
30062 2001-12-11 Miguel de Icaza <miguel@ximian.com>
30064 * expression.cs: Remove reducer for binary expressions, it can not
30067 * const.cs: Put here the code that used to go into constant.cs
30069 * constant.cs: Put here the code for constants, this is a new base
30070 class for Literals.
30072 * literal.cs: Make Literal derive from Constant.
30074 2001-12-09 Miguel de Icaza <miguel@ximian.com>
30076 * statement.cs (Return.Emit): Report error 157 if the user
30077 attempts to return from a finally block.
30079 (Return.Emit): Instead of emitting a return, jump to the end of
30082 * codegen.cs (EmitContext): ReturnValue, ReturnLabel: new
30083 LocalBuilder to store the result of the function. ReturnLabel is
30084 the target where we jump.
30087 2001-12-09 Radek Doulik <rodo@ximian.com>
30089 * cs-parser.jay: remember alias in current namespace
30091 * ecore.cs (SimpleName::DoResolve): use aliases for types or
30094 * class.cs (LookupAlias): lookup alias in my_namespace
30096 * namespace.cs (UsingAlias): add alias, namespace_or_type pair to
30098 (LookupAlias): lookup alias in this and if needed in parent
30101 2001-12-08 Miguel de Icaza <miguel@ximian.com>
30105 * rootcontext.cs: (ModuleBuilder) Made static, first step into
30106 making things static. I need this to avoid passing the
30107 TypeContainer when calling ParameterType.
30109 * support.cs (InternalParameters.ParameterType): Remove ugly hack
30110 that did string manipulation to compute the type and then call
30111 GetType. Use Parameter.ParameterType instead.
30113 * cs-tokenizer.cs: Consume the suffix for floating values.
30115 * expression.cs (ParameterReference): figure out whether this is a
30116 reference parameter or not. Kill an extra variable by computing
30117 the arg_idx during emission.
30119 * parameter.cs (Parameters.GetParameterInfo): New overloaded
30120 function that returns whether a parameter is an out/ref value or not.
30122 (Parameter.ParameterType): The type of the parameter (base,
30123 without ref/out applied).
30125 (Parameter.Resolve): Perform resolution here.
30126 (Parameter.ExternalType): The full type (with ref/out applied).
30128 * statement.cs (Using.Emit, Using.EmitExpression): Implement
30129 support for expressions on the using statement.
30131 2001-12-07 Miguel de Icaza <miguel@ximian.com>
30133 * statement.cs (Using.EmitLocalVariableDecls): Split the
30134 localvariable handling of the using statement.
30136 (Block.EmitMeta): Keep track of variable count across blocks. We
30137 were reusing slots on separate branches of blocks.
30139 (Try.Emit): Emit the general code block, we were not emitting it.
30141 Check the type of the declaration to be an IDisposable or
30142 something that can be implicity converted to it.
30144 Emit conversions if required.
30146 * ecore.cs (EmptyExpression): New utility class.
30147 (Expression.ImplicitConversionExists): New utility function.
30149 2001-12-06 Miguel de Icaza <miguel@ximian.com>
30151 * statement.cs (Using): Implement.
30153 * expression.cs (LocalVariableReference): Support read only variables.
30155 * statement.cs: Remove the explicit emit for the Leave opcode.
30156 (VariableInfo): Add a readonly field.
30158 2001-12-05 Miguel de Icaza <miguel@ximian.com>
30160 * ecore.cs (ConvCast): new class used to encapsulate the various
30161 explicit integer conversions that works in both checked and
30162 unchecked contexts.
30164 (Expression.ConvertNumericExplicit): Use new ConvCast class to
30165 properly generate the overflow opcodes.
30167 2001-12-04 Miguel de Icaza <miguel@ximian.com>
30169 * statement.cs: The correct type for the EmptyExpression is the
30170 element_type, not the variable type. Ravi pointed this out.
30172 2001-12-04 Ravi Pratap <ravi@ximian.com>
30174 * class.cs (Method::Define): Handle PInvoke methods specially
30175 by using DefinePInvokeMethod instead of the usual one.
30177 * attribute.cs (DefinePInvokeMethod): Implement as this is what is called
30178 above to do the task of extracting information and defining the method.
30180 2001-12-04 Ravi Pratap <ravi@ximian.com>
30182 * expression.cs (ArrayCreation::EmitStaticInitializers): Get rid
30183 of the condition for string type.
30185 (Emit): Move that here.
30187 (ArrayCreation::CheckIndices): Keep string literals in their expression
30190 (EmitDynamicInitializers): Handle strings appropriately.
30192 2001-12-04 Miguel de Icaza <miguel@ximian.com>
30194 * codegen.cs (EmitContext): Replace multiple variables with a
30195 single pointer to the current Switch statement.
30197 * statement.cs (GotoDefault, Switch): Adjust to cleaned up
30200 2001-12-03 Miguel de Icaza <miguel@ximian.com>
30204 * statement.cs (GotoDefault), cs-parser.jay: Implement `goto
30207 (Foreach.Emit): Foreach on arrays was not setting
30208 up the loop variables (for break/continue).
30210 (GotoCase): Semi-implented.
30212 2001-12-03 Ravi Pratap <ravi@ximian.com>
30214 * attribute.cs (CheckAttribute): Handle system attributes by using
30215 Attribute.GetAttributes to examine information we need.
30217 (GetValidPlaces): Same here.
30219 * class.cs (Method::Define): Catch invalid use of extern and abstract together.
30221 * typemanager.cs (dllimport_type): Core type for System.DllImportAttribute.
30223 * class.cs (Method.IsPinvoke): Used to determine if we are a PInvoke method.
30225 (Method::Define): Set appropriate flags if we have a DllImport attribute.
30227 (Method::Emit): Handle the case when we are a PInvoke method.
30229 2001-12-03 Miguel de Icaza <miguel@ximian.com>
30231 * expression.cs: Use ResolveWithSimpleName on compound names.
30233 2001-12-02 Ravi Pratap <ravi@ximian.com>
30235 * constant.cs (EmitConstant): Make sure we resolve the associated expression
30236 before trying to reduce it.
30238 * typemanager.cs (RegisterConstant, LookupConstant): Implement.
30240 * constant.cs (LookupConstantValue): Implement.
30242 (EmitConstant): Use the above in emitting the constant.
30244 * expression.cs (MemberAccess::ResolveMemberAccess): Handle constants
30245 that are user-defined by doing a LookupConstantValue on them.
30247 (SimpleName::DoResolve): When we have a FieldExpr, cope with constants
30250 2001-11-29 Miguel de Icaza <miguel@ximian.com>
30252 * expression.cs (BaseAccess, BaseIndexer): Also split this out.
30254 (BaseAccess.DoResolve): Implement.
30256 (MemberAccess.DoResolve): Split this routine into a
30257 ResolveMemberAccess routine that can be used independently
30259 2001-11-28 Miguel de Icaza <miguel@ximian.com>
30261 * expression.cs (Probe, Is, As): Split Probe in two classes Is and
30262 As that share bits of the implementation. Is returns a boolean,
30263 while As returns the Type that is being probed.
30265 2001-12-01 Ravi Pratap <ravi@ximian.com>
30267 * enum.cs (LookupEnumValue): Re-write various bits, return an object value
30268 instead of a Literal - much easier.
30270 (EnumInTransit): Remove - utterly useless :-)
30272 (Populate): Re-write bits - remove duplicate code etc. The code is much neater now.
30274 * expression.cs (MemberLookup): Cope with user-defined enums when they are in transit.
30276 * enum.cs (LookupEnumValue): Auto-compute next values by going down the dependency
30277 chain when we have no associated expression.
30279 2001-11-30 Ravi Pratap <ravi@ximian.com>
30281 * constant.cs (Define): Use Location while reporting the errror.
30283 Also emit a warning when 'new' is used and there is no inherited
30286 * enum.cs (EnumInTransit): Used to tell if an enum type is in the process of being
30289 (LookupEnumValue): Implement to lookup an enum member's value and define it
30292 (Populate): Re-write accordingly to use the above routine.
30294 2001-11-27 Miguel de Icaza <miguel@ximian.com>
30296 * expression.cs (This): Fix prototype for DoResolveLValue to
30297 override the base class DoResolveLValue.
30299 * cs-parser.cs: Report errors cs574 and cs575 (destructor
30302 * ecore.cs (FieldExpr.EmitAssign): Handle value types specially
30303 (we need to load the address of the field here). This fixes
30306 (FieldExpr.DoResolveLValue): Call the DoResolve
30307 function to initialize the Instance expression.
30309 * statement.cs (Foreach.Emit): Fix the bug where we did not invoke
30310 correctly the GetEnumerator operation on a value type.
30312 * cs-parser.jay: Add more simple parsing error catches.
30314 * statement.cs (Switch): Add support for string switches.
30315 Handle null specially.
30317 * literal.cs (NullLiteral): Make NullLiteral objects singletons.
30319 2001-11-28 Ravi Pratap <ravi@ximian.com>
30321 * cs-parser.jay (local_constant_declaration): Use declare_local_constant.
30323 (declare_local_constant): New helper function.
30325 * statement.cs (AddConstant): Keep a separate record of constants
30327 (IsConstant): Implement to determine if a variable is a constant.
30329 (GetConstantExpression): Implement.
30331 * expression.cs (LocalVariableReference): Handle the case when it is a constant.
30333 * statement.cs (IsVariableDefined): Re-write.
30335 2001-11-27 Ravi Pratap <ravi@ximian.com>
30337 * class.cs (TypeContainer::FindMembers): Look for constants
30338 in the case when we are looking for MemberTypes.Field
30340 * expression.cs (MemberAccess::DoResolve): Check that in the
30341 case we are a FieldExpr and a Literal, we are not being accessed
30342 by an instance reference.
30344 * cs-parser.jay (local_constant_declaration): Implement.
30346 (declaration_statement): Implement for constant declarations.
30348 2001-11-26 Miguel de Icaza <miguel@ximian.com>
30350 * statement.cs (Switch): Catch double defaults.
30352 (Switch): More work on the switch() statement
30353 implementation. It works for integral values now, need to finish
30357 2001-11-24 Miguel de Icaza <miguel@ximian.com>
30359 * ecore.cs (Expression.ConvertIntLiteral): New function to convert
30360 integer literals into other integer literals. To be used by
30363 2001-11-24 Ravi Pratap <ravi@ximian.com>
30365 * expression.cs (ArrayCreation): Get rid of ArrayExprs : we save
30368 (EmitDynamicInitializers): Cope with the above since we extract data
30369 directly from ArrayData now.
30371 (ExpectInitializers): Keep track of whether initializers are mandatory
30374 (Bounds): Make it a hashtable to prevent the same dimension being
30375 recorded for every element in that dimension.
30377 (EmitDynamicInitializers): Fix bug which prevented the Set array method
30380 Also fix bug which was causing the indices to be emitted in the reverse
30383 2001-11-24 Miguel de Icaza <miguel@ximian.com>
30385 * expression.cs (ArrayCreation): Implement the bits that Ravi left
30386 unfinished. They do not work, because the underlying code is
30389 2001-11-22 Miguel de Icaza <miguel@ximian.com>
30391 * cs-parser.jay: Remove bogus fixme.
30393 * statement.cs (Switch, SwitchSection, SwithLabel): Started work
30394 on Switch statement.
30396 2001-11-23 Ravi Pratap <ravi@ximian.com>
30398 * typemanager.cs (IsDelegateType, IsEnumType): Fix logic to determine
30401 * expression.cs (ArrayCreation::CheckIndices): Get rid of the require_constant
30402 parameter. Apparently, any expression is allowed.
30404 (ValidateInitializers): Update accordingly.
30406 (CheckIndices): Fix some tricky bugs thanks to recursion.
30408 * delegate.cs (NewDelegate::DoResolve): Re-write large portions as
30409 I was being completely brain-dead.
30411 (VerifyMethod, VerifyApplicability, VerifyDelegate): Make static
30412 and re-write acordingly.
30414 (DelegateInvocation): Re-write accordingly.
30416 * expression.cs (ArrayCreation::Emit): Handle string initialization separately.
30418 (MakeByteBlob): Handle types more correctly.
30420 * expression.cs (ArrayCreation:Emit): Write preliminary code to do
30421 initialization from expressions but it is incomplete because I am a complete
30424 2001-11-22 Miguel de Icaza <miguel@ximian.com>
30426 * statement.cs (If.Emit): Fix a bug that generated incorrect code
30427 on If. Basically, we have to return `true' (ie, we do return to
30428 our caller) only if both branches of the if return.
30430 * expression.cs (Binary.Emit): LogicalOr and LogicalAnd are
30431 short-circuit operators, handle them as short circuit operators.
30433 (Cast.DoResolve): Resolve type.
30434 (Cast.Cast): Take an expression as the target type.
30436 * cs-parser.jay (cast_expression): Remove old hack that only
30437 allowed a limited set of types to be handled. Now we take a
30438 unary_expression and we resolve to a type during semantic
30441 Use the grammar productions from Rhys to handle casts (this is
30442 not complete like Rhys syntax yet, we fail to handle that corner
30443 case that C# has regarding (-x), but we will get there.
30445 2001-11-22 Ravi Pratap <ravi@ximian.com>
30447 * class.cs (EmitFieldInitializer): Take care of the case when we have a
30448 field which is an array type.
30450 * cs-parser.jay (declare_local_variables): Support array initialization too.
30452 * typemanager.cs (MakeKey): Implement.
30454 (everywhere): Use the above appropriately.
30456 * cs-parser.jay (for_statement): Update for array initialization while
30457 declaring variables.
30459 * ecore.cs : The error message was correct, it's the variable's names that
30460 were misleading ;-) Make the code more readable.
30462 (MemberAccess::DoResolve): Fix the code which handles Enum literals to set
30463 the correct type etc.
30465 (ConvertExplicit): Handle Enum types by examining the underlying type.
30467 2001-11-21 Ravi Pratap <ravi@ximian.com>
30469 * parameter.cs (GetCallingConvention): Always return
30470 CallingConventions.Standard for now.
30472 2001-11-22 Miguel de Icaza <miguel@ximian.com>
30474 * expression.cs (Binary.ResolveOperator): Update the values of `l'
30475 and `r' after calling DoNumericPromotions.
30477 * ecore.cs: Fix error message (the types were in the wrong order).
30479 * statement.cs (Foreach.ProbeCollectionType): Need to pass
30480 BindingFlags.Instance as well
30482 * ecore.cs (Expression.TryImplicitIntConversion): Wrap the result
30483 implicit int literal conversion in an empty cast so that we
30484 propagate the right type upstream.
30486 (UnboxCast): new class used to unbox value types.
30487 (Expression.ConvertExplicit): Add explicit type conversions done
30490 (Expression.ImplicitNumericConversion): Oops, forgot to test for
30491 the target type before applying the implicit LongLiterals to ULong
30494 2001-11-21 Miguel de Icaza <miguel@ximian.com>
30496 * cs-parser.jay (for_statement): Reworked the way For works: now
30497 we declare manually any variables that are introduced in
30498 for_initializer to solve the problem of having out-of-band code
30499 emition (that is what got for broken).
30501 (declaration_statement): Perform the actual variable declaration
30502 that used to be done in local_variable_declaration here.
30504 (local_variable_declaration): Do not declare anything, just pass
30505 the information on a DictionaryEntry
30507 2001-11-20 Ravi Pratap <ravi@ximian.com>
30509 * expression.cs (ArrayCreation::CheckIndices): The story continues :-) Complete
30510 re-write of the logic to now make it recursive.
30512 (UpdateIndices): Re-write accordingly.
30514 Store element data in a separate ArrayData list in the above methods.
30516 (MakeByteBlob): Implement to dump the array data into a byte array.
30518 2001-11-19 Ravi Pratap <ravi@ximian.com>
30520 * expression.cs (ArrayCreation): Factor out some code from ValidateInitializers
30523 * constant.cs (Define): Implement.
30525 (EmitConstant): Re-write fully.
30527 Pass in location info.
30529 * class.cs (Populate, Emit): Call Constant::Define and Constant::EmitConstant
30532 * cs-parser.jay (constant_declarator): Use VariableDeclaration instead of
30533 DictionaryEntry since we need location info too.
30535 (constant_declaration): Update accordingly.
30537 * expression.cs (ArrayCreation): Make ValidateInitializers simpler by factoring
30538 code into another method : UpdateIndices.
30540 2001-11-18 Ravi Pratap <ravi@ximian.com>
30542 * expression.cs (ArrayCreation::ValidateInitializers): Update to perform
30543 some type checking etc.
30545 2001-11-17 Ravi Pratap <ravi@ximian.com>
30547 * expression.cs (ArrayCreation::ValidateInitializers): Implement
30548 bits to provide dimension info if the user skips doing that.
30550 Update second constructor to store the rank correctly.
30552 2001-11-16 Ravi Pratap <ravi@ximian.com>
30554 * expression.cs (ArrayCreation::ValidateInitializers): Poke around
30555 and try to implement.
30557 * ../errors/cs0150.cs : Add.
30559 * ../errors/cs0178.cs : Add.
30561 2001-11-16 Miguel de Icaza <miguel@ximian.com>
30563 * statement.cs: Implement foreach on multi-dimensional arrays.
30565 * parameter.cs (Parameters.GetParameterByName): Also lookup the
30566 name of the params argument.
30568 * expression.cs: Use EmitStoreOpcode to get the right opcode while
30569 initializing the array.
30571 (ArrayAccess.EmitStoreOpcode): move the opcode generation here, so
30572 we can use this elsewhere.
30574 * statement.cs: Finish implementation of foreach for single
30577 * cs-parser.jay: Use an out-of-band stack to pass information
30578 around, I wonder why I need this.
30580 foreach_block: Make the new foreach_block the current_block.
30582 * parameter.cs (Parameters.GetEmptyReadOnlyParameters): New
30583 function used to return a static Parameters structure. Used for
30584 empty parameters, as those are created very frequently.
30586 * cs-parser.jay, class.cs: Use GetEmptyReadOnlyParameters
30588 2001-11-15 Ravi Pratap <ravi@ximian.com>
30590 * interface.cs : Default modifier is private, not public. The
30591 make verify test passes again.
30593 2001-11-15 Ravi Pratap <ravi@ximian.com>
30595 * support.cs (ReflectionParameters): Fix logic to determine
30596 whether the last parameter is a params one. Test 9 passes again.
30598 * delegate.cs (Populate): Register the builders we define with
30599 RegisterParameterForBuilder. Test 19 passes again.
30601 * cs-parser.jay (property_declaration): Reference $6 instead
30602 of $$ to get at the location.
30604 (indexer_declaration): Similar stuff.
30606 (attribute): Ditto.
30608 * class.cs (Property): Register parameters for the Get and Set methods
30609 if they exist. Test 23 passes again.
30611 * expression.cs (ArrayCreation::Emit): Pass null for the method in the
30612 call to EmitArguments as we are sure there aren't any params arguments.
30613 Test 32 passes again.
30615 * suppor.cs (ParameterDesc, ParameterModifier): Fix trivial bug causing
30616 IndexOutOfRangeException.
30618 * class.cs (Property::Define): Register property using TypeManager.RegisterProperty
30619 Test 33 now passes again.
30621 2001-11-15 Miguel de Icaza <miguel@ximian.com>
30623 * cs-parser.jay: Kill horrendous hack ($??? = lexer.Location) that
30624 broke a bunch of things. Will have to come up with a better way
30625 of tracking locations.
30627 * statement.cs: Implemented foreach for single dimension arrays.
30629 2001-11-09 Miguel de Icaza <miguel@ximian.com>
30631 * enum.cs (Enum.Emit): Delay the lookup of loc until we run into
30632 an error. This removes the lookup from the critical path.
30634 * cs-parser.jay: Removed use of temporary_loc, which is completely
30637 2001-11-14 Miguel de Icaza <miguel@ximian.com>
30639 * support.cs (ReflectionParameters.ParameterModifier): Report
30640 whether the argument is a PARAMS argument or not.
30642 * class.cs: Set the attribute `ParamArrayAttribute' on the
30643 parameter argument.
30645 * typemanager.cs: Define param_array_type (ParamArrayAttribute)
30646 and cons_param_array_attribute (ConstructorInfo for
30647 ParamArrayAttribute).,
30649 * codegen.cs: Emit the return using the `Return' statement, that
30650 way we can report the error correctly for missing return values.
30652 * class.cs (Method.Emit): Clean up.
30654 * expression.cs (Argument.Resolve): Take another argument: the
30655 location where this argument is used. Notice that this is not
30656 part of the "Argument" class as to reduce the size of the
30657 structure (we know the approximate location anyways).
30659 Test if the argument is a variable-reference, if not, then
30660 complain with a 206.
30662 (Argument.Emit): Emit addresses of variables.
30664 (Argument.FullDesc): Simplify.
30666 (Invocation.DoResolve): Update for Argument.Resolve.
30668 (ElementAccess.DoResolve): ditto.
30670 * delegate.cs (DelegateInvocation.Emit): Invocation of Invoke
30671 method should be virtual, as this method is always virtual.
30673 (NewDelegate.DoResolve): Update for Argument.Resolve.
30675 * class.cs (ConstructorInitializer.DoResolve): ditto.
30677 * attribute.cs (Attribute.Resolve): ditto.
30679 2001-11-13 Miguel de Icaza <miguel@ximian.com>
30681 * statement.cs (Foreach.Emit): Use EmitAssign instead of Store.
30683 * expression.cs (ParameterReference): Drop IStackStorage and implement
30684 IAssignMethod instead.
30686 (LocalVariableReference): ditto.
30688 * ecore.cs (FieldExpr): Drop IStackStorage and implement
30689 IAssignMethod instead.
30691 2001-11-13 Miguel de Icaza <miguel@ximian.com>
30693 * parameter.cs, expression.cs, class.cs, ecore.cs: Made all
30694 enumerations that are used in heavily used structures derive from
30695 byte in a laughable and pathetic attempt to reduce memory usage.
30696 This is the kind of pre-optimzations that you should not do at
30697 home without adult supervision.
30699 * expression.cs (UnaryMutator): New class, used to handle ++ and
30700 -- separatedly from the other unary operators. Cleans up the
30701 code, and kills the ExpressionStatement dependency in Unary.
30703 (Unary): Removed `method' and `Arguments' from this class, making
30704 it smaller, and moving it all to SimpleCall, so I can reuse this
30705 code in other locations and avoid creating a lot of transient data
30706 strucutres when not required.
30708 * cs-parser.jay: Adjust for new changes.
30710 2001-11-11 Miguel de Icaza <miguel@ximian.com>
30712 * enum.cs (Enum.Populate): If there is a failure during
30715 * cs-parser.jay (opt_enum_base): we used to catch type errors
30716 here, but this is really incorrect. The type error should be
30717 catched during semantic analysis.
30719 2001-12-11 Ravi Pratap <ravi@ximian.com>
30721 * cs-parser.jay (operator_declarator, conversion_operator_declarator): Set
30722 current_local_parameters as expected since I, in my stupidity, had forgotten
30725 * attribute.cs (GetValidPlaces): Fix stupid bug.
30727 * class.cs (Method::Emit): Perform check on applicability of attributes.
30729 (Constructor::Emit): Ditto.
30731 (Field::Emit): Ditto.
30733 (Field.Location): Store location information.
30735 (Property, Event, Indexer, Operator): Ditto.
30737 * cs-parser.jay (field_declaration): Pass in location for each field.
30739 * ../errors/cs0592.cs : Add.
30741 2001-11-12 Ravi Pratap <ravi@ximian.com>
30743 * typemanager.cs (attribute_usage_type): New static member for System.AttributeUsage.
30745 (InitCoreTypes): Update accordingly.
30747 (RegisterAttrType, LookupAttr): Implement.
30749 * attribute.cs (Attribute.Targets, AllowMultiple, Inherited): New fields to hold
30750 info about the same.
30752 (Resolve): Update to populate the above as necessary.
30754 (Error592): Helper.
30756 (GetValidPlaces): Helper to the above.
30758 (CheckAttribute): Implement to perform validity of attributes on declarative elements.
30760 * class.cs (TypeContainer::Emit): Update attribute emission code to perform checking etc.
30762 2001-11-12 Ravi Pratap <ravi@ximian.com>
30764 * attribute.cs (Attribute::Resolve): Expand to handle named arguments too.
30766 * ../errors/cs0617.cs : Add.
30768 2001-11-11 Ravi Pratap <ravi@ximian.com>
30770 * enum.cs (Emit): Rename to Populate to be more consistent with what
30771 we expect it to do and when exactly it is called.
30773 * class.cs, rootcontext.cs : Update accordingly.
30775 * typemanager.cs (RegisterField, GetValue): Workarounds for the fact that
30776 FieldInfo.GetValue does not work on dynamic types ! S.R.E lameness strikes again !
30778 * enum.cs (Populate): Register fields with TypeManager.RegisterField.
30780 * expression.cs (MemberAccess.DoResolve): Adjust code to obtain the value
30781 of a fieldinfo using the above, when dealing with a FieldBuilder.
30783 2001-11-10 Ravi Pratap <ravi@ximian.com>
30785 * ../errors/cs0031.cs : Add.
30787 * ../errors/cs1008.cs : Add.
30789 * ../errrors/cs0543.cs : Add.
30791 * enum.cs (DefineEnum): Check the underlying type and report an error if not a valid
30794 (FindMembers): Implement.
30796 * typemanager.cs (FindMembers): Re-write to call the appropriate methods for
30797 enums and delegates too.
30799 (enum_types): Rename to builder_to_enum.
30801 (delegate_types): Rename to builder_to_delegate.
30803 * delegate.cs (FindMembers): Implement.
30805 2001-11-09 Ravi Pratap <ravi@ximian.com>
30807 * typemanager.cs (IsEnumType): Implement.
30809 * enum.cs (Emit): Re-write parts to account for the underlying type
30810 better and perform checking etc.
30812 (GetNextDefaultValue): Helper to ensure we don't overshoot max value
30813 of the underlying type.
30815 * literal.cs (GetValue methods everywhere): Perform bounds checking and return
30818 * enum.cs (error31): Helper to report error #31.
30820 * cs-parser.jay (enum_declaration): Store location of each member too.
30822 * enum.cs (member_to_location): New hashtable.
30824 (AddEnumMember): Update location hashtable.
30826 (Emit): Use the location of each member while reporting errors.
30828 2001-11-09 Miguel de Icaza <miguel@ximian.com>
30830 * cs-parser.jay: A for_initializer if is a
30831 local_variable_declaration really ammount to have an implicit
30832 block with the variable declaration and no initializer for for.
30834 * statement.cs (For.Emit): Cope with null initializers.
30836 This fixes the infinite loop on for initializers.
30838 2001-11-08 Miguel de Icaza <miguel@ximian.com>
30840 * enum.cs: More cleanup.
30842 * ecore.cs: Remove dead code.
30844 * class.cs (Property.Emit): More simplification.
30845 (Event.Emit): ditto.
30847 Reworked to have less levels of indentation.
30849 2001-11-08 Ravi Pratap <ravi@ximian.com>
30851 * class.cs (Property): Emit attributes.
30861 * enum.cs (Emit): Ditto.
30863 * rootcontext.cs (ResolveTree, EmitCode, CloseTypes): Do the same for
30866 * class.cs (Field, Event, etc.): Move attribute generation into the
30867 Emit method everywhere.
30869 * enum.cs (Enum): Revamp to use the same definition semantics as delegates so
30870 we have a DefineEnum, CloseEnum etc. The previous way of doing things was not right
30871 as we had no way of defining nested enums !
30873 * rootcontext.cs : Adjust code accordingly.
30875 * typemanager.cs (AddEnumType): To keep track of enum types separately.
30877 2001-11-07 Ravi Pratap <ravi@ximian.com>
30879 * expression.cs (EvalConstantExpression): Move into ecore.cs
30881 * enum.cs (Enum): Rename some members and make them public and readonly
30882 according to our convention.
30884 * modifiers.cs (EnumAttr): Implement as we need to set only visibility flags,
30887 * enum.cs (Enum::Define): Use the above instead of TypeAttr.
30889 (Enum::Emit): Write a simple version for now which doesn't try to compute
30890 expressions. I shall modify this to be more robust in just a while.
30892 * class.cs (TypeContainer::Emit): Make sure we include Enums too.
30894 (TypeContainer::CloseType): Create the Enum types too.
30896 * attribute.cs (Resolve): Use the new Reduce method instead of EvalConstantExpression.
30898 * expression.cs (EvalConstantExpression): Get rid of completely.
30900 * enum.cs (Enum::Emit): Use the new expression reducer. Implement assigning
30901 user-defined values and other cases.
30903 (IsValidEnumLiteral): Helper function.
30905 * expression.cs (ExprClassfromMemberInfo): Modify to not do any literalizing
30906 out there in the case we had a literal FieldExpr.
30908 (MemberAccess:DoResolve): Do the literalizing of the FieldExpr here.
30910 (Literalize): Revamp a bit to take two arguments.
30912 (EnumLiteral): New class which derives from Literal to wrap enum literals.
30914 2001-11-06 Ravi Pratap <ravi@ximian.com>
30916 * cs-parser.jay (compilation_unit): Remove extra opt_attributes for now.
30918 * expression.cs (ArrayCreation::ValidateInitializers): Implement.
30920 (Resolve): Use the above to ensure we have proper initializers.
30922 2001-11-05 Ravi Pratap <ravi@ximian.com>
30924 * expression.cs (Expression::EvalConstantExpression): New method to
30925 evaluate constant expressions.
30927 * attribute.cs (Attribute::Resolve): Modify bits to use the above function.
30929 2001-11-07 Miguel de Icaza <miguel@ximian.com>
30931 * expression.cs (ArrayCreation.Emit): Some bits to initialize data
30934 (Binary.ResolveOperator): Handle operator != (object a, object b)
30935 and operator == (object a, object b);
30937 (Binary.DoNumericPromotions): Indicate whether the numeric
30938 promotion was possible.
30940 (ArrayAccess.DoResolve, ArrayAccess.Emit, ArrayAccess.EmitAssign):
30943 Made the ArrayAccess implement interface IAssignMethod instead of
30944 IStackStore as the order in which arguments are passed reflects
30947 * assign.cs: Instead of using expr.ExprClass to select the way of
30948 assinging, probe for the IStackStore/IAssignMethod interfaces.
30950 * typemanager.cs: Load InitializeArray definition.
30952 * rootcontext.cs (RootContext.MakeStaticData): Used to define
30953 static data that can be used to initialize arrays.
30955 2001-11-05 Miguel de Icaza <miguel@ximian.com>
30957 * expression.cs: Handle operator== and operator!= for booleans.
30959 (Conditioal.Reduce): Implement reducer for the ?: operator.
30961 (Conditional.Resolve): Implement dead code elimination.
30963 (Binary.Resolve): Catch string literals and return a new
30964 concatenated string.
30966 (Unary.Reduce): Implement reduction of unary expressions.
30968 * ecore.cs: Split out the expression core handling here.
30970 (Expression.Reduce): New method used to perform constant folding
30971 and CSE. This is needed to support constant-expressions.
30973 * statement.cs (Statement.EmitBoolExpression): Pass true and false
30974 targets, and optimize for !x.
30976 2001-11-04 Ravi Pratap <ravi@ximian.com>
30978 * attribute.cs (Attribute::Resolve): Implement guts. Note that resolution
30979 of an attribute gives us a CustomAttributeBuilder which we use accordingly to
30980 set custom atttributes.
30982 * literal.cs (Literal::GetValue): New abstract method to return the actual
30983 value of the literal, cast as an object.
30985 (*Literal): Implement GetValue method.
30987 * cs-parser.jay (positional_argument_list, named_argument_list): Add not just plain
30988 expressions to the arraylist but objects of type Argument.
30990 * class.cs (TypeContainer::Emit): Emit our attributes too.
30992 (Method::Emit, Constructor::Emit): Ditto.
30994 * cs-parser.jay (constructor_declaration): Set attributes too, which we seemed
30995 to be ignoring earlier.
30997 2001-11-03 Ravi Pratap <ravi@ximian.com>
30999 * attribute.cs (AttributeSection::Define): Implement to do the business
31000 of constructing a CustomAttributeBuilder.
31002 (Attribute): New trivial class. Increases readability of code.
31004 * cs-parser.jay : Update accordingly.
31006 (positional_argument_list, named_argument_list, named_argument): New rules
31008 (attribute_arguments): Use the above so that we are more correct.
31010 2001-11-02 Ravi Pratap <ravi@ximian.com>
31012 * expression.cs (Invocation::IsParamsMethodApplicable): Implement
31013 to perform all checks for a method with a params parameter.
31015 (Invocation::OverloadResolve): Update to use the above method and therefore
31016 cope correctly with params method invocations.
31018 * support.cs (InternalParameters::ParameterDesc): Provide a desc for
31021 * class.cs (ConstructorInitializer::Resolve): Make sure we look for Non-public
31022 constructors in our parent too because we can't afford to miss out on
31025 * attribute.cs (AttributeSection): New name for the class Attribute
31027 Other trivial changes to improve readability.
31029 * cs-parser.jay (opt_attributes, attribute_section etc.): Modify to
31030 use the new class names.
31032 2001-11-01 Ravi Pratap <ravi@ximian.com>
31034 * class.cs (Method::Define): Complete definition for params types too
31036 (Indexer::Define): Ditto.
31038 * support.cs (InternalParameters::ParameterType, ParameterDesc, ParameterModifier):
31039 Cope everywhere with a request for info about the array parameter.
31041 2001-11-01 Ravi Pratap <ravi@ximian.com>
31043 * tree.cs (RecordNamespace): Fix up to check for the correct key.
31045 * cs-parser.jay (GetQualifiedIdentifier): New Helper method used in
31046 local_variable_type to extract the string corresponding to the type.
31048 (local_variable_type): Fixup the action to use the new helper method.
31050 * codegen.cs : Get rid of RefOrOutParameter, it's not the right way to
31053 * expression.cs : Clean out code which uses the above.
31055 2001-10-31 Ravi Pratap <ravi@ximian.com>
31057 * typemanager.cs (RegisterMethod): Check if we already have an existing key
31058 and bale out if necessary by returning a false.
31060 (RegisterProperty): Ditto.
31062 * class.cs (everywhere): Check the return value from TypeManager.RegisterMethod
31063 and print out appropriate error messages.
31065 * interface.cs (everywhere): Ditto.
31067 * cs-parser.jay (property_declaration, event_declaration, indexer_declaration): Pass
31068 location to constructor.
31070 * class.cs (Property, Event, Indexer): Update accordingly.
31072 * ../errors/cs111.cs : Added.
31074 * expression.cs (Invocation::IsApplicable): New static method to determine applicability
31075 of a method, as laid down by the spec.
31077 (Invocation::OverloadResolve): Use the above method.
31079 2001-10-31 Ravi Pratap <ravi@ximian.com>
31081 * support.cs (InternalParameters): Get rid of crap taking in duplicate info. We
31082 now take a TypeContainer and a Parameters object.
31084 (ParameterData): Modify return type of ParameterModifier method to be
31085 Parameter.Modifier and not a string.
31087 (ReflectionParameters, InternalParameters): Update accordingly.
31089 * expression.cs (Argument::GetParameterModifier): Same here.
31091 * support.cs (InternalParameters::ParameterType): Find a better way of determining
31092 if we are a ref/out parameter. Actually, the type shouldn't be holding the '&'
31093 symbol in it at all so maybe this is only for now.
31095 2001-10-30 Ravi Pratap <ravi@ximian.com>
31097 * support.cs (InternalParameters): Constructor now takes an extra argument
31098 which is the actual Parameters class.
31100 (ParameterDesc): Update to provide info on ref/out modifiers.
31102 * class.cs (everywhere): Update call to InternalParameters to pass in
31103 the second argument too.
31105 * support.cs (ParameterData): Add ParameterModifier, which is a method
31106 to return the modifier info [ref/out etc]
31108 (InternalParameters, ReflectionParameters): Implement the above.
31110 * expression.cs (Argument::ParameterModifier): Similar function to return
31111 info about the argument's modifiers.
31113 (Invocation::OverloadResolve): Update to take into account matching modifiers
31116 * class.cs (Indexer::Define): Actually define a Parameter object and put it onto
31117 a new SetFormalParameters object which we pass to InternalParameters.
31119 2001-10-30 Ravi Pratap <ravi@ximian.com>
31121 * expression.cs (NewArray): Merge into the ArrayCreation class.
31123 2001-10-29 Ravi Pratap <ravi@ximian.com>
31125 * expression.cs (NewArray): Merge classes NewBuiltinArray and
31126 NewUserdefinedArray into one as there wasn't much of a use in having
31129 * expression.cs (Argument): Change field's name to ArgType from Type.
31131 (Type): New readonly property which returns the proper type, taking into
31132 account ref/out modifiers.
31134 (everywhere): Adjust code accordingly for the above.
31136 * codegen.cs (EmitContext.RefOrOutParameter): New field to determine
31137 whether we are emitting for a ref or out parameter.
31139 * expression.cs (Argument::Emit): Use the above field to set the state.
31141 (LocalVariableReference::Emit): Update to honour the flag and emit the
31144 * parameter.cs (Attributes): Set the correct flags for ref parameters.
31146 * expression.cs (Argument::FullDesc): New function to provide a full desc.
31148 * support.cs (ParameterData): Add method ParameterDesc to the interface.
31150 (ReflectionParameters, InternalParameters): Implement the above method.
31152 * expression.cs (Invocation::OverloadResolve): Use the new desc methods in
31155 (Invocation::FullMethodDesc): Ditto.
31157 2001-10-29 Miguel de Icaza <miguel@ximian.com>
31159 * cs-parser.jay: Add extra production for the second form of array
31162 * expression.cs (ArrayCreation): Update to reflect the above
31165 * Small changes to prepare for Array initialization.
31167 2001-10-28 Miguel de Icaza <miguel@ximian.com>
31169 * typemanager.cs (ImplementsInterface): interface might be null;
31170 Deal with this problem;
31172 Also, we do store negative hits on the cache (null values), so use
31173 this instead of calling t.GetInterfaces on the type everytime.
31175 2001-10-28 Ravi Pratap <ravi@ximian.com>
31177 * typemanager.cs (IsBuiltinType): New method to help determine the same.
31179 * expression.cs (New::DoResolve): Get rid of array creation code and instead
31180 split functionality out into different classes.
31182 (New::FormArrayType): Move into NewBuiltinArray.
31184 (Invocation::EmitArguments): Get rid of the MethodBase argument. Appears
31187 (NewBuiltinArray): New class to handle creation of built-in arrays.
31189 (NewBuiltinArray::DoResolve): Implement guts of array creation. Also take into
31190 account creation of one-dimensional arrays.
31192 (::Emit): Implement to use Newarr and Newobj opcodes accordingly.
31194 (NewUserdefinedArray::DoResolve): Implement.
31196 * cs-parser.jay (local_variable_type): Fix up to add the rank to the variable too.
31198 * typemanager.cs (AddModule): Used to add a ModuleBuilder to the list of modules
31199 we maintain inside the TypeManager. This is necessary to perform lookups on the
31202 (LookupType): Update to perform GetType on the module builders too.
31204 * driver.cs (Driver): Add the ModuleBuilder to the list maintained by the TypeManager.
31206 * exprssion.cs (NewUserdefinedArray::Emit): Implement.
31208 2001-10-23 Ravi Pratap <ravi@ximian.com>
31210 * expression.cs (New::DoResolve): Implement guts of array creation.
31212 (New::FormLookupType): Rename to FormArrayType and modify ever so slightly.
31214 2001-10-27 Miguel de Icaza <miguel@ximian.com>
31216 * expression.cs: Fix bug I introduced lsat night that broke
31219 (Expression.Resolve): Report a 246 error (can not resolve name)
31220 if we find a SimpleName in the stream.
31222 (Expression.ResolveLValue): Ditto.
31224 (Expression.ResolveWithSimpleName): This function is a variant of
31225 ResolveName, this one allows SimpleNames to be returned without a
31226 warning. The only consumer of SimpleNames is MemberAccess
31228 2001-10-26 Miguel de Icaza <miguel@ximian.com>
31230 * expression.cs (Invocation::DoResolve): Catch SimpleNames that
31231 might arrive here. I have my doubts that this is correct.
31233 * statement.cs (Lock): Implement lock statement.
31235 * cs-parser.jay: Small fixes to support `lock' and `using'
31237 * cs-tokenizer.cs: Remove extra space
31239 * driver.cs: New flag --checked, allows to turn on integer math
31242 * typemanger.cs: Load methodinfos for Threading.Monitor.Enter and
31243 Threading.Monitor.Exit
31245 2001-10-23 Miguel de Icaza <miguel@ximian.com>
31247 * expression.cs (IndexerAccess::DoResolveLValue): Set the
31248 Expression Class to be IndexerAccess.
31250 Notice that Indexer::DoResolve sets the eclass to Value.
31252 2001-10-22 Miguel de Icaza <miguel@ximian.com>
31254 * class.cs (TypeContainer::Emit): Emit code for indexers.
31256 * assign.cs (IAssignMethod): New interface implemented by Indexers
31257 and Properties for handling assignment.
31259 (Assign::Emit): Simplify and reuse code.
31261 * expression.cs (IndexerAccess, PropertyExpr): Implement
31262 IAssignMethod, clean up old code.
31264 2001-10-22 Ravi Pratap <ravi@ximian.com>
31266 * typemanager.cs (ImplementsInterface): New method to determine if a type
31267 implements a given interface. Provides a nice cache too.
31269 * expression.cs (ImplicitReferenceConversion): Update checks to use the above
31272 (ConvertReferenceExplicit): Ditto.
31274 * delegate.cs (Delegate::Populate): Update to define the parameters on the
31275 various methods, with correct names etc.
31277 * class.cs (Operator::OpType): New members Operator.UnaryPlus and
31278 Operator.UnaryNegation.
31280 * cs-parser.jay (operator_declarator): Be a little clever in the case where
31281 we have a unary plus or minus operator.
31283 * expression.cs (Unary): Rename memebers of Operator enum to UnaryPlus and
31286 * everywhere : update accordingly.
31288 * everywhere : Change Negate and BitComplement to LogicalNot and OnesComplement
31291 * class.cs (Method::Define): For the case where we are implementing a method
31292 inherited from an interface, we need to set the MethodAttributes.Final flag too.
31293 Also set MethodAttributes.NewSlot and MethodAttributes.HideBySig.
31295 2001-10-21 Ravi Pratap <ravi@ximian.com>
31297 * interface.cs (FindMembers): Implement to work around S.R.E
31300 * typemanager.cs (IsInterfaceType): Implement.
31302 (FindMembers): Update to handle interface types too.
31304 * expression.cs (ImplicitReferenceConversion): Re-write bits which
31305 use IsAssignableFrom as that is not correct - it doesn't work.
31307 * delegate.cs (DelegateInvocation): Derive from ExpressionStatement
31308 and accordingly override EmitStatement.
31310 * expression.cs (ConvertReferenceExplicit): Re-write similary, this time
31311 using the correct logic :-)
31313 2001-10-19 Ravi Pratap <ravi@ximian.com>
31315 * ../errors/cs-11.cs : Add to demonstrate error -11
31317 2001-10-17 Miguel de Icaza <miguel@ximian.com>
31319 * assign.cs (Assign::Resolve): Resolve right hand side first, and
31320 then pass this as a hint to ResolveLValue.
31322 * expression.cs (FieldExpr): Add Location information
31324 (FieldExpr::LValueResolve): Report assignment to readonly
31327 (Expression::ExprClassFromMemberInfo): Pass location information.
31329 (Expression::ResolveLValue): Add new method that resolves an
31332 (Expression::DoResolveLValue): Default invocation calls
31335 (Indexers): New class used to keep track of indexers in a given
31338 (IStackStore): Renamed from LValue, as it did not really describe
31339 what this did. Also ResolveLValue is gone from this interface and
31340 now is part of Expression.
31342 (ElementAccess): Depending on the element access type
31344 * typemanager.cs: Add `indexer_name_type' as a Core type
31345 (System.Runtime.CompilerServices.IndexerNameAttribute)
31347 * statement.cs (Goto): Take a location.
31349 2001-10-18 Ravi Pratap <ravi@ximian.com>
31351 * delegate.cs (Delegate::VerifyDelegate): New method to verify
31352 if two delegates are compatible.
31354 (NewDelegate::DoResolve): Update to take care of the case when
31355 we instantiate a delegate from another delegate.
31357 * typemanager.cs (FindMembers): Don't even try to look up members
31358 of Delegate types for now.
31360 2001-10-18 Ravi Pratap <ravi@ximian.com>
31362 * delegate.cs (NewDelegate): New class to take care of delegate
31365 * expression.cs (New): Split the delegate related code out into
31366 the NewDelegate class.
31368 * delegate.cs (DelegateInvocation): New class to handle delegate
31371 * expression.cs (Invocation): Split out delegate related code into
31372 the DelegateInvocation class.
31374 2001-10-17 Ravi Pratap <ravi@ximian.com>
31376 * expression.cs (New::DoResolve): Implement delegate creation fully
31377 and according to the spec.
31379 (New::DoEmit): Update to handle delegates differently.
31381 (Invocation::FullMethodDesc): Fix major stupid bug thanks to me
31382 because of which we were printing out arguments in reverse order !
31384 * delegate.cs (VerifyMethod): Implement to check if the given method
31385 matches the delegate.
31387 (FullDelegateDesc): Implement.
31389 (VerifyApplicability): Implement.
31391 * expression.cs (Invocation::DoResolve): Update to accordingly handle
31392 delegate invocations too.
31394 (Invocation::Emit): Ditto.
31396 * ../errors/cs1593.cs : Added.
31398 * ../errors/cs1594.cs : Added.
31400 * delegate.cs (InstanceExpression, TargetMethod): New properties.
31402 2001-10-16 Ravi Pratap <ravi@ximian.com>
31404 * typemanager.cs (intptr_type): Core type for System.IntPtr
31406 (InitCoreTypes): Update for the same.
31408 (iasyncresult_type, asynccallback_type): Ditto.
31410 * delegate.cs (Populate): Fix to use System.Intptr as it is indeed
31413 * typemanager.cs (AddDelegateType): Store a pointer to the Delegate class
31416 * delegate.cs (ConstructorBuilder, InvokeBuilder, ...): New members to hold
31417 the builders for the 4 members of a delegate type :-)
31419 (Populate): Define the BeginInvoke and EndInvoke methods on the delegate
31422 * expression.cs (New::DoResolve): Implement guts for delegate creation.
31424 * ../errors/errors.txt : Update for an error (-11) which only we catch :-)
31426 2001-10-15 Miguel de Icaza <miguel@ximian.com>
31428 * statement.cs (Break::Emit): Implement.
31429 (Continue::Emit): Implement.
31431 (For::Emit): Track old being/end loops; Set Begin loop, ack end loop
31432 (While::Emit): Track old being/end loops; Set Begin loop, ack end loop
31433 (Do::Emit): Track old being/end loops; Set Begin loop, ack end loop
31434 (Foreach::Emit): Track old being/end loops; Set Begin loop, ack
31437 * codegen.cs (EmitContext::LoopEnd, EmitContext::LoopBegin): New
31438 properties that track the label for the current loop (begin of the
31439 loop and end of the loop).
31441 2001-10-15 Ravi Pratap <ravi@ximian.com>
31443 * delegate.cs (Emit): Get rid of it as there doesn't seem to be any ostensible
31444 use of emitting anything at all.
31446 * class.cs, rootcontext.cs : Get rid of calls to the same.
31448 * delegate.cs (DefineDelegate): Make sure the class we define is also sealed.
31450 (Populate): Define the constructor correctly and set the implementation
31453 * typemanager.cs (delegate_types): New hashtable to hold delegates that
31456 (AddDelegateType): Implement.
31458 (IsDelegateType): Implement helper method.
31460 * delegate.cs (DefineDelegate): Use AddDelegateType instead of AddUserType.
31462 * expression.cs (New::DoResolve): Check if we are trying to instantiate a delegate type
31463 and accordingly handle it.
31465 * delegate.cs (Populate): Take TypeContainer argument.
31466 Implement bits to define the Invoke method. However, I still haven't figured out
31467 how to take care of the native int bit :-(
31469 * cs-parser.jay (delegate_declaration): Fixed the bug that I had introduced :-)
31470 Qualify the name of the delegate, not its return type !
31472 * expression.cs (ImplicitReferenceConversion): Implement guts of implicit array
31475 (StandardConversionExists): Checking for array types turns out to be recursive.
31477 (ConvertReferenceExplicit): Implement array conversion.
31479 (ExplicitReferenceConversionExists): New method to determine precisely that :-)
31481 2001-10-12 Ravi Pratap <ravi@ximian.com>
31483 * cs-parser.jay (delegate_declaration): Store the fully qualified
31484 name as it is a type declaration.
31486 * delegate.cs (ReturnType, Name): Rename members to these. Make them
31489 (DefineDelegate): Renamed from Define. Does the same thing essentially,
31490 as TypeContainer::DefineType.
31492 (Populate): Method in which all the definition of the various methods (Invoke)
31495 (Emit): Emit any code, if necessary. I am not sure about this really, but let's
31498 (CloseDelegate): Finally creates the delegate.
31500 * class.cs (TypeContainer::DefineType): Update to define delegates.
31501 (Populate, Emit and CloseType): Do the same thing here too.
31503 * rootcontext.cs (ResolveTree, PopulateTypes, EmitCode, CloseTypes): Include
31504 delegates in all these operations.
31506 2001-10-14 Miguel de Icaza <miguel@ximian.com>
31508 * expression.cs: LocalTemporary: a new expression used to
31509 reference a temporary that has been created.
31511 * assign.cs: Handle PropertyAccess back here, so that we can
31512 provide the proper semantic access to properties.
31514 * expression.cs (Expression::ConvertReferenceExplicit): Implement
31515 a few more explicit conversions.
31517 * modifiers.cs: `NEW' modifier maps to HideBySig.
31519 * expression.cs (PropertyExpr): Make this into an
31520 ExpressionStatement, and support the EmitStatement code path.
31522 Perform get/set error checking, clean up the interface.
31524 * assign.cs: recognize PropertyExprs as targets, and if so, turn
31525 them into toplevel access objects.
31527 2001-10-12 Miguel de Icaza <miguel@ximian.com>
31529 * expression.cs: PropertyExpr::PropertyExpr: use work around the
31532 * typemanager.cs: Keep track here of our PropertyBuilders again to
31533 work around lameness in SRE.
31535 2001-10-11 Miguel de Icaza <miguel@ximian.com>
31537 * expression.cs (LValue::LValueResolve): New method in the
31538 interface, used to perform a second resolution pass for LValues.
31540 (This::DoResolve): Catch the use of this in static methods.
31542 (This::LValueResolve): Implement.
31544 (This::Store): Remove warning, assigning to `this' in structures
31547 (Invocation::Emit): Deal with invocation of
31548 methods on value types. We need to pass the address to structure
31549 methods rather than the object itself. (The equivalent code to
31550 emit "this" for structures leaves the entire structure on the
31551 stack instead of a pointer to it).
31553 (ParameterReference::DoResolve): Compute the real index for the
31554 argument based on whether the method takes or not a `this' pointer
31555 (ie, the method is static).
31557 * codegen.cs (EmitContext::GetTemporaryStorage): Used to store
31558 value types returned from functions when we need to invoke a
31559 method on the sturcture.
31562 2001-10-11 Ravi Pratap <ravi@ximian.com>
31564 * class.cs (TypeContainer::DefineType): Method to actually do the business of
31565 defining the type in the Modulebuilder or Typebuilder. This is to take
31566 care of nested types which need to be defined on the TypeBuilder using
31567 DefineNestedMethod.
31569 (TypeContainer::GetClassBases): Implement. Essentially the code from the
31570 methods in RootContext, only ported to be part of TypeContainer.
31572 (TypeContainer::GetInterfaceOrClass): Ditto.
31574 (TypeContainer::LookupInterfaceOrClass, ::MakeFQN): Ditto.
31576 * interface.cs (Interface::DefineInterface): New method. Does exactly
31577 what RootContext.CreateInterface did earlier, only it takes care of nested types
31580 (Interface::GetInterfaces): Move from RootContext here and port.
31582 (Interface::GetInterfaceByName): Same here.
31584 * rootcontext.cs (ResolveTree): Re-write.
31586 (PopulateTypes): Re-write.
31588 * class.cs (TypeContainer::Populate): Populate nested types too.
31589 (TypeContainer::Emit): Emit nested members too.
31591 * typemanager.cs (AddUserType): Do not make use of the FullName property,
31592 instead just use the name argument passed in as it is already fully
31595 (FindMembers): Check in the Builders to TypeContainer mapping instead of the name
31596 to TypeContainer mapping to see if a type is user-defined.
31598 * class.cs (TypeContainer::CloseType): Implement.
31600 (TypeContainer::DefineDefaultConstructor): Use Basename, not Name while creating
31601 the default constructor.
31603 (TypeContainer::Populate): Fix minor bug which led to creating default constructors
31606 (Constructor::IsDefault): Fix up logic to determine if it is the default constructor
31608 * interface.cs (CloseType): Create the type here.
31610 * rootcontext.cs (CloseTypes): Re-write to recursively close types by running through
31613 Remove all the methods which are now in TypeContainer.
31615 2001-10-10 Ravi Pratap <ravi@ximian.com>
31617 * delegate.cs (Define): Re-write bits to define the delegate
31620 2001-10-10 Miguel de Icaza <miguel@ximian.com>
31622 * makefile: Renamed the compiler to `mcs.exe' instead of compiler.exe
31624 * expression.cs (ImplicitReferenceConversion): handle null as well
31625 as a source to convert to any reference type.
31627 * statement.cs (Return): Perform any implicit conversions to
31628 expected return type.
31630 Validate use of return statement.
31632 * codegen.cs (EmitContext): Pass the expected return type here.
31634 * class.cs (Method, Constructor, Property): Pass expected return
31635 type to EmitContext.
31637 2001-10-09 Miguel de Icaza <miguel@ximian.com>
31639 * expression.cs: Make DoResolve take an EmitContext instead of a
31642 Replaced `l' and `location' for `loc', for consistency.
31644 (Error, Warning): Remove unneeded Tc argument.
31646 * assign.cs, literal.cs, constant.cs: Update to new calling
31649 * codegen.cs: EmitContext now contains a flag indicating whether
31650 code is being generated in a static method or not.
31652 * cs-parser.jay: DecomposeQI, new function that replaces the old
31653 QualifiedIdentifier. Now we always decompose the assembled
31654 strings from qualified_identifier productions into a group of
31657 2001-10-08 Miguel de Icaza <miguel@ximian.com>
31659 * rootcontext.cs: Deal with field-less struct types correctly now
31660 by passing the size option to Define Type.
31662 * class.cs: Removed hack that created one static field.
31664 2001-10-07 Miguel de Icaza <miguel@ximian.com>
31666 * statement.cs: Moved most of the code generation here.
31668 2001-10-09 Ravi Pratap <ravi@ximian.com>
31670 * expression.cs (New::DoResolve): Revert changes for array creation, doesn't
31673 (ElementAccess): Remove useless bits for now - keep checks as the spec
31676 2001-10-08 Ravi Pratap <ravi@ximian.com>
31678 * expression.cs (ElementAccess::DoResolve): Remove my crap code
31679 and start performing checks according to the spec.
31681 2001-10-07 Ravi Pratap <ravi@ximian.com>
31683 * cs-parser.jay (type_suffix*): Remove - they are redundant. Use
31684 rank_specifiers instead.
31686 (rank_specifiers): Change the order in which the rank specifiers are stored
31688 (local_variable_declaration): Use opt_rank_specifier instead of type_suffixes.
31690 * expression.cs (ElementAccess): Implement the LValue interface too.
31692 2001-10-06 Ravi Pratap <ravi@ximian.com>
31694 * expression.cs (ConvertExplicitStandard): Add. Same as ConvertExplicit
31695 except that user defined conversions are not included.
31697 (UserDefinedConversion): Update to use the ConvertExplicitStandard to
31698 perform the conversion of the return type, if necessary.
31700 (New::DoResolve): Check whether we are creating an array or an object
31701 and accordingly do the needful.
31703 (New::Emit): Same here.
31705 (New::DoResolve): Implement guts of array creation.
31707 (New::FormLookupType): Helper function.
31709 2001-10-07 Miguel de Icaza <miguel@ximian.com>
31711 * codegen.cs: Removed most of the code generation here, and move the
31712 corresponding code generation bits to the statement classes.
31714 Added support for try/catch/finalize and throw.
31716 * cs-parser.jay: Added support for try/catch/finalize.
31718 * class.cs: Catch static methods having the flags override,
31719 virtual or abstract.
31721 * expression.cs (UserCast): This user cast was not really doing
31722 what it was supposed to do. Which is to be born in fully resolved
31723 state. Parts of the resolution were being performed at Emit time!
31727 2001-10-05 Miguel de Icaza <miguel@ximian.com>
31729 * expression.cs: Implicity convert the result from UserCast.
31731 2001-10-05 Ravi Pratap <ravi@ximian.com>
31733 * expression.cs (Expression::FindMostEncompassingType): Fix bug which
31734 prevented it from working correctly.
31736 (ConvertExplicit): Make the first try, a call to ConvertImplicitStandard, not
31737 merely ConvertImplicit.
31739 2001-10-05 Miguel de Icaza <miguel@ximian.com>
31741 * typemanager.cs: Make the LookupTypeContainer function static,
31742 and not per-instance.
31744 * class.cs: Make static FindMembers (the one that takes a Type
31747 * codegen.cs: Add EmitForeach here.
31749 * cs-parser.jay: Make foreach a toplevel object instead of the
31750 inline expansion, as we need to perform semantic analysis on it.
31752 2001-10-05 Ravi Pratap <ravi@ximian.com>
31754 * expression.cs (Expression::ImplicitUserConversion): Rename to
31755 UserDefinedConversion.
31757 (Expression::UserDefinedConversion): Take an extra argument specifying
31758 whether we look for explicit user conversions too.
31760 (Expression::ImplicitUserConversion): Make it a call to UserDefinedConversion.
31762 (UserDefinedConversion): Incorporate support for user defined explicit conversions.
31764 (ExplicitUserConversion): Make it a call to UserDefinedConversion
31765 with the appropriate arguments.
31767 * cs-parser.jay (cast_expression): Record location too.
31769 * expression.cs (Cast): Record location info.
31771 (Expression::ConvertExplicit): Take location argument.
31773 (UserImplicitCast): Change name to UserCast. Take an extra constructor argument
31774 to determine if we are doing explicit conversions.
31776 (UserCast::Emit): Update accordingly.
31778 (Expression::ConvertExplicit): Report an error if everything fails.
31780 * ../errors/cs0030.cs : Add.
31782 2001-10-04 Miguel de Icaza <miguel@ximian.com>
31784 * modifiers.cs: If the ABSTRACT keyword is present, also set the
31785 virtual and newslot bits.
31787 * class.cs (TypeContainer::RegisterRequiredImplementations):
31788 Record methods we need.
31790 (TypeContainer::MakeKey): Helper function to make keys for
31791 MethodBases, since the Methodbase key is useless.
31793 (TypeContainer::Populate): Call RegisterRequiredImplementations
31794 before defining the methods.
31796 Create a mapping for method_builders_to_methods ahead of time
31797 instead of inside a tight loop.
31799 (::RequireMethods): Accept an object as the data to set into the
31800 hashtable so we can report interface vs abstract method mismatch.
31802 2001-10-03 Miguel de Icaza <miguel@ximian.com>
31804 * report.cs: Make all of it static.
31806 * rootcontext.cs: Drop object_type and value_type computations, as
31807 we have those in the TypeManager anyways.
31809 Drop report instance variable too, now it is a global.
31811 * driver.cs: Use try/catch on command line handling.
31813 Add --probe option to debug the error reporting system with a test
31816 * report.cs: Add support for exiting program when a probe
31817 condition is reached.
31819 2001-10-03 Ravi Pratap <ravi@ximian.com>
31821 * expression.cs (Binary::DoNumericPromotions): Fix the case when
31822 we do a forcible conversion regardless of type, to check if
31823 ForceConversion returns a null.
31825 (Binary::error19): Use location to report error.
31827 (Unary::error23): Use location here too.
31829 * ../errors/cs0019.cs : Check in.
31831 * ../errors/cs0023.cs : Check in.
31833 * expression.cs (Expression.MemberLookup): Return null for a rather esoteric
31834 case of a non-null MethodInfo object with a length of 0 !
31836 (Binary::ResolveOperator): Flag error if overload resolution fails to find
31837 an applicable member - according to the spec :-)
31838 Also fix logic to find members in base types.
31840 (Unary::ResolveOperator): Same here.
31842 (Unary::report23): Change name to error23 and make first argument a TypeContainer
31843 as I was getting thoroughly confused between this and error19 :-)
31845 * expression.cs (Expression::ImplicitUserConversion): Re-write fully
31846 (::FindMostEncompassedType): Implement.
31847 (::FindMostEncompassingType): Implement.
31848 (::StandardConversionExists): Implement.
31850 (UserImplicitCast): Re-vamp. We now need info about most specific
31851 source and target types so that we can do the necessary conversions.
31853 (Invocation::MakeUnionSet): Completely re-write to make sure we form a proper
31854 mathematical union with no duplicates.
31856 2001-10-03 Miguel de Icaza <miguel@ximian.com>
31858 * rootcontext.cs (RootContext::PopulateTypes): Populate containers
31859 in order from base classes to child classes, so that we can in
31860 child classes look up in our parent for method names and
31861 attributes (required for handling abstract, virtual, new, override
31862 constructs: we need to instrospect our base class, and if we dont
31863 populate the classes in order, the introspection might be
31864 incorrect. For example, a method could query its parent before
31865 the parent has any methods and would determine that the parent has
31866 no abstract methods (while it could have had them)).
31868 (RootContext::CreateType): Record the order in which we define the
31871 2001-10-02 Miguel de Icaza <miguel@ximian.com>
31873 * class.cs (TypeContainer::Populate): Also method definitions can
31874 fail now, keep track of this.
31876 (TypeContainer::FindMembers): Implement support for
31877 DeclaredOnly/noDeclaredOnly flag.
31879 (Constructor::Emit) Return the ConstructorBuilder.
31881 (Method::Emit) Return the MethodBuilder.
31882 Check for abstract or virtual methods to be public.
31884 * rootcontext.cs (RootContext::CreateType): Register all the
31885 abstract methods required for the class to be complete and the
31886 interface methods that must be implemented.
31888 * cs-parser.jay: Report error 501 (method requires body if it is
31889 not marked abstract or extern).
31891 * expression.cs (TypeOf::Emit): Implement.
31893 * typemanager.cs: runtime_handle_type, new global type.
31895 * class.cs (Property::Emit): Generate code for properties.
31897 2001-10-02 Ravi Pratap <ravi@ximian.com>
31899 * expression.cs (Unary::ResolveOperator): Find operators on base type
31900 too - we now conform exactly to the spec.
31902 (Binary::ResolveOperator): Same here.
31904 * class.cs (Operator::Define): Fix minor quirk in the tests.
31906 * ../errors/cs0215.cs : Added.
31908 * ../errors/cs0556.cs : Added.
31910 * ../errors/cs0555.cs : Added.
31912 2001-10-01 Miguel de Icaza <miguel@ximian.com>
31914 * cs-tokenizer.cs: Reimplemented Location to be a struct with a
31915 single integer which is really efficient
31917 2001-10-01 Ravi Pratap <ravi@ximian.com>
31919 * expression.cs (Expression::ImplicitUserConversion): Use location
31920 even in the case when we are examining True operators.
31922 * class.cs (Operator::Define): Perform extensive checks to conform
31923 with the rules for operator overloading in the spec.
31925 * expression.cs (Expression::ImplicitReferenceConversion): Implement
31926 some of the other conversions mentioned in the spec.
31928 * typemanager.cs (array_type): New static member for the System.Array built-in
31931 (cloneable_interface): For System.ICloneable interface.
31933 * driver.cs (Driver::Driver): Initialize TypeManager's core types even before
31934 we start resolving the tree and populating types.
31936 * ../errors/errors.txt : Update for error numbers -7, -8, -9, -10
31938 2001-10-01 Miguel de Icaza <miguel@ximian.com>
31940 * expression.cs (Expression::ExprClassFromMemberInfo,
31941 Expression::Literalize): Create literal expressions from
31942 FieldInfos which are literals.
31944 (ConvertNumericExplicit, ImplicitNumericConversion): Fix a few
31945 type casts, because they were wrong. The test suite in tests
31948 (ImplicitNumericConversion): ushort to ulong requires a widening
31951 Int32 constant to long requires widening cast as well.
31953 * literal.cs (LongLiteral::EmitLong): Do not generate i4 constants
31954 for integers because the type on the stack is not i4.
31956 2001-09-30 Miguel de Icaza <miguel@ximian.com>
31958 * expression.cs (report118): require location argument.
31960 * parameter.cs: Do not dereference potential null value.
31962 * class.cs: Catch methods that lack the `new' keyword when
31963 overriding a name. Report warnings when `new' is used without
31964 anything being there to override.
31966 * modifiers.cs: Handle `NEW' as MethodAttributes.NewSlot.
31968 * class.cs: Only add constructor to hashtable if it is non-null
31969 (as now constructors can fail on define).
31971 (TypeManager, Class, Struct): Take location arguments.
31973 Catch field instance initialization in structs as errors.
31975 accepting_filter: a new filter for FindMembers that is static so
31976 that we dont create an instance per invocation.
31978 (Constructor::Define): Catch errors where a struct constructor is
31981 * cs-parser.jay: Pass location information for various new
31984 * delegate.cs (Delegate): take a location argument.
31986 * driver.cs: Do not call EmitCode if there were problesm in the
31987 Definition of the types, as many Builders wont be there.
31989 * decl.cs (Decl::Decl): Require a location argument.
31991 * cs-tokenizer.cs: Handle properly hex constants that can not fit
31992 into integers, and find the most appropiate integer for it.
31994 * literal.cs: Implement ULongLiteral.
31996 * rootcontext.cs: Provide better information about the location of
31997 failure when CreateType fails.
31999 2001-09-29 Miguel de Icaza <miguel@ximian.com>
32001 * rootcontext.cs (RootContext::PopulateTypes): Populates structs
32004 * expression.cs (Binary::CheckShiftArguments): Add missing type
32006 (Binary::ResolveOperator): Add type to the logical and and logical
32007 or, Bitwise And/Or and Exclusive Or code paths, it was missing
32010 (Binary::DoNumericPromotions): In the case where either argument
32011 is ulong (and most signed types combined with ulong cause an
32012 error) perform implicit integer constant conversions as well.
32014 2001-09-28 Miguel de Icaza <miguel@ximian.com>
32016 * expression.cs (UserImplicitCast): Method should always be
32018 (Invocation::BetterConversion): Simplified test for IntLiteral.
32020 (Expression::ImplicitNumericConversion): Split this routine out.
32021 Put the code that performs implicit constant integer conversions
32024 (Expression::Resolve): Become a wrapper around DoResolve so we can
32025 check eclass and type being set after resolve.
32027 (Invocation::Badness): Remove this dead function
32029 (Binary::ResolveOperator): Do not compute the expensive argumnets
32030 unless we have a union for it.
32032 (Probe::Emit): Is needs to do an isinst and then
32033 compare against null.
32035 (::CanConvert): Added Location argument. If the Location argument
32036 is null (Location.Null), then we do not report errors. This is
32037 used by the `probe' mechanism of the Explicit conversion. We do
32038 not want to generate an error for something that the user
32039 explicitly requested to be casted. But the pipeline for an
32040 explicit cast first tests for potential implicit casts.
32042 So for now, if the Location is null, it means `Probe only' to
32043 avoid adding another argument. Might have to revise this
32046 (ClassCast): New class used to type cast objects into arbitrary
32047 classes (used in Explicit Reference Conversions).
32049 Implement `as' as well.
32051 Reverted all the patches from Ravi below: they were broken:
32053 * The use of `level' as a mechanism to stop recursive
32054 invocations is wrong. That was there just to catch the
32055 bug with a strack trace but not as a way of addressing
32058 To fix the problem we have to *understand* what is going
32059 on and the interactions and come up with a plan, not
32060 just get things going.
32062 * The use of the type conversion cache that I proposed
32063 last night had an open topic: How does this work across
32064 protection domains. A user defined conversion might not
32065 be public in the location where we are applying the
32066 conversion, a different conversion might be selected
32067 (ie, private A->B (better) but public B->A (worse),
32068 inside A, A->B applies, but outside it, B->A will
32071 * On top of that (ie, even if the above is solved),
32072 conversions in a cache need to be abstract. Ie, `To
32073 convert from an Int to a Short use an OpcodeCast', not
32074 `To convert from an Int to a Short use the OpcodeCast on
32075 the variable 5' (which is what this patch was doing).
32077 2001-09-28 Ravi Pratap <ravi@ximian.com>
32079 * expression.cs (Invocation::ConversionExists): Re-write to use
32080 the conversion cache
32082 (Expression::ConvertImplicit): Automatic bailing out if level != 0. Also
32083 cache all conversions done, not just user-defined ones.
32085 (Invocation::BetterConversion): The real culprit. Use ConversionExists
32086 to determine if a conversion exists instead of acutually trying to
32087 perform the conversion. It's faster too.
32089 (Expression::ConvertExplicit): Modify to use ConversionExists to check
32090 and only then attempt the implicit conversion.
32092 2001-09-28 Ravi Pratap <ravi@ximian.com>
32094 * expression.cs (ConvertImplicit): Use a cache for conversions
32095 already found. Check level of recursion and bail out if necessary.
32097 2001-09-28 Miguel de Icaza <miguel@ximian.com>
32099 * typemanager.cs (string_concat_string_string, string_concat_object_object):
32100 Export standard methods that we expect for string operations.
32102 * statement.cs (Block::UsageWarning): Track usage of variables and
32103 report the errors for not used variables.
32105 * expression.cs (Conditional::Resolve, ::Emit): Implement ?:
32108 2001-09-27 Miguel de Icaza <miguel@ximian.com>
32110 * codegen.cs: remove unnneded code
32112 * expression.cs: Removed BuiltinTypeAccess class
32114 Fix the order in which implicit conversions are
32117 The previous fixed dropped support for boxed conversions (adding a
32118 test to the test suite now)
32120 (UserImplicitCast::CanConvert): Remove test for source being null,
32121 that code is broken. We should not feed a null to begin with, if
32122 we do, then we should track the bug where the problem originates
32123 and not try to cover it up here.
32125 Return a resolved expression of type UserImplicitCast on success
32126 rather than true/false. Ravi: this is what I was talking about,
32127 the pattern is to use a static method as a "constructor" for
32130 Also, do not create arguments until the very last minute,
32131 otherwise we always create the arguments even for lookups that
32132 will never be performed.
32134 (UserImplicitCast::Resolve): Eliminate, objects of type
32135 UserImplicitCast are born in a fully resolved state.
32137 * typemanager.cs (InitCoreTypes): Init also value_type
32138 (System.ValueType).
32140 * expression.cs (Cast::Resolve): First resolve the child expression.
32142 (LValue): Add new method AddressOf to be used by
32145 Change the argument of Store to take an EmitContext instead of an
32146 ILGenerator, because things like FieldExpr need to be able to call
32147 their children expression to generate the instance code.
32149 (Expression::Error, Expression::Warning): Sugar functions for
32152 (Expression::MemberLookup): Accept a TypeContainer instead of a
32153 Report as the first argument.
32155 (Expression::ResolvePrimary): Killed. I still want to improve
32156 this as currently the code is just not right.
32158 (Expression::ResolveMemberAccess): Simplify, but it is still
32161 (Unary::Resolve): Catch errors in AddressOf operators.
32163 (LocalVariableReference::Emit, ::Store, ::AddressOf): typecast
32164 index to a byte for the short-version, or the compiler will choose
32165 the wrong Emit call, which generates the wrong data.
32167 (ParameterReference::Emit, ::Store): same.
32169 (FieldExpr::AddressOf): Implement.
32171 * typemanager.cs: TypeManager: made public variable instead of
32174 * driver.cs: document --fatal.
32176 * report.cs (ErrorMessage, WarningMessage): new names for the old
32177 Error and Warning classes.
32179 * cs-parser.jay (member_access): Turn built-in access to types
32180 into a normal simplename
32182 2001-09-27 Ravi Pratap <ravi@ximian.com>
32184 * expression.cs (Invocation::BetterConversion): Fix to cope
32185 with q being null, since this was introducing a bug.
32187 * expression.cs (ConvertImplicit): Do built-in conversions first.
32189 2001-09-27 Ravi Pratap <ravi@ximian.com>
32191 * expression.cs (UserImplicitCast::Resolve): Fix bug.
32193 2001-09-27 Ravi Pratap <ravi@ximian.com>
32195 * class.cs (TypeContainer::AddConstructor): Fix a stupid bug
32196 I had introduced long ago (what's new ?).
32198 * expression.cs (UserImplicitCast::CanConvert): Static method to do
32199 the work of all the checking.
32200 (ConvertImplicit): Call CanConvert and only then create object if necessary.
32201 (UserImplicitCast::CanConvert, ::Resolve): Re-write.
32203 (Unary::Operator): Rename Add and Subtract to Addition and Subtraction because
32204 that is the right way.
32206 (Invocation::MakeUnionSet): Convenience function to make unions of sets for
32207 overloading resolution. Use everywhere instead of cutting and pasting code.
32209 (Binary::ResolveOperator): Use MakeUnionSet.
32211 (UserImplicitCast::CanConvert, ::Resolve): Update to take care of the case when
32212 we have to convert to bool types. Not complete yet.
32214 2001-09-27 Miguel de Icaza <miguel@ximian.com>
32216 * typemanager.cs (TypeManager::CSharpName): support ushort.
32218 * expression.cs (Expression::TryImplicitIntConversion): Attempts
32219 to provide an expression that performsn an implicit constant int
32220 conversion (section 6.1.6).
32221 (Expression::ConvertImplicitRequired): Reworked to include
32222 implicit constant expression conversions.
32224 (Expression::ConvertNumericExplicit): Finished.
32226 (Invocation::Emit): If InstanceExpression is null, then it means
32227 that we perform a call on this.
32229 2001-09-26 Miguel de Icaza <miguel@ximian.com>
32231 * expression.cs (Unary::Emit): Remove some dead code.
32232 (Probe): Implement Resolve and Emit for `is'.
32233 (Expression::ConvertImplicitRequired): Attempt to do constant
32234 expression conversions here. Maybe should be moved to
32235 ConvertImplicit, but I am not sure.
32236 (Expression::ImplicitLongConstantConversionPossible,
32237 Expression::ImplicitIntConstantConversionPossible): New functions
32238 that tell whether is it possible to apply an implicit constant
32239 expression conversion.
32241 (ConvertNumericExplicit): Started work on explicit numeric
32244 * cs-parser.jay: Update operator constants.
32246 * parameter.cs (Parameters::GetParameterInfo): Hook up VerifyArgs
32247 (Parameters::GetSignature): Hook up VerifyArgs here.
32248 (Parameters::VerifyArgs): Verifies that no two arguments have the
32251 * class.cs (Operator): Update the operator names to reflect the
32252 ones that the spec expects (as we are just stringizing the
32255 * expression.cs (Unary::ResolveOperator): Fix bug: Use
32256 MethodInfo's ReturnType instead of LookupMethodByBuilder as the
32257 previous usage did only work for our methods.
32258 (Expression::ConvertImplicit): Handle decimal implicit numeric
32259 conversions as well.
32260 (Expression::InternalTypeConstructor): Used to invoke constructors
32261 on internal types for default promotions.
32263 (Unary::Emit): Implement special handling for the pre/post
32264 increment/decrement for overloaded operators, as they need to have
32265 the same semantics as the other operators.
32267 (Binary::ResolveOperator): ditto.
32268 (Invocation::ConversionExists): ditto.
32269 (UserImplicitCast::Resolve): ditto.
32271 2001-09-26 Ravi Pratap <ravi@ximian.com>
32273 * expression.cs (Unary::Emit and Binary::Emit): If we have an overloaded
32274 operator, return after emitting body. Regression tests pass again !
32276 * expression.cs (ConvertImplicit): Take TypeContainer as first argument
32277 (Unary::ForceConversion, Binary::ForceConversion): Ditto.
32278 (Invocation::OverloadResolve): Ditto.
32279 (Invocation::BetterFunction, BetterConversion, ConversionExists): Ditto.
32281 * everywhere : update calls to the above methods accordingly.
32283 2001-09-26 Miguel de Icaza <miguel@ximian.com>
32285 * assign.cs (Assign): Make it inherit from ExpressionStatement.
32287 * expression.cs (ExpressionStatement): New base class used for
32288 expressions that can appear in statements, so that we can provide
32289 an alternate path to generate expression that do not leave a value
32292 (Expression::Emit, and all the derivatives): We no longer return
32293 whether a value is left on the stack or not. Every expression
32294 after being emitted leaves a single value on the stack.
32296 * codegen.cs (EmitContext::EmitStatementExpression): Use the
32297 facilties of ExpressionStatement if possible.
32299 * cs-parser.jay: Update statement_expression.
32301 2001-09-25 Miguel de Icaza <miguel@ximian.com>
32303 * driver.cs: Change the wording of message
32305 2001-09-25 Ravi Pratap <ravi@ximian.com>
32307 * expression.cs (Binary::ResolveOperator): Had forgottten to set
32308 the type of the expression to the return type of the method if
32309 we have an overloaded operator match ! The regression tests pass again !
32310 (Unary::ResolveOperator): Ditto.
32312 * expression.cs (Invocation::ConversionExists): Correct the member lookup
32313 to find "op_Implicit", not "implicit" ;-)
32314 (UserImplicitCast): New class to take care of user-defined implicit conversions.
32315 (ConvertImplicit, ForceConversion): Take TypeContainer argument
32317 * everywhere : Correct calls to the above accordingly.
32319 * expression.cs (UserImplicitCast::Resolve, ::Emit): Implement.
32320 (ConvertImplicit): Do user-defined conversion if it exists.
32322 2001-09-24 Miguel de Icaza <miguel@ximian.com>
32324 * assign.cs: track location.
32325 (Resolve): Use implicit conversions on assignment.
32327 * literal.cs: Oops. Not good, Emit of short access values should
32328 pass (Bytes) or the wrong argument will be selected.
32330 * expression.cs (Unary::Emit): Emit code for -expr.
32332 (Unary::ResolveOperator): Handle `Substract' for non-constants
32333 (substract from zero from the non-constants).
32334 Deal with Doubles as well.
32336 (Expression::ConvertImplicitRequired): New routine that reports an
32337 error if no implicit conversion exists.
32339 (Invocation::OverloadResolve): Store the converted implicit
32340 expressions if we make them
32342 2001-09-24 Ravi Pratap <ravi@ximian.com>
32344 * class.cs (ConstructorInitializer): Take a Location argument.
32345 (ConstructorBaseInitializer): Same here.
32346 (ConstructorThisInitializer): Same here.
32348 * cs-parser.jay : Update all calls accordingly.
32350 * expression.cs (Unary, Binary, New): Take location argument.
32351 Update accordingly everywhere.
32353 * cs-parser.jay : Update all calls to the above to take a location
32356 * class.cs : Ditto.
32358 2001-09-24 Ravi Pratap <ravi@ximian.com>
32360 * expression.cs (Invocation::BetterFunction): Take TypeContainer argument
32361 (Invocation::BetterConversion): Same here
32362 (Invocation::ConversionExists): Ditto.
32364 (Invocation::ConversionExists): Implement.
32366 2001-09-22 Ravi Pratap <ravi@ximian.com>
32368 * expression.cs (OverloadResolve): Improve some more to catch errors 1502 and 1503
32369 Also take an additional TypeContainer argument.
32371 * All over : Pass in TypeContainer as argument to OverloadResolve.
32373 * typemanager.cs (CSharpName): Update to check for the string type and return
32376 * expression.cs (Invocation::FullMethodDesc): New static method to return a string fully describing
32379 2001-09-21 Ravi Pratap <ravi@ximian.com>
32381 * expression.cs (Invocation::OverloadResolve): Re-write to conform more to the spec.
32382 (Invocation::BetterFunction): Implement.
32383 (Invocation::BetterConversion): Implement.
32384 (Invocation::ConversionExists): Skeleton, no implementation yet.
32386 Okay, things work fine !
32388 2001-09-21 Miguel de Icaza <miguel@ximian.com>
32390 * typemanager.cs: declare and load enum_type, delegate_type and
32393 * expression.cs (Expression::Emit): Now emit returns a value that
32394 tells whether a value is left on the stack or not. This strategy
32395 might be reveted tomorrow with a mechanism that would address
32396 multiple assignments.
32397 (Expression::report118): Utility routine to report mismatches on
32400 (Unary::Report23): Report impossible type/operator combination
32403 (Unary::IsIncrementableNumber): Whether the type can be
32404 incremented or decremented with add.
32405 (Unary::ResolveOperator): Also allow enumerations to be bitwise
32407 (Unary::ResolveOperator): Implement ++, !, ~,
32409 (Invocation::Emit): Deal with new Emit convetion.
32411 * All Expression derivatives: Updated their Emit method to return
32412 whether they leave values on the stack or not.
32414 * codegen.cs (CodeGen::EmitStatement): Pop values left on the
32415 stack for expressions that are statements.
32417 2001-09-20 Miguel de Icaza <miguel@ximian.com>
32419 * expression.cs (LValue): New interface. Must be implemented by
32421 (LocalVariableReference, ParameterReference, FieldExpr): Implement
32424 * assign.cs (Assign::Emit, Assign::Resolve): Use new LValue
32425 interface for generating code, simplifies the code.
32427 2001-09-20 Ravi Pratap <ravi@ximian.com>
32429 * expression.cs (everywhere): Comment out return statements in ::Resolve
32430 methods to avoid the warnings.
32432 2001-09-20 Miguel de Icaza <miguel@ximian.com>
32434 * driver.cs (parse): Report error 2001 if we can not open the
32437 * expression.cs (SimpleName::ResolveSimpleName): Error if we can
32440 * cs-parser.jay (QualifierIdentifier): Pass location to SimpleName
32443 * statement.cs (Block::EmitMeta): Reuse the count across all the variables,
32444 otherwise nested blocks end up with the same index.
32446 * codegen.cs (CodeGen::EmitTopBlock): Pass initial sequence
32448 * expression.cs: Instead of having FIXMEs in the Resolve
32449 functions, throw exceptions so it is obvious that we are facing a
32452 * cs-parser.jay (invocation_expression): Pass Location information.
32454 * codegen.cs (CodeGen::Save, CodeGen::CodeGen, CodeGen::Basename):
32455 Use a basename for those routines because .NET does not like paths
32458 * class.cs (TypeContainer::AddMethod): Do not call DefineName if the name was
32461 2001-09-19 Miguel de Icaza <miguel@ximian.com>
32463 * typemanager.cs (TypeManager::CoreLookupType): A function to make sure that we
32464 are loading the correct data types (throws an exception if not).
32465 (TypeManager::InitCoreTypes): Use CoreLookupType
32467 * expression.cs (Unary::ResolveOperator): return the child
32468 expression for expressions which are just +expr.
32469 (Unary::ResolveOperator): Return negative literals for -LITERAL
32470 expressions (otherwise they are Unary {Literal}).
32471 (Invocation::Badness): Take into account `Implicit constant
32472 expression conversions'.
32474 * literal.cs (LongLiteral): Implement long literal class.
32475 (IntLiteral): export the `Value' of the intliteral.
32477 2001-09-19 Ravi Pratap <ravi@ximian.com>
32479 * expression.cs (Binary::Emit): Finally get the emission right ! Woo!
32481 * class.cs (Operator::Define): Change the methodname prefix to 'op_'
32482 instead of 'Operator'
32484 * expression.cs (Binary::ResolveOperator): Update accordingly.
32485 (Unary::Operator): Change names to 'Add' and 'Subtract' instead 'Plus'
32488 * cs-parser.jay (unary_expression): Update to use the new names.
32490 * gen-treedump.cs (GetUnary): Same here.
32492 * expression.cs (Unary::Resolve): Implement.
32493 (Binary::ResolveOperator): Re-write bits to quietly continue if no overloaded
32494 operators are found instead of making noise ;-)
32495 (Unary::ResolveOperator): New method to do precisely the same thing which
32496 Binary::ResolveOperator does for Binary expressions.
32497 (Unary.method, .Arguments): Add.
32498 (Unary::OperName): Implement.
32499 (Unary::ForceConversion): Copy and Paste !
32501 * class.cs (Operator::Define): Fix a small bug for the case when we have
32504 * expression.cs (Unary::Emit): Implement. Need to find the right Opcodes
32505 for the inbuilt operators. Only overloading works for now ;-)
32507 2001-09-18 Miguel de Icaza <miguel@ximian.com>
32509 * expression.cs (CheckedExpr::Resolve, CheckedExpr::Emit,
32510 UnCheckedExpr::Resolve, UnCheckedExpr::Emit): Implement.
32512 * expression.cs (This::Emit): Implement.
32513 (This::Resolve): Implement.
32514 (TypeOf:Resolve): Implement.
32515 (Expression::ResolveSimpleName): Add an implicit this to instance
32517 (MemberAccess::Resolve): Deal with Parameters and Fields.
32518 Bind instance variable to Field expressions.
32519 (FieldExpr::Instance): New field used to track the expression that
32520 represents the object instance.
32521 (FieldExpr::Resolve): Track potential errors from MemberLookup not
32523 (FieldExpr::Emit): Implement.
32525 * codegen.cs (EmitIf, EmitStatement, EmitBlock): Propagate whether
32526 the last instruction contains a return opcode to avoid generating
32527 the last `ret' instruction (this generates correct code, and it is
32528 nice to pass the peverify output).
32530 * class.cs (TypeContainer::EmitFieldInitializers): Implement field
32531 initializer for static and instance variables.
32532 (Constructor::Emit): Allow initializer to be null in the case of
32533 static constructors. Only emit initializer for instance
32536 (TypeContainer::FindMembers): Return a null array if there are no
32539 Also fix the code for the MemberTypes.Method branch, as it was not
32540 scanning that for operators (or tried to access null variables before).
32542 * assign.cs (Assign::Emit): Handle instance and static fields.
32546 * driver.cs: Stop compilation if there are parse errors.
32548 * cs-parser.jay (constructor_declaration): Provide default base
32549 initializer for non-static constructors.
32550 (constructor_declarator): Do not provide a default base
32551 initializers if none was specified.
32552 Catch the fact that constructors should not have parameters.
32554 * class.cs: Do not emit parent class initializers for static
32555 constructors, that should be flagged as an error.
32557 2001-09-18 Ravi Pratap <ravi@ximian.com>
32559 * class.cs (RegisterMethodBuilder): Remove : it's unnecessary.
32560 Move back code into TypeContainer::Populate.
32562 2001-09-18 Ravi Pratap <ravi@ximian.com>
32564 * class.cs (TypeContainer::AddConstructor): Fix the check to
32565 compare against Name, not Basename.
32566 (Operator::OpType): Change Plus and Minus to Add and Subtract.
32568 * cs-parser.jay : Update accordingly.
32570 * class.cs (TypeContainer::FindMembers): For the case where we are searching
32571 for methods, don't forget to look into the operators too.
32572 (RegisterMethodBuilder): Helper method to take care of this for
32573 methods, constructors and operators.
32574 (Operator::Define): Completely revamp.
32575 (Operator.OperatorMethod, MethodName): New fields.
32576 (TypeContainer::Populate): Move the registering of builders into
32577 RegisterMethodBuilder.
32578 (Operator::Emit): Re-write.
32580 * expression.cs (Binary::Emit): Comment out code path to emit method
32581 invocation stuff for the case when we have a user defined operator. I am
32582 just not able to get it right !
32584 2001-09-17 Miguel de Icaza <miguel@ximian.com>
32586 * expression.cs (Expression::OverloadResolve): Drop TypeContainer
32589 (Expression::MemberLookup): Provide a version that allows to
32590 specify the MemberTypes and BindingFlags.
32592 * statement.cs (Block::GetVariableInfo): Forgot to recurse here,
32593 so it was not fetching variable information from outer blocks.
32595 * modifiers.cs: (Modifiers::TypeAttr): Invert condition on
32596 Beforefieldinit as it was buggy.
32598 * rootcontext.cs (::LookupInterfaceOrClass): Removed an Error -200
32599 that Ravi put here.
32601 * class.cs (Constructor::Emit): Only emit if block is not null.
32602 (TypeContainer::EmitDefaultConstructor): Removed routine, now we
32603 deal with this by semantically definining it as if the user had
32606 (TypeContainer::FindMembers): Removed ad-hoc hack to deal with
32607 constructors as we now "emit" them at a higher level.
32609 (TypeContainer::DefineDefaultConstructor): Used to define the
32610 default constructors if none was provided.
32612 (ConstructorInitializer): Add methods Resolve and Emit.
32614 * expression.cs: Cast to ConstructorInfo instead of MethodInfo
32616 2001-09-17 Ravi Pratap <ravi@ximian.com>
32618 * class.cs (TypeContainer::EmitDefaultConstructor): Register
32619 the default constructor builder with our hashtable for methodbuilders
32622 * expression.cs (Invocation::OverloadResolve): Add a check for pd == null
32623 and argument_count is 0 in which case we have a match.
32624 (Binary::ResolveOperator): More null checking and miscellaneous coding
32627 2001-09-17 Ravi Pratap <ravi@ximian.com>
32629 * rootcontext.cs (IsNameSpace): Compare against null.
32631 * everywhere : Correct spelling to 'Greater' and to 'Subtract'
32633 * class.cs (Operator::OpType): Change names to match the ones in Binary::Operator
32634 and Unary::Operator.
32636 * cs-parser.jay (operator_declaration, CheckBinaryOperator, CheckUnaryOperator): Update
32639 * expression.cs (Binary::method): New member to hold the MethodBase for the case when
32640 we have overloaded operators.
32641 (Binary::ResolveOperator): Implement the part which does the operator overload
32644 * class.cs (Operator::Emit): Implement.
32645 (TypeContainer::Emit): Emit the operators we have too.
32647 * expression.cs (Binary::Emit): Update to emit the appropriate code for
32648 the case when we have a user-defined operator.
32650 2001-09-17 Miguel de Icaza <miguel@ximian.com>
32652 * rootcontext.cs: Fix bug: tree.Namespaces might be null.
32654 2001-09-16 Ravi Pratap <ravi@ximian.com>
32656 * class.cs (EmitStaticFieldInitializers, EmitFieldInitializers): Make public.
32657 (TypeContainer::EmitConstructor): Remove and move code into Contructor::Emit.
32658 (Constructor::Emit): Implement.
32659 (EmitStaticFieldInitializers, EmitFieldInitializers): Ensure we return immediately
32660 if we have no work to do.
32661 (TypeContainer::Emit): Pass in TypeContainer as argument to the constructor's
32664 * interface.cs (Interface::InterfaceAttr): Re-write to be more correct and complete.
32665 (Interface::IsTopLevel): Add. Same as TypeContainer::IsTopLevel.
32667 * class.cs (TypeContainer::IsTopLevel): Modify to use parent.Parent instead
32670 2001-09-15 Ravi Pratap <ravi@ximian.com>
32672 * tree.cs (Tree::namespaces): New hashtable to keep track of namespaces
32674 (Tree::RecordNamespace): Method to do what the name says ;-)
32675 (Tree::Namespaces): Property to get at the namespaces hashtable.
32677 * cs-parser.jay (namespace_declaration): Call RecordNamespace to
32680 * rootcontext.cs (IsNamespace): Fixed it :-)
32682 2001-09-14 Miguel de Icaza <miguel@ximian.com>
32684 * class.cs (TypeContainer::FindMembers): Add support for
32686 (MethodCore): New class that encapsulates both the shared aspects
32687 of a Constructor and a Method.
32688 (Method, Constructor): Factored pieces into MethodCore.
32690 * driver.cs: Added --fatal which makes errors throw exceptions.
32691 Load System assembly as well as part of the standard library.
32693 * report.cs: Allow throwing exceptions on errors for debugging.
32695 * modifiers.cs: Do not use `parent', instead use the real type
32696 container to evaluate permission settings.
32698 * class.cs: Put Ravi's patch back in. He is right, and we will
32699 have to cope with the
32701 2001-09-14 Ravi Pratap <ravi@ximian.com>
32703 * modifiers.cs (TypeAttr, MethodAttr, FieldAttr): Map protected internal to
32704 FamORAssem, not FamANDAssem.
32706 2001-09-14 Miguel de Icaza <miguel@ximian.com>
32708 * driver.cs: Added --parse option that only parses its input files
32711 * class.cs: Reverted last change from Ravi to IsTopLevel. That is
32712 incorrect. IsTopLevel is not used to tell whether an object is
32713 root_types or not (that can be achieved by testing this ==
32714 root_types). But to see if this is a top-level *class* (not
32715 necessarly our "toplevel" container).
32717 2001-09-14 Ravi Pratap <ravi@ximian.com>
32719 * enum.cs (Enum::Define): Modify to call the Lookup method on the
32720 parent instead of a direct call to GetType.
32722 2001-09-14 Ravi Pratap <ravi@ximian.com>
32724 * class.cs (TypeContainer::TypeAttr): Remove property code and move it into
32725 Modifiers.TypeAttr. This should just be a call to that method.
32727 * modifiers.cs (TypeAttr): Re-write and take an extra argument, the TypeContainer
32728 object so that we can determine if we are top-level or not.
32730 * delegate.cs (Delegate::Define): Update call to TypeAttr method to pass in the
32733 * enum.cs (Enum::Define): Ditto.
32735 * modifiers.cs (FieldAttr): Re-write.
32737 * class.cs (TypeContainer::IsTopLevel): Change accessibility to public.
32738 (TypeContainer::HaveStaticConstructor): New property to provide access
32739 to precisely that info.
32741 * modifiers.cs (MethodAttr): Re-write.
32742 (EventAttr): Remove altogether as there seems to be no ostensible use for it.
32744 * class.cs (TypeContainer::IsTopLevel): Re-write. root_types doesn't seem to be the parent
32745 of top-level types as claimed.
32747 2001-09-13 Miguel de Icaza <miguel@ximian.com>
32749 * expression.cs (MemberLookup): Fruitless attempt to lookup
32750 constructors. Maybe I need to emit default constructors? That
32751 might be it (currently .NET emits this for me automatically).
32752 (Invocation::OverloadResolve): Cope with Arguments == null.
32753 (Invocation::EmitArguments): new function, shared by the new
32754 constructor and us.
32755 (Invocation::Emit): Handle static and instance methods. Emit
32756 proper call instruction for virtual or non-virtual invocations.
32757 (New::Emit): Implement.
32758 (New::Resolve): Implement.
32759 (MemberAccess:Resolve): Implement.
32760 (MethodGroupExpr::InstanceExpression): used conforming to the spec
32761 to track instances.
32762 (FieldExpr::Resolve): Set type.
32764 * support.cs: Handle empty arguments.
32766 * cs-parser.jay (CompositeLookup, QualifierIdentifier,
32767 SimpleLookup): Auxiliary routines to help parse a qualifier
32770 Update qualifier_identifier rule.
32772 * codegen.cs: Removed debugging messages.
32774 * class.cs: Make this a global thing, this acts just as a "key" to
32775 objects that we might have around.
32777 (Populate): Only initialize method_builders_to_methods once.
32779 * expression.cs (PropertyExpr): Initialize type from the
32782 * codegen.cs (EmitContext::EmitBoolExpression): Use propper
32783 Resolve pattern. Attempt to implicitly convert value to boolean.
32786 * expression.cs: Set the type for the int32/int32 argument case.
32787 (Binary::ResolveOperator): Set the return type to boolean for
32788 comparission operators
32790 * typemanager.cs: Remove debugging print code.
32792 (Invocation::Resolve): resolve type.
32794 * class.cs: Allocate a MemberInfo of the correct size, as the code
32795 elsewhere depends on the test to reflect the correct contents.
32797 (Method::) Keep track of parameters, due to System.Reflection holes
32799 (TypeContainer::Populate): Keep track of MethodBuilders to Method
32802 (TypeContainer::FindMembers): Use ArrayList and then copy an array
32803 of the exact size and return that.
32805 (Class::LookupMethodByBuilder): New function that maps
32806 MethodBuilders to its methods. Required to locate the information
32807 on methods because System.Reflection bit us again.
32809 * support.cs: New file, contains an interface ParameterData and
32810 two implementations: ReflectionParameters and InternalParameters
32811 used to access Parameter information. We will need to grow this
32814 * expression.cs (Invocation::GetParameterData): implement a cache
32815 and a wrapper around the ParameterData creation for methods.
32816 (Invocation::OverloadResolve): Use new code.
32818 2001-09-13 Ravi Pratap <ravi@ximian.com>
32820 * class.cs (TypeContainer::EmitField): Remove and move into
32821 (Field::Define): here and modify accordingly.
32822 (Field.FieldBuilder): New member.
32823 (TypeContainer::Populate): Update accordingly.
32824 (TypeContainer::FindMembers): Implement.
32826 2001-09-13 Miguel de Icaza <miguel@ximian.com>
32828 * statement.cs: (VariableInfo::VariableType): New field to be
32829 initialized with the full type once it is resolved.
32831 2001-09-12 Miguel de Icaza <miguel@ximian.com>
32833 * parameter.cs (GetParameterInfo): Use a type cache to compute
32834 things only once, and to reuse this information
32836 * expression.cs (LocalVariableReference::Emit): Implement.
32837 (OpcodeCast::Emit): fix.
32839 (ParameterReference::Resolve): Implement.
32840 (ParameterReference::Emit): Implement.
32842 * cs-parser.jay: Fix bug introduced by Ravi, variable initializers
32843 that are expressions need to stay as Expressions.
32845 * typemanager.cs (CSharpName): Returns the C# name of a type if
32848 * expression.cs (Expression::ConvertImplicit): New function that
32849 implements implicit type conversions.
32851 (Expression::ImplicitReferenceConversion): Implements implicit
32852 reference conversions.
32854 (EmptyCast): New type for transparent casts.
32856 (OpcodeCast): New type for casts of types that are performed with
32857 a sequence of bytecodes.
32859 (BoxedCast): New type used for casting value types into reference
32860 types. Emits a box opcode.
32862 (Binary::DoNumericPromotions): Implements numeric promotions of
32863 and computation of the Binary::Type.
32865 (Binary::EmitBranchable): Optimization.
32867 (Binary::Emit): Implement code emission for expressions.
32869 * typemanager.cs (TypeManager): Added two new core types: sbyte
32872 2001-09-12 Ravi Pratap <ravi@ximian.com>
32874 * class.cs (TypeContainer::FindMembers): Method which does exactly
32875 what Type.FindMembers does, only we don't have to use reflection. No
32876 implementation yet.
32878 * typemanager.cs (typecontainers): New hashtable to hold the corresponding
32879 typecontainer objects as we need to get at them.
32880 (TypeManager::AddUserType): Overload to take an extra argument, the TypeContainer.
32882 * rootcontext.cs : Correspondingly modify called to AddUserType to pass the
32883 typecontainer object.
32885 * expression.cs (MemberLookup): Modify signature to take a RootContext object instead
32886 of just a Report object.
32888 2001-09-11 Ravi Pratap <ravi@ximian.com>
32890 * class.cs (Event::Define): Go back to using the prefixes "add_" and
32892 (TypeContainer::Populate): Now define the delegates of the type too.
32893 (TypeContainer.Delegates): Property to access the list of delegates defined
32896 * delegates.cs (Delegate::Define): Implement partially.
32898 * modifiers.cs (TypeAttr): Handle more flags.
32900 2001-09-11 Ravi Pratap <ravi@ximian.com>
32902 * class.cs (Indexer::Define): Fix for loop iteration condition to be just <
32904 (Operator::Define): Re-write logic to get types by using the LookupType method
32905 instead of blindly doing a Type.GetType ! How stupid can I get ;-) ?
32906 (Indexer::Define): Ditto.
32907 (Event::Define): Ditto.
32908 (Property::Define): Ditto.
32910 2001-09-10 Ravi Pratap <ravi@ximian.com>
32912 * class.cs (TypeContainer::Populate): Now define operators too.
32913 (TypeContainer.Operators): New property to access the list of operators
32915 (Operator.OperatorMethodBuilder): New member to hold the method builder
32916 for the operator we are defining.
32917 (Operator::Define): Implement.
32919 2001-09-10 Ravi Pratap <ravi@ximian.com>
32921 * class.cs (Event::Define): Make the prefixes of the accessor methods
32922 addOn_ and removeOn_
32924 * genericparser.cs (GenericParser::error): Overloaded method to handle the case
32925 of the location being passed in too. Ideally, this should go later since all
32926 error reporting should be done through the Report object.
32928 * class.cs (TypeContainer.Indexers): New property to access the list of indexers.
32929 (Populate): Iterate thru the indexers we have and define them too.
32930 (Indexer.GetMethodBuilder, .SetMethodBuilder): New members to hold the method builders
32931 for the get and set accessors.
32932 (Indexer::Define): Implement.
32934 2001-09-09 Miguel de Icaza <miguel@ximian.com>
32936 * expression.cs (Binary::Resolve): Beginning of it. I scratched
32937 my previous implementation, did not work.
32939 * typemanager.cs: Add a couple of missing types (the longs).
32941 * literal.cs: Use TypeManager.bool_type instead of getting it.
32943 * expression.cs (EventExpr): New kind of expressions.
32944 (Expressio::ExprClassFromMemberInfo): finish
32946 2001-09-08 Miguel de Icaza <miguel@ximian.com>
32948 * assign.cs: Emit stores to static fields differently.
32950 2001-09-08 Ravi Pratap <ravi@ximian.com>
32952 * Merge in changes and adjust code to tackle conflicts. Backed out my
32953 code in Assign::Resolve ;-)
32955 2001-09-08 Ravi Pratap <ravi@ximian.com>
32957 * cs-parser.jay (CheckAttributeTarget): Modify call to error to use
32958 instead Report.Error and also pass in the location.
32959 (CSharpParser::Lexer): New readonly property to return the reference
32960 to the Tokenizer object.
32961 (declare_local_variables): Use Report.Error with location instead of plain
32965 * class.cs (Operator::CheckUnaryOperator): Move into cs-parser.jay.
32966 (Operator.CheckBinaryOperator): Ditto.
32968 * cs-parser.jay (operator_declarator): Update accordingly.
32970 * cs-parser.jay (CheckUnaryOperator): Modify to use Report.Error
32971 (CheckBinaryOperator): Same here.
32973 * rootcontext.cs (LookupType): Add an extra lookup which simply does a lookup
32974 on the name without any prefixes of namespace names etc. This is because we
32975 already might have something already fully qualified like
32976 'System.Console.WriteLine'
32978 * assign.cs (Resolve): Begin implementation. Stuck ;-)
32980 2001-09-07 Ravi Pratap <ravi@ximian.com>
32982 * cs-tokenizer.cs (location): Return a string which also contains
32985 * expression.cs (ElementAccess): New class for expressions of the
32986 type 'element access.'
32987 (BaseAccess): New class for expressions of the type 'base access.'
32988 (CheckedExpr, UnCheckedExpr): New classes for Checked and Unchecked expressions
32991 * cs-parser.jay (element_access): Implement action.
32992 (base_access): Implement actions.
32993 (checked_expression, unchecked_expression): Implement.
32995 * cs-parser.jay (local_variable_type): Correct and implement.
32996 (type_suffixes, type_suffix_list, type_suffix): Implement actions.
32998 * cs-tokenizer.cs (real_type_suffix): Comment out the extra getchar.
33000 * cs-parser.jay (rank_specifiers): Remove space while concatenating the type's
33001 name and the specifiers.
33003 * interface.cs (InterfaceAttr): New property to return the corresponding TypeAttributes
33005 * rootcontext.cs (CreateInterface): Use the InterfaceAttr property instead of
33006 making them all public ;-)
33008 * cs-parser.jay (error): Remove entirely as we have an implementation in the base
33011 2001-09-07 Miguel de Icaza <miguel@ximian.com>
33013 * expression.cs (ExprClassFromMemberInfo): Return FieldExpr and
33015 (FieldExpr, PropertyExprs): New resolved expressions.
33016 (SimpleName::MemberStaticCheck): Perform static checks for access
33017 to non-static fields on static methods. Maybe this should be
33018 generalized for MemberAccesses.
33019 (SimpleName::ResolveSimpleName): More work on simple name
33022 * cs-parser.jay (primary_expression/qualified_identifier): track
33023 the parameter index.
33025 * codegen.cs (CodeGen::Save): Catch save exception, report error.
33026 (EmitContext::EmitBoolExpression): Chain to expression generation
33027 instead of temporary hack.
33028 (::EmitStatementExpression): Put generic expression code generation.
33030 * assign.cs (Assign::Emit): Implement variable assignments to
33031 local variables, parameters and fields.
33033 2001-09-06 Miguel de Icaza <miguel@ximian.com>
33035 * statement.cs (Block::GetVariableInfo): New method, returns the
33036 VariableInfo for a variable name in a block.
33037 (Block::GetVariableType): Implement in terms of GetVariableInfo
33039 * literal.cs (IntLiteral::Emit, FloatLiteral::Emit,
33040 DoubleLiteral::Emit, CharLiteral::Emit, BoolLiteral::Emit): Implement
33042 2001-09-06 Ravi Pratap <ravi@ximian.com>
33044 * cs-parser.jay (operator_declaration): Continue on my quest : update
33045 to take attributes argument.
33046 (event_declaration): Ditto.
33047 (enum_declaration): Ditto.
33048 (indexer_declaration): Ditto.
33050 * class.cs (Operator::Operator): Update constructor accordingly.
33051 (Event::Event): Ditto.
33053 * delegate.cs (Delegate::Delegate): Same here.
33055 * enum.cs (Enum::Enum): Same here.
33057 2001-09-05 Ravi Pratap <ravi@ximian.com>
33059 * cs-parser.jay (CheckAttributeTarget): Update to use the right error number.
33061 * ../tests/cs0658.cs : New file to demonstrate error 0658.
33063 * attribute.cs (Attributes): New class to encapsulate all attributes which were
33064 being passed around as an arraylist.
33065 (Attributes::AddAttribute): Method to add attribute sections.
33067 * cs-parser.jay (opt_attributes): Modify actions to use the new Attributes class.
33068 (struct_declaration): Update accordingly.
33069 (constant_declaration): Update.
33070 (field_declaration): Update.
33071 (method_header): Update.
33072 (fixed_parameter): Update.
33073 (parameter_array): Ditto.
33074 (property_declaration): Ditto.
33075 (destructor_declaration): Ditto.
33077 * class.cs (Struct::Struct): Update constructors accordingly.
33078 (Class::Class): Ditto.
33079 (Field::Field): Ditto.
33080 (Method::Method): Ditto.
33081 (Property::Property): Ditto.
33082 (TypeContainer::OptAttribute): update property's return type.
33084 * interface.cs (Interface.opt_attributes): New member.
33085 (Interface::Interface): Update to take the extra Attributes argument.
33087 * parameter.cs (Parameter::Parameter): Ditto.
33089 * constant.cs (Constant::Constant): Ditto.
33091 * interface.cs (InterfaceMemberBase): New OptAttributes field.
33092 (InterfaceMemberBase::InterfaceMemberBase): Update constructor to take
33093 the attributes as a parameter.
33094 (InterfaceProperty): Update constructor call.
33095 (InterfaceEvent): Ditto.
33096 (InterfaceMethod): Ditto.
33097 (InterfaceIndexer): Ditto.
33099 * cs-parser.jay (interface_indexer_declaration): Update call to constructor to
33100 pass the attributes too.
33101 (interface_event_declaration): Ditto.
33102 (interface_property_declaration): Ditto.
33103 (interface_method_declaration): Ditto.
33104 (interface_declaration): Ditto.
33106 2001-09-05 Miguel de Icaza <miguel@ximian.com>
33108 * class.cs (Method::Define): Track the "static Main" definition to
33109 create an entry point.
33111 * rootcontext.cs (RootContext::EntryPoint): MethodInfo that holds the
33112 EntryPoint if we find it.
33114 * codegen.cs (EmitContext::EmitInvocation): Emit invocations.
33115 (EmitContext::ig): Make this variable public.
33117 * driver.cs: Make the default output file be the first file name
33118 with the .exe extension.
33120 Detect empty compilations
33122 Handle various kinds of output targets. Handle --target and
33123 rename -t to --dumper.
33125 * expression.cs, literal.cs, assign.cs, constant.cs: All `Resolve'
33126 methods inherited from Expression return now an Expression. This
33127 will is used during the tree rewriting as we resolve them during
33130 (Expression::MemberLookup): Implements the MemberLookup (7.3) from
33131 the spec. Missing entirely is the information about
33132 accessability of elements of it.
33134 (Expression::ExprClassFromMemberInfo): New constructor for
33135 Expressions that creates a fully initialized Expression based on
33136 a MemberInfo that is one of Eventinfo, FieldINfo, PropertyInfo or
33139 (Invocation::Resolve): Begin implementing resolution of invocations.
33141 * literal.cs (StringLiteral): Implement Emit.
33143 2001-09-05 Ravi Pratap <ravi@ximian.com>
33145 * cs-parser.jay (error): Add new modifier because we are hiding an inherited
33148 2001-09-04 Ravi Pratap <ravi@ximian.com>
33150 * cs-parser.jay (attribute_arguments): Implement actions.
33151 (attribute): Fix bug in production. Implement action.
33152 (attribute_list): Implement.
33153 (attribute_target): Implement.
33154 (attribute_target_specifier, opt_target_specifier): Implement
33155 (CheckAttributeTarget): New method to check if the attribute target
33157 (attribute_section): Implement.
33158 (opt_attributes): Implement.
33160 * attribute.cs : New file to handle attributes.
33161 (Attribute): Class to hold attribute info.
33163 * cs-parser.jay (opt_attribute_target_specifier): Remove production
33164 (attribute_section): Modify production to use 2 different rules to
33165 achieve the same thing. 1 s/r conflict down !
33166 Clean out commented, useless, non-reducing dimension_separator rules.
33168 * class.cs (TypeContainer.attributes): New member to hold list
33169 of attributes for a type.
33170 (Struct::Struct): Modify to take one more argument, the attribute list.
33171 (Class::Class): Ditto.
33172 (Field::Field): Ditto.
33173 (Method::Method): Ditto.
33174 (Property::Property): Ditto.
33176 * cs-parser.jay (struct_declaration): Update constructor call to
33177 pass in the attributes too.
33178 (class_declaration): Ditto.
33179 (constant_declaration): Ditto.
33180 (field_declaration): Ditto.
33181 (method_header): Ditto.
33182 (fixed_parameter): Ditto.
33183 (parameter_array): Ditto.
33184 (property_declaration): Ditto.
33186 * constant.cs (Constant::Constant): Update constructor similarly.
33187 Use System.Collections.
33189 * parameter.cs (Parameter::Parameter): Update as above.
33191 2001-09-02 Ravi Pratap <ravi@ximian.com>
33193 * class.cs (TypeContainer::AddDelegate): New method to add a delegate.
33194 (TypeContainer.delegates): New member to hold list of delegates.
33196 * cs-parser.jay (delegate_declaration): Implement the action correctly
33197 this time as I seem to be on crack ;-)
33199 2001-09-02 Miguel de Icaza <miguel@ximian.com>
33201 * rootcontext.cs (RootContext::IsNamespace): new function, used to
33202 tell whether an identifier represents a namespace.
33204 * expression.cs (NamespaceExpr): A namespace expression, used only
33205 temporarly during expression resolution.
33206 (Expression::ResolveSimpleName, ::ResolvePrimary, ::ResolveName):
33207 utility functions to resolve names on expressions.
33209 2001-09-01 Miguel de Icaza <miguel@ximian.com>
33211 * codegen.cs: Add hook for StatementExpressions.
33213 * class.cs: Fix inverted test for static flag in methods.
33215 2001-09-02 Ravi Pratap <ravi@ximian.com>
33217 * class.cs (Operator::CheckUnaryOperator): Correct error number used
33218 to make it coincide with MS' number.
33219 (Operator::CheckBinaryOperator): Ditto.
33221 * ../errors/errors.txt : Remove error numbers added earlier.
33223 * ../errors/cs1019.cs : Test case for error # 1019
33225 * ../errros/cs1020.cs : Test case for error # 1020
33227 * cs-parser.jay : Clean out commented cruft.
33228 (dimension_separators, dimension_separator): Comment out. Ostensibly not
33229 used anywhere - non-reducing rule.
33230 (namespace_declarations): Non-reducing rule - comment out.
33232 * enum.cs (Enum::AddEnum): Rename to AddEnumMember as I was getting confused
33233 with TypeContainer::AddEnum.
33235 * delegate.cs : New file for delegate handling classes.
33236 (Delegate): Class for declaring delegates.
33238 * makefile : Update.
33240 * cs-parser.jay (delegate_declaration): Implement.
33242 2001-09-01 Ravi Pratap <ravi@che.iitm.ac.in>
33244 * class.cs (Event::Define): Implement.
33245 (Event.EventBuilder): New member.
33247 * class.cs (TypeContainer::Populate): Update to define all enums and events
33249 (Events): New property for the events arraylist we hold. Shouldn't we move to using
33250 readonly fields for all these cases ?
33252 2001-08-31 Ravi Pratap <ravi@che.iitm.ac.in>
33254 * class.cs (Property): Revamp to use the convention of making fields readonly.
33255 Accordingly modify code elsewhere.
33257 * class.cs : Apply patch from Mr. Mandar <go_mono@hotmail.com> for implementing
33258 the Define method of the Property class.
33260 * class.cs : Clean up applied patch and update references to variables etc. Fix
33262 (TypeContainer::Populate): Update to define all the properties we have. Also
33263 define all enumerations.
33265 * enum.cs (Define): Implement.
33267 2001-08-31 Ravi Pratap <ravi@che.iitm.ac.in>
33269 * cs-parser.jay (overloadable_operator): The semantic value is an
33270 enum of the Operator class.
33271 (operator_declarator): Implement actions.
33272 (operator_declaration): Implement.
33274 * class.cs (Operator::CheckUnaryOperator): New static method to help in checking
33275 validity of definitions.
33276 (Operator::CheckBinaryOperator): Static method to check for binary operators
33277 (TypeContainer::AddOperator): New method to add an operator to a type.
33279 * cs-parser.jay (indexer_declaration): Added line to actually call the
33280 AddIndexer method so it gets added ;-)
33282 * ../errors/errors.txt : Update to include new error numbers. Are these numbers
33283 already taken care of by the MS compiler ?
33285 2001-08-29 Ravi Pratap <ravi@che.iitm.ac.in>
33287 * class.cs (Operator): New class for operator declarations.
33288 (Operator::OpType): Enum for the various operators.
33290 2001-08-29 Ravi Pratap <ravi@che.iitm.ac.in>
33292 * class.cs (TypeContainer::AddIndexer): Remove FIXME comment. We
33293 ostensibly handle this in semantic analysis.
33295 * cs-parser.jay (general_catch_clause): Comment out
33296 (specific_catch_clauses, specific_catch_clause): Ditto.
33297 (opt_general_catch_clause, opt_specific_catch_clauses): Ditto
33298 (catch_args, opt_catch_args): New productions.
33299 (catch_clause): Rewrite to use the new productions above
33300 (catch_clauses): Modify accordingly.
33301 (opt_catch_clauses): New production to use in try_statement
33302 (try_statement): Revamp. Basically, we get rid of one unnecessary rule
33303 and re-write the code in the actions to extract the specific and
33304 general catch clauses by being a little smart ;-)
33306 * ../tests/try.cs : Fix. It's not 'finalize' my friend, it's 'finally' !
33307 Hooray, try and catch statements parse fine !
33309 2001-08-28 Ravi Pratap <ravi@che.iitm.ac.in>
33311 * statement.cs (Block::GetVariableType): Fix logic to extract the type
33312 string from the hashtable of variables.
33314 * cs-parser.jay (event_accessor_declarations): Trivial fix. Man, how did
33315 I end up making that mistake ;-)
33316 (catch_clauses): Fixed gross error which made Key and Value of the
33317 DictionaryEntry the same : $1 !!
33319 2001-08-28 Ravi Pratap <ravi@che.iitm.ac.in>
33321 * cs-tokenizer.cs (initTokens): Add keywords 'add' and 'remove'
33323 * cs-parser.jay (event_declaration): Correct to remove the semicolon
33324 when the add and remove accessors are specified.
33326 2001-08-28 Ravi Pratap <ravi@che.iitm.ac.in>
33328 * cs-parser.jay (IndexerDeclaration): New helper class to hold
33329 information about indexer_declarator.
33330 (indexer_declarator): Implement actions.
33331 (parsing_indexer): New local boolean used to keep track of whether
33332 we are parsing indexers or properties. This is necessary because
33333 implicit_parameters come into picture even for the get accessor in the
33334 case of an indexer.
33335 (get_accessor_declaration, set_accessor_declaration): Correspondingly modified.
33337 * class.cs (Indexer): New class for indexer declarations.
33338 (TypeContainer::AddIndexer): New method to add an indexer to a type.
33339 (TypeContainer::indexers): New member to hold list of indexers for the
33342 2001-08-27 Ravi Pratap <ravi@che.iitm.ac.in>
33344 * cs-parser.jay (add_accessor_declaration): Implement action.
33345 (remove_accessor_declaration): Implement action.
33346 (event_accessors_declaration): Implement
33347 (variable_declarators): swap statements for first rule - trivial.
33349 * class.cs (Event): New class to hold information about event
33351 (TypeContainer::AddEvent): New method to add an event to a type
33352 (TypeContainer::events): New member to hold list of events.
33354 * cs-parser.jay (event_declaration): Implement actions.
33356 2001-08-27 Ravi Pratap <ravi@che.iitm.ac.in>
33358 * cs-parser.jay (dim_separators): Implement. Make it a string
33359 concatenating all the commas together, just as they appear.
33360 (opt_dim_separators): Modify accordingly
33361 (rank_specifiers): Update accordingly. Basically do the same
33362 thing - instead, collect the brackets here.
33363 (opt_rank_sepcifiers): Modify accordingly.
33364 (array_type): Modify to actually return the complete type string
33365 instead of ignoring the rank_specifiers.
33366 (expression_list): Implement to collect the expressions
33367 (variable_initializer): Implement. We make it a list of expressions
33368 essentially so that we can handle the array_initializer case neatly too.
33369 (variable_initializer_list): Implement.
33370 (array_initializer): Make it a list of variable_initializers
33371 (opt_array_initializer): Modify accordingly.
33373 * expression.cs (New::NType): Add enumeration to help us
33374 keep track of whether we have an object/delegate creation
33375 or an array creation.
33376 (New:NewType, New::Rank, New::Indices, New::Initializers): New
33377 members to hold data about array creation.
33378 (New:New): Modify to update NewType
33379 (New:New): New Overloaded contructor for the array creation
33382 * cs-parser.jay (array_creation_expression): Implement to call
33383 the overloaded New constructor.
33385 2001-08-26 Ravi Pratap <ravi@che.iitm.ac.in>
33387 * class.cs (TypeContainer::Constructors): Return member
33388 constructors instead of returning null.
33390 2001-08-26 Miguel de Icaza <miguel@ximian.com>
33392 * typemanager.cs (InitCoreTypes): Initialize the various core
33393 types after we have populated the type manager with the user
33394 defined types (this distinction will be important later while
33395 compiling corlib.dll)
33397 * expression.cs, literal.cs, assign.cs, constant.cs: Started work
33398 on Expression Classification. Now all expressions have a method
33399 `Resolve' and a method `Emit'.
33401 * codegen.cs, cs-parser.jay: Fixed the bug that stopped code
33402 generation from working. Also add some temporary debugging
33405 2001-08-24 Miguel de Icaza <miguel@ximian.com>
33407 * codegen.cs: Lots of code generation pieces. This is only the
33408 beginning, will continue tomorrow with more touches of polish. We
33409 handle the fundamentals of if, while, do, for, return. Others are
33410 trickier and I need to start working on invocations soon.
33412 * gen-treedump.cs: Bug fix, use s.Increment here instead of
33415 * codegen.cs (EmitContext): New struct, used during code
33416 emission to keep a context. Most of the code generation will be
33419 * cs-parser.jay: Add embedded blocks to the list of statements of
33420 this block. So code generation proceeds in a top down fashion.
33422 2001-08-23 Miguel de Icaza <miguel@ximian.com>
33424 * statement.cs: Add support for multiple child blocks.
33426 2001-08-22 Miguel de Icaza <miguel@ximian.com>
33428 * codegen.cs (EmitCode): New function, will emit the code for a
33429 Block of code given a TypeContainer and its ILGenerator.
33431 * statement.cs (Block): Standard public readonly optimization.
33432 (Block::Block constructors): Link children.
33433 (Block::Child): Child Linker.
33434 (Block::EmitVariables): Emits IL variable declarations.
33436 * class.cs: Drop support for MethodGroups here, delay until
33438 (Method::): Applied the same simplification that I did before, and
33439 move from Properties to public readonly fields.
33440 (Method::ParameterTypes): Returns the parameter types for the
33441 function, and implements a cache that will be useful later when I
33442 do error checking and the semantic analysis on the methods is
33444 (Constructor::GetCallingConvention): Renamed from CallingConvetion
33445 and made a method, optional argument tells whether this is a class
33446 or a structure to apply the `has-this' bit.
33447 (Method::GetCallingConvention): Implement, returns the calling
33449 (Method::Define): Defines the type, a second pass is performed
33450 later to populate the methods.
33452 (Constructor::ParameterTypes): implement a cache similar to the
33453 one on Method::ParameterTypes, useful later when we do semantic
33456 (TypeContainer::EmitMethod): New method. Emits methods.
33458 * expression.cs: Removed MethodGroup class from here.
33460 * parameter.cs (Parameters::GetCallingConvention): new method.
33462 2001-08-21 Miguel de Icaza <miguel@ximian.com>
33464 * class.cs (TypeContainer::Populate): Drop RootContext from the
33467 (Constructor::CallingConvention): Returns the calling convention.
33468 (Constructor::ParameterTypes): Returns the constructor parameter
33471 (TypeContainer::AddConstructor): Keep track of default constructor
33472 and the default static constructor.
33474 (Constructor::) Another class that starts using `public readonly'
33475 instead of properties.
33477 (Constructor::IsDefault): Whether this is a default constructor.
33479 (Field::) use readonly public fields instead of properties also.
33481 (TypeContainer::TypeAttr, TypeContainer::AddConstructor): Keep
33482 track of static constructors; If none is used, turn on
33483 BeforeFieldInit in the TypeAttributes.
33485 * cs-parser.jay (opt_argument_list): now the return can be null
33486 for the cases where there are no arguments.
33488 (constructor_declarator): If there is no implicit `base' or
33489 `this', then invoke the default parent constructor.
33491 * modifiers.cs (MethodAttr): New static function maps a set of
33492 modifiers flags into a MethodAttributes enum
33493 (FieldAttr): renamed from `Map'. So now we have FieldAttr,
33494 MethodAttr, TypeAttr to represent the various mappings where the
33495 modifiers are used.
33496 (FieldAttr): Map also `readonly' to `FieldAttributes.InitOnly'
33498 2001-08-19 Miguel de Icaza <miguel@ximian.com>
33500 * parameter.cs (GetParameterInfo): Fix bug where there would be no
33503 * interface.cs (PopulateIndexer): Implemented the code generator
33504 for interface indexers.
33506 2001-08-17 Miguel de Icaza <miguel@ximian.com>
33508 * interface.cs (InterfaceMemberBase): Now we track the new status
33511 (PopulateProperty): Implement property population. Woohoo! Got
33512 Methods and Properties going today.
33514 Removed all the properties for interfaces, and replaced them with
33515 `public readonly' fields.
33517 2001-08-16 Miguel de Icaza <miguel@ximian.com>
33519 * interface.cs (AddEvent, AddMethod, AddIndexer, AddProperty):
33520 initialize their hashtables/arraylists only when they are needed
33521 instead of doing this always.
33523 * parameter.cs: Handle refs and out parameters.
33525 * cs-parser.jay: Use an ArrayList to construct the arguments
33526 instead of the ParameterCollection, and then cast that to a
33529 * parameter.cs: Drop the use of ParameterCollection and use
33530 instead arrays of Parameters.
33532 (GetParameterInfo): Use the Type, not the Name when resolving
33535 2001-08-13 Miguel de Icaza <miguel@ximian.com>
33537 * parameter.cs: Eliminate the properties Name, Type and ModFlags,
33538 and instead use public readonly fields.
33540 * class.cs: Put back walking code for type containers.
33542 2001-08-11 Miguel de Icaza <miguel@ximian.com>
33544 * class.cs (MakeConstant): Code to define constants.
33546 * rootcontext.cs (LookupType): New function. Used to locate types
33549 2001-08-08 Miguel de Icaza <miguel@ximian.com>
33551 * rootcontext.cs: OH MY! My trick works! It is amazing how nice
33552 this System.Reflection code is. Kudos to Microsoft
33554 * typemanager.cs: Implement a type cache and avoid loading all
33555 types at boot time. Wrap in LookupType the internals. This made
33556 the compiler so much faster. Wow. I rule!
33558 * driver.cs: Make sure we always load mscorlib first (for
33559 debugging purposes, nothing really important).
33561 * Renamespaced things that were on `CSC' to `CIR'. Maybe I should
33562 have moved to `CSC' rather than `CIR'. Oh man! The confussion!
33564 * rootcontext.cs: Lookup types on their namespace; Lookup types
33565 on namespaces that have been imported using the `using' keyword.
33567 * class.cs (TypeContainer::TypeAttr): Virtualize.
33568 (Class::TypeAttr): Return attributes suitable for this bad boy.
33569 (Struct::TypeAttr): ditto.
33570 Handle nested classes.
33571 (TypeContainer::) Remove all the type visiting code, it is now
33572 replaced with the rootcontext.cs code
33574 * rootcontext.cs (GetClassBases): Added support for structs.
33576 2001-08-06 Miguel de Icaza <miguel@ximian.com>
33578 * interface.cs, statement.cs, class.cs, parameter.cs,
33579 rootcontext.cs, gen-treedump.cs, enum.cs, cs-parse.jay:
33580 Drop use of TypeRefs, and use strings instead.
33582 2001-08-04 Miguel de Icaza <miguel@ximian.com>
33586 * class.cs (Struct::Struct): set the SEALED flags after
33587 checking the modifiers.
33588 (TypeContainer::TypeAttr): new property, returns the
33589 TypeAttributes for a class.
33591 * cs-parser.jay (type_list): Oops, list production was creating a
33592 new list of base types.
33594 * rootcontext.cs (StdLib): New property.
33595 (GetInterfaceTypeByName): returns an interface by type name, and
33596 encapsulates error handling here.
33597 (GetInterfaces): simplified.
33598 (ResolveTree): Encapsulated all the tree resolution here.
33599 (CreateClass, GetClassBases, GetInterfaceOrClass): Create class
33602 * driver.cs: Add support for --nostdlib, to avoid loading the
33603 default assemblies.
33604 (Main): Do not put tree resolution here.
33606 * rootcontext.cs: Beginning of the class resolution.
33608 2001-08-03 Miguel de Icaza <miguel@ximian.com>
33610 * rootcontext.cs: Provide better error reporting.
33612 * cs-parser.jay (interface_base): set our $$ to be interfaces.
33614 * rootcontext.cs (CreateInterface): Handle the case where there
33615 are no parent interfaces.
33617 (CloseTypes): Routine to flush types at the end.
33618 (CreateInterface): Track types.
33619 (GetInterfaces): Returns an array of Types from the list of
33620 defined interfaces.
33622 * typemanager.c (AddUserType): Mechanism to track user types (puts
33623 the type on the global type hash, and allows us to close it at the
33626 2001-08-02 Miguel de Icaza <miguel@ximian.com>
33628 * tree.cs: Removed RecordType, added RecordClass, RecordStruct and
33629 RecordInterface instead.
33631 * cs-parser.jay: Updated to reflect changes above.
33633 * decl.cs (Definition): Keep track of the TypeBuilder type that
33634 represents this type here. Not sure we will use it in the long
33635 run, but wont hurt for now.
33637 * driver.cs: Smaller changes to accomodate the new code.
33639 Call ResolveInterfaceBases, Call ResolveClassBases, Save assembly
33642 * rootcontext.cs (CreateInterface): New method, used to create
33643 the System.TypeBuilder type for interfaces.
33644 (ResolveInterfaces): new entry point to resolve the interface
33646 (CodeGen): Property, used to keep track of the code generator.
33648 2001-07-26 Miguel de Icaza <miguel@ximian.com>
33650 * cs-parser.jay: Add a second production for delegate_declaration
33653 (enum_body): Put an opt_comma here instead of putting it on
33654 enum_body or enum_member_declarations so we can handle trailing
33655 commas on enumeration members. Gets rid of a shift/reduce.
33657 (type_list): Need a COMMA in the middle.
33659 (indexer_declaration): Tell tokenizer to recognize get/set
33661 * Remove old targets.
33663 * Re-add the parser target.
33665 2001-07-13 Simon Cozens <simon@simon-cozens.org>
33667 * cs-parser.jay: Add precendence rules for a number of operators
33668 ot reduce the number of shift/reduce conflicts in the grammar.
33670 2001-07-17 Miguel de Icaza <miguel@ximian.com>
33672 * tree.cs: moved IGenerator interface and renamed it to ITreeDump
33675 Get rid of old crufty code.
33677 * rootcontext.cs: Use this to keep track of the parsed
33678 representation and the defined types available to the program.
33680 * gen-treedump.cs: adjust for new convention.
33682 * type.cs: Split out the type manager, and the assembly builder
33685 * typemanager.cs: the type manager will live here now.
33687 * cil-codegen.cs: And the code generator here.
33689 2001-07-14 Sean MacIsaac <macisaac@ximian.com>
33691 * makefile: Fixed up for easy making.
33693 2001-07-13 Simon Cozens <simon@simon-cozens.org>
33695 * cs-parser.jay (rank_specifier): Remove a conflict by reordering
33698 (unary_expression): Expand pre_increment_expression and
33699 post_decrement_expression to reduce a shift/reduce.
33701 2001-07-11 Simon Cozens
33703 * cs-tokenizer.cs: Hex numbers should begin with a 0.
33705 Improve allow_keyword_as_indent name.
33707 2001-06-19 Miguel de Icaza <miguel@ximian.com>
33709 * Adjustments for Beta2.
33711 2001-06-13 Miguel de Icaza <miguel@ximian.com>
33713 * decl.cs: Added `Define' abstract method.
33714 (InTransit): new property, used to catch recursive definitions.
33716 * interface.cs: Implement `Define'.
33718 * modifiers.cs: Map Modifiers.constants to
33719 System.Reflection.TypeAttribute flags.
33721 * class.cs: Keep track of types and user-defined types.
33722 (BuilderInit): New method for creating an assembly
33723 (ResolveType): New function to launch the resolution process, only
33724 used by interfaces for now.
33726 * cs-parser.jay: Keep track of Classes, Structs and Interfaces
33727 that are inserted into the name space.
33729 2001-06-08 Miguel de Icaza <miguel@ximian.com>
33731 * ARGH. I have screwed up my tree so many times due to the use of
33732 rsync rather than using CVS. Going to fix this at once.
33734 * driver.cs: Objetify driver. Load assemblies, use assemblies to
33737 2001-06-07 Miguel de Icaza <miguel@ximian.com>
33739 * Experiment successful: Use System.Type rather that our own
33742 2001-05-25 Miguel de Icaza <miguel@ximian.com>
33744 * cs-parser.jay: Removed nsAliases from here.
33746 Use new namespaces, handle `using XXX;'
33748 * namespace.cs: Reimplemented namespace handling, use a recursive
33749 definition of the class. Now we can keep track of using clauses
33750 and catch invalid using clauses.
33752 2001-05-24 Miguel de Icaza <miguel@ximian.com>
33754 * gen-treedump.cs: Adapted for all the renaming.
33756 * expression.cs (Expression): this class now has a Type property
33757 which returns an expression Type.
33759 (Probe::, New::, TypeOf::, SizeOf::, Constant::): renamed from
33760 `Type', as this has a different meaning now in the base
33762 2001-05-22 Miguel de Icaza <miguel@ximian.com>
33764 * interface.cs, class.cs: Removed from all the sources the
33765 references to signature computation, as we can not do method
33766 signature computation during the parsing time, as we are not
33767 trying to solve at that point distinguishing:
33771 void a (NS.Blah x) {}
33774 Which depending on the context might be valid or not, as we do not
33775 know if Blah is the same thing as NS.Blah at that point.
33777 * Redid everything so the code uses TypeRefs now instead of
33778 Types. TypeRefs are just temporary type placeholders, that need
33779 to be resolved. They initially have a pointer to a string and the
33780 current scope in which they are used. This is used later by the
33781 compiler to resolve the reference to an actual Type.
33783 * DeclSpace is no longer a CIR.Type, and neither are
33784 TypeContainers (Class and Struct) nor Interfaces nor Enums. They
33785 are all DeclSpaces, but no Types.
33787 * type.cs (TypeRefManager): This implements the TypeRef manager,
33788 which keeps track of all the types that need to be resolved after
33789 the parsing has finished.
33791 2001-05-13 Miguel de Icaza <miguel@ximian.com>
33793 * ARGH. We are going to have to store `foreach' as a class rather
33794 than resolving it, as we need to verify error 1579 after name
33795 resolution. *OR* we could keep a flag that says `This request to
33796 IEnumerator comes from a foreach statement' which we can then use
33797 to generate the error.
33799 2001-05-10 Miguel de Icaza <miguel@ximian.com>
33801 * class.cs (TypeContainer.AddMethod): we now add methods to the
33802 MethodGroup instead of the method hashtable.
33804 * expression.cs: Add MethodGroup abstraction, which gets us one
33805 step closer to the specification in the way we handle method
33808 * cs-parser.jay (primary_expression): qualified_identifier now
33809 tried to match up an identifier to a local variable reference or
33810 to a parameter reference.
33812 current_local_parameters is now a parser global variable that
33813 points to the current parameters for the block, used during name
33816 (property_declaration): Now creates an implicit `value' argument to
33819 2001-05-09 Miguel de Icaza <miguel@ximian.com>
33821 * parameter.cs: Do not use `param' arguments as part of the
33822 signature, per the spec.
33824 2001-05-08 Miguel de Icaza <miguel@ximian.com>
33826 * decl.cs: Base class for classes, structs and interfaces. This
33827 is the "Declaration Space"
33829 * cs-parser.jay: Use CheckDef for checking declaration errors
33830 instead of having one on each function.
33832 * class.cs: Factor out some code for handling error handling in
33833 accordance to the "Declarations" section in the "Basic Concepts"
33834 chapter in the ECMA C# spec.
33836 * interface.cs: Make all interface member classes derive from
33837 InterfaceMemberBase.
33839 2001-05-07 Miguel de Icaza <miguel@ximian.com>
33841 * Many things: all interfaces are parsed and generated in
33842 gen-treedump. Support for member variables, constructors,
33843 destructors, properties, constants is there.
33845 Beginning of the IL backend, but very little done, just there for
33848 2001-04-29 Miguel de Icaza <miguel@ximian.com>
33850 * cs-parser.jay: Fix labeled statement.
33852 * cs-tokenizer.cs (escape): Escape " and ' always.
33853 ref_line, ref_name: keep track of the line/filename as instructed
33854 by #line by the compiler.
33857 2001-04-27 Miguel de Icaza <miguel@ximian.com>
33859 * System.CodeDOM/CodeBinaryOperatorExpression.cs: Rearrange enum
33860 to match the values in System.CodeDOM.
33862 Divid renamed to Divide.
33864 * System.CodeDOM/CodeForLoopStatement.cs: Always have valid
33866 (Statements.set): remove.
33868 * System.CodeDOM/CodeCatchClause.cs: always have a valid
33871 * System.CodeDOM/CodeIfStatement.cs: trueStatements and
33872 falseStatements always have valid values.
33874 * cs-parser.jay: Use System.CodeDOM now.