1 2010-07-12 Marek Safar <marek.safar@gmail.com>
3 * generic.cs: Don't use Report directly.
5 * expression.cs, ecore.cs: UserOperatorCall uses MethodSpec without
6 MethodGroupExpr, will be simplified later.
8 2010-07-09 Marek Safar <marek.safar@gmail.com>
10 * property.cs, parameters.cs: Inflated IndexerSpec parameters.
12 * import.cs: Don't build unused parameters.
14 2010-07-08 Marek Safar <marek.safar@gmail.com>
16 * expression.cs (Invocation): Don't recreate simple-name expression.
18 2010-07-07 Marek Safar <marek.safar@gmail.com>
20 * ecore.cs: Don't report NRE warning for lifted null.
22 2010-07-07 Marek Safar <marek.safar@gmail.com>
24 * typemanager.cs, convert.cs, expression.cs: Another reference
25 equality implementation attack (Fixes #620025, #579058).
27 2010-07-05 Marek Safar <marek.safar@gmail.com>
29 * context.cs, expression.cs, ecore.cs: BaseThis is fully based on
30 this expression (Fixes #619904).
32 2010-07-05 Marek Safar <marek.safar@gmail.com>
34 * membercache.cs, class.cs: Don't use base member to check for
35 property or indexer base implementation.
37 2010-07-03 Marek Safar <marek.safar@gmail.com>
39 * membercache.cs: Copy Membercache member state flags for 2 stage
40 inflate (Fixes #619555).
42 * ecore.cs: Use resolved accessors everywhere.
44 2010-07-02 Marek Safar <marek.safar@gmail.com>
47 * membercache.cs, property.cs: Check accessors of base property and
50 2010-07-02 Marek Safar <marek.safar@gmail.com>
52 * modifiers.cs, membercache.cs, import.cs, class.cs: Moved imported
53 override method checks into import.
55 * expression.cs: Removed redundant check.
57 2010-06-30 Marek Safar <marek.safar@gmail.com>
59 * nullable.cs, expression.cs, statement.cs, method.cs, ecore.cs,
60 delegate.cs, cs-parser.jay, visit.cs: Use MemberAccess to resolve
61 base access expression, it has all bits done correctly.
63 2010-06-30 Marek Safar <marek.safar@gmail.com>
65 * support.cs: Removed unused code.
67 * ecore.cs: Don't use memberlookup for operators.
69 2010-06-30 Marek Safar <marek.safar@gmail.com>
71 * typemanager.cs, membercache.cs, convert.cs, expression.cs,
72 ecore.cs: Replace remaining MethodLookup with correct user operator
73 lookup (to do correct deep lookup). Clean up most of outstanding
74 quirks in binary operator overload resolution.
76 2010-06-29 Marek Safar <marek.safar@gmail.com>
78 * import.cs: Operators must have between 1 and 2 parameters.
80 * method.cs: Switch destructor to direct membercache lookup
82 2010-06-29 Marek Safar <marek.safar@gmail.com>
84 * driver.cs, expression.cs: Use Membercache for StringConcat when
85 it got all what is needed.
87 2010-06-29 Marek Safar <marek.safar@gmail.com>
89 * membercache.cs, expression.cs, statement.cs, doc.cs, ecore.cs:
90 Changed FindMembers to allocate a new list only when a filter is
91 used. Saves decent chunk of memory and should save even more in the
92 future when the filter is not used that often.
94 2010-06-28 Marek Safar <marek.safar@gmail.com>
96 * field.cs, property.cs, assign.cs, const.cs, expression.cs,
97 ecore.cs, class.cs, cs-parser.jay, enum.cs: Don't use intermediate
98 structure for simple type fields (saves memory and makes few things
99 simpler). Clean up some hacks mostly for events.
101 2010-06-25 Marek Safar <marek.safar@gmail.com>
103 * statement.cs, cs-parser.jay: Don't create expensive block for
106 2010-06-24 Marek Safar <marek.safar@gmail.com>
108 * statement.cs, report.cs: Rethrow internal error when reporting is
111 * ecore.cs: Check for identical name only when simple name is set.
114 2010-06-24 Marek Safar <marek.safar@gmail.com>
116 A fix for bug #616809
117 * generic.cs, expression.cs, ecore.cs: Added a new type expression
118 for open generic type to pass unbound type arguments to typeof
121 2010-06-24 Marek Safar <marek.safar@gmail.com>
123 * statement.cs: Foreach collection implementation refactoring to
124 search for GetEnumerator more preciselly. Fixes #431453 and more
127 * linq.cs, decl.cs, ecore.cs, delegate.cs: Update methodgroup api.
129 2010-06-23 Marek Safar <marek.safar@gmail.com>
131 * cs-parser.jay: Track more locations.
133 2010-06-22 Marek Safar <marek.safar@gmail.com>
135 * cs-tokenizer.cs, location.cs, cs-parser.jay: Track more locations.
137 2010-06-18 Marek Safar <marek.safar@gmail.com>
139 * cs-tokenizer.cs, anonymous.cs, expression.cs, statement.cs,
140 support.cs, location.cs, cs-parser.jay: Some work on full ast mode.
142 2010-06-18 Marek Safar <marek.safar@gmail.com>
144 * convert.cs, typespec.cs, method.cs: Fixed few more dynamic
147 2010-06-18 Marek Safar <marek.safar@gmail.com>
149 * typemanager.cs, namespace.cs: Report more predefined types and
150 imported types collision types as a warning.
151 Fixes #537414, #601157
153 2010-06-18 Marek Safar <marek.safar@gmail.com>
155 * generic.cs: Overrides base method constraint can use method type
158 * import.cs: Removed redundant cache.
160 2010-06-17 Marek Safar <marek.safar@gmail.com>
162 * generic.cs: Propagate type only inflate downwards.
164 2010-06-17 Marek Safar <marek.safar@gmail.com>
166 A fix for bug #614955
167 * method.cs: Do not reject binary dynamic operators.
169 2010-06-17 Marek Safar <marek.safar@gmail.com>
171 * typespec.cs: Internal types have no generic parameters.
174 2010-06-17 Marek Safar <marek.safar@gmail.com>
176 A fix for bug #614955
177 * cs-parser.jay: Correctly set expression mode for default parameter
180 2010-06-17 Marek Safar <marek.safar@gmail.com>
182 A fix for bug #615023
183 * ecore.cs: Resolve dynamic namespace and keyword collision in the
184 favour of the keyword.
186 2010-06-17 Marek Safar <marek.safar@gmail.com>
188 A fix for bug #614917
189 * convert.cs: Allow more undocumented 0 like values to enum type
192 2010-06-17 Marek Safar <marek.safar@gmail.com>
194 * generic.cs, method.cs: Inflate copied type parameters from base
195 class or explicit interfaces.
197 * convert.cs: Fixed conversion between two type parameters.
200 2010-06-16 Marek Safar <marek.safar@gmail.com>
202 * membercache.cs, convert.cs: Correctly resize an array used by
205 2010-06-15 Marek Safar <marek.safar@gmail.com>
207 A fix for bug #599601
208 * dynamic.cs, ecore.cs: A new flag for dynamic resolver to ignore
209 generated member access left expression.
211 2010-06-16 Marek Safar <marek.safar@gmail.com>
213 * expression.cs: Dispatch dynamic invocation solely on left
216 2010-06-16 Marek Safar <marek.safar@gmail.com>
218 * expression.cs, statement.cs: Always persist explicit cast
219 semantic at expression level.
221 2010-06-15 Marek Safar <marek.safar@gmail.com>
223 * expression.cs, attribute.cs: Enable generic type parameters
226 2010-06-15 Marek Safar <marek.safar@gmail.com>
228 A fix for bug #612146
229 * generic.cs: Don't use fixed array for inflated type parameter
230 interface constraints.
232 2010-06-15 Marek Safar <marek.safar@gmail.com>
234 * typespec.cs: ElementTypeSpec has to use its own ITypeDefinition.
236 * report.cs: Unwrap elements for related symbols reporting.
238 2010-06-15 Marek Safar <marek.safar@gmail.com>
240 A fix for bug #612796
241 * cs-tokenizer.cs: Offset correctly keywords the first character
244 2010-06-15 Marek Safar <marek.safar@gmail.com>
246 A fix for bug #613397
247 * expression.cs: Removed too aggressive object initializers
250 2010-06-15 Marek Safar <marek.safar@gmail.com>
252 * parameter.cs, property.cs, membercache.cs, decl.cs, iterators.cs,
253 anonymous.cs, expression.cs, support.cs, method.cs, pending.cs,
254 class.cs, cs-parser.jay: Simplify parsing of accessors by removing
255 any intermediate steps and fake nodes, also saves few MBs of memory.
257 2010-06-11 Marek Safar <marek.safar@gmail.com>
259 * modifiers.cs, rootcontext.cs, location.cs, cs-parser.jay: More
260 precise modifiers parsing.
262 2010-06-09 Marek Safar <marek.safar@gmail.com>
264 * cs-tokenizer.cs, anonymous.cs, expression.cs, cs-parser.jay:
265 Fixed few shift/reduce conflicts.
267 2010-06-09 Marek Safar <marek.safar@gmail.com>
269 * typemanager.cs, parameter.cs, dynamic.cs, typespec.cs,
270 expression.cs, ecore.cs, cs-parser.jay: Fully parse composed type
271 specifiers and stop using string in AST.
273 2010-06-07 Marek Safar <marek.safar@gmail.com>
275 * typemanager.cs, eval.cs, iterators.cs, anonymous.cs, expression.cs
276 method.cs, class.cs, delegate.cs, cs-parser.jay, driver.cs, visit.cs
277 enum.cs: Hold location of predefined types.
279 2010-06-07 Marek Safar <marek.safar@gmail.com>
281 A fix for bug #610878
282 * pending.cs: Clone cached list before modifying.
284 2010-06-04 Marek Safar <marek.safar@gmail.com>
286 * convert.cs, typespec.cs, expression.cs: Start using array member
287 kind for better conversion checks.
289 * import.cs, report.cs: Report better error message for runtime
292 2010-06-04 Marek Safar <marek.safar@gmail.com>
294 * membercache.cs, convert.cs, nullable.cs, expression.cs: Optimize
295 user defined conversion probing and simplify user conversion for
296 nullabe types. Fixes #610940.
298 2010-06-03 Marek Safar <marek.safar@gmail.com>
300 A fix for bug #610919
301 * parameter.cs, property.cs, cs-parser.jay: Use independent implicit
302 parameters for explicit event accessors. Anonymous method capturing
303 won't otherwise work for event implicit parameter.
305 2010-06-02 Marek Safar <marek.safar@gmail.com>
307 A fix for bug #610088
308 * nullable.cs, expression.cs, statement.cs, method.cs, ecore.cs:
309 Ignore overrides for base overload resolution as for non-base
310 expressions and convert the best candidate to closest override
313 2010-06-01 Marek Safar <marek.safar@gmail.com>
315 A fix for bug #610139
316 * generic.cs, convert.cs: Recursively check effective base interface
318 2010-06-01 Marek Safar <marek.safar@gmail.com>
320 * statement.cs: Handle nullable types and type parameters in using
321 statement, avoid boxing value types. Also fixes #571010
323 2010-06-01 Marek Safar <marek.safar@gmail.com>
325 * convert.cs, expression.cs: Emit unbox for underlying nullable
328 2010-05-29 Marek Safar <marek.safar@gmail.com>
330 A fix for bug #610126
331 * expression.cs: Don't use branch optimization for types bigger than
334 2010-05-28 Marek Safar <marek.safar@gmail.com>
336 A fix for bug #609088
337 * import.cs: Check private modifier correctly.
339 2010-05-28 Marek Safar <marek.safar@gmail.com>
341 A fix for bug #609049
342 * ecore.cs: Don't ignore override methods when looking for base
345 2010-05-27 Marek Safar <marek.safar@gmail.com>
347 A fix for bugs #608007, #572540, #566130, #476358
349 * generic.cs, linq.cs, expression.cs, statement.cs, cs-parser.jay:
350 More tricky refactoring of implicit linq blocks.
352 2010-05-25 Marek Safar <marek.safar@gmail.com>
354 * linq.cs, cs-parser.jay: Keep location for all linq clauses.
356 2010-05-25 Marek Safar <marek.safar@gmail.com>
358 * context.cs, expression.cs, cs-parser.jay: Don't store current
359 block in This expression (it's too early for linq blocks).
361 2010-05-21 Marek Safar <marek.safar@gmail.com>
363 * expression.cs: Use constrained prefix more broadly to avoid boxing.
365 2010-05-20 Marek Safar <marek.safar@gmail.com>
367 A fix for bug #591149
368 * nullable.cs: Don't double wrap same expression.
370 2010-05-20 Marek Safar <marek.safar@gmail.com>
372 A fix for bug #569827
373 * anonymous.cs: Any issued error in probing mode means no match.
375 2010-05-20 Marek Safar <marek.safar@gmail.com>
377 * expression.cs: Search for base indexer using the closest match
380 2010-05-20 Marek Safar <marek.safar@gmail.com>
382 A fix for bug #572071
383 * method.cs: Set override constraints using unexpanded interface
386 2010-05-20 Marek Safar <marek.safar@gmail.com>
388 A fix for bug #572071
389 * ecore.cs: Include secondary extension method lookup in probing
392 2010-05-19 Marek Safar <marek.safar@gmail.com>
394 A fix for bug #515801
395 * typespec.cs (MayBecomeEqualGenericTypes): Recursively check
398 2010-05-19 Marek Safar <marek.safar@gmail.com>
400 A fix for bug #515801
401 * pending.cs: Advance counter correctly.
403 2010-05-19 Marek Safar <marek.safar@gmail.com>
405 A fix for bug #480139
406 * method.cs, pending.cs: Indexer override uses base name.
408 2010-05-19 Marek Safar <marek.safar@gmail.com>
410 A fix for bug #424064
411 * generic.cs: Replace original with inflated type parameter on
414 2010-05-19 Marek Safar <marek.safar@gmail.com>
416 A fix for bug #359733
417 * parameter.cs: Extension attribute can be defined in each assembly.
419 2010-05-18 Marek Safar <marek.safar@gmail.com>
421 A fix for bug #446507
422 * method.cs: Only one method can implement an interface.
424 2010-05-18 Marek Safar <marek.safar@gmail.com>
426 A fix for bug #594905
427 * convert.cs, constant.cs, expression.cs, literal.cs, ecore.cs:
428 Typed null can be used as a source for expression methods.
430 2010-05-18 Marek Safar <marek.safar@gmail.com>
432 A fix for bug #606551
433 * namespace.cs: Using directive imports only types and not nested
436 2010-05-17 Marek Safar <marek.safar@gmail.com>
438 * typespec.cs, expression.cs, statement.cs, ecore.cs, complete.cs,
439 delegate.cs: Member instance is resolved after member overload
440 definitely resolves static/instance property of member expression.
441 Fixes #545047, #358848, #456605, #460016, #603299
443 2010-05-12 Marek Safar <marek.safar@gmail.com>
445 A fix for bug #604981
446 * generic.cs, decl.cs, anonymous.cs: Reset more type arguments
447 details for nested anonymous methods stories.
449 2010-05-11 Marek Safar <marek.safar@gmail.com>
451 A fix for bug #604735
452 * namespace.cs: Don't report namespace collision.
454 2010-05-11 Marek Safar <marek.safar@gmail.com>
456 A fix for bug #604748
457 * class.cs, typespec.cs: Search full imported attribute hierarchy
460 2010-05-11 Marek Safar <marek.safar@gmail.com>
462 * namespace.cs: Ignore missing dependencies failure at
465 2010-05-11 Marek Safar <marek.safar@gmail.com>
467 A fix for bug #604640
468 * namespace.cs: Don't resolve using constraints too early.
470 2010-05-11 Marek Safar <marek.safar@gmail.com>
472 A fix for bug #604239
473 * generic.cs: Copy partial type constraints to partial container.
475 2010-05-10 Marek Safar <marek.safar@gmail.com>
477 A fix for bug #557210
478 * import.cs: Relax underlying enum field rules.
480 2010-05-10 Marek Safar <marek.safar@gmail.com>
482 A fix for bug #603476
483 * property.cs: Implement IParametersMember for indexer accessors.
485 2010-05-07 Marek Safar <marek.safar@gmail.com>
487 A fix for bug #601141
488 * class.cs: Update all partial modifiers.
490 2010-05-06 Marek Safar <marek.safar@gmail.com>
492 A fix for bug #601708
493 * method.cs, membercache.cs: Destructors cannot be hidden.
495 2010-05-06 Marek Safar <marek.safar@gmail.com>
497 A fix for bug #602551
498 * class.cs: Resursive reference of type definition is allowed.
500 2010-05-06 Marek Safar <marek.safar@gmail.com>
502 * anonymous.cs: Mutate cached storey instance types too.
504 2010-05-06 Marek Safar <marek.safar@gmail.com>
506 A fix for bug #602443
507 * convert.cs: Explicit enum conversion cannot involve user operators
509 2010-05-05 Miguel de Icaza <miguel@novell.com>
511 * class.cs (TypeContainer.DefineBaseTypes)
512 (TypeContainer.CheckRecursiveDefinition): check for the iface not
513 being null, as we could have failed resolution and crashed;
516 * cs-parser.jay: Productions to catch common mistakes when other
517 punctuation operators are used instead of comma. Fixes 571702
519 2010-05-05 Marek Safar <marek.safar@gmail.com>
521 * anonymous.cs: Mutate correct set of constraints.
523 2010-05-05 Marek Safar <marek.safar@gmail.com>
525 A fix for bug #602842
526 * expression.cs: Resolve all array bound arguments.
528 2010-05-05 Marek Safar <marek.safar@gmail.com>
530 * import.cs: Don't import private fields.
532 2010-04-30 Marek Safar <marek.safar@gmail.com>
534 Partially based on patch by <sami.lamti@gmail.com>
536 * eval.cs, ecore.cs: Fixed eval show methods.
538 2010-04-30 Marek Safar <marek.safar@gmail.com>
540 * generic.cs, delegate.cs: Implement output type inference of
541 methodgroup now when the specification was cleared at least little
544 2010-04-29 Marek Safar <marek.safar@gmail.com>
546 A fix for bug #575611
547 * class.cs: Fix recursive unmanaged recursice sruct check.
549 2010-04-29 Marek Safar <marek.safar@gmail.com>
551 A fix for bug #479776
552 * expression.cs: Implement typeof unbounded nested generic types.
554 2010-04-29 Marek Safar <marek.safar@gmail.com>
556 A fix for bug #474953
557 * class.cs: Fix valid recursive base type definition.
559 2010-04-29 Marek Safar <marek.safar@gmail.com>
561 A fix for bug #421737
562 * convert.cs, expression.cs: A boxing conversion exists from a
563 nullable-type to a reference type, if a boxing conversion exists
564 from the underlying non-nullable-value-type to the reference type.
566 2010-04-29 Marek Safar <marek.safar@gmail.com>
568 A fix for bug #376875
569 * import.cs: Import volatile modifier.
571 2010-04-29 Marek Safar <marek.safar@gmail.com>
573 A fix for bug #372412
574 * typespec.cs, expression.cs, codegen.cs: Emit readonly prefix for
577 2010-04-29 Marek Safar <marek.safar@gmail.com>
579 A fix for bug #568955
580 * statements.cs: Handle recursive scope initializers.
582 2010-04-28 Marek Safar <marek.safar@gmail.com>
584 A fix for bug #566511
585 * anonymous.cs: Always get inflated version of hoisted variable
586 on generic type definition.
588 2010-04-28 Marek Safar <marek.safar@gmail.com>
590 * import.cs, membercache.cs: Relax rules for valid properties.
592 2010-04-28 Marek Safar <marek.safar@gmail.com>
594 * import.cs: Intern arrays used in generic arguments.
596 2010-04-28 Marek Safar <marek.safar@gmail.com>
598 A fix for bug #600398
599 * convert.cs: Actually use effective base type for the comparison.
601 2010-04-28 Marek Safar <marek.safar@gmail.com>
603 A fix for bug #600326
604 * ecore.cs: Pass arity to base member lookup.
606 2010-04-28 Marek Safar <marek.safar@gmail.com>
608 A fix for bug #573385
609 * expression.cs: MemberAccess is of generic type based on right
612 2010-05-28 Marek Safar <marek.safar@gmail.com>
614 * cs-tokenizer.cs: Made tab size configurable.
616 2010-05-27 Marek Safar <marek.safar@gmail.com>
618 * attribute.cs: Ensure Obsolete members are defined before doing
621 2010-05-27 Marek Safar <marek.safar@gmail.com>
623 * visit.cs: Add DOM visitor skeleton.
627 2010-05-27 Marek Safar <marek.safar@gmail.com>
629 * attribute.cs, codegen.cs: Drop COMPILER_ACCESS hack.
631 2010-05-27 Marek Safar <marek.safar@gmail.com>
633 * *.cs: Major rewrite of compiler internals to better work with
634 unmodified System.Reflection.Emit. Some of the key changes are
635 - TypeSpec replaces reflection specific System.Type.
636 - All Type(TypeSpec) operations are now done in compiler therefore
637 no dependency on SRE to inflate generic members and types or to
638 query unclosed types.
639 - MemberCache is now the only and full hierarchical topology.
640 - Generic constraints are implemented properly.
641 - And as a bonus compilation is on average 30% faster.
643 2010-04-15 Jb Evain <jbevain@novell.com>
645 * dmcs.exe.config: update the runtime version to .net 4.0 RTM.
647 2010-04-12 Marek Safar <marek.safar@gmail.com>
649 * expression.cs, attribute.cs, parameter.cs: More attribute type
652 2010-04-12 Marek Safar <marek.safar@gmail.com>
654 A fix for bug #593342
656 * generic.cs, parameter.cs, argument.cs, field.cs, property.cs,
657 decl.cs, roottypes.cs, constant.cs, nullable.cs, expression.cs,
658 method.cs, ecore.cs, class.cs, delegate.cs, attribute.cs,
659 codegen.cs: Add custom attribute encoder to deal with unfinished
660 types and easier corlib bootstrap from its own types.
662 2010-03-26 Marek Safar <marek.safar@gmail.com>
664 * cs-parser.jay: Report invalid constraint types.
666 2010-03-16 Jb Evain <jbevain@novell.com>
668 * Makefile: rename the net_2_1 profile to moonlight.
670 2010-03-11 Marek Safar <marek.safar@gmail.com>
672 * statement.cs, cs-parser.jay: Use correct location for empty
675 2010-03-11 Marek Safar <marek.safar@gmail.com>
677 * cs-parser.jay: Disable Location from expression.
679 * generic.cs: Check constraints for overrides in the parser.
681 2010-03-09 Marek Safar <marek.safar@gmail.com>
683 * cs-parser.jay (GetLocation): Use an expression when available.
685 2010-03-04 Marek Safar <marek.safar@gmail.com>
687 A fix for bug #582579
688 * ecore.cs (FieldExpr): Don't optimize cross reference loads.
690 2010-03-04 Marek Safar <marek.safar@gmail.com>
692 A patch by kornelpal@gmail.com
694 * dynamic.cs, anonymous.cs, rootcontext.cs, class.cs: Don't make
695 compiler generated classes sealed by default. Emit and close top
696 level compiler generated classes as well.
698 * support.cs: Use RuntimeHelpers.GetHashCode.
700 2010-03-03 Rolf Bjarne Kvinge <RKvinge@novell.com>
702 * Makefile: We need to use the internal bootstrapping gmcs for
703 net_2_1_bootstrap too now.
705 2010-03-02 Raja R Harinath <harinath@hurrynot.org>
707 * expression.cs (IndexerAccess.ResolveAccessor): Add CS1540 check.
709 2010-03-02 Marek Safar <marek.safar@gmail.com>
711 * cs-tokenizer.cs: Missed few locations in previous fix.
713 2010-03-02 Marek Safar <marek.safar@gmail.com>
715 * cs-tokenizer.cs, argument.cs, dynamic.cs, assign.cs, anonymous.cs,
716 nullable.cs, expression.cs, statement.cs, cs-parser.jay, cfold.cs:
717 Report correct location for operator errors.
719 2010-03-02 Marek Safar <marek.safar@gmail.com>
721 * typemanager.cs (IsDynamicType): Don't check external types when
722 the attribute is not external.
724 2010-02-24 Marek Safar <marek.safar@gmail.com>
726 A fix for bug #582579
727 * decl.cs (IsExposedFromAssembly): Use PartialContainer for parent
730 2010-02-24 Marek Safar <marek.safar@gmail.com>
732 A fix for bug #581804
733 * ecore.cs: Fixed type comparison.
735 2010-02-08 Miguel de Icaza <miguel@novell.com>
737 * namespace.cs (CompletionGetTypesStartingWith): Do not include
738 private types in the completion results.
740 * cs-parser.jay: Bubble completions after "from x in ?" and "from x
743 2010-02-17 Marek Safar <marek.safar@gmail.com>
745 * generic.cs, field.cs, decl.cs, cs-parser.jay: Simplify special
748 2010-02-14 Miguel de Icaza <miguel@novell.com>
750 * eval.cs: Do not do the report printer dance unless the user has
751 set the DescribeTypes feature.
753 2010-02-10 Marek Safar <marek.safar@gmail.com>
755 * argument.cs, dynamic.cs, expression.cs: Track RC API changes.
757 2010-02-08 Marek Safar <marek.safar@gmail.com>
759 A fix for bug #577029
760 * anonymous.cs: Fixed TypeBuilder* check.
762 2010-02-06 Miguel de Icaza <miguel@novell.com>
764 * eval.cs (CompileBlock): Also undo if there are problems during
765 semantic analysis, fixes various cases where invalid C# code would
766 be reported, but the internal changes would not be undone.
768 2010-02-03 Miguel de Icaza <miguel@novell.com>
770 * driver.cs: Change the --fatal flag to allow a number to be
771 passed, this ignores the first N fatal errors. Useful to debug
772 errors that do not happen on the first hit.
774 * cs-parser.jay (invocation_expression): accept both the
775 CLOSE_PARENS and COMPLETE_COMPLETION, this allows completions
776 inside an invocation.
778 * driver.cs: Expose FatalErrors.
780 * eval.cs: Initialize the printer's Fatal property from the
781 Driver's FatalError flag, this allows csharp --fatal to work
784 Add support for calling Describe (typeof (TYPE)) if the expression
787 2010-02-02 Marek Safar <marek.safar@gmail.com>
789 A fix for bug #574991
790 * rootcontext.cs, class.cs, driver.cs: Hide enhanced warnings behind
793 2010-02-02 Marek Safar <marek.safar@gmail.com>
795 A fix for bug #575986
796 * expression.cs: Don't mutate typeof type definitions.
798 2010-01-28 Marek Safar <marek.safar@gmail.com>
800 * decl.cs: Use only one set of modifiers.
802 2010-01-26 Marek Safar <marek.safar@gmail.com>
804 A fix for bug #573329
805 * eval.cs: Don't disable error reporting completely on silent mode.
807 2010-01-25 Marek Safar <marek.safar@gmail.com>
809 A fix for bug #573312
810 * constant.cs, expression.cs, ecore.cs: Emit correct offset for
811 pointer index of unknown size types greater than 2.
813 2010-01-15 Marek Safar <marek.safar@gmail.com>
815 * *.cs: Use only 1 member kind enum.
817 2010-01-15 Marek Safar <marek.safar@gmail.com>
819 * *.cs: Add event specification.
821 2010-01-14 Marek Safar <marek.safar@gmail.com>
823 * membercache.cs: Extracted from decl.cs.
825 * *.cs: Put more infrastructure in place.
827 2010-01-13 Marek Safar <marek.safar@gmail.com>
829 * *.cs: Add property specification, unused yet.
831 2010-01-13 Marek Safar <marek.safar@gmail.com>
833 * property.cs: Move all property based declarations into a new file.
835 2010-01-13 Marek Safar <marek.safar at gmail.com>
837 * expression.cs (Conditional): Resolve reduced expression.
839 2010-01-13 Marek Safar <marek.safar at gmail.com>
841 * *.cs: Introduced non-generic method specification.
843 2010-01-07 Marek Safar <marek.safar@gmail.com>
845 * method.cs: Move all method based declarations into a new file.
847 2010-01-07 Marek Safar <marek.safar@gmail.com>
849 * *.cs: Extract field specification.
851 2009-12-17 Marek Safar <marek.safar@gmail.com>
853 * field.cs: Extracted from class.cs
855 2009-12-15 Marek Safar <marek.safar@gmail.com>
857 * attribute.cs (GetFixedBuffer): Work on field definition only.
859 2009-12-15 Marek Safar <marek.safar@gmail.com>
861 * *.cs: Clean up NET_4_0 conditional where possible.
863 2009-12-14 Rodrigo Kumpera <rkumpera@novell.com>
865 support.cs (DynamicType): Assembly property returns the assembly builder.
866 This is required due to how compiler context works in corlib.
868 2009-12-14 Marek Safar <marek.safar@gmail.com>
870 A fix for bug #564376
871 * assign.cs (LocalTemporary): Removed no longer needed special
874 2009-12-11 Marek Safar <marek.safar@gmail.com>
876 * modifiers.cs, decl.cs, iterators.cs, const.cs, anonymous.cs,
877 class.cs, delegate.cs, cs-parser.jay, enum.cs: Turn modifiers into
878 enum for easier debugging.
880 2009-12-10 Marek Safar <marek.safar@gmail.com>
882 * decl.cs, anonymous.cs, class.cs: Sealed Define it's now main entry
885 * parameter.cs, delegate.cs, dynamic.cs: Don't use builder methods
888 2009-12-10 Marek Safar <marek.safar@gmail.com>
890 * cs-parser.jay, statement.cs: Handle parser error in code
893 2009-12-10 Marek Safar <marek.safar@gmail.com>
895 * ecore.cs: Ignore base imported methods when they are already
898 * eval.cs: Handle non-existent keys.
900 * report.cs, driver.cs: Make fatal work with console printer only.
902 2009-12-08 Rodrigo Kumpera <rkumpera@novell.com>
904 * typemanager.cs (MakeGenericMethod): Fix stupid mistake.
906 2009-12-08 Rodrigo Kumpera <rkumpera@novell.com>
908 * typemanager.cs: Add MakeGenericMethod that checks if the method
909 is really the generic method definition.
911 ecore.cs (MethodGroupExpr:IsApplicable): Use new TypeManager function
912 to inflate generic methods.
914 2009-12-08 Marek Safar <marek.safar@gmail.com>
916 A fix for bug #561149
917 * anonymous.cs: Use actual type parameters when checking for generic
920 2009-12-08 Marek Safar <marek.safar@gmail.com>
922 A fix for bug #561369
923 * expression.cs (DoNumericPromotion): Fixed typo.
925 2009-12-08 Marek Safar <marek.safar@gmail.com>
927 *.cs: Moving to generics world.
929 cs-parser.jay: Removed current_array_type.
931 2009-12-07 Marek Safar <marek.safar@gmail.com>
933 *.cs: Moving to generics world.
935 2009-12-04 Marek Safar <marek.safar@gmail.com>
937 *.cs: Moving to generics world (day 2).
939 2009-12-03 Marek Safar <marek.safar@gmail.com>
941 *.cs: Moving to generics world.
943 2009-12-02 Marek Safar <marek.safar@gmail.com>
945 * typemanager.cs, parameter.cs, class.cs, delegate.cs, attribute.cs:
946 Encode dynamic type attribute for elements where attributes cannot
949 2009-12-01 Marek Safar <marek.safar@gmail.com>
951 argument.cs, assign.cs, expression.cs, cs-parser.jay: Named
954 2009-12-01 Marek Safar <marek.safar@gmail.com>
956 A fix for bug #360455
957 * class.cs: Never report a unused warning for generic events to
958 workaround wrong expression type.
960 2009-11-30 Marek Safar <marek.safar@gmail.com>
962 A fix for bug #558305
963 * decl.cs, class.cs: Check partial method definitions using correct
966 2009-11-30 Marek Safar <marek.safar@gmail.com>
968 * argument.cs: Don't cache rarely used dynamic flag.
970 2009-11-27 Marek Safar <marek.safar@gmail.com>
972 * cs-parser.jay: Use jay global stacks (saves over 3MB for corlib).
974 2009-11-27 Marek Safar <marek.safar@gmail.com>
976 * ecore.cs (SimpleName): Removed no longer needed in_transit as
977 Resolve is now non-reentrant (saves ~0.6MB for corlib).
979 2009-11-26 Marek Safar <marek.safar@gmail.com>
981 A fix for bug #545081
982 * decl.cs: Check private nested types of nested types recursively.
984 2009-11-26 Marek Safar <marek.safar@gmail.com>
986 A fix for bug #558305
987 * location.cs: Ignore self referencing #line directive
989 2009-11-26 Marek Safar <marek.safar@gmail.com>
991 A fix for bug #558292
992 * class.cs: Allow single unsafe fixed buffer fields.
994 2009-11-26 Marek Safar <marek.safar@gmail.com>
996 * expression: Optimize few more zero-based operations.
998 2009-11-26 Marek Safar <marek.safar@gmail.com>
1000 * cs-tokenizer.cs, cs-parser.jay: Simplify literal parsing, also
1001 avoids boxing of literal values.
1003 2009-11-26 Marek Safar <marek.safar@gmail.com>
1005 * cs-tokenizer.cs, argument.cs, eval.cs, linq.cs, decl.cs,
1006 expression.cs, ecore.cs, location.cs, cs-parser.jay, attribute.cs,
1007 codegen.cs: LocatedToken redesing to avoid excessive allocation and
1008 boxing (saves ~7MB for corlib). Also fixes presise token location.
1010 2009-11-25 Marek Safar <marek.safar@gmail.com>
1012 * ecore.cs, cs-parser.jay: Keep parser structures local. Share
1013 common data buckers.
1015 2009-11-24 Marek Safar <marek.safar@gmail.com>
1017 * expression.cs: Lower static array initializer barrier.
1019 * support.cs, driver.cs: Share reader buffer.
1021 2009-11-23 Marek Safar <marek.safar@gmail.com>
1023 * cs-tokenizer.cs, support.cs: Some tokenizer optimizations.
1025 2009-11-23 Marek Safar <marek.safar@gmail.com>
1027 * cs-tokenizer.cs, support.cs: Use Dictionary instead of Hashtable,
1028 cleanup some obsolete code.
1030 2009-11-20 Marek Safar <marek.safar@gmail.com>
1032 * context.cs, expression.cs, ecore.cs, complete.cs: Cleaned up
1035 2009-11-20 Marek Safar <marek.safar@gmail.com>
1037 * *.cs: Resolved expressions are never resolved again, this helps to
1038 uncover some not easy to find bugs and improve the performance.
1040 2009-11-19 Marek Safar <marek.safar@gmail.com>
1042 * *.cs: Made constant expressions fully compatible with any other
1045 2009-11-19 Marek Safar <marek.safar@gmail.com>
1047 * *.cs: DoResolve is a worker method and has to be protected.
1049 2009-11-18 Marek Safar <marek.safar@gmail.com>
1051 * *.cs: More context specific handling.
1053 2009-11-17 Marek Safar <marek.safar@gmail.com>
1055 * *.cs: More context specific handling.
1057 2009-11-16 Marek Safar <marek.safar@gmail.com>
1059 * dynamic.cs, class.cs: Removed few fixed user types conversions.
1061 * symbolwriter.cs: Uses public ILOffset.
1063 2009-11-13 Marek Safar <marek.safar@gmail.com>
1065 A fix for bug #553650
1066 * generic.cs: Another missing TypeToCoreType, still too many to fix.
1068 2009-11-13 Marek Safar <marek.safar@gmail.com>
1070 A fix for bug #555170
1072 * class.cs, delegate.cs, enum.cs: Constants have to be available
1073 for parameters resolve.
1075 2009-11-12 Marek Safar <marek.safar@gmail.com>
1077 * typemanager.cs, argument.cs, support.cs, delegate.cs: Dynamic
1080 2009-11-12 Marek Safar <marek.safar@gmail.com>
1082 * argument.cs, context.cs, expression.cs, ecore.cs: Dynamic binding
1083 with a statically known candidate set.
1085 2009-11-11 Scott Peterson <lunchtimemama@gmail.com>
1087 * generic.cs: Made type inflation for generic constraint checks
1088 recursive. This fixes BGO #553655.
1090 2009-11-11 Marek Safar <marek.safar@gmail.com>
1092 * dynamic.cs, decl.cs, expression.cs, ecore.cs: More dynamic type
1095 2009-11-10 Marek Safar <marek.safar@gmail.com>
1097 * typemanager.cs, generic.cs, parameter.cs, argument.cs, dynamic.cs,
1098 linq.cs, rootcontext.cs, ecore.cs, class.cs, delegate.cs,
1099 attribute.cs: Add some dynamic error checking.
1101 2009-11-07 Marek Safar <marek.safar@gmail.com>
1103 A fix for bug #553465
1105 * expression.cs: Fixed mixed version of expression tree anonymous
1108 2009-11-06 Marek Safar <marek.safar@gmail.com>
1110 A fix for bug #553031
1112 * linq.cs, expression.cs, class.cs, cs-parser.jay: Initialize
1113 expression tree version of anonymous type with members declaration.
1115 2009-11-05 Marek Safar <marek.safar@gmail.com>
1117 * parameter.cs: Handle nullable parameter default expression.
1119 * argument.cs, dynamic.cs, expression.cs, support.cs, ecore.cs,
1120 class.cs, attribute.cs: Check for wrong dynamic arguments.
1122 2009-11-05 Marek Safar <marek.safar@gmail.com>
1124 * statement.cs: Dynamic statements.
1126 2009-11-04 Marek Safar <marek.safar@gmail.com>
1128 * dynamic.cs, assign.cs, context.cs, expression.cs, ecore.cs:
1129 Compound assignments over dynamic type.
1131 2009-11-03 Marek Safar <marek.safar@gmail.com>
1133 * argument.cs, dynamic.cs, expression.cs, delegate.cs: Dynamic
1134 constructor arguments.
1136 2009-10-30 Marek Safar <marek.safar@gmail.com>
1138 * dynamic.cs, convert.cs, assign.cs, constant.cs, expression.cs,
1139 codegen.cs: Unary mutator on dynamic member access expression.
1141 2009-10-29 Marek Safar <marek.safar@gmail.com>
1143 A fix for bug #550580
1144 * convert.cs: Don't eliminate explicit precission casts.
1146 2009-10-28 Marek Safar <marek.safar@gmail.com>
1148 A fix for bug #550404
1150 * parameter.cs, iterators.cs, context.cs, anonymous.cs,
1151 expression.cs, statement.cs, ecore.cs: Quote any nested expression
1154 2009-10-27 Marek Safar <marek.safar@gmail.com>
1156 * constant.cs, nullable.cs: Create nullable-null as LiftedNull
1159 * class.cs: Allow nullable binary user operators.
1161 2009-10-26 Marek Safar <marek.safar@gmail.com>
1163 * expression.cs: Move binary expression optimization at the end of
1166 2009-10-23 Marek Safar <marek.safar@gmail.com>
1168 * constant.cs, nullable.cs, expression.cs, literal.cs, cfold.cs:
1169 Separate NullConstant from NullLiteral.
1171 2009-10-23 Marek Safar <marek.safar@gmail.com>
1173 * typemanager.cs, eval.cs, decl.cs, roottypes.cs, context.cs,
1174 anonymous.cs, expression.cs, rootcontext.cs, ecore.cs, class.cs,
1175 flowanalysis.cs, cs-parser.jay, driver.cs, codegen.cs: Split
1176 ModuleContainer. Add common unclosed member check routine.
1178 2009-10-22 Marek Safar <marek.safar@gmail.com>
1180 * argument.cs: Use literal flag for real literals only.
1182 * dynamic.cs: Use correct return type for custom delegates.
1184 2009-10-22 Marek Safar <marek.safar@gmail.com>
1186 * dynamic.cs, expression.cs: Pass logical binary flag to dynamic
1189 2009-10-22 Marek Safar <marek.safar@gmail.com>
1191 * dynamic.cs, ecore.cs: Dynamic invocation with void return type.
1193 2009-10-21 Marek Safar <marek.safar@gmail.com>
1195 * dynamic.cs, convert.cs, expression.cs, ecore.cs: Wrap array index
1198 2009-10-21 Marek Safar <marek.safar@gmail.com>
1200 * typemanager.cs, dynamic.cs, expression.cs: Don't resolve runtime
1203 2009-10-20 Marek Safar <marek.safar@gmail.com>
1205 * argument.cs, dynamic.cs, expression.cs: Latest API update.
1207 2009-10-19 Marek Safar <marek.safar@gmail.com>
1209 * typemanager.cs, expression.cs: Dynamic array initializer.
1211 2009-10-16 Marek Safar <marek.safar@gmail.com>
1213 * typemanager.cs, rootcontext.cs: Clear -nostdlib flag when object
1216 2009-10-16 Marek Safar <marek.safar@gmail.com>
1218 A fix for bug #493523, #507067
1219 * convert.cs, nullable.cs, expression.cs: Do implicit and explicit
1220 standard nullable conversion using underlying standard conversion
1221 and not full conversion.
1223 2009-10-15 Marek Safar <marek.safar@gmail.com>
1225 * dynamic.cs, expression.cs, ecore.cs, delegate.cs: Check return
1226 type in VerifyArgumentsCompat.
1228 2009-10-15 Marek Safar <marek.safar@gmail.com>
1230 * nullable.cs, expression.cs, statement.cs, namespace.cs, ecore.cs:
1231 Reject variable used with type arguments.
1233 2009-10-14 Marek Safar <marek.safar@gmail.com>
1235 * argument.cs, dynamic.cs, assign.cs, expression.cs, ecore.cs:
1236 Implement dynamic expressions assignment.
1238 2009-10-14 Marek Safar <marek.safar@gmail.com>
1240 * expression.cs: Build underlying expression when resolving unary
1243 2009-10-14 Marek Safar <marek.safar@gmail.com>
1245 * expression.cs: Emit enum array initializer using binary blob.
1247 2009-10-08 Marek Safar <marek.safar@gmail.com>
1249 * typemanager.cs, constant.cs: Optimize decimal constants which fit
1252 2009-10-07 Marek Safar <marek.safar@gmail.com>
1254 * typemanager.cs: Reset object_type.
1256 * assign: Made SimpleAssign public.
1258 2009-10-06 Marek Safar <marek.safar@gmail.com>
1260 * typemanager.cs, decl.cs, namespace.cs, ecore.cs, class.cs: Pass
1261 invocation assembly to IsThisOrFriendAssembly.
1263 2009-10-05 Marek Safar <marek.safar@gmail.com>
1265 * expression.cs: Equality comparison of generic parameter with
1268 2009-10-05 Marek Safar <marek.safar@gmail.com>
1270 A fix for bug #543570
1271 * generic.cs: Import predefined constraints correctly.
1273 2009-10-02 Marek Safar <marek.safar@gmail.com>
1275 * ecore.cs: Don't crash on overloads with optional paremeters where
1276 arguments count overflows.
1278 * parameter.cs: Import optional parameter constants using optional
1281 2009-10-01 Marek Safar <marek.safar@gmail.com>
1283 * Makefile: Default is gmcs compiler.
1285 2009-10-01 Marek Safar <marek.safar@gmail.com>
1287 * cs-parser.jay: Fixed few NRE.
1289 2009-10-01 Marek Safar <marek.safar@gmail.com>
1291 * cs-parser.jay, driver.cs: Expose parser exception in verbose mode.
1293 2009-09-30 Marek Safar <marek.safar@gmail.com>
1295 * linq.cs, convert.cs, assign.cs, expression.cs, ecore.cs: Add
1296 ShimExpression, ImplicitCast.
1298 2009-09-30 Marek Safar <marek.safar@gmail.com>
1300 A fix for bug #542959
1301 * delegate.cs: Emit correct delegate instance variable when there
1302 are static and non-static overloads.
1304 2009-09-29 Marek Safar <marek.safar@gmail.com>
1306 * dynamic.cs, linq.cs, anonymous.cs, expression.cs, statement.cs,
1307 ecore.cs, cs-parser.jay: Unary expression dynamic compiler.
1309 2009-09-28 Marek Safar <marek.safar@gmail.com>
1311 A fix for bug #542487
1312 * ecore.cs: Resolve extension methods hidden by properties.
1314 2009-09-25 Marek Safar <marek.safar@gmail.com>
1316 * expression.cs, ecore.cs: More dynamic binary expressions.
1318 2009-09-22 Marek Safar <marek.safar@gmail.com>
1320 * nullable.cs, expression.cs: Fixed null lifted conversion for
1321 bitwise enum operations.
1323 2009-09-22 Marek Safar <marek.safar@gmail.com>
1325 * convert.cs, ecore.cs: Fixed explicit unsafe coversion of long
1326 values in checked context.
1328 2009-09-22 Marek Safar <marek.safar@gmail.com>
1330 * expression.cs, ecore.cs: Fixed array index constant conversion.
1332 2009-09-20 Miguel de Icaza <miguel@novell.com>
1334 * expression.cs: Do not crash when MemberLookup returns something
1335 that is not a MemberExpr here. Report error 582 instead.
1339 2009-09-18 Marek Safar <marek.safar@gmail.com>
1341 * decl.cs, class.cs: Check protected property accessors.
1343 2009-09-18 Marek Safar <marek.safar@gmail.com>
1345 * dynamic.cs, assign.cs: Dynamic compound assignment.
1347 2009-09-17 Marek Safar <marek.safar@gmail.com>
1349 * expression.cs: Fixed compound assignment explicit conversion.
1351 2009-09-17 Marek Safar <marek.safar@gmail.com>
1353 * expression.cs, ecore.cs: Cannot infer variables from method group.
1355 2009-09-16 Marek Safar <marek.safar@gmail.com>
1357 * argument.cs, dynamic.cs, convert.cs, context.cs, anonymous.cs,
1358 constant.cs, nullable.cs, expression.cs, literal.cs, ecore.cs,
1359 codegen.cs: Dynamic binary operations scaffolding.
1361 2009-09-15 Marek Safar <marek.safar@gmail.com>
1363 * expression.cs: Fixes nullable promotion for enum type variables.
1365 2009-09-11 Marek Safar <marek.safar@gmail.com>
1367 * driver.cs, dynamic.cs: Reset more static variables.
1369 2009-09-11 Marek Safar <marek.safar@gmail.com>
1371 * dynamic.cs, expression.cs, rootcontext.cs, namespace.cs, ecore.cs,
1372 driver.cs: Introduced Expression::MakeExpression.
1374 2009-09-11 Marek Safar <marek.safar@gmail.com>
1376 * eval.cs: Exposed MessageOutput instead of cleaning up eval API.
1378 2009-09-09 Marek Safar <marek.safar@gmail.com>
1380 * eval.cs, report.cs: Use Console.Out for all eval error or warning
1383 2009-09-09 Marek Safar <marek.safar@gmail.com>
1385 A fix for bug #518707
1386 * expression.cs (Is): Optimize only generic parameter type
1387 expression probing value type generic parameter.
1389 2009-09-09 Marek Safar <marek.safar@gmail.com>
1391 A fix for bug #532571
1392 * ecore.cs: Check for simple name type arguments used with
1395 2009-09-08 Marek Safar <marek.safar@gmail.com>
1397 A fix for bug #497421
1398 * generic.cs (CheckConstraint): Don't use buildin types to check for
1399 parameterless constructor.
1401 2009-09-08 Marek Safar <marek.safar@gmail.com>
1403 A fix for bug #537402
1404 * generic.cs (CheckConstraint): Correctly inflate generic type
1405 arguments when checking generic method.
1407 2009-09-08 Marek Safar <marek.safar@gmail.com>
1409 A fix for bug #536463
1410 * decl.cs (AddToContainer): Don't report collision between explicit
1411 and parameterless non-explicit members.
1413 2009-09-08 Marek Safar <marek.safar@gmail.com>
1415 * eval.cs: Reset more static stuff.
1417 2009-09-07 Marek Safar <marek.safar@gmail.com>
1419 A fix for bug #324625
1420 * expression.cs, ecore.cs: Create nested generic type expression
1421 using declaring and not current type.
1423 2009-09-07 Marek Safar <marek.safar@gmail.com>
1425 * *.cs: Changed Report class to accept various output printers and
1426 be an instance class. An expression resolver can now use different
1427 message reporter for each call and Report.Error can safely throw
1428 an exception. Part of ongoing work to turn mcs into proper library.
1430 2009-09-04 Marek Safar <marek.safar@gmail.com>
1432 * statement.cs, ecore.cs: Removed error reporting from emit code.
1434 2009-09-04 Marek Safar <marek.safar@gmail.com>
1436 * cs-parser.jay, parameter.cs: Moved parser check out of constructor
1438 2009-09-03 Marek Safar <marek.safar@gmail.com>
1440 * anonymous.cs, expression.cs, statement.cs, cs-parser.jay: Moved
1441 parser checks out of constructors.
1443 2009-09-02 Marek Safar <marek.safar@gmail.com>
1445 * expression.cs, statement.cs, ecore.cs: Use common Report.Error.
1447 2009-09-02 Marek Safar <marek.safar@gmail.com>
1449 A fix for bug #535448
1450 * anonymous.cs, class.cs: Copy return label between all contexts.
1452 2009-09-02 Marek Safar <marek.safar@gmail.com>
1454 A fix for bug #535395
1455 * namespace.cs: Resolve context can be null.
1457 2009-08-25 Marek Safar <marek.safar@gmail.com>
1459 A fix for bug #533912
1460 * generic.cs: Use correct context for constraints resolving.
1462 2009-08-25 Marek Safar <marek.safar@gmail.com>
1464 A fix for bug #532630
1465 * driver.cs: Trim conditional symbols.
1467 2009-08-25 Marek Safar <marek.safar@gmail.com>
1469 * context.cs: New file.
1471 * *.exe.sources, *.csproj: Updated.
1473 2009-08-25 Marek Safar <marek.safar@gmail.com>
1475 * generic.cs, parameter.cs, decl.cs, statement.cs, namespace.cs,
1476 class.cs, generic-mcs.cs, codegen.cs: Add GetSignatureForError to
1477 IMembercontext, some small cleanups.
1479 2009-08-24 Marek Safar <marek.safar@gmail.com>
1481 * *.cs: Split ResolveContext and EmitContext.
1483 2009-08-24 Marek Safar <marek.safar@gmail.com>
1485 * *.cs: Only ResolveContext implements IMemberContext.
1487 2009-08-21 Marek Safar <marek.safar@gmail.com>
1489 * *.cs: Renamed IResolveContext to IMemberContext.
1491 2009-08-21 Marek Safar <marek.safar@gmail.com>
1493 * *.cs: Detached ResolveContext from EmitContext.
1495 2009-08-21 Marek Safar <marek.safar@gmail.com>
1497 * codegen.cs: Moved flow-analysis to BlockContext.
1499 2009-08-21 Marek Safar <marek.safar@gmail.com>
1501 * *.cs: Detached BlockContext from EmitContext.
1503 2009-08-20 Gonzalo Paniagua Javier <gonzalo@novell.com>
1505 * statement.cs: avoid nullref when the return value of GetEnumerator()
1506 does not contain any MoveNext() method.
1508 2009-08-19 Marek Safar <marek.safar@gmail.com>
1510 * *.cs: Removed IResolveContext::GenericDeclContainer.
1512 2009-08-19 Marek Safar <marek.safar@gmail.com>
1514 * class.cs, delegate.cs: Changed Delegate to be TypeContainer based.
1516 2009-08-19 Marek Safar <marek.safar@gmail.com>
1518 * generic.cs, iterators.cs, expression.cs, statement.cs, ecore.cs,
1519 cs-parser.jay, attribute.cs, codegen.cs: Better error reports.
1521 2009-08-18 Marek Safar <marek.safar@gmail.com>
1523 * *.cs: Removed boolean fields from EmitContext.
1525 2009-08-18 Marek Safar <marek.safar@gmail.com>
1527 * *.cs: Add IResolveContext::IsStatic.
1529 2009-08-18 Marek Safar <marek.safar@gmail.com>
1531 * *.cs: Moved TopBlock's methods from EmitContext to TopBlock.
1533 2009-08-17 Marek Safar <marek.safar@gmail.com>
1535 * *.cs: Removed DeclContainer from EmitContext.
1537 2009-08-17 Marek Safar <marek.safar@gmail.com>
1539 * *.cs: Add IResolveContext::CurrentTypeParameters.
1541 2009-08-14 Marek Safar <marek.safar@gmail.com>
1543 * *.cs: Removed TypeContainer and ContainerType from EmitContext.
1545 2009-08-14 Marek Safar <marek.safar@gmail.com>
1547 * decl.cs, expression.cs, namespace.cs, ecore.cs, class.cs,
1548 codegen.cs: Add IResolveContext::LookupExtensionMethod.
1550 2009-08-13 Marek Safar <marek.safar@gmail.com>
1552 * decl.cs: Look in PartialContainer for parent type parameters.
1554 2009-08-13 Marek Safar <marek.safar@gmail.com>
1556 * decl.cs, namespace.cs, ecore.cs, class.cs, attribute.cs,
1557 codegen.cs: Add IResolveContext::LookupTypeParameter.
1559 2009-08-13 Marek Safar <marek.safar@gmail.com>
1561 * lambda.cs, expression.cs, statement.cs, namespace.cs, ecore.cs:
1562 Moved resolved logic from Emit to Resolve.
1564 2009-08-13 Marek Safar <marek.safar@gmail.com>
1566 * parameter.cs, decl.cs, roottypes.cs, class.cs, attribute.cs,
1567 codegen.cs: Reworked atttributes handling of ResolveContext.
1569 2009-08-12 Marek Safar <marek.safar@gmail.com>
1571 * decl.cs, ecore.cs, class.cs, attribute.cs, codegen.cs: Pushed
1572 LookupNamespaceOrType to ResolveContext.
1574 2009-08-12 Marek Safar <marek.safar@gmail.com>
1576 * typemanager.cs, decl.cs, expression.cs, namespace.cs, ecore.cs,
1577 class.cs: Removed unused parameters and methods.
1579 2009-08-11 Marek Safar <marek.safar@gmail.com>
1581 * generic.cs, lambda.cs, anonymous.cs, statement.cs, generic-mcs.cs,
1582 codegen.cs: Finding the best common type of a set of expressions for
1585 2009-08-07 Marek Safar <marek.safar@gmail.com>
1587 * dynamic.cs, expression.cs: More dynamic conversions.
1589 2009-08-06 Miguel de Icaza <miguel@novell.com>
1591 * generic.cs: This loop was incorrect, it was increment ii, but
1592 checking for `i'. This was a change introduced to fix #327497,
1595 * class.cs: Catch another case for cs0533 error, fixes #324782.
1597 2009-08-06 Rodrigo Kumpera <rkumpera@novell.com>
1599 * typemanager.cs (GetGenericArguments): SRE returns null for
1600 generic methods on type builder instances if they are not generic
1601 themselves. For example, for Foo<int>::Bar() it returns null, but
1602 not for Foo<int>::Bar<>() or Foo<int>::Bar<double>().
1604 2009-08-05 Marek Safar <marek.safar@gmail.com>
1606 * argument.cs, dynamic.cs, expression.cs, ecore.cs, class.cs,
1607 delegate.cs: Work on dynamic binding.
1609 2009-08-04 Marek Safar <marek.safar@gmail.com>
1611 A second fix for bug #525342
1612 * class.cs: Attach partial method attributes to method
1615 2009-08-03 Marek Safar <marek.safar@gmail.com>
1617 * typemanager.cs, parameter.cs, support.cs, class.cs: Dynamic type
1620 * rootcontext.cs: Default to langversion v4.
1622 2009-08-03 Marek Safar <marek.safar@gmail.com>
1624 * pending.cs: Check return type before member info is set.
1626 2009-08-03 Marek Safar <marek.safar@gmail.com>
1628 * anonymous.cs: Fully initialize generic hoisted field expression.
1630 2009-08-02 Miguel de Icaza <miguel@novell.com>
1632 * cs-parser.jay: Flag variables declared on the interactive shell
1633 as used to prevent the 168 warning about local variable not being
1636 2009-07-31 Marek Safar <marek.safar@gmail.com>
1638 * parameter.cs, dynamic.cs, support.cs, class.cs, delegate.cs,
1639 attribute.cs: Emit dynamic export attribute.
1641 2009-07-30 Marek Safar <marek.safar@gmail.com>
1643 * expression.cs: More verifier work.
1645 2009-07-29 Marek Safar <marek.safar@gmail.com>
1647 * nullable.cs: Fixed SRE crash during corlib compilation.
1649 2009-07-29 Marek Safar <marek.safar@gmail.com>
1651 * generic.cs, typemanager.cs, decl.cs, iterators.cs, convert.cs,
1652 nullable.cs, expression.cs, ecore.cs, class.cs, attribute.cs:
1653 More TypeManager.TypeToCoreType needed.
1655 2009-07-29 Marek Safar <marek.safar@gmail.com>
1657 * anonymous.cs: Update after recent SRE fixes.
1659 2009-07-28 Marek Safar <marek.safar@gmail.com>
1661 * typemanager.cs, expression.cs, ecore.cs, delegate.cs: Use correct
1662 version of GetFieldHandle for fields of generic types.
1664 2009-07-27 Marek Safar <marek.safar@gmail.com>
1666 * typemanager.cs, argument.cs, convert.cs, assign.cs, expression.cs,
1667 ecore.cs: Add TypeManager.IsDynamicType,
1668 PredefinedAttributes.Dynamic.
1670 2009-07-27 Marek Safar <marek.safar@gmail.com>
1672 A fix for bug #415375
1673 * expression.cs: Fixed object and reference type parameter
1676 2009-07-27 Marek Safar <marek.safar@gmail.com>
1678 A fix for bug #525342
1679 * class.cs: Attach partial method attributes to method
1682 2009-07-24 Marek Safar <marek.safar@gmail.com>
1684 * argument.cs, dynamic.cs, expression.cs, class.cs, attribute.cs:
1687 2009-07-24 Marek Safar <marek.safar@gmail.com>
1689 * anonymous.cs (MutateField): Add imported types handling.
1691 2009-07-23 Marek Safar <marek.safar@gmail.com>
1693 * expression.cs, delegate.cs: Moved arguments resolve into their
1694 counterparts expressions. Removed argument resolve from
1695 CollectionElementInitializer.
1697 2009-07-23 Marek Safar <marek.safar@gmail.com>
1699 A fix for bug #523683
1700 * convert.cs, delegate.cs: Use common overload mechanism for method
1701 group conversion check.
1703 2009-07-22 Marek Safar <marek.safar@gmail.com>
1705 A fix for bug #523899
1706 * generics.cs: Exact type inference with other bound types.
1708 2009-07-22 Raja R Harinath <harinath@hurrynot.org>
1710 Don't complain when the same type is implemented by the output
1711 assembly as well as multiple referenced assemblies
1712 * namespace.cs (RootNamespace.LookupTypeReflection): Add
1713 'must_be_unique' flag.
1714 (GlobalRootNamespace): Update to changes.
1715 (Namespace.LookupType): Pass 'must_be_unique' only when we don't
1716 already have a type in hand.
1718 2009-07-22 Marek Safar <marek.safar@gmail.com>
1720 * expression.cs: More verifier instrumentation.
1722 * statement.cs: Do proper throw expression conversion.
1724 2009-07-22 Marek Safar <marek.safar@gmail.com>
1726 A fix for bug #522789
1727 * expression.cs: Mutate invocation return type.
1729 2009-07-16 Marek Safar <marek.safar@gmail.com>
1731 * anonymous.cs: Split assignable and readonly generated variable
1734 2009-07-16 Marek Safar <marek.safar@gmail.com>
1736 A fix for bug #521671
1737 * statement.cs: Fixed crash when checking missing type.
1739 2009-07-16 Marek Safar <marek.safar@gmail.com>
1741 * typemanager.cs, generic.cs, argument.cs, linq.cs, convert.cs,
1742 assign.cs, expression.cs, statement.cs, support.cs, ecore.cs,
1743 class.cs, driver.cs: Work on dynamic binding.
1745 * dynamic.cs: New file.
1747 * *.sources, *.proj: Updated.
1749 2009-07-15 Marek Safar <marek.safar@gmail.com>
1751 * expression.cs (Conditional): Avoid double Resolve.
1753 2009-07-13 Marcus Griep <marcus@griep.us>
1755 * ecore.cs: Fix obscure bug with resolving members of interfaces
1756 that hide parent interface members. Fixes bug #444388 and corrects
1759 2009-07-13 Marek Safar <marek.safar@gmail.com>
1761 * expression.cs (LocalVariableReference): Bounce resolve.
1763 2009-07-10 Marek Safar <marek.safar@gmail.com>
1765 * typemanager.cs, lambda.cs, parameter.cs, convert.cs, anonymous.cs,
1766 expression.cs, literal.cs, ecore.cs, complete.cs: Moved internal
1769 * support.cs: New dynamic type wrapper.
1771 2009-07-08 Marek Safar <marek.safar@gmail.com>
1773 * ecore.cs, cs-parser.jay: Better error reporting for implicitly
1774 typed local variable.
1776 2009-07-06 Marek Safar <marek.safar@gmail.com>
1778 A fix for bug #519005
1779 * anonymous.cs: Use null_type as no return type placeholder.
1781 2009-07-02 Marek Safar <marek.safar@gmail.com>
1783 * generic.cs: Handle type inference of identical type parameters
1784 with different bounds.
1786 2009-07-01 Marek Safar <marek.safar@gmail.com>
1788 * expression.cs, class.cs: Events variance.
1790 * cs-parser.jay: Interface events error messages.
1792 2009-07-01 Marek Safar <marek.safar@gmail.com>
1794 * generic.cs, argument.cs: Updated type inference logic to C# 4.0.
1796 2009-06-29 Marek Safar <marek.safar@gmail.com>
1798 * parameter.cs, convert.cs, expression.cs, class.cs: Default
1799 parameter expression can be value-type New.
1801 * cs-parser.jay: Clean up too many parameter modifier boolean flags.
1803 2009-06-26 Marek Safar <marek.safar@gmail.com>
1805 * generic.cs, argument.cs, expression.cs, ecore.cs, cs-parser.jay:
1806 Implemented C# 4.0 named arguments.
1808 2009-06-24 Marek Safar <marek.safar@gmail.com>
1810 * typemanager.cs, parameter.cs, iterators.cs, convert.cs,
1811 expression.cs, ecore.cs, delegate.cs: Removed unnecessary ArgList
1812 parameter modifier. Also fixes bug #515497.
1814 2009-06-24 Marek Safar <marek.safar@gmail.com>
1816 * *.cs: Replaced ArrayList with Arguments in need of a nonsequential
1817 arguments expression to be implemented.
1819 *.sources: Add argument.cs
1821 2009-06-23 Marek Safar <marek.safar@gmail.com>
1823 * parameter.cs: Moved GetParameterIndexByName to base class.
1825 * expression.cs, statement.cs, ecore.cs, delegate.cs: Removed
1826 unused AType. Use argument's version of GetExpressionTree.
1828 2009-06-22 Marek Safar <marek.safar@gmail.com>
1830 * expression.cs, cs-parser.jay, attribute.cs, codegen.cs: Named
1833 2009-06-17 Marek Safar <marek.safar@gmail.com>
1835 A fix for bug #514096
1836 * class.cs: Allow IntPtr/UIntPtr fields to be volatile.
1838 2009-06-17 Marek Safar <marek.safar@gmail.com>
1840 * expression.cs: The first multi-dimensional array nested array
1841 initializers was not checked.
1843 * statement.cs (Switch): Fixed error message to reflect 2.0 changes.
1845 2009-06-17 Marek Safar <marek.safar@gmail.com>
1847 A fix for bug #513400
1848 * nullable.cs (EmitEquality): Operands emit could be simplified for
1849 built-in types when we now emit user operators differently.
1851 2009-06-16 Marek Safar <marek.safar@gmail.com>
1853 * ecore.cs: Report inaccessible delegate methods correctly.
1855 2009-06-16 Marek Safar <marek.safar@gmail.com>
1857 * parameter.cs, expression.cs, ecore.cs, class.cs, delegate.cs,
1858 cs-parser.jay: Implemented C# 4.0 optional parameters.
1860 2009-06-16 Marek Safar <marek.safar@gmail.com>
1862 * driver.cs: Removed broken DefineManifestResource.
1864 2009-06-16 Raja R Harinath <harinath@hurrynot.org>
1866 * Makefile [net_2_0_bootstrap]: Don't explicitly mention net_1_1.
1867 Use $(BOOTSTRAP_PROFILE) instead.
1869 2009-06-12 Jb Evain <jbevain@novell.com>
1871 * rootcontext.cs: add a Platform field.
1872 * driver.cs: handle /platform.
1873 * codegen.cs: pass the proper flags according to
1874 the platform when saving the assembly.
1876 2009-06-11 Marek Safar <marek.safar@gmail.com>
1878 * parameter.cs, const.cs, report.cs, cs-parser.jay, attribute.cs:
1879 Add optional parameters grammar.
1881 2009-06-10 Marek Safar <marek.safar@gmail.com>
1883 * eval.cs, anonymous.cs, report.cs, rootcontext.cs, cs-parser.jay,
1884 driver.cs: Split lang version and metadata version.
1886 2009-06-10 Marek Safar <marek.safar@gmail.com>
1888 * decl.cs: Better overload ctor collision error message.
1890 2009-06-05 Jb Evain <jbevain@novell.com>
1892 * driver.cs (EmbededResource): avoid using an internal method
1893 in gmcs to embed manifest resources.
1895 2009-06-04 Sebastien Pouliot <sebastien@ximian.com>
1897 * generic.cs, parameter.cs: Avoid using 'var' so we can bootstrap
1898 the compiler from older mono versions (like moon's bots)
1900 2009-06-04 Marek Safar <marek.safar@gmail.com>
1902 * namespace.cs (LookupTypeReflection): Ignore collisions between
1905 2009-06-04 Marek Safar <marek.safar@gmail.com>
1907 * codegen.cs: Enabled generic type forwarders.
1909 2009-06-04 Marek Safar <marek.safar@gmail.com>
1911 * dmcs.*: Add another version of SRE compiler.
1913 2009-06-03 Marek Safar <marek.safar@gmail.com>
1915 * generic.cs, typemanager.cs, parameter.cs, convert.cs,
1916 generic-mcs.cs: Fixed variant type conversions.
1918 2009-06-02 Marek Safar <marek.safar@gmail.com>
1920 A fix for bug #507863
1921 * codegen.cs: Fixes a crash on invalid string value attribute.
1923 2009-06-01 Marek Safar <marek.safar@gmail.com>
1925 A fix for bug #508334
1926 * typemanager.cs, parameter.cs, convert.cs, expression.cs, ecore.cs,
1927 cs-parser.jay: Fully import __arglist modifier.
1929 2009-05-29 Marek Safar <marek.safar@gmail.com>
1931 * generic.cs, typemanager.cs, parameter.cs, ecore.cs, class.cs,
1932 delegate.cs, generic-mcs.cs: Rewrote type variance checks to
1933 actually work with closed generic types.
1935 2009-05-27 Alan McGovern <amcgovern@novell.com>
1937 * class.cs, decl.cs, delegate.cs, parameter.cs:
1938 Fix the build by replacing the use of 'var' with the actual type.
1940 2009-05-27 Marek Safar <marek.safar@gmail.com>
1942 * generic.cs, parameter.cs, decl.cs, ecore.cs, class.cs, delegate.cs
1943 cs-parser.jay, generic-mcs.cs: Report wrong variant types
1946 * driver.cs, rootcontext.cs, report.cs: Add 3.0 language version
1949 2009-05-26 Rodrigo Kumpera <rkumpera@novell.com>
1950 Marek Safar <marek.safar@gmail.com>
1952 A fix for bug #377509
1953 * parameter.cs: Use predefined and not empty name for implicit
1956 2009-05-21 Marek Safar <marek.safar@gmail.com>
1958 * class.cs: Don't report wrong warnings for event fields.
1960 2009-05-21 Marek Safar <marek.safar@gmail.com>
1962 A fix for bug #504667
1963 * class.cs: Check for static class using parent container instead of
1966 2009-05-08 Marek Safar <marek.safar@gmail.com>
1968 A fix for bug #496922
1969 * expression.cs: Always use temporary variable when using object
1972 2009-04-28 Marek Safar <marek.safar@gmail.com>
1974 A fix for bug #495112
1975 * class.cs (IsUnmanagedType): Handle recursive unmanaged types using
1978 2009-04-27 Miguel de Icaza <miguel@novell.com>
1980 * driver.cs: Add a flag to work as a replacement for CSC in VS.
1982 2009-04-24 Miguel de Icaza <miguel@novell.com>
1984 * complete.cs: No idea how gonzalo got a null in the list, but
1987 2009-04-24 Miguel de Icaza <miguel@novell.com>
1989 * complete.cs (CompletionElementInitializer): New completion class
1990 to support completing inside a C# 3 element initializer, so this
1991 allows completion for Silverlight situations where it is very
1994 new TextBlock () { Fo<TAB>
1996 (CompletionSimpleName): Expose the prefix that was
1997 passed to the simple name.
1999 * cs-parser.jay (object_or_collection_initializer): Add support
2000 for element_initializers.
2002 * expression.cs (CollectionOrObjectInitializers.DoResolve):
2003 special case completion expressions as this method aggressively
2004 collects data before it operates, and errors were being thrown
2005 earlier than we were able to complete.
2007 2009-04-23 Miguel de Icaza <miguel@novell.com>
2009 * eval.cs: Make getcompletions silent and enable debugging output
2010 if the -v option is passed.
2012 * namespace.cs (NamespaceEntry.CompletionGetTypesStartingWith):
2013 Consider looking up the namespace that matches the prefix being
2016 This is part of the support for allowing completions like:
2017 `System.Co<TAB>' to complete to System.Console.
2019 * complete.cs (CompletionSimpleName.AppendResults): Make this
2022 2009-04-21 Raja R Harinath <harinath@hurrynot.org>
2024 * cs-parser.jay (GetTokenName): Mark GENERATE_COMPLETION and
2025 COMPLETE_COMPLETION as internal.
2027 2009-04-17 Miguel de Icaza <miguel@novell.com>
2029 * complete.cs: Include namespace resolution in simple names as
2030 well as global types and types in the using scope in the
2033 * namespace.cs: Supporting infrastrcture to provide completions
2034 based on the current using scope.
2036 * eval.cs: Introduce an entry point that allows for initialization
2037 to return a list of the files passed on the command line.
2039 2009-04-14 Marek Safar <marek.safar@gmail.com>
2041 A fix for bug #494243
2042 * report.cs (SymbolRelatedToPreviousError): Fixed NRE.
2044 2009-04-13 Marek Safar <marek.safar@gmail.com>
2046 A fix for bug #493887
2047 * statement.cs: Don't skip string multi-section with default or
2048 null label when populating string hashtable.
2050 2009-04-06 Marek Safar <marek.safar@gmail.com>
2052 A fix for bug #492329
2053 * expression.cs (New): Load variable when assigning type parameter
2056 2009-04-06 Marek Safar <marek.safar@gmail.com>
2058 A fix for bug #488960
2059 * decl.cs: Compare MVAR types using non-null values.
2061 2009-03-27 Marek Safar <marek.safar@gmail.com>
2063 * typemanager.cs, expression.cs: Removed unused nullable checks.
2065 2009-03-27 Marek Safar <marek.safar@gmail.com>
2067 * *.cs: Removed some gmcs conditionals.
2069 2009-03-26 Marek Safar <marek.safar@gmail.com>
2071 * generic.cs, support.cs: Moved generics stuff out of support.cs
2073 2009-03-24 Marek Safar <marek.safar@gmail.com>
2075 * ecore.cs, expression.cs: Use queried type for MethodGroupExpr
2078 2009-03-23 Marek Safar <marek.safar@gmail.com>
2080 * attribute.cs: Consider all members for error reporting when
2081 checking named arguments.
2083 2009-03-23 Marek Safar <marek.safar@gmail.com>
2085 A fix for bug #487625
2086 * namespace.cs: Use a warning for all predefined type conflicts.
2088 2009-03-23 Marek Safar <marek.safar@gmail.com>
2090 A fix for bug #485706
2091 * statement.cs: Explicitly type catch type argument to pass verifier
2094 2009-03-22 Miguel de Icaza <miguel@novell.com>
2096 Initial support to provide code completion facilities to consumers
2097 of the evaluator API.
2099 * cs-tokenizer.cs (CompleteOnEOF): this new property is used to
2100 support the completion engine. When we reach the end of the
2101 input stream instead of returning EOF, when this flag is true the
2102 tokenizer instead produces:
2104 One GENERATE_COMPLETION token: this token then must be
2105 handled in the grammar at every point where the user
2106 would likely request a completion.
2108 As many COMPLETE_COMPLETION tokens as necessary. These
2109 tokens are generated to assist the parser in unwinding and
2110 producing a valid parse tree.
2112 The parser rules do not have to be perfect, the parser needs to be
2113 augmented with judicious use of GENERATE_COMPLETION tokens to
2114 improve the areas where we can provide completion and the parser
2115 needs to add support for COMPLETE_COMPLETION tokens in productions
2118 It is common to not have enough support for COMPLETE_COMPLETION
2119 under certain rules and that even if we generated the
2120 GENERATE_COMPLETION token that the resulting tree will be invalid
2121 due to the missing rules that support COMPLETE_COMPLETION.
2123 The final EOF token is produced by having the parser notify the
2124 tokenizer when it reaches the root production that the next token
2127 * support.cs (CompletionResult): New Exception. This exception
2128 is thrown to return the completion results when one of the special
2129 completion expressions is reached.
2131 This exception is thrown by the completing ExpressionStatements
2132 classes that live in complete.cs
2134 * complete.cs (CompletingExpression): a new base class for
2135 completing expressions. This derives from the
2136 ExpressionStatement class and not from Expression as it allows
2137 completion to happen not only where expressions are expected in
2138 the grammar, but also where statements are expected.
2140 (CompletionSimpleName): A new class used to provide completions
2141 for SimpleNames. This currently only resolves to local
2142 variables from the evaluator context (GetVars call).
2144 (CompletionMemberAccess): Implements support for completing member
2147 * cs-parser.jay: Add support for completion in a few places.
2149 * eval.cs (GetCompletions): New public API for the evaluator that
2150 returns a list of possible completions given the input. The
2151 return value is an array of completions
2153 * anonymous.cs (Compatible): If the exception thrown from the
2154 resolved expression is a CompletionResult exception let that one
2155 through instead of printing a diagnostic error in the try/catch.
2157 2009-03-22 Miguel de Icaza <miguel@novell.com>
2161 * driver.cs (Main): Use Environment.Exit to quit quickly and
2162 prevent the compiler from doing the usual wait for helper thread
2165 This is to prevent a slowdown that was reported by Gonzalo on
2168 2009-03-19 Marek Safar <marek.safar@gmail.com>
2170 * ecore.cs: Load build-in types directly instead of accessing
2173 2009-03-18 Marek Safar <marek.safar@gmail.com>
2175 * ecore.cs: Always use unbox.any when available.
2177 2009-03-18 Marek Safar <marek.safar@gmail.com>
2179 * class.cs: Always set TypeAttributes.BeforeFieldInit conditionally.
2181 2009-03-17 Marek Safar <marek.safar@gmail.com>
2183 * generic.cs: Removed obsolete version of type inference.
2185 2009-03-16 Marek Safar <marek.safar@gmail.com>
2187 * typemanager.cs, decl.cs, roottypes.cs, anonymous.cs, nullable.cs,
2188 expression.cs, rootcontext.cs, namespace.cs, ecore.cs, class.cs,
2189 delegate.cs, flowanalysis.cs, cs-parser.jay, driver.cs,
2190 attribute.cs, codegen.cs: Changed RootTypes to be ModuleContainer.
2192 2009-03-11 Marek Safar <marek.safar@gmail.com>
2194 A fix for bug #482996
2195 * anonymous.cs: Make sure we are not infering return type when
2196 checking type compatibility.
2198 2009-03-11 Marek Safar <marek.safar@gmail.com>
2200 * typemanager.cs, generic.cs, parameter.cs, decl.cs, const.cs,
2201 rootcontext.cs, namespace.cs, class.cs, delegate.cs, driver.cs,
2202 generic-mcs.cs, attribute.cs, codegen.cs: Maintain predefined
2203 attributes in their own structure. Needed when accessing their
2204 properties before they are resolved.
2206 2009-03-09 Marek Safar <marek.safar@gmail.com>
2208 * cs-tokenizer.cs: Optimized GetKeyword using an array instead of
2209 hashtable (~10x faster).
2211 * driver.cs: Removed wrong Reset.
2213 2009-03-08 Marek Safar <marek.safar@gmail.com>
2215 * class.cs: Use correct common base type for unmanaged delayed
2218 * rootcontext.cs: Wrap unhandled exception.
2220 2009-03-06 Raja R Harinath <harinath@hurrynot.org>
2222 Make SeekableStreamReader self-tuning and arbitrarily seekable
2223 * support.cs (SeekableStreamReader.ResetStream): New. Allocates
2225 (SeekableStreamReader.Position.set): Use it. Simplify logic
2226 which, as a side-effect, makes it arbitrarily-seekable. Tune the
2227 buffer size when the stream needs to be re-read from the beginning.
2229 2009-03-05 Marek Safar <marek.safar@gmail.com>
2231 A fix for bug #480100
2232 * parameter.cs: A parameter is not hoisted when used directly as ET.
2234 2009-03-04 Marek Safar <marek.safar@gmail.com>
2236 * statement.cs: Fixed an issue when using variable is of interface
2239 2009-03-03 Marek Safar <marek.safar@gmail.com>
2241 A fix for bug #480319
2242 * report.cs, driver.cs: Support -warnaserror-:<warning list> option.
2244 2009-03-03 Marek Safar <marek.safar@gmail.com>
2246 A fix for bug #480867
2247 * typemanager.cs, expression.cs, ecore.cs: Changed method group
2248 expression to have no valid type.
2250 2009-03-03 Marek Safar <marek.safar@gmail.com>
2252 A fix for bug #481258
2253 * class.cs: Set extension method flag in partial container.
2255 2009-03-03 Marek Safar <marek.safar@gmail.com>
2257 * statement.cs, typemanager.cs: Use expression for StringEmitter.
2259 * attribute.cs: Add sanity check.
2261 2009-02-27 Marek Safar <marek.safar@gmail.com>
2263 * class.cs: Add external constructor error.
2265 2009-02-26 Marek Safar <marek.safar@gmail.com>
2267 A fix for bug #475354
2268 * convert.cs, nullable.cs, expression.cs, statement.cs: Emit
2269 correctly user defined nullable equality operators.
2271 2009-02-25 Marek Safar <marek.safar@gmail.com>
2273 A fix for bug #479532
2274 * expression.cs: Implement NewInitialize::AddressOf.
2276 2009-02-25 Marek Safar <marek.safar@gmail.com>
2278 A fix for bug #413633
2279 * expression.cs: Iterate all base class-constraint types.
2281 2009-02-24 Marek Safar <marek.safar@gmail.com>
2283 A fix for bug #479209
2284 * literal.cs: Mutate null underlying type.
2286 2009-02-24 Marek Safar <marek.safar@gmail.com>
2288 A fix for bug #476295
2289 * convert.cs: Avoid wrapping implicitly convertible reference type.
2291 2009-02-23 Marek Safar <marek.safar@gmail.com>
2293 * iterators.cs: Create MemberName correctly.
2295 2009-02-23 Marek Safar <marek.safar@gmail.com>
2297 A fix for bug #478655
2298 * literal.cs: Check also underlying null type conversion.
2300 2009-02-21 Marek Safar <marek.safar@gmail.com>
2302 * generic.cs, ecore.cs, class.cs: Removed redundant AsAccessible.
2304 2009-02-20 Marek Safar <marek.safar@gmail.com>
2306 A fix for bug #477447
2307 * statement.cs: Add reference to correct parent storey when this
2308 is accessible from deep children storey (more than 1 level).
2310 2009-02-19 Marek Safar <marek.safar@gmail.com>
2312 A fix for bug #475860 by David Mitchell <dmitchell@logos.com>
2313 * class.cs: Define base type members before setting up member cache.
2315 2009-02-18 Marek Safar <marek.safar@gmail.com>
2317 A fix for bug #477378
2318 * nullable.cs, expression.cs, statement.cs: More precise null type
2321 2009-02-18 Marek Safar <marek.safar@gmail.com>
2323 A fix for bug #472805
2324 * typemanager.cs, namespace.cs: Import only visible extension method
2327 2009-02-18 Marek Safar <marek.safar@gmail.com>
2329 A fix for bug #476895
2330 * attribute.cs: Use correct resolve context for attribute type.
2332 2009-02-18 Marek Safar <marek.safar@gmail.com>
2334 A fix for bug #476266
2335 * anonymous.cs: Mutate multi-dimensional arrays.
2337 2009-02-18 Marek Safar <marek.safar@gmail.com>
2339 A fix for bug #476400
2340 * statement.cs, expression.cs: Removed wrong Dispose optimization.
2342 2009-02-18 Marek Safar <marek.safar@gmail.com>
2344 A fix for bug #476811
2345 * generics.cs: Fixed null-literal check.
2347 2009-02-17 Marek Safar <marek.safar@gmail.com>
2349 * typemanager.cs, convert.cs, flowanalysis.cs, driver.cs,
2350 expression.cs, ecore.cs, rootcontext.cs, eval.cs, class.cs: More
2351 messing with static variables.
2353 2009-02-16 Marek Safar <marek.safar@gmail.com>
2355 A fix for bug #475965
2356 * generics.cs: Check generic parameter type after extracting from
2359 2009-02-16 Marek Safar <marek.safar@gmail.com>
2361 A fix for bug #475823
2362 * convert.cs, expression.cs, literal.cs, ecore.cs, cfold.cs: Add
2365 2009-02-14 Marek Safar <marek.safar@gmail.com>
2367 * modifiers.cs, decl.cs, ecore.cs, class.cs, flowanalysis.cs:
2368 Simplified event field definition using backing field and not
2369 field builder directly.
2371 * expression.cs (EmitLdArg): Optimize fast paths.
2373 2009-02-13 Marek Safar <marek.safar@gmail.com>
2375 A fix for bug #475327
2376 * expression.cs (ArrayCreation): Don't mutate values optimized away.
2378 2009-02-13 Marek Safar <marek.safar@gmail.com>
2380 A fix for bug #475342
2381 * cs-parser.jay: Using 'super' instead of 'base' to call base
2382 constructor crashes compiler.
2384 2009-02-13 Marek Safar <marek.safar@gmail.com>
2386 A fix for bug #475354
2387 * expression.cs (Constantify): Add nullable types.
2389 * const.cs (EmitDecimalConstant): Avoid explicit cast.
2391 2009-02-12 Marek Safar <marek.safar@gmail.com>
2393 A fix for bug #475246
2394 * expression.cs: More broken flowanalysis hacking needed.
2396 2009-02-12 Marek Safar <marek.safar@gmail.com>
2398 * attribute.cs: Compare only ref/out array modifiers.
2400 2009-02-11 Marek Safar <marek.safar@gmail.com>
2402 * statement.cs: Use member cache when looking for foreach members.
2404 2009-02-11 Marek Safar <marek.safar@gmail.com>
2406 * expression.cs: Don't expose internal initializer types.
2408 * statement.cs: Check also explicit conversions for goto case.
2410 2009-02-11 Marek Safar <marek.safar@gmail.com>
2412 * convert.cs, statement.cs: Removed usage of IsAssignableFrom.
2414 2009-02-10 Marek Safar <marek.safar@gmail.com>
2416 * *.cs: Replace null-type with NullLiteral where appropriate.
2418 2009-02-09 Marek Safar <marek.safar@gmail.com>
2420 * expression.cs: Initializer of reference argument use temporary
2421 variable to be verifiable.
2423 * parameter.cs: Share EmitLdArg.
2425 2009-02-09 Marek Safar <marek.safar@gmail.com>
2427 A fix for bug #473559
2428 * class.cs: Fixed: Not reporting error about nested class with the
2431 2009-02-06 Scott Peterson <lunchtimemama@gmail.com>
2433 Contributed under the MIT/X11 license.
2435 * generic.cs: Added VerifyVariantTypeParameters which performs new
2436 variance verification logic. The old logic, based on the spec, was
2437 wrong because the spec is full of LIES!
2439 * generic-mcs.cs: Stubbed out the VerifyVariantTypeParameters method.
2441 *typemanager.cs: Moved variance verification logic to GenericTypeExpr.
2444 * ecore.cs: Added calls to the new variance verification logic.
2447 * delegate.cs: Removed calls to the old variance verification logic.
2449 2009-02-06 Marek Safar <marek.safar@gmail.com>
2451 * delegate.cs: Use cached Invoke method directly.
2453 2009-02-06 Marek Safar <marek.safar@gmail.com>
2455 * expression.cs: Emit expression tree for hoisted variable access.
2457 2009-02-04 Marek Safar <marek.safar@gmail.com>
2459 * namespace.cs: Add better extension class check.
2461 2009-02-05 Scott Peterson <lunchtimemama@gmail.com>
2463 * generic.cs: Fixed typeo (TypeParameter.Variacne).
2465 2009-02-04 Scott Peterson <lunchtimemama@gmail.com>
2467 This patch adds initial generic variance support to the compiler.
2468 It is contributed under the MIT/X11 license.
2470 * typemanager.cs: Modified ImplementsInterface to check variance.
2471 Added VerifyVariantTypeParameters which checks the specified type to see
2472 if it uses a variant type parameter as a type argument (which is not
2473 allowed). Added IsVariantOf which determins if the first type is a
2474 variant of the second. NOTE: This only supports reference types at
2475 the moment to conform with the current level of VM support. When the
2476 VM supports value types, this will follow step.
2478 * generic.cs: Added the Variance enum. Added a Variance property to
2479 TypeParameter and added variance support to definition phase. Added a
2480 Variance property to TypeParameterName. Also check to make sure that
2481 no variant types appear in generic method parameters.
2483 * cs-tokenizer.cs: Modified parse_less_than to tokenize the variance
2484 keywords if the langversion supports it.
2486 * parameter.cs: Added Parameter.VerifyNoVariantTypeParameters to ensure
2487 that variant types are only used in legal positions. Also added
2488 ParametersCompiled.VerifyNoVariantTypeParameters to check all of its
2491 * decl.cs: Construct TypeParameter with the variance information.
2493 * convert.cs: Checks variance in ImplicitReferenceConversionExists
2494 and ImplicitConversionStandard.
2496 * rootcontext.cs: Added new "Future" language version.
2498 * class.cs: In TypeContainer.DoDefineMembers, ensure that contravariant
2499 type parameters are not used as type arguments in interface inheritance.
2500 In MemberBase.DoMemberDependentChecks, ensure that contravariant type
2501 parameters are not used as method return types. In MemberBase.
2502 ResolveMemberType, ensure that variant type parameters are not used
2503 as type arguments. Also call VerifyNoVariantTypeParameters on every
2504 set of parameters which are resolved.
2506 * delegate.cs: Modified Delegate.Define to ensure that variant
2507 parameters are not used as type arguments and that a contravariant
2508 parameter is not used as the return type. Also call
2509 VerifyNoVariantTypeParameters on the delegate parameters.
2511 * cs-parser.jay: Modified grammar to support "in" and "out" keywords
2512 to specify generic variance.
2514 * driver.cs: Added support for LanguageVersion.Future in the form of
2515 "-langversion:future".
2517 * generic-mcs.cs: Stubbed out new members in generic.cs.
2519 2009-02-03 Marek Safar <marek.safar@gmail.com>
2521 * class.cs, generic.cs: Emit type parameter constraints for nested
2524 2009-02-02 Marek Safar <marek.safar@gmail.com>
2526 A fix for bug #471213
2527 * class.cs: Avoid emitting backing field for abstract event fields.
2529 2009-02-01 Marek Safar <marek.safar@gmail.com>
2531 A fix for bug #359731
2532 * cs-tokenizer.cs, cs-parser.jay: Correctly parse nested query
2535 2009-01-30 Marek Safar <marek.safar@gmail.com>
2537 A fix for bug #470767
2538 * statement.cs: Introduced BlockScopeExpression, needed when
2539 expression tree conversion has to emit scope variables.
2541 2009-01-29 Marek Safar <marek.safar@gmail.com>
2543 * class.cs: Remove duplicate CallingConvention.
2545 2009-01-29 Marek Safar <marek.safar@gmail.com>
2547 *.cs: Rename Parameters to ParametersCompiled and ParametersImported
2548 when I finally found the right naming convention.
2550 2009-01-29 Marek Safar <marek.safar@gmail.com>
2552 * cs-tokenizer.cs: Put back different open parens optimization.
2554 2009-01-28 Marek Safar <marek.safar@gmail.com>
2556 A fix for bug #470227
2557 * cs-tokenizer.cs: Remove too agressive parser optimization.
2559 2009-01-28 Marek Safar <marek.safar@gmail.com>
2561 A fix for bug #324319
2562 * class.cs: Remove too early base type resolve.
2564 2009-01-27 Marek Safar <marek.safar@gmail.com>
2566 A fix for bug #324319
2567 * ecore.cs: Explicitly type null when assigning to type argument to
2568 make pass verifier check.
2570 2009-01-27 Marek Safar <marek.safar@gmail.com>
2572 * anonymous.cs: Fixed recent regression when initializing captured
2575 2009-01-26 Marek Safar <marek.safar@gmail.com>
2577 A fix for bug #469019
2578 * anonymous.cs: Use all parent type parameters when instantiating
2579 nested generic storey.
2581 2009-01-26 Marek Safar <marek.safar@gmail.com>
2583 * expression.cs: Check for null instance methodgroup expression.
2585 2009-01-26 Marek Safar <marek.safar@gmail.com>
2587 A fix for bug #469244
2588 * cs-tokenizer.cs, cs-parser.jay: Fixed parsing of nullable type
2589 instance inside a conditional expression.
2591 2009-01-23 Marek Safar <marek.safar@gmail.com>
2593 * typemanager.cs, generic.cs, parameter.cs, decl.cs, anonymous.cs,
2594 expression.cs, report.cs, ecore.cs, attribute.cs: Use common
2595 GetElementType and HasElementType. IsValueType clean up.
2597 2009-01-23 Marek Safar <marek.safar@gmail.com>
2599 * nullable.cs: Use common EmitCall.
2601 * expression.cs: Emit constraint. for virtual calls only.
2603 2009-01-23 Marek Safar <marek.safar@gmail.com>
2605 * typemanager.cs, generic.cs, eval.cs, convert.cs, const.cs,
2606 expression.cs, statement.cs, rootcontext.cs, ecore.cs, class.cs,
2607 driver.cs, attribute.cs, enum.cs: Split IsValueType and IsStruct
2610 2009-01-22 Jb Evain <jbevain@novell.com>
2612 * anonymous.cs: make anonymous types' ToString implementation
2613 match what csc outputs.
2615 2009-01-21 Marek Safar <marek.safar@gmail.com>
2617 * typemanager.cs, ecore.cs, iterator.cs: TypeLookupExpression clean
2620 2009-01-17 Marek Safar <marek.safar@gmail.com>
2622 * convert.cs, ecore.cs: Explicitly casts type arguments to pass
2625 2009-01-16 Marek Safar <marek.safar@gmail.com>
2627 * nullable.cs (LiftedBinaryOperator): Check for all possible null
2630 2009-01-15 Marek Safar <marek.safar@gmail.com>
2632 A fix for bug #466634
2633 * statement.cs: Add reference for nested storey when only this
2636 2009-01-15 Marek Safar <marek.safar@gmail.com>
2638 A fix for bug #466474
2639 * codegen.cs: Emit SecurityPermissionAttribute when -unsafe option
2642 2009-01-15 Marek Safar <marek.safar@gmail.com>
2644 * iterators.cs, anonymous.cs, expression.cs, statement.cs, ecore.cs:
2645 Fixed nested stories parent referencing process. Also fixes #463985.
2647 2009-01-06 Marek Safar <marek.safar@gmail.com>
2649 * decl.cs, iterators.cs, expression.cs, statement.cs, doc.cs,
2650 class.cs, cs-parser.jay, codegen.cs: Clean up destructor
2651 implementation. Also fixes #463108.
2653 2009-01-05 Marek Safar <marek.safar@gmail.com>
2655 A fix for bug #416109
2656 * decl.cs: Issue correct CLSAttribute warning location.
2658 2009-01-05 Marek Safar <marek.safar@gmail.com>
2660 A fix for bug #456775
2661 * attribute.cs: Use attribute owner scope when resolving attribute
2664 2009-01-05 Marek Safar <marek.safar@gmail.com>
2666 A fix for bug #457257
2667 * decl.cs: Fixed incorrect member declaring type comparison.
2669 2009-01-05 Marek Safar <marek.safar@gmail.com>
2671 A fix for bug #460896
2672 * driver.cs: Handle /RES resources as embeddable.
2674 2009-01-05 Marek Safar <marek.safar@gmail.com>
2676 A fix for bug #462515
2677 * ecore.cs: Report inacessible members upwards.
2679 2009-01-05 Marek Safar <marek.safar@gmail.com>
2681 A fix for bug #463190, #463192
2682 * decl.cs, namespace.cs: Also import internal extension classes.
2684 2009-01-04 Marek Safar <marek.safar@gmail.com>
2686 A fix for bug #463415
2687 * generic.cs: Use right index for RemoveDependentTypes.
2689 2009-01-02 Marek Safar <marek.safar@gmail.com>
2691 A fix for bug #463196
2692 * expression.cs: Fixed enum to null comparison.
2694 2009-01-02 Marek Safar <marek.safar@gmail.com>
2696 A fix for bug #463121
2697 * nullable.cs: Fixed nullable user equality operator comparison.
2699 2009-01-02 Marek Safar <marek.safar@gmail.com>
2701 A fix for bug #462950
2702 * class.cs, decl.cs: Use full explicit name when defining automatic
2703 property backing field.
2705 2009-01-02 Marek Safar <marek.safar@gmail.com>
2707 A fix for bug #462592
2708 * pending.cs: Emit type arguments for generic proxy method.
2710 2008-12-30 Marek Safar <marek.safar@gmail.com>
2712 * expression.cs (As): Mutate all type arguments.
2714 2008-12-29 Marek Safar <marek.safar@gmail.com>
2716 A fix for bug #462622
2717 * anonymous.cs: Resolve anonymous type GetHashCode in unchecked
2720 2008-12-29 Marek Safar <marek.safar@gmail.com>
2722 A fix for bug #450782
2723 * ecore.cs: Consider more variables of form V.I to be fixed.
2725 2008-12-29 Marek Safar <marek.safar@gmail.com>
2727 A fix for bug #460712
2728 * typemanager.cs: Core types could be imported.
2730 2008-12-28 Marek Safar <marek.safar@gmail.com>
2732 A fix for bugs #460847, #460772, #458049, #457339, #447807
2733 * generic.cs, parameter.cs, lambda.cs, linq.cs, anonymous.cs
2734 statement.cs, ecore.cs, class.cs, delegate.cs, flowanalysis.cs
2735 cs-parser.jay, driver.cs: LINQ implementation upgrade to deal with
2736 user lambdas used inside query clauses.
2738 2008-12-18 Marek Safar <marek.safar@gmail.com>
2740 A fix for bug #460229
2741 * cs-tokenizer.cs: Ignore wrongly placed BOM markers.
2743 2008-12-18 Marek Safar <marek.safar@gmail.com>
2745 A fix for bug #459952
2746 * decl.cs, namespace.cs: Use common CheckAccessLevel.
2748 2008-12-18 Marek Safar <marek.safar@gmail.com>
2750 A fix for bug #459630
2751 * convert.cs: Enum to valuetype conversion is not allowed.
2753 2008-12-18 Marek Safar <marek.safar@gmail.com>
2755 A fix for bug #457087
2756 * generic.cs: Don't crash when constraint comes from type
2759 2008-12-16 Marek Safar <marek.safar@gmail.com>
2761 A fix for bug #459221
2762 * anonymous.cs, statement.cs: Delay only captured this
2765 2008-12-12 Marek Safar <marek.safar@gmail.com>
2767 A fix for bug #457489
2768 * anonymous.cs, statement.cs: Split anonymous storey instantiation
2769 and initialization to capture scope initializers correctly.
2771 2008-12-11 Marek Safar <marek.safar@gmail.com>
2773 * generic.cs, parameter.cs, expression.cs, statement.cs, doc.cs:
2774 ParameterReference refactoring.
2776 2008-12-03 Marek Safar <marek.safar@gmail.com>
2778 * typemanager.cs, namespace.cs, driver.cs: Allow ExtensionAttribute
2779 to be imported from any assembly.
2781 2008-12-03 Marek Safar <marek.safar@gmail.com>
2783 * parameter.cs, lambda.cs, linq.cs, iterators.cs, anonymous.cs
2784 statement.cs, class.cs, cs-parser.jay: Removed duplicate parameters
2785 from anonymous method and lambda expression.
2787 2008-12-01 Marek Safar <marek.safar@gmail.com>
2789 A fix for bug #448560
2790 * expression.cs (As): Box any generic type arguments to be
2793 2008-11-29 Raja R Harinath <harinath@hurrynot.org>
2795 Add tripwire for implicit conversion bugs
2796 * ecore.cs (MethodGroupExpr.Error_ArgumentCountWrong): New helper
2798 (MethodGroupExpr.OverloadResolve): Add sanity check between
2799 IsApplicable and VerifyArgumentsCompat.
2800 (VerifyArgumentsCompat): Report CS1501 where appropriate.
2802 2008-11-29 Raja R Harinath <harinath@hurrynot.org>
2804 Fix build break in System.Data_test
2805 * convert.cs (ImplicitConversionExists): Move NullLiteral
2807 (ImplicitStandardConversionExists): ... here.
2809 2008-11-28 Marek Safar <marek.safar@gmail.com>
2811 * literal.cs: Emit correctly explicit null to nullable cast.
2813 2008-11-28 Marek Safar <marek.safar@gmail.com>
2815 * ecore.cs, generics.cs: Fixed crash when type arguments fail to
2818 2008-11-28 Marek Safar <marek.safar@gmail.com>
2820 A fix for bug #449005
2821 * convert.cs, nullable.cs: Use only one implicit nullable
2824 2008-11-27 Marek Safar <marek.safar@gmail.com>
2826 * convert.cs, literal.cs: More Convert cleanup is needed.
2828 2008-11-27 Marek Safar <marek.safar@gmail.com>
2830 * decl.cs, class.cs: Fixed misleading error message.
2832 2008-11-26 Marek Safar <marek.safar@gmail.com>
2834 A fix for bug #449005
2835 * nullable.cs (EmitEquality): Disable optimization for user operator
2838 2008-11-25 Marek Safar <marek.safar@gmail.com>
2840 A fix for bug #447027
2841 * anonymous.cs (HoistedVariable): Cache also outer access to deal
2842 with context variables stored as expression instances.
2844 2008-11-25 Marek Safar <marek.safar@gmail.com>
2846 A fix for bug #447027
2847 * delegate.cs: Fixed delegate VerifyMethod logic.
2849 2008-11-24 Marek Safar <marek.safar@gmail.com>
2851 * ecore.cs, delegate.cs: MethodGroup expressions can be applicable
2854 2008-11-21 Marek Safar <marek.safar@gmail.com>
2856 * typemanager.cs, decl.cs, anonymous.cs, class.cs, enum.cs: Rewrote
2857 member type resolve to follow normal flow, instead of random
2860 2008-11-21 Marek Safar <marek.safar@gmail.com>
2862 * iterators.cs (GetEnumeratorStatement): Re-use already resolved
2865 2008-11-21 Marek Safar <marek.safar@gmail.com>
2867 * const.cs: Emit decimal array constant as literal.
2869 2008-11-20 Marek Safar <marek.safar@gmail.com>
2871 * iterators.cs, ecore.cs: Removed CurrentBlock statement.
2873 2008-11-19 Marek Safar <marek.safar@gmail.com>
2875 * eval.cs, location.cs, driver.cs (Location.SourceFiles): Turned
2876 into real property (saves 8 MB for corlib compilation).
2878 2008-11-19 Marek Safar <marek.safar@gmail.com>
2880 * generic.cs, lambda.cs, linq.cs, iterators.cs, anonymous.cs,
2881 nullable.cs, expression.cs, statement.cs, ecore.cs, cs-parser.jay
2882 generic-mcs.cs: Small cleanup of TypeArguments.
2884 2008-11-18 Marek Safar <marek.safar@gmail.com>
2886 * generic.cs, iterators.cs, anonymous.cs, nullable.cs, ecore.cs,
2887 expression.cs, namespace.cs, generic-mcs.cs, class.cs: Small cleanup
2888 of ConstructedType expression, renamed to GenericTypeExpr.
2890 2008-11-17 Marek Safar <marek.safar@gmail.com>
2892 A fix for bug #445303
2893 * location.cs (IsConditionalDefined): Handle undefined global
2896 2008-11-17 Marek Safar <marek.safar@gmail.com>
2898 A fix for bug #444678
2899 * expression.cs (TryReduceConstant): Always create new constant
2902 2008-11-17 Marek Safar <marek.safar@gmail.com>
2904 A fix for bug #444673
2905 * ecore.cs: Ignore open generic types when used as generic type
2908 2008-11-17 Marek Safar <marek.safar@gmail.com>
2910 A fix for bug #445458
2911 * expression.cs, cs-parser.jay: Don't crash when an expression
2914 2008-11-17 Marek Safar <marek.safar@gmail.com>
2916 A fix for bug #445464
2917 * expression.cs, cs-parser.jay: Fixed typeof of non-generic type
2918 inside unbound type.
2920 2008-11-14 Jb Evain <jbevain@novell.com>
2922 * driver.cs: ignore empty -nowarn argument such as
2923 the one in -nowarn:12,13,,.
2925 2008-11-13 Marek Safar <marek.safar@gmail.com>
2927 A fix for bug #444271
2928 * anonymous.cs: Rescan parent storeys when best candidate was
2931 2008-11-13 Marek Safar <marek.safar@gmail.com>
2933 * generic.cs, expression.cs, ecore.cs, cs-parser.jay: Removed
2934 useless UnboundTypeExpression.
2936 * attribute.cs: Do check obsolete attribute on generic types.
2938 2008-11-12 Marek Safar <marek.safar@gmail.com>
2940 A fix for bugs #425680, #400139
2941 * ecore.cs, expression.cs: Trying to do some almost_matched_members
2944 2008-11-11 Marek Safar <marek.safar@gmail.com>
2946 A fix for bug #435747
2947 * assign.cs, expression.cs: Cleanup New assignment to emit correcly
2948 compound value types assignment. Few micro optimizations added.
2950 2008-11-10 Marek Safar <marek.safar@gmail.com>
2952 A fix for bug #442610
2953 * anonymous.cs (MutateConstructor): More SRE hacking.
2955 2008-11-10 Marek Safar <marek.safar@gmail.com>
2957 A fix for bug #442579
2958 * ecore.cs: Also initialize expanded form of a method with 1 params
2961 2008-11-06 Marek Safar <marek.safar@gmail.com>
2963 * expression.cs (UnaryMutator): Do early l-side check.
2965 2008-11-05 Miguel de Icaza <miguel@novell.com>
2967 * codegen.cs (InitDynamic): also setup Assembly.Name like we do in
2968 Init, otherwise we would crash later on when checking for friend
2971 * eval.cs: Do not hide errors from invalid calls to LoadAssembly.
2972 Otherwise we never get any meaningful information as to what
2975 2008-11-05 Marek Safar <marek.safar@gmail.com>
2977 A fix for bug #436318
2978 * driver.cs, report.cs: Add -warnaserror:Wn to command line options.
2980 2008-11-05 Miguel de Icaza <miguel@novell.com>
2982 * namespace.cs: Turns out that it was a really bad idea to hide
2983 the errors for namespaces not found here in eval mode.
2985 * eval.cs: When we process using clauses, only enter those into
2986 the list of valid using clauses after they have been validated.
2988 The above change gives the proper semantics: it does not
2989 senselessly report the same errors with broken using statements by
2990 never storing them in the first place when they are invalid.
2992 2008-11-05 Marek Safar <marek.safar@gmail.com>
2994 A fix for bug #421839
2995 * cs-parser.jay: Remove expression from coalesce rule to force lower
2996 priority than the assignment operator.
2998 2008-11-05 Marek Safar <marek.safar@gmail.com>
3000 A fix for bug #437875
3001 * nullable.cs: Compile correctly method group operand used with null
3002 coalescing operator.
3004 2008-11-04 Marek Safar <marek.safar@gmail.com>
3006 A fix for bug #434589
3007 * expression.cs (Binary): Ignore lifted conversions when at least
3008 one operand is of reference type.
3010 2008-11-04 Marek Safar <marek.safar@gmail.com>
3012 * cs-parser.jay: Better syntax error report.
3014 2008-11-03 Marek Safar <marek.safar@gmail.com>
3016 A fix for bug #436792
3017 * cs-parser.jay: Use GetLocation to access location.
3019 2008-11-03 Marek Safar <marek.safar@gmail.com>
3021 A fix for bug #440774
3022 * cs-parser.jay: Also set current_array_type when parsing local
3025 2008-11-03 Marek Safar <marek.safar@gmail.com>
3027 A fix for bug #440785
3028 * expression.cs (As): Don't resolve self modifing expression
3031 2008-11-03 Marek Safar <marek.safar@gmail.com>
3033 A fix for bug #439447
3034 * cs-tokenizer.cs: Tokenize surrogates only where allowed.
3036 2008-11-03 Marek Safar <marek.safar@gmail.com>
3038 A fix for bug #437571
3039 * cs-parser.jay: Fixes internal error for invalid expression
3042 2008-10-17 Marek Safar <marek.safar@gmail.com>
3044 * ecore.cs: Resolve correctly ambiguous params delegate methods.
3046 2008-10-17 Marek Safar <marek.safar@gmail.com>
3048 * generic.cs, anonymous.cs: Simplified GetDeclarations.
3050 2008-10-17 Marek Safar <marek.safar@gmail.com>
3052 * cs-tokenizer.cs: More precise cast parsing.
3054 2008-10-16 Martin Baulig <martin@ximian.com>
3056 * anonymous.cs (AnonymousMethodStorey): Put back the
3057 `hoisted_locals' hashtable and use it in EmitType().
3059 2008-10-15 Marek Safar <marek.safar@gmail.com>
3061 * cs-tokenizer.cs, nullable.cs, expression.cs, statement.cs,
3062 cs-parser.jay: Tokenizer optimizations and memory reduction, saves
3065 2008-10-14 Marek Safar <marek.safar@gmail.com>
3067 * cs-tokenizer.cs: Add bool type to the list of valid cast tokens.
3069 2008-10-14 Marek Safar <marek.safar@gmail.com>
3071 * statement.cs: Mutate scope initializers.
3073 2008-10-14 Marek Safar <marek.safar@gmail.com>
3075 * expression.cs: Use typeless value for This constant.
3077 * ecore.cs: Access FieldInfo via GetConstructedFieldInfo.
3079 2008-10-14 Marek Safar <marek.safar@gmail.com>
3081 * cs-tokenizer.cs, cs-parser.jay: Unify context sensite keyword
3084 2008-10-13 Marek Safar <marek.safar@gmail.com>
3086 * cs-tokenizer.cs: Add missing alias qualifier and dotted generic
3089 2008-10-13 Marek Safar <marek.safar@gmail.com>
3091 * cs-tokenizer.cs, expression.cs, cs-parser.jay: Reworked parens
3092 parser and tokenizer. Fixes many ambiguities including #433258.
3094 2008-10-10 Marek Safar <marek.safar@gmail.com>
3096 * cs-parser.jay: Fixed missing accessor recovery.
3098 2008-10-10 Marek Safar <marek.safar@gmail.com>
3100 A fix for bug #433701
3101 * expression.cs: Better error message.
3103 2008-10-10 Marek Safar <marek.safar@gmail.com>
3105 * cs-parser.jay, expression.cs: Start reporting real parser errors.
3107 * Makefile: Disabled unused debug symbols.
3109 Also fixes: #320556, #321097, #321656, #321876, #351316
3111 2008-10-09 Miguel de Icaza <miguel@novell.com>
3113 * eval.cs: rename "<interactive>" to "{interactive}", to work
3114 around a requirement in the compiler that this be a valid
3115 filename, and in Windows it is not (433886).
3117 2008-10-09 Marek Safar <marek.safar@gmail.com>
3119 * cs-tokenizer.cs, cs-parser.jay: Fixed more subtle parser problems
3121 2008-10-08 Marek Safar <marek.safar@gmail.com>
3123 * cs-tokenizer.cs, eval.cs, anonymous.cs, statement.cs, class.cs
3124 cs-parser.jay: Generic type declaration and type arguments cleanup.
3126 2008-10-05 Marek Safar <marek.safar@gmail.com>
3128 * cs-parser.jay: Allow parsing weird array creation construct.
3130 2008-10-05 Marek Safar <marek.safar@gmail.com>
3132 * cs-parser.jay: Conflicts reduction.
3134 2008-10-04 Marek Safar <marek.safar@gmail.com>
3136 * cs-parser.jay: Conflicts reduction.
3138 2008-10-04 Raja R Harinath <harinath@hurrynot.org>
3141 * flowanalysis.cs (MyBitvector.MakeShared): Rename from 'Shared'
3142 property. Add a 'count' hint about the use of the shared vector.
3143 Ensure that we don't leak out dirty bits.
3144 (UsageVector.MergeChild): Throw away information about variables
3146 Based on patch and analysis by Moritz Kroll <Moritz.Kroll@gmx.de>.
3148 2008-10-03 Marek Safar <marek.safar@gmail.com>
3150 A fix for bug #431746
3151 * iterators.cs, anonymous.cs: Re-initialize hoisted iterator
3152 parameters when iterator is created.
3154 2008-10-03 Marek Safar <marek.safar@gmail.com>
3156 A fix for bug #431827
3157 * expression.cs: Fixed right based pointer arithmetic operations
3160 2008-10-03 Marek Safar <marek.safar@gmail.com>
3162 A fix for bug #353779
3163 * assign.cs, expression.cs: Fixed compound assignment conversions.
3165 2008-10-02 Marek Safar <marek.safar@gmail.com>
3167 A fix for bug #375262
3168 * statement.cs: Refactor ArrayForeach to be usable with string
3169 indexer. Optimized single dimentional arrays foreach.
3171 2008-10-02 Marek Safar <marek.safar@gmail.com>
3173 A fix for bug #431255
3174 * anonymous.cs, expression.cs: Removed broken optimization.
3176 2008-10-01 Marek Safar <marek.safar@gmail.com>
3178 * anonymous.cs: Use full type parameters of parent generic
3179 containers. Removed unnecessary AddParentStoreyReference call.
3181 2008-10-01 Marek Safar <marek.safar@gmail.com>
3183 A fix for bug #324702
3184 * class.cs: Use better shorter names for explicit interface member
3187 * ecore.cs, typemanager.cs: Convert only mscorlib predefined names.
3189 2008-10-01 Marek Safar <marek.safar@gmail.com>
3191 * expression.cs: Use new interface to check fixed expression.
3193 2008-10-01 Marek Safar <marek.safar@gmail.com>
3195 A fix for bug #421101
3196 * expression.cs, statement.cs, ecore.cs: Use IFixedExpression
3197 interface to check for fixed fixed-buffers.
3199 2008-10-01 Marek Safar <marek.safar@gmail.com>
3201 A fix for bug #429264
3202 * assign.cs, anonymous.cs, ecore.cs: More type mutators added.
3204 * delegate.cs: Removed unnecessary casts.
3206 2008-09-30 Marek Safar <marek.safar@gmail.com>
3208 A fix for bug #352151
3209 * decl.cs, iterators.cs, anonymous.cs, report.cs, namespace.cs,
3210 class.cs: Fixed already defined explicit interface members check.
3212 2008-09-29 Rodrigo Kumpera <rkumpera@novell.com>
3214 cs-tokenizer.cs: Fix typo.
3216 2008-09-28 Miguel de Icaza <miguel@novell.com>
3218 * eval.cs (InteractiveBase): The quit command now just sets a
3219 flag, instead of calling Environment.Exit(), it is milder on
3222 CompiledMethod is now in Mono.CSharp, not nested inside
3223 the Evaluator, it was inconvenient to use.
3225 2008-09-27 Miguel de Icaza <miguel@novell.com>
3227 * eval.cs (Evaluator): Introduce Compile method, to allow compiled
3228 code to be invoked without having to reparse.
3230 2008-09-27 Miguel de Icaza <miguel@novell.com>
3232 * ecore.cs: The recent changes to FieldExpr broke this as well.
3233 Fixes LINQ queries in the interactive shell.
3235 * Multiple files: indentation fixing for the Mono coding
3236 guidelines for the switch statement.
3238 * eval.cs: Make the Evaluator API thread safe.
3240 2008-09-26 Marek Safar <marek.safar@gmail.com>
3242 * anonymous.cs, statement.cs, class.cs, cs-parser.jay: Simplified
3243 constructor parsing.
3245 2008-09-26 Marek Safar <marek.safar@gmail.com>
3247 A fix for bug #325326
3248 * statement.cs: Check possible mistaken empty statement using
3249 explicit blocks only.
3251 2008-09-25 Miguel de Icaza <miguel@novell.com>
3253 * eval.cs (LoadAssembly, ReferenceAssembly): Call
3254 RootNamespace.ComputeNamespaces to update the internal list of
3255 namespaces, this is no longer done for us.
3257 (InteractiveBase): Use the Evaluator APIs instead of calling into
3260 2008-09-25 Marek Safar <marek.safar@gmail.com>
3262 A fix for bug #429264
3263 * expression.cs: Missing mutator for access to multidimensional
3266 2008-09-25 Marek Safar <marek.safar@gmail.com>
3268 * class.cs, statement: Emit DebuggerHidden attribute for iterator
3271 * driver.cs: Missing input argument check.
3273 2008-09-25 Marek Safar <marek.safar@gmail.com>
3275 * typemanager.cs, generic.cs, eval.cs, decl.cs, anonymous.cs,
3276 expression.cs, statement.cs, rootcontext.cs, class.cs,
3277 cs-parser.jay, driver.cs, generic-mcs.cs, enum.cs: Removed obsolete
3280 2008-09-24 Miguel de Icaza <miguel@novell.com>
3282 * ecore.cs (FieldExpr): Only initialize eclass when we return a
3283 fully constructed FieldExpr, fixes the regression introduced in
3286 * ecore.cs, expression.cs: Plug back the eclass initialization as
3287 otherwise it regresses `csharp'.
3289 2008-09-24 Marek Safar <marek.safar@gmail.com>
3291 * typemanager.cs, decl.cs, convert.cs, assign.cs, expression.cs,
3292 ecore.cs, attribute.cs: Moved obsolete method checks from emit
3293 phase to resolve phase. It resolves problems with expression trees
3294 and fixes bugs #323796, #325156.
3296 2008-09-23 Marek Safar <marek.safar@gmail.com>
3298 * codegen.cs: Report better error when symbol writer is missing.
3300 2008-09-23 Marek Safar <marek.safar@gmail.com>
3302 * codegen.cs: Set .NET symbol writer.
3304 * decl.cs: Guard against null generic arguments.
3306 * report.cs: Don't report exactly same additional details.
3308 2008-09-22 Marek Safar <marek.safar@gmail.com>
3310 A fix for bug #324917
3311 * cs-parser.jay: Add missing multidimensional non-expression type
3314 2008-09-22 Marek Safar <marek.safar@gmail.com>
3316 A fix for bug #428191
3317 * anonymous.cs: Create an outer generic fields also for non-storey
3320 2008-09-22 Marek Safar <marek.safar@gmail.com>
3322 A fix for bug #378294
3323 * class.cs: Make fixed size buffers gmcs feature only.
3325 2008-09-22 Marek Safar <marek.safar@gmail.com>
3327 A fix for bug #355622, #324993
3328 * assign.cs, const.cs, class.cs: Create new EmitContext for each
3331 2008-09-19 Marek Safar <marek.safar@gmail.com>
3333 * nullable.cs, expression.cs, namespace.cs, delegate.cs: Duplicate
3336 2008-09-19 Marek Safar <marek.safar@gmail.com>
3338 A fix for bug #416110
3339 * generic.cs: Struct constraint results in default ctor and
3340 ValueType base type constraint to be set.
3342 2008-09-19 Marek Safar <marek.safar@gmail.com>
3344 A fix for bug #423791
3345 * generic.cs: Fixed params output type type-inference.
3347 2008-09-19 Marek Safar <marek.safar@gmail.com>
3349 * cs-parser.jay, expression.cs: Fixed few expression crashes.
3351 2008-09-19 Marek Safar <marek.safar@gmail.com>
3353 * cs-tokenizer.cs: Don't break on extra partial modifier.
3355 2008-09-19 Marek Safar <marek.safar@gmail.com>
3357 A fix for bug #427592
3358 * generic.cs: Use common parameter resolve method.
3360 2008-09-18 Marek Safar <marek.safar@gmail.com>
3362 A fix for bug #414758
3363 * expression.cs, ecore.cs: Fixed crash when accessing non-static
3366 2008-09-18 Marek Safar <marek.safar@gmail.com>
3368 * driver.cs, namespace.cs: Read types and namespaces after all
3369 requested assemblies are loaded, fixes issues with System.Core
3370 auto-reference, and #419888.
3372 2008-09-18 Marek Safar <marek.safar@gmail.com>
3374 A fix for bug #417705
3375 * cs-parser.jay: Fixed as/is operator expression split.
3377 2008-09-18 Marek Safar <marek.safar@gmail.com>
3379 * const.cs, expression.cs, statement.cs, ecore.cs, cs-parser.jay:
3380 Fixed expression tree representation of empty new expression and
3381 new initializer expression.
3383 2008-09-18 Miguel de Icaza <miguel@novell.com>
3385 * eval.cs: Remove warning, keep reference to driver around.
3387 * Hide fields that do not need to be public.
3389 2008-09-17 Marek Safar <marek.safar@gmail.com>
3391 A fix for bug #426385
3392 * expression.cs (ImplicitlyTypedArrayCreation): Use full implicit
3393 conversion for array elements.
3395 2008-09-17 Marek Safar <marek.safar@gmail.com>
3397 * expression.cs, statement.cs, class.cs, cs-parser.jay: Fixed
3398 void parsing conflicts.
3400 2008-09-15 Marek Safar <marek.safar@gmail.com>
3402 A fix for bug #425601
3403 * driver.cs, typemanager.cs, namespace.cs: Automatically reference
3404 System.Core only when there is no custom ExtensionAttribute
3407 2008-09-15 Miguel de Icaza <miguel@novell.com>
3409 * namespace.cs: Do not report CS0246 (name
3411 2008-09-12 Marek Safar <marek.safar@gmail.com>
3413 A fix for bug #425669
3414 * generic.cs: Don't cache generic static anonymous method
3417 2008-09-12 Marek Safar <marek.safar@gmail.com>
3419 * generic.cs, class.cs, delegate.cs: Check recursive inherited
3420 conflicting constraints.
3422 2008-09-12 Raja R Harinath <harinath@hurrynot.org>
3424 * cs-tokenizer.cs (consume_identifier): Allow partial methods in
3427 2008-09-12 Marek Safar <marek.safar@gmail.com>
3429 * literal.cs, convert.cs, expression.cs, statement.cs: More null
3430 to null pointer conversion fixes.
3432 2008-09-11 Marek Safar <marek.safar@gmail.com>
3434 * cs-parser.jay, expression.cs: An implicitly typed local variable
3435 declarator cannot use an array initializer.
3437 2008-09-11 Marek Safar <marek.safar@gmail.com>
3439 * cs-parser.jay: Reduced number of printed tokens, add sorting.
3441 2008-09-11 Marek Safar <marek.safar@gmail.com>
3443 * generic.cs (InflatedConstraints): Don't crash when constraints
3446 * cs-parser.jay: const_declarator is a block.
3448 * constant.cs: Check for not allowed NaN conversions.
3450 2008-09-10 Miguel de Icaza <miguel@novell.com>
3452 * driver.cs: Drop --shell argument, the compiler is no longer a
3455 * eval.cs: Move most of the code that deals with evaluation into
3456 this file and document the public API from repl.cs
3458 * repl.cs: Remove from here.
3460 2008-09-10 Marek Safar <marek.safar@gmail.com>
3462 A fix for bug #424684
3463 * generic.cs: Generic class constraints must come first.
3465 2008-09-09 Miguel de Icaza <miguel@novell.com>
3467 * cs-parser.jay: Improve error reporting for syntax errors in
3468 statements and expressions, we now report the expected tokens
3469 instead of reporting the useless "; expected".
3471 Drop the strings from the token declaration, it turns out that
3472 they did not do what I thought they did. Instead they were adding
3473 two sets of tokens to the tables.
3475 2008-09-09 Marek Safar <marek.safar@gmail.com>
3477 * typemanager.cs, generic.cs, parameter.cs, expression.cs, class.cs,
3478 delegate.cs: Share special type check.
3480 2008-09-09 Marek Safar <marek.safar@gmail.com>
3482 A fix for bug #423981
3483 * expression.cs (EmitBranchable): Correctly emit inverted float conditions.
3485 2008-09-09 Marek Safar <marek.safar@gmail.com>
3487 * ecore.cs (ReducedConstantExpression): Implemented ConvertExplicitly and
3490 2008-09-09 Marek Safar <marek.safar@gmail.com>
3492 A fix for bugs: #324750, #335946
3493 * cs-tokenizer.cs, cs-parser.jay, expression.cs: Use a custom
3494 lookup rule to determine ?-based tokens.
3496 2008-09-08 Miguel de Icaza <miguel@novell.com>
3498 * repl.cs (OptionalAssign.EmitStatement): It is possible that some
3499 expressions (like event adding or removing) end up here, so we
3500 need to treat those as statements.
3502 Add LoadAssembly method.
3504 2008-09-04 Miguel de Icaza <miguel@novell.com>
3506 * repl.cs: Add Time method.
3508 2008-09-05 Marek Safar <marek.safar@gmail.com>
3510 * cs-tokenizer.cs: Fixed swaped UTF-16 surrogates parsing.
3512 2008-09-05 Miguel de Icaza <miguel@novell.com>
3514 * repl.cs: Add workaround for old compilers.
3516 2008-09-04 Jb Evain <jbevain@novell.com>
3518 * repl.cs (PrettyPrint): pretty print everything that
3519 implements IDictionary, as well as IEnumerables. Also,
3520 add a quit helper property.
3522 2008-09-04 Marek Safar <marek.safar@gmail.com>
3524 * constant.cs: Better error reporting for decimal literals.
3526 * class.cs, attribute.cs, typemanager.cs: Emit more fixed buffer
3529 2008-09-04 Marek Safar <marek.safar@gmail.com>
3530 Miguel de Icaza <miguel@novell.com>
3532 A fix for bug #422951
3533 * assign.cs (Assign.DoResolve): Perform the type conversions
3534 checks before we attempt to initialize `New' initializers.
3536 2008-09-04 Marek Safar <marek.safar@gmail.com>
3538 A fix for bug #422853
3539 * delegate.cs (DelegateCreation): Add special handling for
3540 EmptyExpression.Null instance expression which is just another
3541 hack for undecided member instance exression.
3543 2008-09-04 Marek Safar <marek.safar@gmail.com>
3545 * expression.cs, ecore.cs: Emit full expression tree for reduced
3548 2008-09-04 Marek Safar <marek.safar@gmail.com>
3550 * expression.cs (This): Guard against multi-resolving.
3552 * ecore.cs, statement.cs (Throw): Simplified.
3554 * flowanalysis.cs: Also verify event fields.
3556 2008-09-04 Miguel de Icaza <miguel@novell.com>
3558 * assign.cs (Assign.DoResolve): Perform the type conversions
3559 checks before we attempt to initialize `New' initializers.
3561 * repl.cs (PrettyPrint): Add Hashtable prettyprint
3563 * anonymous.cs (AnonymousTypeClass): On EvalMode make the class
3566 * repl.cs: Update help.
3568 2008-09-03 Miguel de Icaza <miguel@novell.com>
3570 * driver.cs (ProcessDefaultConfig): Now it encapsulates all the
3571 handling of the default config handling, including the special
3572 treatment of System.Core assembly.
3574 Fixes the REPL processing for LINQ.
3576 2008-09-03 Marek Safar <marek.safar@gmail.com>
3578 A fix for bug #422507
3579 * expression.cs (UnboxCast): Add missing child expression mutator.
3581 2008-09-03 Marek Safar <marek.safar@gmail.com>
3583 * driver.cs: Don't self reference System.Core assembly.
3585 2008-09-03 Marek Safar <marek.safar@gmail.com>
3587 A fix for bug #422507
3588 * expression.cs (StringConcat): Add missing type mutator.
3590 2008-09-03 Marek Safar <marek.safar@gmail.com>
3592 * generic.cs (TypeInferenceContext): Follow equality rule for
3593 constructed type lower bound type inference.
3595 2008-09-02 Miguel de Icaza <miguel@novell.com>
3597 * getline.cs (CmdRefresh): Apply patch from Douglas S. Blank
3598 <dblank@cs.brynmawr.edu> which updates the cursor position on
3601 2008-09-02 Marek Safar <marek.safar@gmail.com>
3603 A fix for bug #367145
3604 * driver.cs: Fixed import of extension methods when using -noconfig
3607 2008-09-02 Marek Safar <marek.safar@gmail.com>
3609 * iterator.cs: Don't emit GetEnumerator method twice but call a generic
3610 version from non-generic implementation instead.
3612 2008-09-01 Marek Safar <marek.safar@gmail.com>
3614 A fix for bug #418908
3615 * class.cs: Use AddScopeStatement for field initializers.
3617 2008-09-01 Marek Safar <marek.safar@gmail.com>
3619 A fix for bug #415385
3620 * ecore.cs, convert.cs: Do method group conversion for equal group types.
3622 2008-09-01 Marek Safar <marek.safar@gmail.com>
3624 A fix for bug #421736
3625 * iterators.cs: Don't crash on unreachable iterators.
3627 2008-09-01 Marek Safar <marek.safar@gmail.com>
3629 A fix for bug #421628
3630 * parameter.cs, attribute.cs: Clone also parameter attributes.
3632 2008-08-30 Miguel de Icaza <miguel@novell.com>
3634 * namespace.cs (LookupType): In EvalMode, try to replace
3635 the TypeBuilder from our cache with a Type as Reflection.Emit does
3636 not like to mix code from older assemblies emitted and new
3639 This sounds like a serious Mono bug that prevents multiple
3640 assemblies to be generated and consumed at the same time.
3642 * cs-parser.jay (push_current_class): Do not make interactive
3643 classes internal or private, make them public as we currently
3644 generate each new class in a new assembly.
3646 2008-08-29 Miguel de Icaza <miguel@novell.com>
3648 * decl.cs, roottypes.cs, class.cs:: Add an infrastructure to
3649 remove types that are entered into the global namespace during
3650 parsing so that we can remove them on failure.
3652 * cs-parser.jay: Parsing: we now keep track of types that are
3653 entered into global variables and queue those in case the parsing
3656 This happens in a few situations: during partial-input, we invoke
3657 the parser repeatedly for example with the string "class X", this
3658 would cause X to be registed, and we need to remove this
3659 registration so that another parse attempt later with say "class X {"
3660 would actually work.
3662 Additionally, if there is an error in the resolution phase, for
3663 example: "class X : NonExistant {}" th
3665 * cs-parser.jay: Be more precise with the errors being raised,
3666 instead of flagging all exceptions during parsing to be attributed
3667 to the parsing process, distinguish those from errors happening in
3668 the actions and hint that using -v would produce the actual
3671 * repl.cs: Do not load all compiler references on each reset,
3672 doing the partial reset takes care of this.
3674 2008-08-28 Miguel de Icaza <miguel@novell.com>
3676 * repl.cs: Add support for loading all the files from
3677 ~/.config/csharp/*cs as startup scripts and ~/.config/csharp/*.dll
3680 Introduce a micro-parser that is able to deambiguate on its input
3681 whether we are dealing with a compilation unit (namespace, class,
3682 interface, struct, delegate) declaration or a statement. This
3683 allows both declarations and statements to be entered.
3685 Set history size by default to 300 lines.
3687 Instead of distinguishing based on the parser.InteractiveResult,
3688 have only two cases: statements were parsed, or a compilation unit
3689 was. Always pull the Using statement additions from the
3690 compilation unit parse.
3692 * cs-tokenizer.cs: Rename tokens to better describe their intent
3693 (EvalStatementParserCharacter and EvalCompilationUnitParserCharacter).
3695 * rootcontext.cs: Split EvalMode into EvalMode and StatementMode.
3696 EvalMode is used to trigger the lookup of global variables while
3697 StatementMode is used turn variable declarations into static
3700 * getline.cs: Allow history size to be set.
3702 2008-08-29 Marek Safar <marek.safar@gmail.com>
3704 A fix for bug #360755
3705 * ecore.cs (SimpleName): Exclude indexers from simple name resolve.
3707 2008-08-29 Marek Safar <marek.safar@gmail.com>
3709 * generic.cs, iterators.cs, codegen.cs: Removed unused variable.
3711 * typemanager.cs, statement.cs, ecore.cs, enum.cs: Don't reconstruct enum
3712 member name, it is too confusing
3714 * decl.cs, class.cs: Don't report unused fields with attached attribute.
3716 * rootcontext.cs: Finally default to warning level 4.
3718 2008-08-28 Marek Safar <marek.safar@gmail.com>
3720 * class.cs (CheckBase): Ignore overloaded operators.
3722 2008-08-28 Marek Safar <marek.safar@gmail.com>
3724 A fix for bug #420830
3725 * expression.cs, cs-parser.jay: Put back InvocationOrCast expression.
3727 2008-08-28 Marek Safar <marek.safar@gmail.com>
3729 A fix for bug #420832
3730 * anonymous.cs, iterators.cs: Also clone hoisted this iterator variable.
3732 2008-08-28 Marek Safar <marek.safar@gmail.com>
3734 A fix for bug #420386
3735 * nullables.cs: Fixed logic of nullable user comparison operators involving
3738 2008-08-28 Marek Safar <marek.safar@gmail.com>
3740 * attribute (IsClsCompliant): Use FALSE value for pointer types.
3742 2008-08-27 Miguel de Icaza <miguel@novell.com>
3744 * repl.cs: Add support for aborting the running code with C-c.
3746 2008-08-27 Raja R Harinath <harinath@hurrynot.org>
3748 * cs-parser.jay (CS1002): Dump 'yyToken' with Report.ExtraInformation.
3750 2008-08-27 Miguel de Icaza <miguel@novell.com>
3752 * cs-parser.jay (interactive_statement_list): A new set of rules
3753 for hosting statements that uses the "interactive_" prefix.
3755 * repl.cs: Add support for parsing `using' as a statement or as a
3756 directive. Deambiguating before passing this to the parser.
3758 We need to distinguish statement_expressions that occur at the
3759 toplevel vs those that occur embedded into expressions.
3761 * getline.cs: Applied patch from Stuart Carnie <stuart.carnie@gmail.com>
3762 that fixes the cursor key handling, and a history bug.
3764 2008-08-26 Miguel de Icaza <miguel@novell.com>
3766 * Makefile: Drop BOOTSTRAP_COMPILER as that was masking the
3767 limitations in Console, instead the 2.0 bootstrap libraries now
3768 include the Console bits.
3770 Also, remove the use of Nullables from getline.cs
3774 Interactive support for the C# compiler. Use gmcs --shell to
3775 enter a read-eval-print loop shell.
3777 Docs: http://www.mono-project.com/CsharpRepl
3779 * sources: include repl.cs here and getline.cs for gmcs.exe,
3780 everything else is getline.cs impaired.
3782 * Makefile: when bootstrapping pass a special flag
3783 BOOTSTRAP_COMPILER which we use to prevent failures in compilation
3784 as we use NET_2_0 define to pull 2.0 APIs from System.Console.
3785 This distinguishes those two cases.
3787 * repl.cs: Support for a read-eval-print loop. Will be soon
3788 refactored into eval support and then REPL on top of it.
3790 * ecore.cs: If a simplename lookup fails, before erroring out,
3791 if we are in EvalMode to resolve the name to a declaration in the
3794 This means that variable declarations that happened in previous
3795 classes (as repl puts every statement in a separate class) are
3796 made visible in this way.
3798 * cs-parser.jay: UnexpectedEOF, a new flag that is set if we
3799 triggered an error due to the end of file being reached. This is
3800 used to do multi-line input, and notify the caller that the user
3801 needs to provide more text before a successful parse.
3803 Add new grammar rules after the INTERACTIVE_PARSER token is seen
3804 to drive the evaluation with a custom wrapper.
3806 * driver.cs: Add support for --shell, and refactor some code to be
3809 * namespace.cs: Add support for serializing the contents of the
3810 namespaces and reloading them.
3812 * getline.cs: A managed implementation of ReadLine under
3813 X11/Apache2 license terms. Easy to embed in other applications as
3816 * namespace.cs: Add some functions to save and restore the
3819 * rootcontext.cs: New public field.
3821 * cs-tokenizer.cs: Add support for one of the possible characters
3822 we introduce into the token stream.
3824 This patch does not affect the regular tokenization process, the
3825 only performance hit would happen if there is an invalid character
3826 on the input string.
3828 * support.cs: Move isatty helper routine here.
3830 * codegen.cs: Small cleanup, and add a mechanism to initialize the
3831 code generator for in-memory assemblies.
3833 2008-08-26 Marek Safar <marek.safar@gmail.com>
3835 * generic.cs, ecore.cs, delegate.cs, cs-parser.jay, expression.cs: A type
3836 parameter cannot be always used as a type.
3838 2008-08-21 Marek Safar <marek.safar@gmail.com>
3840 * convert.cs, expression.cs: Use single ExplicitReferenceConversion routine.
3842 2008-08-21 Marek Safar <marek.safar@gmail.com>
3844 * convert.cs: Implement explicit array to IList<T> conversion.
3846 2008-08-20 Marek Safar <marek.safar@gmail.com>
3848 A fix for bug #362740
3849 * cs-tokenizer.cs: Handle UTF-16 surrogates.
3851 2008-08-20 Marek Safar <marek.safar@gmail.com>
3853 * generic.cs, support.cs, typemanager.cs, lambda.cs, parameter.cs,
3854 pending.cs, ecore.cs, linq.cs, class.cs, decl.cs, delegate.cs,
3855 flowanalysis.cs, iterators.cs, cs-parser.jay, convert.cs, anonymous.cs,
3856 expression.cs, attribute.cs, statement.cs, doc.cs: Refactored parameters
3857 handling to use just one type of infrastructure and deal with generics
3860 2008-07-23 Martin Baulig <martin@ximian.com>
3862 *** Merged this from trunk revision 108527 ***
3865 (ExplicitBlock.EmitSymbolInfo): Moved to `ToplevelBlock'.
3866 (ToplevelBlock.EmitSymbolInfo): Tell the symbol writer about the
3869 2008-08-15 Marek Safar <marek.safar@gmail.com>
3871 * ecore.cs, linq.cs, const.cs, expression.cs, statement.cs: More robust
3874 2008-08-15 Marek Safar <marek.safar@gmail.com>
3876 * delegate.cs: Fixed compiler crash when creating delegate using partial
3879 * typemanager.cs: MulticastDelegate is not a delegate.
3881 2008-08-14 Marek Safar <marek.safar@gmail.com>
3883 * expression.cs, ecore.cs, anonymous.cs, class.cs: Fixed missing error
3886 2008-08-14 Raja R Harinath <harinath@hurrynot.org>
3888 * cs-parser.jay (type): Allow 'var' in mcs too.
3889 (local_variable_type): Likewise.
3891 2008-08-14 Marek Safar <marek.safar@gmail.com>
3893 * driver.cs: Removed broken -noconfig variants.
3895 2008-08-14 Marek Safar <marek.safar@gmail.com>
3897 A fix for bug #417078
3898 * expression.cs: Emit correctly left side pointer operators.
3900 2008-08-13 Marek Safar <marek.safar@gmail.com>
3902 * generic.cs, lambda.cs: Inflate method generic arguments only.
3904 2008-08-12 Marek Safar <marek.safar@gmail.com>
3906 * class.cs: Fixed struct layout check regression.
3908 2008-08-12 Marek Safar <marek.safar@gmail.com>
3910 * cs-parser.jay, enum.cs: Simplified enum parsing.
3912 * decl.cs: Check all type parameters conflicts.
3914 * expression.cs, statement.cs, attribute.cs: More expression checks.
3916 2008-08-11 Marek Safar <marek.safar@gmail.com>
3918 * generic.cs: Add type inference types restriction.
3920 * parameter.cs, class.cs, delegate.cs, iterators.cs, cs-parser.jay,
3921 anonymous.cs, expression.cs: Allocate less accessor parameters.
3923 2008-08-08 Marek Safar <marek.safar@gmail.com>
3925 * typemanager.cs, ecore.cs: Ambiguous operators can come from different
3928 2008-08-08 Marek Safar <marek.safar@gmail.com>
3930 * convert.cs, delegate.cs: Fixed delegate compatibility conversion.
3932 2008-08-07 Marek Safar <marek.safar@gmail.com>
3934 * class.cs, decl.cs, iterator.cs, ecore.cs: Refactor base type resolving.
3935 Also fixes #362146 and #381592.
3937 2008-08-07 Marek Safar <marek.safar@gmail.com>
3939 * ecore.cs: Reduced constant cannot be used as an attribute value.
3941 * cs-parser.jay: Base expression has to be a type.
3943 * expression.cs (Conditional): Uses ReducedExpression.
3945 2008-08-06 Marek Safar <marek.safar@gmail.com>
3947 A fix for bug #376826
3948 * parameter.cs, ecore.cs, anonymous.cs, expression.cs, statement.cs: An
3949 address of hoisted local variable or parameter cannot be taken.
3951 2008-08-05 Marek Safar <marek.safar@gmail.com>
3953 * ecore.cs, constant.cs, expression.cs, statement.cs: Resolve correctly
3954 anonymous method inside checked/unchecked expression.
3956 2008-08-05 Marek Safar <marek.safar@gmail.com>
3958 * typemanager.cs (IsEqual): Guard against null.
3960 * ecore.cs, class.cs, convert.cs, const.cs, constant.cs, expression.cs,
3961 attribute.cs, enum.cs, statement.cs: Pass EmitContext to constant conversion
3962 routine. Fixed few misleading conversion errors.
3964 2008-08-04 Marek Safar <marek.safar@gmail.com>
3966 * class.cs: Consider generics when checking cycles in struct layout.
3968 2008-08-04 Raja R Harinath <harinath@hurrynot.org>
3970 * cs-tokenizer.cs (get_cmd_arg): Simplify. Don't be too pedantic.
3972 2008-08-04 Marek Safar <marek.safar@gmail.com>
3974 A fix for bug #414165
3975 * anonymous.cs: Use same anonymous implementation method for all anonymous
3978 2008-08-04 Marek Safar <marek.safar@gmail.com>
3980 * generic.cs, anonymous.cs, statement.cs: Emit inherited anonymous method
3983 2008-08-04 Marek Safar <marek.safar@gmail.com>
3985 * cs-parser.jay: Typeof argument has to be a type expression.
3987 * namespace.cs: Check alias and namespace definitions collisions.
3989 * class.cs, pending.cs: Moved explicit interface accessor implementation
3992 * delegate.cs, expression.cs: Verify special name invocations.
3994 2008-08-01 Marek Safar <marek.safar@gmail.com>
3996 * cs-parser.jay: Don't choke on empty generic type arguments.
3998 * cs-tokenizer.cs: Handle escaped preprocessor directives.
4000 * expression.cs, ecore.cs: Minor expressions bugs.
4002 2008-08-01 Marek Safar <marek.safar@gmail.com>
4004 * cs-parser.jay: Removed duplicate interface declaration (fixes 2 conflicts)
4005 and added more error handling.
4007 * class.cs, iterators.cs, anonymous.cs: Removed useless interface parameter.
4009 * modifiers.cs, enum.cs: Fixed.
4011 2008-07-31 Jb Evain <jbevain@novell.com>
4013 * driver.cs: remove -pkg ability of smcs.
4015 2008-07-30 Marek Safar <marek.safar@gmail.com>
4017 * statement.cs (Switch): Correctly set empty default target for single
4020 2008-07-30 Marek Safar <marek.safar@gmail.com>
4022 * typemanager.cs, assign.cs, driver.cs, expression.cs, statement.cs: Rewrote
4023 string switch statement implementation to use string dictionary which
4024 significantly (2-8x) improves performance of generated code.
4026 2008-07-29 Marek Safar <marek.safar@gmail.com>
4028 A fix for bug #412880 by Atsushi Enomoto <atsushi@ximian.com>
4029 * modifiers.cs (GetDescription): Fixed FamANDAssem case.
4031 2008-07-29 Marek Safar <marek.safar@gmail.com>
4033 A fix for bug #412595
4034 * typemanager.cs, convert.cs, expression.cs: Some types are never
4035 convertible to each other.
4037 2008-07-29 Marek Safar <marek.safar@gmail.com>
4039 * nullable.cs (CreateNullConstant): An error messages update.
4041 2008-07-29 Marek Safar <marek.safar@gmail.com>
4043 A fix for bug #412595
4044 * cfold.cs: Don't cast undefined bool constant.
4046 2008-07-29 Martin Baulig <martin@ximian.com>
4049 (SymbolWriter.Reset): New public static method.
4052 (CompilerCallableEntryPoint.Reset): Call SymbolWriter.Reset().
4054 2008-07-28 Marek Safar <marek.safar@gmail.com>
4056 * cs-tokenizer.cs (IsLambdaOpenParens): Optimized using more stop tokens.
4058 * expression.cs (ElementAccess): Exact size allocation.
4060 2008-07-26 Marek Safar <marek.safar@gmail.com>
4062 * driver.cs: Replaced outdated UnixParseOption with CSCParseOption.
4064 2008-07-25 Marek Safar <marek.safar@gmail.com>
4066 * flowanalysis.cs (StructInfo): Fixed detection of dynamic types.
4068 * class.cs: Removed $PRIVATE$ field hack which caused problems during
4071 2008-07-25 Marek Safar <marek.safar@gmail.com>
4073 A fix for bug #412217
4074 * assign.cs: Mutate also assignment type.
4076 2008-07-25 Marek Safar <marek.safar@gmail.com>
4078 A fix for bug #323644
4079 * typemanager.cs (IsValidProperty): Verify DefaultMemberName when checking
4082 2008-07-25 Marek Safar <marek.safar@gmail.com>
4084 A fix for bug #412134
4085 * expression.cs (ResolveOperatorEnum): Do implicit conversion of
4086 non-enumerable operands when overloading equality or bitwise operators.
4088 2008-07-25 Marek Safar <marek.safar@gmail.com>
4090 * anonymous.cs: Cache closed generic anonymous method delegates.
4092 2008-07-24 Marek Safar <marek.safar@gmail.com>
4094 * lambda.cs, linq.cs, class.cs, iterators.cs, cs-parser.jay, assign.cs,
4095 anonymous.cs, statement.cs: Always emit anonymous method as static method
4096 when is instance free. Use nesting for nested anynomous methods blocks.
4098 2008-07-23 Marek Safar <marek.safar@gmail.com>
4100 * anonymous.cs (MutateGenericMethod): Added extra code path for imported
4103 2008-07-23 Marek Safar <marek.safar@gmail.com>
4105 * expression.cs: Removed MakeSimpleCall.
4107 2008-07-23 Marek Safar <marek.safar@gmail.com>
4109 A fix for bug #323012
4110 * class.cs, pending.cs: Emit proxy for indexers when they differ in name.
4111 Base method implementing interface has to be public.
4113 2008-07-23 Marek Safar <marek.safar@gmail.com>
4115 * cs-parser.jay: Don't break on missing argument.
4117 2008-07-22 Marek Safar <marek.safar@gmail.com>
4119 A fix for bug #320993
4120 * report.cs, parameter.cs, class.cs, decl.cs, delegate.cs, attribute.cs,
4121 enum.cs, codegen.cs: Report CLS compliance errors as warnings.
4123 2008-07-22 Marek Safar <marek.safar@gmail.com>
4125 A fix for bug #320748
4126 * convert.cs: Implicit user operators cannot convert to interfaces
4128 2008-07-22 Marek Safar <marek.safar@gmail.com>
4130 A fix for bug #312686
4131 * driver.cs: Ignore empty assembly references.
4133 2008-07-22 Marek Safar <marek.safar@gmail.com>
4135 A fix for bug #387040
4136 * ecore.cs: Skip constrains check for an explicit implementation.
4138 2008-07-21 Marek Safar <marek.safar@gmail.com>
4140 A fix for bug #409045
4141 * cs-tokenizer.cs, rootcontext.cs, class.cs, location.cs, delegate.cs,
4142 cs-parser.jay, driver.cs, expression.cs, attribute.cs: Conditional
4143 identifiers are file specific unless passed as input arguments.
4145 2008-07-21 Marek Safar <marek.safar@gmail.com>
4147 * typemanager.cs, parameter.cs, class.cs, attribute.cs: Use an attribute
4148 to emit UnmanagedMarshal data under 2.0 profile.
4150 2008-07-21 Marek Safar <marek.safar@gmail.com>
4152 A fix for bug #410369
4153 * parameter.cs: Clone correctly ParamsParameter.
4155 2008-07-21 Marek Safar <marek.safar@gmail.com>
4157 * expression.cs (Argument): Always report type for type based expressions
4160 2008-07-18 Marek Safar <marek.safar@gmail.com>
4162 A fix for bug #410666
4163 * anonymous.cs: Correctly initialize generic storey reference.
4165 2008-07-18 Marek Safar <marek.safar@gmail.com>
4167 * convert.cs: Don't box same type arguments.
4169 2008-07-18 Marek Safar <marek.safar@gmail.com>
4171 * ecore.cs, linq.cs, delegate.cs, constant.cs, nullable.cs, expression.cs:
4172 Finished missing generic type mutators.
4174 2008-07-18 Marek Safar <marek.safar@gmail.com>
4176 * iterators.cs, statement.cs: Finished statements CloneTo.
4178 2008-07-18 Marek Safar <marek.safar@gmail.com>
4180 * anonymous.cs: ExpressionTreeProxy is of Value type expression.
4182 * expression.cs: Emit optimized default value expressions in expression tree
4185 2008-07-18 Marek Safar <marek.safar@gmail.com>
4187 * ecore.cs, cs-parser.jay, statement.cs: Error reporting fixes.
4189 2008-07-17 Marek Safar <marek.safar@gmail.com>
4191 A fix for bug #367536
4192 * cs-parser.jay: Check static constructor of generic types for an access
4195 2008-07-17 Marek Safar <marek.safar@gmail.com>
4197 A fix for bug #353800
4198 * lambda.cs: Emit ret for contextual statements.
4200 * codegen.cs: Keep both resolved and unreachable flags, otherwise we end
4201 up emitting redundant ret for all anonymous methods with return.
4203 2008-07-17 Marek Safar <marek.safar@gmail.com>
4205 A fix for bug #365188
4206 * ecore.cs, anonymous.cs, expression.cs, codegen.cs, statement.cs: Don't
4207 create anonymous method storey in unreachable block.
4209 2008-07-17 Marek Safar <marek.safar@gmail.com>
4211 * generic.cs, typemanager.cs, cs-tokenizer.cs, parameter.cs, namespace.cs,
4212 class.cs, delegate.cs, flowanalysis.cs, iterators.cs, anonymous.cs,
4213 driver.cs, nullable.cs, expression.cs, attribute.cs, codegen.cs,
4214 statement.cs: Fixed relevant defects found by Gendarme.
4216 2008-07-17 Marek Safar <marek.safar@gmail.com>
4218 A fix for bug #325291
4219 * modifiers.cs, class.cs, cs-parser.jay, anonymous.cs, codegen.cs,
4220 statement.cs: Replaced IAnonymousHost with top level block flag.
4222 2008-07-17 Marek Safar <marek.safar@gmail.com>
4224 * cs-parser.jay: Clean up unused open_parens.
4226 2008-07-17 Marek Safar <marek.safar@gmail.com>
4228 * ecore.cs: Custom error message for a range variable assignment.
4230 2008-07-16 Marek Safar <marek.safar@gmail.com>
4232 * constant.cs, typemanager.cs: Emit empty string ("") as string.Empty field
4235 2008-07-16 Marek Safar <marek.safar@gmail.com>
4237 * literal.cs: Null literal is of object type.
4239 2008-07-16 Marek Safar <marek.safar@gmail.com>
4241 * nullable.cs (LiftedBinaryOperator): Always lift unwrapped nullable
4242 expression of nullable equality comparison.
4244 2008-07-15 Marek Safar <marek.safar@gmail.com>
4246 * expression.cs(PointerArithmetic): Removed redundant assignment.
4248 2008-07-15 Marek Safar <marek.safar@gmail.com>
4250 * decl.cs (GetSignatureForError): Report full namespace name for containers.
4252 2008-07-14 Marek Safar <marek.safar@gmail.com>
4254 A fix for bug #408361
4255 * anonymous.cs (MutateGenericMethod): Store generic type arguments before
4256 they are replaced by GetMethod.
4258 2008-07-14 Marek Safar <marek.safar@gmail.com>
4260 A fix for bug #408721 by jeremie.laval@gmail.com
4261 * expression.cs (Indirection): Implemented CloneTo.
4263 2008-07-14 Marek Safar <marek.safar@gmail.com>
4265 * statement.cs (AssignableSlots): Temporary disabled variable initialization
4268 2008-07-14 Marek Safar <marek.safar@gmail.com>
4270 * report.cs (EnableReporting): Don't reinitialize 0-based values.
4272 2008-07-11 Marek Safar <marek.safar@gmail.com>
4274 * linq.cs: Reset tranparent parameter counter in probing mode.
4276 2008-07-11 Marek Safar <marek.safar@gmail.com>
4278 * anonymous.cs: Mutate anonymous method type.
4280 2008-07-11 Marek Safar <marek.safar@gmail.com>
4282 * ecore.cs, anonymous.cs: Mutate field expressions.
4284 2008-07-10 Marek Safar <marek.safar@gmail.com>
4286 A fix for bug #369670
4287 * linq.cs, statement.cs: Use explicit block for query expressions variables.
4289 2008-07-10 Marek Safar <marek.safar@gmail.com>
4291 * report.cs, ecore.cs: Flush recorder only when silent mode is off.
4293 2008-07-10 Raja R Harinath <harinath@hurrynot.org>
4296 * cs-tokenizer.cs (is_punct): If a generic lookahead is looking
4297 only one '>', and finds a '>>', abort the generic lookahead.
4299 2008-07-10 Marek Safar <marek.safar@gmail.com>
4301 A fix for bug #319902
4302 * cs-tokenizer.cs: Always look-ahed for `>=' when tokenizing `>'.
4304 2008-07-10 Marek Safar <marek.safar@gmail.com>
4306 A fix for bug #406371
4307 * statement.cs: Moved EmitSymbolInfo to Block.
4309 2008-07-09 Marek Safar <marek.safar@gmail.com>
4311 * ecore.cs: Report better error for extension method overload failures.
4313 2008-07-09 Marek Safar <marek.safar@gmail.com>
4315 * expression.cs (Is): No need to box reference values.
4317 2008-07-09 Marek Safar <marek.safar@gmail.com>
4319 * class.cs: Use event resolve context when initializing CreateEmitContext.
4321 2008-07-09 Marek Safar <marek.safar@gmail.com>
4323 A fix for bug #394436
4324 * anonymous.cs, class.cs, expression.cs, lambda.cs: Emit correctly extension
4325 method used inside expression trees. Added more LINQ to expression tree
4328 2008-07-08 Marek Safar <marek.safar@gmail.com>
4330 A fix for bug #378189, #370577
4331 * lambda.cs, ecore.cs: Implemented 3.0 enhancement to better conversion
4334 2008-07-08 Marek Safar <marek.safar@gmail.com>
4336 * anonymous.cs, class.cs, decl.cs: Emit CompilerGenerated attribute
4339 2008-07-08 Marek Safar <marek.safar@gmail.com>
4341 A fix for bug #406702
4342 * anonymous.cs: Always park anonymous method in the nearest parent storey.
4344 2008-07-07 Marek Safar <marek.safar@gmail.com>
4346 A fix for bug #406648
4347 * cs-parser.jay: Report nullable use in mcs for some cases.
4349 2008-07-07 Marek Safar <marek.safar@gmail.com>
4351 * ecore.cs: Improved argument mismatch error messages.
4353 2008-07-07 Marek Safar <marek.safar@gmail.com>
4355 * anonymous.cs: Don't cache generic delegates when reference MVAR argument.
4357 2008-07-07 Marek Safar <marek.safar@gmail.com>
4359 * expression.cs (TypeOf): Mutate type argument.
4361 2008-07-04 Marek Safar <marek.safar@gmail.com>
4363 * class.cs: Report missing partial modifier for correct type.
4365 2008-07-04 Marek Safar <marek.safar@gmail.com>
4367 * ecore.cs, expression.cs (VariableReference): Variable property is
4370 2008-07-04 Marek Safar <marek.safar@gmail.com>
4372 * ecore.cs, convert.cs: Made OpcodeCast more memory efficient.
4374 2008-07-04 Marek Safar <marek.safar@gmail.com>
4376 * anonymous.cs, class.cs, lambda.cs, iterator.cs: Cache static anonymous
4379 2008-07-04 Marek Safar <marek.safar@gmail.com>
4381 * anonymous.cs, class.cs, expression.cs, iterator.cs, statement.cs: Reduce
4382 anonymous method storey to an instance method when only "this" is hoisted.
4384 2008-07-03 Marek Safar <marek.safar@gmail.com>
4386 A fix for bug #321615
4387 * expression.cs: Pointer comparisons use unsigned operator.
4389 2008-07-03 Marek Safar <marek.safar@gmail.com>
4391 * expression.cs: Fixed native pointer conversions. Also fixes #321615.
4393 2008-07-02 Marek Safar <marek.safar@gmail.com>
4395 A fix for bug #404905
4396 * class.cs: Always initialize local unsafe variables.
4398 2008-06-30 Marek Safar <marek.safar@gmail.com>
4400 A fix for bug #396987
4401 * expression.cs (NewInitialize): Clear local temporary variable for next run
4403 2008-06-27 Marek Safar <marek.safar@gmail.com>
4405 A fix for bug #401020
4406 * ecore.cs: Both types and modifiers have to match for ref and out arguments
4408 2008-06-27 Marek Safar <marek.safar@gmail.com>
4410 A fix for bug #398319
4411 * cs-parser.jay: Implemented undocumented base access expression inside
4414 2008-06-26 Marek Safar <marek.safar@gmail.com>
4416 A fix for bug #404227
4417 * cs-parser.jay: Parse namespace declaration using qualified identifier.
4419 2008-06-26 Marek Safar <marek.safar@gmail.com>
4421 A fix for bug #404227
4422 * convert.cs: Fixed explicit array to interface cast.
4424 2008-06-26 Marek Safar <marek.safar@gmail.com>
4426 A fix for bug #403894
4427 * delegate.cs: Mutate DelegateInvocation type.
4429 2008-06-26 Marek Safar <marek.safar@gmail.com>
4431 A fix for bug #379348
4432 * delegate.cs: Box a load of generic parameters.
4434 2008-06-26 Marek Safar <marek.safar@gmail.com>
4436 * expression.cs: Add an array creation arguments mutate.
4438 2008-06-26 Marek Safar <marek.safar@gmail.com>
4440 A fix for bug #386068
4441 * anonymous.cs, expression.cs: Emit correctly hoisted expression tree
4444 2008-06-25 Marek Safar <marek.safar@gmail.com>
4446 * ecore.cs, expression.cs: Fixed broken TypeCast clone, implemented few more
4449 2008-06-25 Marek Safar <marek.safar@gmail.com>
4451 A fix for bug #403518
4452 * delegate.cs: Type correctly anonymous method new invocation.
4454 2008-06-24 Marek Safar <marek.safar@gmail.com>
4456 A fix for bug #394826
4457 * anonymous.cs: Fully qualify members when resolving anonymous type internal
4460 2008-06-24 Marek Safar <marek.safar@gmail.com>
4462 A fix for bug #394826
4463 * anonymous.cs, iterators.cs: Construct generic storey only when is really
4466 2008-06-24 Marek Safar <marek.safar@gmail.com>
4468 * class.cs: Clone indexer parameters for localized capturing.
4470 2008-06-24 Marek Safar <marek.safar@gmail.com>
4472 A fix for bug #402379
4473 * expression.cs: Don't crash when an object initializer resolve fails.
4475 2008-06-24 Marek Safar <marek.safar@gmail.com>
4477 A fix for bug #402888
4478 * expression.cs: Mutate conditional expression.
4480 2008-06-24 Marek Safar <marek.safar@gmail.com>
4482 A fix for bug #401012
4483 * class.cs: Keep StructLayout in shared container.
4485 2008-06-24 Marek Safar <marek.safar@gmail.com>
4487 A fix for bug #400438
4488 * decl.cs, class.cs: Only properties can be automatically implemented.
4490 2008-06-24 Marek Safar <marek.safar@gmail.com>
4492 * statement.cs (ChangeToIterator): Copy also labels.
4494 2008-06-23 Marek Safar <marek.safar@gmail.com>
4496 * ecore.cs: Pass type argument details to parent extension method.
4498 2008-06-23 Marek Safar <marek.safar@gmail.com>
4500 A fix for bug #375966
4501 * delegate.cs: Fixed IsTypeCovariant generic type conversions.
4503 2008-06-23 Raja R Harinath <harinath@hurrynot.org>
4505 * Makefile (bootstrap-libs): Pass NO_DIR_CHECK to sub-make.
4507 2008-06-22 Marek Safar <marek.safar@gmail.com>
4509 A fix for bug #394347
4510 * anonymous.cs: Cache compatible delegates as compatibility check produces
4511 a new method every time.
4513 2008-06-20 Marek Safar <marek.safar@gmail.com>
4515 * anonymous.cs: Propagate storey reference for single references.
4517 2008-06-20 Marek Safar <marek.safar@gmail.com>
4519 A fix for bug #387615
4520 * assign.cs, expression.cs: Correctly clone compound assignment.
4522 2008-06-19 Marek Safar <marek.safar@gmail.com>
4524 A fix for bug #359611, #359604
4525 * anonymous.cs: Mutate all types of hoisted parameters.
4527 2008-06-19 Marek Safar <marek.safar@gmail.com>
4529 * typemanager.cs, lambda.cs, parameter.cs, ecore.cs, linq.cs, class.cs
4530 delegate.cs, iterators.cs, cs-parser.jay, assign.cs, anonymous.cs, driver.cs
4531 expression.cs, codegen.cs, statement.cs
4533 Fixes bugs: #318652, #323223, #234779, #325069, #325476, #332532, #334465,
4534 #345907, #349190, #353276, #355256, #359617, #378542, #384584, #396530
4536 ** Anonymous methods, lambda expressions rewrite **
4538 Anonymous expressions are now resolved when an explicit block is resolved
4539 and they don't require any registration procedure anymore. Further,
4540 anonymous methods are defined when explicit block is emitted which allows
4541 better control of whole process and opens possibilities for more
4542 optimizations as well as alternative to reverse whole process.
4544 A concept of `MutateHoistedGenericType' was introduced to keep the resolve
4545 process consistent and to correctly emit hoisted generic methods when they
4546 have at least 1 hoisted variable.
4548 2008-06-17 Martin Baulig <martin@ximian.com>
4550 * class.cs: Also emit the `[DebuggerHidden]' attribute on the main
4552 (AbstractPropertyEventMethod.IsDebuggerHidden): New protected
4553 virtual property; check it in Emit().
4554 (PropertyMethod.IsDebuggerHidden): Override, check whether we're
4556 (MethodOrOperator.ResolveMethods): Set `DEBUGGER_HIDDEN' if we're
4558 (Indexer.Define): Likewise.
4560 2008-06-17 Marek Safar <marek.safar@gmail.com>
4562 * convert.cs: Don't use IsInterface on type arguments.
4564 * delegate.cs: DelegateInvocation uses MethodInfo.
4566 * parameter.cs: Removed IsTypeParameter.
4568 * generic-mcs.cs: More missing stuff.
4570 2008-06-16 Martin Baulig <martin@ximian.com>
4573 (Modifiers.DEBUGGER_HIDDEN): New public const.
4576 (TypeManager.GetDebuggerHiddenAttribute): New public static method.
4579 (MethodOrOperator.Emit): Check `Modifiers.DEBUGGER_HIDDEN'.
4580 (AbstractPropertyEventMethod): Likewise.
4581 (Constructor.Emit): Likewise.
4582 (SourceMethod.SetCompilerGenerated): Removed.
4584 * iterator.cs: Set `Modifiers.DEBUGGER_HIDDEN' everywhere except
4588 (RootScopeInfo.DoDefineMembers): Set `Modifiers.DEBUGGER_HIDDEN'
4589 if we're an `IteratorHost'.
4590 (AnonymousMethodMethod..ctor): Don't set
4591 `Modifiers.COMPILER_GENERATED'; csc only sets this on the class,
4594 2008-06-16 Marek Safar <marek.safar@gmail.com>
4596 * statement.cs: Clean-up foreach statements.
4598 2008-06-12 Marek Safar <marek.safar@gmail.com>
4600 * class.cs: Stop using public method which should not exist
4601 (MethodBuilder.SetGenericMethodSignature).
4603 2008-06-11 Martin Baulig <martin@ximian.com>
4606 (Location.LookupFile): Add `CompilationUnit' argument; when given
4607 a relative file name, make it relative to the directory the .cs
4608 file is located in instead of using the current directory.
4610 2008-06-11 Martin Baulig <martin@ximian.com>
4613 (IMethodData.EmitExtraSymbolInfo): Added `SourceMethod' argument.
4614 (MethodOrOperator.EmitExtraSymbolInfo): Likewise.
4615 (SourceMethod.SetRealMethodName): Moved here from the symbol writer.
4616 (SourceMethod.SetCompilerGenerated): Likewise.
4618 2008-06-11 Marek Safar <marek.safar@gmail.com>
4620 * codegen.cs, driver: Only write symbol file when it's asked for.
4622 2008-06-11 Marek Safar <marek.safar@gmail.com>
4624 * codegen.cs: Don't use assembly writer error handling for symbol writer.
4626 2008-06-10 Martin Baulig <martin@ximian.com>
4628 * symbolwriter.cs: Reflect latest MarkSequencePoint() API changes.
4630 2008-06-09 Marek Safar <marek.safar@gmail.com>
4632 A fix for bug #316290
4633 * expression.cs: Include decimal operators in predefined table.
4635 * parameters.cs: More readonlyness.
4637 2008-06-09 Marek Safar <marek.safar@gmail.com>
4639 A fix for bug #397213
4640 * cs-parser.jay: One more missing current_local_parameters reset.
4642 2008-06-09 Marek Safar <marek.safar@gmail.com>
4644 A fix for bug #396633
4645 * class.cs: Host backing field in partial container.
4647 2008-06-09 Marek Safar <marek.safar@gmail.com>
4649 A fix for bug #397068
4650 * expression.cs: Check both operand types when predefined operator is used.
4652 2008-06-05 Martin Baulig <martin@ximian.com>
4654 Merged the `debugger-kahalo' branch.
4657 (MethodData.Emit): Call SymbolWriter.SetCompilerGenerated() if
4658 we're an iterator method.
4659 (SourceMethod): Reflect latest symbol writer changes;
4660 SymbolWriter.OpenMethod() now takes a `ICompileUnit' argument and
4661 now `start_row' and `end_row'.
4662 (Constructor.Emit): Fix the logic whether to emit symbol information.
4664 * iterator.cs: Call SymbolWriter.SetCompilerGenerated() on all the
4668 (CompilationUnit): New public class; derives from `SourceFile'.
4669 (SourceFileEntry.DefineSymbolInfo): New public method.
4670 (SourceFileEntry.SetChecksum): New public method.
4671 (Location): Encode hidden line numbers by using `column == 255';
4672 the .ctor now accepts `column == -1' to mark a hidden line number.
4673 (Location.Hidden): New public property.
4674 (Location.CheckPoint): Add `CompilationUnit'.
4675 (Location.SourceFiles): Change return type to `CompilationUnit[]'.
4676 (Location.Push): Add `CompilationUnit compile_unit' argument.
4677 (Location.CompilationUnit): New public property.
4680 (ToplevelBlock.Emit): Add `ec.Mark (EndLocation)'.
4682 * cs-parser.jay: `SourceFile' -> `CompilationUnit'.
4684 * driver.cs: `SourceFile' -> `CompilationUnit'.
4686 * cs-tokenizer.cs: `SourceFile' -> `CompilationUnit'.
4688 * namespace.cs: `SourceFile' -> `CompilationUnit'.
4690 * cs-tokenizer.cs: Add support for `#pragma checksum' and
4694 (SymbolWriter.MarkSequencePoint): Take a `Location' and use the
4695 new symbol writer API to also pass the file.
4697 2008-06-05 Marek Safar <marek.safar@gmail.com>
4699 * statement.cs: Emit catch variable assignment using variable expression.
4701 2008-06-05 Marek Safar <marek.safar@gmail.com>
4703 * ecore.cs, expression.cs, statement.cs: Make TemporaryVariable compatible
4704 with other variable types.
4706 2008-06-04 Marek Safar <marek.safar@gmail.com>
4708 * ecore.cs, expression.cs, statement.cs, typemanager.cs: Removed custom
4709 GetLength method emit, it breaks resolve rules.
4711 2008-06-02 Atsushi Enomoto <atsushi@ximian.com>
4712 Marek Safar <marek.safar@gmail.com>
4714 A fix for bug #395542
4715 * cs-parser.jay: The trailing comma is allowed in anonymous type member
4718 2008-06-02 Marek Safar <marek.safar@gmail.com>
4720 A fix for bug #395287
4721 * class.cs, modifiers.cs: Automatic properties method base modifiers checks.
4723 2008-05-31 Marek Safar <marek.safar@gmail.com>
4725 A fix for bug #395845
4726 * class.cs, nullable.cs: User unary operator is allowed to have nullable and
4727 non-nullable parameter type.
4729 2008-05-31 Marek Safar <marek.safar@gmail.com>
4731 * class.cs: Handle contructor initializer as a statement in top-level block.
4733 2008-05-30 Marek Safar <marek.safar@gmail.com>
4735 * attribute.cs: Don't mix old and new corlib types when emitting corlib
4736 security attributes.
4738 2008-05-24 Marek Safar <marek.safar@gmail.com>
4740 * ecore.cs, expression.cs: Small IVariable refactoring.
4742 2008-05-22 Marek Safar <marek.safar@gmail.com>
4744 * assign.cs (LocalTemporary): Implemented CreateExpressionTree.
4746 2008-05-21 Marek Safar <marek.safar@gmail.com>
4748 * cs-parser.jay: Removed redundant catch type check.
4750 2008-05-21 Marek Safar <marek.safar@gmail.com>
4752 A fix for bug #390372
4753 * nullable.cs: Set correct return type.
4755 2008-05-21 Marek Safar <marek.safar@gmail.com>
4757 A fix for bug #391062
4758 * typemanager.cs: Fixed crash when comparing null types.
4760 2008-05-21 Marek Safar <marek.safar@gmail.com>
4762 A fix for bug #391871
4763 * cs-parser.jay: Better error handling for invalid catch type.
4765 2008-05-20 Marek Safar <marek.safar@gmail.com>
4767 A fix for bug #392155
4768 * cs-tokenizer.cs: Fixed casting of byte and decimal expression.
4770 2008-05-15 Marek Safar <marek.safar@gmail.com>
4772 A fix for bug #390666
4773 * ecore.cs (BetterExpressionConversion): Unwrap each Expression<T>
4776 2008-05-15 Marek Safar <marek.safar@gmail.com>
4778 * class.cs, expression.cs, statement.cs: Removed a hack, setting block flag
4781 2008-05-13 Marek Safar <marek.safar@gmail.com>
4783 A fix for bug #389625
4784 * delegate.cs, generic.cs: Some progress on method group return type
4787 2008-05-13 Marek Safar <marek.safar@gmail.com>
4789 A fix for bug #378419
4790 * namespace.cs: Inspect also parent namespaces not only namespace entries.
4792 2008-05-12 Marek Safar <marek.safar@gmail.com>
4794 * class.cs (Constructor): Added IsCompilerGenerated.
4796 2008-05-12 Marek Safar <marek.safar@gmail.com>
4798 * expression.cs: Enum binary operators can accept non-enum operand only when
4799 is implicitly convertible to underlying type.
4801 2008-05-12 Marek Safar <marek.safar@gmail.com>
4803 A fix for bug #389272
4804 * support.cs: Workaround System.InvalidOperationException for enums.
4806 2008-05-12 Marek Safar <marek.safar@gmail.com>
4808 A fix for bug #389073
4809 * convert.cs: More undocumented explicit IntPtr/UIntPtr conversions.
4811 2008-05-10 Marek Safar <marek.safar@gmail.com>
4813 * driver.cs: Split Parse.
4815 * location.cs (LookupFile): Uses string.Empty.
4817 2008-05-07 Marek Safar <marek.safar@gmail.com>
4819 * expression.cs, parameter.cs: Small ParameterReference clean up.
4821 2008-05-07 Marek Safar <marek.safar@gmail.com>
4823 * anonymous.cs, codegen.cs, convert.cs, ecore.cs: Removed uber ugly TempEc
4824 hack. Fixes #387502.
4826 2008-05-06 Martin Baulig <martin@ximian.com>
4828 * class.cs (Constructor.Emit): Fix the logic whether to emit
4831 2008-05-06 Raja R Harinath <harinath@hurrynot.org>
4834 * iterators.cs (Iterator.CurrentBlock.DoEmit): Don't emit
4835 InvalidOperationException when the iterator is before the start or
4838 2008-05-06 Marek Safar <marek.safar@gmail.com>
4840 * nullable.cs (NullCoalescingOperator): Result is underlying type of left,
4841 when left is nullable type.
4843 2008-05-06 Marek Safar <marek.safar@gmail.com>
4845 A fix for bug #386628
4846 * expression.cs (LocalVariableReference): Continue in resolving when
4847 variable is not assigned.
4849 2008-05-05 Marek Safar <marek.safar@gmail.com>
4851 * nullable.cs, statement.cs (Unwrap): Store non-variable expression in all
4852 nullable operations.
4854 2008-05-04 Marek Safar <marek.safar@gmail.com>
4856 * nullable.cs, statement.cs (Unwrap): Don't duplicate variable expressions,
4857 it saves many redundant temporary variables for nullable operations.
4859 2008-05-03 Marek Safar <marek.safar@gmail.com>
4861 * assign.cs: EventAddOrRemove is a statement and cannot have a type.
4863 * cfold.cs, constant.cs, expression.cs: Share Error_OperatorCannotBeApplied
4866 * nullable.cs: Constant coalescing operator optimizations.
4868 2008-05-03 Marek Safar <marek.safar@gmail.com>
4870 * constant.cs: Use unsigned conversion for values which are unsigned only.
4872 2008-05-03 Marek Safar <marek.safar@gmail.com>
4874 * convert.cs, literal.cs, nullabel.cs, typemanager.cs: Implemeted null
4875 coalescing operator as it should be.
4877 2008-05-02 Marek Safar <marek.safar@gmail.com>
4879 A fix for bug #371016
4880 * expression.cs: All predefined delegate operators require implicit method
4883 2008-05-02 Marek Safar <marek.safar@gmail.com>
4885 * constant.cs: Emit long constant as uint when fits the range.
4887 * convert.cs, expression.cs: Fixed few unsafe conversions.
4889 2008-05-02 Marek Safar <marek.safar@gmail.com>
4891 * convert.cs, literal.cs: Don't wrap implicit reference conversion to object
4893 2008-05-02 Raja R Harinath <harinath@hurrynot.org>
4896 * convert.cs (ImplicitNumericConversion): Don't modify the type of
4898 * ecore.cs (EmptyCast.Create): Flatten nested EmptyCasts.
4900 2008-05-01 Marek Safar <marek.safar@gmail.com>
4902 * constant.cs, literal.cs: IsLiteral property for error reporting.
4904 * ecore.cs, expression.cs: Implemented Property expression.
4906 2008-05-01 Marek Safar <marek.safar@gmail.com>
4908 * class.cs, modifiers.cs, flowanalysis.cs: New BACKING_FIELD flag.
4910 * nullable.cs: Implemented nullable coalescing null operator.
4912 * ecore.cs, expression.cs: Expression trees work.
4914 2008-05-01 Marek Safar <marek.safar@gmail.com>
4916 * ecore.cs: CreateExpressionTree is finally abstract.
4918 * expression.cs, linq.cs: Updated.
4920 2008-05-01 Marek Safar <marek.safar@gmail.com>
4922 * expression.cs, ecore.cs: Block base access expression inside expression
4925 2008-05-01 Marek Safar <marek.safar@gmail.com>
4927 A fix for bug #385058
4928 * expression.cs: User-defined operator implementations always take
4929 precedence over predefined operator implementations.
4931 2008-04-30 Marek Safar <marek.safar@gmail.com>
4933 * assign.cs, anonymous.cs, lambda.cs, nullable.cs, ecore.cs, linq.cs,
4934 class.cs, iterators.cs, expression.cs, attribute.cs: Filled a few more
4935 expression tree conversions.
4937 2008-04-30 Marek Safar <marek.safar@gmail.com>
4939 * typemanager.cs, ecore.cs, class.cs, expression.cs, doc.cs: Merged all
4940 operators method details to Operator class.
4942 2008-04-30 Marek Safar <marek.safar@gmail.com>
4944 * anonymous.cs: Pass unsafe flags to anonymous container.
4946 * ecore.cs, expression.cs, statement.cs: Block unsafe pointer operations
4947 inside expression tree.
4949 2008-04-29 Martin Baulig <martin@ximian.com>
4951 * cs-tokenizer.cs (Tokenizer.Position): Added `line'.
4952 (Tokenizer.PopPosition): Also restore the `line'.
4954 2008-04-29 Marek Safar <marek.safar@gmail.com>
4956 * delegate.cs: Implemented Invoke expression.
4958 2008-04-29 Marek Safar <marek.safar@gmail.com>
4960 * expression.cs: Fixed equality reference comparison regression.
4962 2008-04-29 Marek Safar <marek.safar@gmail.com>
4964 * ecore.cs: Clean up EmptyCast hack.
4966 * expression.cs, nullable.cs: Implemented enum binary and unary operations
4967 using correct conversion rules. Also fixes #383993.
4969 2008-04-28 Martin Baulig <martin@ximian.com>
4971 * class.cs (Constructor.Emit): Don't emit debugging information
4972 for generated default .ctor's.
4974 2008-04-28 Marek Safar <marek.safar@gmail.com>
4976 * convert.cs: Empty-cast ushort to int conversion.
4978 2008-04-28 Marek Safar <marek.safar@gmail.com>
4980 A fix for bug #384191
4981 * ecore.cs, expression.cs: Fixed expression cloning.
4983 2008-04-28 Marek Safar <marek.safar@gmail.com>
4985 * ecore.cs, delegate.cs, assign.cs: Few tweaks for recent changes.
4987 2008-04-28 Raja R Harinath <harinath@hurrynot.org>
4989 Fix #381559, test-638.cs, test-639.cs
4990 * assign.cs (CompoundAssign.Helper): New wrapper.
4991 (CompoundAssign.DoResolve): Use it to wrap the nested 'target'
4993 * ecore.cs (MethodGroupExpr.VerifyArgumentsCompat) <params arguments>:
4994 Pass unconverted expressions to the params array creation expression.
4995 (FieldExpr.EmitAssign): Don't special-case StringConcat.
4996 (PropertyExpr.EmitAssign): Likewise.
4997 * expression.cs (ArrayCreation.ResolveArrayElement): Keep track of the
4998 element if it is of kind CompoundAssign.Helper.
4999 (ArrayCreation.Emit): If we saw a CompoundAssign.Helper, emit it
5000 first before anything else.
5001 (ArrayAccess.EmitAssign): Don't special-case StringConcat.
5002 (ArrayAccess.LoadArrayAndArguments): Simplify.
5004 2008-04-27 Marek Safar <marek.safar@gmail.com>
5006 * expression.cs: Fixed cloning of typeof(void).
5008 2008-04-27 Raja R Harinath <harinath@hurrynot.org>
5010 * assign.cs (Assign.DoResolve): Remove support for EventExprs.
5011 (Assign.Emit): Likewise. Move it to ...
5012 (CompoundAssign.DoResolve): ... here and ...
5013 (CompoundAssign.Emit): ... here.
5014 (EventAddOrRemove): New helper to handle += and -= on events, and
5015 avoid the use of BinaryDelegates.
5016 * ecore.cs (EventExpr.DoResolveLValue): Emit CS0070 unconditionally.
5017 (EventExpr.EmitAddOrRemove): Improve.
5018 * delegate.cs (DelegateInvocation.DoResolve): Simplify slightly.
5020 * cs-parser.jay (type) <namespace_or_type_name variant>: Don't
5021 create VarExprs for 'foo.bar.var'.
5022 * ecore.cs (VarExpr.InferType): Rename from DoResolveLValue, which
5023 is a highly inappropriate name for its functionality.
5025 2008-04-26 Raja R Harinath <harinath@hurrynot.org>
5027 Simplify handling of multiple assignments
5028 * assign.cs (Assign): Clear out all 'embedded assign' gunk. Make
5030 (SimpleAssign): New. Class to be used for normal assignments.
5031 * anonymous.cs, class.cs, cs-parser.jay: Update to changes.
5032 * expression.cs, parameter.cs, statement.cs: Likewise.
5034 2008-04-25 Marek Safar <marek.safar@gmail.com>
5036 * ecore.cs, expression.cs, nullable.cs: Implemeted enum binary add operation
5037 for incompatible underlying types, more to come, uff.
5039 2008-04-26 Raja R Harinath <harinath@hurrynot.org>
5042 * expression.cs (VariableReference.EmitAssign) <source is NewInstance>:
5043 Handle 'leave_copy'.
5045 2008-04-25 Marek Safar <marek.safar@gmail.com>
5047 * expression.cs, nullable.cs: Implemented UnaryPlus expression.
5049 2008-04-24 Raja R Harinath <harinath@hurrynot.org>
5051 Fix test-636.cs. Sprinkle a few more 'EmitSideEffect's around
5052 * expression.cs (Unary.TryReduceConstant): Unwrap SideEffectConstant.
5053 * statement.cs (While, Do, For): Allow test to have side effects.
5054 (For.DoEmit): Always emit InitStatement.
5057 * expression.cs (Binary.DoResolve) <BitwiseAnd with zero constant>:
5058 Always create SideEffectConstant.
5059 (Binary.EnumLiftUp): Don't assume that the enumeration constant is
5060 of type EnumConstant.
5062 * expression.cs (Binary.EmitBranchable) <Equality with constant>:
5063 Handle 'right' being SideEffectConstant of type 'bool'.
5065 * expression.cs (Binary.EmitBranchable) <Equality with constant>:
5066 Use left.EmitBranchable instead of open coding it, so as to
5067 improve optimization opportunities.
5069 * constant.cs (SideEffectConstant.EmitSideEffect): Simplify slightly.
5071 * ecore.cs (Expression.EmitBranchable): Document some non-obvious
5073 (Expression.EmitSideEffect): Document.
5075 2008-04-23 Marek Safar <marek.safar@gmail.com>
5077 * expression.cs: Implemented NewArrayBounds, TypeIs, and TypeAs expressions.
5079 2008-04-23 Marek Safar <marek.safar@gmail.com>
5081 * constant.cs, statement.cs: Use EmitSideEffect for constant if statement.
5083 2008-04-23 Marek Safar <marek.safar@gmail.com>
5085 * ecore.cs, expression.cs, delegate.cs: Implemeted delegate instantiation
5086 conversion to expression tree.
5088 2008-04-23 Marek Safar <marek.safar@gmail.com>
5090 * ecore.cs: Removed unused expression.
5092 2008-04-22 Marek Safar <marek.safar@gmail.com>
5094 * expression.cs: Implemented NegateChecked and New expressions.
5096 2008-04-22 Marek Safar <marek.safar@gmail.com>
5098 * convert.cs, nullable.cs, expression.cs: Implemented Negate expression.
5100 2008-04-22 Raja R Harinath <harinath@hurrynot.org>
5103 * anonymous.cs (AnonymousMethodExpression.DoResolve): Mark as
5104 needing final 'ret' instruction.
5106 2008-04-22 Marek Safar <marek.safar@gmail.com>
5108 * expression.cs: Disabled lifted binary conversion on ISO-1 profiles.
5110 2008-04-21 Marek Safar <marek.safar@gmail.com>
5112 * expression.cs: Emit ldnull and not null expression as an instance argument
5113 of static method expression calls.
5115 2008-04-21 Marek Safar <marek.safar@gmail.com>
5117 A fix for bug #378200
5118 * expression.cs: Fixed crash when creating parameterless expression tree
5121 2008-04-21 Marek Safar <marek.safar@gmail.com>
5123 A fix for bug #375297
5124 * anonymous.cs: Fixed crash when inferring from null argument anonymous
5127 2008-04-21 Marek Safar <marek.safar@gmail.com>
5129 A fix for bug #377596
5130 * decl.cs, class.cs: Emit delegate type argument attributes.
5132 2008-04-21 Marek Safar <marek.safar@gmail.com>
5134 A fix for bug #365314
5135 * generic.cs, ecore.cs: Type parameter declaration cannot be of generic type
5137 2008-04-21 Marek Safar <marek.safar@gmail.com>
5139 * cs-parser.jay, expression.cs: ComposedCast can work with type expressions
5142 2008-04-21 Marek Safar <marek.safar@gmail.com>
5144 * generic.cs (TypeParameter): Removed redundant location.
5146 2008-04-19 Marek Safar <marek.safar@gmail.com>
5148 * generic.cs, parameter.cs, namespace.cs, ecore.cs, class.cs, decl.cs,
5149 delegate.cs, iterators.cs, cs-parser.jay, const.cs, enum.cs: Use
5150 FullNamedExpression in all declaration type expression, statements will come
5153 2008-04-18 Marek Safar <marek.safar@gmail.com>
5155 * generic.cs, namespace.cs, ecore.cs, class.cs, decl.cs, generic-mcs.cs,
5156 nullable.cs, expression.cs, enum.cs, doc.cs: Cleaning up type expressions.
5158 2008-04-18 Marek Safar <marek.safar@gmail.com>
5160 * parameter.cs, delegate.cs, cs-parser.jay, expression.cs: Removed unused
5163 2008-04-17 Marek Safar <marek.safar@gmail.com>
5165 * decl.cs, class.cs, generic.cs: Verify partial parts type parameters and
5168 2008-04-17 Marek Safar <marek.safar@gmail.com>
5170 * decl.cs, class.cs, cs-parser.jay, ecore.cs, expression.cs: Unify all type
5174 2008-04-17 Raja R Harinath <harinath@hurrynot.org>
5176 Hook up 'EmitSideEffect'
5177 * constant.cs (Constant.EmitSideEffect): New.
5178 (SideEffectConstant.Emit): Simplify. Use EmitSideEffect.
5179 (SideEffectConstant.EmitSideEffect): New.
5180 * ecore.cs (BoxedCast.EmitBranchable): Remove. We can't use an
5181 unconditional branch in EmitBranchable.
5182 (FieldExpr.EmitBranchable): New.
5183 * expression.cs (Unary.EmitSideEffect): New.
5184 (Binary.EmitSideEffect): New.
5185 (VariableReference.EmitSideEffect): New. Do nothing.
5187 2008-04-16 Raja R Harinath <harinath@hurrynot.org>
5189 Introduce 'EmitSideEffect'
5190 * ecore.cs (Expression.EmitSideEffect): New.
5191 (TypeCast): Rename from EmptyCast.
5193 (EmptyCast.EmitBranchable, EmptyCast.EmitSideEffect): Implement.
5194 (BoxedCast.EmitBranchable, BoxedCast.EmitSideEffect): Implement.
5195 * convert.cs, nullable.cs: Update to changes.
5197 2008-04-16 Marek Safar <marek.safar@gmail.com>
5199 * class.cs, cs-parser.jay: Early check for base types expression.
5201 2008-04-16 Marek Safar <marek.safar@gmail.com>
5203 * decl.cs (MemberName): Declare PrettyName as obsolete.
5205 2008-04-16 Marek Safar <marek.safar@gmail.com>
5207 * namespace.cs: Use MemberName comparison.
5209 2008-04-16 Raja R Harinath <harinath@hurrynot.org>
5212 * decl.cs (MemberName.PrettyName): New. Replaces the misnamed
5214 (MemberName.MethodName, MemberName.GetSignatureForError): Improve.
5215 (MemberName.FullyQualifiedName): New. Provides the functionality
5216 that users assume FullName would have.
5217 * ecore.cs, namespace.cs: Update to changes.
5219 * statement.cs (Using.assign): Make into ExpressionStatement.
5220 (Using.EmitPreTryBody): Simplify.
5222 2008-04-16 Marek Safar <marek.safar@gmail.com>
5224 * report.cs: ColorFormat is protected.
5226 * rootcontext.cs: Unused fields clean-up.
5228 * namespace.cs: Made UsingEntry name private.
5230 2008-04-16 Marek Safar <marek.safar@gmail.com>
5232 * cs-tokenizer.cs, location.cs: Removed unused field.
5234 2008-04-16 Jan Oravec <jan.oravec@6com.sk>
5235 Raja R Harinath <harinath@hurrynot.org>
5238 * constant.cs (SideEffectConstant.value): Rename from 'left'.
5239 (SideEffectConstant.side_effect): Rename from 'right'.
5240 (SideEffectConstant..ctor): Normalize 'side_effect'.
5241 (SideEffectConstant.Emit): Emit 'value', not 'side_effect' as the
5242 value of this constant.
5243 * cfold.cs: Update to changes.
5245 2008-04-15 Marek Safar <marek.safar@gmail.com>
5247 * cs-paser.jay: Removed unused variable.
5249 * driver.cs: Made Compile instance method.
5251 2008-04-15 Raja R Harinath <harinath@hurrynot.org>
5253 * flowanalysis.cs (FlowBranching.MergeChild): Simplify.
5255 2008-04-15 Marek Safar <marek.safar@gmail.com>
5257 * cs-paser.jay, namespace.cs: Simplified handling of namespace imports.
5259 2008-04-13 Jb Evain <jbevain@novell.com>
5261 * namespace.cs: update the System.Core fullname for 2.1
5262 * driver.cs: update the list of required assemblies for 2.1.
5263 Merged from the Moonlight 2 branch.
5265 2008-04-11 Marek Safar <marek.safar@gmail.com>
5267 * assign.cs, ecore.cs, expression.cs, nullable.cs: More work on nullable
5268 types and user defined operators. User operators arguments has to be checked
5269 for null value before invocation, which also means no operator is called
5270 when any argument is not convertible to unwrapped nullable type.
5272 2008-04-09 Marek Safar <marek.safar@gmail.com>
5274 * convert.cs, ecore.cs, expression.cs, nullable.cs: Initial refactoring
5275 of Unary expressions to follow operator overloading rules precisely.
5276 Also fixes #321794, #323794
5278 2008-04-08 Marek Safar <marek.safar@gmail.com>
5280 * cs-parser.jay, expression.cs: Don't wrap Indirection expression in Unary
5283 2008-04-08 Marek Safar <marek.safar@gmail.com>
5285 * expression.cs, ecore.cs: Implemented MemberInit expression.
5287 2008-04-08 Raja R Harinath <harinath@hurrynot.org>
5289 Fix mono/tests/exception4.cs
5290 * statement.cs (ExceptionStatement, TryCatch): Revert to using
5291 ec.NeedReturnLabel () rather emitting a 'nop'.
5293 * statement.cs (ExceptionStatement.SomeCodeFollows): A hook for a
5295 (TryCatch.SomeCodeFollows): Likewise.
5296 * flowanalysis.cs (FlowBranchingException): Call 'SomeCodeFollows'
5297 for 'break', 'continue' and 'return' statements inside a try.
5298 We're fairly sure that the generated IL stream will have more
5299 instructions textually following the try.
5300 (FlowBranchingTryCatch): Likewise.
5302 * statement.cs (Throw.Resolve): Move CS0156 and CS0724 testing ...
5303 * flowanalysis.cs (FlowBranching.CheckRethrow): ... here and to its
5306 * statement.cs (CollectionForeach.DisposableWrapper): Make a true
5307 wrapper -- forward everything to CollectionForeach.
5308 (CollectionForeach.NonDisposableWrapper): New.
5309 (CollectionForeach.EmitFinallyBody): Use 'endfinally' instruction
5310 instead of a pop + branch to end.
5312 2008-04-07 Marek Safar <marek.safar@gmail.com>
5314 A fix for bug #377485
5315 * assign.cs, expression.cs, decl.cs, class.cs, ecore.cs, namespace.cs:
5316 Propagate location for extension method groups. Report conversion failure at
5319 2008-04-07 Marek Safar <marek.safar@gmail.com>
5321 * anonymous.cs, expression.cs, ecore.cs, typemanager.cs: Implemented
5322 ListInit and Field expressions.
5324 2008-04-06 Raja R Harinath <harinath@hurrynot.org>
5326 * iterators.cs (Iterator.EmitMoveNext): Remove try/fault wrapper.
5327 Since $PC is always -1 inside the body of MoveNext, the fault
5329 * flowanalysis.cs (FlowBranchingException.EmitFinally): Kill.
5330 * statement.cs (ExceptionStatement.emit_finally): Likewise.
5331 (ExceptionStatement.ResolveFinally): Drop 'branching' argument.
5333 The denouement! Fix #324708
5334 * iterators.cs (Iterator.EmitMoveNext): Reset $PC to -1 on entry.
5335 (Iterator.EmitYieldBreak): We no longer need to reset $PC.
5336 * statement.cs (ExceptionStatement.DoEmit): Actually emit the
5337 'finally' inside the finally clause.
5339 * statement.cs (ExceptionStatement.DoEmit): Emit try/finally block
5340 inside an iterator. Don't emit the body of the 'finally' inside
5341 the finally clause yet.
5343 Use the ResumableStatement infrastructure for MoveNext ()
5344 * iterators.cs (Iterator.EmitMoveNext_NoResumePoints): New.
5345 (Iterator.EmitMoveNext): Use 'resume_points'. Get rid of
5346 'old_resume_points'. Move dispatcher upfront.
5347 (Iterator.MarkYield): Mark the 'resume_point' of a Yield.
5348 * statement.cs (ExceptionStatement.DoEmit): Emit a dispatcher if
5349 in an enumerator. This encodes the main fix in this patch series
5350 -- we can only jump into the first instruction of a try from the
5351 outside, but we want to emit try/finally regions in iterators and
5352 resume in the middle of them.
5354 2008-04-05 Raja R Harinath <harinath@hurrynot.org>
5356 * statement.cs (ExceptionStatement.ResolveFinally): Move setting
5357 of NeedReturnLabel here.
5359 Introduce a common point for emitting try/finally to IL
5360 * statement.cs (ExceptionStatement.DoEmit): New. Combines all the
5361 features of the various subclasses, which are now driven by ...
5362 (ExceptionStatement.EmitPreTryBody): ... this and ...
5363 (ExceptionStatement.EmitTryBody): ... this and the original
5365 (TryFinally, Lock, Using, UsingTemporary, DisposableWrapper):
5366 Remove DoEmit and update to follow above protocol.
5368 * statement.cs (ExceptionStatement.EmitForDispose): If all labels
5369 of the dispatcher are the same, skip emitting the 'switch'.
5370 * iterator.cs (Iterator.EmitDispose): Update to changes.
5372 Clean up handling of 'using' statement
5373 * statement.cs (UsingTemporary): New. Carved out of ...
5374 (Using): ... this. Simplify drastically. Handle exactly
5376 * cs-parser.jay (using_statement): Split. Create UsingTemporary
5377 or Using as appropriate. If there are multiple variable declared,
5378 create nested Using statements.
5379 (resource_acquisition): Kill.
5381 * statement.cs (ExceptionStatement.EmitForDispose): Use
5382 EmitFinallyBody, not EmitFinally.
5384 * flowanalysis.cs (FlowBranching.StealFinallyClauses): Remove.
5385 * iterator.cs: Update to changes.
5387 Start using the ResumableStatement infrastructure
5388 * statement.cs (ResumeableStatement.PrepareForDispose): New.
5389 (ResumableStatement.EmitForDispose): New.
5390 (ExceptionStatement): Override them.
5391 * iterators.cs (Iterator.EmitDispose): Use PrepareForDispose and
5392 EmitForDispose to create the body of the Dispose method. Don't
5395 * iterator.cs (Iterator.AddResumePoint): Move here from ...
5396 * statement.cs (Toplevel.AddResumePoint): ... here.
5397 (Toplevel.MoveNextStatement.Resolve): Create FlowBranchingIterator.
5398 * flowanalysis.cs (FlowBranchingIterator): New.
5399 * codegen.cs (EmitContext): Update to changes.
5401 * iterators.cs (Iterator.OldResumePoint): Rename from ResumePoint.
5402 (Iterator.old_resume_points): Rename from 'resume_points'.
5403 (Iterator.MoveNextStatement): Remove unused class.
5405 New infrastructure for try/finally in iterators (still unused)
5406 * flowanalysis.cs (FlowBranching.AddResumePoint): New.
5407 (FlowBranchingToplevel.AddResumePoint): Hook into
5408 ToplevelBlock.AddResumePoint.
5409 (FlowBranchingTryCatch): Move CS01626 and CS01631 checks here.
5410 (FlowBranchingException): Hook into ExceptionBlock.AddResumePoint.
5411 * statement.cs (ToplevelBlock.AddResumePoint): New. Collect
5412 resume points and assign program-counter values.
5413 (ExceptionBlock.AddResumePoint): Collect resume points for
5414 de-muxer at the top of try block.
5415 * iterators.cs (Yield.CheckContext): Simplify.
5416 (Yield.Resolve): Use FlowBranching.AddResumePoint.
5418 2008-04-04 Raja R Harinath <harinath@hurrynot.org>
5420 * flowanalysis.cs (FlowBranching.AddReturnOrigin): Change Location
5421 argument to an ExitStatement.
5422 (FlowBranchingException): Refactor saved origins code.
5423 * statement.cs (ExitStatement): Update to cahges.
5424 * iterator.cs (YieldBreak): Likewise.
5426 * statement.cs (ResumableStatement): New. Common base class for
5427 YieldReturn and ExceptionStatement.
5428 (ExitStatement): New. Common base class for Return and YieldBreak.
5429 (Return): Update to changes.
5430 * iterator.cs (YieldBreak): Likewise.
5431 * lambda.cs (ContextualReturn): Likewise.
5434 * ecore.cs (Expression.ResolveAsTypeStep): If '!silent' attempt to
5435 emit a meaningful error message.
5437 Fix #324765, #319508
5438 * flowanalysis.cs (VariableInfo.IsEverAssigned): New.
5439 (VariableInfo.SetAssigned): Set it.
5440 * statement.cs (Block.UsageWarning): Use 'IsEverAssigned' to
5441 determine if CS0219 or CS0168 is appropriate. Don't use
5442 flow-analysis information.
5443 (Block.Resolve): Use ec.EndFlowBranching, not ec.DoEndFlowBranching.
5444 * codegen.cs (EmitContext.DoEndFlowBranching): Kill. Inline into ...
5445 (EmitContext.EndFlowBranching): ... this.
5447 2008-04-03 Marek Safar <marek.safar@gmail.com>
5449 * class.cs, typemanager.cs: Emit volatile field with IsVolatile modifier.
5451 2008-04-03 Marek Safar <marek.safar@gmail.com>
5453 A fix for bug #376508
5454 * convert.cs, expression.cs: Fixed difference between ImplicitConversion and
5455 ImplicitConversionExists.
5457 2008-04-03 Marek Safar <marek.safar@gmail.com>
5459 * expression.cs (Binary): Added remaining binary operators to expression
5462 * nullable.cs: Optimize shift with null argument.
5464 2008-04-03 Raja R Harinath <harinath@hurrynot.org>
5466 Fix minor IL regression
5467 * statement.cs (TryCatch..ctor): Add 'inside_try_finally' argument.
5468 (TryCatch.DoEmit): Use it to avoid creating another ExceptionBlock.
5469 * cs-parser.jay (try_statement): Update to changes.
5471 * statement.cs (TryFinally.need_exc_block): Delete.
5472 (TryFinally): Update to changes.
5474 Now all ExceptionStatements are unconditional
5475 * statement.cs (CollectionForeach.DisposableWrapper): New.
5476 Extract out the try/finally code into a new wrapper.
5477 (CollectionForeach.Resolve): Use it to simplify the code.
5479 2008-04-02 Raja R Harinath <harinath@hurrynot.org>
5481 Start at simplifying ExceptionStatement semantics a bit
5482 * statement.cs (TryCatch, TryFinally): Split 'Try' into two pieces.
5483 * cs-parser.jay (try_statement): Update to changes.
5484 (opt_catch_clauses): Remove.
5485 * flowanalysis.cs: Update to changes.
5486 (FlowBranching.BranchingType.TryCatch): New.
5487 (FlowBranchingTryCatch): New.
5489 * flowanalysis.cs (FlowBranching.BranchingType.SwitchSection): Kill.
5490 (FlowBranching.CreateBranching): Update to changes.
5491 (FlowBranchingBlock.AddSibling): Add sanity check.
5492 * codegen.cs (EmitContext.StartFlowBranching) <Block variant>:
5495 * iterators.cs (Iterator.MarkFinally): Remove.
5496 * statement.cs (ExceptionStatement): Update to changes.
5498 Add support for skipping over finally blocks at runtime. First
5499 in a series to fix #324708
5500 * iterators.cs (Iterator.SkipFinally): New LocalBuilder.
5501 (Iterator.EmitMoveNext): Initialize it.
5502 * statement.cs (ExceptionStatement.EmitFinally): Use it to emit a
5503 branch over the body of the 'finally' clause.
5505 2008-03-31 Raja R Harinath <harinath@hurrynot.org>
5507 Avoid lopsided use of Foo/DoFoo names
5508 * statement.cs (ExpressionStatement.EmitFinallyBody):
5509 Rename from EmitFinally.
5510 (ExpressionStatement.EmitFinally): Rename from DoEmitFinally.
5511 * iterator.cs: Update to changes.
5513 2008-04-02 Marek Safar <marek.safar@gmail.com>
5515 * ecore.cs, expression.cs, nullable.cs: ConditionalLogicalOperator is now
5516 based on UserOperatorCall. More binary nullable operators clean up.
5518 2008-04-02 Martin Baulig <martin@ximian.com>
5520 * symbolwriter.cs: Remove the `#if !DISABLE_TERRANIA_CHANGES' conditionals.
5522 2008-04-02 Marek Safar <marek.safar@gmail.com>
5524 * nullable.cs: Merge user and empty conversions when lifting expression
5527 * expression.cs (StringConcat): Implemented expression tree representation.
5529 2008-04-01 Marek Safar <marek.safar@gmail.com>
5531 * nullable.cs: When lifting null literal and a user operator exists, no call
5534 2008-04-01 Marek Safar <marek.safar@gmail.com>
5536 * nullable.cs, ecore.cs, expression.cs: Convert null arithmetic to lifted
5539 2008-04-01 Marek Safar <marek.safar@gmail.com>
5541 * nullable.cs, expression.cs: Use namespace instead heavily nested
5542 monster abstract class.
5544 2008-04-01 Marek Safar <marek.safar@gmail.com>
5546 * ecore.cs, convert.cs, constant.cs, nullable.cs, expression.cs: Implemented
5547 lifting of null literal and user operators. Clean up of some temporary
5550 2008-03-30 Raja R Harinath <harinath@hurrynot.org>
5552 Fix #368224, test-629.cs
5553 * flowanalysis.cs (FlowBranching.StealFinallyClauses): Return true
5554 if it crossed an unwind-protect boundary.
5555 * iterators.cs (Yield.CheckContext): Relax check for 'yield break'.
5556 (Yield.Resolve, Yield.DoEmit): Track whether the yield occurs
5557 inside an unwind-protected region.
5558 (YieldBreak.Resolve, YieldBreak.DoEmit): Likewise.
5559 (Iterator.MarkYield): Add 'unwind_protect' parameter. Emit a
5560 'leave' instead of a 'br' if unwind-protected.
5561 (Iterator.EmitYieldBreak): Likewise.
5563 2008-03-29 Gert Driesen <drieseng@users.sourceforge.net>
5565 * driver.cs: Only define versioninfo resources if no win32 resource
5568 2008-03-28 Marek Safar <marek.safar@gmail.com>
5570 A fix for bug #372375
5571 * convert.cs: Fixed boxing of nullable types.
5573 2008-03-28 Marek Safar <marek.safar@gmail.com>
5575 * typemanager.cs: Initialize InternalsVisibleTo as the very first optional
5578 2008-03-28 Marek Safar <marek.safar@gmail.com>
5580 A fix for bug #374619
5581 * nullable.cs: Fixed guarding of EmitBitwiseBoolean.
5583 2008-03-27 Marek Safar <marek.safar@gmail.com>
5585 * lambda.cs: Check return type only for invocation.
5587 2008-03-27 Marek Safar <marek.safar@gmail.com>
5589 A fix for bug #374214
5590 * ecore.cs: Correctly report argument type mismatch.
5592 2008-03-27 Marek Safar <marek.safar@gmail.com>
5594 * convert.cs (ImplicitReferenceConversionCore): Correctly compare enum type
5595 and not rely on broken IsEnum.
5597 2008-03-27 Marek Safar <marek.safar@gmail.com>
5599 * nullable.cs: New file, extracted from generic.cs.
5601 * generic.cs, generic-mcs.cs, *.csproj, *.sources: Updated.
5603 2008-03-27 Marek Safar <marek.safar@gmail.com>
5605 * generic.cs, convert.cs, generic-mcs.cs, expression.cs: Added lifting of
5606 predefined comparison operators and null literals.
5608 * report.cs: New warning ID.
5610 2008-03-25 Marek Safar <marek.safar@gmail.com>
5612 A fix for bug #370577
5613 * lambda.cs: Check return type too.
5615 2008-03-25 Marek Safar <marek.safar@gmail.com>
5617 A fix for bug #372846
5618 * class.cs: Automatic properties can be declared as unsafe.
5620 2008-03-20 Marek Safar <marek.safar@gmail.com>
5622 * location.cs: Use string based concatenation.
5624 * expression.cs: LiftedBinaryOperator is gmcs only.
5626 2008-03-20 Marek Safar <marek.safar@gmail.com>
5628 * generic.cs, literal.cs, ecore.cs, expression.cs: Ongoing work on nullable
5629 conversions rules and expression trees.
5631 2008-03-19 Marek Safar <marek.safar@gmail.com>
5633 * delegate.cs: Use extension method source as delegate target.
5635 2008-03-19 Marek Safar <marek.safar@gmail.com>
5637 * generic.cs, generic-mcs.cs, expression.cs, ecore.cs: Rewrote nullable
5638 binary operations to be purely based on binary operations and optimized
5639 emitted code (30% less in some cases). Introduced ReducedExpression for ETs
5640 and other ET refactoring.
5642 * typemanager.cs: Fixed warning.
5644 2008-03-17 Marek Safar <marek.safar@gmail.com>
5646 * class.cs, decl.cs, delegate.cs: Do protected modifier check on each member
5648 * symbolwriter.cs: Fixed.
5650 2008-03-17 Marek Safar <marek.safar@gmail.com>
5652 * anonymous.cs, driver.cs: Reset anonymous types counters.
5654 2008-03-17 Marek Safar <marek.safar@gmail.com>
5656 * ecore.cs (MethodGroupExpr): Skip first candidate, it's already the best.
5658 * class.cs: Use fullname for all type member definitions.
5660 2008-02-19 Martin Baulig <martin@ximian.com>
5663 (IMethodData.EmitExtraSymbolInfo): New interface method.
5664 (MethodData.Emit): Call method.EmitExtraSymbolInfo().
5665 (MethodOrOperator.EmitExtraSymbolInfo): Implement this new
5666 interface method here as an empty public virtual method.
5669 (AnonymousMethodMethod.ctor): Added `string real_name' argument.
5670 (AnonymousMethodMethod.EmitExtraSymbolInfo): Override and call
5671 CodeGen.SymbolWriter.SetRealMethodName().
5673 2008-02-18 Martin Baulig <martin@ximian.com>
5676 (ScopeInfo.EmitType): Override this and emit debugging
5677 information for captured variables.
5678 (RootScopeInfo.EmitType): Override this and emit symbol
5679 information for a captured `this'.
5681 2008-02-15 Martin Baulig <martin@ximian.com>
5683 * iterators.cs: Emit debugging info.
5686 (EmitContext.Flags): Add `OmitDebuggingInfo'.
5687 (EmitContext.OmitDebuggingInfo): New public property.
5690 (While): Override Emit() and don't emit symbol info there; do it
5691 inside DoEmit() instead.
5692 (Block.Emit): Omit symbol information while emitting the scope
5693 initializers; don't ec.Mark() the `EndLocation'. Fix the lexical
5695 (ExplicitBlock.IsIterator): Moved here from `ToplevelBlock'.
5696 (ToplevelBlock.MakeIterator): Pass the `flags' to `ExplicitBlock's
5697 .ctor to make `IsIterator' work.
5699 2008-03-14 Martin Baulig <martin@ximian.com>
5701 * symbolwriter.cs: Added the new symbol writer function from the
5702 debugger's `terrania' branch; temporarily enclose them inside
5703 `#if !DISABLE_TERRANIA_CHANGES' conditionals until I'm back from
5706 2008-03-14 Martin Baulig <martin@ximian.com>
5709 (SymbolWriter): Make this a public static class.
5712 (CodeGen.SymbolWriter): Removed; use the new static `SymbolWriter'
5713 class instead of using `if (CodeGen.SymbolWriter != null)' everywhere.
5715 2008-03-14 Marek Safar <marek.safar@gmail.com>
5717 A fix for bug #370577
5718 * statement.cs, lambda.cs: Added extra limitations when dealing with void
5721 2008-03-14 Marek Safar <marek.safar@gmail.com>
5723 * typemanager.cs (CSharpName): Made 250 times faster.
5725 2008-03-13 Marek Safar <marek.safar@gmail.com>
5727 * ecore.cs, expression.cs: Emit conversion for ET shift argument.
5729 2008-03-12 Marek Safar <marek.safar@gmail.com>
5731 * generic.cs, typemanager.cs, enum.cs, codegen.cs, statement.cs: Try not to
5732 crash when predefined field does not exist.
5734 2008-03-12 Marek Safar <marek.safar@gmail.com>
5736 * ecore.cs (PropertyExpr): Fixed IsSingleDimensionalArrayLength regression.
5738 2008-03-12 Marek Safar <marek.safar@gmail.com>
5740 * class.cs (FixedField): Don't crash when contructors are missing.
5742 2008-03-11 Marek Safar <marek.safar@gmail.com>
5744 * typemanager.cs, namespace.cs, literal.cs, ecore.cs, class.cs, decl.cs,
5745 convert.cs, constant.cs, expression.cs, statement.cs: Use same method to
5746 check internal types accessibility for internal and external types.
5747 Replaced EnumToUnderlying by GetEnumUnderlyingType.
5749 2008-03-11 Marek Safar <marek.safar@gmail.com>
5751 * support.cs, typemanager.cs, pending.cs, ecore.cs, class.cs, delegate.cs
5752 convert.cs, const.cs, anonymous.cs, constant.cs, expression.cs,
5753 attribute.cs, statement: Use corect instance of predefined types (work
5754 related to #364674).
5756 2008-03-07 Marek Safar <marek.safar@gmail.com>
5758 * expression.cs (TypeOfVoid): Fixed predefined method initialization.
5760 2008-03-07 Marek Safar <marek.safar@gmail.com>
5762 * generic.cs, typemanager.cs, parameter.cs, rootcontext.cs, ecore.cs,
5763 class.cs, delegate.cs, iterators.cs, const.cs, constant.cs, driver.cs,
5764 expression.cs, attribute.cs, codegen.cs, statement.cs: TypeManager optional
5765 predefined types clean up, delayed predefined types members initialization
5766 (work related to #364674).
5768 2008-03-05 Marek Safar <marek.safar@gmail.com>
5770 * typemanager.cs (IsFriendAssembly): InternalsVisibleTo is not mandatory.
5772 2008-03-05 Marek Safar <marek.safar@gmail.com>
5774 * typemanager.cs, parameter.cs, rootcontext.cs, ecore.cs, class.cs, decl.cs,
5775 delegate.cs, convert.cs, driver.cs, attribute.cs, codegen.cs: TypeManager
5776 predefined types clean up (work related to #364674).
5778 2008-03-04 Marek Safar <marek.safar@gmail.com>
5780 * ecore.cs: Print an error message instead of throwing exception.
5782 2008-03-04 Marek Safar <marek.safar@gmail.com>
5784 * generic.cs, typemanager.cs, literal.cs, convert.cs, cfold.cs, constant.cs,
5785 expression.cs, statement.cs: Unififed null literal representation.
5787 2008-03-03 Marek Safar <marek.safar@gmail.com>
5789 * anonymous.cs, cfold.cs, convert.cs, delegate.cs, doc.cs, ecore.cs,
5790 expression.cs: Refactored binary operators resolve phase and improved speed.
5791 The nullable code is still missing and won't work correctly, more fixes
5794 It also fixes #323726, #324312, #324248, and many other unreported issues.
5796 2008-02-29 Zoltan Varga <vargaz@gmail.com>
5798 * report.cs (FeatureIsNotAvailable): Use 'mcs1' instead of 'mcs', and 'mcs'
5801 2008-02-27 Marek Safar <marek.safar@gmail.com>
5803 * ecore.cs: Clean-up and split BetterConversion.
5805 2008-02-25 Raja R Harinath <harinath@hurrynot.org>
5808 * enum.cs (EnumMember.Value): Only access 'value' if
5809 ResolveValue says it's ok.
5810 (EnumMember.DoResolveValue): Don't set prev_member.value.
5811 (Enum.GetDefinition): Reverse arguments of Equals --
5812 EnumMember.Value can return 'null'.
5814 * statement.cs (Switch.Error_AlreadyOccurs): Fix typo in name.
5816 2008-02-22 Marek Safar <marek.safar@gmail.com>
5818 * generic.cs, expression.cs: More ongoing work on expression trees.
5820 2008-02-21 Marek Safar <marek.safar@gmail.com>
5822 * class.cs, typemanager.cs: Rewrote operator matching logic to correctly
5823 handle missing matches when mutiple operators exist.
5825 2008-02-20 Marek Safar <marek.safar@gmail.com>
5827 A fix for bug #363218
5828 * expression.cs (ArrayCreation.Clone): Deal with multi-dimensional
5831 2008-02-20 Marek Safar <marek.safar@gmail.com>
5833 * expression.cs, constant.cs, cfold.cs: Yet another side-effect constant
5834 update. This time to deal correctly with SideEffectConstant expression used
5835 as an argument for another constant folding.
5837 2008-02-20 Raja R Harinath <harinath@hurrynot.org>
5839 * typemanager.cs (DropGenericMethodArguments): Ensure we get an underlying
5842 2008-02-19 Marek Safar <marek.safar@gmail.com>
5844 * constant.cs, cfold.cs: SideEffectConstant results can apply for folding.
5846 2008-02-19 Marek Safar <marek.safar@gmail.com>
5848 A fix for bug #328136
5849 * expression.cs: Do not fold immediately LogicalAnd operators when the left
5850 side is a false constant, because we still need to evaluate the right-hand
5853 * statement.cs (If): Emit two types of boolean constants (simple constant,
5854 side-effect constant).
5856 2008-02-19 Marek Safar <marek.safar@gmail.com>
5858 * constant.cs (SideEffectConstant): Don't emit boolean constant.
5860 * expression.cs: Fold immediately LogicalAnd operators when both sides are
5863 2008-02-18 Marek Safar <marek.safar@gmail.com>
5865 A fix for bug #361457
5866 * ecore.cs (IsApplicable): Params methods have lower priority.
5868 * support.cs: Return correct parameter modifier for params types.
5870 2008-02-18 Marek Safar <marek.safar@gmail.com>
5872 * generic.cs (TypeParameter): Cache attribute target name.
5874 * support.cs: Removed unused variable.
5876 * typemanager.cs: Removed debugging leftover.
5878 * ecore.cs: Use local type instead of a property;
5880 * class.cs (VerifyMembers): Consider also parent to test whether type member
5883 * expression.cs (FullMethodDesc): Removed.
5885 * attribute.cs (IsValidArgumentType): Made static.
5887 2008-02-17 Raja R Harinath <harinath@hurrynot.org>
5889 Cleanup to be more readable.
5890 * Makefile (GMCS_PROFILE): Remove.
5891 (COMPILER_NAME): New helper.
5893 2008-02-15 Miguel de Icaza <miguel@novell.com>
5895 * cs-tokenizer.cs: if a conditional expression happens inside a
5896 (...) this also means that we do not need to de-ambiguate between
5897 an parenthesized expression and a cast.
5901 * constant.cs (SideEffectConstant): a constant value that happens
5902 to have a side effect.
5904 Fixes the build regressions introduced by the fix for #359789
5906 2008-02-14 Rodrigo Kumpera <rkumpera@novell.com>
5908 * expression.cs (Conditional.Emit): when emitting the ternary
5909 operator, use local variables to generate code verifiable code.
5911 The verifier cannot infer that the type on stack before the
5912 stloc.0 is executed is of type ParentB. This happens because the
5913 stack merge algorithm uses only parent types when deciding which
5914 is the common type. This is described in Part III 1.8.1.3 of ECMA
5917 This code compiled with mcs is not verifiable under MS. The MS
5918 verifier picks the first common interface of Foo and Bar, which is
5919 wrong, but doesn't use a full join type of the 2 interfaces.
5921 CSC uses a clever hack to compile such code in a verifiable
5922 way. It stores the intermediate values in a local variable with
5927 2008-02-14 Miguel de Icaza <miguel@novell.com>
5929 * expression.cs: Do not fold BitwiseAnd operators when the left
5930 side is a false constant, because we still need to evaluate the
5935 * support.cs: Instead of throwing an InternalErrorException when
5936 the position of the stream is outside the boundary of our buffer,
5937 reset the state of the reader, and restart the reading from the
5938 beginning of the file.
5940 2008-02-14 Marek Safar <marek.safar@gmail.com>
5942 * generic.cs (TypeParameter.GetMembers): Is not supported operation.
5944 2008-02-14 Marek Safar <marek.safar@gmail.com>
5946 A fix for bug #361686
5947 * decl.cs: A protected types used inside a private class which parents
5948 derives from the protected class are accessible.
5950 2008-02-13 Marek Safar <marek.safar@gmail.com>
5952 * generic.cs (ConstraintChecker): Use cached member lookup when looking for
5953 the parameterless constructor.
5955 2008-02-13 Marek Safar <marek.safar@gmail.com>
5957 * generic.cs, typemanager.cs, iterators.cs, codegen.cs: Refactored core
5958 lookup methods to use standard member cache when doing member lookup.
5960 2008-02-12 Marek Safar <marek.safar@gmail.com>
5962 * driver.cs: Don't report full path for referenced module as assembly error.
5964 2008-02-12 Marek Safar <marek.safar@gmail.com>
5966 * Makefile: Fixed `qh' target to work on all machines.
5968 * report.cs, typemanager.cs, parameter.cs, ecore.cs, class.cs, anonymous.cs,
5969 expression.cs, codegen.cs, statement.cs, doc.cs: Replaced type IsSubclassOf
5970 and HasElementType with TypeManager implementation.
5972 2008-02-08 Marek Safar <marek.safar@gmail.com>
5974 A fix for bugs #325134, #359749
5975 * expression.cs, ecore.cs: Try to resolve an extension method even if the
5976 first binds point to non-method member expression.
5978 2008-02-08 Marek Safar <marek.safar@gmail.com>
5980 * cs-parser.jay: Null coalescing operator is not part of ISO-1.
5982 2008-02-08 Marek Safar <marek.safar@gmail.com>
5984 A fix for bugs #321394, #323028
5985 * generic.cs, parameter.cs, ecore.cs, class.cs, decl.cs, delegate.cs:
5986 Reworked naive IsAccessibleAs implementation to handle nested types.
5988 2008-02-05 Jb Evain <jbevain@novell.com>
5990 * class.cs: use generic type comparison for parameters
5993 2008-02-05 Marek Safar <marek.safar@gmail.com>
5995 A fix for bug #325372
5996 * class.cs: Use generic type comparison when testing method signatures.
5998 2008-02-05 Marek Safar <marek.safar@gmail.com>
6000 A fix for bug #357047
6001 * ecore.cs: Applied C# 3.0 changes to better conversion.
6003 2008-02-05 Marek Safar <marek.safar@gmail.com>
6005 A fix for bug #358374
6006 * cs-parser.jay: Correctly set modifiers for all constructor types.
6008 2008-02-04 Marek Safar <marek.safar@gmail.com>
6010 A fix for bug #355251
6011 * generic.cs: Added base class constraint based type inference.
6013 2008-02-01 Marek Safar <marek.safar@gmail.com>
6015 A fix for bug #357255
6016 * decl.cs: One more missing visibility check.
6018 2008-02-01 Marek Safar <marek.safar@gmail.com>
6020 * support.cs: Fixed broken return.
6022 2008-01-25 Marek Safar <marek.safar@gmail.com>
6024 * report.cs: Correctly reset warnings count after probing.
6026 2008-01-25 Martin Baulig <martin@ximian.com>
6029 (NamespaceEntry.SymbolFileID): Make this work again after
6030 MemberName.ToString() is gone.
6032 2008-01-25 Marek Safar <marek.safar@gmail.com>
6034 * expression.cs: Implemented Divide, Equal, ExclusiveOr, GreaterThanOrEqual
6037 2008-01-25 Marek Safar <marek.safar@gmail.com>
6039 * generic.cs: Use full implicit conversion for type inference fixing.
6041 2008-01-24 Marek Safar <marek.safar@gmail.com>
6043 * ecore.cs, expression.cs, generic.cs: Implemented Convert, ConvertChecked.
6044 Fixed user operator conversions.
6046 2008-01-24 Marek Safar <marek.safar@gmail.com>
6048 * generic.cs: Do nullable type to null comparison optimization during
6051 2008-01-24 Marek Safar <marek.safar@gmail.com>
6053 A fix for bug #355163
6054 * generic.cs: Enabled l-value resolve on nullable expressions.
6056 2008-01-24 Marek Safar <marek.safar@gmail.com>
6058 A fix for bug #353986
6059 * class.cs: Ingore static ctors with parameters for any further checks.
6061 2008-01-24 Marek Safar <marek.safar@gmail.com>
6063 A fix for bug #354310
6064 * namespace.cs: Removed redundant check.
6066 2008-01-24 Marek Safar <marek.safar@gmail.com>
6068 A fix for bug #354928
6069 * expression.cs: ElementInitializers can be resolved only once.
6071 2008-01-24 Marek Safar <marek.safar@gmail.com>
6073 * convert.cs, ecore.cs, expression.cs, generic.cs: Implemented Coalesce and
6074 Condition expressions.
6076 2008-01-23 Marek Safar <marek.safar@gmail.com>
6078 * codegen.cs: Fixed AssemblyBuilder initialization on other platforms.
6080 2008-01-22 Marek Safar <marek.safar@gmail.com>
6082 * ecore.cs, expression.cs, generic.cs: Implicit bool? to bool conversion is
6085 * generic.cs: Implemented coalesce expression.
6087 2008-01-22 Marek Safar <marek.safar@gmail.com>
6089 A fix for bug #355145
6090 * anonymous.cs, convert.cs, ecore.cs, generic.cs, lambda.cs: Implemented
6091 expression tree type inference.
6093 2008-01-22 Raja R Harinath <harinath@hurrynot.org>
6096 * expression.cs (Binary.IsUnsignedType): Fix typo.
6098 2008-01-22 Marek Safar <marek.safar@gmail.com>
6100 * ecore.cs, expression.cs, generic.cs: Implemented NewArrayInit expression.
6102 2008-01-22 Marek Safar <marek.safar@gmail.com>
6104 A fix for bug #355161
6105 * ecore.cs, expression.cs: Wider range of extension method supported
6108 2008-01-22 Gert Driesen <drieseng@users.sourceforge.net>
6110 * codegen.cs: Use magic value for AssemblyBuilderAccess to instruct
6111 AssemblyBuilder to operate in compiler context. Fixes mcs part of
6114 2008-01-22 Marek Safar <marek.safar@gmail.com>
6116 A fix for bug #355148
6117 * ecore.cs, expression.cs: Correctly report misused ref and out modifiers.
6119 2008-01-22 Miguel de Icaza <miguel@novell.com>
6121 * expression.cs (CreateExpressionTree): Add support for or and
6122 logical or, and indent following the coding conventions.
6124 * typemanager.cs (LinqExpression): renamed from
6125 ExpressionTreeManager, for a shorter name.
6127 Use TypeManager.CoreLookupType to lookup types from our core
6128 assemblies and turn those into "Type" variables.
6130 Consumers that previously used "Namespace" and "Type" from this
6131 class should instead use the TypeExpression which is a type that
6132 is fully resolved (without involving the regular C# resolution
6135 This typically looks like this:
6137 TypeExpression texpr = new TypeExpression (LinqExpression.expression_type, loc);
6138 new MemberAccess (texpr, name, type_arguments, loc)
6140 This avoids the problem in: #355178
6142 2008-01-21 Marek Safar <marek.safar@gmail.com>
6144 * cs-parser.jay, expression.cs: Check `namespace alias qualifier' language
6145 feature in parser only as we do in other cases.
6147 2008-01-21 Marek Safar <marek.safar@gmail.com>
6149 * attribute.cs, ecore.cs, class.cs, delegate.cs, expression.cs, linq.cs,
6150 typemanager.cs: A refactoring of params arguments to reuse existing
6151 expressions (params -> array initializer) to emit params argument instead
6152 of specialized handling.
6153 It was required by expression tree implementation and it has other benefits
6154 as well, we now apply same optimization for params arguments as we do for
6157 2008-01-18 Marek Safar <marek.safar@gmail.com>
6159 A fix for bug #353526
6160 * generic.cs: A type inference of params arguments may not required any
6161 temporary array creation.
6163 2008-01-18 Marek Safar <marek.safar@gmail.com>
6165 A fix for bug #353534
6166 * generic.cs, ecore.cs, expression.cs: A method group type inference is
6167 supported for delegates only.
6169 2008-01-18 Marek Safar <marek.safar@gmail.com>
6171 * generic.cs: Fixed 3.0 type inference fixing phase to determine a unique
6172 type for more than 1 candidates.
6174 2008-01-18 Marek Safar <marek.safar@gmail.com>
6176 * typemanager.cs, ecore.cs, expression.cs: Implemented ArrayLength and Call
6179 2008-01-16 Marek Safar <marek.safar@gmail.com>
6181 * generic.cs, typemanager.cs, lambda.cs, parameter.cs, ecore.cs, constant.cs,
6182 expression.cs: Implemented Add, And, AndAlso, and ArrayIndex (without unary
6183 operator) expressions.
6185 2008-01-16 Zoltan Varga <vargaz@gmail.com>
6187 * statement.cs: Avoid declaring an IL variable for this_variable since it is
6188 not accessed from the generated IL.
6190 2008-01-14 Marek Safar <marek.safar@gmail.com>
6192 * typemanager.cs, lambda.cs, parameter.cs, ecore.cs, class.cs, delegate.cs,
6193 iterators.cs, convert.cs, assign.cs, anonymous.cs, expression.cs,
6194 statement.cs: The first expression tree implementation drop, mostly
6195 infrastructure work.
6197 2008-01-14 Marek Safar <marek.safar@gmail.com>
6199 * ecore.cs (IsNestedChild): Refactored.
6201 2008-01-11 Marek Safar <marek.safar@gmail.com>
6203 * lambda.cs: Don't use a cast on unknown expression statement.
6205 2008-01-10 Geoff Norton <gnorton@novell.com>
6207 * cs-tokenizer.cs: One more token to distinguish between method and lambda
6210 2008-01-09 Marek Safar <marek.safar@gmail.com>
6212 * doc.cs: Report better /doc crash details.
6214 2008-01-09 Marek Safar <marek.safar@gmail.com>
6216 A fix for bug #352536
6217 * ecore.cs, assign.cs, codegen.cs: Check event assignments.
6219 2008-01-08 Marek Safar <marek.safar@gmail.com>
6221 A fix for bug #352287
6222 * ecore.cs, expression.cs: Do `this' access checking in all member access
6225 2008-01-08 Marek Safar <marek.safar@gmail.com>
6227 * rootcontext.cs, driver.cs: Switch to linq mode by default.
6229 * report.cs: Reset message stacks.
6231 2008-01-08 Marek Safar <marek.safar@gmail.com>
6233 * generic.cs (InferInPhases): Correctly calculate params position.
6235 2008-01-08 Marek Safar <marek.safar@gmail.com>
6237 * cs-tokenizer.cs: No need to parse full string when parsing lambda
6240 2008-01-07 Marek Safar <marek.safar@gmail.com>
6242 * cs-tokenizer.cs: Enabled lambda arguments micro-parser for all profiles.
6244 * decl.cs (LookupNamespaceOrType): Don't cache names which caused an error.
6246 * driver.cs: Updated --help option.
6248 2008-01-07 Marek Safar <marek.safar@gmail.com>
6250 * generic.cs (InferParamsTypeArguments): Removed.
6251 (InferInPhases): Add params type inference.
6252 (LowerBoundInference): Fixed scoring mechanism.
6254 * cs-tokenizer.cs (PreProcessPragma): Use Location instead of line.
6256 2008-01-06 Gert Driesen <drieseng@users.sourceforge.net>
6258 * typemanager.cs: On 2.0 profile, GetPublicKeyToken returns an empty
6259 byte array for unsigned "baked" assemblies.
6261 2008-01-05 Gert Driesen <drieseng@users.sourceforge.net>
6263 * codegen.cs: AssemblyName.GetPublicKey returns a zero-length byte
6264 array for assemblies that are not strongnamed.
6266 2008-01-04 Marek Safar <marek.safar@gmail.com>
6268 A fix for bug #351481
6269 * expression.cs (MemberAccess.ResolveNamespaceOrType): Use correct
6270 declaring type for nested generic types.
6272 2008-01-04 Marek Safar <marek.safar@gmail.com>
6274 * namespace.cs, class.cs, decl.cs, cs-parser.jay: Use GetSignatureForError
6275 instead of ToString.
6277 2008-01-03 Marek Safar <marek.safar@gmail.com>
6279 A fix for bug #351047
6280 * expression.cs (Binary.ResolveOperator): Allow equality operators between
6281 null and structs only when equality and inequality operators are defined
6282 either as an user-operators or predefined operators.
6284 2008-01-03 Marek Safar <marek.safar@gmail.com>
6286 A fix for bug #351047
6287 * generic.cs, typemanager.cs, class.cs: New IsReferenceType helper method.
6289 2008-01-03 Marek Safar <marek.safar@gmail.com>
6291 A fix for bug #351257
6292 * cs-tokenizer.cs: Advance line number for '\r' correctly.
6294 2008-01-03 Marek Safar <marek.safar@gmail.com>
6296 A fix for bug #351157
6297 * class.cs (Using): Fixed yet another broken cloning.
6299 (Block): Put back more sensible default value for statements.
6301 2008-01-01 Gert Driesen <drieseng@users.sourceforge.net>
6303 * codegen.cs: Allow AssemblyVersion with only major version component.
6306 2007-12-29 Marek Safar <marek.safar@gmail.com>
6308 A fix for bug #324654
6309 * class.cs: Use FullName property as member name.
6311 2007-12-28 Marek Safar <marek.safar@gmail.com>
6313 A fix for bug #342117
6314 * generic.cs (ConstraintChecker): Struct constraint also satisfies default
6315 constructor constraint.
6317 2007-12-28 Marek Safar <marek.safar@gmail.com>
6319 A fix for bug #338273
6320 * class.cs (ProbertyBase): Access modifier checks are required for overrides
6323 2007-12-28 Marek Safar <marek.safar@gmail.com>
6325 A fix for bug #350839
6326 * ecore.cs (MethodroupExpr): Probing hacks are no longer required.
6328 2007-12-27 AdTsai (http://code.google.com/u/AdTsai/)
6330 Reviewed by Ben Maurer, Miguel de Icaza, patches from Google's
6333 http://code.google.com/p/google-highly-open-participation-mono/issues/detail?id=4
6335 * statement.cs: Changed some Hashtables to use HybridDictionaries
6336 instead. It was observed that some HashTables only contained a few
6337 items in the vast majority of cases. Since HybridDictionary is
6338 more efficient on small sets (<10 elements), "known_variables"
6339 from class ExplicitBlock as well as "labels" and "constants " from
6340 class Block were changed to HybridDictionaries.
6342 Atsai results: (56216kb->54987kb)
6344 Miguel results (bootstrap of mcs): 59819kb -> 59290kb
6347 2007-12-27 AdTsai (http://code.google.com/u/AdTsai/)
6349 Reviewed by Ben Maurer, Miguel de Icaza, patches from Google's
6352 http://code.google.com/p/google-highly-open-participation-mono/issues/detail?id=4
6354 * expression.cs: foreach loop to for loop, saved on allocation of
6355 enumerator (59333kb->59141kb)
6357 * statement.cs. Changed foreach loops to for loops, saved on
6358 allocation of enumerator (59141kb->59006kb)
6360 * decl.cs: ArrayLists in .NET 1.1 allocate 16 elements by default
6361 when constructed with no specified capacity. This was causing a
6362 few ArrayLists to allocate more memory than they would potentially
6363 need in the Block class and MemberCache class. Setting the
6364 ArrayLists to construct with a capacity of 1 saves some
6365 memory. (56216kb->55585kb)
6367 2007-12-27 Marek Safar <marek.safar@gmail.com>
6369 A fix for bug #347189 (2nd issue)
6370 * expression.cs (MemberAccess): Nested type can be found in base non-generic
6373 2007-12-27 Miguel de Icaza <miguel@novell.com>
6375 * report.cs: Do not use colors if stdout and stderr are not a
6378 2007-12-27 Marek Safar <marek.safar@gmail.com>
6380 A fix for bug #346998
6381 * ecore.cs (MethodGroupExpr): Implemented override filter for generic
6384 2007-12-27 Marek Safar <marek.safar@gmail.com>
6386 A fix for bug #343465
6387 * class.cs: Explicit method name for nested types uses dots only.
6389 2007-12-27 Marek Safar <marek.safar@gmail.com>
6391 A fix for bug #343707
6392 * cs-tokenizer.cs: Advance line number for mixed CR/LF files correctly.
6394 2007-12-27 Marek Safar <marek.safar@gmail.com>
6396 * ecore.cs: Report type inference errors only when arguments count matches
6399 * generic.cs (NullCoalescingOperator): Cannot be applied to null.
6401 * expression.cs, report.cs: New warning.
6403 * typemanager.cs: Catch anonymous method type too.
6405 2007-12-23 Marek Safar <marek.safar@gmail.com>
6407 A fix for bug #346379
6408 * expression.cs (UnaryMutator): Emit size of type for pointer mutator.
6410 2007-12-23 Marek Safar <marek.safar@gmail.com>
6412 A fix for bug #347359
6413 * expression.cs (Invocation): Don't resolve already resolved expression.
6415 2007-12-23 Marek Safar <marek.safar@gmail.com>
6417 A fix for bug #347189
6418 * class.cs (FixedField): Use non-dependent code only in the define phase.
6420 2007-12-23 Marek Safar <marek.safar@gmail.com>
6422 A fix for bug #348076
6423 * ecore.cs (FieldExpr.DoResolve): Allow any variable based expression.
6425 2007-12-22 Marek Safar <marek.safar@gmail.com>
6427 * ecore.cs (MethodGroupExpr.OverloadResolve): Set type arguments for
6428 discovered extension methods.
6430 2007-12-22 Marek Safar <marek.safar@gmail.com>
6432 * ecore.cs, namespace.cs, expression.cs: Removed broken ResolveGeneric
6435 2007-12-21 Miguel de Icaza <miguel@novell.com>
6437 * report.cs (ErrorMessage): Add support for using colors on
6438 terminals that support it.
6440 2007-12-21 Marek Safar <marek.safar@gmail.com>
6442 * ecore.cs: Use information about expanded params for error reporting.
6444 2007-12-21 Marek Safar <marek.safar@gmail.com>
6446 * ecore.cs, generic.cs, delegate.cs: Refactoring of method overloading code
6447 and logic for params overloads.
6449 2007-12-15 Miguel de Icaza <miguel@novell.com>
6451 * generic.cs (NullCoalescingOperator.CloneTo): implement this one,
6452 as this is also created from the parser. Fixes #349034
6454 2007-12-12 Miguel de Icaza <miguel@novell.com>
6456 * statement.cs (Throw.CloneTo): it is valid to have empty
6457 expressions for throw.
6459 2007-12-03 Marek Safar <marek.safar@gmail.com>
6461 * cs-parser.jay: Set delegate constraint parsing region correctly.
6463 2007-12-03 Marek Safar <marek.safar@gmail.com>
6465 A fix for bug #345467
6466 * typemanager.cs (IsEqual): Compare generic parameters position only.
6468 2007-11-28 Marek Safar <marek.safar@gmail.com>
6470 * expression.cs (BaseAccess): Type arguments can be null.
6472 2007-11-27 Raja R Harinath <harinath@gmail.com>
6474 * statement.cs (Block.Resolve): Ensure flow-branching tree is
6475 consistent even when an error has occured.
6476 (Switch.Resolve): Likewise.
6478 2007-11-22 Marek Safar <marek.safar@gmail.com>
6480 A fix for bug #334505
6481 * class.cs: Don't ignore InternalsVisibleTo attribute for internal
6484 2007-11-22 Marek Safar <marek.safar@gmail.com>
6486 * ecore.cs, typemanager.cs, delegate.cs, expression.cs: The first of
6487 refactorings required to resolve extension methods correctly when mixing
6488 generics and non-generics members.
6490 2007-11-20 Marek Safar <marek.safar@gmail.com>
6492 A fix for bug #342584
6493 * convert.cs: Added not documented explicit IntPtr/UIntPtr to enum
6496 2007-11-19 Marek Safar <marek.safar@gmail.com>
6498 A fix for bug #342512
6499 * delegate.cs: Use delegate argument expression when is available. Don't
6500 emit virtual call when class is sealed.
6502 2007-11-16 Marek Safar <marek.safar@gmail.com>
6504 A fix for bug #325423
6505 * assign.cs (FieldInitializer): Use resolved expression for emit.
6507 * class.cs: Print less confusing error message.
6509 2007-11-16 Marek Safar <marek.safar@gmail.com>
6511 * cs-tokenizer.cs: Removed GMCS ifdefs.
6513 * rootcontext.cs, report.cs: Report unavailable gmcs features used by
6516 * cs-parser.jay: Disabled nullable check.
6518 * generic-mcs: Copied more generic stuff.
6520 2007-11-16 Marek Safar <marek.safar@gmail.com>
6522 * gcs-parser.jay: Merged to cs-parser.jay.
6524 * generic.cs, typemanager.cs, cs-tokenizer.cs, linq.cs, Makefile
6525 * *.csproj, *.sources: Updated to use only jay parser file.
6527 2007-11-16 Marek Safar <marek.safar@gmail.com>
6529 * gcs-parser.jay: Added nullable and default expression feature checks.
6531 2007-11-16 Marek Safar <marek.safar@gmail.com>
6533 * gcs-parser.jay, cs-parser.jay, class.cs: Unified parameters parsing,
6534 it fixes many TODOs and hidden bugs.
6536 * expression: Removed duplicate error check.
6538 2007-11-15 Marek Safar <marek.safar@gmail.com>
6540 * gcs-parser.jay, statement.cs, decl.cs, ecore.cs: Try to resolve an
6541 implicitly type local variable only when it is used in a declaration.
6543 2007-11-15 Marek Safar <marek.safar@gmail.com>
6545 * attribute.cs: Use CS0612 for empty strings.
6547 2007-11-14 Marek Safar <marek.safar@gmail.com>
6549 * lambda.cs, statement.cs: Contextual return may act as a statement.
6551 2007-11-14 Marek Safar <marek.safar@gmail.com>
6553 A fix for a regression cause by #324222
6554 * class.cs: Don't report unused even when it implements an interface.
6556 2007-11-13 Marek Safar <marek.safar@gmail.com>
6558 A fix for bug #341205
6559 * ecore.cs, expression.cs: Method group expression cannot do static
6560 method access with an instance reference check before overloading takes
6563 2007-11-13 Marek Safar <marek.safar@gmail.com>
6565 A fix for bug #325359
6566 * class.cs: Use predictable name for automatically generated property.
6568 2007-11-12 Marek Safar <marek.safar@gmail.com>
6570 A fix for bug #324996
6571 * expression.cs (Is): Handle case where D is nullable and T is not
6574 * generics.cs (Nullable.HasValue): Nullable HasValue expression.
6576 2007-11-12 Marek Safar <marek.safar@gmail.com>
6578 * generic.cs, literal.cs, ecore.cs, class.cs, delegate.cs, const.cs,
6579 anonymous.cs, expression.cs, attribute.cs, codegen.cs, statement.cs:
6580 Flush small error reporting changes.
6582 2007-11-09 Marek Safar <marek.safar@gmail.com>
6584 A fix for bug #324996
6585 * expression.cs: Rewrote Is expression implementation to work with
6586 generics, nullable types, anonymous method. A const result expression
6587 uses existing infrastructure instead of custom not fully-featured one.
6589 2007-11-08 Marek Safar <marek.safar@gmail.com>
6591 A fix for bug #340202
6592 * class.cs: Consider generics for volatile field.
6594 2007-11-08 Marek Safar <marek.safar@gmail.com>
6596 A fix for bug #335594
6597 * expression.cs: Use conversion rules when handling string addition.
6599 2007-11-07 Marek Safar <marek.safar@gmail.com>
6601 A fix for bug #336651
6602 * expression.cs: Fixed a crash when probing is on.
6604 2007-11-07 Marek Safar <marek.safar@gmail.com>
6606 A fix for bug #324242
6607 * covert.cs: Added a conversion from any nullable-type with an
6608 underlying enum-type to the type System.Enum.
6610 2007-11-07 Marek Safar <marek.safar@gmail.com>
6612 A fix for bug #324222
6613 * class.cs: Report all non-used event fields.
6615 2007-11-07 Marek Safar <marek.safar@gmail.com>
6617 A fix for bug #325161
6618 * cs-parser.jay, gcs-parser.jay, decl.cs: Implemented namespace alias
6619 qualifier for generic types.
6621 2007-11-07 Marek Safar <marek.safar@gmail.com>
6623 A fix for bug #322971
6624 * expression.cs, ecore.cs: Added intermediate result value check for
6627 2007-11-07 Marek Safar <marek.safar@gmail.com>
6629 A fix for bug #324754
6630 * cs-parser.jay, gcs-parser.jay, class.cs: Try to create an interator
6631 when it was requested.
6633 2007-11-07 Marek Safar <marek.safar@gmail.com>
6635 A fix for bug #325101
6636 * expression.cs: Do type not value comparison for `is' expression.
6638 2007-11-07 Marek Safar <marek.safar@gmail.com>
6640 A fix for bug #320236
6641 * convert.cs: Don't apply user conversion on underlying target type.
6643 2007-11-06 Marek Safar <marek.safar@gmail.com>
6645 * expression.cs: Don't use unresolved expression for error reporting.
6647 2007-11-06 Marek Safar <marek.safar@gmail.com>
6649 A fix for bugs #337712, #324490
6650 * ecore.cs (MethodGroupExpr): Refactored to handle delegate method
6651 overloading resolution too.
6653 * delegate.cs: Uses MethodGroupExpr for overloading resolution. It makes
6654 the process consistent and more robust.
6656 * expression.cs, linq.cs, report.cs: Update.
6658 2007-11-02 Marek Safar <marek.safar@gmail.com>
6660 A fix for bug #332909
6661 * attribute.cs: Resolve attributes in correct context using error
6664 * rootcontext.cs: Define Obsolete attribute members as core members.
6666 2007-11-02 Marek Safar <marek.safar@gmail.com>
6668 * statement.cs: Removed unused methods.
6670 2007-10-31 Wade Berrier <wberrier@novell.com>
6672 * Makefile: reenable copy of gmcs.exe.config, but include it in EXTRA
6673 DIST (it doesn't get included because PROGRAM isn't defined to be gmcs
6676 2007-10-31 Marek Safar <marek.safar@gmail.com>
6678 A fix for bug #338102
6679 * decl.cs (CheckExistingMembersOverloads): Workaround issue with generic
6680 methods registered as non-generics.
6682 2007-10-31 Marek Safar <marek.safar@gmail.com>
6684 A fix for bugs #337712, #324490
6685 * delegate.cs: Delegate covariance and contravariance is not allowed for
6688 2007-10-31 Marek Safar <marek.safar@gmail.com>
6690 A fix for bug #337719
6691 * cs-tokenizer.cs: Restore identifier buffer when parsing contextual
6694 2007-10-30 Marek Safar <marek.safar@gmail.com>
6696 * Makefile (net_2_0_bootstrap/mcs.exe.config): Reverted copy gmcs.exe.config.
6698 2007-10-29 Marek Safar <marek.safar@gmail.com>
6700 * cs-tokenizer.cs, gcs-parser.jay, driver.cs: Fixed parsing of nested
6703 2007-10-29 Raja R Harinath <rharinath@novell.com>
6705 * Makefile (net_2_0_bootstrap/mcs.exe.config): Copy gmcs.exe.config.
6707 2007-10-29 Marek Safar <marek.safar@gmail.com>
6709 A fix for bug #334652
6710 * ecore.cs (MethodGroupExpr.OverloadResolve): Do also lookup for
6711 extension methods when we have not found the best candidate in normal
6714 2007-10-27 Marek Safar <marek.safar@gmail.com>
6716 * AssemblyInfo.cs: Keep up-to-date.
6718 2007-10-27 Marek Safar <marek.safar@gmail.com>
6720 * Makefile: Fixed generics compiler name.
6722 2007-10-27 Marek Safar <marek.safar@gmail.com>
6724 * lambda.test: removed, lambda parsing is done differently.
6726 * gen-il.cs, gen-treedump.cs, old-code.cs : Obsolete.
6728 2007-10-27 Gert Driesen <drieseng@users.sourceforge.net>
6730 * Makefile: Removed dependency on gmcs.exe.config. Fixes build.
6732 2007-10-27 Marek Safar <marek.safar@gmail.com>
6734 * Makefile, *.sources : All C# compilers are in mcs folder.
6736 * *.cs: Use existing 2_1 define for smcs.
6738 2007-10-26 Marek Safar <marek.safar@gmail.com>
6740 A fix for bug #335847
6741 * assign.cs, expression.cs: Couple of changes to avoid creating a
6742 temporary variable for each object initializer assignment statement. It
6743 simplifies struct initialization too, otherwise two temporary variables
6745 Implemented optimization of redundant default element initializers.
6747 2007-10-25 Marek Safar <marek.safar@gmail.com>
6749 A fix for bug #336766
6750 * expression.cs (Class.CheckBase): Use generic name when method is
6753 2007-10-25 Marek Safar <marek.safar@gmail.com>
6755 A fix for bug #334737
6756 * expression.cs (IndexerAccess.EmitAssign): Emit local temporary
6757 variable and not variable argument for prepared copies.
6759 2007-10-24 Marek Safar <marek.safar@gmail.com>
6761 A fix for bug #325110
6762 * class.cs, expression.cs, attribute.cs: Use open generic method when
6763 checking conditional attribute.
6765 2007-10-24 Marek Safar <marek.safar@gmail.com>
6767 * report.cs, cs-tokenizer.cs, class.cs, cs-parser.jay, anonymous.cs,
6768 expression.cs, statement.cs: Renamed method FeatureIsNotISO to
6769 FeatureIsNotAvailable.
6771 2007-10-24 Marek Safar <marek.safar@gmail.com>
6773 ** C# 3.0 Partial methods
6775 * cs-tokenizer.cs, support.cs, class.cs, decl.cs: Implemented partial
6776 methods support. Because of member cache issue with generics only
6777 non-generics partial methods are fully supported.
6779 2007-10-23 Marek Safar <marek.safar@gmail.com>
6781 * class.cs, decl.cs: Rewrote member overloads check to cope with
6782 generics and to use member cache for member checking. It also improves
6783 performance and fixes remaining overloads issues.
6785 2007-10-20 Marek Safar <marek.safar@gmail.com>
6787 * class.cs, const.cs, decl.cs, delegate.cs, enum.cs, generic.cs,
6788 roottypes.cs, typemanager.cs:
6790 A member cache creation logic changed to add members immediately and
6791 not rely on fallback. The member cache is now only prefered way
6792 how to access and find type declaration members. It saves 5 MB of memory
6793 during MWF compilation and makes code ready for more optimizations and
6794 clean-ups, it's also a pre-requirement for partial methods.
6796 2007-10-18 Raja R Harinath <harinath@gmail.com>
6798 * ecore.cs (Expression.Error_ValueCannotBeConverted): Add special
6799 handling for generic parameters.
6801 2007-10-15 Marek Safar <marek.safar@gmail.com>
6803 * class.cs (FixedField): Removed redundant volatile check.
6805 2007-10-15 Marek Safar <marek.safar@gmail.com>
6807 * class.cs, decl.cs: Fixed overload members verification to do only one
6808 check per possible collision.
6810 2007-10-13 Marek Safar <marek.safar@gmail.com>
6812 A fix for bug #325478
6813 * anonymous.cs (AnonymousContainer.Compatible): Merge are flags together
6814 and create only one disposable flags container.
6816 2007-10-12 Marek Safar <marek.safar@gmail.com>
6818 A fix for bug #332442 by Alexandre Gomes <alexmipego@gmail.com>
6819 * statement.cs (Fixed): Fixed variables cloning.
6821 2007-10-12 Marek Safar <marek.safar@gmail.com>
6823 A fix for bug #333342
6824 * class.cs (EventField): Don't mark value type event as synchronized.
6826 2007-10-12 Marek Safar <marek.safar@gmail.com>
6828 * ecore.cs, anonymous.cs (MethodGroupExpr): Use score from type
6829 inference to identify best candidate method correctly.
6830 (ProperyExpr): A range variable is read only and cannot be modified.
6832 2007-10-11 Marek Safar <marek.safar@gmail.com>
6834 * ecore.cs, delegate.cs (MethodGroupExpr): Refactored best candidate
6835 logic to identify best candidate method correctly.
6837 2007-10-11 Marek Safar <marek.safar@gmail.com>
6839 * location.cs (Equals, GetHashCode): Removed.
6841 2007-10-11 Marek Safar <marek.safar@gmail.com>
6843 * report.cs: Implemented message recorder. It is used mainly for lambda
6844 expressions to capture otherwise swallowed error messages.
6846 * anonymous.cs, lambda.cs.cs: Do full parameters check.
6848 * ecore.cs (ExtensionMethodGroup): Report binding failure at the botton
6850 (MethodGroupExpr.DoResolve): Use message recorder for error handling.
6852 * expression.cs (MemberAccess): Always report lookup failure.
6854 * location.cs: Implemented Equals, GetHashCode.
6856 * statement.cs (Return.DoResolve): Fixed hardcoded error argument.
6858 2007-10-10 Jb Evain <jbevain@novell.com>
6860 * codegen.cs: re-enable assembly version check.
6862 2007-10-09 Marek Safar <marek.safar@gmail.com>
6864 * report.cs, anonymous.cs, driver.cs, expression.cs: Added few ISO-2
6867 * namespace.cs (UsingAlias): Do correct version check.
6869 2007-10-08 Marek Safar <marek.safar@gmail.com>
6871 * expresison.cs, ecore.cs: Issue extension method error message when
6874 * rootcontext.cs: Added ISO_2 compiler mode option.
6876 2007-10-08 Marek Safar <marek.safar@gmail.com>
6878 * expresison.cs (UnaryMutator.ResolveOperator): Print more useful error
6881 2007-10-08 Marek Safar <marek.safar@gmail.com>
6883 * attribute.cs (GetString, GetBoolean): Work with both literal and
6886 * ecore.cs, expresison.cs, delegate.cs (Invocation, MethodGroupExpr):
6887 Moved method overload specific methods to MethodGroupExpr.
6889 (IndexerAccess): Re-wrote resolving mechanism, fixed many issues and
6890 it should be less memory consuming.
6892 Mon Oct 8 09:29:15 CEST 2007 Paolo Molaro <lupus@ximian.com>
6894 * codegen.cs: remove the assembly version check until the buildbot is
6897 2007-10-07 Jb Evain <jbevain@novell.com>
6899 * attribute.cs (Attribute.GetString): if the value
6900 expression is a StringConstant, return its string value.
6902 2007-10-07 Jb Evain <jbevain@novell.com>
6904 * typemanager.cs: add `assembly_version_attribute_type`.
6905 * codegen.cs: on attribute emission, check that the
6906 AssemblyVersionAttribute doesn't overflow.
6908 2007-10-05 Marek Safar <marek.safar@gmail.com>
6910 A fix for bug #324677
6911 * anonymous.cs, decl.cs: Yes another anonymous container hack. Overwrite
6912 parent container of a scope container with currently resolved one.
6914 2007-10-05 Marek Safar <marek.safar@gmail.com>
6916 A fix for bug #325534
6917 * class.cs (Invocation.DoResolve): Check invocation of object finalizer
6920 2007-10-05 Marek Safar <marek.safar@gmail.com>
6922 A fix for bug #327504
6923 * class.cs (Operator.Define): Refactored implicit and explicit user
6924 operator conversion rules.
6926 2007-10-05 Marek Safar <marek.safar@gmail.com>
6928 A fix for bug #327520
6929 * ecore.cs (ExtensionMethodGroupExpr): Emit resolved extension argument.
6931 2007-10-04 Marek Safar <marek.safar@gmail.com>
6933 A fix for bug #328022
6934 * class.cs (MethodData.Define): Use correct method to check whether
6935 a method implementents an accessor.
6937 2007-10-04 Marek Safar <marek.safar@gmail.com>
6939 A fix for bug #330069
6940 * statement.cs (Fixed.Resolve): Read the first array element only when
6941 an array is instantiated.
6943 2007-10-04 Marek Safar <marek.safar@gmail.com>
6945 * expression.cs, assign.cs, generics.cs: Print correct operator when
6946 compound assignment is used.
6948 2007-10-04 Marek Safar <marek.safar@gmail.com>
6950 A fix for bug #325841
6951 * expression.cs (ArrayAccess): Use full argument cloning only for
6952 string compound concatenation.
6954 2007-10-03 Marek Safar <marek.safar@gmail.com>
6956 A fix for bug #328774
6957 * ecore.cs (FieldExpr.EmitAssign): Fixed string concatenation compound
6959 (PropertyExpr.EmitAssign): Fixed string concatenation compound
6962 2007-10-03 Raja R Harinath <rharinath@novell.com>
6965 * ecore.cs (SimpleName.DoSimpleNameResolve): Handle Property and
6966 Event accessibility checks here. Remove some bogus code that
6967 accidently made GenericMethods work.
6968 (PropertyExpr.IsAccessibleFrom, EventExpr.IsAccessibleFrom): New.
6970 2007-09-25 Marek Safar <marek.safar@gmail.com>
6972 * expression.cs (ArrayCreation): Fixed cloning of an implicit types.
6974 * statement.cs (Block): Refactored AddVariable to allow error handling
6977 * generic.cs: New stub.
6979 2007-09-23 Marek Safar <marek.safar@gmail.com>
6981 * anonymous.cs, codegen.cs: Changed InferReturnType to be EmitContext
6984 2007-09-17 Marek Safar <marek.safar@gmail.com>
6986 * class.cs: Use partial container to record whether any partial part
6987 contains static field initializer and therefore default contructor has
6990 2007-09-14 Marek Safar <marek.safar@gmail.com>
6992 * class.cs (TypeContainer.AddPartial): Fixed an issue reported on
6993 mono-list when only one of two partial parts has defined accessibility
6996 2007-09-14 Marek Safar <marek.safar@gmail.com>
6998 A fix for bug #82845
7000 * class.cs (TypeContainer): Set correct resolve context for all field
7003 2007-09-13 Marek Safar <marek.safar@gmail.com>
7005 * assign.cs: Fixed a crash when field is resolved twice with an error.
7007 * codegen.cs: Changed InFieldInitializer to be flag.
7009 * anonymous.cs, ecore.cs, expression.cs: Update after
7010 IsInFieldInitializer rename.
7012 * const.cs: Removed unused parameter.
7014 * class.cs: Changed the way how we resolve and emit field initializers.
7015 The field initilizers have to have access to contructor block to emit
7016 compiler generated code.
7018 2007-09-13 Marek Safar <marek.safar@gmail.com>
7020 * expression.cs (MemberAccess.DoResolve): DeclSpace is broken by
7021 generics use TypeContainer instead.
7023 2007-09-12 Marek Safar <marek.safar@gmail.com>
7025 * generic.cs (TypeInferenceContext.InflateGenericArgument): Stub.
7027 * lambda.cs (ResolveParameters): Use more powerful
7028 InflateGenericArgument.
7030 * parameters.cs: Better exception message.
7032 2007-09-10 Marek Safar <marek.safar@gmail.com>
7034 * anonymous.cs (AnonymousMethodExpression.CompatibleChecks): Report
7035 correct expression block type.
7037 * ecore.cs (Expression.Error_MemberLookupFailed): Made virtual.
7039 * expression.cs (Invocation): Extracted method group resolve to
7042 2007-09-07 Marek Safar <marek.safar@gmail.com>
7044 * ecore.cs (Expression.MemberLookupFinal): Removed unused loc parameter.
7045 (MethodGroupExpr.ResolveGeneric): Use existing method group instance.
7047 * expression.cs (MemberAccess.DoResolve): Uses generic resolver for
7048 generic extension methods.
7050 2007-09-06 Marek Safar <marek.safar@gmail.com>
7052 A fix for bug #82676 (Do I get it right now?)
7053 * convert.cs (Binary.ResolveOperator): An interface is converted to the
7054 object before a standard conversion is applied.
7056 2007-09-06 Marek Safar <marek.safar@gmail.com>
7058 * convert.cs (ImplicitReferenceConversionCore): Reverted wrong fix of
7061 2007-09-05 Marek Safar <marek.safar@gmail.com>
7063 A fix for bug #82676
7064 * convert.cs (ImplicitReferenceConversionCore): Check both sides for
7065 non-generic interface types.
7067 2007-09-05 Marek Safar <marek.safar@gmail.com>
7069 A fix for bug #82690
7070 * ecore.cs (PropertyExpr.EmitAssign): Leave a copy does just that.
7072 2007-09-05 Marek Safar <marek.safar@gmail.com>
7074 A fix for bug #82571
7075 * anonymous.cs (AnonymousMethod.DoCreateMethodHost): Use internal
7076 modifier for container based methods.
7078 2007-09-05 Marek Safar <marek.safar@gmail.com>
7080 A fix for bug #82676
7081 * convert.cs (ImplicitReferenceConversionCore): From any class-type S to
7082 any interface-type T means to any of interface type T.
7084 2007-09-04 Marek Safar <marek.safar@gmail.com>
7086 * namespace.cs: We have 2 versions of System.Core assembly.
7088 2007-09-04 Marek Safar <marek.safar@gmail.com>
7090 A fix for bug #82652
7091 * class.cs (Class.GetClassBases): Compare types and not expressions.
7093 2007-09-04 Marek Safar <marek.safar@gmail.com>
7095 A fix for bug #82620
7096 * expression.cs (Invocation.EmitArguments): Duplicate params arguments
7097 actually never worked before.
7098 (IndexerAccess): Emit prepared arguments before they are modified.
7100 2007-09-04 Marek Safar <marek.safar@gmail.com>
7102 A fix for bug #82563
7103 * assign.cs: Revert wrong fix.
7105 * expression.cs (VariableReference.EmitAssign): Handle ref reference
7107 (ArrayAccess): Changed the way we emit compound (prepared) assignments.
7108 Instead of ldelema/stdind we have to use temporary variables to handle
7109 cases like String.Concat (params string[]).
7111 2007-08-31 Marek Safar <marek.safar@gmail.com>
7113 * class.cs: EmitAttributes to Emit rename.
7115 * decl.cs (MemberCore.GetClsCompliantAttributeValue): Parent can be
7117 (MemberCore.HasClsCompliantAttribute): Don't depend on
7118 GetClsCompliantAttributeValue execution.
7120 2007-08-31 Marek Safar <marek.safar@gmail.com>
7122 * anonymous.cs: Use shorter type prefix.
7124 * ecore.cs (SimpleName.DoSimpleNameResolve): Use transparent identifiers
7127 * expression.cs (LocalVariableReference.DoResolveBase): Don't capture
7128 variables when probing is on.
7130 * statement.cs (LocaLInfo.Clone): Clone correctly resolved and
7131 unresolved variables.
7132 (TopLevelBlock.GetTransparentIdentifier): Default implementation doesn't
7133 handle transparent identifiers.
7135 2007-08-26 Marek Safar <marek.safar@gmail.com>
7137 * attribute.cs (IsClsCompliant): Add nullable types test.
7139 2007-08-24 Atsushi Enomoto <atsushi@ximian.com>
7141 * doc.cs : catch other types of exception than XmlException to
7142 report CS1570. Fixed bug #82565.
7144 2007-08-23 Marek Safar <marek.safar@gmail.com>
7146 * anonymous.cs (AnonymousMethodExpressin.ExplicitTypeInference):
7147 The number of delegate parameters has to match.
7148 (AnonymousMethodExpressin.VerifyParameterCompatibility): Handles generic
7151 2007-08-21 Marek Safar <marek.safar@gmail.com>
7153 * anonymous.cs (AnonymousMethod): Generate private anonymous method
7154 to fix problem with private arguments.
7156 2007-08-20 Marek Safar <marek.safar@gmail.com>
7158 * anonymous.cs (AnonymousTypeClass): An anonymous type can be empty.
7160 * decl.cs (MemberName): Ignore generic type with no generic arguments.
7162 * expression.cs (AnonymousTypeDeclaration): An anonymous type can be
7163 empty. Add cloning suport.
7165 * roottypes.cs (GetAnonymousType): Fixed argument comparison logic.
7167 2007-08-20 Marek Safar <marek.safar@gmail.com>
7169 * convert.cs, ecore.cs, expression.cs, literal.cs: Use factory method
7170 to create EmptyCast. It handles EmptyConstantCast specialization for
7173 2007-08-18 Marek Safar <marek.safar@gmail.com>
7175 * expression.cs (Binary.is_unsigned): Handle unsafe types too.
7176 (EmitArrayArgument): One routine for array arguments.
7177 (ArrayCreation.MakeByteBlob): Fixed an array alignment.
7179 2007-08-17 Marek Safar <marek.safar@gmail.com>
7181 * cs-tokenizer.cs (GetKeyword): Handle from keyword in a different way.
7183 2007-08-17 Marek Safar <marek.safar@gmail.com>
7185 * anonymous.cs: MemberLookupFinal update.
7187 * class.cs (ConstructorInitializer): Is expression based.
7189 * delegate.cs: MethodGroupExpr update.
7191 * ecore.cs (Error_MemberLookupFailed): Improved to report better error
7193 (Error_MemberLookupFailed): Customizable error override.
7194 (MethodGroupExpr): Keep queried type for later usage.
7195 (MethodGroupExpr.OverloadResolve): Catch errors related to overload
7198 * expression.cs: Error_MemberLookupFailed refactoring.
7199 (New.DoResolve): Resolve as much as possible.
7200 (ElementInitializer.Error_MemberLookupFailed): Object initializer
7201 customization for invalid member types.
7203 * statement.cs: MethodGroupExpr update.
7205 2007-08-16 Marek Safar <marek.safar@gmail.com>
7207 * modifier.cs (Check): Check all modifiers and not only accessibility
7210 2007-08-16 Marek Safar <marek.safar@gmail.com>
7212 * ecore.cs (Expression.Error_ValueCannotBeConverted): Report always a
7213 type and not an expression.
7215 2007-08-16 Marek Safar <marek.safar@gmail.com>
7217 * statement.cs (Catch.Clone): Type and variable can be null.
7219 2007-08-16 Marek Safar <marek.safar@gmail.com>
7221 A fix for bug #81979
7222 * assign.cs (Assign.Emit): Prepare arguments for string concatenation.
7223 I am really not sure whether this is the best fix.
7225 * expression.cs (VariableReference.EmitAssign): Do prepare_load test
7228 2007-08-14 Marek Safar <marek.safar@gmail.com>
7230 ** C# 3.0 Object and collection initializers (major re-write)
7232 * assign.cs (DoResolve): Initializers are not assign related.
7234 * codegen.cs (EmitContext.CurrentInitializerVariable): Holds a varible
7235 used during collection or object initialization.
7237 * expression.cs (Error_InvalidArguments): Add initializers specific
7238 messages. More will come later because it requires some general
7240 (New.DoResolve): Better error handling for unsafe types.
7241 (EmptyExpressionStatement): New class.
7242 (ElementInitializer): An object initializer expression.
7243 (CollectionElementInitializer): A collection initializer expression.
7244 (CollectionOrObjectInitializers): A block of object or collection
7246 (NewInitialize): New expression with element/object initializers.
7248 * statement.cs: Reverted object/collection initializer hacks.
7250 * typemanager.cs (CSharpName): Filter __arglist type.
7252 2007-08-09 Marek Safar <marek.safar@gmail.com>
7254 ** C# 3.0 Anonymous Types (update to the latest standard)
7256 * expression.cs (Binary.ResolveOperator): Threat all null based types
7258 (AnonymousTypeDeclaration): Renamed from AnonymousType and simplified.
7259 (AnonymousTypeParameter): Updated.
7261 * anonymous.cs (CompilerGeneratedClass): Add custom name overload.
7262 (AnonymousTypeClass): New anonymous type container.
7264 * class.cs (AddField): Return operation result.
7266 * generic.cs: Another empty TypeArguments overload.
7268 * roottypes.cs (AddAnonymousType, GetAnonymousType): Anonymous types
7269 are stored at top of normal hierarchy.
7271 * typemanager.cs (CSharpName): Filter anonymous types.
7273 2007-08-09 Marek Safar <marek.safar@gmail.com>
7275 * expression.cs (StringConcat.Append): Handle 3 and more concatenation
7276 as single Concat call. How could we miss that :-(
7278 2007-08-08 Marek Safar <marek.safar@gmail.com>
7280 * expression.cs (ArrayCreation.CloneTo): Allocate exact size.
7282 2007-08-07 Miguel de Icaza <miguel@novell.com>
7284 * expression.cs: Fix the previous commit, the creation of the
7285 arguments array list needs also to be conditional on the arguments
7288 * class.cs: Add a little bit of help to help narrow down problems.
7290 * expression.cs (ArrayCreation.CloneTo): Argument can be null, do
7291 not try to copy in that case.
7293 * driver.cs: When building SMCS, include a new different set of
7294 default assemblies here. Do this here so we can control whether
7295 to include the default assemblies with /noconfig.
7297 2007-08-03 Marek Safar <marek.safar@gmail.com>
7299 A fix for bug #81979
7300 * expression.cs (TypeOf.GetAttributableValue): Check for type arguments
7303 2007-08-03 Marek Safar <marek.safar@gmail.com>
7305 A fix for bug #82300
7307 * anonymous.cs (AnonymousContainer.Define): Don't define anything when
7308 we are in probing scope.
7310 2007-08-03 Marek Safar <marek.safar@gmail.com>
7312 A fix for bug #82301
7314 * statement.cs (Catch.CloneTo): Clone blocks in the right order.
7315 (Statement.CloneTo): Clone and not map children blocks.
7317 2007-08-03 Marek Safar <marek.safar@gmail.com>
7319 A fix for bug #82299
7321 * expression.cs (LocalVariableReference.CloneTo): Remap local info
7324 * statement.cs (Statement.CloneTo): Clone variables before statements
7325 to allow remaping of local variables.
7327 2007-08-03 Marek Safar <marek.safar@gmail.com>
7329 A fix for bug #82296
7332 * report.cs: Log crash details for future clone problems.
7334 * statement.cs (Return.Clone): Don't clone non-existent expression.
7336 2007-08-03 Raja R Harinath <harinath@gmail.com>
7338 * class.cs (TypeContainer.AddBasesForPart): Make virtual.
7339 (Class.AddBasesForPart): Move CS0537 check here from ...
7340 * cs-parser.jay (class_declaration): ... here. Move calling of
7341 'AddBasesForPart' to ...
7342 (class_bases): ... here.
7343 (struct_declaration, interface_declaration): Update to changes.
7345 2007-08-02 Marek Safar <marek.safar@gmail.com>
7347 A fix for bug #81923
7349 * statement.cs (Using.ResolveLocalVariableDecls): Only non-user implicit
7350 conversion is allowed.
7352 2007-08-02 Marek Safar <marek.safar@gmail.com>
7354 A fix for bug #81564
7356 * ecore.cs (EventExpr): Add IsBase handling.
7358 * expression.cs (BaseAccess.CommonResolve): Events can use base accessor
7361 2007-08-02 Raja R Harinath <harinath@gmail.com>
7363 Reduce some differences between cs-parser.jay in mcs/ and gmcs/.
7364 * cs-parser.jay: Some whitespace cleanups.
7365 (current_delegate): New.
7367 (struct_declaration): Make similar to gmcs/cs-parser.jay -- add
7368 a dummy code block, and use 'type_name' instead of 'member_name'.
7369 (interface_declaration, class_declaration): Likewise.
7370 (delegate_declaration): Likewise. Rearrange slightly and use
7372 * cs-tokenizer.cs (handle_where): Rename from handle_constraints.
7373 (GetKeyword): Update to change. Use '!foo' instead of 'foo == false'.
7375 2007-08-02 Marek Safar <marek.safar@gmail.com>
7377 A fix for bug #82039
7379 * ecore.cs (TypeLookup.GetSignatureForError): Use name when type is not
7382 * typemanager.cs (CSharpName): Split to string overload.
7384 2007-08-02 Marek Safar <marek.safar@gmail.com>
7387 * report.cs: Updated warning CS0472.
7389 2007-08-01 Marek Safar <marek.safar@gmail.com>
7391 A fix for bug #82181
7393 * cs-tokenizer.cs: Ignore partial keyword inside block expression.
7395 2007-08-01 Marek Safar <marek.safar@gmail.com>
7397 A fix for bug #82277
7398 * statememnt.cs (Block.Clone): Don't clone explicit blocks twice.
7400 2007-08-01 Marek Safar <marek.safar@gmail.com>
7402 ** C# 3.0 Type Inference (major bits are working)
7404 * anonymous.cs (AnonymousMethodExpression): Removed refactored fields.
7405 (.ImplicitStandardConversionExists): Uses compatible.
7406 (.ExplicitTypeInference): Infers type arguments based on explicit arguments
7407 (.InferReturnType): New method.
7408 (.Compatible): Refactored.
7409 (.ResolveParameters): Uses factory to create resolved parameters.
7410 (.CompatibleMethod): Add probing mode support.
7411 (AnonymousContainer): Removed unused fields. Split Define and Resolve to
7412 clearly distinguish between 2 different operations.
7413 (LambdaMethod): Moved to lambda.cs.
7414 (AnonymousMethod): Removed unused fields and methods.
7415 (AnonymousDelegate): Simplified.
7417 * codegen.cs (ResolveTopBlock): Updated renamed Resolve to Define.
7419 * convert. cs (ImplicitConversionStandard): Compatible works differently.
7421 * delegate.cs (Delegate): New mehods to reduce code duplication.
7422 (.GetConstructor): New method.
7423 (.GetInvokeMethod): New method.
7424 (DelegateCreation): Updated.
7426 * ecore.cs (ResolveOverloadExtensions): Don't crash when extension method
7428 (OverloadResolve): Made probing little bit faster.
7430 * expression.cs (ParameterReference.DoResolveLValue): Reference can be null
7433 * generic.cs (TypeInferenceContext): Dummy implementation.
7435 * iterators.cs: Updated after Resolve/Define rename.
7437 * lambda.cs (LambdaExpression)
7438 (.ResolveParameters): Handles both type of arguments and type inference too.
7440 * parameter.cs (ImplicitLambdaParameter.Resolve): Sanity check.
7441 (InflateTypes): Updated.
7443 * support.cs (InflateTypes): Changed signature and updated.
7445 * typemanager.cs (LookupMemberCache): Better dynamic type check.
7446 (MemberLookup_FindMembers): More MS tricks.
7447 (GetParameterData): Ditto.
7448 (GetDelegateParameters): Uses quick path for dynamic types.
7450 2007-08-01 Marek Safar <marek.safar@gmail.com>
7452 * class.cs (MethodData.Define): EmitContext is required for generic stuff
7455 2007-07-31 Marek Safar <marek.safar@gmail.com>
7457 * statement.cs (ProcessParameters): Don't crash when parameters have wrong
7460 2007-07-26 Jb Evain <jbevain@novell.com>
7462 * typemanager.cs (TypeManager.GetConstructor): Add a method overload
7463 which takes a boolean 'report_errors', similar to the GetMethod.
7464 (InitCodeHelpers): StructLayoutAttribute.ctor(int16) is not visible
7465 in .net 2.1, do not report errors here.
7467 * typemanager.cs (TypeManager.InitCoreTypes): System.ArgIterator,
7468 System.Runtime.CompilerServices.RequiredAttributeAttribute and
7469 System.Runtime.CompilerServices.TypeForwardedToAttribute are internal
7472 * typemanager.cs (TypeManager.InitCoreTypes): Move the resolution
7473 of the type InternalsVisibleToAttribute before the first call
7474 to CoreLookupType which is allowed to fail (third boolean parameter
7475 to true). Because, during the resolution for a type that is not
7476 immediately found, we try to check if the type is not defined in
7477 a friend assembly, and to do so, we need the
7478 InternalVisibleToAttribute.
7480 2007-07-23 Miguel de Icaza <miguel@novell.com>
7482 * expression.cs (Binary): Add support for the brain-dead CSC 2.x
7483 feature that allows structs to be compared against null and inline
7484 the result as true or false.
7486 Notice that the same code is not permitted inside a generic block
7487 of code that would do:
7489 class Foo<T> where T : struct {
7496 It is only allowed if the type of T is not bound (no where
7497 clause). In my opinion, this CSC 2 behavior is broken but people
7498 seem to be using it (IronRuby does, a few bug reports on bugzilla
7499 have it and some people have complained about it).
7501 All of the users that depend on this behavior have code that is
7504 * report.cs (Warning, Error): make these take object arguments,
7505 not strings, as that allows us to take advantage of Format.
7507 2007-07-20 William Holmes <billholmes54@gmail.com>
7509 * decl.cs: Changed MemberName.CountTypeArguments to also check the
7510 Left member variable for the Count.
7511 * doc.cs: Changed DocUtil.GetMethodDocCommentName to call
7512 MemberName.CountTypeArguments to avoid a NRE.
7514 This code is contributed under the MIT X11 license
7516 2007-07-18 Marek Safar <marek.safar@gmail.com>
7518 * cs-tokenizer.cs: Improved lambda parsing and removed old code.
7520 2007-07-18 Atsushi Enomoto <atsushi@ximian.com>
7522 * doc.cs : generic method arguments are written as ``x while generic
7523 type arguments are `x. Combined with the previous change, fixed bug
7526 2007-07-18 Raja R Harinath <rharinath@novell.com>
7529 * expression.cs (Binary.ResolveOperator): When converting
7530 'a + (- b)' to 'a - b', ensure that the unary '-' is discarded.
7532 2007-07-18 Atsushi Enomoto <atsushi@ximian.com>
7534 * doc.cs : when T: or whatever x: is specified, it does not really
7535 check the doc comment's syntax correctness. Fixed bug #82006.
7537 2007-07-18 Marek Safar <marek.safar@gmail.com>
7539 * anonymous.cs (AnonymouseMethodExpression): Refactored to work with
7540 LambdaExpression better.
7542 * cs-tokenizer.cs: Changed a way how we detect lambda parameters.
7544 * driver.cs (LambdaTypeParseTest): Removed, tested method is gone.
7546 * ecore.cs (Expression.MemberLookupFailed): Don't show currect context
7547 as it can be generated.
7549 * expression.cs (Invocation.Error_InvalidArguments): Show correct
7552 * lambda.cs (LambdaExpression): Refactored to share same code with
7553 AnonymousMethodExpression.
7555 2007-07-17 Marek Safar <marek.safar@gmail.com>
7557 * anonymous.cs (MakeName): Include host name for easier debugging.
7558 (LambdaMethod): New class for lambda spcecific stuff.
7560 * attribute.cs: Set EmitContext return type.
7562 * class.cs: Set EmitContext return type.
7564 * codegen.cs (EmitContext): Return type cannot be null to stop messing
7565 with null/void meaning.
7567 * iterators.cs (ContainerType): Implemented.
7569 * rootcontext.cs: Set value of TypeManager.bool_type at early stage.
7571 * statement.cs (Return): Updated to lambda expressions.
7572 (Block.CloneTo): Parent can be null.
7574 2007-07-13 Marek Safar <marek.safar@gmail.com>
7576 A fix for bug #81917
7577 * attribute.cs (AttributeTester.GetFixedBuffer): More robust testing.
7579 * class.cs (FixedField): Check whether field is in unsafe scope.
7581 * ecore.cs (FieldExpr.DoResolve): Create fixed buffer expression here.
7582 (FieldExpr.Emit): Fixed buffers cannot be volatile.
7584 * expression.cs (ElementAccess.Resolve): Move fixed buffers resolve to
7587 * statement.cs (Fixed.Resolve): Simplified fixed buffers.
7589 2007-07-13 Marek Safar <marek.safar@gmail.com>
7591 * cs-tokenizer.cs, class.cs, decl.cs, driver.cs, namespace.cs,
7592 rootcontext.cs, expression.cs, statement.cs: Updated to use WarningLevel
7595 2007-07-13 Marek Safar <marek.safar@gmail.com>
7597 * ecore.cs (FieldExpr.AddressOf): Less confusing warning message.
7599 2007-07-13 Marek Safar <marek.safar@gmail.com>
7601 * anonymous.cs (AnonymousMethodExpression): Parameters are r/o.
7602 (AnonymousContainer.ResolveNoDefine): Another ec to aec flag conversion.
7604 * codegen.cs(EmitContext): Add ProbingMode flag.
7606 * delegate.cs (DelegateInvocation): Set few instance variables as r/o.
7608 * driver.cs: For now set both warning values.
7610 * ecore.cs (SimpleName): Name is readonly.
7611 (MethodGroup.OverloadResolve): One quick path for probing.
7613 * expression.cs (Unary): Set Oper r/o.
7614 (Binary): Set Oper r/o.
7615 (ParameterReference): Set few instance variables as r/o.
7616 (ParameterReference.DoResolveBase): Don't capture aruments when
7618 (Invocation.CloneTo): Fixed typo, looks easy, yeah.
7619 (Arglist): arguments are private.
7620 (SizeOf): type is private and r/o.
7621 (MemberAccess): arguments are private.
7623 * report.cs: Enhanced reporting on/off capabilities.
7625 * lambda.cs: Uses ec.IsInProbingMode.
7626 (ContextualReturn): Derives from return.
7628 * rootcontext.cs: For now set both warning values.
7630 * statement.cs (CloneContext.RemapBlockCopy): Remaps block to cloned
7632 (Return.Resolve): Don't die immediately.
7633 (Block.Resolve): Speed-up probing.
7634 (Block.CloneTo): Clone only child blocks.
7636 Fri Jul 13 11:19:28 CEST 2007 Paolo Molaro <lupus@ximian.com>
7638 * iterators.cs: reverted Miguel's latest change (r81925) as it
7639 breaks the build in System.
7641 2007-07-13 Miguel de Icaza <miguel@novell.com>
7643 * iterators.cs (Yield.CheckContext): Check for the iterator type
7644 also here as we can call into Yield even in codepaths that are not
7646 (MethodOrOperator is the only path that was checked).
7648 In addition to the standard check, use a more specific check for
7649 constructors to report a more verbose error.
7651 2007-07-12 Miguel de Icaza <miguel@novell.com>
7653 * ecore.cs (FieldExpr.AddressOf): Do not stop processing here,
7654 report the warning and continue
7656 * statement.cs (Using.EmitLocalVariableDecls): We were leaving
7657 values on the stack on the call to Emit. Use EmitStatement if
7658 possible, or using Emit + Pop if not possible. Fixes #82064
7660 2007-07-12 Raja R Harinath <rharinath@novell.com>
7662 * expression.cs (Invocation.IsApplicable): Reorganize slightly to
7663 avoid try...finally in some cases.
7665 2007-07-10 Marek Safar <marek.safar@gmail.com>
7667 * attribute.cs (Attribute.ResolveConstructor): Uses method group.
7669 * class.cs (ConstructorInitializer.Resolve): Use and keep method group
7670 instead of method. Re-use standard error handling.
7671 (ConstructorInitializer.Emit): Simplified.
7673 * delegate.cs: Updated after Invocation.EmitCall change.
7675 * ecore.cs (GetOperatorTrueOrFalse): Uses MethodGroupExpr only.
7676 (SimpleName.SimpleNameResolve): Set and reset in_transit flag correctly.
7677 (ExtensionMethodGroupExpr): Refactored to use same OverloadResolve
7678 method and don't permanently changing input arguments.
7679 (MethodGroupExpr): Introduced resolved best_candidate, when method group
7680 is resolved it has one of the candidates is the best one which is later
7681 used to emit. Removed a few unused method.
7682 (MethodGroupExpr.MakeUnionSet): Moved from Invocation, it belongs here.
7684 * expression.cs (StaticCallExpr.MakeSimpleCall): Uses method group.
7685 (Binary.ResolveOperator): Ditto.
7686 (ConditionalLogicalOperator.DoResolve): Ditto.
7687 (Invocation): Uses method group.
7688 (Invocation.DoResolve): Simplified.
7689 (Invocation.EmitCall): Removed useless is_static.
7690 (Invocation.Emit): Delegate to method group.
7691 (Invocation.EmitStatement): Simplified.
7692 (New): Uses method group.
7693 (MemberAccess.DoResolve): Don't destroy original expression.
7695 * statement.cs (ForEach.Resolve): Use null for no method arguments.
7697 2007-07-04 Marek Safar <marek.safar@gmail.com>
7699 * ecore.cs (VarExpr.DoResolveLValue): More restriction checks.
7702 * lambda.cs: Add custom error message type.
7704 2007-07-03 Marek Safar <marek.safar@gmail.com>
7706 * lambda.cs: Simplified little bit.
7708 * parameter.cs: Introduced ImplicitLambdaParameter.
7709 (Parameters.CreateFullyResolved): New factory instead of ctor.
7713 * delegate.cs: Updated parameter creation.
7715 2007-07-03 Marek Safar <marek.safar@gmail.com>
7717 * ecore.cs (SimpleName.GetSignatureForError): Display correctly generic
7720 * generic.cs: Synchronized with gmcs.
7722 2007-07-03 Marek Safar <marek.safar@gmail.com>
7724 * class.cs (Indexer): Check return type as soon as possible.
7726 * cs-parser.jay: Initialize implicit_value_parameter_type for interface
7729 * ecore.cs (VarExpr.DoResolveLValue): Set eclass value.
7731 * expression.cs (Invocation.Error_InvalidArguments): Show type only.
7733 * parameter.cs (Parameter): Use expression type when it is available.
7735 * support.cs (ReflectionParameters.ParameterDesc): Show an extension
7736 method modifier for the first parameter only.
7738 2007-06-24 Marek Safar <marek.safar@gmail.com>
7740 A fix for bug #81938
7741 * typemanager.cs (ChangeType): Fixed couple of char conversions.
7743 * constant.cs: Tide up an exception message.
7745 2007-06-22 Marek Safar <marek.safar@gmail.com>
7747 * ecore.cs (SimpleName.DoSimpleNameResolve): Better error reporting when
7748 an uninitialized variable is used.
7750 * expression.cs (LocalVariableReference.DoResolve): Ditto.
7752 2007-06-22 Marek Safar <marek.safar@gmail.com>
7754 * ecore.cs (SimpleName.TypeOrNamespaceNotFound): Allow to override type
7755 not found error handling.
7757 * expression.cs (ArrayCreation): Removed redundant fields and little bit
7759 (ArrayCreation.ResolveArrayElement): To be ready to customization.
7760 (ArrayCreation.DoResolve): Simplified.
7761 (ImplicitlyTypedArrayCreation.DoResolve): Implicitly typed arrays have
7762 its own resolve process.
7763 (ImplicitlyTypedArrayCreation.ResolveArrayElement): Conversion magic.
7765 2007-06-20 Marek Safar <marek.safar@gmail.com>
7767 * namespace.cs (NamespaceEntry.Error_AmbiguousTypeReference): Print
7770 2007-06-20 Marek Safar <marek.safar@gmail.com>
7772 * cs-tokenizer.cs: Removed var related stuff.
7774 * ecore.cs (Expression.ResolveAsContextualType): Introduced new method.
7775 (VarExpr): Changed to derive from SimpleName. VarExpr now behaves as
7776 a type and a keyword at same time.
7778 * decl.cs (MembeName.GetTypeExpression): Create VarExpr when type name
7781 * expression.cs (ImplicitlyTypedArrayCreation): New empty class for
7782 implicitly typed arrays, more changes will follow.
7784 * statement.cs (LocalInfo.Resolve): Resolve type as contextual type.
7786 2007-06-19 Marek Safar <marek.safar@gmail.com>
7788 * ecore.cs (VarExpr): Removed Handled field.
7790 * statement.cs (Using.ResolveLocalVariableDecls): Refactored to use
7791 build-in assign functionality.
7792 (ForEach.Resolve): Removed all implicitly typed local variable code and
7794 (ArrayForeach.Resolve): Infer implicitly typed local variable here.
7795 (CollectionForeach.Resolve): Infer implicitly typed local variable here.
7797 2007-06-18 Marek Safar <marek.safar@gmail.com>
7799 * assign.cs: Removed implicitly typed local variable check.
7801 * expression.cs (LocalVariableReference.DoResolve): Add check for self
7802 referencing implicitly typed local variable.
7803 (LocalVariableReference.DoResolveLValue): Infer implicitly typed local
7806 * statement.cs (Fixed): Removed unsupported implicitly typed local
7809 2007-06-15 Marek Safar <marek.safar@gmail.com>
7811 * decl.cs (MemberName): Moved all Unbound stuff to parser.
7813 2007-06-14 Marek Safar <marek.safar@gmail.com>
7815 A fix for bugs #81855 and #76274
7816 * attribute.cs (AttachTo): Always set owner for global attributes to
7819 * ecore.cs (Error_TypeDoesNotContainDefinition): A type location can be
7822 * cs-parser.jay: Assembly and module attributes must precede all other
7823 elements except using clauses and extern alias declarations.
7825 2007-06-13 Marek Safar <marek.safar@gmail.com>
7827 A fix for bug #81748
7829 * expression.cs: More checks for non ISO-1 features.
7831 2007-06-12 Marek Safar <marek.safar@gmail.com>
7833 A fix for bug #81807
7834 * statement.cs(Switch.TableSwitchEmit): Define null label when it's not
7835 present inside switch statement and it is required by nullable check.
7837 2007-06-12 Marek Safar <marek.safar@gmail.com>
7839 A fix for bug #81840
7840 * ecore.cs (SimpleName.ResolveAsTypeStep): Look for non-generic type
7841 when type matching fails.
7843 * namespace.cs: Tiny error message change.
7845 2007-06-12 Marek Safar <marek.safar@gmail.com>
7847 * decl.cs (CheckAbstractAndExtern): Moved to MemberCore for easier error
7848 reporting. Added automatic property check.
7850 * class.cs: Updated after CheckAbstractAndExtern relocation.
7851 (AEventPropertyAccessor.GetSignatureForError): Customized.
7853 2007-06-11 Marek Safar <marek.safar@gmail.com>
7855 * class.cs (DefineBaseTypes): Base type can be undefined.
7857 * ecore.cs (TypeLookup): Minor refactoring.
7858 (DoResolveAsTypeStep): Removed redundant check.
7860 * namespace.cs (Lookup): Removed redundant check.
7862 * rootcontext.cs (BootstrapCorlib_ResolveType): Uses normal
7863 ResolveAsTypeTerminal step.
7864 (BootstrapCorlib_*): Simplified.
7865 (PopulateCoreType): Core types can be now external.
7867 2007-06-07 Marek Safar <marek.safar@gmail.com>
7869 * anonymous.cs (VerifyExplicitParameterCompatibility): Add flag to do
7871 (InferTypeArguments): Infers anonymous expression type arguments.
7872 (Compatible): Split to Compatible and InferTypeArguments.
7874 * lambda.cs: Updated.
7876 2007-06-08 Marek Safar <marek.safar@gmail.com>
7878 * anonymous.cs (AnonymousContainer): Marked as compiler generated.
7880 2007-06-07 Raja R Harinath <harinath@gmail.com>
7882 Fix #80477, cs0135-2.cs, cs0135-3.cs
7883 * statement.cs (ToplevelBlock.ProcessParameters): Add parameter
7884 names to the "known" variables list.
7885 (Block.CheckInvariantMeaningInBlock): Handle the fact the
7886 parameter names are also "known".
7887 (Block.CheckError136): Remove.
7888 (ExplicitBlock.CloneTo): New. Set 'known_variables' in target to
7891 2007-06-07 Marek Safar <marek.safar@gmail.com>
7893 * ecore.cs (MethodGroupExpr.OverloadResolve): Print full method definition.
7895 2007-06-06 Marek Safar <marek.safar@gmail.com>
7897 * ecore.cs (SimpleName.Emit): Emitting unresolved simple name is
7898 internal error not an user error.
7900 * expression.cs (IsApplicable): Refactored to make debugging easier.
7902 * support.cs: More tricks for non-mono runtimes.
7904 * typemanager.cs (CoreLookupType): Made public.
7905 (InitSystemCore): All linq specific stuff moved to linq.cs
7907 2007-06-05 Marek Safar <marek.safar@gmail.com>
7909 * typemanager.cs (CSharpSignature): One more missing build-in types
7911 More tricks for non-mono runtime.
7913 2007-06-05 Raja R Harinath <harinath@gmail.com>
7915 * statement.cs (Block.CheckError136_InParents): Remove.
7916 (Block.AddVariable): Use GetParameterInfo instead.
7917 (ToplevelBlock.ProcessArguments): Likewise.
7919 2007-06-04 Raja R Harinath <rharinath@novell.com>
7921 * statement.cs (ToplevelBlock.CloneTo): New. Copy over parameter
7923 (ToplevelBlock.GetParameterInfo): Split out of ...
7924 (ToplevelBlock.GetParameterRefernce): ... this.
7925 (ToplevelBlock.ParameterMap): Remove.
7926 * expression.cs (ParameterReference): Update to use
7927 ToplevelParameterInfo.
7929 * statement.cs (ToplevelBlock.ProcessParameters): Workaround some
7932 * flowanalysis.cs (FlowBranching.CheckOutParameters): Move ...
7933 * statement.cs (ToplevelBlock.CheckOutParameters): ... here.
7935 * statement.cs (ToplevelBlock.ResolveMeta): Move CS0136 checks ...
7936 (ToplevelBlock.ProcessParameters) ... here.
7937 (ToplevelBlock..ctor): Invoke it.
7939 * statement.cs (ToplevelBlock.ResolveMeta): Add sanity checks for
7942 * statement.cs (IKnownVariable): New interface.
7943 (LocalInfo): Implement it.
7944 (ToplevelParameterInfo): New class.
7945 (ExplicitBlock.AddKnownVariable): Use IKnownVariable.
7946 (ExplicitBlock.GetKnownVariable): Likewise. Rename from
7947 GetKnownVariableInfo.
7949 2007-06-03 Raja R Harinath <harinath@gmail.com>
7951 Partly speed up CS0136 error checks.
7952 * statement.cs (ExplicitBlock.GetKnownVariableInfo): Remove
7953 'recurse' parameter.
7954 (Block.DoCheckError136): Only check errors in parameters. Move
7955 local variable checks ...
7956 (Block.AddVariable): ... here, and ...
7957 (ToplevelBlock.ResolveMeta): ... here.
7959 2007-06-02 Raja R Harinath <harinath@gmail.com>
7961 * statement.cs (Block.IsChildOf): Remove.
7963 * statement.cs (Statement.Clone): Move special case code ...
7964 (Block.CloneTo): ... here.
7966 2007-05-29 Raja R Harinath <rharinath@novell.com>
7968 * statement.cs (ToplevelBlock.container): Remove field. It's
7969 redundant with 'Parent'.
7970 (ToplevelBlock.ContainerBlock): Remove accessor.
7971 (ToplevelBlock..ctor): Update to changes. Register anonymous
7972 child with parent here, ...
7973 * cs-parser.jay (end_anonymous): ... not here. Don't modify
7975 (start_anonymous): Don't save current_block.
7976 (top_current_block): Remove.
7978 * statement.cs (Block.Flags): Remove IsExplicit and IsToplevel flags.
7979 (Block.Resolve): Update to changes.
7980 (Block..ctor): Move setting of "correct" 'Toplevel'
7981 and 'Explicit' fields to ...
7982 (ExplicitBlock..ctor, ToplevelBlock..ctor): ... here.
7984 2007-05-27 Raja R Harinath <harinath@gmail.com>
7987 * statement.cs (Block.Implicit): Remove.
7988 (Block): Update to changes.
7989 * flowanalysis.cs: Likewise.
7991 Mildly speed up CheckInvariantMeaningInBlock
7992 * statement.cs (ExplicitBlock.AddKnownVariable): Move here from Block.
7993 Recursively call AddKnownVariable to all enclosing blocks.
7994 (ExplicitBlock.GetKnownVariableInfo): Move here from Block.
7995 Remove recursive calls.
7996 (Block): Update to changes.
7998 New ExplicitBlock invariants
7999 * statement.cs (Block.Explicit): New field. It points to the
8000 immediately enclosing non-implicit block.
8001 (Block..ctor): Maintain the invariant.
8002 * cs-parser.jay: Take advantage of invariant.
8004 Introduce ExplicitBlock
8005 * statement.cs (ExplicitBlock): New.
8006 (ToplevelBlock): Derive from it.
8007 (Block.Flags.IsExplicit): Rename from '...Implicit' and invert
8009 (Block.Implicit): Update to changes.
8010 * cs-parser.jay: Update to changes.
8013 * codegen.cs (EmitContext.IsLastStatement): Remove.
8014 * statement.cs (Block.DoEmit): Update to changes.
8016 2007-05-25 Raja R Harinath <rharinath@novell.com>
8018 * cs-parser.jay: Use 'start_block' and 'end_block' rather than
8019 modifying current_block directly.
8021 2007-05-23 Scott Peterson <lunchtimemama@gmail.com>
8023 * class.cs: Implemented automatic properties (C# 3.0)
8024 Thanks to Marek for the help.
8026 2007-05-23 Raja R Harinath <rharinath@novell.com>
8028 * flowanalysis.cs (VariableInfo.SetAssigned): When noting a
8029 variable as assigned, note also that all its components are
8031 (MyBitVector.SetRange): New. Function to set multiple bits to true.
8033 2007-05-19 Marek Safar <marek.safar@gmail.com>
8035 * anonymous.cs, class.cs: Emit Compiler generated attribute when
8036 member is marked as compiler generated.
8038 * decl.cs (MemberCore): Refactored ModFlags into property.
8040 * modifiers.cs: Add new modifier (COMPILER_GENERATED).
8041 (Check): Check only accessibility modifiers.
8043 2007-05-18 Raja R Harinath <rharinath@novell.com>
8045 Track all assignable slots in one bit array
8046 * statement.cs (ToplevelBlock.ParameterMap): Convert into array.
8047 (ToplevelBlock.ResolveMeta): Don't create a VariableMap. Move
8048 logic from VariableMap constructor here. Use the same 'offset'
8049 variable that's later used for computing offsets of local
8051 * flowanalysis.cs (UsageVector.parameters): Remove.
8052 (UsageVector): Update to changes.
8053 (VariableMap): Remove.
8055 Avoid creating ParameterMap in every block
8056 * statement.cs (Block.ParameterMap): Move ...
8057 (ToplevelBlock.ParameterMap): ... here.
8058 (ToplevelBlock.ResolveMeta): Create VariableMap for parameters
8060 * flowanalysis.cs (FlowBranching.param_map): Remove.
8061 (FlowBranching.UsageVector): Update to changes.
8062 (FlowBranchingToplevel.CheckOutParameters): Likewise.
8064 * statement.cs (Block.CloneTo): Clone Toplevel field too.
8066 * expression.cs (ParameterReference): Distinguish between block
8067 where parameter was referenced and declared.
8069 2007-05-18 Marek Safar <marek.safar@gmail.com>
8071 * flowanalysis.cs, statement.cs: Put back improved error handling.
8073 2007-05-15 Scott Peterson <lunchtimemama@gmail.com>
8077 Imporved object and collection initialization (C# 3.0).
8079 2007-05-15 Marek Safar <marek.safar@gmail.com>
8081 A fix for bug #81380
8082 * expression.cs (Is.DoResolve): Only value types have constant `is'
8085 2007-05-15 Raja R Harinath <rharinath@novell.com>
8087 * statement.cs (ToplevelBlock.child): Remove.
8089 2007-05-15 Raja R Harinath <harinath@gmail.com>
8091 Rationalize ResolveMeta: refactoring
8092 (Block.ResolveMeta): Remove wrong or superfluous comments. Carve
8093 out constant handling code into ...
8094 (Block.DoResolveConstants): ... this.
8096 Rationalize ResolveMeta: kill local_map
8097 * statement.cs (Block.local_map, Block.LocalMap): Remove.
8098 (Block.AssignableSlots): New.
8099 (Block.ResolveMeta): Make protected. Don't create a VariableMap
8100 for locals -- move code from VariableMap here. Avoid unnecessary
8102 * flowanalysis.cs (FlowBranching.local_map): Remove.
8103 (FlowBranching..ctor): Use Block.AssignableSlots.
8104 (VariableMap): Remove unused constructors.
8106 2007-05-11 Raja R Harinath <rharinath@novell.com>
8108 * Makefile [PROFILE=net_2_0_bootstrap]: Add special-case rules.
8110 2007-05-11 Marek Safar <marek.safar@gmail.com>
8112 * typemanager.cs (IsFriendAssembly): Should not be called for building
8115 2007-05-09 Marek Safar <marek.safar@gmail.com>
8117 * literal.cs (NullConstant): Print null in all cases.
8119 * expression.cs (Binary.ResolveOperator): Implemented delegate
8120 comparison based on C# 2.0 changes.
8122 2007-04-28 Scott Peterson <lunchtimemama@gmail.com>
8124 This code is contributed under the MIT X11 license
8126 The following enables support for several C# 3.0 language features:
8128 * cs-tokenizer.cs: Added support for the "var" keyword.
8130 * ecore.cs: Refactored TypeLookupExpression.DoResolveAsTypeStep().
8131 Added VarExpr class to facilitate type inferencing.
8133 * class.cs: Added IDictionary field AnonymousTypes to TypeContainer
8134 to support anonymous types.
8136 * assign.cs: Added support for type inferencing and initialization.
8138 * anonymous.cs: Added AnonymousClass class to enable anonymous types.
8140 * expression.cs: Added implicit array support to ArrayCreation.
8141 Added 5 types and 1 interface:
8143 IInitializable Implementing classes can inject initializing
8144 statements after object instantiation.
8146 Initializer Stores data for object initialization.
8148 AnonymousType An expression for anonymous types.
8150 AnonymousTypeParameter Stores data about an anonymous type's field.
8152 NewInitialize An expression for object initialization.
8154 CollectionInitialize An expression for collection initialization.
8156 * statement.cs: Added "var" keyword support to the foreach, using, and fixed
8159 2007-05-06 Marek Safar <marek.safar@gmail.com>
8161 A fix for bug #81500
8162 * cs-tokenizer.cs: Add special handling for coalescing operator.
8164 2007-05-06 Marek Safar <marek.safar@gmail.com>
8166 A fix for bug #81529
8167 * attribute.cs (GetAttributeUsage): AttributeUsage attribute inherits
8168 its value from base class until it is redefined.
8170 2007-05-02 Raja R Harinath <rharinath@novell.com>
8172 Fix regression in cs0631-3.cs
8173 * cs-parser.jay (operator_declarator): Add opt_attributes to error
8174 fallback. Make error fallback catch more cases.
8176 2007-05-01 Miguel de Icaza <miguel@novell.com>
8178 * cs-parser.jay: Allow parameters in operator declarations to have
8181 2007-04-27 Miguel de Icaza <miguel@novell.com>
8183 * statement.cs (If.CloneTo): Only clone the FalseStatement if it
8186 * lambda.cs (ContextualReturn.Resolve): An expression is valid
8187 inside the ContextualReturn, it does not have to be an
8188 ExpressionStatement.
8190 2007-04-24 Miguel de Icaza <miguel@novell.com>
8192 * lambda.cs (ContextualReturn.Resolve): if the return type is not
8195 2007-04-23 Miguel de Icaza <miguel@novell.com>
8197 * anonymous.cs (AnonymousContainer): split the virtual Resolve
8198 method in two methods: ResolveNoDefine and Resolve.
8200 ResolveNoDefine will stop just after ResolveTopBlock has been
8203 Resolve will then continue by creating a method and issuing the
8204 call to method.Define ().
8206 (AnonymousMethod): Split and implement the new Resolve and
8207 ResolveNoDefine as well.
8209 * lambda.cs (LambdaExpression): Split the anonymous method
8210 resolution code into a separate routine (CoreCompatibilityTest)
8211 from DoCompatibleTest.
8213 (LambdaExpression.TryBuild): New method, this method tries to
8214 build the LambdaExpression with the given set of types to be used
8215 as the types for the various parameters of the lambda expression.
8217 If the compilation succeed with the given types, the infered type
8218 of the Anonymous method is returned, otherwise null is returned.
8220 2007-04-23 Marek Safar <marek.safar@gmail.com>
8222 A fix for bug #81414
8223 * delegate.cs: Better fix, moved ApplyAttributes from Define to Emit.
8225 2007-04-22 Miguel de Icaza <miguel@novell.com>
8227 * cs-tokenizer.cs: Change various identifiers here from the
8228 camelCasing to the recommended Linux-like style for instance
8229 variables from the Coding Guidelines.
8231 2007-04-19 Martin Baulig <martin@ximian.com>
8234 (Convert.ImplicitReferenceConversionCore): Allow conversions from
8235 System.Enum to System.ValueType.
8237 2007-04-13 Martin Baulig <martin@ximian.com>
8239 Rewrote implicit reference conversions. We need to distinguish
8240 between implicit reference conversions (13.1.4) and implicit
8241 boxing conversions (13.1.5).
8243 According to the spec, there's an an implicit conversion
8244 "From a one-dimensional array-type S[] to IList<T> and base
8245 interfaces of this interface, provided there is an implicit
8246 reference conversion from S to T." Note that this does not
8247 include boxing conversions.
8250 (Convert.ImplicitTypeParameterBoxingConversion): New method.
8251 (Convert.ImplicitReferenceConversion): Split into
8252 ImplicitReferenceConversionCore() and
8253 ImplicitBoxingConversionExist().
8254 (Convert.ImplicitReferenceConversionExists): Use the new
8255 ImplicitReferenceConversionCore() and ImplicitBoxingConversionExists().
8257 2007-04-12 Martin Baulig <martin@ximian.com>
8259 * convert.cs (Convert.ImplicitReferenceConversion): Move the
8260 `TypeManager.null_type' checks up to the top of the method.
8262 2007-04-11 Marek Safar <marek.safar@gmail.com>
8264 A fix for bug #81350
8265 * class.cs, decl.cs, ecore.cs, namespace.cs: The optimization for private
8268 2007-04-11 Martin Baulig <martin@ximian.com>
8270 * statement.cs (Foreach.CollectionForeach.ProbeCollectionType):
8271 Use `TypeManager.GetInterfaces(t)' rather than `t.GetInterfaces()'
8272 to make this work for generic classes; fixes #79561.
8274 2007-04-11 Martin Baulig <martin@ximian.com>
8276 * expression.cs (As): Add support for nullable types; fixes #79371.
8278 2007-04-11 Martin Baulig <martin@ximian.com>
8280 * doc.cs (DocUtil.GetSignatureForDoc): Don't crash if
8281 `type.FullName' is null; fixes #80243.
8283 2007-04-11 Martin Baulig <martin@ximian.com>
8285 * expression.cs (Invocation.IsApplicable): Don't modify the method
8286 if type inference succeeded, but the method was not applicable.
8289 2007-04-10 Marek Safar <marek.safar@gmail.com>
8291 A fix for bug #81324
8292 * namespace.cs (Namespace.LookupExtensionMethod): Always inspect both
8293 internal and external namespaces containers.
8295 2007-04-10 Martin Baulig <martin@ximian.com>
8297 * delegate.cs (DelegateCreation.ResolveMethodGroupExpr): Use
8298 TypeManager.DropGenericMethodArguments() so we also call
8299 IMethodData.SetMemberIsUsed() for generic methods. Fixes #80357.
8301 2007-04-10 Martin Baulig <martin@ximian.com>
8303 * iterators.cs (Iterator.CreateIterator): Don't crash if
8304 `method.ReturnType' is null. This happens if something went wrong
8305 while resolving that typ (we already reported an error in this case).
8307 2007-04-10 Martin Baulig <martin@ximian.com>
8309 * expression.cs (New.DoResolve): Don't call CheckComImport() on
8310 generic interfaces; report the CS0144 directly.
8312 2007-04-10 Martin Baulig <martin@ximian.com>
8314 * ecore.cs (MemberExpr.ResolveMemberExpr): If `left' is a
8315 `TypeExpr', call ResolveAsTypeTerminal() on it; fixes #81180.
8317 2007-04-10 Martin Baulig <martin@ximian.com>
8319 * expression.cs (New.DoEmitTypeParameter): Fix #81109.
8321 2007-04-09 Raja R Harinath <rharinath@novell.com>
8324 * flowanalysis.cs (UsageVector.MergeChild): Handle child.Block == null.
8325 * statement.cs: Use KillFlowBranching only in ResolveUnreachable.
8328 * statement.cs (For.Resolve): If resolution fails, use
8331 2007-04-08 Marek Safar <marek.safar@gmail.com>
8333 * anonymous.cs (MakeName): Make faster and zero-based.
8334 (VerifyExplicitParameterCompatibility): Back to mode where generic
8335 parameter is ignored.
8336 (AnonymousMethodMethod.Emit): Decorate method as compiler generated.
8338 * class.cs (EmitType): Method can emit another new method.
8340 * cs-tokenizer.cs (IsLinqEnabled): Fixes static cctor race.
8342 * driver.cs: Updated.
8344 * lambda.cs: Reuse predefined empty parameters.
8346 * parameter.cs: Updated
8348 * support.cs: Implemented InflateTypes.
8350 * typemanager.cs (GetFullName): Don't use FullName as it can be null.
8351 (InitSystemCore): Introduced to isolate 3.0 dependencies.
8353 2007-04-03 Martin Baulig <martin@ximian.com>
8357 * statement.cs (Foreach.CollectionForeach.TryType): Use a custom
8358 version of TypeManager.IsOverride() which also works with generic
8361 2007-04-03 Martin Baulig <martin@ximian.com>
8366 (Convert.ExplicitReferenceConversion): We need to cast when
8367 converting from IList<T> to S[].
8369 2007-04-01 Marek Safar <marek.safar@gmail.com>
8371 * decl.cs (FindExtensionMethods): Consider all candidates with same name
8374 * expression.cs (MemberAccess.DoResolve): Cache resolved expression.
8376 2007-03-31 Marek Safar <marek.safar@gmail.com>
8378 * anonymous.cs (AnonymousMethodExpression.Compatible): Handles both
8379 argument and return type inferring.
8381 * codegen.cs (InferReturnType): Flag whether return can be inferred.
8382 (ReturnType): Turned to property.
8384 * statement.cs (Return): Implemented return type inferring.
8386 * support.cs (ReflectionParameters): Use local types if possible.
8388 2007-03-30 Raja R Harinath <rharinath@novell.com>
8390 * flowanalysis.cs (FlowBranching.Reachability): Remove.
8391 (FlowBranching.UsageVector): Update to changes.
8393 Prepare to kill 'Reachability'
8394 * flowanalysis.cs (UsageVector): Remove 'Reachability' from
8395 argument of constructor.
8397 2007-03-29 Raja R Harinath <rharinath@novell.com>
8399 Prepare to kill 'Reachability'
8400 * flowanalysis.cs (UsageVector.is_unreachable): New.
8401 (UsageVector): Update to maintain 'is_unreachable' in parallel to
8402 'reachability', and verify they're consistent.
8405 * expression.cs (New.EmitStatement): Handle type parameters here too.
8407 2007-03-29 Martin Baulig <martin@ximian.com>
8412 (ScopeInfo.ctor): Use `Modifiers.PUBLIC' if we're a nested
8413 CompilerGeneratedClass.
8414 (ScopeInfo.EmitScopeInstance): Make this protected.
8415 (CapturedVariable.EmitInstance): Use `Ldarg_0' if
8416 `ec.CurrentAnonymousMethod.Scope == Scope'.
8418 * statement.cs (Block.ScopeInfo): Make this a property.
8420 2007-03-27 Raja R Harinath <harinath@gmail.com>
8422 Prepare to kill 'Reachability'
8423 * flowanalysis.cs (FlowBranching.Reachability): Make class private.
8424 (FlowBranching.UsageVector.Reachability): Remove property.
8425 (FlowBranching.UsageVector.IsUnreachable): New property.
8426 (FlowBranching.UsageVector.ResetBarrier): New.
8427 (FlowBranching.UsageVector, FlowBranchingLabeled): Update to changes.
8428 * codegen.cs, statement.cs: Update to changes.
8430 2007-03-27 Martin Baulig <martin@ximian.com>
8435 (DeclSpace.LookupNestedTypeInHierarchy): Correctly handle nested
8438 2007-03-26 Raja R Harinath <rharinath@novell.com>
8440 * flowanalysis.cs (FlowBranching.Reachability): Use a boolean
8441 instead of TriState. Remove all mention of TriState.
8443 * flowanalysis.cs (FlowBranching.Reachability): Prepare to be
8444 replaced by a boolean. Add boolean 'is_unreachable' field, check
8445 and maintain invariants.
8447 2007-03-25 Marek Safar <marek.safar@gmail.com>
8449 * anonymous.cs: Restored checks disabled for uninflated anonymous methods.
8451 2007-03-25 Marek Safar <marek.safar@gmail.com>
8453 * expression.cs: Stop using obsolete 2.0 opcodes.
8455 2007-03-25 Marek Safar <marek.safar@gmail.com>
8457 * enum.cs (EnumMember.Define): Fixed regression and slowdown caused by
8458 one of the latests Martin's fixes.
8460 2007-03-23 Miguel de Icaza <miguel@novell.com>
8462 * expression.cs: On BigEndian systems, swap the bytes, temporary
8463 solution until we get a new bitconverter class.
8465 2007-03-23 Martin Baulig <martin@ximian.com>
8469 * decl.cs (MemberCache.AddMembers): Add generic methods both as
8470 "Method" and "Method`1". Normally, a cache lookup is done on the
8471 "Method" form (ie. without the generic arity), but this one makes
8472 lookups on the full form work as well.
8474 2007-03-22 Raja R Harinath <rharinath@novell.com>
8476 * flowanalysis.cs (Reachability): Reorganize slightly, and remove
8479 2007-03-20 Bill Holmes <billholmes54@gmail.com>
8481 Added 2 MemberCoreArrayList objects, ordered_explicit_member_list and
8482 ordered_member_list, to TypeBuilder to store members to be defined
8483 in the order they were parsed in.
8484 - ordered_explicit_member_list contains all properties indexers
8485 and methods that are defined as explicit implementation of an
8486 interface or base class.
8487 - ordered_member_list contains all properties indexers and methods
8488 that are not defined as explicit implementation of an interface
8491 Removed MethodArrayList and IndexerArrayList from TypeBuilder. The
8492 functionality in these removed classes has been replaced with
8493 ComputeIndexerName, EmitIndexerName, HasEqualss, HasGetHashCode, and
8494 CheckEqualsAndGetHashCode members defined and called in the TypeBuilderClass.
8496 Adding CheckForDuplications to PropertyBase.PropertyMethod and calls
8497 to CheckForDuplications inside GetMethod and SetMethod Define Method
8498 to handle method property and indexer name conflicts.
8502 All code is contributed under the MIT/X11 license.
8504 2007-03-20 Martin Baulig <martin@ximian.com>
8506 * class.cs (TypeContainer.Interfaces): Removed; they're now
8507 included in `TypeContainer.Types'.
8509 2007-03-20 Martin Baulig <martin@ximian.com>
8511 Fix #77963, #80314 and #81019. Added gtest-317, ..., gtest-320.
8513 * class.cs (TypeContainer.CreateType): New public method. This is
8514 now called before DefineType() to create the TypeBuilders.
8515 (TypeContainer.DefineType): Don't create the TypeBuilder here; it
8516 has already been created by CreateType().
8517 (TypeContainer.DefineTypeBuilder): Renamed into CreateTypeBuilder();
8518 don't resolve our base classes here; this has been moved into
8519 DefineBaseTypes(). We're now called from CreateType().
8520 (TypeContainer.DefineBaseTypes): New private method; resolve our
8521 base classes here. We're now called from DefineType().
8524 (RootContext.ResolveTree): Call TypeContainer.CreateType() on all
8525 our types first to create all the TypeBuilders. After that, call
8526 TypeContainer.DefineType() on all the types which'll resolve their
8527 base classes and setup the resolve order.
8529 2007-03-20 Martin Baulig <martin@ximian.com>
8531 * class.cs (TypeContainer.Enums): Removed; they're now included in
8532 `TypeContainer.Types'.
8534 2007-03-20 Martin Baulig <martin@ximian.com>
8537 (TypeContainer.DefineType): Don't call ResolveMembers() here.
8538 (TypeContainer.DoResolveMembers): Call DefineType() on our
8539 `compiler_generated' classes; moved here from DefineNestedTypes().
8542 (RootContext.ResolveTree): Call ResolveMembers() on all
8543 TypeContainer's in the `type_container_resolve_order'.
8545 2007-03-19 Marek Safar <marek.safar@gmail.com>
8547 * class.cs: Use corlib to handle InternalMethodImplAttribute.
8549 2007-03-17 Marek Safar <marek.safar@gmail.com>
8551 * class.cs (EventFieldAccessor.EmitMethod): Don't override existing
8552 implementation flags.
8554 2007-03-17 Marek Safar <marek.safar@gmail.com>
8556 * class.cs: More optimizations for type parameters.
8558 2007-03-15 Marek Safar <marek.safar@gmail.com>
8560 * anonymous.cs (AnomymousMethod): Can be now hosted in generic container.
8562 * ecore.cs, parameter.cs: More common code for both corlibs.
8564 * typemanager.cs (IsGenericMethod): Simplified.
8566 2007-03-15 Raja R Harinath <rharinath@novell.com>
8568 * flowanalysis.cs (FlowBranching.Reachability): Remove handling of
8570 * statement.cs, iterators.cs, lambda.cs: Update to changes.
8572 * statement.cs (Lock.Resolve): Invoke 'ec.NeedReturnLabel'
8573 unconditionally. Simplify explanation.
8574 (Try.Resolve, Using.Resolve): Likewise.
8576 2007-03-15 Martin Baulig <martin@ximian.com>
8580 * decl.cs (DeclSpace): If we're a partial class, use our
8581 `PartialContainer's `TypeParameters' and `CurrentTypeParameters'.
8583 2007-03-15 Raja R Harinath <rharinath@novell.com>
8585 * flowanalysis.cs (FlowBranching.Reachability): Remove handling of
8587 (FlowBranching.UsageVector): Update to changes.
8588 (FlowBranching.MergeSiblings): Likewise.
8589 * statement.cs: Likewise.
8591 2007-03-15 Martin Baulig <martin@ximian.com>
8596 (MemberCache): Added a special .ctor for type parameters.
8599 (TypeManager.MemberLookup_FindMembers): `TypeParameter' now has a
8602 2007-03-09 Martin Baulig <martin@ximian.com>
8604 * enum.cs (Enum): Make this a TypeContainer.
8605 (EnumMember): Derive from `Const'.
8608 (Const.DoResolveValue): New protected virtual method; move most of
8609 the functionality of ResolveValue() here so we can override it in
8611 (Const.CreateConstantReference): Make this virtual.
8613 * class.cs (Kind): Add `Kind.Enum'.
8614 (TypeContainer.Emit): Don't emit the enums here; they're already
8615 in the `RootContext.typecontainer_resolve_order'.
8617 * rootcontext.cs (RootContext.EmitCode): Don't emit the enums
8618 here; they're already in the `typecontainer_resolve_order'.
8620 * ecore.cs (EnumConstant.ConvertImplicitly): Add
8621 TypeManager.DropGenericTypeArguments().
8624 (TypeManager.CSharpEnumValue): Add DropGenericTypeArguments().
8625 (TypeManager.IsEnumType): Likewise.
8626 (TypeManager.EnumToUnderlying): Likewise.
8627 (TypeManager.IsEqual): Add support for enums.
8629 2007-03-12 Raja R Harinath <rharinath@novell.com>
8631 * typemanager.cs (InitCoreTypes) [NET_2_0]: Allow
8632 DefaultParameterValueAttribute to be undefined, say if System.dll
8635 2007-03-11 Marek Safar <marek.safar@gmail.com>
8637 * ecore.cs, parameter.cs, typemanager.cs: Another gmcs fix to work with
8640 2007-03-10 Marek Safar <marek.safar@gmail.com>
8642 * class.cs, parameter.cs: Unified parameters verification.
8644 2007-03-08 Martin Baulig <martin@ximian.com>
8646 * cs-parser.jay (constructor_header): Pass the location to the
8647 newly created TopLevelBlock.
8649 2007-03-07 Martin Baulig <martin@ximian.com>
8651 * statement.cs (Block.Resolve): Don't crash on error; bug #80715.
8653 2007-03-06 Miguel de Icaza <miguel@novell.com>
8655 * convert.cs (ExplicitReferenceConversionExists): Sync this method
8656 with the changes from David, fixes the build.
8658 2007-03-05 David Mitchell <dmitchell@logos.com>
8660 * convert.cs: Implement From System.Collecitons.Generic.IList<T>
8661 and its base interfaces to a one-dimensional array type S[],
8662 provided there is an implicit or explicit reference conversion
8665 2007-03-03 Marek Safar <marek.safar@gmail.com>
8667 * cs-tokenizer.cs: Implemented basic linq grammar.
8669 * driver.cs: Set linq lang version on demand.
8671 2007-02-26 Marek Safar <marek.safar@gmail.com>
8673 * cs-parser.jay, expression.cs: Compile empty __arglist correctly.
8675 2007-02-25 Marek Safar <marek.safar@gmail.com>
8677 * attribute.cs: Replaced DefinePInvoke in favor of S.R.E implementation
8680 * class.cs (InterfaceMemberBase): Share common `extern' modifier checks
8682 Check property and event extern attributes.
8684 * codegen.cs (ModuleClass): HasDefaultCharSet when module defined global
8687 2007-02-24 Marek Safar <marek.safar@gmail.com>
8689 A fix for bug #80407
8690 * ecore.cs: Don't report ambiguity error when methods have same parent.
8692 2007-02-23 Marek Safar <marek.safar@gmail.com>
8694 A fix for bug #80878
8695 * class.cs, cs-parser.jay: Event property can host anonymous methods.
8697 2007-02-22 Marek Safar <marek.safar@gmail.com>
8699 * attribute.cs: Enable ExtensionAttribute presence test.
8701 2007-02-22 Marek Safar <marek.safar@gmail.com>
8703 * class.cs: Warn about missing GetHashCode only when Equals is override.
8705 * decl.cs: Check accessibility of type arguments.
8707 * typemanager.cs: Correctly report nullable array.
8709 2007-02-20 Marek Safar <marek.safar@gmail.com>
8711 * class.cs, report.cs: Capture more details when things go wrong.
8713 2007-02-20 Marek Safar <marek.safar@gmail.com>
8715 A fix for bug #80650
8716 * cs-parser.jay: Anonymous container starts at constructor declaration
8717 and not at block beginning because it has to be usable in constructor
8720 * statement.cs: Use context location and not block one for error reporting.
8722 2007-02-18 Marek Safar <marek.safar@gmail.com>
8724 A fix for bug #78712
8725 * class.cs.cs, decl.cs, ecore.cs: LookupAnyGeneric inspects nested types
8728 2007-02-18 Marek Safar <marek.safar@gmail.com>
8730 A fix for bug #80493 by Atsushi Enomoto
8731 * cs-parser.jay: Ignore invalid attribute target.
8733 2007-02-18 Marek Safar <marek.safar@gmail.com>
8735 * cs-tokenizer.cs: Ignore '\0' as white space character.
8737 2007-02-17 Miguel de Icaza <miguel@novell.com>
8739 * cs-parser.jay: Add support for lambda expressions to the mcs
8742 * lambda.cs: Only clone when we are probing, not on the final call
8743 (Compatible is the final call).
8745 * statement.cs (CloneContext): Introduce class to provide block
8746 remapping during clone.
8748 All statements Clone themselves now.
8750 (Clone): special handling for blocks, when we clone a block, we
8751 register the block inside this routine, as children of the block
8752 might trigger a lookup.
8754 * expression.cs: Add support for CloneContext in all expressions.
8756 2007-02-17 Marek Safar <marek.safar@gmail.com>
8758 A fix for bug #80493
8759 * statement.cs: Report ambiguous warning when interfaces are not related.
8761 2007-02-15 Marek Safar <marek.safar@gmail.com>
8763 C# 3.0 extension methods.
8765 * attribute.cs (Error_MisusedExtensionAttribute): Extension attribute
8766 cannot be used directly.
8768 * class.cs (Class.Emit): Emit extension attribute if any class method
8769 is extension method.
8770 (Method.Define): Add basic extension method validation conditions.
8771 (Method.Emit): Emit extension attribute for method.
8773 * codegen.cs (AssemblyClass): Emit extension attribute if at least one
8774 extension method exists. Currently we follow same approach as Microsoft
8775 does, emit even if a method or a class are private but this can change
8778 * cs-parser.jay: Add handling of `this' keyword in method parameters
8781 * decl.cs (DeclSpace.IsStaticClass): New property.
8782 (MemberCache.FindExtensionMethods): Looks for extension methods with
8783 defined name and extension type.
8785 * doc.cs: Updated after OverloadResolve changes.
8787 * driver.cs: Add new soft reference to System.Core.dll.
8789 * ecore.cs (MethodLookup): Can return only MethodGroupExpr.
8790 (ExtensionMethodGroupExpr): Represents group of extension methods.
8792 * expression.cs (Invocation): Moved methods BetterConversion, MoreSpecific,
8793 BetterFunction, IsOverride, IsAncestralType, OverloadResolve
8794 to MethodGroupExpr and made non-static for easier customization.
8795 (Invocation.DoResolve): Add extension method lookup when no standard
8797 (MemberAccess.DoResolve): Try extension methods if no member exists.
8799 * modifiers.cs: Add METHOD_EXTENSION modifier.
8801 * namespace.cs (RegisterExtensionMethodClass): Register class namespace
8802 as well as candidate extension type.
8803 (ComputeNamespaces): When assembly constains extension methods registers
8805 (Namespace.RegisterExternalExtensionMethodClass): Register type for later
8806 extension method lookup.
8807 (Namespace.LookupExtensionMethod): Looks for extension method in this
8809 (NamespaceEntry.LookupExtensionMethod): Does extension methods lookup to
8810 find a method which matches name and extensionType.
8812 * parameter.cs (Parameter): Add This modifer.
8813 (HasExtensionMethodModifier): New property.
8814 (Resolve): Add extension parameter check.
8815 (ModFlags): turned to property to exclude this modifier as it is not real
8817 (Parameters): Implemented ExtensionMethodType and HasExtensionMethodType.
8819 * support.cs (ParameterData): Add ExtensionMethodType.
8820 (ReflectionParameters): Implemented ExtensionMethodType interface property.
8822 * typemanager.cs: Add type and ctor extension attribute type.
8824 2007-02-15 Miguel de Icaza <miguel@novell.com>
8826 * report.cs (DisableErrors, EnableErrors): used to prevent error
8827 output when we are "trying" to compile various methods with
8830 * ecore.cs (Expression): Add Clone method that calls the virtual
8831 CloneTo method. The current CloneTo method in Expression throws
8832 an exception so we can track down all the places where this must
8833 be implemented (not using abstract, because that would be a lot of
8834 up-front-work before we can start testing the implementation
8837 Important: we only need Clone capabilities for expressions created
8838 by the parser, as the expressions we will be cloning are
8839 expressions in the pre-resolved state. This vastly simplifies
8842 (SimpleName): Add CloneTo that does nothing.
8843 (EmptyCast): Add CloneTo.
8845 * expression.cs (Binary): Implement CloneTo.
8846 (Invocation.IsApplicable): Store the current ec in
8847 EmitContext.TempEc and restore it on return. This is used so we
8848 do not have to sprinkle hundres of methods with an extra
8849 EmitContext, we know that the only user is the lambda expression
8850 ImplicitConversionExists code.
8852 (Argument): Add Cloning capabilities.
8853 (LocalVariableReference, ParenthesizedExpression, Unary, Probe,
8854 Cast, Conditional, ArrayCreation, InvocationOrCast, Invocation,
8855 ArglistAccess, ArgList, TypeOf, SizeOf, CheckedExpr,
8856 UnCheckedExpr, ElementAccess, BaseAccess, BaseIndexerAccess,
8857 IndexerAccess): Add Clone capability.
8859 (LocalVariableReference, This): TODO: needs cloned Block mapping.
8861 (Argument): Add cloning capability.
8863 * assign.cs (Assign): Implement CloneTo.
8865 * anonymous.cs (ImplicitStandardConversionExists): Make virtual.
8867 * lambda.cs (ImplicitStandardConversionExists): Implement lambda
8868 version by calling Convert with the EmitContext (that we are
8869 currently storing in ec, this is not great, but will do for now,
8870 to avoid passing EmitContext parameters to hundreds of functions
8871 that do not need them now).
8873 (SetExpression): Remove, it is not needed.
8875 (ContextualReturn): Implement CloneTo.
8877 * statement.cs (Statement): Implement cloning infrastructure,
8878 similar to expressions.
8880 (Block): Partial implementation of Clone for statements.
8882 (Return): Implement clone.
8884 * constant.cs (Constant.CloneTo): New method, does nothing.
8886 * codegen.cs (TempEc): Add a static EmitContext as a temporary
8887 solution, until we decide how to exactly do this.
8889 2007-02-14 Marek Safar <marek.safar@gmail.com>
8891 A fix for bug #80493
8892 * class.cs (FindOutBaseMethod): When the base accessor does not exist and
8893 a property is override we need to use second accessor.
8895 2007-02-13 Marek Safar <marek.safar@gmail.com>
8897 A fix for bug #80418
8898 * attribute.cs, class.cs: Use correct calling conventions for pinvoke
8901 2007-02-13 Marek Safar <marek.safar@gmail.com>
8903 Another fix for bug #80749
8904 * pending.cs: Abstract class has priority over interfaces.
8906 2007-02-13 Marek Safar <marek.safar@gmail.com>
8908 Another fix for bug #80749
8909 * pending.cs: Abstract class has priority over interfaces.
8911 2007-02-13 Marek Safar <marek.safar@gmail.com>
8913 Another fix for bug #80749
8914 * pending.cs: Abstract class has priority over interfaces.
8916 2007-02-13 Marek Safar <marek.safar@gmail.com>
8918 Another fix for bug #80749
8919 * pending.cs: Abstract class has priority over interfaces.
8921 2007-02-13 Marek Safar <marek.safar@gmail.com>
8923 * class.cs Better error message.
8925 * driver.cs: Add shorter versions of -optimize option.
8927 2007-02-13 Martin Baulig <martin@ximian.com>
8929 * class.cs (Constructor.Emit): Check the return value of
8930 ec.ResolveTopBlock() and return on error.
8932 2007-02-13 Raja R Harinath <rharinath@novell.com>
8934 * ecore.cs (Error_InvalidExpressionStatement): Add a comma to error
8935 message to fix error message regression.
8937 2007-02-12 Marek Safar <marek.safar@gmail.com>
8939 * delegate.cs: Delegate creation expression cannot be of Nullable type.
8941 2007-02-12 Marek Safar <marek.safar@gmail.com>
8943 A fix for bug #80749
8944 * assign.cs (FieldInitializer): FieldInitializer has to keep track of
8945 its parent container.
8947 * class.cs (DefineFieldInitializers): Each initializer can has different
8950 * const.cs: Updated.
8952 2007-02-11 Miguel de Icaza <miguel@novell.com>
8954 * lambda.cs (LambdaExpression.Compatible): Remove some early code,
8955 now all the heavy lifting to check that embedded statements or
8956 expressions have the right form is done in the ContextualReturn.
8958 (ContextualReturn): New class.
8960 * ecore.cs (Error_InvalidExpressionStatement): Make a helper
8961 method that can be invoked to report 201, so we do not replicate
8964 * cs-parser.jay: Reuse Error_InvalidExpressionStatement.
8966 * cs-tokenizer.cs (xtoken): Correctly compute the column, it was
8967 treating tabs as spaces.
8969 2007-02-09 Marek Safar <marek.safar@gmail.com>
8971 A fix for bug #80315 by martin.voelkle@gmail.com (Martin Voelkle)
8972 * assign.cs: Use full implicit conversion for right side check.
8974 2007-02-09 Marek Safar <marek.safar@gmail.com>
8976 * statement.cs (Switch): Switch over boolean type is not standardized.
8978 2007-02-08 Marek Safar <marek.safar@gmail.com>
8980 A fix for bug #80755
8981 * decl.cs (FindBaseEvent): Don't use method cache for events.
8983 2007-02-07 Marek Safar <marek.safar@gmail.com>
8985 * cs-parser.jay: Better syntax error handling.
8987 * ecore.cs, enum.cs, statement.cs, typemanager.cs: Print enum member name
8988 instead of underlying type value.
8990 2007-02-06 Marek Safar <marek.safar@gmail.com>
8992 * driver.cs: Check define identifier before is registered.
8994 * namespace.cs: Use existing error message.
8996 * report.cs: New warning.
8998 2007-02-06 Marek Safar <marek.safar@gmail.com>
9000 A fix for bug #80742
9001 * expression.cs: Delegate Invoke method can be called directly.
9003 2007-02-06 Marek Safar <marek.safar@gmail.com>
9005 A fix for bug #80676
9006 * class.cs (IsEntryPoint): The Main method can have params modifier.
9008 2007-02-04 Miguel de Icaza <miguel@novell.com>
9010 * parameter.cs (Parameter, Parameters): Add Clone method.
9012 * anonymous.cs (Compatible): Turn method into virtual method, so
9013 LambdaExpression can implement a different behavior.
9015 (CompatibleChecks, VerifyExplicitParameterCompatibility): Factor
9016 out the basic checking here, so it can be used by
9019 * lambda.cs: Introduce "Compatible" function that will do the
9022 2007-02-02 Marek Safar <marek.safar@gmail.com>
9024 * attribute.cs: Unified one error message.
9026 * class.cs (Class): Use type attributes and not properties to test static
9028 (IsEntryPoint): Don's pass local variable.
9030 * convert.cs: Removed duplicate check.
9032 * decl.cs, doc.cs, ecore.cs (LookupType): Renamed to LookupNamespaceOrType.
9034 * driver.cs: Don't crash when soft reference does not exist.
9036 * namespace.cs (EnsureNamespace): Renamed to RegisterNamespace.
9037 (UsingEntry): Removed redundant allocation.
9039 * parameter.cs: Add fast path for type parameters.
9041 * support.cs: Don't allocate attribute when it's not used.
9043 2007-01-30 Miguel de Icaza <miguel@novell.com>
9046 (AnonymousMethodExpression.ImplicitStandardConversionExists): turn
9047 this into a virtual method, so we can override it in LambdaExpression.
9049 * driver.cs: Improve diagnostics in case of failure.
9051 * cs-tokenizer.cs: Instead of trying to parse a type and a name,
9052 write a function that is slightly more complex and that parses:
9054 type identifier [, type identifier]* )
9056 The old function would return incorrectly a OPEN_PARENS_LAMBDA for
9059 (canEmpty ? i >= 0 : i > 0)
9061 2007-01-30 Raja R Harinath <rharinath@novell.com>
9063 * cs-tokenizer.cs (parse_namespace_or_typename): Don't throw an
9064 exception on possibly valid code.
9066 2007-01-29 Raja R Harinath <rharinath@novell.com>
9068 * cs-tokenizer.cs (is_punct) ['<']: Update to changes in
9070 (parse_opt_type_arguments): Remove. It's almost the same as
9072 (parse_namespace_or_typename): Use parse_less_than.
9074 2007-01-28 Miguel de Icaza <miguel@novell.com>
9076 * cs-tokenizer.cs: Typo fix, its not GMCS_SOURCES but GMCS_SOURCE,
9077 this bug took a few hours to find, because the state saved and
9078 restored by PushPosition and PopPosition was ignoring the state of
9079 parse_generic_less_than.
9081 I can also now remove the handling of OP_LT and OP_GT, this solves
9084 * cs-tokenizer.cs: store the location for the ARROW token, we use
9087 (PushPosition, PopPosition): save/restore also `current_token',
9088 restore `parse_generic_less_than' (was missing).
9090 (parse_opt_type_arguments): use parse_type, not
9091 parse_namespace_or_typename to parse types.
9093 * lambda.cs: Empty new file, will eventually have the lambda
9094 expression implementation.
9096 * lambda.test: used to test the internal tokenizer.
9098 * report.cs (FeatureIsNotISO1): Rename from
9099 FeatureIsNotStandardized, because it was about the language level
9100 (1 vs 2) it was not about standarization.
9102 (FeatureRequiresLINQ): New.
9104 * support.cs (SeekableStreamReader): Only require that the reader
9105 is a TextReader, not a StreamReader, so we can plug StringReader.
9107 * cs-tokenizer.cs (parse_type_and_parameter): Returns true if at a
9108 given position in the input stream the following tokens can be
9109 parsed as a type followed by an identifier.
9111 (is_punct): after a '(' if parse_type_and_parameter returns true,
9112 then return a special token OPEN_PARENS_LAMBDA which is used to
9113 avoid reduce/reduce errors in the grammar for the
9114 lambda_expression rules.
9116 (parse_type): implement a type parser inside the
9117 tokenizer, the parser only returns true or false depending on
9118 whether the input at a given position can be parsed as a type.
9120 (peek_token): new method used during type parsing.
9122 2007-01-28 Raja R Harinath <rharinath@novell.com>
9125 * anonymous.cs (ScopeInfo.InflateParameters): New.
9126 (AnonymousContainer.Resolve): Use it to redirect types of
9127 delegate parameters.
9129 2007-01-27 Raja R Harinath <rharinath@novell.com>
9132 * expression.cs (Error_InvalidArguments): Don't use two different
9133 messages for CS1503. Use ExtraInformation and
9134 SymbolRelatedToPreviousError instead.
9137 * decl.cs (DeclSpace.initialize_type_params): Don't access
9138 'type_params' of a partial class directly.
9140 2007-01-26 Miguel de Icaza <miguel@novell.com>
9142 * constant.cs: Removed a handful of out-of-range checks that were
9145 2007-01-25 Marek Safar <marek.safar@gmail.com>
9147 * expression.cs (CheckUselessComparison): Add additional check for char
9150 * namespace.cs: Fixed typo.
9152 2007-01-23 Miguel de Icaza <miguel@novell.com>
9154 * constant.cs: Bloat removal, CheckRange and CheckUnsigned are
9155 gone, instead we inline the test, preventing the needless casts to
9156 longs, ulongs and doubles for the parameters, avoiding calls to
9157 methods that overchecked stuff, and instead inlined things
9160 2007-01-20 Marek Safar <marek.safar@gmail.com>
9162 * cs-parser.jay: Better parameter error handling.
9164 2007-01-17 Marek Safar <marek.safar@gmail.com>
9166 A fix for bug #80368, #80522
9167 * expression.cs (ArrayCreation.only_constant_initializers): Indicates
9168 whether array initializer contains constants only.
9169 (ArrayCreation.Emit): Use better formula to decide when
9170 are array initializers for static initialization.
9171 (ArrayCreation.EmitDynamicInitializers): When the array is small enough we
9172 have to emit even constants otherwise they are pre-initialized.
9174 2007-01-17 Bill Holmes <bill.holmes@ansys.com>
9175 Raja R Harinath <rharinath@novell.com>
9177 Fix emit order of 'get' vs. 'set'.
9178 * support.cs (Accessors): New.
9179 * cs-parser.jay (accessor_declarations): Use it instead of 'Pair'.
9180 Note the order in which accessors are declared in the source.
9181 * class.cs (PropertyBase.DefineGet, PropertyBase.DefineSet): New.
9182 Refactored from Property.Define and Indexer.Define.
9183 (PropertyBase.DefineAccessors): New helper that calls the above in
9184 appropriate order as noted by the parser.
9185 (Property.Define, Indexer.Define): Update to changes.
9186 (PropertyBase.SetMethod.PropertyInfo): Don't return a null.
9188 2007-01-17 Raja R Harinath <rharinath@novell.com>
9190 Fix cs0029-6.cs and gcs0029-2.cs (regression)
9191 * ecore.cs (EmptyConstantCast.ConvertImplicitly): Check that
9192 there's an implicit conversion from the current type to the target
9193 type before converting the underlying constant.
9195 2007-01-16 Marek Safar <marek.safar@gmail.com>
9197 * const.cs (ResolveValue): Updated after constant conversion was made more
9200 * constant.cs (GetAttributableValue): constant to object conversion is
9201 used for attributes only.
9202 (IntConstant.ConvertImplicitly): Moved from convert to be used in all
9203 constant conversions.
9204 (LongConstant.ConvertImplicitly): Ditto.
9206 * convert.cs (ImplicitNumericConversion): Extracted constant bussiness.
9207 (ImplicitConversionStandard): Handle constant conversion as extra step.
9208 It solves the issue when constant conversion was called indirectly like
9209 inside array initializer and constant folding was skipped.
9211 * literal.cs (NullLiteral.ConvertImplicitly): Fixed an issue exposed by
9214 * statement.cs(ImplicitConversionStandard): Updated after constant
9215 conversion was made more generic.
9217 2007-01-16 Sergey P. Kondratyev <se@unicom.tomica.ru>
9219 * expression.cs (As.DoResolve): Use GenericConstraints instead of
9220 Constraints, solves the problem where the compiler incorrectly
9221 reported that a type parameter was not constrained to a class (Bug
9224 2007-01-14 Marek Habersack <grendello@gmail.com>
9226 * doc-bootstrap.cs: Fix a compilation problem in the bootstrap phase.
9228 2007-01-14 Marek Safar <marek.safar@gmail.com>
9230 A fix for bug #80368
9231 * assign.cs (FieldInitializer): New class implements field
9232 initializer statement.
9234 * attribute.cs: Update after FieldMember rename.
9236 * class.cs (PropertyBasedMember): New common class for property based
9238 (InterfaceMemberBase): New base class for all members which can be used as
9239 an interface members.
9240 (MethodCore): Moved really common code to InterfaceMemberBase.
9241 (Method.Define): Equal and GetHasCode detection is relevant for methods
9243 (MethodData.Define): Don't assume that public event implements an
9244 interface automatically.
9245 (MethodData.DefineMethodBuilder): Issue an error even if only extern
9247 (MemberBase): Moved all interface speficic code to InterfaceMemberBase.
9248 (FieldMember): Merged with FieldBase.
9249 (EventProperty.AEventPropertyAccessor): New specialization to check whether
9250 event extern modifier can be used.
9251 (EventField.EventFieldAccessor): Moved event field specific code here.
9252 (Event.AllowedModifiers): Even event can be extern.
9253 (Event.FindOutBaseMethod): New override specific to events.
9254 (Indexer.parameters): Reintroduce parameters because base class holds
9255 only properties common data.
9256 (Indexer.CheckForDuplications): Indexers are threated as methods so we
9257 need do extra parameters check.
9259 * const.cs: Update after FieldMember rename.
9261 * decl.cs (MemberCache.FindBaseEvent): New method.
9263 * doc.cs (GetMethodDocCommentName): Accept parameters as extra argument
9264 to reflect that indexer is now derived from PropertyBased.
9266 * ecore.cs (GetMemberType): Made public.
9267 (EventExpr.ResolveMemberAccess): Use right event cache and checks for
9270 * flowanalysis.cs, statement.cs: Update after FieldMember rename.
9272 * typemanager.cs (CSharpSignature): Correctly print event accessors.
9273 (RegisterEvent): Removed.
9274 (RegisterPrivateFieldOfEvent): Renamed to RegisterEventField.
9275 (GetPrivateFieldOfEvent): Renamed to GetEventField.
9277 2007-01-11 Raja R Harinath <rharinath@novell.com>
9280 * statement.cs (CollectionForeach.TryType): Prefer generic
9281 GetEnumerator over non-generic variant. Fix code to follow comments.
9283 2007-01-09 Raja R Harinath <rharinath@novell.com>
9286 * support.cs (ReflectionParameter): Don't use an invalid index on
9287 the generic parameter data.
9289 2007-01-08 Miguel de Icaza <miguel@novell.com>
9291 * driver.cs: Just add a tiny bit of infrastructure.
9293 2007-01-02 Marek Safar <marek.safar@gmail.com>
9295 * class.cs (VerifyMembers): Fixed an crash reported on mono mailing list
9296 where field type is struct from current assembly.
9298 * ecore.cs (EnumConstant.AsString): Report an enum member name whenever
9301 2007-01-02 Marek Safar <marek.safar@gmail.com>
9303 A fix for bug #80381
9304 * attribute.cs (AttributeTester.RegisterNonObsoleteType): Registers
9307 * namespace.cs (GlobalRootNamespace.LookupTypeReflection): Better error
9309 (Namespace.LookupType): Always use core types from corlib when speficied.
9311 * report.cs: A new warning.
9313 * rootcontext.cs (BootstrapCorlib_ResolveInterface,
9314 BootstrapCorlib_ResolveClass): Register type as non-obsolete type.
9315 (ResolveCore): Add missing System.Runtime.InteropServices._Attribute.
9317 * typemanager.cs (CoreLookupType): Register type as non-obsolete type.
9318 (InitCoreTypes): Set expression type of object_type and value_type
9319 immediately after lookup.
9321 2007-01-01 Miguel de Icaza <miguel@novell.com>
9323 * cs-tokenizer.cs: Accept Pc class characters (Connector
9324 Punctuation) as valid identifiers. Fixes #78259
9326 * expression.cs (Invocation.DoResolve): Moved the check for the
9327 use of `this' for doing method calls to the Invocation resolution
9328 step, after overload resolution has taken place instead of doing
9329 the check at the low-level `This.DoResolve' level.
9331 The `This.DoResolve'(appens before overload resolution, so it has
9332 no way of knowing if the method that will be called will be
9333 instace or static, triggering an erroneous report for cs0188 (Bug
9336 We now do the check for instance method invocations after we know
9337 what method will be called.
9339 (This.CheckThisUsage): Move the actual use of this structure
9340 checking into its own method and expose it.
9342 * Everywhere that called Error_ValueCannotBeConverted: pass a new
9345 Exceptions: Null.ConvertImplicitly,
9346 Constant.ImplicitConversionRequired as there are too many call
9347 sites for passing the ec.
9349 * ecore.cs (Expression.Error_ValueCannotBeConverted): Take an
9350 EmitContext, if the value is null, then we do not try to provide
9351 the extra information from the error (If a userdefined conversion
9352 exists, as UserDefinedConversion requires a non null-EmitContext).
9356 2006-12-30 Raja R Harinath <rharinath@novell.com>
9358 * flowanalysis.cs (MyBitVector): Document some invariants.
9359 (MyBitVector.Or, MyBitVector.And): Reimplement the optimizations
9360 introduced below, and add a couple of others,
9362 2006-12-30 Marek Safar <marek.safar@gmail.com>
9364 * attribute.cs (GetMethodObsoleteAttribute): Uses new
9365 GetPropertyFromAccessor and GetEventFromAccessor.
9367 * class.cs (MethodCore.CheckBase): A new warning when obsolete member
9368 overrides non-obsolete one.
9369 (Indexer.Define): Error message has been moved to the parser.
9371 * cs-parser.jay: Better syntax errors handling.
9373 * delegate.cs (NewDelegate.DoResolve): Issue less confusing error message
9374 when an invocation has no arguments.
9376 * ecore.cs: Removed not used caching.
9378 * expression.cs (IsSpecialMethodInvocation): Reuses TypeManager
9381 * report.cs: Add a new warning.
9383 * support.cs (ReflectionParameters): Implements Equals, GetHashCode.
9385 * typemanager.cs (enumeration_type): Removed.
9386 (CSharpSignature): Reuses IsSpecialMethod.
9387 (IsEqual): Hack for MS BCL.
9388 (GetPropertyFromAccessor): New method.
9389 (GetEventFromAccessor): New method.
9390 (IsSpecialMethod): Fixed to handle more cases.
9392 2006-12-30 Marek Safar <marek.safar@gmail.com>
9394 * cs-tokenizer.cs (PreProcessDefinition, handle_preprocessing_directive):
9395 Made white spaces array static.
9397 * ecore.cs (RemoveGenericArity): Optimized.
9399 * flowanalysis.cs (MyBitVector.Or, MyBitVector.And): Optimized (up to
9401 (MyBitVector.initialize_vector): Simplified.
9403 2006-12-22 Miguel de Icaza <miguel@novell.com>
9405 * ecore.cs: Am not entirely happy with this hack, but it seems to
9406 address the issue in 80257 (a small test case for
9409 I set the MethodGroupExpr.Type to an internal compiler type
9410 (itself in this case) to force the resolution to take place. Why
9411 it does not take place with a null is beyond me.
9413 2006-12-20 Marek Safar <marek.safar@gmail.com>
9415 A fix for bug #80288
9416 * expression.cs (ResolveOperator): Consider user defined conversion for
9417 logical and operator too.
9418 (EmitBranchable): Optimization for logical and when full constant folding
9419 could not be applied but one operand is constant.
9421 2006-12-19 Marek Safar <marek.safar@gmail.com>
9423 * class.cs (GetClassBases): Write 5 times every day, will never use
9424 FullName for error reporting.
9426 * decl.cs (AsAccessible, CheckAccessLevel): Always unpack arrays first.
9428 2006-12-19 Martin Baulig <martin@ximian.com>
9430 * statement.cs (LocalInfo.EmitSymbolInfo): New public method; emit
9431 the symbol file info here.
9433 2006-12-18 Marek Safar <marek.safar@gmail.com>
9435 * cs-tokenizer.cs (handle_preprocessing_directive): When previous section
9436 of `elseif' is taking then following sections are not taking.
9437 Fixes an issue reported on mono mailing list.
9439 2006-12-18 Marek Safar <marek.safar@gmail.com>
9441 A fix for bug #80300
9442 * cs-tokenizer.cs (PreProcessDefinition): Do no define/undefine when
9443 a caller is not taking.
9445 2006-12-18 Raja R Harinath <rharinath@novell.com>
9447 * anonymous.cs: Change several TypeContainer declarations to DeclSpace.
9448 (CompilerGeneratedClass): Use parent.PartialContainer unconditionally.
9449 (RootScopeInfo, AnonymousMethodMethod): Update to changes.
9450 * iterator.cs: Change several TypeContainer declarations to DeclSpace.
9451 * class.cs: Update to changes.
9453 2006-12-17 Marek Safar <marek.safar@gmail.com>
9455 A fix for bug #79934
9456 * anonymous.cs (CompilerGeneratedClass): Register class in a shared
9459 * class.cs (ResolveMembers): Register an iterator in current container and
9462 2006-12-16 Raja R Harinath <rharinath@novell.com>
9465 * expression.cs (VerifyArgumentsCompat): Allow zero arguments to
9466 satisfy a params annotated parameter.
9468 2006-12-16 Marek Safar <marek.safar@gmail.com>
9470 A fix for bug #77014
9471 * expression.cs (Invocation.BetterFunction): Fixed to cope with dynamic
9472 paramters correctly and not rely on hacks in Parameters class.
9473 (Invocation.IsParamsMethodApplicable): Changed to accept params parameter
9475 (Invocation.VerifyArgumentsCompat): Ditto.
9476 (Invocation.EmitArguments): Changed to correctly emit params arguments at
9479 * parameter.cs (HasParams): Don't assume that params is the last one.
9481 * support.cs (ReflectionParameters.ctor): Look for params attribute
9483 (ReflectionParameters.ParameterType): Removed hack when we returned last
9484 parameter for out of range parameters.
9485 (ParameterName, ParameterModifier): Ditto.
9487 2006-12-14 Marek Safar <marek.safar@gmail.com>
9489 A fix for bug #79987
9490 * decl.cs (DeclSpace.VerifyClsCompliance): External names cache is null
9491 when assembly is not CLS compliant but type is. I have no idea why is this
9494 * typemanager.cs (Reset): Invalidate AllClsTopLevelTypes cache.
9496 2006-12-13 Miguel de Icaza <miguel@novell.com>
9498 * class.cs (ConstructorInitializer.Resolve): Allow for ":this()"
9499 in struct constructors, they are basically no-ops.
9501 2006-12-12 Marek Safar <marek.safar@gmail.com>
9503 * cs-tokenizer.cs (Position): Save preprocessor status too.
9505 2006-12-12 Marek Safar <marek.safar@gmail.com>
9507 A fix for bug #77794
9508 * cs-tokenizer.cs (consume_identifier): Check for correct partial context.
9510 2006-12-12 Marek Safar <marek.safar@gmail.com>
9512 * cs-tokenizer.cs (get_cmd_arg): Support CR as the line terminator.
9514 (pp_expr): Report error for an invalid expression.
9515 (handle_preprocessing_directive): Simplified; add more error checking.
9517 2006-12-11 Marek Safar <marek.safar@gmail.com>
9519 A fix for bug #74939
9520 * cs-tokenizer.cs (is_punct): We cannot simply disable preprocessor
9521 directives handling.
9523 2006-12-10 Marek Safar <marek.safar@gmail.com>
9525 A fix for bugs #80093, and #75984
9526 * cs-tokenizer.cs (handle_preprocessing_directive): Fixed #if/#else/#endif
9527 logic, it seems to me as it worked before "by coincidence".
9528 (xtoken): Simplified to use reworked handle_preprocessing_directive.
9529 (cleanup): Enabled endif check.
9531 2006-12-09 Marek Safar <marek.safar@gmail.com>
9533 A fix for bug #80162
9534 * statement.cs (CollectionForeach.TryType): Generics and non-generics
9535 enumerators are never ambiguous.
9537 2006-12-08 Raja R Harinath <rharinath@novell.com>
9540 * cs-tokenizer.cs (parse_less_than): Recognize double-colons too.
9542 2006-12-06 Marek Safar <marek.safar@gmail.com>
9544 A fix for bug #80144
9545 * class.cs (EventProperty.Define): Explicit implementation means
9546 that an even is used.
9548 2006-12-06 Marek Safar <marek.safar@gmail.com>
9550 Fixes the operators implementation (part II)
9552 * cfold.cs (DoConstantNumericPromotions): Renamed to
9553 DoBinaryNumericPromotions and simplified.
9554 (BinaryFold): Couple of conversion fixes; simplified.
9556 * constant.cs, ecore.cs, literal.cs
9557 (ToType): Renamed to ConvertImplicitly.
9558 (Reduce): Renamed to ConvertExplicitly.
9560 * class.cs, convert.cs: Updated.
9562 * expression.cs: TryReduce doesn't throw an exception.
9564 2006-12-01 Marek Safar <marek.safar@gmail.com>
9566 A fix for bug #80108
9567 * ecore.cs (EventExpr.EmitAddOrRemove): Don't crash when right side is not
9570 2006-11-30 Marek Safar <marek.safar@gmail.com>
9572 Fixes unary operators implementation (part I)
9575 * cfold.cs (Error_CompileTimeOverflow): Made internal
9577 * const.cs (IConstant): Changed to use reference to constant and
9578 not constant itself.
9579 Updated IConstant implementations.
9581 * constant.cs (CreateConstant): New factory method.
9582 Updated IConstant implementation.
9584 * convert.cs (ImplicitStandardConversionExists): Uses compiler Equals.
9586 * ecore.cs: Updated to use CreateConstantReference.
9588 * enum.cs: Reflects IConstant changes.
9590 * expression.cs (Unary): Reimplemented +,-,~ to conform C# standard.
9592 * literal.cs (NullConstant): Change to be independently usable.
9594 2006-11-29 Martin Baulig <martin@ximian.com>
9596 * class.cs (Constructor.Emit): Correctly handle anonymous methods;
9597 we need to emit the scope initializer before calling the base .ctor.
9599 * anonymous.cs: Merged back from the new anonymous methods branch.
9600 (AnonymousMethodHost): Renamed to `RootScopeInfo'.
9602 * expression.cs (ParameterReference.DoResolveBase): Create a
9603 "normal" ScopeInfo when capturing parameters rather than using the
9604 root scope; this makes things work with anonymous methods having
9608 (ToplevelBlock.AnonymousMethodHost): Renamed into `RootScope'.
9610 2006-11-22 Marek Safar <marek.safar@gmail.com>
9612 A fix for bug #79987
9613 * class.cs (VerifyClsCompliance): Move redundant CLS compliance attribute
9614 check to a base class.
9615 * decl.cs (VerifyClsCompliance): Warn that CLS compliance cannot be tested
9616 only when assembly has missing attribute.
9617 * report.cs: Update.
9619 2006-11-21 Marek Safar <marek.safar@gmail.com>
9621 * cs-tokenizer.cs: Merged with gmcs version.
9623 2006-11-20 Marek Safar <marek.safar@gmail.com>
9626 * cs-parser.jay: Better error message when partial keyword is misplaced.
9628 2006-11-19 Gert Driesen <drieseng@users.sourceforge.net>
9630 A fix for bug #79810
9631 report.cs: CS1058 only applies to 2.0 profile (gmcs).
9632 codegen.cs: on 2.0 profile, non-exception throwables are wrapped in
9633 a RuntimeWrappedException by default.
9635 2006-11-18 Marek Safar <marek.safar@gmail.com>
9637 A fix for bug #79843
9638 * delegate.cs (Delegate.VerifyMethod): Fixed covariance and contravariance
9640 (DelegateCreation.Error_NoMatchingMethodForDelegate): Ditto.
9642 2006-11-18 Marek Safar <marek.safar@gmail.com>
9644 * driver.cs, namespace.cs: Uses faster IndexOf version.
9646 2006-11-17 Marek Safar <marek.safar@gmail.com>
9648 A fix for bug #79941
9649 * class.cs (MemberCore.IsDuplicateImplementation): Add more tricks for
9651 (Operator.Define): Implicit/Explicit operator of same type is duplicate
9652 even if internal name is different.
9653 * convert.cs (GetConversionOperator): Replaced EmitContext with parentType.
9654 (UserDefinedConversion): Simplified as the operators cannot be internal.
9655 * ecore.cs (Error_ValueCannotBeConverted): Take account of user
9657 (MethodLookup): Replaced EmitContext with parentType.
9658 * expression.cs: Updated.
9660 2006-11-09 Raja R Harinath <rharinath@novell.com>
9662 * driver.cs (BadAssembly): Handle all the ugliness of
9663 DefineDynamicAssembly.
9665 2006-11-08 Raja R Harinath <rharinath@novell.com>
9667 Address parts of #58244 -- most of what's left is in the runtime
9668 * driver.cs (LoadAssembly): Simplify slightly. Add CS0009 and
9669 CS1509 error checks, and handle them for all assembly loads, not
9670 just the first invocation.
9671 (LoadModule): Likewise. Move handling of 'adder_method' ...
9672 * codegen.cs (AssemblyClass.AddModule): ... here.
9674 2006-11-02 Marek Safar <marek.safar@gmail.com>
9676 * statement.cs.cs (CollectionForeach.TryType): Issue a error when
9677 IEnumerable<T> is ambiguous.
9679 2006-10-31 Marek Safar <marek.safar@gmail.com>
9681 A fix for bug #67689
9682 * statement.cs.cs (CollectionForeach.TryType): Issue a warning when
9683 GetEnumerator is ambiguous.
9685 * report.cs: Add new warning.
9687 2006-10-29 Marek Safar <marek.safar@gmail.com>
9689 A fix for bug #78602
9690 ecore.cs (PropertyExpr.InstanceResolve): The qualifier for access
9691 to protected member can be nested type.
9693 2006-10-28 Marek Safar <marek.safar@gmail.com>
9695 A fix for bug #78965
9696 ecore.cs (PropertyExpr.InstanceResolve): The qualifier for access
9697 to protected member must derive from current type.
9699 2006-10-27 Marek Safar <marek.safar@gmail.com>
9701 assign.cs: Reuses error method.
9703 ecore.cs (Expression.Error_ValueCannotBeConverted): Report a value
9704 instead of type for constants.
9705 (Expression.Error_ValueAssignment): Common error method.
9707 * expression.cs (UnaryMutator.ResolveOperator): Value cannot be used
9710 2006-10-27 Marek Safar <marek.safar@gmail.com>
9712 A fix for bug #79081
9713 * expression.cs (MemberAccess.DoResolve): Check nested type
9716 2006-10-27 Atsushi Enomoto <atsushi@ximian.com>
9718 * doc.cs : nested delegates were not handled. Fixed bug #79754.
9720 2006-10-26 Marek Safar <marek.safar@gmail.com>
9722 A fix for bug #76591
9723 * cs-tokenizer.cs (IsCastToken): Enable a cast of anonymous method.
9725 2006-10-26 Marek Safar <marek.safar@gmail.com>
9727 * codegen.cs (AssemblyClass.ApplyAttributeBuilder): Don't allow to have
9728 type forwarder of the same type multiple times.
9730 2006-10-26 Raja R Harinath <rharinath@novell.com>
9733 * ecore.cs (PropertyExpr.InstanceResolve): Always resolve the
9734 instance as an rvalue, even when we later resolve as an lvalue.
9736 2006-10-25 Martin Baulig <martin@ximian.com>
9738 * anonymous.cs: Fix #79673.
9740 2006-10-24 Marek Safar <marek.safar@seznam.cz>
9742 A fix for bug #79666
9743 expression.cs (ArrayCreation.GetAttributableValue): An initializer can be
9744 ignored when is optimized (= default value) as its value is already set.
9746 2006-10-23 Marek Safar <marek.safar@seznam.cz>
9748 A fix for bug #79724
9749 * report.cs (SymbolRelatedToPreviousError): Uses DeclSpace instead of
9750 TypeContainer for type lookup.
9752 2006-10-23 Marek Safar <marek.safar@seznam.cz>
9754 A fix for bug #79231
9755 * ecore.cs (ResolveAsBaseTerminal): Removed redundant error test.
9756 * expression.cs (OverloadResolve): Always convert type name for
9758 (ResolveNamespaceOrType): Don't confuse a nested type with any
9761 2006-10-18 Martin Baulig <martin@ximian.com>
9763 * anonymous.cs: Propagate the IsStatic state, fixes the crasher in banshee.
9765 2006-10-17 Miguel de Icaza <miguel@novell.com>
9767 * convert.cs: Fix typo, fixes the test-535.cs, we were casting to
9768 an int32, but requesting an int64 from the conversion
9770 2006-10-12 Martin Baulig <martin@ximian.com>
9773 (AnonymousContainer.Resolve): Inflate the `ReturnType'. Fixes #79592.
9775 2006-10-12 Martin Baulig <martin@ximian.com>
9778 (Using.EmitLocalVariableDeclFinally): Small fix for iterators.
9780 2006-10-11 Miguel de Icaza <miguel@novell.com>
9782 * convert.cs: Remove broken code: I was doing the "Existance"
9783 tests for Implicit conversions.
9785 2006-10-10 Miguel de Icaza <miguel@novell.com>
9787 * convert.cs: Added one missing case in
9788 ImplicitStandardConversionExists uint64 to intptr.
9792 * typemanager.cs (uintptr_type): another core known type.
9794 * ecore.cs (OperatorCast): routine used to do cast operations that
9795 depend on op_Explicit. We could change some of the Decimal
9796 conversions to use this.
9798 This one has a probe mechanism that checks both types for an op_
9799 which it coudl be used to eliminate two classes: CastToDecimal
9800 and CastFromDecimal.
9802 * convert.cs: Implement the conversions documented in #59800
9804 2006-10-10 Martin Baulig <martin@ximian.com>
9806 * iterators.cs (Iterator.Resolve): Call RootScope.ResolveType()
9807 before RootScope.ResolveMembers().
9809 * anonymous.cs (ScopeInfo.CapturedScope.ctor): Use the child's
9810 `CurrentType' if appropriate.
9812 2006-10-09 Marek Safar <marek.safar@seznam.cz>
9814 A fix for bug #78568
9815 * cs-tokenizer.cs (Deambiguate_CloseParens): Expression cannot be cast
9816 when contains binary operators.
9817 * cs-parser.jay: Updated.
9819 2006-10-09 Martin Baulig <martin@ximian.com>
9822 (Delegate.DefineType): Don't call TypeParameter.Resolve() here;
9823 moved that into Define() and also do the other type parameter
9824 checks there. Fixes #79094. Added gtest-292.cs.
9827 (ArrayCreation.EmitDynamicInitializers): Use `etype.IsValueType'
9828 since that doesn't include type parameters; don't use `Ldelema'
9829 for type parameters. Fixes #78980. Added gtest-293.cs.
9831 2006-10-08 Marek Safar <marek.safar@seznam.cz>
9834 * convert.cs (ExplicitReferenceConversion): Only enum to enum value
9835 conversion is allowed.
9837 2006-10-06 Marek Safar <marek.safar@seznam.cz>
9839 * ecore.cs (Expression.MemberLookup): Don't register any symbol for
9840 error reporting when no error occurs.
9842 2006-10-06 Marek Safar <marek.safar@seznam.cz>
9844 * cfold.cs (ConstantFold.BinaryFold): Report an error when the conversion
9847 2006-10-06 Raja R Harinath <rharinath@novell.com>
9850 * class.cs (DefineTypeBuilder): Check circular dependencies before
9851 setting the parent of the TypeBuilder.
9852 (CheckRecursiveDefinition): Don't use 'BaseType', since
9853 it may not be valid until after DefineTypeBuilder. Use
9854 'base_type' instead.
9856 2006-10-04 Martin Baulig <martin@ximian.com>
9858 Merged the Anonymous Methods patch.
9860 * anonymous.cs, iterators.cs: The new anonymous methods code.
9862 * statement.cs (Variable): New public abstract class.
9863 (LocalInfo.Variable): New public property.
9864 (LocalInfo.ResolveVariable): New public method.
9865 (Block.Flags): Add `IsIterator'.
9866 (Block.AddVariable): Improved the CS0136 check.
9867 (Block.AnonymousChildren): New public property.
9868 (Block.AddAnonymousChild): New public method.
9869 (ToplevelBlock): Update to use the new anonymous method framework.
9870 (ToplevelBlock.ctor): `container' is now a `Block' and not a
9871 `ToplevelBlock'; this is required to correctly implement the
9873 (Fixed, Using): Use `TemporaryVariable' instead of directly
9874 creating the `LocalBuilder'.
9876 * parameter.cs (Parameter.ResolveVariable): New public method.
9877 (Parameters.ResolveVariable): Likewise.
9879 * ecore.cs (TemporaryVariable): Use the new `Variable' framework.
9881 * class.cs (TypeContainer): Replaced the `iterators' list and
9882 corresponding methods with a list of `CompilerGeneratedClass'es.
9883 (TypeContainer.ResolveMembers): New public method.
9884 (Method): `IIteratorContainer' has been replaced by
9887 * expression.cs (VariableReference): New public abstract base
9888 class for `LocalVariableReference', `ParameterReference' and
9891 * codegen.cs (EmitContext): Removed `capture_context',
9892 `HaveCaptureInfo', `EmitScopeInitFromBlock()' and `Capture*()'.
9893 (EmitContext.EmitThis): Removed.
9895 * cs-parser.jay: Replace `iterator_container' with
9898 2006-10-04 Martin Baulig <martin@ximian.com>
9900 * generic.cs (GenericMethod): Don't make this abstract.
9901 (Constraints.Clone): Added dummy implementation.
9903 2006-10-04 Raja R Harinath <harinath@gmail.com>
9906 * namespace.cs (LookForAnyGenericType): Avoid nullref on
9907 'declspaces'. Avoid allocating arrays willy-nilly.
9910 * cfold.cs (BinaryFold): Move boolean Equality and Inequality
9911 cases out of the switch.
9913 2006-09-28 Marek Safar <marek.safar@seznam.cz>
9915 * namespace.cs (Namespace.Error_NamespaceDoesNotExist): Better error
9916 message when non-generic type is used with the type arguments.
9917 * expression.cs: Updated.
9919 2006-09-28 Raja R Harinath <rharinath@novell.com>
9922 * convert.cs (Convert.ImplicitStandardConversionExists): Avoid infloop.
9923 * expression.cs (EmptyExpression.Grab, EmptyExpression.Release):
9924 Change semantics slightly. Don't insist on having only one
9925 temporary EmptyExpression -- just throttle the creation of new ones.
9928 * ecore.cs (Expression.MemberLookup): Enable CS0229 errors for
9929 non-interfaces too. If no methods are found, don't try to create
9932 2006-09-28 Marek Safar <marek.safar@seznam.cz>
9934 * ecore.cs (ResolveAsTypeStep): Print better error when type can be
9937 * namespace.cs (Namespace.LookForAnyGenericType): New method to help
9938 us produce better error message.
9940 2006-09-27 Marek Safar <marek.safar@seznam.cz>
9942 * expression.cs (Binary.ResolveOperator): Warn about a side effect
9943 of the `|' operator.
9945 * report.cs: A new warning added.
9947 2006-09-27 Martin Baulig <martin@ximian.com>
9949 * generic.cs (GenericMethod): Don't make this abstract.
9951 2006-09-27 Martin Baulig <martin@ximian.com>
9954 (InternalErrorException): Added overloaded ctor taking a params array.
9956 2006-09-26 Marek Safar <marek.safar@seznam.cz>
9958 * class.cs, codegen.cs, const.cs, cs-tokenizer.cs, driver.cs, ecore.cs:
9959 Fixed the cases when same error was reported twice.
9961 * report.cs (SymbolRelatedToPreviousError): Simplified as all our messages
9962 now report symbol information.
9964 2006-09-25 Martin Baulig <martin@ximian.com>
9966 * class.cs: Completely unified with the gmcs version.
9968 2006-09-25 Martin Baulig <martin@ximian.com>
9970 * typemanager.cs (TypeManager.IsNullableType): New public function.
9971 (TypeManager.IsNullableTypeOf): Likewise.
9972 (TypeManager.IsNullableValueType): Likewise.
9974 * class.cs (MethodCore): Added the `GenericMethod' argument from
9975 gmcs and also unified all classes derived from `MethodCore' with gmcs.
9977 2006-09-24 Raja R Harinath <harinath@gmail.com>
9979 * convert.cs: Unify with gmcs version.
9981 2006-09-24 Marek Safar <marek.safar@seznam.cz>
9983 * decl.cs (DeclSpace.VerifyClsCompliance): When type has type parameters
9984 verify them as well.
9986 * report.cs: New warning.
9988 2006-09-24 Marek Safar <marek.safar@seznam.cz>
9990 * anonymous.cs (AnonymousMethod.Compatible): Cannot generate arguments
9991 for anonymous block with out argument.
9993 2006-09-24 Marek Safar <marek.safar@seznam.cz>
9995 * class.cs (ClassOrStruct.VerifyMembers): Fixed to report correctly
9996 not used private events only.
9998 2006-09-23 Marek Safar <marek.safar@seznam.cz>
10000 * cfold.cs (BinaryFold): On the guest to unify empty constant cast.
10002 * const.cs (Const.Define): Check for constant type.
10003 (Const.IsConstantTypeValid): Looks for valid constant types.
10005 * convert.cs (ImplicitReferenceConversion): NullCast to EmptyConstantCast.
10007 * ecore.cs (EmptyConstantCast): New common class for all constant based
10010 * expression.cs (Is.DoResolve): Handle null constant especially.
10011 (New.DoResolve): Check for new void().
10012 (MemberAccess.DoResolve): Cope with all kind of nulls.
10014 * literal.cs (NullConstant): Uses EmptyConstantCast.
10015 (NullDefault): Based on EmptyConstantCast.
10016 (NullLiteral): Uses EmptyConstantCast.
10018 * statement.cs (Block.ResolveMeta): Check for constant type.
10020 2006-09-22 Martin Baulig <martin@ximian.com>
10022 * delegate.cs, attribute.cs: Merged with the gmcs versions.
10024 2006-09-22 Raja R Harinath <rharinath@novell.com>
10026 * literal.cs (NullDefault): The type of default(IFoo) is 'IFoo',
10030 * typemanager.cs (Closure.Filter): Consider PrivateScope attributes.
10031 * decl.cs (DeclSpace.FindMemberToOverride): Likewise. Reorganize
10034 2006-09-22 Martin Baulig <martin@ximian.com>
10036 * ecore.cs: Merged with the gmcs version.
10038 * generic.cs (ConstructedType): New dummy class.
10039 (TypeArguments): Don't make this abstract.
10042 (TypeManager.IsGenericTypeDefinition): New method.
10043 (TypeManager.GetGenericFieldDefinition): Moved here from gmcs.
10045 2006-09-22 Raja R Harinath <rharinath@novell.com>
10047 * expression.cs (ComposedCast): Check for arrays of TypedReference
10048 before creating the type, not after.
10050 2006-09-21 Marek Safar <marek.safar@seznam.cz>
10052 * cfold.cs, const.cs, enum.cs, statement.cs: Updated
10053 after ToType change.
10055 * constant.cs (Constant.ImplicitConversionRequired): Designed to used
10056 when constant must be implicitly convertible.
10058 * convert.cs (ImplicitReferenceConversion): Reuse ToType.
10060 * ecore.cs (NullCast): Derives from NullConstant.
10062 * expression.cs (Is.DoResolve): Removed useless variables.
10063 (Conditional.DoResolve): Quick hack for `Foo () ? null : null'.
10064 (New.Constantify): Add enum support.
10065 (MemberAccess.DoResolve): Add warning when accessing null constant or
10068 * generic.cs (GenericConstraints.IsReferenceType): Another dummy
10071 * literal.cs (NullConstant): New abstract class with common
10072 functionality for all null specializations.
10073 (NullDefault): Represents default(X) when result can be
10075 (NullLiteral): Updated.
10077 * report.cs: Add new warning.
10079 2006-09-21 Martin Baulig <martin@ximian.com>
10081 * generic.cs (GenericTypeParameterBuilder): Removed this ugly hack.
10083 2006-09-21 Martin Baulig <martin@ximian.com>
10085 * generic.cs (GenericConstraints): New dummy class.
10086 (Constraints): Likewise.
10087 (TypeParameter): Likewise.
10088 (TypeParameterName): Likewise.
10089 (GenericMethod): Likewise.
10091 * typemanager.cs (TypeManager.GetGenericArguments): New method.
10093 * decl.cs: Merged with the gmcs version.
10095 2006-09-21 Raja R Harinath <rharinath@novell.com>
10097 * generic.cs (TypeParameter): Implement IMemberContainer.
10098 (GenericTypeParameterBuilder): New. An abominable repugnant hack.
10100 * rootcontext.cs: Unify with gmcs version.
10102 * report.cs: Unify with gmcs version.
10103 * typemanager.cs (AddTypeParameter, LookupTypeParameter): Move
10104 from gmcs/generics.cs.
10105 * generics.cs (TypeParameter): New dummy class.
10107 * support.cs: Unify with gmcs version.
10109 2006-09-20 Raja R Harinath <rharinath@novell.com>
10111 * ecore.cs (MethodGroupExpr.ResolveGeneric): New dummy method.
10112 * expression.cs (MemberAccess, BaseAccess): Remove GMCS_SOURCE #ifdef.
10114 * decl.cs (MemberName): Unify with gmcs, except for GetTypeExpression.
10115 * generic.cs (TypeArguments): New dummy class to help avoid #ifdefs.
10116 * mcs.exe.sources: Add generic.cs.
10118 * codegen.cs: Unify with gmcs version.
10120 * codegen.cs (IResolveContent.GenericDeclContainer): Copy from gmcs.
10121 (EmitContext): Add GenericDeclContainer implementation.
10122 * decl.cs (MemberCore, DeclSpace): Likewise.
10123 * namespace.cs: Remove #ifdef GMCS_SOURCE.
10125 * namespace.cs (GetTypeInAssembly): Remove #ifdef GMCS_SOURCE.
10126 MCS TypeManager has a corresponding dummy method.
10128 2006-09-19 Martin Baulig <martin@ximian.com>
10130 * expression.cs: Completely merged with the gmcs version.
10132 2006-09-19 Martin Baulig <martin@ximian.com>
10134 * expression.cs (Invocation): Merged with the gmcs version.
10135 (ArrayAccess.GetStoreOpcode): Likewise.
10137 2006-09-19 Martin Baulig <martin@ximian.com>
10140 (TypeManager.IsGenericMethod): Moved here from ../gmcs/generic.cs.
10141 (TypeManager.IsGenericMethodDefinition): Likewise.
10143 2006-09-19 Martin Baulig <martin@ximian.com>
10146 (TypeManager.IsEqual): Moved the gmcs implementation here.
10147 (TypeManager.DropGenericTypeArguments): Likewise.
10148 (TypeManager.DropGenericMethodArguments): Likewise.
10149 (TypeManager.GetTypeArguments): Moved here from gmcs.
10150 (TypeManager.HasGenericArguments): Likewise.
10152 2006-09-19 Martin Baulig <martin@ximian.com>
10154 * expression.cs (Binary): Merged with the gmcs version.
10156 2006-09-19 Martin Baulig <martin@ximian.com>
10158 * expression.cs (Probe, As, Is): Merged with the gmcs version.
10160 2006-09-19 Martin Baulig <martin@ximian.com>
10162 * typemanager.cs: Merged with the gmcs version.
10164 2006-09-16 Raja R Harinath <rharinath@novell.com>
10166 * AssemblyInfo.cs [GMCS_SOURCE]: Unify with gmcs source.
10167 * driver.cs: Likewise.
10169 2006-09-16 Marek Safar <marek.safar@seznam.cz>
10172 * class.cs (MethodCore.VerifyClsCompliance): Do check for abstract members
10173 only if parent type is class.
10174 * decl.cs (MemberCore.GetClsCompliantAttributeValue): Fixed missing cache
10177 2006-09-15 Marek Safar <marek.safar@seznam.cz>
10180 * expression.cs(MemberAccess.DoResolve): Don't crash when not allowed
10182 * typemanager.cs(CSharpName): Converts NullType to null.
10184 2006-09-15 Martin Baulig <martin@ximian.com>
10187 (TypeManager.GetMethodName): Added mcs implementation.
10188 (TypeManager.IsEqual): Likewise.
10191 (SimpleName.RemoveGenericArity): Added dummy implementation.
10193 * pending.cs: Merged with the gmcs version.
10195 2006-09-15 Martin Baulig <martin@ximian.com>
10197 * statement.cs: Merge with the gmcs version.
10199 2006-09-15 Martin Baulig <martin@ximian.com>
10201 * statement.cs (Switch): Merge with the gmcs implementation
10202 (without nullables), which is newer.
10204 2006-09-15 Martin Baulig <martin@ximian.com>
10206 * statement.cs (Block.Variables): Make this public.
10207 (ToplevelBlock.Parameters): Make this a property.
10208 (Throw.Resolve): Use `TypeManager.IsSubclassOf ()'.
10210 2006-09-15 Martin Baulig <martin@ximian.com>
10212 * namespace.cs: Merge with the gmcs version.
10214 2006-09-15 Martin Baulig <martin@ximian.com>
10216 * decl.cs (MemberName): Minor code cleanups.
10218 2006-09-15 Martin Baulig <martin@ximian.com>
10220 * parameter.cs: Merge with the gmcs version.
10222 2006-09-15 Martin Baulig <martin@ximian.com>
10224 * enum.cs: Merge with the gmcs version: 3005 is a warning in gmcs
10225 and an error in mcs.
10227 2006-09-15 Martin Baulig <martin@ximian.com>
10229 * flowanalysis.cs: Merged from GMCS; added the generics code into
10230 a `GMCS_SOURCE' conditional so we can share this file.
10232 2006-09-08 Martin Baulig <martin@ximian.com>
10234 * typemanager.cs (TypeManager.interlocked_type): New public field.
10235 (TypeManager.int_interlocked_compare-exchange): New public field.
10236 (TypeManager.InitEnumUnderlyingTypes): Also initialize the
10237 enumerator types here and call InitGenericCoreTypes().
10238 (TypeManager.InitCoreTypes): Call InitEnumeratorTypes() right
10239 after calling InitEnumUnderlyingTypes().
10242 (RootContext.ResolveCore): Added `System.Threading.Interlocked' to
10243 `classes_second_stage'.
10245 2006-09-14 Marek Safar <marek.safar@seznam.cz>
10247 * assign.cs, ecore.cs, expression.cs: Share error message text.
10248 * class.cs (FieldMember.Define): Check for varible of static type.
10249 * driver.cs (LoadAssembly): Uses error output for errors.
10250 * statement.cs: Updated.
10252 2006-09-08 Marek Safar <marek.safar@seznam.cz>
10254 * expression.cs (Error_OperatorCannotBeApplied): Report type instead of
10257 2006-09-07 Martin Baulig <martin@ximian.com>
10260 (MainDriver): Revert r62663 from Marek; see #70506 for details.
10262 2006-08-29 Miguel de Icaza <miguel@novell.com>
10264 * cs-parser.jay: Turn 1522 into a warning, instead of an error #79210
10266 2006-08-17 Miguel de Icaza <miguel@novell.com>
10268 * cs-tokenizer.cs: Apply patch from Atsushi Enomoto that fixes
10269 #52019 and #79064, the use of the \uXXXX sequence in source code
10270 to represent unicode characters.
10272 2006-08-15 Marek Safar <marek.safar@seznam.cz>
10274 * expression.cs (SizeOf.DoResolve): Check for void type. Fixed enum types
10276 * class.cs, ecore.cs, statement.cs: Merged to one error message.
10278 2006-08-13 Miguel de Icaza <miguel@novell.com>
10280 * assign.cs: Catch attempts to assign to a method groups in += and
10283 2006-08-13 Marek Safar <marek.safar@seznam.cz>
10286 * cs-parser.jay: Don't destroy current array type by typeof of array's.
10288 2006-08-12 Marek Safar <marek.safar@seznam.cz>
10290 * class.cs (Method.Define): Issue a warning when generic method looks like
10292 * decl.cs (MemberCore.GetSignatureForError): Print member type arguments
10295 2006-08-09 Marek Safar <marek.safar@seznam.cz>
10297 * anonymous.cs(AnonymousDelegate.Emit): Uses Constructor filter when
10299 * decl.cs (MemberCache.FindMembers): When container is interface we need to
10300 search all base interfaces as a member can be ambiguous.
10301 * delegate.cs (Delegate.FindMembers): Fixed to return valid data for
10302 Constructor member type filter.
10303 (Delegate.ResolveConstructorMethod) Uses Constructor filter.
10304 * ecore.cs: (Expression.MemberLookup): Implemented ambiguity error/warning
10305 reporting for returned memberinfos.
10306 * report.cs: Updated.
10307 * typemanager.cs (TypeManager.LookupBaseInterfacesCache): Uses TypeManager
10308 version to work on all runtimes.
10309 (TypeManager.RealMemberLookup): Removed members filtering.
10311 2006-08-08 Raja R Harinath <rharinath@novell.com>
10313 * ecore.cs (FieldExpr.EmitAssign): Release temporary.
10314 (PropertyExpr.EmitAssign): Likewise.
10315 * expression.cs (Indirection.EmitAssign): Likewise.
10316 (LocalVariableReference.EmitAssign): Likewise.
10317 (ParameterReference.EmitAssign): Likewise.
10318 (Invocation.EmitArguments): Likewise.
10319 (ArrayAccess.EmitAssign): Likewise.
10320 (IndexerAccess.EmitAssign): Likewise.
10321 (This.EmitAssign): Likewise.
10322 (ConditionalLogicalOperator.Emit): Likewise.
10325 * codegen.cs (EmitContext.GetTemporaryLocal): Simplify. Use Stack
10326 instead of ArrayList. If the hashtable has a LocalBuilder, don't
10327 leave it in after returning it.
10328 (EmitContext.FreeTemporaryLocal): Simplify. Update to changes.
10330 2006-08-06 Marek Safar <marek.safar@seznam.cz>
10332 * expresssion.cs (IndexerAccess.DoResolve): Fixed to report correct error
10335 2006-08-03 Raja R Harinath <rharinath@novell.com>
10337 Fix cs0146-3.cs and cs0146-4.cs.
10338 * class.cs (TypeManager.CheckRecursiveDefinition): Check that
10339 enclosing types don't depend on the current type.
10341 2006-08-02 Raja R Harinath <rharinath@novell.com>
10344 * class.cs (TypeContainer.DoDefineMembers): Use
10345 FindBaseMemberWithSameName on Parent, since we're interested in
10346 whether we hide inherited members or not.
10347 (FindBaseMemberWithSameName): Make slightly more robust.
10349 Fix the non-generic testcase from #77396
10350 * decl.cs (DeclSpace.DeclContainer): Remove override.
10352 * namespace.cs (NamespaceEntry.Doppelganger): Create slave
10353 declspaces for doppelgangers too.
10354 (UsingEntry): Implement IResolveContext.
10355 (UsingEntry.Resolve): Don't set ToplevelTypes.Namespace. Use
10356 'this' as the resolve context.
10357 (LocalAliasEntry): Likewise.
10359 Implement parts of #77403
10360 * roottypes.cs (RootDeclSpace): New. Used to represent the
10361 toplevel declaration space. Each namespace declaration introduces
10362 a "partial" root declaretion space.
10363 * namespace.cs (NamespaceEntry.SlaveDeclSpace): New.
10364 (NamespaceEntry.ctor): Create a SlaveDeclSpace if necessary.
10365 * cs-parser.jay (CSharpParser.ctor): Initialize 'current_class'
10366 from 'current_namespace.SlaveDeclSpace'.
10367 (namespace_declaration): Likewise.
10368 * class.cs (TypeContainer.ctor): Remove parent==ToplevelTypes
10369 check. It can't happen now.
10370 * decl.cs (DeclSpace.LookupType): Likewise.
10371 * driver.cs (MainDriver): Sanity check.
10373 2006-08-01 Raja R Harinath <rharinath@novell.com>
10375 * decl.cs (DeclSpace.FindNestedType): Remove.
10376 (DeclSpace.LookupNestedTypeINHierarchy): Use PartialContainer and
10377 LookupTypeContainer to get the container of the nested type.
10378 * class.cs (TypeContainer.FindNestedType): Make non-override.
10380 2006-07-31 Raja R Harinath <rharinath@novell.com>
10382 * decl.cs (DeclSpace.PartialContainer): Move field from ...
10383 * class.cs (TypeContainer.PartialContainer): ... here.
10384 (TypeContainer.AddBasesForPart): New helper.
10385 (MemberBase.ParentContainer): Remove. Use Parent.PartialContainer
10387 * cs-parser.jay (current_class): Convert to DeclSpace.
10388 (struct_declaration, interface_declaration, class_declaration):
10389 Use AddBasesForPart instead of .Bases directly.
10390 * const.cs, iterators.cs: Update to changes.
10392 2006-07-28 Raja R Harinath <rharinath@novell.com>
10394 * class.cs (TypeContainer.AddMemberType): Rename from
10395 AddToTypeContainer.
10396 (TypeContainer.AddMember): Rename from AddToMemberContainer.
10397 (AddTypeContainer): New. Combine AddClassOrStruct and
10399 (AddPartial): Update. Add 'is_partial' argument.
10400 * roottypes.cs: Update to changes.
10401 * cs-parser.jay (push_current_class): New helper for handling
10402 current_container and current_class.
10403 (struct_declaration, interface_declaration, class_declaration):
10406 2006-07-26 Raja R Harinath <rharinath@novell.com>
10408 * roottypes.cs: Rename from tree.cs.
10410 Rename RootContext.Tree.Types to RootContext.ToplevelTypes.
10411 * tree.cs (Tree, ITreeDump): Remove types.
10412 * rootcontext.cs (tree, Tree): Remove fields.
10413 (root, ToplevelTypes): New.
10414 * *.cs: Update to rename.
10416 * tree.cs (Tree.RecordDecl): Remove.
10417 (RootTypes.AddToTypeContainer): Record the toplevel type in its
10419 * class.cs, cs-parser.jay: Remove mention of RecordDecl.
10421 2006-07-23 Raja R Harinath <harinath@gmail.com>
10423 * codegen.cs (EmitContext.Flags): Move InCatch, InFinally,
10424 DoFlowAnalysis and OmitStructFlowAnalysis here.
10425 (ec.With): Rename from WithUnsafe and generalize.
10426 (ec.WithCheckState): Remove. All users can be handled by 'With'.
10427 (ec.WithFlowAnalyis): New.
10428 * ecore.cs, expression.cs, statement.cs: Update.
10430 2006-07-22 Raja R Harinath <harinath@gmail.com>
10432 * statement.cs (Block.ResolveMeta): Simplify slightly.
10434 * codegen.cs (EmitContext.Flags): New enum. Used to represent the
10435 multiple boolean fields. Convert InUnsafe, constant_check_state,
10436 check_state to flags.
10437 (CheckState, ConstantCheckState): Update.
10438 (InUnsafe): New read-only property.
10439 (FlagsHandle): Rename from CheckStateHandle and convert to handle
10441 (WithUnsafe): New helper similar to WithCheckState.
10442 * statement.cs (Block.ResolveMeta): Use WithUnsafe.
10443 (Unsafe.Resolve, Unsafe.DoEmit): Likewise.
10445 2006-07-21 Raja R Harinath <rharinath@novell.com>
10447 Make comparisons use the same IL irrespective of whether they're
10448 in a 'checked' or 'unchecked' context: one of the issues in #78899
10449 * codegen.cs (EmitContext.CheckState): Make read-only property.
10450 (EmitContext.ConstantCheckState): Likewise.
10451 (EmitContext.CheckStateHandle, EmitContext.WithCheckState): New
10452 helper that implement a save/restore stack for CheckState
10453 values. This is the only way to change check-state.
10454 * ecore.cs (Expression.ExpressionToArrayArgument): Use WithCheckState.
10455 * expression.cs (CheckedExpr.DoResolve, CheckedExpr.Emit): Likewise.
10456 (CheckedExpr.EmitBranchable): New forwarding method.
10457 (UnCheckedExpr): Likewise.
10458 * statement.cs (Block.ResolveMeta): Use WithCheckState.
10459 (Unchecked.Resolve, Unchecked.DoEmit): Likewise.
10460 (Checked.Resolve, checked.DoEmit): Likewise.
10462 2006-07-20 Miguel de Icaza <miguel@novell.com>
10464 * anonymous.cs: Cache the resolved anonymous delegate, and return
10465 this so that the ResolveTopBlock is only triggered once, not
10468 Currently we trigger ResolvetopBlock twice due to a first pass of
10469 argument check compatibility, and a second pass that does the
10472 2006-07-15 Marek Safar <marek.safar@seznam.cz>
10474 * annonymous.cs (AnonymousMethod.CreateScopeType): Fixed nested type
10476 * rootcontext.cs (Reset): Add helper_classes.
10478 2006-07-15 Marek Safar <marek.safar@seznam.cz>
10481 * statement.cs (Switch.SimpleSwitchEmit): Handle case null at any position
10484 2006-07-13 Miguel de Icaza <miguel@novell.com>
10486 * statement.cs (Lock): Handle expressions of type
10487 TypeManager.null_type specially. Fixes #78770
10489 2006-07-08 Marek Safar <marek.safar@seznam.cz>
10491 * expression.cs (Binary.ResolveOperator): Don't crash when null is assigned
10494 2006-07-08 Marek Safar <marek.safar@seznam.cz>
10496 * attribute.cs (AttributeTester.GetMethodObsoleteAttribute): Fixed to look
10497 for accessors as well.
10498 * ecore.cs (EventExpr): Add AccessorTable.
10500 2006-07-01 Marek Safar <marek.safar@seznam.cz>
10503 * attribute.cs, class.cs, ecore.cs : Add missing location of related symbol
10504 for CS0122 where appropriate.
10505 * typemanager.cs (IsNestedChildOf): Type can be null in the case of top
10507 (Filter): Assembly can be null in the case of top level attributes.
10509 2006-06-25 Marek Safar <marek.safar@seznam.cz>
10513 * ecore.cs (Expression.MemberLookupFailed): Don't crash when failed lookup
10514 is done at global level.
10516 2006-06-24 Marek Safar <marek.safar@seznam.cz>
10518 A fix for #77002, Implemented TypeForwarder support.
10520 * attribute.cs (Attribute.GetArgumentType): Reads type argument.
10521 * expression.cs (TypeOf.TypeArgument): Exposes typeof type.
10522 * typemanager.cs (): Add type_forwarder_attr_type.
10524 2006-06-24 Marek Safar <marek.safar@seznam.cz>
10526 * report.cs: Add CS0469 warning.
10528 2006-06-21 Martin Baulig <martin@ximian.com>
10530 * codegen.cs (CodeGen.Save): Moved the symbol file generation into
10531 the `try'-block, so we also report CS0016 etc. there.
10533 2006-06-21 Martin Baulig <martin@ximian.com>
10536 (Delegate.VerifyMethod): Allow `params' methods; fixes #78678.
10538 2006-06-21 Martin Baulig <martin@ximian.com>
10540 * expression.cs (Unary.ResolveOperator): In `Operator.AddressOf',
10541 also report CS1686 for parameters.
10543 2006-06-21 Martin Baulig <martin@ximian.com>
10545 * statement.cs (GotoCase.Resolve): Report a warning (CS0469)
10546 instead of an error if the value is not implicitly convertible to
10547 the switch types; fixes #77964.
10549 2006-06-21 Raja R Harinath <rharinath@novell.com>
10552 * class.cs (FieldBase.ResolveInitializer): Stop resolution if
10553 FieldBuilder is null.
10556 * expression.cs (Binary.CheckShiftArguments): Don't overwrite original
10557 'left' and 'right' before error-checking.
10559 2006-06-16 Juraj Skripsky <js@hotfeet.ch>
10561 * ecore.cs (SimpleName.Error_ObjectRefRequired): Do not truncate the name.
10563 (MemberExpr.EmitInstance): Use GetSignatureForError () to get full name.
10564 (FieldExpr.DoResolve): likewise.
10565 (PropertyExpr.InstanceResolve): likewise.
10566 (EventExpr.InstanceResolve): likewise.
10568 2006-06-04 Marek Safar <marek.safar@seznam.cz>
10570 * parameter.cs (Parameter.ApplyAttributeBuilder): More DefaultValue
10571 attribute applicable tests for attribute argument.
10573 2006-06-02 Raja R Harinath <rharinath@novell.com>
10576 * expression.cs (Binary.DoNumericPromotions): Remove and rewrite.
10577 (Binary.OverloadResolve_PredefinedIntegral): New.
10578 (Binary.OverloadResolve_PredefinedFloating): New.
10579 (Binary.OverloadResolve_PredefinedString): New.
10580 (Binary.ResolveOperator): Use those instead of DoNumericPromotions.
10581 Follow the standard more closely, and treat numeric promotions in
10582 terms of overload resolution.
10583 (Binary.CheckShiftArguments): Simplify.
10585 2006-06-01 Raja R Harinath <rharinath@novell.com>
10587 * flowanalysis.cs (MyBitVector): Simplify representation.
10588 (MyBitVector.Clone): Avoid allocating BitArray.
10589 (MyBitVector.operator&): Rename from MyBitVector.And and make symmetric.
10590 (MyBitVector.operator|): Likewise, with MyBitVector.Or.
10591 (*): Update. Change all references to MyBitVector.And and
10592 MyBitVector.Or to &= and |=.
10594 2006-05-29 Raja R Harinath <rharinath@novell.com>
10596 Fix cs0231-[34].cs.
10597 * cs-parser.jay (formal_parameter_list): Extend the pattern below
10598 to param arguments too.
10600 2006-05-26 Miguel de Icaza <miguel@novell.com>
10602 * cs-parser.jay: Catch another parsing form for arglist being
10603 followed by other arguments. Fixes #78313.
10605 2006-05-24 Raja R Harinath <rharinath@novell.com>
10607 * flowanalysis.cs (FlowBranchingToplevel.AddReturnOrigin): Move
10608 checking of out parameters to ...
10609 (FlowBranchingToplevel.Merge): ... here.
10610 (FlowBranchingException.AddBreakOrigin): If 'finally_vector' is
10611 set, propagate the origin upward, and only complain if there was
10613 (FlowBranchingException.AddContinueOrigin): Likewise.
10614 (FlowBranchingException.AddReturnOrigin): Likewise.
10615 (FlowBranchingException.AddGotoOrigin): Likewise.
10617 2006-05-23 Raja R Harinath <rharinath@novell.com>
10619 * flowanalysis.cs (UsageVector.MergeOrigins): If an origin is
10620 unreachable, skip it.
10621 (FlowBranchingException.Merge): Always propagate jumps, even if
10622 the finally block renders subsequent code unreachable.
10624 2006-05-18 Raja R Harinath <rharinath@novell.com>
10627 * statement.cs (Goto.Resolve): Move responsibility for resolving
10628 'goto' to FlowBranching.AddGotoOrigin.
10629 (Goto.SetResolvedTarget): New. Callback to set the
10630 LabeledStatement that's the target of the goto.
10631 (Goto.DoEmit): Use Leave instead of Br when crossing an
10632 unwind-protect boundary.
10633 * flowanalysis.cs (FlowBranching.AddGotoOrigin): Rename from
10634 LookupLabel and adjust to new semantics.
10635 (FlowBranchingToplevel.AddGotoOrigin): Likewise.
10636 (FlowBranchingBlock.AddGotoOrigin): Likewise. Use
10637 Goto.SetResolvedTarget to update target.
10638 (FlowBranchingLabeled.AddGotoOrigin): Likewise.
10639 (FlowBranchingException.AddGotoOrigin): Rewrite to be similar to
10640 AddBreakOrigin & co. Delay propagation until ...
10641 (FlowBranchingException.Merge): ... this.
10643 * statement.cs (Block.Resolve): Always depend on flow-branching to
10644 determine unreachability. Kill workaround that originally emitted
10645 only one statement after an "unreachable" label (see infloop in
10648 Fix #77869, #76148, #77755, #75255 and a host of other bugs.
10649 This is still "wrong", but anything better would probably need a
10650 multi-pass algorithm.
10651 * flowanalysis.cs (FlowBranchingLabeled): Salt away a copy of the
10652 usage vector. Force current usage vector to be reachable, to
10653 optimistically signify backward jumps.
10654 (FlowBranchingLabeled.LookupLabel): Note if a backward jump is
10656 (FlowBranchingLabeled.Merge): New. If no backward jump was
10657 detected, return the original salted-away usage vector instead,
10658 updated with appropriate changes. Print unreachable warning if
10660 * statement.cs (Block.Resolve): Don't print unreachable warning on
10661 a labeled statement.
10663 2006-05-17 Gert Driesen <drieseng@users.sourceforge.net>
10665 * driver.cs: Pass filename without path to AssemblyBuilder's
10666 AddResourceFile. Fixes bug #78407.
10668 2006-05-17 Raja R Harinath <rharinath@novell.com>
10670 * statement.cs (LabeledStatement.Resolve): Move merging of origins ...
10671 * flowanalysis.cs (FlowBranchingLabeled): ... here.
10672 (FlowBranching.MergeChild): Overwrite
10673 reachability information from Labeled branchings too.
10675 2006-05-16 Raja R Harinath <rharinath@novell.com>
10677 * statement.cs (Goto.Resolve): Merge jump origins here ...
10678 * flowanalysis.cs (FlowBranching.Label): ... rather than here.
10680 * flowanalysis.cs (FlowBranching.LookupLabel): Move CS0159 check ...
10681 (FlowBranchingToplevel.LookupLabel): ... here. Add CS1632 check.
10682 (FlowBranchingGoto.LookupLabel): New. Handle back jumps.
10683 (FlowBranchingBlock.LookupLabel): Call LabeledStatement.AddReference
10685 * statement.cs (Goto.Resolve): ... not here.
10686 (Goto.Emit): Remove CS1632 check.
10688 2006-05-14 Marek Safar <marek.safar@seznam.cz>
10690 * ecore.cs (Expression.ResolveAsTypeTerminal): Fixed type in the obsolete
10693 2006-05-11 Raja R Harinath <rharinath@novell.com>
10695 * flowanalysis.cs (UsageVector.MergeJumpOrigins): Kill.
10696 (FlowBranchingBlock.Label): Use UsageVector.MergeOrigins.
10697 (FlowBranchingException.Label): Likewise.
10699 * flowanalysis.cs (MyBitVector.SetAll): New. Sets all bits to the
10701 (MyBitVector.Or): Use it to avoid losing information (Count).
10702 (FlowBranching.MergeOrigins): Likewise.
10704 * flowanalysis.cs (UsageVector.IsDirty): Remove.
10705 (UsageVector.Parameters, UsageVector.ParameterVector): Likewise.
10706 (UsageVector.Locals, UsageVector.LocalVector): Likewise.
10707 (UsageVector.ToString): Simplify.
10708 (UsageVector.MergeSiblings): Move here from ...
10709 (FlowBranching.Merge): ... here.
10710 (FlowBranchingToplevel.CheckOutParameters): Take an UsageVector,
10713 2006-05-10 Raja R Harinath <rharinath@novell.com>
10715 * flowanalysis.cs (UsageVector.MergeOrigins): Simplify, now that a
10716 null bitvector is treated as all-true.
10718 * flowanalysis.cs (MyBitVector.And, MyBitVector.Or): Make lazier.
10719 (MyBitVector): Rationalize invariants. 'vector != null' implies
10720 that we have our own copy of the bitvector. Otherwise,
10721 'InheritsFrom == null' implies all inherited bits are true.
10723 2006-05-09 Marek Safar <marek.safar@seznam.cz>
10725 * statement.cs (LocalInfo): Add IsConstant.
10726 (LocalInfo.DeclareLocal): Moved from EmitMeta and changed to don't emit
10727 local variable for constants.
10729 2006-05-09 Raja R Harinath <rharinath@novell.com>
10731 * flowanalysis.cs (MyBitVector.Empty): New.
10732 (MyBitVector): Don't allow InheritedFrom to be null.
10733 (MyBitVector.And, MyBitVector.Or): Treat 'null' as all-ones.
10734 (UsageVector, FlowBranching): Update to changes.
10736 * flowanalysis.cs (FlowBranching.InTryWithCatch): Don't terminate
10737 recursion. The 'Parent == null' condition isn't sufficient for
10739 (FlowBranching.AddBreakOrigin): Likewise.
10740 (FlowBranching.AddContinueOrigin): Likewise.
10741 (FlowBranching.AddReturnOrigin): Likewise.
10742 (FlowBranching.StealFinallyClauses): Likewise.
10743 (FlowBranching.MergeTopBlock): Move to FlowBranchingToplevel.
10744 (FlowBranching.CheckOutParameters): Likewise.
10745 (FlowBranchingToplevel): Terminate all the above recursions here.
10746 (FlowBranchingToplevel.End): Rename from MergeTopBlock.
10747 * codegen.cs (EmitContext.ResolveTopBlock): Update to changes.
10749 * flowanalysis.cs (BranchingType.Toplevel): New. Represents a
10751 (FlowBranchingToplevel): New. Empty for now.
10752 (FlowBranching.MergeTopBlock): Update.
10753 * codegen.cs (EmitContext.ResolveTopBlock): Create a Toplevel
10754 branching for the anonymous delegate.
10755 (EmitContext.StartFlowBranching): Add ToplevelBlock variant.
10757 * flowanalysis.cs (UsageVector.MergeOrigins): Reorganize.
10758 (UsageVector.MergeJumpOrigins): Don't ignore current reachability
10759 information at the start of the merge. Reorganize.
10761 2006-05-07 Marek Safar <marek.safar@seznam.cz>
10763 * class.cs (MethodData.Define): Method cannot implement interface accessor.
10765 2006-05-07 Marek Safar <marek.safar@seznam.cz>
10767 * expression.cs (QualifiedAliasMember.ResolveAsTypeStep): Pass location
10768 to newly introduced ctor.
10770 * namespace.cs (Namespace.Error_NamespaceDoesNotExist): Moved an error
10771 message to one place.
10772 (GlobalRootNamespace.Error_NamespaceDoesNotExist): Custom message for
10775 2006-05-07 Marek Safar <marek.safar@seznam.cz>
10777 * const.cs (Const.Error_ExpressionMustBeConstant): Better error message.
10779 * ecore.cs (Expression.ResolveAsConstant): Updated.
10781 * statement.cs (ResolveMeta): Updated.
10783 2006-05-06 Marek Safar <marek.safar@seznam.cz>
10785 * cs-parser.jay: __arglist cannot be used in initializer.
10787 2006-05-06 Marek Safar <marek.safar@seznam.cz>
10790 * namespace.cs (LocalAliasEntry.DoResolve): Don't allow to access nested
10793 2006-05-05 Raja R Harinath <rharinath@novell.com>
10795 * statement.cs (EmptyStatement.ResolveUnreachable): Override.
10796 (LabeledStatement): Add 'name' parameter.
10797 (LabeledStatement.Name, LabeledStatement.JumpOrigins): New.
10798 (Block.AddLabel): Update to changes.
10799 * cs-parser.jay (labeled_statement): Likewise.
10801 * flowanalysis.cs (BranchingType.Labeled): New.
10802 (UsageVector.MergeOrigins): Remove unused 'branching' argument.
10803 (FlowBranchingLabeled): New. Does nothing for now, but will
10804 eventually handle 'goto' flows.
10805 * codegen.cs (StartFlowBranching): Add new LabeledStatement variant.
10806 * statement.cs (LabeledStatement.Resolve): Create a FlowBranching
10807 that's terminated ...
10808 (Block.Resolve): ... here.
10810 * flowanalysis.cs (UsageVector.MergeFinally): Remove.
10811 (UsageVector.MergeFinallyOrigins): Likewise.
10812 (FlowBranching.InTryOrCatch): Likewise.
10813 (FlowBranching.AddFinallyVector): Likewise.
10814 (FlowBranchingException): Update to changes.
10817 * statement.cs (Return.Resolve): Move error checking to ...
10818 * flowbranching.cs (FlowBranching.AddReturnOrigin): ... this.
10819 (FlowBranchingException): Handle return origins like break and
10821 (FlowBranching.UsageVector.CheckOutParameters): Remove.
10823 2006-05-04 Marek Safar <marek.safar@seznam.cz>
10826 * class.cs (TypeContainer.FindMembers): Includes event method in the methods
10829 2006-05-04 Marek Safar <marek.safar@seznam.cz>
10832 * class.cs (MethodData.Define): Do public accessor check only when method
10833 implements an interface.
10835 2006-05-04 Raja R Harinath <rharinath@novell.com>
10837 Remove special handling of 'break'
10838 * flowanalysis.cs (Reachability): Remove all mention of 'breaks'.
10839 (Reachability.Meet): Simplify. Remove 'do_breaks' argument.
10840 (UsageVector.Break): Remove.
10841 (FlowBranching.Merge): Use 'Reachable.IsUnreachable' to determine
10843 (FlowBranchingBreakable.Merge): Don't ResetBreaks.
10845 * statement.cs (Break.Resolve): Call UsageVector.Goto (), not
10846 UsageVector.Breaks (). Don't set NeedsReturnLabel.
10848 2006-05-03 Marek Safar <marek.safar@seznam.cz>
10851 * pending.cs (PendingImplementation.BaseImplements): A found member cannot
10852 be the interface member.
10854 2006-05-03 Marek Safar <marek.safar@seznam.cz>
10857 * constant.cs (LongConstant.EmitLong): Fixed to catch also negative values
10858 for emitting small (int) values.
10860 2006-05-03 Raja R Harinath <rharinath@novell.com>
10863 * flowanalysis.cs (FlowBranchingException.Merge): Ensure
10864 control-flow passes through the 'finally' after merging-in all the
10865 control-flows from 'try' and the 'catch' clauses.
10867 * flowanalysis.cs (FlowBranching.IsLoop): Remove.
10868 (FlowBranching.IsTryOrCatch): Remove 'is_return' parameter. It's
10869 always true at the only non-recursive entry point.
10870 (FlowBranching.CreateBranching) [BranchingType.Loop]: Return a
10871 FlowBranchingBreakable.
10872 (FlowBranchingLoop): Remove.
10873 * statement.cs (Return.DoResolve): Update to changes.
10876 * flowanalysis.cs (FlowBranching.BranchingType.Embedded): New.
10877 (FlowBranching.CreateBranching): Handle it: create a
10878 FlowBranchingContinuable.
10879 (FlowBranching.BreakCrossesExceptionBoundary): Remove.
10880 (FlowBranching.AddContinueOrigin): Similar to AddBreakOrigin,
10881 except that it handles the 'continue' command.
10882 (FlowBranching.UsageVector.MergeOrigins): Rename from
10884 (FlowBranchingContinuable): Similar to FlowBranchingBreakable,
10885 except that it overrides AddContinueOrigin.
10886 (FlowBranchingException): Override AddContinueOrigin, similar to
10888 * statement.cs (While.Resolve, Foreach.ArrayForeach.Resolve):
10889 Create a new branching around the embedded statement.
10890 (Do.Resolve, For.Resolve): Likewise. Do reachability analysis for
10891 control flow after the embedded statement.
10892 (Continue.Resolve): Move all error checking to AddContinueOrigin.
10894 * flowanalysis.cs (FlowBranching.IsSwitch): Remove.
10895 (FlowBranching.CreateBranching) [BranchingType.Switch]: Create a
10896 FlowBranchingBreakable.
10897 (FlowBranchingSwitch): Remove.
10900 * statement.cs (Break.Resolve): Simplify. Move responsibility for
10901 error reporting to ...
10902 * flowanalysis.cs (FlowBranching.AddBreakOrigin) ... this.
10903 Rename from 'AddBreakVector'. Add new location argument. Return
10904 a bool indicating whether the 'break' crosses an unwind-protect.
10905 (FlowBranchingException.AddBreakOrigin): Add.
10906 (FlowBranchingException.Merge): Propagate 'break's to surrounding
10907 flowbranching after updating with the effects of the 'finally'
10909 (FlowBranchingBreakable): New common base class for
10910 FlowBranchingLoop and FlowBranchingSwitch.
10912 * statement.cs (Foreach.ArrayForeach.Resolve): Set barrier after
10913 embedded statement.
10914 (Foreach.CollectionForeach.Resolve): Remove extraneous flowbranching.
10916 2006-05-02 Raja R Harinath <rharinath@novell.com>
10918 * statement.cs (Do.Resolve): If the loop is infinite, set the
10920 (While.Resolve, For.Resolve): Set a barrier after the embedded
10921 statement. There's no direct control flow that goes from the end
10922 of the embedded statement to the end of the loop.
10923 * flowanalysis.cs (FlowBranching.Infinite): Remove.
10924 (FlowBranchingLoop.Merge): Don't look at 'Infinite'. The changes
10925 above ensure that the reachability is correctly computed.
10927 * flowanalysis.cs (Reachability.ResetBarrier): Remove.
10928 (UsageVector.MergeBreakOrigins): If the current path is
10929 unreachable, treat it as if all parameters/locals are initialized.
10930 (FlowBranchingLoop.Merge): Don't clear any barriers. Handle
10931 infinite loops before merging-in break origins.
10933 * flowanalysis.cs (Reachability.Meet): Simplify code handling 'returns'.
10934 (Reachability.Reachable): Split part into ...
10935 (Reachability.Unreachable): ... this. Simplify.
10936 (Reachability.IsUnreachable): Use 'Unreachable' instead.
10938 * flowanalysis.cs (Reachability.SetReturnsSometimes): Remove.
10939 (Reachability.SetThrowsSometimes): Likewise.
10940 (FlowBranchingBlock.MergeTopBlock): Don't compare against
10941 TriState.Always, use corresponding property.
10942 * statement.cs (Lock.Resolve, Try.Resolve, Using.Resolve): Likewise.
10943 (Block.Resolve): Likewise. Remove some redundant checks.
10945 2006-05-02 Raja R Harinath <harinath@gmail.com>
10947 * flowanalysis.cs (UsageVector.Throw): Set barrier too.
10948 (Reachability.Meet): Don't bother checking AlwaysThrows --
10949 barrier is always set.
10950 (FlowBranchingBlock.Merge): Likewise.
10952 2006-05-01 Raja R Harinath <harinath@gmail.com>
10954 * codegen.cs (EmitContext.ResolveTopBlock): Remove redundant
10955 checks for unreachable.
10957 2006-05-01 Marek Safar <marek.safar@seznam.cz>
10960 * flowanalysis.cs (UsageVector.IsAssigned): Add flag to ignore short path.
10962 * statement.cs (Block.UsageWarning): Uses newly introduced flag to detect
10963 whether field is really assigned.
10965 2006-04-30 Raja R Harinath <harinath@gmail.com>
10967 * flowanalysis.cs (Reachability): Make 4-argument constructor
10969 (Reachability.Meet): Rename from 'And'. Remove static variant.
10970 (Reachability.Always): Rename from the highly misleading
10971 'Reachability.Never'.
10972 (FlowBranching.Merge): Update to changes. Mark an impossible
10973 situation with a 'throw'.
10974 (*): Update to changes.
10976 2006-04-29 Raja R Harinath <harinath@gmail.com>
10978 * flowanalysis.cs (TriState): Rename from FlowBranching.FlowReturns.
10979 Remove 'Undefined'.
10980 (FlowBranching.TriState_Meet): Rename from AndFlowReturns. Simplify.
10981 (FlowBranching.TriState_Max): Rename from OrFlowReturns. Simplify.
10982 (*): Update to changes.
10983 * statement.cs: Update to changes.
10985 2006-04-28 Marek Safar <marek.safar@seznam.cz>
10988 *class.cs (Method.FindOutBaseMethod): Base method cannot be property method.
10990 2006-04-28 Raja R Harinath <harinath@gmail.com>
10992 * flowanalysis.cs (FlowBranching.MergeTopBlock): Don't create a
10995 * flowanalysis.cs (UsageVector.MergeChild): Change FlowBranching
10996 argument to two arguments: an usage-vector and a bool. Move call
10997 to FlowBranching.Merge () ...
10998 (FlowBranching.MergeChild, FlowBranching.MergeTopBlock): ... here.
11000 * flowanalysis.cs (UsageVector.MergeChild): Move special-case
11001 handling of loop and switch reachability to ...
11002 (FlowBranchingLoop.Merge, FlowBranchingSwitch.Merge): ... these.
11004 2006-04-27 Raja R Harinath <harinath@gmail.com>
11006 * flowanalysis.cs (FlowBranching.InLoop): Move special-case
11007 handling to FlowBranchingLoop.InLoop.
11008 (FlowBranching.InSwitch): Likewise, to FlowBranchingSwitch.
11010 2006-04-26 Marek Safar <marek.safar@seznam.cz>
11013 * anonymous.cs (AnonymousMethod.DoResolve): Moved the check whether
11014 anonymous method is allowed from AnonymousContainer here.
11016 * attribute.cs, codegen.cs (EmitContext): Add IsAnonymousMethodAllowed.
11018 2006-04-24 Raja R Harinath <rharinath@novell.com>
11021 * flowanalysis.cs (MyBitVector.Or): Add null check on argument.
11023 2006-04-23 Marek Safar <marek.safar@seznam.cz>
11026 * constant.cs (FloatConstant.Reduce): Add range checking for checked context.
11027 (DoubleConstant.Reduce): Ditto.
11029 2006-04-23 Raja R Harinath <rharinath@novell.com>
11031 * expression.cs (LocalVariableReference.DoResolveBase): Simplify.
11032 Remove 'lvalue_right_side' argument. Move parts to ...
11033 (LocalVariableReference.ResolveLocalInfo, LocalVariable.DoResolve)
11034 (LocalVariable.DoResolveLValue): ... these.
11036 2006-04-21 Raja R Harinath <rharinath@novell.com>
11039 * codegen.cs (EmitContext.InRefOutArgumentResolving): Remove.
11040 * expression.cs (EmptyExpression.LValueMemberOutAccess): New.
11041 (LocalVariableReference.DoResolveBase): Use it to implement new
11043 (IndexerAccess.DoResolveLValue): Handle LValueMemberOutAccess.
11044 (Argument.Resolve): Simplify. Move CS1510 check ...
11045 * ecore.cs (Expression.ResolveLValue): ... here.
11046 (UnboxCast.DoResolveLValue): Handle LValueMemberOutAccess.
11047 (PropertyExpr.DoResolveLValue): Likewise.
11048 (FieldExpr.Report_AssignToReadonly): Likewise.
11049 (FieldExpr.DoResolve): Add 'out_access' argument. Use
11050 LValueMemberAccess or LValueMemberOutAccess on instance depending
11052 (FieldExpr.DoResolveLValue): Pass 'out_access' argument to
11053 DoResolve as appropriate.
11055 2006-04-20 Raja R Harinath <rharinath@novell.com>
11058 * expression.cs (Invocation.VerifyArgumentsCompat): Don't try
11059 implicit conversions on 'out' and 'ref' arguments.
11061 * expression.cs (Invocation.VerifyArgumentsCompat): Reorganize to
11062 improve clarity. Remove dead code.
11065 * statement.cs (Block.UsageWarning): Allow VariableInfo to be null.
11066 (Catch.Resolve): Resolve VarBlock if it exists.
11068 2006-04-19 Miguel de Icaza <miguel@novell.com>
11070 * statement.cs (Foreach.EmitFinally): Do not emit the enumerator
11071 twice, this was some residual code, the enumerator was emitted
11072 properly in the two branche of if later.
11074 2006-04-19 Raja R Harinath <rharinath@novell.com>
11076 * expression.cs (Cast.ResolveLValue): Remove. The result of a
11077 cast is never an lvalue.
11078 (Cast.DoResolve, Cast.ResolveRest): Combine.
11079 (Argument.Emit): Simplify slightly. Move 'Expr is
11080 IMemoryLocation' check ...
11081 (Argument.Resolve): ... here.
11082 (Argument.Error_LValueRequired): Remove. Inline into only user.
11084 Simplifications. Fix cs0191-2.cs
11085 * ecore.cs (FieldExpr.DoResolve): Move handling of CS0192, CS0198,
11086 CS1649 and CS1651 to ...
11087 (FieldExpr.Report_AssignToReadonly): ... this. Simplify by moving
11088 the actual selection of the error code and message to a lookup
11089 table. Add a dummy return value to simplify callsites.
11090 (FieldExpr.ResolveLValue): Don't allow a constructor to write to
11091 readonly fields of other instances of the same type. Move CS0197
11093 * expression.cs (Argument.Resolve): ... here. Simplify code.
11094 Ensure that ec.InRefOutArgumentResolving is only set during LValue
11095 resolution of an out or ref argument. The code simplification
11096 above uses this invariant.
11098 2006-04-18 Raja R Harinath <rharinath@novell.com>
11100 Possibly fix #77752. Fix cs1690-[4-7].cs.
11101 * ecore.cs (Expression.CheckMarshalByRefAccess): Renamed from
11102 CheckMarshallByRefAccess. Drop parameter.
11103 (FieldExpr.CheckMarshalByRefAccess): Update. Change CS1690 to a
11105 (FieldExpr.DoResolve): Call CheckMarshalByRefAccess on
11106 InstanceExpression.
11107 * report.cs (AllWarnings): Add CS1690.
11108 * expression.cs (Argument.Resolve): Use EmptyExpression.OutAccess
11109 for ref access too.
11110 (LocalVariableReference.DoResolveBase): Update.
11112 2006-04-09 Marek Safar <marek.safar@seznam.cz>
11114 * class.cs (MethodOrOperator): Moved common parts from method class.
11115 detect obsolete attributes.
11116 (Method.Define): Simplified as it reuses code from base.
11117 (Constructor.ValidAttributeTargets): Fixed issue found during
11119 (Destructor.ValidAttributeTargets): Fixed issue found during
11121 (Operator): Finished refactoring set off by #78020. Operator class is now
11122 ordinary method class.
11124 * anonymous.cs: Updated.
11126 * decl.cs (DeclSpace): Add IsGeneric
11128 2006-04-09 Marek Safar <marek.safar@seznam.cz>
11130 * class.cs (Constructor.Emit): Don't emit the attributes twice.
11132 2006-04-09 Marek Safar <marek.safar@seznam.cz>
11134 * class.cs (Operator.Emit): Extracted code from MethodData to correctly
11135 detect obsolete attributes.
11136 (Method.CreateEmitContext): Moved to MethodOrOperator.
11138 2006-04-09 Marek Safar <marek.safar@seznam.cz>
11141 * class.cs (TypeContainer.MemberCoreArrayList.DefineContainerMembers): Throw
11142 customized exception to make crash detection easier.
11143 (MethodOrOperator): Started to work on new base class for methods and
11145 (Method): Derives from MethodOrOperator.
11146 (Constructor.Emit): Emits its own attributes.
11147 (AbstractPropertyEventMethod.Emit): Ditto.
11148 (Operator): Derives from MethodOrOperator, will refactor fully in extra
11150 (Operator.Emit): It's temporary more tricky than should be.
11152 * doc.cs (GetMethodDocCommentName): Updated after operator changes.
11154 * report.cs (InternalErrorException): Add ctor with inner exception.
11156 2006-04-08 Marek Safar <marek.safar@seznam.cz>
11159 * ecore.cs (SimpleName.ResolveAsTypeStep): Report better error when type is
11162 2006-04-07 Marek Safar <marek.safar@seznam.cz>
11165 * expression.cs (ArrayCreation.GetAttributableValue): Creates correctly typed
11168 2006-04-06 Marek Safar <marek.safar@seznam.cz>
11170 * class.cs (Class.ApplyAttributeBuilder): Report an error when ComImport
11171 attribute is present and Guid not.
11172 (Interface.ApplyAttributeBuilder): Ditto.
11174 * attribute.cs: Add error message.
11176 2006-04-06 Marek Safar <marek.safar@seznam.cz>
11180 * attribute.cs (Attribute.AttachTo): The attribute can have multiple
11181 sources (it's composite) so hold them in extra array as they are used in
11182 Emit phase only. It worked in the previous versions by mistake.
11183 (Attribute.Emit): Emit attribute for more owners when exist.
11185 * codegen.cs, class.cs: Updated to don't re-attach attribute twice as now
11186 it has now different behaviour.
11188 2006-04-04 Marek Safar <marek.safar@seznam.cz>
11190 * constant.cs (Constant.IsDefaultInitializer): New method.
11192 * class.cs: Updated.
11194 * expression.cs (ArrayCreation.CheckIndices): Add an optimization to don't
11195 re-initialize default values. It saves KBs almost for every assembly.
11196 Thanks Zoltan for the idea.
11197 (ArrayCreation.ResolveInitializers): Renamed from ValidateInitializers.
11198 (ArrayCreation.DoResolve): Resolve only once.
11199 (ArrayCreation.Emit): Emit static initializer only when it is faster.
11200 (ArrayCreation.GetAttributableValue): Cope with optimized values.
11202 2006-04-03 Zoltan Varga <vargaz@gmail.com>
11204 * report.cs (Warning, Error): Add 0-, 1-, and 2- argument specializations.
11207 2006-04-01 Marek Safar <marek.safar@seznam.cz>
11209 * assign.cs (Assign.DoResolve): Assignment to same variable can occur
11210 in an embedded statement too.
11212 2006-04-01 Raja R Harinath <rharinath@novell.com>
11215 * statement.cs (Switch.EmitObjectInteger) [ulong]: Remove bad cast.
11217 2006-04-01 Marek Safar <marek.safar@seznam.cz>
11221 * class.cs (TypeContainer.AddPartial): Don't report an error when modifier
11224 * modifiers.cs: Add DEFAULT_ACCESS_MODIFER.
11226 2006-03-31 Marek Safar <marek.safar@seznam.cz>
11228 * assign.cs (LocalTemporary): Don't require ILGenerator in the resolve
11231 * anonymous.cs, assign.cs, ecore.cs, expression.cs: Updated after
11232 LocalTemporary change.
11234 * class.cs (ClassOrStruct.DefineDefaultConstructor): Moved from
11236 (ClassOrStruct.DefineFieldInitializers): Implemented static field
11237 initializers optimization.
11238 (ClassOrStruct.TypeAttr): Moved from modifiers.
11239 (Constructor.CheckBase): Don't crash when static ctor has parameters.
11240 (FieldBase.ResolveInitializer): Resolves initializer.
11241 (FieldBase.HasDefaultInitializer): New property.
11243 * cs-parser.jay: Removed message.
11245 * expression.cs (CompilerGeneratedThis): New specialization.
11247 * modifiers.cs (TypeAttr): Moved to ClassOrStruct.TypeAttr
11249 2006-03-28 Marek Safar <marek.safar@seznam.cz>
11251 * cs-parser.jay, cs-tokenizer.cs: On demand Stack allocation.
11253 2006-03-27 Marek Safar <marek.safar@seznam.cz>
11255 * ecore.cs (Expression.ResolveAsConstant): Clean up, enum constants should
11256 be now EnumConstants only.
11258 2006-03-27 Marek Safar <marek.safar@seznam.cz>
11260 * attribute.cs, driver.cs: Reset more caches.
11262 2006-03-26 Marek Safar <marek.safar@seznam.cz>
11264 * cs-tokenizer.cs (adjust_real): Uses float.Parse for float literals.
11266 2006-03-26 Marek Safar <marek.safar@seznam.cz>
11268 * constant.cs (Constant.Reduce): Replaced EmitContext with single bool
11269 for easier reuse. Updated all overrides.
11270 (IntegralConstant): New base class for all integral constants.
11271 (IntegralConstant.Error_ValueCannotBeConverted): When assigned value if out
11272 of the constant range, report custom error.
11273 (UIntConstant.Reduce): Fixed uint conversion.
11275 * ecore.cs, literal.cs: Reduce updates.
11277 2006-03-26 Marek Safar <marek.safar@seznam.cz>
11281 * class.cs (Constructor.Define): Removed extra if for default ctors.
11282 A patch from Atsushi Enomoto.
11284 2006-03-26 Marek Safar <marek.safar@seznam.cz>
11286 * attribute.cs (Attribute.ResolveConstructor): Conversion was moved to
11287 GetAttributableValue.
11289 * constant.cs (Constant.GetAttributableValue): Does implicit conversion
11292 * convert.cs (ImplicitConversionRequired): Error message moved to
11295 * ecore.cs (Expression.GetAttributableValue): Add type parameter for
11296 automatic implicit conversion of an output value.
11297 (EnumConstant.GetAttributableValue): Don't reduce the enum constants.
11299 * expression.cs (ArrayCreation.GetAttributableValue): Add element type
11301 (TypeOf.GetAttributableValue): Add extra handling for object type.
11303 * literal.cs (DoubleLiteral.Error_ValueCannotBeConverted): Doubles can have
11304 special error message.
11306 2006-03-25 Marek Safar <marek.safar@seznam.cz>
11308 * class.cs (Constructor.Emit): Don't crash when struct ctor is
11310 (Constructor.ApplyAttributeBuilder): Transform MethodImplAttribute to be
11311 compatible with MS runtime.
11313 2006-03-23 Marek Safar <marek.safar@seznam.cz>
11315 * attribute.cs (Attribute.ResolveConstructor): Check for an invalid
11316 attribute arguments here.
11318 * class.cs (Indexer.Define): The check was moved to attribute class.
11320 2006-03-22 Marek Safar <marek.safar@seznam.cz>
11322 * assign.cs, class.cs, codegen.cs, convert.cs, decl.cs, ecore.cs,
11323 expression.cs, typemanager.cs: Minor changes from gmcs to make merging
11326 2006-03-22 Raja R Harinath <rharinath@novell.com>
11328 Support ParameterDefaultValueAttribute in gmcs. Also applied to
11329 mcs to keep code differences small.
11330 * attribute.cs (Attribute.GetParameterDefaultValue): New.
11331 * typemanager.cs (parameter_default_value_attribute_type): New.
11332 * parameter.cs (Parameter.ApplyAttributeBuilder): Use them. Add
11335 2006-03-21 Marek Safar <marek.safar@seznam.cz>
11337 * expression.cs (StringConcat.Append): Reverted back to no warning state.
11339 2006-03-21 Marek Safar <marek.safar@seznam.cz>
11341 * const.cs (Error_ConstantCanBeInitializedWithNullOnly): Share a message.
11343 * statement.cs (Block.ResolveMeta): Look for wrong object constants in
11346 2006-03-21 Atsushi Enomoto <atsushi@ximian.com>
11348 * doc-bootstrap.cs : fix build.
11350 2006-03-20 Marek Safar <marek.safar@seznam.cz>
11352 * expression.cs (StringConcat.Append): Issue a warning when empty string
11353 is going to append.
11355 2006-03-20 Marek Safar <marek.safar@seznam.cz>
11357 * assign.cs (CompoundAssign.ResolveSource): Removed.
11359 * attribute.cs (ResolvePossibleAttributeType): Updated after MemberAccess
11362 * class.cs (TypeContainer.FindMethods): Removed.
11363 (TypeContainer.CheckMemberUsage): Made static.
11365 * codegen.cs (GetAssemblyName): Uses Length for empty string test.
11367 * constant.cs (CheckRange): Removed unused type argument.
11368 (CheckUnsigned): Removed unused type argument.
11370 * cs-parser.jay: Updated after MemberAccess clean up.
11371 Uses Length for empty string test.
11373 * cs-tokenizer.cs: Uses Length for empty string test.
11374 (IsCastToken): Made static.
11375 (is_hex): Made static.
11376 (real_type_suffix): Made static.
11378 * decl.cs (SetupCache): Made static.
11379 (OnGenerateDocComment): Removed unused ds argument.
11381 * delegate.cs (VerifyDelegate): Removed unused argument.
11383 * doc.cs: Uses Length for empty string test.
11385 * driver.cs: Uses Length for empty string test.
11387 * enum.cs (IsValidEnumType): Made static
11389 * expression.cs (EnumLiftUp): Removed unused argument.
11390 (ResolveMethodGroup): Ditto.
11391 (BetterConversion): Ditto.
11392 (GetVarargsTypes): Ditto.
11393 (UpdateIndices): Ditto.
11394 (ValidateInitializers): Ditto.
11395 (MemberAccess.ctor): Ditto.
11396 (GetIndexersForType): Ditto.
11398 * flowanalysis.cs: (MergeFinally): Removed unused argument.
11400 * iterators.cs: Updated after MemberAccess clean up.
11402 * location.cs: Uses Length for empty string test.
11404 * namespace.cs: Uses Length for empty string test.
11406 * report.cs (CheckWarningCode): Made static.
11408 * statement.cs (LabeledStatement): Removed unused argument.
11410 * typemanager.cs (FilterNone): Removed.
11412 2006-03-18 Marek Safar <marek.safar@seznam.cz>
11414 * codegen.cs (EmitContext.TestObsoleteMethodUsage): Removed as it become
11417 * class.cs: Updated.
11419 2006-03-18 Marek Safar <marek.safar@seznam.cz>
11421 * cs-parser.jay.cs: __arglist is not allowed for delegates.
11423 2006-03-18 Marek Safar <marek.safar@seznam.cz>
11427 * expression.cs (VerifyArgumentsCompat): Reverted to double error
11428 reporting, it's more tricky than I thought.
11430 2006-03-18 Marek Safar <marek.safar@seznam.cz>
11434 * anonymous.cs.cs (AnonymousMethod): Add host to allow access to
11436 (AnonymousMethod.ImplicitStandardConversionExists): New method.
11437 (AnonymousMethod.Compatible): Moved parameter resolving to DoResolve.
11438 Add more error reporting; Fixed issue with params.
11440 * convert.cs (ImplicitStandardConversionExists): Returned conversion check.
11442 * cs-parser.jay: AnonymousMethod requires host container.
11444 * delegate.cs (NewDelegate.DoResolve): Updated after Compatible changes.
11446 2006-03-18 Raja R Harinath <harinath@gmail.com>
11448 * class.cs: Change 'TypeContainer ds' constructor argument to
11449 'DeclSpace parent'. Some classes were missed below due to
11450 different naming convention.
11452 * class.cs (MemberCore.Parent): Delete. This makes the
11453 ParentContainer changes below enforceable by the compiler.
11455 Treat pointers to enclosing declaration space as 'DeclSpace', not
11457 * class.cs, const.cs, delegate.cs, enum.cs, iterator.cs: Change
11458 'TypeContainer parent' constructor argument to 'DeclSpace parent'.
11460 * statement.cs (LocalInfo..ctor): Use DeclSpace argument instead
11462 (Block.AddThisVariable): Likewise.
11463 * class.cs (MethodData.Define, MethodData.Emit): Likewise.
11464 (AbstractPropertyEventMethod.Emit): Likewise.
11465 (AbstractPropertyEventMethod.EmitMethod): Likewise.
11466 (GetMethod.Define, SetMethod.Define): Likewise.
11467 (PropertyMethod.Define, DelegateMethod.Define): Likewise.
11468 (DelegateMethod.EmitMethod): Likewise.
11470 Fix regression test-partial-13.cs.
11471 Rationalize use of PartialContainer. Ensure that the partial
11472 class semantics can be tied to type-correctness, i.e., any
11473 violation will cause a compile error.
11474 * class.cs, const.cs: Access all fields that belong to class
11475 TypeContainer via ParentContainer. Arguments of EmitContexts and
11476 Resolve()-like functions still use 'Parent'.
11478 * class.cs (SourceMethod): Use DeclSpace, not TypeContainer.
11479 (*.CreateEmitContext): Change TypeContainer argument to DeclSpace.
11480 (PropertyMethod.CheckModifiers): Remove unused argument.
11481 * codegen.cs (EmitContext..ctor): Change TypeContainer argument to
11484 2006-03-17 Raja R Harinath <harinath@gmail.com>
11486 Make semantics of PartialContainer simpler.
11487 * decl.cs (DeclSpace.IsPartial): Remove.
11488 * class.cs (TypeContainer.IsPartial): Likewise.
11489 (TypeContainer..ctor): Set PartialContainer to point to self.
11490 (TypeContainer.GetClsCompliantAttributeValue): Don't use IsPartial.
11491 (TypeContainer.FindNestedType): Likewise.
11492 (MemberCore.ParentContainer): Simplify. Remove deprecation.
11494 2006-03-17 Marek Safar <marek.safar@seznam.cz>
11496 * typemanager.cs.cs (GetInterfaces): Don't recreate 0-sized arrays.
11498 2006-03-15 Marek Safar <marek.safar@seznam.cz>
11500 * class.cs (FieldMember.Emit): ParentContainer is real parent for partial
11503 2006-03-15 Marek Safar <marek.safar@seznam.cz>
11505 * class.cs (Operator.Define): An error for base conversion was not
11506 reported correctly.
11508 2006-03-14 Atsushi Enomoto <atsushi@ximian.com>
11510 * iterator.cs : yield break is allowed in try statement which has
11511 catch clauses. Fixed bug #77767.
11513 2006-03-13 Marek Safar <marek.safar@seznam.cz>
11515 A fix for #77593, #77574.
11517 * class.cs (MethodCore.CheckBase): Another if for operator.
11519 2006-03-09 Marek Safar <marek.safar@seznam.cz>
11521 * anonymous.cs (AnonymousMethod.Compatible): Don't crash when parameters
11524 * delegate.cs (Delegate.GetInvokeMethod): Use emitcontext free MemberLookup.
11525 (DelegateCreation.ImplicitStandardConversionExists): New method for just
11528 *ecore.cs (Expression.MemberLookup): Don't ask for emitcontext when it's
11531 * assign.cs, constant.cs, convert.cs, delegate.cs, expression.cs:
11532 Updated after another emitcontext usage was clean up. It should help us to
11533 synchronize with gmcs easier.
11535 2006-03-04 Marek Safar <marek.safar@seznam.cz>
11539 * class.cs (SetMethod.DefineParameters): Uses new parameters type ctor.
11540 (Event.Define): ditto
11541 (SetIndexerMethod.DefineParameters): Uses Parameters.MergeGenerated.
11543 * delegate.cs (Delegate.Define): Uses Parameters.MergeGenerated.
11544 Removed redundant code and set NewSlot for Invoke method too.
11546 * parameter.cs (Parameters.ctor): Add custom, type ctor.
11547 (Parameters.MergeGenerated): New method. Use this method when you merge
11548 compiler generated argument with user arguments.
11550 2006-03-03 Marek Safar <marek.safar@seznam.cz>
11552 * attribute.cs (ResolveAsTypeTerminal): Removed.
11554 * ecore.cs (Expression.ResolveAsTypeTerminal): Make virtual to allow
11555 specialization for predefined types; 30% speed up.
11556 Finally placed obsolete check to right place.
11557 (Expression.ResolveType): Removed.
11559 * enum.cs, expression.cs, parameter.cs, statement.cs, typemanager.cs:
11560 Updated after ResolveType was removed.
11562 * expression.cs (Cast.ctor): Check void cast.
11563 (Binary.ResolveAsTypeTerminal): Is never type.
11564 (Conditional.ResolveAsTypeTerminal): Is never type.
11566 * rootcontext.cs (ResolveCore): Set base type to simplify some code later.
11568 2006-03-01 Raja R Harinath <rharinath@novell.com>
11571 * expression.cs (ParameterReference.DoResolveBase): Change return
11573 (ParameterReference.DoResolve, ParameterReference.DoResolveLValue):
11577 * ecore.cs (PropertyExpr.InstanceResolve): Fix CS1540 check.
11580 * typemanager.cs (GetFullNameSignature): Don't nullref on
11581 protected accessors.
11583 2006-02-27 Marek Safar <marek.safar@seznam.cz>
11585 * attribute.cs (Attribute.PosArguments, Attribute.NamedArguments): Use
11586 these two separated members to simplify the code.
11587 (Attribute.Resolve): Refactored to use new fields and methods.
11588 (Attribute.ResolveConstructor): Extracted from ResolveArguments and
11589 implemented obsolete attribute checking.
11590 (Attribute.ResolveNamedArguments): Extracted from ResolveArguments and
11591 implemented obsolete checking again. It look line never ending quest ;-)
11592 (GlobalAttribute.ResolveConstructor): Need to override as the rest.
11594 * cfold.cs (BinaryFold): TryReduce throws an exception to indicate error.
11596 * constanct.cs (TryReduce): Throws OverflowException to indicate error.
11598 *class.cs (Property.Define): Add RegisterProperty call.
11600 * cs-parser.jay: Replaced ArrayList with fixed array for attribute
11601 argument groups (only 2).
11603 * ecore.cs (Expression.GetAttributableValue): New virtual method used for
11604 encoding expression to arguments.
11605 (Expression.ExprClassToResolveFlags): Just turned to property.
11607 * expression.cs (ArrayCreation.ValidateInitializers): Slightly optimized.
11608 (ArrayCreation.GetAttributableValue): Renamed from EncodeAsAttribute and
11609 optimized as well as implemented support for zero-length attributes.
11611 * typemanager.cs (TypeManager.RegisterProperty, TypeManager.GetProperty):
11612 Add caching of PropertyInfo's.
11614 2006-02-25 Marek Safar <marek.safar@seznam.cz>
11616 * delegate.cs (DelegateCreation.ResolveMethodGroupExpr): Don't report
11617 error multiple times.
11619 2006-02-25 Marek Safar <marek.safar@seznam.cz>
11621 New partial class implementation.
11622 A fix for #77027, #77029, #77403
11624 * attribute.cs (Attributable): Made attributes protected.
11626 * class.cs (TypeContainer): Add PartialContainer and partial_parts as
11627 the replacements of ClassPart and PartialContainer.
11628 (TypeContainer.AddClassOrStruct): Call RecordDecl here.
11629 (TypeContainer.AddInterface): Ditto.
11630 (TypeContainer.AddPartial): The main method for partial classes. It checks
11631 for errors and merges ModFlags and attributes. At the end class is added to
11632 partial_parts list.
11633 (TYpeContainer.DefineDefaultConstructor): Checks whether default ctor is
11635 (TypeContainer.GetClsCompliantAttributeValue): Cope with partial class too.
11636 (TypeContainer.GetNormalPartialBases): Resolves base classes and interfaces
11637 from the rest of partial classes.
11638 (TypeContainer.GetClassBases): Simplified.
11639 (TypeContainer.DefineTypeBuilder): New method, mostly extracted from
11641 (TypeContainer.DefineDefaultConstructor): Is used by derived classes.
11642 (TypeContainer.HasExplicitLayout): Uses Flags now.
11643 (PartialContainer): Removed.
11644 (ClassOrStruct.AddToContainer): Moved enclosing member name check here.
11645 (StaticClass): Was merged with Class.
11646 (Class.GetClassBases): class and static class bases are verified here.
11647 (Class.TypeAttr): Added static attributes when class is static.
11648 (Struct.RegisterFieldForInitialization): Moved from TypeContainer.
11649 (MemberBase): In some cases we need to call parent container for partial
11650 class. It should be eliminated but it's not easy now.
11652 * cs-parser.jay: Replaced all PartialContainer with AddPartial.
11654 * decls.cs (MemberCore.DocComment): Introduced new property as is used by
11655 partial classed to accumulate class comments.
11656 (MemberCore.GetClsCompliantAttributeValue): Moved from TypeContainer.
11658 * doc.cs (GenerateTypeDocComment): Partial classes clean up.
11660 * driver.cs (MainDriver): Tree.GetDecl was removed.
11662 * modifiers.cs (Modifiers): Add partial modifier.
11664 * tree.cs (Tree.decl): Removed.
11665 (RootTypes): Started to use this class more often for root types
11668 2006-02-22 Marek Safar <marek.safar@seznam.cz>
11672 * attribute.cs (AttributeTester.GetCoClassAttribute): Don't crash when
11673 external interface does not have an attribute.
11675 2006-02-22 Marek Safar <marek.safar@seznam.cz>
11677 Another prerequisites for new partial classs implementation.
11679 * attribute.cs (Attribute.Equal): Implemented.
11680 (Attribute.Emit): Changed as attributes can be applied more than twice.
11681 (Attributes.Emit): Check for duplicate attributes here.
11683 * class.cs, decl.cs, delegate.cs, doc.cs, enum.cs: Don't pass DeclSpace
11684 as a parameter, clean-up.
11686 2006-02-11 Marek Safar <marek.safar@seznam.cz>
11690 * class.cs (TypeContainer.DefineType): Cannot use ResolveType because it
11691 contains obsolete attribute check which can in some cases look for base
11692 type of current class which is not initialized yet.
11693 (TypeContainer.BaseType): Replacement of ptype.
11695 * decl.cs (MemberCore.CheckObsoleteType): Reuse existing code.
11697 2006-02-11 Marek Safar <marek.safar@seznam.cz>
11699 First of prerequisites for new partial classs implemention.
11701 * attribute.cs (Attributable): Extended by ResolveContext;
11702 Attributes finally have correct context for resolving in all cases.
11703 (AttachTo): Attribute owner is assigned here.
11705 * codegen.cs (IResolveContext): Introduce new interface to hold
11706 all information needed in resolving phase.
11707 (EmitContext): Implements IResolveContext; more clean-up needed here.
11709 * decl.cs (MemberCore): Implemented IResolveContext.
11711 * anonymous.cs, attribute.cs, class.cs, codegen.cs, const.cs,
11712 decl.cs, ecore.cs, enum.cs, expression.cs, iterators.cs, namespace.cs,
11713 parameter.cs, statement.cs, tree.cs, typemanager.cs:
11714 Refactored to use new IResolveContext instead of EmitContext; cleanup
11716 2006-02-06 Miguel de Icaza <miguel@novell.com>
11718 * codegen.cs (EmitScopeInitFromBlock): check here the
11719 capture_context, there is no need to make two calls to the
11722 * anonymous.cs: Add some debugging messages that might help me
11723 track other instances of this problem in the future (the
11724 regression of test 467).
11726 * cs-parser.jay: track the variable block, as we need to initalize
11727 any captured variables declared in this block for the "catch"
11728 portion of the "Try" statement.
11730 * statement.cs (Try.Emit): If the "Catch" has a VarBlock, emit any
11731 scope initialization for captured variables.
11733 Also, move the emit for the variables after the block location has
11736 2006-02-06 Marek Safar <marek.safar@seznam.cz>
11738 * ecore.cs (PropertyExpr.FindAccessors): Just made flags const.
11740 2006-02-02 Miguel de Icaza <miguel@novell.com>
11742 * anonymous.cs (CaptureContext.EmitInitScope): I was wrong in the
11743 commit yesterday, the initialization for the roots is necessary.
11744 What is not necessary is the scope activation.
11746 2006-02-02 Raja R Harinath <rharinath@novell.com>
11748 * ecore.cs (PropertyExpr.DoResolveLValue): Add CS0206 check.
11749 * expression.cs (IndexerAccess.DoResolveLValue): Add CS1612 and
11751 (Argument.Resolve): Remove CS0206 checks.
11753 2006-02-01 Miguel de Icaza <miguel@novell.com>
11755 * anonymous.cs (CaptureContext.EmitInitScope): Do not emit the
11756 scopes for all the roots, the scopes will now be emitted when the
11757 Blocks are entered. [This change was wrong, fixed on 2006-02-02]
11759 (CaptureContext.EmitScopeInitFromBlock): Simply emit the ScopeInfo
11760 code. This reduces a lot of existing cruft.
11762 * statement.cs (Block.Emit): Call EmitScopeInitFromBlock here, so
11763 that the ScopeInfo is generated as we enter the scope, not at the
11764 time of use, which is what we used to do before.
11766 * codegen.cs (EmitScopeInitFromBlock): New routine, this is called
11767 every time a Block is about to be emitted if we have a
11770 2006-02-01 Raja R Harinath <rharinath@novell.com>
11772 * typemanager.cs (NoTypes, NoTypeExprs): Remove.
11774 * *.cs: Use Type.EmptyTypes instead of TypeManager.NoTypes.
11776 * typemanager.cs (cons_param_array_attribute): Make private.
11777 (Reset): Set it to null.
11778 (InitCoreHelpers): Don't initialize it.
11779 (ConsParamArrayAttribute): New. Initialize it as needed.
11780 * parameter.cs (ParamsParameter.ApplyAttribute): Update to change.
11782 2006-01-31 Miguel de Icaza <miguel@novell.com>
11784 * expression.cs: There might be errors reported during the
11785 selection of applicable methods. If there are errors, do not
11786 continue execution as it will lead the compiler to crash.
11788 2006-01-30 Miguel de Icaza <miguel@novell.com>
11790 * expression.cs: Member access is not allowed on anonymous
11791 methods. Fixes #77402.
11793 2006-01-30 Raja R Harinath <rharinath@novell.com>
11796 * cs-parser.jay (VariableDeclaration): Don't set
11797 current_array_type to null.
11798 (field_declaration, event_declaration, declaration_statement):
11799 Set it to null here.
11801 2006-01-28 Raja R Harinath <harinath@gmail.com>
11803 * typemanager.cs (GenericParameterPosition): New.
11806 2006-01-28 Atsushi Enomoto <atsushi@ximian.com>
11808 * doc.cs : To process "include" elements, first we should create
11809 another list than XmlNodeList, because it could result in node
11810 removal, which could result in that the XmlNodeList gives up
11811 yielding next node.
11813 (Also made code identical to gmcs again.)
11815 2006-01-25 Miguel de Icaza <miguel@novell.com>
11817 * ecore.cs: Introduce an error report that we were not catching
11818 before, if not silent, we must report the error. Gonzalo ran into
11821 2006-01-23 Miguel de Icaza <miguel@novell.com>
11823 A fix for bug: #76957
11825 * iterators.cs (MoveNextMethod.CreateMethodHost): call
11826 ComputeMethodHost before creating the method, this is a new
11829 * anonymous.cs (AnonymousContainer): Now we track all the scopes
11830 that this method references (RegisterScope). The actual scope
11831 where the method is hosted is computed with the ComputeMethodHost
11832 before we create the method.
11834 Moved the Deepest routine here.
11836 (AnonymousContainer.ComputeMethodHost): New routine used to
11837 compute the proper ScopeInfo that will host the anonymous method.
11839 (ScopeInfo): Deal with multiple roots. The problem was that we
11840 did not have a unique root where all ScopeInfos could be hanged
11841 from. Remove `topmost' ScopeInfo, and instead keep an arraylist
11844 Remove AdjustMethodScope which is now computed at the end. Remove
11845 LinkScope which did a partial link, instead link all ScopeInfos
11846 before code generation from the new "LinkScopes" routine.
11848 Simplify all the Add* routines as they no longer need to maintain
11849 the tree, they just need to record that they are using variables
11852 (IsAncestor, GetAncestorScopes, GetParentScope, LinkScope): New
11853 routines to produce the forest of ScopeInfo trees.
11855 * class.cs (TypeContainer.AppendMethod): This is just like
11856 AddMethod, but ensures that an interface implementation method
11857 (IEnumerable.XXX) is not inserted at the beginning of the queue of
11858 methods, but at the end.
11860 We use this functionality to ensure that the generated MoveNext
11861 method in the iterator class is resolved/emitted before the
11862 enumerator methods created.
11864 This is required because the MoveNext method computes the right
11865 ScopeInfo for the method. And the other methods will eventually
11866 need to resolve and fetch information computed from the anonymous
11869 2006-01-21 Raja R Harinath <harinath@gmail.com>
11870 Carlos Alberto Cortez <calberto.cortez@gmail.com>
11872 Fix rest of #76995.
11873 * namespace.cs (NamespaceEntry.UsingExternalAliases): Don't add to
11874 the 'aliases' hash.
11875 (NamespaceEntry.LookupAlias): Lookup 'extern_aliases' hash too.
11876 (NamespaceEntry.VerifyUsing): Resolve external aliases too.
11878 2006-01-18 Raja R Harinath <rharinath@novell.com>
11880 Fix #76656, cs0231-2.cs.
11881 * cs-parser.jay (formal_parameter_list): Make error case catch
11883 (parenthesized_expression_0): Add CS1026 check.
11884 (invocation_expression): Remove unused { $$ = lexer.Location }.
11886 2006-01-17 Raja R Harinath <rharinath@novell.com>
11889 * cs-parser.jay (statement_expression): Don't list out the
11890 individual statement-expressions. Convert syntax error into
11893 2006-01-16 Raja R Harinath <rharinath@novell.com>
11896 * ecore.cs (MemberAccess.CheckIntermediateModification): Remove.
11897 (UnboxCast.DoResolveLValue): New. Move CS0445 check from
11898 CheckIntermediateModification.
11899 (FieldExpr.DoResolve): Add new two-argument version that
11900 allows us to resolve the InstanceExpression as an lvalue.
11901 The one-argument variant is now just a wrapper.
11902 (FieldExpr.DoResolveLValue): Use two-argument DoResolve.
11903 Resolve the lhs as an lvalue if the it has a value type.
11904 (FieldExpr.AssignToReadonly): Move CS1648 and CS1650 checks
11905 from Assign.DoResolve.
11906 (PropertyExpr.InstanceResolve): Allow InstanceExpression to be
11907 resolved as an lvalue.
11908 (PropertyExpr.DoResolve): Update.
11909 (PropertyExpr.DoResolveLValue): Resolve the lhs as an lvalue if it
11910 has a value type. Move CS1612 check here from
11911 CheckIntermediateModification.
11912 * assign.cs (Assign.DoResolve): Remove CS1648 and CS1650 checks.
11913 * expression.cs (EmptyExpression.OutAccess): New. Used as the
11914 'right_side' of a ResolveLValue on an 'out' argument.
11915 (EmptyExpression.LValueMemberAccess): New. Used as the
11916 'right_side' of a propagated ResolveLValue on a value type.
11917 (LocalVariableReference.DoResolveBase): Recognize
11918 EmptyExpression.OutAccess and EmptyExpression.LValueMemberAccess.
11920 (Argument.Resolve): Use EmptyExpression.OutAccess rather than
11921 EmptyExpression.Null.
11923 2006-01-16 Atsushi Enomoto <atsushi@ximian.com>
11925 * typemanager.cs : added IsGenericParameter(). In mcs it always
11927 * doc.cs : for generic parameters, use GenericParameterPosition,
11930 2006-01-12 Ben Maurer <bmaurer@andrew.cmu.edu>
11932 * expression.cs: Fix Console.WriteLine ((this = x).foo);
11934 2006-01-12 Miguel de Icaza <miguel@novell.com>
11936 This fixes the problem where we used ldfld instead of ldflda to
11937 load the "THIS" pointer on captured parameters, when THIS is a
11938 value type. See bug #77205.
11940 * iterators.cs (CapturedThisReference.Emit): Pass false to
11941 EmitThis (we do not need the address).
11943 * codegen.cs (EmitThis): it needs to know whether we need the
11944 address of `this' or not. This is used by value types.
11946 * expression.cs (This.AddressOf): Pass true to the EmitThis call,
11947 every other call passes false.
11949 2006-01-12 Raja R Harinath <rharinath@novell.com>
11952 * typemanager.cs (TryGetBaseDefinition): Rename from the mis-named
11954 * expression.cs (Invocation.OverloadResolve): Update.
11955 (Invocation.DoResolve): Avoid double resolution of invocation.
11957 2006-01-11 Raja R Harinath <rharinath@novell.com>
11960 * expression.cs (Unary.Emit): When in /checked+ mode, don't emit
11961 unary negation of floating point types as 0-expr; negation cannot
11962 overflow in floating point types.
11965 * expression.cs (MemberAccess.DoResolve): Disallow the use of '.'
11966 on operands of 'void' type.
11969 * cfold.cs (BinaryFold): Implement folding of BinaryOr, BinaryAnd
11970 and ExclusiveOr for boolean constants too.
11972 2006-01-09 Raja R Harinath <rharinath@novell.com>
11975 * expression.cs (Invocation.OverloadResolve): Replace reflected
11976 override methods with their base virtual methods, rather than
11977 skipping over them.
11978 * typemanager.cs (TypeManager.GetOverride): New.
11980 2006-01-05 Jb Evain <jbevain@gmail.com>
11982 * class.cs (Property.Define, Indexer.Define): do not tag the
11983 properties as SpecialName | RTSpecialName.
11985 2006-01-04 Miguel de Icaza <miguel@novell.com>
11987 * class.cs (MethodCore.IsDuplicateImplementation): This method was
11988 doing a low-level comparission of parameter types. It was lacking
11989 a check for __argslist.
11991 2005-12-30 Miguel de Icaza <miguel@novell.com>
11993 * expression.cs (ParameterReference.DoResolveBase): Allow
11994 reference parameters if they are local to this block.
11996 This allows the ref and out parameters of a delegate to be used in
11997 an anonymous method, for example:
11999 delegate void set (out int x);
12001 set s = delegate (out int x){
12005 This is used by functionality introduced late in the C# language.
12007 * anonymous.cs (AnonymousMethod.Compatible): Allow anonymous
12008 method that take ref and out parameters.
12010 Fixes #77119 which was a late change in the spec.
12012 2005-12-23 Miguel de Icaza <miguel@novell.com>
12014 * anonymous.cs (ScopeInfo.LinkScope): Do not link the scope to its
12015 parent if its the same scope. Fixes #77060.
12017 2005-12-21 Miguel de Icaza <miguel@novell.com>
12019 * driver.cs: Report the case of no source files and no -out:
12022 2005-12-20 Raja R Harinath <rharinath@novell.com>
12025 * expression.cs (ComposedCast.GetSignatureForError): Define.
12027 2005-12-18 Carlos Alberto Cortez <calberto.cortez@gmail.com>
12031 * namespace.cs (NamespaceEntry): Add extern_aliases as a
12032 ListDictionary, to contain the ExternAliasEntry entries (in
12033 addition to the NamespaceEntry.aliases hashtable). This field is
12034 shared between the original entry and its doppelganger (bodyless
12036 (NamespaceEntry.UsingExternalAlias): Add the extern alias entry to
12037 extern_aliases field.
12038 (NamespaceEntry.Lookup): Move the IsImplicit check after the
12039 lookup in extern_aliases.
12041 2005-12-16 Raja R Harinath <rharinath@novell.com>
12044 * class.cs (TypeContainer.Mark_HasEquals): New.
12045 (TypeContainer.Mark_HasGetHashCode): New.
12046 (ClassPart): Override them.
12047 (MethodCore.CheckBase): Use them instead of referring to Parent.Methods.
12050 * enum.cs (EnumMember.EnumMember): Pass the parent_enum as the
12051 'parent' argument to the base constructor.
12053 Remove all mention of TypeContainer from decl.cs.
12054 * decl.cs (MemberCore.Parent): Change into a DeclSpace.
12055 (MemberCore.MemberCore): Change type of 'parent' argument to DeclSpace.
12056 (DeclSpace.DeclSpace): Likewise.
12057 (DeclSpace.DefineMembers): Remove unused argument.
12058 * cs-parser.jay (pop_current_class): Update to changes. Simplify
12059 debugging check -- we don't care if the debug code throws an
12060 InvalidCastException instead of an InternalErrorException.
12061 * class.cs (TypeContainer.DefineMembers): Update to changes.
12062 (TypeContainer.DoDefineMembers): Likewise.
12063 (TypeContainer.GetMethods): Likewise.
12064 (PropertyMember.Define): Likewise.
12065 (MemberBase.Parent): New property that forwards to
12066 MemberCore.Parent, but ensures that we get a TypeContainer.
12067 * rootcontext.cs (RootContext.PopulateCoreType): Update to changes.
12068 (RootContext.PopulateTypes): Likewise. Remove special case code
12069 for !RootContext.StdLib: DefineMembers is idempotent.
12071 2005-12-14 Miguel de Icaza <miguel@novell.com>
12073 * convert.cs (ExplicitConversionCore): Check the return value from
12074 ExplicitConversionCore which can return null on failure. Fixes #76914
12076 2005-12-13 Marek Safar <marek.safar@seznam.cz>
12078 * class.cs (Method.ApplyAttributeBuilder): Test out modifier properly.
12080 2005-12-11 Atsushi Enomoto <atsushi@ximian.com>
12082 * doc.cs : The search for referenced namespace was insufficient to
12083 get global one as it used to do. Fixed bug #76965.
12085 2005-12-10 Atsushi Enomoto <atsushi@ximian.com>
12087 * doc.cs : check name in cref in the last phase that whether it is
12090 2005-12-09 Atsushi Enomoto <atsushi@ximian.com>
12092 * cs-tokenizer.cs : reverted the latest change: it somehow broke
12095 2005-12-09 Atsushi Enomoto <atsushi@ximian.com>
12097 * doc.cs : so it turned out that we cannot skip override check for
12098 interface members. Fixed bug #76954.
12100 2005-12-09 Atsushi Enomoto <atsushi@ximian.com>
12102 * cs-tokenizer.cs : fixed bug #75984:
12103 - #warning and #error should not be handled when the source line
12105 - #line is not checked strictly when the source line is disabled.
12106 - #define and #undef is on the other hand checked strictly at any
12109 2005-12-08 Atsushi Enomoto <atsushi@ximian.com>
12111 * cs-tokenizer.cs : missing Location (actually, filename) in one of
12114 2005-12-05 Marek Safar <marek.safar@seznam.cz>
12116 * attribute.cs (GlobalAttribute.ctor): Pass NamespaceEntry only.
12118 * class.cs (EmitFieldInitializers): Simplified and fixed to work with
12119 event initializers.
12120 (FieldBase.EmitInitializer): Moved from TypeContainer and simplified.
12121 (FieldBase.Initializer): Initializer is now optional.
12122 (EventField.Define): Only event field can have initializer.
12124 * codegen.cs (EmitContext): DeclSpace is not readonly (small hack).
12126 * const.cs (Const): Reuse initializer.
12128 * cs-parser.jay: Updated after FieldBase changes.
12129 Added current_array_type to simplify array initializers.
12131 * ecore.cs (NullCast.IsDefaultValue): Implemented.
12133 * expression.cs, iterators.cs: Updated.
12135 * namespace.cs (NamespaceEntry): Made UsingFound private.
12137 2005-12-05 Marek Safar <marek.safar@seznam.cz>
12139 * parameterCollection.cs: Obsolete, removed.
12140 * parser.cs: Obsolete, removed.
12142 2005-12-05 Marek Safar <marek.safar@seznam.cz>
12145 * class.cs (Constructor.Emit): Set obsolete checking for whole context.
12147 * enum.cs (Enum.Define): Set obsolete context here.
12149 2005-12-05 Atsushi Enomoto <atsushi@ximian.com>
12152 - FindDocumentedMember() now expects 1) paramList as null
12153 when "we don't have to check the number of parameters" and
12154 2) Type.EmptyTypes when "there is no arguments".
12155 - Introduced FoundMember struct to hold the exact type which was
12156 used to find the documented member (the above change broke
12157 test-xml-044; it might be better just to use DeclaringType than
12158 what MS does, like this change does, but it depends on usage.)
12160 2005-12-05 Atsushi Enomoto <atsushi@ximian.com>
12162 * doc.cs : documented member might be from DeclaringType for nested
12163 types. Fixed bug #76782.
12165 2005-12-03 Ben Maurer <bmaurer@ximian.com>
12167 * anonymous.cs: Have the param code handle leaving copies on the
12168 stack etc. Allows anonymous params to take part in the assignment
12169 code (++, +=, etc). Fixes bug #76550
12171 * expression.cs: Handle the prepare_for_load/leave_copy by passing
12172 it down to the anon code.
12174 * iterators.cs: Use dummy var here
12176 * codegen.cs: Handle new vars
12178 2005-12-01 Marek Safar <marek.safar@seznam.cz>
12181 * class.cs (MethodData.Define): Set proper Obsolete context.
12183 * ecore.cs (FieldExpr.ResolveMemberAccess): Don't check [Obsolete] in
12185 (FieldExpr.DoResolve): Ditto.
12187 2005-12-01 Marek Safar <marek.safar@seznam.cz>
12190 * class.cs (MethodCore.DoDefineParameters): Test [Obsolete] only when
12191 parent is not obsolete.
12193 2005-12-01 Atsushi Enomoto <atsushi@ximian.com>
12195 * doc.cs : (FindDocumentedMember) find parameterless members first
12196 and get CS0419 in the early stage. Fixed first case of bug #76727.
12198 2005-11-30 Marek Safar <marek.safar@seznam.cz>
12201 * ecore.cs (Expression.ResolveAsConstant): Report constant error only when
12202 no error was reported.
12204 *expression.cs (Binary.DoResolve): left can be null.
12206 2005-11-22 Marek Safar <marek.safar@seznam.cz>
12209 * class.cs (MethodData.Emit): Parameters should be labeled first.
12211 2005-11-21 Marek Safar <marek.safar@seznam.cz>
12214 * parameter.cs (Parameter.ApplyAttributeBuilder): Fixed `ref' detection.
12216 2005-11-18 Marek Safar <marek.safar@seznam.cz>
12218 * attribute.cs (AreParametersCompliant): Moved to Parameter.
12220 * class.cs (MethodCore): Parameter clean up.
12221 (IMethodData): Added ParameterInfo.
12222 (MethodData): Parameter clean up.
12223 (Indexer.Define): Parameter clean up.
12235 * typemanager.cs: Parameter clean up.
12237 * delegate.cs (Define): Get rid of duplicated code.
12239 * expression.cs (ParameterReference): Removed useless parameters
12241 (Invocation): Ditto.
12243 * parameter.cs (ParamsParameter): New class, params specialization.
12244 (ArglistParameter): Attemp to separate arglist.
12245 (Parameter): Refactored to be reusable and faster.
12246 (Parameter.Modifier): Made understandable.
12247 (Parameters): Changed to be used as a class for `this' assembly
12248 parameters. Refactored to use new specialized classes.
12250 * support.cs (ParameterData): Added Types property.
12251 (InternalParameters): Deleted.
12253 2005-08-20 Martin Baulig <martin@ximian.com>
12255 Merging this patch from GMCS to fix #75867.
12257 * anonymous.cs (CaptureContext.CaptureThis): Create the topmost
12258 scope if we don't already have it.
12260 2005-11-17 Martin Baulig <martin@ximian.com>
12263 (CaptureContext.EmitMethodHostInstance): Use `Ldarg_0' if we
12264 inherit the scope from our parent. Fixes #76653.
12266 2005-11-16 Atsushi Enomoto <atsushi@ximian.com>
12268 * doc.cs : the previous patch does not actually fix the bug.
12269 PropertyInfo override check is now implemented and really fixed it.
12270 * expression.cs : Invocation.IsAncestralType() is used from doc.cs.
12272 2005-11-16 Atsushi Enomoto <atsushi@ximian.com>
12274 * doc.cs : apply "override filter" also to properties.
12277 2005-11-16 Atsushi Enomoto <atsushi@ximian.com>
12279 * doc.cs : renamed FindMembers() to FindMethodBase(). For interfaces,
12280 no need to check overrides. For classes, omit those results from
12281 interfaces since they must exist in the class. Fixed bug #76726.
12283 2005-11-15 Atsushi Enomoto <atsushi@ximian.com>
12285 * typemanager.cs : (GetFullNameSignature) differentiate indexers
12286 with different parameters. Fixed the second problem in #76685.
12288 2005-11-15 Atsushi Enomoto <atsushi@ximian.com>
12290 * doc.cs : (FindDocumentedMember) pass invocation_type as well (to
12291 get expected 'protected' access in CheckValidFamilyAccess()).
12294 2005-11-15 Atsushi Enomoto <atsushi@ximian.com>
12296 * doc.cs : (GenerateTypeDocComment) Fields could be FixedField.
12297 Fixed bug #76705. CS1569 was incorrectly commented out.
12299 2005-11-14 Atsushi Enomoto <atsushi@ximian.com>
12301 * doc.cs : use Invocation.IsOverride() to do real override check.
12302 * expression.cs : made Invocation.IsOverride() internal.
12304 2005-11-14 Atsushi Enomoto <atsushi@ximian.com>
12306 * doc.cs : use TypeManager.FindMembers() instead of (possible)
12307 TypeBuilder.FindMembers() and filter overriden base members out.
12310 2005-11-13 Atsushi Enomoto <atsushi@ximian.com>
12312 * doc.cs : ref/out parameters are represented as '@' (instead of
12313 '&' in type FullName). Fixed bug #76630 (additionally crefs).
12315 2005-11-13 Atsushi Enomoto <atsushi@ximian.com>
12317 * doc.cs : when there was no '.' in cref to methods in doc comment,
12318 then parameters were missing in the output. Fixed bug #76691.
12320 2005-11-13 Atsushi Enomoto <atsushi@ximian.com>
12322 * driver.cs : don't output docs when there is an error.
12325 2005-11-13 Atsushi Enomoto <atsushi@ximian.com>
12328 Now it should detect indexers. Fixed primary concern in bug #76685.
12329 Fixed CS0419 message to not show the identical member signature in
12332 2005-11-13 Atsushi Enomoto <atsushi@ximian.com>
12334 * doc.cs : (FindDocumentedMember) use TypeManager.MemberLookup()
12335 instead of Type.FindMembers() since it does not handle events.
12338 2005-11-12 Gert Driesen <drieseng@users.sourceforge.net>
12340 * codegen.cs: Fixed typo (speficied -> specified).
12342 2005-11-11 Marek Safar <marek.safar@seznam.cz>
12345 * doc.cs (FindDocumentedTypeNonArray): Don't resolve again.
12347 2005-11-11 Marek Safar <marek.safar@seznam.cz>
12349 * attribute.cs: Changed error message.
12351 * cs-tokenizer.cs: One more check.
12353 2005-11-10 Marek Safar <marek.safar@seznam.cz>
12355 * statement.cs (Block.Resolve): Ignore empty statement.
12357 2005-11-10 Marek Safar <marek.safar@seznam.cz>
12359 * report.cs: Made error/warning methods more strict to avoid
12362 * anonymous.cs, attribute.cs, class.cs, codegen.cs, constant.cs,
12363 convert.cs, cs-parser.jay, cs-tokenizer.cs, decl.cs, delegate.cs,
12364 doc.cs, driver.cs, ecore.cs, expression.cs, location.cs,
12365 namespace.cs, parameter.cs, statement.cs, typemanager.cs: Updated.
12367 2005-11-08 Marek Safar <marek.safar@seznam.cz>
12369 * attribute.cs (Attribute.GetCoClassAttributeValue): New method.
12370 (AttributeTester.GetCoClassAttribute): Get CoClassAttribute.
12372 * class.cs (TypeContainer.IsComImport): New property.
12373 (Constructor.Define): Create proper ctor for ComImport types.
12375 * expression.cs (New.CheckComImport): Fixed.
12377 2005-11-07 Miguel de Icaza <miguel@novell.com>
12379 * anonymous.cs (CaptureContext.AddParameterToContext): The fact
12380 that a parameter has been captured does not mean that we do not
12381 have to do the rest of the processing. This fixes the second part
12382 of #76592. If there was another anonymous method capturing
12383 values in the past, the Scope would never be set for the second
12384 method that captured the same parameter.
12386 (CaptureContext.EmitAssignParameter): When `leave_copy' is passed,
12387 properly manipulate the stack. Second part of fix for #76592.
12389 * expression.cs (New): Add support for invoking "new" on
12390 interfaces that have been flagged with the ComImport attribute and
12391 the CoClass. Fixes #76637
12393 * statement.cs (Try.DoEmit): When a variable is captured, do not
12394 try to emit the vi.LocalBuilder variable as it has been captured.
12395 Create a temporary variable and store the results on the
12396 FieldBuilder. Fixes #76642
12398 2005-11-07 Marek Safar <marek.safar@seznam.cz>
12400 * class.cs (CheckPairedOperators): Made compilable with csc 2.0.
12402 * ecore.cs (InstanceResolve): Fixed CS1540 detection.
12404 * expression.cs (Binary.DoResolve): Added && optimalization.
12406 * typemanager.cs (AddUserType): Removed useless argument.
12408 2005-11-04 Marek Safar <marek.safar@seznam.cz>
12410 * statement.cs (Block.variables): Uses ListDictionary.
12412 2005-11-03 Marek Safar <marek.safar@seznam.cz>
12415 * class.cs (PartialContainer.EmitType): Customized to emit
12416 security attributes.
12417 (ClassPart.ApplyAttributeBuilder): Transform security attribute
12418 for partial classes.
12420 2005-11-03 Marek Safar <marek.safar@seznam.cz>
12423 * expression.cs (ElementAccess.DoResolveLValue): Fixed buffer
12424 access has to be fixed.
12426 * typemanager.cs (IsUnmanagedType): Wrong common field type.
12428 2005-11-01 Marek Safar <marek.safar@seznam.cz>
12431 * ecore.cs (NullCast.Reduce): Implemented.
12433 * expression.cs (ArrayCreation.CheckIndices): Correcly check
12436 * statement.cs (SwitchLabel.ResolveAndReduce): Catch null
12438 (Foreach.Resolve): Catch null properly.
12440 2005-10-29 Marek Safar <marek.safar@seznam.cz>
12442 * cs-tokenizer.cs: Warning text fix.
12444 * driver.cs: AllWarningNumbers exposed on public interface.
12446 * report.cs (): Reviewed warning numbers.
12447 (IsValidWarning): Use binary search.
12449 2005-10-29 Marek Safar <marek.safar@seznam.cz>
12451 * driver.cs: Implemeted resource visibility.
12452 (Resources): New class for code sharing between /res: and
12455 2005-10-28 Marek Safar <marek.safar@seznam.cz>
12458 * cfold.cs (ConstantFold.BinaryFold): Implemented null cast
12461 * convert (Convert.ImplicitReferenceConversion): NullCast holds
12464 * ecore.cs (NullCast): Child is contant only.
12466 * literal.cs (NullLiteral.Reduce): null can be converted to any
12469 2005-10-28 Kornél Pál <kornelpal@hotmail.com>
12471 * driver.cs: Use Encoding.Default as default code page instead
12474 2005-10-27 Raja R Harinath <rharinath@novell.com>
12477 * expression.cs (Invocation.Error_InvalidArguments): Handle
12478 __arglist parameters.
12479 (Invocation.VerifyArgumentsCompat): Likewise.
12480 * support.cs (ReflectionParameters.GetSignatureForError): Print
12481 __arglist parameters.
12482 (InternalParamters.GetSignatureForError): Likewise.
12483 * parameter.cs (Parameters.GetSignatureForError): Likewise.
12485 2005-10-26 Marek Safar <marek.safar@seznam.cz>
12487 * attribute.cs (GetPropertyValue): Made public.
12489 * codegen.cs (AssemblyClass): ResolveClsCompliance renamed to
12491 Add new property WrapNonExceptionThrows to handle 2.0 assembly
12493 (AssemblyClass.Emit): Emit RuntimeCompatibilityAttribute when it
12496 * driver.cs: Reflect method name change.
12498 * statement.cs (Try.Resolve): Warn when try has both general
12499 exception handlers.
12501 * typemanager.cs: runtime_compatibility_attr_type new predefined
12504 2005-10-26 Raja R Harinath <harinath@gmail.com>
12507 * pending.cs (InterfaceMethod): Allow tm.args [i] to be null --
12508 treat it as an empty parameter list.
12510 2005-10-26 Raja R Harinath <rharinath@novell.com>
12513 * ecore.cs (SimpleName.DoSimpleNameResolve): Make fall-back
12514 ResolveAsTypeStep silent.
12515 * statement.cs (Block.AddConstant): Mark block as used.
12516 (Block.ResolveMeta): Avoid piling on error messages
12517 if a constant initializer resolution fails.
12519 2005-10-25 Raja R Harinath <rharinath@novell.com>
12521 * namespace.cs (RootNamespace.VerifyUsingForAll, Namespace.VerifyUsing):
12523 (NamespaceEntry.VerifyAllUsing): New.
12524 (NamespaceEntry.AliasEntry.Resolve): New. Handles common error
12525 behaviour. Delegates actual resolution of alias to ...
12526 (NamespaceEntry.DoResolve): ... this. Renamed from Resolve.
12527 (NamespaceEntry.LocalAliasEntry, NamespaceEntry.ExternAliasEntry):
12529 * driver.cs (Driver.MainDriver): Update.
12531 * namespace.cs (NamespaceEntry.DefineNamespace): Remove.
12532 (NamespaceEntry.SymbolFileID): Make into a on-demand computed
12534 (Namespace.DefineNamespaces, RootNamespace.DefineNamespacesForAll):
12536 * symbolwriter.cs (SymbolWriter.Initialize): Don't call
12537 RootNamespace.DefineNamespacesForAll.
12539 2005-10-24 Raja R Harinath <harinath@gmail.com>
12541 * typemanager.cs (assemblies, external_aliases, modules)
12542 (AddAssembly, AddExternAlias, AddModule GetAssemblies, Modules)
12543 (ComputeNamespaces, GetRootNamespace): Remove extra staging
12544 overhead. Move resposibility ...
12545 * namespace.cs (GlobalRootNamespace): ... here. Update to changes.
12546 * driver.cs, attribute.cs, codegen.cs: Update to changes.
12548 2005-10-23 Raja R Harinath <harinath@gmail.com>
12550 * namespace.cs (RootNamespace.all_namespaces): Renamed from
12551 cached_namespaces. Improve usage.
12552 (RootNamespace.Reset, RootNamespace.RegisterNamespace)
12553 (RootNamespace.VerifyUsingForAll, RootNamespace.DefineNamespacesForAll):
12554 Move from GlobalRootNamespace and simplify.
12555 (RootNamespace.Global): Make instance variable.
12556 (RootNamespace.RootNamespace): Add "alias name" parameter.
12557 (GlobalRootNamespace): Simplify drastically.
12558 (Namespace.Lookup): Don't use GetNamespace.
12559 * typemanager.cs (GetRootNamespace): Rename from
12560 ComputeNamespaceForAlias.
12561 (NamespaceClash): Use Global.IsNamespace instead of GetNamespace.
12563 2005-10-23 Marek Safar <marek.safar@seznam.cz>
12565 * anonymous.cs (AnonymousContainer): Don't crash when container
12568 2005-10-23 Marek Safar <marek.safar@seznam.cz>
12570 * expression.cs (Binary.DoResolve): Warn when comparing same
12573 2005-10-23 Marek Safar <marek.safar@seznam.cz>
12576 * expression.cs (Binary.DoResolve): It looks like there are no
12577 convetsion rules in enum context.
12579 2005-10-19 Carlos Alberto Cortez <calberto.cortez@gmail.com>
12581 Add support for extern alias qualifiers.
12582 * typemanager.cs: Move some LookupTypeReflection code
12583 to namespace.cs, to have cleaner code. Added some methods
12584 to help us keep track of the extern aliased references.
12585 * driver.cs: Add suport for extern alias assemblies on command
12586 line and check for their warnings/errors. Also keep track of the
12587 extern aliased assemblies.
12588 * namespace.cs: Move the global functionality of Namespace
12589 to GlobalRootNamespace/RootNamespace. Now the global namespace
12590 is GlobalRootNamespace.Globa. Also the code moved from
12591 typemanager.cs lives in GlobalRootNames.cs/RootNamespace.cs.
12592 Finally added LocalAliasEntry (AliasEntry before) and
12593 ExternAliasEntry, to handle alias statements.
12594 * cs-parser.jay: Add support in the grammar for extern alias
12596 * doc.cs, delegate.cs, expression.cs ecore.cs, symbolwriter.cs:
12597 Update callings to Namespace (now in GlobalRootNamespace).
12599 2005-10-18 Raja R Harinath <rharinath@novell.com>
12602 * class.cs (TypeContainer.DefineType): Move updating of
12603 topological sort earlier in the code.
12604 * decl.cs (DeclSpace.ResolveBaseTypeExpr): Don't use TypeBuilder.
12606 2005-10-18 Marek Safar <marek.safar@seznam.cz>
12609 * cfold.cs (BinaryFold): Reduce constant in enum conversion.
12611 * constant.cs (Constant.TryReduce): Moved from Cast class.
12612 (Reduce): Made little bit more OO and fixed missing conversions.
12614 * ecore.cs (Reduce): Implemented.
12615 (Binary.EnumLiftUp): New method to upgrade values to enum values.
12617 * literal.cs (Reduce): Implemented.
12619 * class.cs: Reverted Miguel's wrong commit.
12621 2005-10-14 Miguel de Icaza <miguel@novell.com>
12623 * ecore.cs (GetMemberType): Report the correct mapping for the MemberCore
12625 2005-10-14 Atsushi Enomoto <atsushi@ximian.com>
12627 * cs-parser.jay, expression.cs : CS0214 was missing error location
12628 for constants. Fixed bug #76404.
12630 2005-10-11 Marek Safar <marek.safar@seznam.cz>
12633 * convert.cs (ExplicitConversionCore): Fixed object->enum
12636 2005-10-10 Raja R Harinath <rharinath@novell.com>
12638 * ecore.cs (PropertyExpr.Emit): Use Invocation.EmitCall to emit
12639 InstanceExpression.
12640 (PropertyExpr.EmitCall): Likewise.
12641 * expression.cs (Invocation.EmitArguments): Handle case where
12643 (Invocation.EmitCall): Avoid allocating temporary variable if
12644 there are no arguments.
12646 2005-10-07 Raja R Harinath <rharinath@novell.com>
12649 * convert.cs (ImplicitConversionStandard): Move conversion of
12650 void* to arbitrary pointer types ...
12651 (ExplicitConversionStandard): .. here.
12652 * ecore.cs (Expression.Error_ValueCannotBeConverted): Fix CS0266
12653 error to always print typenames.
12655 2005-10-07 Raja R Harinath <rharinath@novell.com>
12657 * convert.cs (GetConversionOperator): Rename from
12658 GetConversionOperators. Move operator selection code from ...
12659 (UserDefinedConversion): ... here.
12661 2005-10-06 Marek Safar <marek.safar@seznam.cz>
12663 * convert.cs (ExplicitConversionCore): Removed duplicate enum
12666 2005-10-05 Marek Safar <marek.safar@seznam.cz>
12668 * assign.cs (Assign.DoResolve): Error method changed.
12670 * cfold.cs (DoConstantNumericPromotions): Error method changed.
12672 * const.cs (ResolveValue): Reset in_transit immediately.
12674 * constant.cs: Error method changed.
12676 * convert.cs: Removed useless location parameter.
12677 (ExplicitNumericConversion): Don't do double enum check.
12678 (ExplicitConversionCore): Renamed from ExplicitConversion.
12679 (ExplicitUnsafe): Extracted from ExplicitConversion.
12680 (ExplicitConversion): Uses for error reporting.
12682 * ecore.cs (Error_ValueCannotBeConverted): More logic for more
12684 (ResolveBoolean): Uses common error method.
12685 (CastToDecimal): Get rid of ec.
12686 (CastFromDecimal): Optimized.
12687 (ConvCast): Get rid of ec.
12689 * enum.cs (ResolveValue): Reset in_transit immediately.
12690 (Emit): Return after first error.
12692 * expression.cs: Convert changes.
12694 * literal.cs: Error method changed.
12696 * statement.cs: Error method changed.
12698 2005-10-03 Raja R Harinath <rharinath@novell.com>
12700 * support.cs (SeekableStreamReader.Position): Don't error out when
12701 the requested position is just beyond the end of the current
12704 2005-09-28 Raja R Harinath <rharinath@novell.com>
12706 * support.cs (SeekableStreamReader): Simplify drastically. Don't
12707 try to keep in sync with the byte count of the underlying Stream.
12708 However, this limits us to a window size of 2048 characters: i.e.,
12709 the maximum lookahead of our lexer/parser can be 2048 characters.
12711 2005-09-28 Marek Safar <marek.safar@seznam.cz>
12714 * driver.cs: Fix compilation files with full root path.
12716 2005-09-25 Miguel de Icaza <miguel@novell.com>
12718 * report.cs (SymbolRelatedToPreviousError): Format the output so
12719 it does not use an open parenthesis that is never closed.
12721 * driver.cs: Follow coding guidelines
12723 2005-09-27 Marek Safar <marek.safar@seznam.cz>
12726 * const.cs (Const.ResolveValue): Check for assigning non-null
12727 value to reference type.
12729 2005-09-27 Marek Safar <marek.safar@seznam.cz>
12731 * anonymous.cs: Implemented ExprClassName.
12733 * assign.cs (Assign.DoResolve): Don't chrash when type is not
12736 * attribute.cs (ResolveArguments): Enabled MethodImplOptions
12739 * class.cs (StaticClass.DefineContainerMembers): Report protected
12742 * codegen.cs: if(ed) PRODUCTION.
12744 * convert.cs (Error_CannotImplicitConversion): Better error
12747 * cs-parser.jay: More error checks.
12749 * cs-tokenizer.cs (consume_identifier): Fixed Miguel's revert.
12751 * driver.cs (CSCParseOption): Enabled wrong option check.
12753 * ecore.cs (Expression.ExprClassName): Turned to property.
12754 (MemberExpr.CheckIntermediateModification): For checking boxed
12755 value types modification.
12757 * statement.cs (Fixed.Resolve): Expression type must be
12758 convertible to fixed type.
12759 (CollectionForeach.GetEnumeratorFilter,TryType):
12760 Small refactoring for easier error checking.
12762 2005-09-26 Marek Safar <marek.safar@seznam.cz>
12764 * attribute.cs (Attribute.Resolve): Check Obsolete attribute for
12767 * class.cs (GeneratedBaseInitializer): New class for customization
12768 compiler generated initializers.
12769 (MemberBase.DoDefine): Check Obsolete attribute here.
12770 (FieldMember.DoDefine): Ditto.
12772 * const.cs (ExternalConstant.CreateDecimal): Builder for decimal
12775 * decl.cs (MemberCore.EmitContext): Returns valid current ec.
12776 (MemberCore.GetObsoleteAttribute): Removed argument.
12777 (MemberCore.CheckObsoleteness): Obsolete attributes are hierarchic.
12778 (MemberCore.CheckObsoleteType): New helper.
12782 * statement.cs: Updates after MemberCore changes.
12784 * ecore.cs (TypeExpr.ResolveType): Check type obsoleteness here.
12785 (FieldExpr.ResolveMemberAccess): Fixed decimal constants checks.
12787 * expression.cs (ComposedCast.DoResolveAsTypeStep): Don't check
12788 obsolete attribute for compiler construct.
12789 (As.DoResolve): Cache result.
12791 * iterators.cs (Define_Constructor): Use GeneratedBaseInitializer.
12793 2005-09-26 Raja R Harinath <rharinath@novell.com>
12796 * expression.cs (This.VerifyFixed): In a value type T, the type of
12797 'this' is T&, iow, 'this' is either an out or ref parameter. In a
12798 value type R, 'this' is treated as a value parameter.
12800 2005-09-22 Miguel de Icaza <miguel@novell.com>
12802 * statement.cs (Lock): Use the TemporaryVariable class instead of
12803 manually using local variables as those do not work when variables
12806 * ecore.cs: Moved the TemporaryVariable class from being a nested
12807 class inside Foreach to be a public class that can be employed in
12810 2005-09-19 Marek Safar <marek.safar@seznam.cz>
12812 * cs-parser.jay: interface_accessors replaced by
12813 accessor_declarations.
12815 * ecore.cs, literal.cs, statement.cs: NullLiteral holds null
12818 * statement.cs (GotoCase.Resolve): Convert null constant to
12820 (SwitchLabel.ResolveAndReduce): Ditto.
12821 (SwitchLabel.NullStringCase): Custom null stamp.
12822 (Switch.SimpleSwitchEmit): Fix from NullLiteral to NullStringCase.
12824 typemanager.cs (CSharpSignature): Don't skip first argument
12827 2005-09-18 Miguel de Icaza <miguel@novell.com>
12829 * driver.cs: Set InEmacs based on the environment variable EMACS.
12831 * location.cs (InEmacs): in this mode, do not report column
12832 location as it confuses Emacs.
12834 2005-09-16 Marek Safar <marek.safar@seznam.cz>
12836 * cfold.cs, constant.cs, convert.cs, ecore.cs,
12837 expression.cs, iterators.cs, literal.cs: Store constants and
12840 * class.cs (MemberBase.ShortName): Pass location.
12842 * cs-parser.jay: Some location fixes.
12844 * ecore.cs (Expression.Location): Made virtual.
12846 2005-09-05 Miguel de Icaza <miguel@novell.com>
12848 * expression.cs (Cast.TryReduce): Only reduce to an EnumConstant
12849 if the underlying types are the same, otherwise we need to produce
12850 code that will do the proper cast.
12852 This was exposed by Marek's constant rewrite which produced
12853 invalid code for the call site:
12855 enum X : long { a }
12856 void Method (X v) {}
12860 This fixes test-49.cs
12862 2005-09-05 Atsushi Enomoto <atsushi@ximian.com>
12864 * attribute.cs : (Attribute.IsValidArgumentType): array of string/
12865 Type/Object should be allowed as well. Fixed bug #75968.
12867 2005-09-05 Atsushi Enomoto <atsushi@ximian.com>
12869 * expression.cs : (Binary.DoResolve): when one is enum constant and
12870 another is constant 0, then return enum one *as enum type*.
12873 2005-09-02 Raja R Harinath <rharinath@novell.com>
12875 * attribute.cs (GetMarshal): Work even if "DefineCustom" is
12879 * ecore.cs (SimpleNameResolve.DoSimpleNameResolve): Disable
12880 flow-branching for LocalVariableReferences in case we were invoked
12881 from a MemberAccess.
12882 * expression.cs (LocalVariableReference.VerifyAssigned): New.
12884 (LocalVariableReference.DoResolveBase): ... this.
12885 (MemberAccess.Resolve): Do the check that was disabled during
12888 2005-09-01 Atsushi Enomoto <atsushi@ximian.com>
12891 (PartialContainer.Create): check abstract/sealed/static strictly
12892 but abstract/sealed can exist only at one side. Fixed bug #75883.
12894 2005-09-01 Kornél Pál <kornelpal@hotmail.com>
12897 * attribute.cs (Attribute.GetMarshal): If ArraySubType is not
12898 specified, don't default to UnmanagedType.I4.
12900 2005-09-01 Atsushi Enomoto <atsushi@ximian.com>
12902 * expression.cs : conditional operator should check possibly
12903 incorrect assign expression. Fixed bug #75946.
12905 2005-08-31 Atsushi Enomoto <atsushi@ximian.com>
12907 * cs-tokenizer.cs, cs-parser.jay, driver.cs, support.cs :
12908 Reverting the change. gmcs is much complex than mcs on this matter.
12910 2005-08-31 Atsushi Enomoto <atsushi@ximian.com>
12912 * cs-tokenizer.cs : To read another token ahead of the actual
12913 consumption, use new SavedToken and cache token instead of moving
12914 back the stream with SeekableStreamReader (it seemed problematic).
12916 driver.cs : Thus use StreamReader directly.
12917 * support.cs : Thus removed SeekableStreamReader.
12919 2005-08-30 Raja R Harinath <rharinath@novell.com>
12922 * anonymous.cs (ScopeInfo.MakeFieldName): New helper.
12923 (ScopeInfo.EmitScopeType): Use it to construct field names from
12924 names of captured locals.
12927 * ecore.cs (BoxedCast.BoxedCast) [1-argument variant]: Remove.
12928 * convert.cs (ImplicitReferenceConversion, TryImplicitIntConversion):
12929 Pass 'target_type' to BoxedCast. Don't default to 'object'.
12930 (ExplicitConversion): Remove enum cases already handled by
12931 implicit conversion. Move implicit conversion check to the beginning.
12932 * delegate.cs (DelegateCreation.ResolveMethodGroupExpr): Update.
12933 * expression.cs (ArrayCreation.EmitDynamicInitializers):
12934 Don't treat System.Enum as a struct.
12936 2005-08-30 Jb Evain <jbevain@gmail.com>
12938 * attribute.cs: handles as expression in parameters.
12940 2005-08-30 Raja R Harinath <rharinath@novell.com>
12943 * class.cs (TypeContainer.VerifyClsName): Don't use a
12944 PartialContainer when verifying CLS compliance.
12945 (AbstractPropertyEventMethod): Set Parent here, ...
12946 (PropertyMethod): ... not here.
12948 2005-08-30 Atsushi Enomoto <atsushi@ximian.com>
12950 * attribute.cs : escaped attribute name should not be allowed to be
12951 resolved (e.g. @class as classAttribute). Fixed bug #75930.
12953 2005-08-29 Raja R Harinath <rharinath@novell.com>
12956 * convert.cs (ImplicitStandardConversionExists): Allow zero also
12957 when converting a long constant to unsigned long.
12958 * expression.cs (Invocation.OverloadResolve): Add sanity check to
12959 detect where IsApplicable and VerifyArgumentsCompat disagree.
12961 2005-08-29 Raja R Harinath <rharinath@novell.com>
12962 and Carlos Alberto Cortez <carlos@unixmexico.org>
12965 * class.cs (TypeContainer.CanElideInitializer): New helper.
12966 (TypeContainer.EmitFieldInitializers): Use it to determine if we
12967 can safely emitting the initializer of a field.
12969 2005-08-25 Atsushi Enomoto <atsushi@ximian.com>
12971 * statement.cs : (Continue.Resolve()) Unlike break, continue is not
12972 allowed inside a switch (without loop). Fixed bug #75433.
12974 2005-08-26 Kornél Pál <kornelpal@hotmail.com>
12976 * AssemblyInfo.cs: Using Consts.MonoVersion instead of MonoVersion.cs.
12977 * mcs.exe.sources: Using Consts.MonoVersion instead of MonoVersion.cs.
12979 2005-08-25 Atsushi Enomoto <atsushi@ximian.com>
12981 * driver.cs : kinda reverting the default encoding changes (not exact
12982 revert since I noticed that "codepage:reset" might not work fine).
12984 2005-08-25 Atsushi Enomoto <atsushi@ximian.com>
12986 * class.cs : (AbstractPropertyEventMethod) SetupName() now takes
12987 Location. Now getter and setter store location correctly.
12988 (errors/cs0111-12.cs now reports the expected location.)
12990 2005-08-25 Atsushi Enomoto <atsushi@ximian.com>
12992 * driver.cs : Use default encoding on the environment.
12993 Removed (now that) extra parameter for SeekableStreamReader.
12994 * support.cs : (SeekableStreamReader) third .ctor() argument for
12995 StreamReader is not required (always true). preamble size could
12996 be acquired in simpler and safe way.
12998 2005-08-24 Atsushi Enomoto <atsushi@ximian.com>
13000 * cs-parser.jay: report CS0642 at warning level 3
13001 and report CS0642 for an if else statement also
13002 fixes bug #74745. Patch by John Luke (and a bit
13004 Removed extra CS0642 warning check for "while",
13006 * statement.cs: In Block.Resolve(), CS0642 check
13007 is reimplemented to check a sequence of an empty
13008 statement and a block.
13010 Both fix bug #66777.
13012 2005-08-24 Marek Safar <marek.safar@seznam.cz>
13014 * attribute.cs (GetMethodObsoleteAttribute): Disabled obsolete properties
13015 detection until I fix it.
13017 * cs-tokenizer.cs: Changed error message.
13019 * cs-parser.jay: Fixed 2 error locations.
13021 * ecore.cs (Error_TypeDoesNotContainDefinition): Share error message.
13022 (PropertyExpr.Error_PropertyNotFound): First attempt to detect non C#
13025 * enum.cs (GetSignatureForError): Fixed.
13027 * expression.cs (Invocation.IsSpecialMethodInvocation): Improved special
13031 * typemanager.cs (RegisterProperty): Removed.
13033 * statement.cs (CheckInvariantMeaningInBlock): Changed error message.
13035 2005-08-24 Raja R Harinath <rharinath@novell.com>
13038 * expression.cs (ArrayAccess.EmitLoadOpcode): Emit ldelem.i for pointers.
13039 (ArrayAccess.GetStoreOpcode): Return stelem.i for pointers.
13041 2005-08-23 Atsushi Enomoto <atsushi@ximian.com>
13043 * expression.cs : tiny fix is required for not warning positive ulong.
13046 2005-08-23 Atsushi Enomoto <atsushi@ximian.com>
13048 * expression.cs : add CS0652 check for constant and integral
13049 expression. Fixed bug #53974.
13051 2005-08-23 Atsushi Enomoto <atsushi@ximian.com>
13053 * expression.cs : in DoNumericPromotions(), check if there is implicit
13054 conversion overload for string (to check CS0034). Fixed bug #52492.
13056 2005-08-23 Atsushi Enomoto <atsushi@ximian.com>
13058 * cs-tokenizer.cs : Check newline in char constant. Fixed bug #75245.
13060 2005-08-23 Atsushi Enomoto <atsushi@ximian.com>
13062 * ecore.cs : report location when it is *not* Null.
13064 2005-08-23 Atsushi Enomoto <atsushi@ximian.com>
13070 Added OmitStructFlowAnalysis to EmitContext to handle CS0165 check
13071 correctly. Fixed bug #75721.
13073 2005-08-23 Raja R Harinath <rharinath@novell.com>
13075 * support.cs (SeekableStreamReader.Position): Avoid an expensive
13076 loop that performs 'min (pos, char_count)'.
13079 * expression.cs (Unary.ResolveOperator): Don't discard implicit
13080 converted value in Operator.OnesComplement.
13082 2005-08-22 Ben Maurer <bmaurer@ximian.com>
13084 * anonymous.cs: If the anon method is pulled into a helper class,
13085 it needs to be `internal' not `private'. Fixes runtime behavior on
13088 2005-08-20 Martin Baulig <martin@ximian.com>
13090 * anonymous.cs (CaptureContext.CaptureThis): Create the topmost
13091 scope if we don't already have it.
13093 * expression.cs (Invocation.EmitCall): Use `ec.EmitThis ()' rather
13094 than `ig.Emit (OpCodes.Ldarg_0)' to make it work inside iterators;
13097 2005-08-17 Marek Safar <marek.safar@seznam.cz>
13100 * decl.cs (DeclSpace.VerifyClsCompliance): Skip when collision object
13101 is a partial class.
13103 2005-08-16 Marek Safar <marek.safar@seznam.cz>
13105 The big constants rewrite
13106 Fix #75746, #75685 and more
13107 As a side effect saved 1MB for MWF ;-)
13109 * attribute.cs (GetAttributeArgumentExpression): Use ToType, GetTypedValue.
13110 (GetMarshal, GetMethodImplOptions, GetLayoutKindValue): Values are not
13111 enum based for corlib compilation.
13113 * cfold.cs (BinaryFold): Convert operand for enum additions. Fixed enum
13116 * class.cs (FixedField.Define): Use ResolveAsConstant.
13118 * const.cs (IConstant): Interface constants and enums.
13119 (Const.ResolveValue): New method for constant resolvning.
13120 (ExternalConstant): Constants from imported assemblies.
13122 * constant.cs (Constant.GetTypedValue): Used to get constant with forced
13123 conversion; like enums.
13124 (Constant.ToType): Converts this constant to different type.
13125 (Constant.Increment): Adds 1.
13127 * convert.cs (ImplicitConversionRequired): Simplified.
13129 * cs-parser.jay: Create EnumMember directly.
13131 * decl.cs (MemberCore.CheckObsoleteness): Checks for ObsoleteAttribute presence.
13133 * doc.cs (GenerateEnumDocComment): Removed.
13135 * ecore.cs (Expression.ResolveAsConstant): New constant specific method.
13136 (ConvertIntLiteral): Removed.
13137 (FieldExpr.ResolveMemberAccess): Refactored to remove constant specific if(s).
13139 * enum.cs (EnumMember): Implement IConstant.
13140 (Enum.IsValidEnumConstant): Removed.
13141 (Enum.GetNextDefaultValue): Removed.
13142 (Enum.FindMembers): Updated.
13143 (Enum.GenerateDocComment): Iterate enum members.
13145 * expression.cs (Cast.TryReduce): Handle enums correctly.
13146 (New.Constantify): Made public.
13147 (MemberAccess.DoResolve): Removed contant specific if(s).
13149 * literal.cs (NullLiteral): Implement new abstract methods.
13151 * statement.cs (GotoCase.Resolve): Use new constant methods.
13152 (SwitchLabel.ResolveAndReduce): Use new constant methods.
13154 * typemanager.cs (LookupEnum): Removed.
13155 (IsEnumType): Fixed to work with corlib.
13156 (RegisterConstant): Removed.
13157 (LookupConstant): Removed.
13158 (GetConstant): Changed to work with IConstant.
13160 2005-08-04 Atsushi Enomoto <atsushi@ximian.com>
13162 * location.cs : Fixed overflown (>255) column number.
13164 2005-08-03 Raja R Harinath <rharinath@novell.com>
13166 First cut of the qualified-alias-member feature.
13167 * cs-tokenizer.cs (Tokenizer.is_punct): Recognize the double-colon
13169 * cs-parser.jay (DOUBLE_COLON): New token.
13170 (namespace_or_type_name): Add rule for recognizing
13171 qualified-alias-members.
13172 (primary_expression): Likewise.
13173 (element_access): Allow QualifiedAliasMember as a possible
13174 type-bearing expression.
13175 (local_variable_type, local_variable_pointer_type): Likewise.
13176 * namespace.cs (NamespaceEntry.LookupAlias): New. Looks up
13177 aliases in the current and enclosing namespace declarations.
13178 (NamespaceEntry.UsingAlias): Add CS0440 warning.
13179 * decl.cs (MemberName.is_double_colon): New.
13180 (MemberName.MemberName): Add new constructor for alias-member.
13181 (MemberName.GetTypeExpression): Generate QualifiedAliasMember too.
13182 * expression.cs (QualifiedAliasMember): New expression type.
13184 2005-08-02 Atsushi Enomoto <atsushi@ximian.com>
13186 * location.cs : it borked when no argument was specified.
13188 2005-08-02 Atsushi Enomoto <atsushi@ximian.com>
13190 * location.cs : tiny ToString() format fix.
13192 2005-08-02 Atsushi Enomoto <atsushi@ximian.com>
13194 * statement.cs : oops, it was missing.
13196 2005-08-02 Atsushi Enomoto <atsushi@ximian.com>
13198 A set of fixes for precise line/column location.
13201 "token" field now holds a file/line "delta", a line number offset
13202 from the segment, and a column number. See also:
13203 http://lists.ximian.com/pipermail/mono-devel-list/2004-
13204 December/009508.html
13205 Removed static IsNull. Use instance IsNull property instead.
13206 * cs-tokenizer.cs :
13207 For some tokens it stores Location. For Identifier it stores
13208 LocatedToken which is a pair of string name and location.
13209 Column numbers are adjusted only at getChar().
13211 Use Location.ToString() for reporting (it now contains column).
13213 Largely modified to use LocatedToken instead of
13214 string (IDENTIFIER), and to acquire Location from some tokens.
13215 * namespace.cs, decl.cs, ecore.cs, class.cs, delegate.cs,
13216 iterators.cs, const.cs, anonymous.cs, tree.cs, enum.cs,
13218 Now MemberName holds Location. DeclSpace.ctor() receives Location
13219 as a parameter. Removed extra parameters to all derived classes.
13220 Replaced Location.IsNull() with instance property.
13221 * assign.cs, expression.cs :
13222 Added .ctor() overload that omits Location.
13224 Added "nameEscaped" flag that indicates the identifier was escaped
13225 in the source file. This fixes bug #57047.
13227 2005-08-02 Marek Safar <marek.safar@seznam.cz>
13229 * attribute.cs (AttributeTester.GetImportedIgnoreCaseClsType):
13230 New method, looking for lo-case imported cls type.
13232 * decl.cs (DeclSpace.VerifyClsCompliance): Check CS3005 for types
13235 * driver.cs: Removed VerifyTopLevelNameClsCompliance usage.
13237 * enum (Enum.VerifyClsCompliance): Hardcode non-compliant types.
13239 * typemanager.cs (TypeManager.AllClsTopLevelTypes): Renamed from
13240 all_imported_types.
13241 (TypeManager.LoadAllImportedTypes): Lo-case imported types.
13243 Optimized to save 3.5 MB for SWF compilation.
13245 2005-08-01 Marek Safar <marek.safar@seznam.cz>
13247 * class.cs (AddToTypeContainer): Use inheritance insted of if(s).
13248 (PartialContainer.Create): Moved logic AddToContainer.
13249 (PartialContainer.MarkForDuplicationCheck): Shares name.
13251 * decl.cs (DeclSpace.AddToContainer): Check name collisions at one
13254 * namespace.cs (Namespace.AddDeclSpace): Lazy declspaces
13256 (Namespace.GetSignatureForError): New method.
13258 * tree.cs (Tree.RecordDecl): Moved to AddToContainer.
13259 (RootTypes.AddToTypeContainer): se inheritance insted of if(s).
13261 2005-08-01 Raja R Harinath <rharinath@novell.com>
13264 * ecore.cs (Expression.MemberLookupFailed): Use queried_type for
13265 member lookup rather than qualifier_type, since qualifier_type can
13268 2005-08-01 Marek Safar <marek.safar@seznam.cz>
13270 * enum.cs (Enum.VerifyClsName): Fixed to allow not CLSCompliant
13273 2005-07-31 Miguel de Icaza <miguel@novell.com>
13275 * statement.cs: Copy the local exception into the exception
13276 captured local. Fixes 75674
13278 2005-07-31 Raja R Harinath <harinath@gmail.com>
13281 * expression.cs (Invocation.OverloadResolve): Don't report error
13282 CS1501 if error CS1502 has been reported.
13283 (New.DoResolve): Delegate CS1501 reporting to
13284 Invocation.OverloadResolve.
13287 * statement.cs (Block.CheckInvariantMeaningInBlock): Verify
13288 invariant-meaning-in-block property in an enclosing block if
13291 2005-07-29 Marek Safar <marek.safar@seznam.cz>
13293 * statement.cs (SwitchLabel.ResolveAndReduce): Refactored.
13294 (SwitchLabel.Erorr_AlreadyOccurs): Share error message.
13295 (Switch.CheckSwitch): Just save 50kb for SWF.
13297 2005-07-27 Martin Baulig <martin@ximian.com>
13299 * anonymous.cs (CaptureContext.AddField): Added
13300 `AnonymousContainer am' argument; compute its toplevel scope if
13301 it's not already computed. Fixes #75649.
13303 2005-07-26 Raja R Harinath <rharinath@novell.com>
13306 * class.cs (Constructor.Emit): Reset block to null if the block
13309 2005-07-25 Marek Safar <marek.safar@seznam.cz>
13311 * class.cs (TypeContainer.VerifyMembers): Be compatible in warning 169.
13313 2005-07-25 Marek Safar <marek.safar@seznam.cz>
13315 * class.cs (MethodData.Define): Check whether accessor implementing
13316 interface is public.
13318 * driver.cs (Driver.parse): Try to be smart and check for `MZ' header.
13320 2005-07-22 Marek Safar <marek.safar@seznam.cz>
13323 * namespace.cs (LookupType): Moved same type check to...
13325 * typemanager.cs (LookupTypeReflection): Don't allow to import more types
13326 with the same name.
13328 2005-07-21 Raja R Harinath <rharinath@novell.com>
13330 * namespace.cs (NamespaceLookupType): Avoid a string allocation when we
13331 already found a typebuilder.
13332 * class.cs (MethodCore.IsDuplicateImplementation): Compare
13333 MemberNames, not strings.
13335 * const.cs (Error_ExpressionMustBeConst):
13336 Rename from Error_EpressionMustBeConst.
13337 * const.cs, class.cs, statement.cd: Update.
13339 2005-07-21 Marek Safar <marek.safar@seznam.cz>
13343 * const.cs (Const.LookupConstantValue): Report missing contant expression
13345 (Error_EpressionMustBeConstant): Only one error method.
13347 * class.cs, statement.c: Updated.
13349 2005-07-20 Raja R Harinath <rharinath@novell.com>
13351 * statement.cs (Block.Flags): Add back HasVarargs.
13352 (Block.flags): Make protected.
13353 (ToplevelBlock.HasVarargs): Convert to a property that updates flags.
13355 * typemanager.cs (types, typecontainers, user_types): Remove.
13356 (UserTypes, TypeContainers): Likewise.
13357 (HandleDuplicate, AddDelegateType, AddEnumType): Likewise.
13358 (CleanUp, Reset): Update.
13359 (AddUserType): Combine variants. Now, only updates builder_to_declspace.
13360 (GetNestedType): Use Type.GetNestedType.
13361 (CoreLookupType): Take two arguments, the namespace and the
13362 basename of the type. Update to use the Namespace.Lookup
13364 (InitEnumUnderlyingTypes, InitCoreTypes): Update.
13365 (RealMemberLookup): Use IsNestedChildOf instead of playing with
13366 string concatenation and substring matches.
13367 * class.cs, enum.cs, delegate.cs: Update to changes.
13369 2005-07-20 Marek Safar <marek.safar@seznam.cz>
13371 * constant.cs (Constant.Error_ConstantValueCannotBeConverted): Moved from
13372 Expression and made virtual.
13374 * convert.cs (ImplicitReferenceConversionExists): Skip for value types.
13375 (ImplicitStandardConversionExists): Fixed `byte' typo ?
13377 * ecore.cs (Expression.Error_ConstantValueCannotBeConverted): Moved.
13379 * literal.cs (NullLiteral.Error_ConstantValueCannotBeConverted): Customize
13382 * convert.cs, ecore.cs, enum.cs: Reflect Error_ConstantValueCannotBeConverted
13385 2005-07-18 Marek Safar <marek.safar@seznam.cz>
13388 * codegen.cs (AssemblyClass.ApplyAttributeBuilder): Check whether
13389 AssemblyCultureAttribute is not used on executable.
13392 * typemanager.cs: Add System.Reflection.AssemblyCultureAttribute.
13394 2005-07-16 Raja R Harinath <rharinath@novell.com>
13397 * expression.cs (Binary.Warning_UnintendeReferenceComparison):
13398 New. Reports CS0252/CS0253.
13399 Mostly taken from preliminary patch by Duncak Mak.
13400 (Binary.DoResolveOperator): Store results of operator lookup.
13401 Use them to detect if we need to warn about unintended reference
13404 2005-07-15 Raja R Harinath <rharinath@novell.com>
13407 * namespace.cs (Namespace.Lookup): Add back location parameter.
13408 (Namespace.LookupType): Add CS0436 report. Add location parameter.
13409 * delegate.cs, ecore.cs, expression.cs: Update to changes.
13411 * codegen.cs (EmitContext.DeclSpace): Make readonly.
13412 * namespace.cs (Namespace.Lookup): Carve out type lookup into ...
13413 (Namespace.LookupType): ... this.
13414 (NamespaceEntry.GetUsingTable): Allocate only one zero-sized array
13416 * typemanager.cs (LookupTypeReflection): Remove buggy code that
13417 purported to handle pointers.
13418 (char_ptr_type, void_ptr_type): Use GetPointerType rather than
13421 2005-07-15 Marek Safar <marek.safar@seznam.cz>
13423 * expression.cs (MemberAccess.ResolveNamespaceOrType): Don't report nested
13426 2005-07-15 Raja R Harinath <rharinath@novell.com>
13428 * namespace.cs (Namespace.Lookup): Drop location parameter.
13429 (NamespaceEntry.LookupAlias): Remove. Merge into ...
13430 (NamespaceEntry.Lookup): ... this.
13431 (NamespaceEntry.Error_AmbiguousTypeReference):
13432 Move here from DeclSpace.
13433 (NamespaceEntry.LookupNamespaceOrType): Move support for dotted
13435 * ecore.cs (TypeLookupExpression.DoResolveAsTypeStep): ... here.
13436 * decl.cs (DeclSpace.ErrorAmbiguousTypeReference):
13437 Move to NamespaceEntry.
13438 * delegate.cs, expression.cs: Update to changes.
13440 2005-07-14 Marek Safar <marek.safar@seznam.cz>
13442 * attribute.cs (Attribute.ResolveAttributeType): Renamed from
13443 CheckAttributeType and refactored.
13444 (Attribute.ResolvePossibleAttributeType): Changed to reuse
13445 ResolveAsTypeTerminal error handling.
13446 (ResolveAsTypeTerminal): Introduced because of global attributes extra
13448 (GetSignatureForError): Print errors in same way.
13451 * codegen.cs: Reflect attribute GetSignatureForError change.
13454 * expression.cs: Add silent parameter to ResolveAsTypeStep.
13456 * namespace.cs (UsingEntry): Refactored to make fields private.
13459 statement.cs: Error_UnexpectedKind has extra parameter.
13461 2005-07-14 Raja R Harinath <rharinath@novell.com>
13463 * ecore.cs (IAlias): Remove.
13464 * decl.cs (DeclSpace): Don't derive from IAlias. Remove members
13465 that implement the interface.
13466 * namespace.cs (Namespace): Likewise.
13467 (Namespace.declspaces): Renamed from 'defined_names'.
13468 (Namespace.AddDeclSpace): Renamed from 'DefineName'. Take a
13469 DeclSpace instead of an IAlias.
13470 * tree.cs (Tree.AddDecl): Update.
13472 2005-07-12 Raja R Harinath <rharinath@novell.com>
13474 * statement.cs (Block.Flags); Remove HasVarargs.
13475 (Block.HasVarargs): Move to ToplevelBlock.
13476 (Block.ThisVariable, Block.AddThisVariable): Likewise.
13477 (Block.Variables): Make protected. Initialize variable hashtable
13479 (Block.AddVariable): Update.
13480 (Block.Resolve): Update to changes.
13481 (ToplevelBlock.HasVarargs): New boolean.
13482 (ToplevelBlock.ThisVariable): Move here from Block.
13483 (ToplevelBlock.AddThisVariable): Likewise.
13484 (ToplevelBlock.IsThisAssigned): New. Forwards call to this_variable.
13485 * expression.cs (This.ResolveBase): Update to changes.
13486 (ArglistAccess.DoResolve): Likewise.
13488 2005-07-11 Marek Safar <marek.safar@seznam.cz>
13491 * ecore.cs, class.cs: Use SetAssigned instead of direct access.
13493 * class.cs (TypeContainer.VerifyMembers): Distinguish between
13494 not used and not used & assigned.
13495 (FieldBase.ASSIGNED): Moved to MemberCore.Flags.
13497 2005-07-11 Marek Safar <marek.safar@seznam.cz>
13500 * expression.cs (Is.DoResolve): null is never provided type.
13502 2005-07-08 Marek Safar <marek.safar@seznam.cz>
13505 * cs-parser.jay: Less strict event error rule to catch more errors.
13507 2005-07-08 Martin Baulig <martin@ximian.com>
13509 Fix test-iter-10.cs - distinguish whether we `yield' in a property
13510 gettter (allowed) or setter (not allowed).
13512 * class.cs (Accessor): Implement IIteratorContainer.
13513 (Accessor.Yields): New public field.
13514 (PropertyBase.PropertyMethod.Define): Handle iterators on a
13515 per-accessor basis.
13518 (get_accessor_declaration, set_accessor_declaration): Set the
13519 `yields' flag on the accessor, not the property.
13520 (property_declaration): Do the iterators check on a per-accessor
13521 basis and not for the whole property.
13523 2005-07-08 Martin Baulig <martin@ximian.com>
13525 * anonymous.cs (CaptureContext.EmitParameterInstance): Correctly
13526 handle parameters in nested scopes; fixes #74808; see gtest-188.cs.
13528 2005-07-07 Marek Safar <marek.safar@seznam.cz>
13531 * attribute.cs (orig_sec_assembly): Holds original version of assembly.
13532 (ExtractSecurityPermissionSet): Cope with self referencing security
13533 attributes properly.
13535 * driver.cs (SetOutputFile): Made public property OutputFile.
13537 2005-07-07 Raja R Harinath <rharinath@novell.com>
13540 * class.cs (TypeContainer.first_nonstatic_field): Rename from
13541 has_nonstatic_fields. Make into a FieldBase pointer.
13542 (TypeContainer.AddField): Add CS0282 check.
13543 (TypeContainer.EmitType): Update.
13545 2005-07-06 Miguel de Icaza <miguel@novell.com>
13547 * cs-tokenizer.cs (consume_identifier): Do not create strings to
13548 compare if they start with __.
13550 2005-07-06 Raja R Harinath <rharinath@novell.com>
13552 * statement.cs (Switch.SwitchGoverningType): Only look at
13553 UserCasts that don't need implicit standard conversions to one of
13554 the allowed switch types (Fixes test-322.cs).
13555 (LocalInfo.Resolve): Re-enable sanity-test.
13557 2005-07-06 Marek Safar <marek.safar@seznam.cz>
13559 * cs-tokenizer.cs (consume_identifier): Detect double undescores
13561 * ecore.cs (FieldExpr.AddressOf): Changed volatile error to warning.
13563 * expression.cs (Invocation.DoResolve): Report error CS0245 here.
13565 2005-07-06 Raja R Harinath <rharinath@novell.com>
13568 * ecore.cs (SimpleName.GetSignatureForError): Add.
13569 * expression.cs (MemberAccess.DoResolve): Don't clobber 'expr' field.
13570 (MemberAccess.GetSignatureForError): Add.
13572 2005-07-05 Marek Safar <marek.safar@seznam.cz>
13574 The big error and warning messages review.
13604 * typemanager.cs: Updated.
13606 * class.cs: (MethodCore.SetYields): Moved here to share.
13607 (PropertyMethod.Define): Moved iterator setup here.
13609 * iterators.cs: Add orig_method to have full access to parent
13612 2005-07-05 Raja R Harinath <rharinath@novell.com>
13614 Make 'fixed variable' handling standards compliant. Fix #70807, #72729.
13615 * ecore.cs (IVariable.VerifyFixed): Remove 'is_expression' parameter.
13616 (FieldExpr.VerifyFixed): Ensure that the field is part of a fixed
13617 variable of struct type.
13618 * expression.cs (Unary.ResolveOperator): Update to change.
13619 (Indirection.VerifyFixed): Likewise.
13620 (LocalVariableReference.VerifyFixed): A local variable is always fixed.
13621 (ParameterReference.VerifyFixed): Value parameters are fixed.
13622 (This.VerifyFixed): Treat 'this' as a value parameter.
13623 * statement.cs (LocalInfo.IsFixed): Remove.
13625 2005-07-01 Martin Baulig <martin@ximian.com>
13627 * iterators.cs (Iterator.CapturedThisReference.Emit): Use
13628 `ec.EmitThis ()' to get the correct scope.
13630 2005-07-01 Martin Baulig <martin@ximian.com>
13632 * ecore.cs (FieldExpr.DoResolve): Don't capture the field if it's
13633 instance is a ParameterReference; fixes #75299.
13635 2005-07-01 Martin Baulig <martin@ximian.com>
13637 Reverted Marek's latest patch (r46725):
13638 - it contains structural changes which are neither mentioned in
13639 the ChangeLog nor explained anywhere; for example the additional
13640 argument of EmitContext's and Iterator's .ctor's and the
13641 TypeContainer.DefineMembers() change.
13642 - structural changes like this should go in in seperate patches
13643 and not be hidden in a huge patch which just seems to affect
13644 warnings and errors.
13645 a big and hard to understand patch.
13646 - it breaks iterators and causes regressions, for instance in
13649 2005-06-30 Raja R Harinath <rharinath@novell.com>
13652 * expression.cs (Indexers.map): Remove.
13653 (Indexers.Append): Filter out inaccessible setters and getters.
13654 (IndexerAccess.DoResolve, IndexerAccess.DoResolveLValue): Update.
13657 * ecore.cs (MemberExpr.EmitInstance): New. Add CS0120 check.
13658 Refactored from ...
13659 (FieldExpr.EmitInstance, PropertyExpr.EmitInstance): ... these.
13660 (FieldExpr.Emit, PropertyExpr.Emit): Update.
13661 (FieldExpr.EmitAssign, PropertyExpr.EmitAssign): Update.
13662 * expression.cs (Invocation.EmitCall): Add CS0120 check.
13664 2005-06-30 Marek Safar <marek.safar@seznam.cz>
13667 * class.cs (FieldBase.GetInitializerExpression): One more field
13670 2005-06-28 Miguel de Icaza <miguel@novell.com>
13672 * pending.cs: Do not define a proxy if the base method is virtual,
13673 it will be picked up by the runtime (bug 75270).
13675 2005-06-08 Martin Baulig <martin@ximian.com>
13677 The big Iterators rewrite :-)
13679 * iterators.cs: Rewrite this to use the anonymous methods framework.
13681 * rootcontext.cs (RootContext.DefineTypes): Define Delegates
13682 before the TypeContainers; see 2test-21.cs.
13685 (TypeContainer.DefineType): Don't create a new EmitContext if we
13686 already have one (this only happens if we're an Iterator).
13687 (TypeContainer.Define): Also call Define() on all our iterators.
13688 (Method.CreateEmitContext): Added support for iterators.
13691 (AnonymousContainer): New abstract base class for `AnonymousMethod'.
13692 (AnonymousContainer.CreateMethodHost): Moved here from
13693 AnonymousMethod and made abstract.
13694 (AnonymousContainer.CreateScopeType): New abstract method.
13695 (AnonymousContainer.IsIterator): New public property.
13696 (ScopeInfo.EmitScopeType): Call CreateScopeType() on our Host to
13697 get the ScopeTypeBuilder rather than manually defining it here.
13698 (ScopeInfo.EmitScopeInstance): New public method; correctly handle
13701 * driver.cs (Driver.MainDriver): Call TypeManager.InitCodeHelpers()
13702 before RootContext.DefineTypes().
13704 * codegen.cs (EmitContext.RemapToProxy): Removed.
13705 (EmitContext.CurrentAnonymousMethod): Changed type from
13706 AnonymousMethod -> AnonymousContainer.
13707 (EmitContext.ResolveTopBlock): Protect from being called twice.
13708 (EmitContext.MapVariable, RemapParameter(LValue)): Removed.
13709 (EmitContext.EmitThis): Removed the iterators hacks; use the
13710 anonymous methods framework for that.
13713 (ToplevelBlock.Container): Make this a property, not a field.
13714 (ToplevelBlock.ReParent): New public method; move the
13715 ToplevelBlock into a new container.
13716 (Foreach.TemporaryVariable): Simplify.
13718 2005-06-05 Martin Baulig <martin@ximian.com>
13720 * statement.cs (LocalInfo.CompilerGenerated): New flag.
13721 (Block.AddTemporaryVariable): New public method; creates a new
13722 `LocalInfo' for a temporary variable.
13723 (Block.EmitMeta): Create the LocalBuilders for all the temporary
13725 (Foreach.TemporaryVariable): Use Block.AddTemporaryVariable() for
13726 non-iterator variables.
13728 2005-06-05 Martin Baulig <martin@ximian.com>
13730 * statement.cs (Foreach.TemporaryVariable): Create the
13731 LocalBuilder in the Emit phase and not in Resolve since in some
13732 situations, we don't have an ILGenerator during Resolve; see
13733 2test-19.cs for an example.
13735 2005-06-04 Martin Baulig <martin@ximian.com>
13737 **** Merged r45395 from GCS ****
13739 The big Foreach rewrite - Part II.
13741 * typemanager.cs (TypeManager.object_getcurrent_void): Replaced
13742 with `PropertyInfo ienumerator_getcurrent'.
13744 * codegen.cs (VariableStorage): Removed.
13747 (Foreach): Derive from Statement, not ExceptionStatement.
13748 (Foreach.CollectionForeach): New nested class. Moved all the code
13749 dealing with collection foreach here.
13750 (Foreach.ForeachHelperMethods): Removed.
13751 (Foreach.TemporaryVariable): Implement IMemoryLocation.
13753 2005-05-23 Martin Baulig <martin@ximian.com>
13755 * statement.cs (Try.DoResolve): Don't create a `finally' if we
13756 don't need to. Fix #75014.
13758 2005-05-20 Martin Baulig <martin@ximian.com>
13760 Merged r44808 from GMCS.
13762 * class.cs (TypeContainer.CircularDepException): Removed.
13763 (TypeContainer.DefineType): Removed the `InTransit' stuff.
13764 (TypeContainer.CheckRecursiveDefinition): Check for circular class
13765 (CS0146) and interface (CS0529) dependencies here.
13767 2005-06-21 Raja R Harinath <rharinath@novell.com>
13769 * expression.cs (Invocation.EmitCall): Fix initialization
13770 'this_call' to reflect current behaviour. Fix indentation.
13772 * convert.cs (FindMostEncompassedType): Add two trivial special
13773 cases (number_of_types == 0 || number_of_types == 1).
13774 (FindMostEncompasingType): Likewise.
13776 2005-06-17 Raja R Harinath <rharinath@novell.com>
13778 Some cleanups preparing for the fix of #75283.
13779 * ecore.cs (PropertyExpr.InstanceResolve): Tighten conditions for
13781 (EventExpr.InstanceResolve): Likewise.
13782 (EventExpr.DoResolve): Remove redundant checks.
13784 2005-06-10 Duncan Mak <duncan@novell.com>
13786 * cs-tokenizer.cs (process_directives): New flag for controlling
13787 the processing of preprocessor directives.
13788 (x_token): After seeing a '#', return Token.NONE instead of going
13789 to handle_preprocessing_directive() when not processing
13790 directives. This avoids unnecessary processing during the token peek in
13795 * cs-tokenizer.cs (handle_preprocessing_directive, xtoken): Use
13796 the existing error reporting methods instead of Report.Error.
13798 * convert.cs (priv_fmt_expr): Remove. It's not needed anymore
13799 after Raja's rewrite.
13801 2005-06-08 Miguel de Icaza <miguel@novell.com>
13803 * class.cs: Small fix.
13805 2005-06-08 Raja R Harinath <rharinath@novell.com>
13808 * class.cs (GetPartialBases): Fix return value check of
13809 part.GetClassBases.
13811 2005-06-07 Raja R Harinath <rharinath@novell.com>
13813 Ensure that partial classes are registered in their enclosing
13814 namespace. Initial part of fix of #75160.
13815 * tree.cs (Tree.RecordDecl): Add new namespace argument.
13816 Register declspace with namespace here, not in
13817 DeclSpace.RecordDecl.
13818 * cs-parser.jay: Pass namespace to RecordDecl.
13819 * class.cs (PartialContainer.Create): Likewise.
13820 (ClassPart.DefineType): New sanity-check. Throws an exception if
13822 * decl.cs (Declspace.RecordDecl): Remove.
13823 * namespace.cs (NamespaceEntry.DefineName): Remove.
13825 2005-06-06 Marek Safar <marek.safar@seznam.cz>
13827 * rootcontext.cs: Reset TargetExt as well.
13829 2005-06-03 Raja R Harinath <rharinath@novell.com>
13831 * ecore.cs (Expression.Resolve): Emit CS0654 error when
13832 -langversion:ISO-1.
13834 2005-06-02 Raja R Harinath <rharinath@novell.com>
13836 Fix #75080, cs0119.cs.
13837 * ecore.cs (Expression.ExprClassToResolveFlags): New. Broken out
13839 (Expression.Resolve): ... this. Use it. Remove bogus code
13840 allowing ExprClass.Type and ExprClass.Namespace for
13841 ResolveFlags.VariableOrValue.
13842 (Expression.Resolve) [1-argument variant]: Change default resolve
13843 flags based on language version.
13844 (Expression.Error_UnexpectedKind): Use a simple string array
13845 rather than an ArrayList.
13846 * expression.cs (TypeOf.DoResolve): Set eclass to ExprClass.Value,
13847 not ExprClass.Type.
13848 (TypeOfVoid.DoResolve): Likewise.
13849 (MemberAccess.DoResolve) [3-argument variant]: Make private. Drop
13850 flags argument -- it always has the same value.
13852 2005-05-31 Raja R Harinath <rharinath@novell.com>
13855 * ecore.cs (Expression.ResolveLValue): Add a Location parameter.
13856 Use it in the error message.
13857 * assign.cs, expression.cs, statement.cs: Update.
13859 2005-05-30 Raja R Harinath <rharinath@novell.com>
13862 * ecore.cs (Expression.MemberLookupFailed): Add CS0122 check in
13863 the "almostMatchedMember" case too.
13864 * typemanager.cs (Closure.CheckValidFamilyAccess): Add anything
13865 that failed the accessibility checks to 'almost_match'.
13867 2005-05-27 Vladimir Vukicevic <vladimir@pobox.com>
13869 * attribute.cs: Use internal MethodBuilder methods to set
13870 ExactSpelling and SetLastError on PInvoke methods, instead
13871 of passing them via charset. Fixes #75060.
13873 2005-05-27 Raja R Harinath <rharinath@novell.com>
13875 * parameter.cs (Parameter): Remove TODO comment.
13876 (Parameter.DefineParameter): Remove Location parameter.
13877 (Parameters.LabelParameters): Likewise.
13878 * class.cs (Constructor.Emit): Update to change.
13879 (MethodData.Emit): Likewise.
13880 * anonymous.cs (AnonymousMethod.EmitMethod): Likewise.
13881 * delegate.cs (Delegate.Define, Delegate.Emit): Likewise.
13883 2005-05-27 Atsushi Enomoto <atsushi@ximian.com>
13886 Removed Parameters.Location and added Parameter.Location instead.
13887 Removed Location parameter from Emit() and GetSignature().
13894 Modified all related calls.
13896 2005-05-26 Raja R Harinath <rharinath@novell.com>
13898 Improve user-defined conversion handling.
13899 * convert.cs (GetConversionOperators): Rewrite. Return only the
13900 applicable operators.
13901 (AddConversionOperators): New. Helper for GetConversionOperators.
13902 (FindMostEncompassedType, FindMostEncompassingType): Verify that
13903 there is only one most encompassed/encompassing type.
13904 (FindMostSpecificSource, FindMostSpecificTarget): Remove
13905 "applicable operator" handling.
13906 (UserConversion): Move cache here from GetConversionOperators.
13907 Directly cache the chosen operator, rather than the whole
13909 (ExplicitNumericConversion): Fix buggy implementation of Decimal
13910 case. Allow conversion of decimal to sbyte and byte too.
13911 * expression.cs (EmptyExpression.Grab, EmptyExpression.Release):
13912 New static methods. Used to avoid allocating EmptyExpressions in
13915 2005-05-24 Duncan Mak <duncan@novell.com>
13917 * ecore.cs (CastFromDecimal): New class for casting a decimal to
13918 another class, used in Convert.ExplicitNumericConversion.
13919 (CastToDecimal): New class, similar to above, but casts to
13920 System.Decimal, used in Convert.ImplicitNumericConversion and also
13921 in explicit convesion from double/float to decimal.
13923 * convert.cs (ImplicitNumericConversion): Handle implicit
13924 conversions to System.Decimal.
13925 (ExplicitNumericConversion): handle explicit conversions to
13930 2005-05-20 Miguel de Icaza <miguel@novell.com>
13932 * typemanager.cs (EnumToUnderlying): Do not throw if we do not
13933 know the type at this stage, just break through. Fixes #75008
13935 2005-05-19 Martin Baulig <martin@ximian.com>
13938 (ImplicitDelegateCreation.Check): Added `bool check_only' argument
13939 to disable error reporting.
13941 * convert.cs (Convert.ImplicitStandardConversionExists): Use it
13942 here since we don't want to report an error; see the new test-336.cs.
13944 2005-05-19 Raja R Harinath <rharinath@novell.com>
13946 * statement.cs (ToplevelBlock.GetParameterReference)
13947 (ToplevelBlock.IsParameterReference,ToplevelBlock.IsLocalParameter):
13948 Move here from class Block.
13949 * ecore.cs (SimpleName.SimpleNameResolve): Update to changes.
13950 * expression.cs (ParameterReference.DoResolveBase): Likewise.
13952 2005-05-18 Martin Baulig <martin@ximian.com>
13957 (FlowBranching.Reachability): Add non-static public And() and Or()
13959 (FlowBranchingSwitch): New class; do the `break_origins' thing
13960 like in FlowBranchingLoop.
13961 (FlowBranching.UsageVector.MergeBreakOrigins): Also merge the
13962 reachability, not just locals and parameters.
13963 (FlowBranching.MergeChild): Remove some of the hacks for loop and
13964 switch; MergeBreakOrigins() now takes care of that.
13966 2005-05-18 Martin Baulig <martin@ximian.com>
13968 * flowanalysis.cs (FlowBranching.UsageVector.MergeChild): If we're
13969 a loop and may leave it, reset the barrier; fixes #74974.
13971 2005-05-17 Marek Safar <marek.safar@seznam.cz>
13973 * attribute.cs (Attribute.ResolveArguments): GuidAttribute check
13976 * cs-parser.jay: Catch more lexical errors.
13978 * report.cs: Add one more Error method.
13981 * typemanager.cs: Register System.Runtime.InteropServices.GuidAttribute
13983 2005-05-17 Martin Baulig <martin@ximian.com>
13985 * expression.cs (Argument.Resolve): Turn on flow analysis; fix
13988 2005-05-16 Raja R Harinath <rharinath@novell.com>
13990 Fix test-382.cs. Emit values of decimal constants.
13991 * class.cs (TypeContainer.RegisterFieldForInitialization): New.
13993 (TypeContainer.AddField): ... this.
13994 (TypeContainer.EmitFieldInitializers): Allow the list of fields
13995 with initializers to include 'Const's.
13996 (ClassPart.RegisterFieldForInitialization): Forward to
13998 * const.cs (Const.Const): Pass initializer to base class.
13999 (Const.Define): In case of decimal constants, register them for
14000 initialization in a static constructor.
14002 2005-05-14 Martin Baulig <martin@ximian.com>
14004 * statement.cs (Block.Resolve): Correctly handle unreachable code;
14005 do not call ResolveUnreachable() on unreachable statements in
14006 here, see the comment in the source code.
14008 2005-05-13 Raja R Harinath <rharinath@novell.com>
14011 * expression.cs (BinaryResolveOperator): If one of the operands of
14012 an equality comparison is 'null' and the other is a pointer type,
14013 convert the null to a NullPointer.
14014 * convert.cs (ImplicitReferenceConversion): If the expression is a
14015 NullLiteral and the target type is a pointer type, return a
14016 NullPointer instead.
14017 (ImplicitConversionStandard): Likewise.
14019 2005-05-13 Marek Safar <marek.safar@seznam.cz>
14021 * cs-parser.jay: Set readonly context based on special constructs.
14023 * expression.cs (LocalVariableReference.DoResolveBase): Improved
14024 readonly variable error handling.
14026 * rootcontext.cs (EmitCode): Don't verify members when error
14029 * statement.cs (LocalInfo): Add reaodnly context information.
14030 (SetReadOnlyContext, GetReadOnlyContext): New methods.
14032 2005-05-13 Raja R Harinath <rharinath@novell.com>
14034 * statement.cs (Block.Resolve): Revert change below. Modify fix
14035 for #74041 to initialize 'resolved' to false only for explicit
14036 blocks. Fixes #74873.
14038 2005-05-12 Raja R Harinath <harinath@gmail.com>
14041 * typemanager.cs (unmanaged_enclosing_types): New.
14042 (IsUnmanagedType): Avoid infloops by using
14043 'unmanaged_enclosing_types' to talk with recursive invocations.
14045 2005-05-13 Martin Baulig <martin@ximian.com>
14047 * statement.cs (Block.Resolve): Make the `bool unresolved' flag an
14048 instance variable, not a local. Fix #74873.
14049 (Block.ResolveUnreachable): Set it to true here.
14051 2005-05-11 Duncan Mak <duncan@novell.com>
14053 * cs-tokenizer.cs (get_cmd_arg): Check that 'c' is not -1 before
14054 continuing to process for 'arg'.
14055 (handle_preprocessing_directive): Check the argument of the #endif
14056 directive and report error CS1025 if there are any trailing
14059 According to the C# spec, having even whitespace after the #endif
14060 directive is illegal; however, because we call arg.TrimEnd ()
14061 beforehand, we have the same behavior as csc, allowing whitespace
14062 after the directive.
14066 2005-05-11 Marek Safar <marek.safar@seznam.cz>
14070 * class.cs (ConstructorInitializer.GetOverloadedConstructor): Removed.
14071 (Constructor.GetObsoleteAttribute): Implemented correctly.
14073 2005-05-10 Martin Baulig <martin@ximian.com>
14075 * support.cs (ReflectionParameters.ParameterModifier): Use
14076 `Parameter.Modifier.REF' if we both have `ParameterAttributes.Out'
14077 and `ParameterAttributes.In'. Fixes #74884.
14079 2005-05-10 Marek Safar <marek.safar@seznam.cz>
14081 * class.cs (Method.Define): Catch attempt for Finalizer declaration.
14083 * expression.cs (Argument.GetParameterModifier): Turned to property.
14084 (Invocation.Error_InvalidArguments): Add more descriptive errors.
14086 * parameter.cs (Parameter.GetModifierSignature): Translates modifier to
14089 2005-05-09 Raja R Harinath <rharinath@novell.com>
14092 * decl.cs (MemberCache.AddMethods): Register override methods,
14093 rather than non-override methods.
14094 * typemanager.cs (RegisterOverride): New.
14095 (IsOverride): Update.
14097 2005-05-09 Marek Safar <marek.safar@seznam.cz>
14101 * ecore.cs (SimpleName.SimpleNameResolve): Add in_transit to catch
14102 recursive declaration.
14104 * statement.cs (Block.ResolveMeta): Report any error in resolving.
14106 2005-05-06 Marek Safar <marek.safar@seznam.cz>
14108 * cfold (DoConstantNumericPromotions): Don't try to convert 0 enum.
14110 * expression.cs (Binary.DoResolve): (x && 0) is always 0.
14112 2005-05-05 Raja R Harinath <rharinath@novell.com>
14115 * decl.cs (DeclSpace.FamilyAccessible):
14116 Use TypeManager.IsNestedFamilyAccessible.
14118 Fix reopened #64812.
14119 * typemanager.cs (Closure.Filter): Introduce checks for 'protected
14122 2005-05-04 Raja R Harinath <rharinath@novell.com>
14123 Abin Thomas <projectmonokochi@rediffmail.com>
14124 Anoob V E <projectmonokochi@rediffmail.com>
14125 Harilal P R <projectmonokochi@rediffmail.com>
14128 * typemanager.cs (Closure.CheckValidFamilyAccess): Don't blindly
14129 allow access to all static members.
14131 2005-05-04 Martin Baulig <martin@ximian.com>
14133 * ecore.cs (FieldExpr.DoResolveLValue): Always call fb.SetAssigned().
14135 2005-05-04 Martin Baulig <martin@ximian.com>
14139 * statement.cs (Switch.SimpleSwitchEmit): Always emit the default
14140 section at the end; make things work if `default' is not the last
14143 2005-05-04 Martin Baulig <martin@ximian.com>
14147 * statement.cs (Switch): Replaced the `got_default' field with a
14148 `default_section' one.
14149 (Switch.CheckSwitch): Set `default_section' here.
14150 (Switch.Resolve): If we're a constant switch and the constant is
14151 not found, use the default section.
14153 2005-05-03 Martin Baulig <martin@ximian.com>
14155 * expression.cs (ArrayAccess.EmitGetLength): New public method.
14157 * statement.cs (Foreach.ArrayForeach): New nested class.
14158 (Foreach.TemporaryVariable): New nested class.
14159 (Foreach.EmitArrayForeach): Removed; this is now in the new
14160 ArrayForeach class.
14162 2005-05-03 Raja R Harinath <rharinath@novell.com>
14164 * pending.cs (BaseImplements): Move the #74773 fix here. This is
14166 (VerifyPendingMethods): Revert change below.
14168 * typemanager.cs (IsOverride, RegisterNonOverride): New.
14169 * decl.cs (MemberCache.AddMethod): Register "non-override" methods
14170 that used to trigger warning -28. Remove warning -28.
14171 * expression.cs (Invocation.OverloadResolve): Use
14172 TypeManager.IsOverride to distinguish override methods.
14175 * pending.cs (VerifyPendingMethods): If a base type implements the
14176 requested interface, don't bother checking individual methods of
14177 the base type. As a side-effect, this prevents the creation of
14178 unnecessary proxies.
14180 2005-05-02 Martin Baulig <martin@ximian.com>
14184 * flowanalysis.cs (FlowBranching.UsageVector.MergeJumpOrigins):
14185 Also `And' the locals if the old vector is null.
14186 (FlowBranching.UsageVector.BitVector.And): Allow `vector' being
14187 null; in this case we basically reset all the variables.
14189 2005-05-02 Martin Baulig <martin@ximian.com>
14193 * flowanalysis.cs (FlowBranching.UsageVector.MergeBreakOrigins):
14194 Added `FlowBranching branching' argument; always `and' the
14195 variables instead of `or'ing them unless we're an infinite loop.
14197 * statement.cs (While.Resolve): Create a new sibling unless we're
14200 2005-05-02 Martin Baulig <martin@ximian.com>
14204 * class.cs (ConstructorInitializer.Resolve): Added `Block block'
14205 arguments; use it instead of creating a new TopLevelBlock.
14206 (Constructor.Emit): Call `block.ResolveMeta ()' before resolving
14207 our ConstructorInitializer.
14210 (TopLevelBlock.TopLevelBranching): New public property.
14211 (TopLevelBlock.ResolveMeta): New public method; call ResolveMeta()
14212 and create our `TopLevelBranching'.
14214 * codegen.cs (EmitContext.ResolveTopBlock): If we're not an
14215 anonymous method host, use `block.TopLevelBranching' rather than
14216 creating a new branching.
14218 2005-04-20 Miguel de Icaza <miguel@novell.com>
14220 * anonymous.cs (ScopeInfo.AddChild): when adding a new child to
14221 a ScopeInfo, if any of the current children is a child of the new
14222 entry, move those children there.
14224 2005-04-30 Martin Baulig <martin@ximian.com>
14226 * statement.cs (Switch.SimpleSwitchEmit): Reset `default_at_end'
14227 at the beginning of a SwitchSection. Fix #73335.
14229 2005-04-27 Marek Safar <marek.safar@seznam.cz>
14232 * class.cs (EmitFieldInitializers): Use FieldExpr in initializer.
14234 * ecore.cs (FieldExpr): Add a new ctor with in_initializer.
14235 (FieldExpr.DoResolve): Obsolete members are ignored for field
14238 2005-04-26 Marek Safar <marek.safar@seznam.cz>
14240 * attribute.cs (AreOverloadedMethodParamsClsCompliant): Add array
14241 of arrays detection.
14243 * class.cs (Interface.VerifyClsCompliance): Add base interfaces
14245 (Field.VerifyClsCompliance): Volatile fields are not compliant.
14247 * decl.cs (MemberCache.VerifyClsParameterConflict): Add array of
14250 2005-04-25 Ben Maurer <bmaurer@ximian.com>
14252 * cs-parser.jay: Use the prefered version of -unsafe in error
14255 2005-04-22 Marek Safar <marek.safar@seznam.cz>
14257 * driver.cs (CompilerCallableEntryPoint.Invoke): Reset under any
14260 2005-04-20 John Luke <john.luke@gmail.com>
14262 * driver.cs: fix typo in error message, --outout to --output
14264 2005-04-20 Marek Safar <marek.safar@seznam.cz>
14266 * codegen.cs (InRefOutArgumentResolving): New field.
14268 * ecore.cs (FieldExpr.DoResolve): Check for assigning to readonly
14269 fields outside contructor.
14271 * expression.cs (Argument.Resolve): Set InRefOutArgumentResolving.
14273 2005-04-19 Miguel de Icaza <miguel@novell.com>
14275 * anonymous.cs (CaptureContext.EmitParameterInstance): The
14276 parameter code was not completed ever, so it was not as up-to-date
14277 as local variables. Must finish it.
14279 The bug fix was to compare the Toplevel of the block, not the
14280 current block. Thanks for Ben for pointing this out.
14282 2005-04-19 Raja R Harinath <rharinath@novell.com>
14284 * decl.cs (AddMethods): Use the declaring type of the problem
14285 method to determine if we want to squash a warning.
14287 2005-04-19 Marek Safar <marek.safar@seznam.cz>
14289 * attribute.cs: Removed debug output.
14291 * decl.cs (MemberCache.AddMethods): Fixed Finalize ignoring.
14293 * driver.cs (Driver.parse): Synchronize parser ErrorOutput with
14296 2005-04-18 Raja R Harinath <rharinath@novell.com>
14299 * expression.cs (Binary.EqualsNullIsReferenceEquals): New.
14300 (Binary.DoResolveOperator): Use it to avoid blindly optimizing out
14301 all null comparisons against reference types.
14303 2005-04-18 Marek Safar <marek.safar@seznam.cz>
14306 * class.cs (TypeContainer.CircularDepException) New nested
14308 (GetPartialBases, GetNormalBases, GetClassBases): Removed error.
14309 (TypeContainer.DefineType): Removed error, reset InTransit before
14311 (Class.DefineType): Throw exception when is in Transit.
14312 Catch exception and report error.
14313 (Struct.DefineType): Throw exception when is in Transit.
14314 Catch exception and report error.
14315 (Interface.DefineType): Throw exception when is in Transit.
14316 Catch exception and report error.
14318 * codegen.cs: Add InCatch,InFinally to EmitContext to easily
14319 handle nested exception handlers.
14321 * flowanalysis.cs (InTryWithCatch): New method, search for try with
14324 * iterators.cs (Yield.CheckContext): Add CS1626 report. Updated
14325 InFinally and InCatch storage.
14327 * statement.cs (Throw.Resolve): Use InCatch, InFinally from ec.
14328 (Catch.Resolve): Set and Restore ec.InCatch.
14329 (Try.Resolve): Set and Restore ec.InFinally.
14330 (Try.HasCatch): True when try has catch.
14332 2005-04-17 Atsushi Enomoto <atsushi@ximian.com>
14334 * doc.cs : In some cases FilterName returns MonoEvent and MonoField
14335 for the same event member, so exclude such cases from warning 419.
14338 2005-04-16 Miguel de Icaza <miguel@novell.com>
14340 * expression.cs (Binary.ResolveOperator): Apply patch from John
14341 Luke to fix bug 59864: operators &, | and ^ on enumerations
14342 require that the same enum type on both sides.
14344 * driver.cs: Add warnings to old flag usage, this is to assist
14345 people who produce Makefiles and hope that the Makefiles will be
14348 * class.cs (TypeContainer.EmitType): Moved the definition of the
14349 special $PRIVATE$ field from the resolve phase to the Emit phase.
14350 During resolve we do not know if we are a struct with
14351 HasExplicitLayout, we know this only after the attributes for the
14354 Set the FieldOffset to zero on the dummy field that we create for
14355 the class. Fixes 74590.
14357 2005-04-16 Raja R Harinath <rharinath@novell.com>
14360 * ecore.cs (PropertyExpr.resolved): New.
14361 (DoResolve): Use it to handle a case of double resolution here.
14362 Handle a case of identical-name-and-type-name.
14363 * expression.cs (ArrayCreation.CheckIndices): Avoid double
14364 resolution by storing the results of expression resolution back
14365 into the "probes" array.
14367 2005-04-15 Raja R Harinath <rharinath@novell.com>
14369 Fix cs0208-7.cs and cs0208-8.cs.
14370 * typemanager.cs (IsUnmanagedType): Arrays are not allowed
14371 (cf. ECMA standard, behaviour of CSC 1.1 and CSC 2.0). Improve
14372 error reporting to point out the reason a struct is not unmanaged.
14374 2005-04-13 Atsushi Enomoto <atsushi@ximian.com>
14376 * doc.cs : In FindDocumentedType(), avoid TypeExpr.ResolveType() and
14377 just use TypeExpr.Type. This fixes bug #74595 when merged to gmcs.
14379 2005-04-13 Raja R Harinath <rharinath@novell.com>
14382 * ecore.cs (PropertyExpr.InstanceResolve): Handle a case of
14383 IdenticalNameAndTypeName here.
14384 (EventExpr.InstanceResolve): Likewise.
14386 2005-04-13 Marek Safar <marek.safar@seznam.cz>
14388 C# 2.0 DefaultCharSetAttribute implementation
14390 * attribute.cs (Attribute.ResolveAsTypeStep): New protected method
14391 which allows us to set GlobalNamespace for every resolve.
14392 (Attribute.ResolveArguments): Cut from Resolve.
14393 (Attribute.GetCharSetValue): Returns CharSet named argument.
14394 (Attribute.DefinePInvokeMethod): Gets default charset from
14396 (GlobalAttribute.ResolveAsTypeStep): Override.
14397 (GlobalAttribute.ResolveArguments): Override.
14399 * class.cs (TypeAttr): Is protected.
14401 * codegen.cs (ModuleClass.DefaultCharSet): New member.
14402 (ModuleClass.DefaultCharSetType): New memeber.
14403 (ModuleClass.ResolveAttributes): Resolves DefaultCharSetAttribute.
14405 * decl.cs (Decl.TypeAttr): New protected virtual. Returns default
14406 charset from module.
14408 * delegate.cs (TypeAttr): Override.
14409 (Delegate.DefineType): Use this TypeAttr.
14411 * driver.cs (Driver.MainDriver): Call Module.ResolveAttributes
14412 at very early stage (before types are defined) to resolve model
14413 module attributes. It will probably not work with corlib but it
14416 * enum.cs (Enum.TypeAttr): New protected virtual. Returns default
14417 charset from module.
14419 * typemanager.cs (default_charset_type): New type.
14421 2005-04-13 Raja R Harinath <rharinath@novell.com>
14423 * decl.cs (MemberCache.AddMethods): Don't warn if
14424 System.Object.Finalize has buggy MethodAttributes.
14426 * typemanager.cs (IsUnmanagedType): Restore !IsValueType check
14429 2005-04-13 Atsushi Enomoto <atsushi@ximian.com>
14431 * doc.cs : detect ambiguous reference to overloaded members.
14432 Fixed bug #71603. MS 1.1 csc does not detect it.
14434 2005-04-13 Atsushi Enomoto <atsushi@ximian.com>
14436 * doc.cs : delegates must not be referenced with parameters.
14439 2005-04-12 Miguel de Icaza <miguel@novell.com>
14441 * typemanager.cs (IsUnmanagedType): Arrays are allowed.
14443 2005-04-10 Miguel de Icaza <miguel@novell.com>
14445 * driver.cs (MainDriver): Stop processing if the CLS stage found
14448 (CompilerCallableEntryPoint.InvokeCompiler): Always
14449 reset after execution; Take a TextWriter argument for the
14452 * report.cs: Use the error stream instead of hardcoding stderr.
14454 2005-04-09 Miguel de Icaza <miguel@novell.com>
14456 * class.cs: Reduce code paths to test, too small of an
14457 optimization to make it worth the extra testing. Always perform
14460 2005-04-08 Raja R Harinath <rharinath@novell.com>
14463 * class.cs (OperatorArrayList.CheckPairedOperators): Skip
14464 operators that had errors reported on them.
14466 2005-04-08 Marek Safar <marek.safar@seznam.cz>
14468 * attribute.cs (Attribute.IsValidArgumentType): Test valid named
14470 (Attribute.Resolve): Add named argument type checking.
14472 * class.cs (FixedField.Define): Use IsPrimitiveType
14474 * expression.cs (Binary.ResolveOperator): Reflect IsCLRType renaming.
14476 * iterators.cs (Iterator.DefineIterator): Add check for arglist and
14477 unsafe parameter types.
14479 * statement.cs (Using.ResolveExpression): Add better error description.
14481 * typemanager.cs (IsCLRType): Renamed to IsPrimitiveType.
14483 2005-04-08 Raja R Harinath <rharinath@novell.com>
14486 * attribute.cs (Attribute.GetAttributeUsage): Resolve
14487 AttributeUsageAttribute in the emitcontext of the attribute class,
14488 not in the emitcontext of the attributable entity it was attached to.
14489 * cs-parser.jay: Use 'current_class', not 'current_container',
14490 when creating a GlobalAttribute.
14492 2005-04-08 Alp Toker <alp@atoker.com>
14494 * pending.cs: The fix to #58413 failed to compile methods implementing
14495 interfaces with/without params modifiers and vice versa, even though
14496 params modifiers aren't part of the signature. Make the modifier check
14497 less strict as in csc.
14499 2005-04-07 Abin Thomas <projectmonokochi@rediffmail.com>
14500 Anoob V E <projectmonokochi@rediffmail.com>
14501 Harilal P R <projectmonokochi@rediffmail.com>
14504 * pending.cs (TypeAndMethods.mods): New. Store the parameter
14505 modifiers of pending methods.
14506 (PendingImplementation.PendingImplementation): Initialize it.
14507 Add Parameter.Modifier [][] mods and initialize it with ParameterData.
14508 (PendingImplementation.InterFaceMethod): Repalce Type[] argument
14509 with ParameterData. Add check for modifiers.
14510 * class.cs (MethodData.Define): Update to changes.
14512 2005-04-07 Raja R Harinath <rharinath@novell.com>
14514 * ecore.cs (Expression.IsAccessorAccessible): Clarify code somewhat.
14516 2005-04-07 Marek Safar <marek.safar@seznam.cz>
14518 * class.cs (PropertyMethod.Define): Check private accessor in abstract
14521 * decl.cs (DeclSpace.ApplyAttributeBuilder): Don't allow RequiredAttribute
14524 * typemanager.cs: Registered RequiredAttributeAttribute.
14526 2005-04-06 Marek Safar <marek.safar@seznam.cz>
14528 * class.cs (VerifyMembers): Doesn't need EmitContext argument.
14529 Warning CS0169 is back at level 3.
14530 (IMethodData.SetMemberIsUsed): New method.
14532 * decl.cs (IsUsed): New value; moved from FieldBase.Status
14533 (SetMemberIsUsed, IsUsed): New methods, encapsulate IsUsed.
14535 * delegate.cs (ResolveMethodGroupExpr): Call SetMemberIsUsed.
14537 * ecore.cs (FieldExpr.ResolveMemberAccess): Call SetMemberIsUsed for
14539 (PropertyExpr.ResolveAccessors): Call SetMemberIsUsed when delegate
14542 * expression.cs (OverloadResolve): Call SetMemberIsUsed. when method
14545 * rootcontext.cs (RootContext.EmitCode): Call VerifyMembers in extra run
14546 to avoid the problems with nested types.
14548 2005-04-05 Abin Thomas <projectmonokochi@rediffmail.com>
14549 Anoob V.E <projectmonokochi@rediffmail.com>
14550 Harilal P.R <projectmonokochi@rediffmail.com>
14551 Raja R Harinath <rharinath@novell.com>
14554 * delegate.cs (Define): Emit ParamArrayAttribute for 'params'
14556 * typemanager (GetConstructor): Make public.
14558 2005-04-05 John Luke <john.luke@gmail.com>
14559 Raja R Harinath <rharinath@novell.com>
14562 * typemanager.cs (IsUnmanagedType): Check non-public fields of a
14563 struct too. Return false quicker in a few cases.
14564 (VerifyUnManaged): Use it.
14566 2005-04-05 Raja R Harinath <rharinath@novell.com>
14569 * statement.cs (Block.Resolve): Initialize 'unreachable' to false,
14570 not 'unreachable_seen'.
14572 2005-04-04 Marek Safar <marek.safar@seznam.cz>
14574 * attribute.cs (Attribute.GetValue): Removed unused.
14576 * codegen.cs (CodeGen.TrimExt): Removed unused.
14578 * cs-parser.jay (output): Removed unused.
14580 * cs-tokenizer.cs (hex_digits): Removed unused.
14582 * enum.cs (MapToInternalType, GetEnumeratorName): Removed unused.
14584 * expression.cs (Indirection.LoadExprValue): Removed unused.
14585 (ArrayCreation.ExpressionToArrayArgument): Removed unused.
14587 * iterators.cs (Iterator.param_types): Removed unused.
14589 * statement.cs (Goto.block): Removed unused.
14590 (ToplevelBlock.did): Removed unused.
14591 (Switch.ResolveConstantSwitch): Removed unused.
14593 2005-04-01 Ben Maurer <bmaurer@ximian.com>
14595 * rootcontext.cs: Allow mcs to bootstrap with the compilation
14598 2005-04-01 Raja R Harinath <rharinath@novell.com>
14600 Fix #74232 and cs0208-3.cs.
14601 * expression.cs (ComposedCast.DoResolveAsTypeStep): Add CS0208 check.
14602 * typemanager.cs (IsUnmanagedType): Don't allow 'object' as an
14603 unmanaged type. Don't use FieldBuilders when 't' is a
14604 TypeBuilder. Use ModFlags and MemberType fields.
14605 * class.cs (MemberBase.member_type): Rename from MemberType.
14606 (MemberBase.MemberType): New property. Determines member_type on
14608 (MemberBase.DoDefine): Don't initialize MemberType here.
14609 (FieldMember.Define): Likewise.
14611 2005-04-01 Marek Safar <marek.safar@seznam.cz>
14614 * class.cs (Event.Emit): Call Add/Remove emit even for interfaces.
14615 Attributes are emitted there.
14617 2005-04-01 Raja R Harinath <rharinath@novell.com>
14619 * cs-tokenizer.cs (consume_identifier): Treat 'partial' as a
14620 keyword in 'partial enum' too.
14621 * cs-parser.jay (enum_declaration): Add CS0267 check ('partial enum'
14623 Report from Kamil Skalski <nazgul@omega.pl>.
14626 * rootcontext.cs (ResolveTree): The 'root.Interfaces' list can
14627 have partial containers too.
14629 * ecore.cs (SimpleName.SimpleNameResolve): Move 'invariant meaning
14630 in block' checks to Block.CheckInvariantMeaningInBlock.
14631 * statement.cs (Block.GetKnownVariableInfo): Make private.
14632 (Block.IsVariableUsedInChildBlock): Remove.
14633 (Block.IsVariableUsedInBlock): Likewise.
14634 (Block.CheckInvariantMeaningInBlock): New. Show location of
14635 conflicting declaration.
14636 (Block.AddVariable): Make error messages less long-winded and more
14637 specific. Show location of conflicting declaration.
14638 * parameter.cs (Parameters.Location): New readonly property.
14640 2005-03-31 Raja R Harinath <rharinath@novell.com>
14642 Clean up semantics of invoking ResolveMemberAccess.
14643 * ecore.cs (SimpleName.DoSimpleNameResolve): If a MemberExpression
14644 can have an instance, ensure that we pass in a non-TypeExpression
14645 to ResolveMemberAccess. Tighten up IdenticalNameAndTypeName checks.
14646 (MemberExpr.DoSimpleNameResolve): Remove type_is_inferred
14647 argument. Update to changes and simplify.
14648 (FieldExpr.Emitinstance): Remove CS0120 check.
14649 (PropertyExpr.EmitInstance): Likewise.
14650 * expression.cs (Argument.Resolve): Likewise.
14651 (Invocation.DoResolve): Update to changes in semantics of
14652 InstanceExpression.
14654 2005-03-31 Marek Safar <marek.safar@seznam.cz>
14657 * class.cs (AbstractPropertyEventMethod.EmitMethod): Enable emit method
14660 * decl.cs (MemberCache.AddMethods): Fix infinite loop.
14662 2005-03-31 Raja R Harinath <rharinath@novell.com>
14664 Fix difference in behaviour with commandline invocation.
14665 * driver.cs (Driver.Reset): New.
14666 (CompilerCallableEntryPoint): Call it.
14668 * statement.cs (If.Resolve): Avoid spurious "uninitialized
14669 variable" warnings if the boolean expression failed to resolve.
14671 2005-03-30 Sebastien Pouliot <sebastien@ximian.com>
14673 * attribute.cs: Fix the union of several permissions when some of them
14674 are unrestricted (so the result isn't an unrestricted permission set).
14677 2005-03-30 Raja R Harinath <rharinath@novell.com>
14679 * ecore.cs (MemberExpr): New class. Convert from interface
14681 (MemberExpr.ResolveMemberAccess): Refactor and move here from
14682 MemberAccess.ResolveMemberAccess. Tighten up pre-conditions and
14684 (MethodGroupExpr, FieldExpr, PropertyExpr, EventExpr): Update.
14685 (MethodGroupExpr.IsExplicitImpl): Remove.
14686 (Expression.GetFieldFromEvent): Remove.
14687 (SimpleName.MemberStaticCheck): Remove.
14688 (SimpleName.DoSimpleNameResolve): Update to changes.
14689 * expression.cs (MemberAccess.ResolveMemberAccess): Refactor.
14690 (MemberAccess.IdenticalNameAndTypeName): Remove.
14691 (MemberAccess.error176): Move to MemberExpr.
14692 (MemberAccess.DoResolve): Update to changes.
14693 (BaseAccess.DoResolve): Likewise.
14695 2005-03-30 Marek Safar <marek.safar@seznam.cz>
14697 C# 2.0 Conditional attribute class implementation
14699 * attribute.cs (AttributeTester.IsAttributeExcluded): New method.
14700 Analyzes class whether it has attribute which has ConditionalAttribute
14701 and its condition is not defined.
14703 * class.cs (Class.ApplyAttributeBuilder): Add IsAttributeExcluded check.
14704 (Class.IsExcluded): New method. Search for at least one defined
14705 condition in ConditionalAttribute of attribute class.
14707 2005-03-30 Raja R Harinath <rharinath@novell.com>
14709 * ecore.cs (PropertyExpr): Derive from Expression, not
14710 ExpressionStatement.
14711 (PropertyExpr.EmitStatement): Remove.
14713 2005-03-29 Raja R Harinath <rharinath@novell.com>
14716 * expression.cs (MemberAccess.ResolveMemberAccess): Allow the
14717 internal field "value__" of an enum be private. The examples for
14718 "value__" that I found on MSDN all used FieldAttributes.Private.
14720 * decl.cs (MemberCache.AddMethods): Use C# terminology in warning.
14721 Don't mention IL method attribute names.
14723 Fix #47991. Remove a TODO.
14724 * statement.cs (Block.Toplevel): Make into a field.
14725 (Block.Parameters): Move into ToplevelBlock.
14726 (Block.known_variables): Rename from child_variable_names.
14727 (Block.Block): Remove variants that take Parameters. Initialize
14728 'Toplevel' with the immediately surrounding toplevel block.
14729 (Block.AddKnownVariable): Rename from AddChildVariableName. Add a
14730 LocalInfo parameter.
14731 (Block.GetKnownVariableInfo): New.
14732 (Block.IsVariableNameUsedInChildBlock): Update.
14733 (Block.IsVariableNameUsedInBlock): New. Checks if a name is used in
14734 the block, even though it may not be in scope.
14735 (Block.AddVariable): Remove Parameters parameter. Use
14736 Toplevel.Parameters instead.
14737 (Block.AddConstant): Remove Parameters parameter.
14738 (Block.GetParameterReference): Update to use Toplevel.Parameters.
14739 (Block.IsParamaterReference): Likewise.
14740 (Block.IsLocalParameter): Likewise. Simplify a lot.
14741 (ToplevelBlock.Parameters): New. Moved from Block.
14742 (ToplevelBlock.ToplevelBlock): Update to changes. Always
14743 initialize Parameters to a non-null value.
14744 * cs-parser.jay: Update to changes.
14745 * ecore.cs (SimpleName.SimpleNameResolve): Emit cs0136 error for
14746 simple names that mean different things in the same block. Use
14747 Block.IsVariableNameUsedInBlock.
14749 2005-03-28 Raja R Harinath <rharinath@novell.com>
14751 * typemanager.cs (TypeHandle.BaseType): Make into an IMemberContainer.
14752 (TypeHandle.TypeHandle): Use LookupMemberCache rather than
14753 GetTypeHandle. It is possible for a reflected type to derive from
14754 a TypeBuilder (e.g., int[] derives from the TypeBuilder
14755 System.Array during mscorlib compilation).
14756 * decl.cs (MemberCache.MemberCache): If the base cache doesn't
14757 contain a method_hash, don't create one either. Don't create a
14758 deep copy of the base cache's method_hash.
14759 (MemberCache.SetupCache): Rename back from DeepCopy.
14760 (MemberCache.AddMethods): Rewrite, now that method_hash isn't
14761 already initialized. If we see an override function, add its
14762 underlying base virtual function to the member_hash too.
14764 * enum.cs (Enum.LookupEnumValue): Remove debugging code.
14766 2005-03-26 Raja R Harinath <harinath@acm.org>
14769 * assign.cs (Assign.DoResolve): When the RHS of an assignment
14770 fails to resolve, ensure that the LHS is still resolved as an
14773 2005-03-25 Raja R Harinath <harinath@acm.org>
14775 * enum.cs (Enum.DefineType): Set ec.InEnumContext and
14777 (Enum.current_ec): Remove.
14778 (Enum.LookupEnumValue): Remove EmitContext argument.
14779 Just uses the one created during DefineType.
14780 (Enum.FindMembers): Update.
14781 * expression.cs (MemberAccess.DoResolve): Update.
14783 2005-03-22 Marek Safar <marek.safar@seznam.cz>
14785 * assign.cs (Assign.DoResolve): Check for CS1717 when
14786 source and target are same (uses Equals).
14788 * expression.cs (LocalVariableReference, ParameterReference,
14789 This): Implemented Equals, GetHashCode.
14791 * statement.cs (Block.GetParameterReference): Removed useless
14794 2005-03-22 Raja R Harinath <rharinath@novell.com>
14797 * statement.cs (Block.AddVariable): Ensure that we skip implicit
14798 blocks before deciding whether the error is cs0136 or cs0128.
14800 * cs-parser.jay: Pass MemberName to RootContext.Tree.RecordDecl.
14801 (using_alias_directive, using_namespace_directive): Pass
14802 MemberName, not an expression to Namespace.UsingAlias and
14804 (MakeName): Use the MemberName of the namespace.
14805 * namespace.cs (Namespace.MemberName): New.
14806 (UsingEntry.UsingEntry): Take a MemberName, not an expression.
14807 (AliasEntry.AliasEntry, Namespace.Using, Namespace.UsingAlias):
14809 * decl.cs (MemberName.Name): Make readonly.
14810 (MemberName.FromDotted): New "constructor".
14811 (MemberName.Equals, MemberName.GetHashCode): Implement overrides.
14812 (MemberCore.Name): Compute from MemberName on demand.
14813 (MemberCore.SetMemberName): Provide a way to change the
14815 (MemberCore.AddToContainer): Don't take a fullname parameter.
14816 * class.cs (TypeContainer.AddToMemberContainer): Don't add the
14817 fully qualified name of the container to the member name.
14818 (TypeContainer.AddToTypeContainer): Use a fully qualified name
14819 only if the type is a member of the root container.
14820 (TypeContainer.AddMethod, TypeContainer.AddProperty): Use
14821 MemberName.Left rather than searching for an embedded ".".
14822 (PartialContainer.CreatePart): Update to changes in RootContext.
14823 (MemberBase.ShortName): Turn into a property. Use
14824 MemberCore.SetMemberName.
14825 (MemberBase.ExplicitInterfaceName): Remove.
14826 (MemberBase.UpdateMemberName): Remove.
14827 (AbstractPropertyEventMethod.UpdateName): Use SetMemberName.
14828 (PropertyBase.SetMemberName): New override.
14829 * tree.cs (Tree.RecordDecl): Take a MemberName and use it as hash key.
14830 (Tree.GetDecl): New.
14831 (Tree.AllDecls): Rename from Decls.
14832 * attribute.cs, enum.cs, report.cs: Update to changes.
14833 * driver.cs (MainDriver): Use MemberName.FromDotted on
14834 RootContext.MainClass.
14836 2005-03-21 Marek Safar <marek.safar@seznam.cz>
14838 * class.cs (FixedField.Define): Check for CS1664 and more sanity
14841 * expression.cs (ElementAccess.DoResolveLValue): Check for CS1708.
14843 2005-03-18 Marek Safar <marek.safar@seznam.cz>
14845 * modifiers.cs (Modifiers.PROPERTY_CUSTOM): New constant for
14846 property accessor modifiers.
14848 * class.cs (FieldMember.ApplyAttributeBuilder): Don't allow apply
14849 fixed buffer attribute (CS1716).
14850 (PropertyMethod.HasCustomAccessModifier): When property accessor
14851 has custom modifier.
14853 * ecore (PropertyExpr.DoResolve): Add CS0271 for custom accessor
14855 (PropertyExpr.DoResolveLValue): Add CS0272.
14857 2005-03-17 Miguel de Icaza <miguel@novell.com>
14859 * convert.cs: When converting to a pointer, use the proper Conv.U
14860 or Conv.I depending on the source data type.
14862 * cs-tokenizer.cs: Make the size for large decimal constants,
14865 2005-03-17 Martin Baulig <martin@ximian.com>
14867 * anonymous.cs (AnonymousMethod.method_modifiers): Change default
14868 from `Modifiers.INTERNAL' to `Modifiers.PRIVATE'. Fixes #73260.
14870 2005-03-17 Martin Baulig <martin@ximian.com>
14872 * anonymous.cs (AnonymousMethod.EmitMethod): Changed return type
14873 to bool so we can return an error condition.
14874 (AnonymousDelegate.Emit): Check whether AnonymousMethod.EmitMethod()
14877 2005-03-16 Zoltan Varga <vargaz@freemail.hu>
14879 * attribute.cs: Encode ThrowOnUnmappableChar and BestFitMapping
14882 2005-03-16 Raja R Harinath <rharinath@novell.com>
14884 Remove TypeManager.LookupType and TypeManager.LookupTypeDirect.
14885 Refactor to avoid traversing the list of assemblies, and to avoid
14886 string concatenation.
14887 * typemanager.cs (guid_attr_type): Remove.
14888 (negative_hits, pointers, references): Remove hashes.
14890 (GetConstructedType): New. Uses type_hash to handle constructed
14891 types (arrays, references, pointers).
14892 (GetReferenceType, GetPointerType): Use it.
14893 (GetNestedType): New. Uses type_hash to handle nested types of
14895 (LookupType, LookupTypeDirect): Remove.
14896 (CoreLookupType): Inline parts of old LookupTypeDirect code. Use
14897 'types' hash and LookupTypeReflection directly.
14898 (params_string, params_object): Use GetConstructedType.
14899 * namespace.cs (Namespace.cached_types): New. Cache of reflected
14901 (Namespace.Lookup): Use cached_types.
14902 (NamespaceEntry.LookupNamespaceOrType): Inline the functionality
14903 provided by old TypeManager.LookupType.
14904 * rootcontext.cs (MakeFQN): Remove.
14905 * decl.cs (DeclSpace.MakeFQN): Likewise.
14906 (DeclSpace.LookupType): Use TypeManager.GetNestedType.
14907 * expression.cs (ComposedCast.DoResolveAsTypeStep): Use
14908 TypeManager.GetConstructedType.
14909 * tree.cs (decl_ns_hash, LookupByNamespace): Remove.
14911 2005-03-15 Marek Safar <marek.safar@seznam.cz>
14913 * class.cs (MethodCore.CheckBase): Report CS1715 for properties and
14916 * cs-parser.jay: Reports CS1527 for any namespace element.
14918 * delegate.cs (DelegateCreation.Error_NoMatchingMethodForDelegate):
14921 * expression.cs (ParameterReference.IsAssigned): Changed error to
14923 (Error_WrongNumArguments): Moved CS0245 detection here.
14925 * statement.cs (Return.Resolve): Add CS1622 report.
14927 2005-03-11 Marek Safar <marek.safar@seznam.cz>
14929 * class.cs (StaticClass.DefineContainerMembers): Added CS0720.
14931 2005-03-11 Zoltan Varga <vargaz@freemail.hu>
14933 * attribute.cs expression.cs: Get rid of some allocations.
14935 2004-03-11 Atsushi Enomoto <atsushi@ximian.com>
14937 * doc.cs : just eliminate the latest change.
14939 2004-03-10 Atsushi Enomoto <atsushi@ximian.com>
14941 * doc.cs : commented out the latest change. It breaks xml-030.cs
14943 2004-03-10 Atsushi Enomoto <atsushi@ximian.com>
14945 * doc.cs : When TypeBuilder did not create Type yet, GetEvents() will
14946 fail. So invoke CreateType() in FindDocumentedType().
14948 2004-03-10 Atsushi Enomoto <atsushi@ximian.com>
14950 * cs-tokenizer.cs : added IsKeyword().
14951 * doc.cs : Detect keyword incorrectly used as identifier.
14952 Allow identifiers prefixed by @.
14954 2005-03-10 Marek Safar <marek.safar@seznam.cz>
14956 * attributes.cs (Attributes.Emit): Continue after CheckTargets.
14957 It caused exception in namespace resolving (again!).
14959 * class.cs (Class.ctor): Removed exit.
14960 (PropertyMethod.ctor): ditto.
14962 * codegen.cs (Codegen.Reset): Reset static data.
14963 (Codegen.ResolveTopBlock): Forward error status from ResolveMeta.
14965 * cs-tokenizer.cs (Cleanup): Removed.
14967 * driver.cs (GetSystemDir): Rewrote to one line command.
14968 It caused problem with unloaded dynamic modules.
14969 (UnixParseOption): Removed Exit.
14970 (CompilerCallableEntryPoint.InvokeCompiler): Make static.
14971 (CompilerCallableEntryPoint.Reset): Reset suitable static data.
14972 Now can be mcs used as library.
14974 * ecore.cs (Expression.ResolveBoolean): Use Location.Null for
14977 * location.cs (Reset): Reset static data.
14979 * namespace.cs (Reset): Reset static data.
14981 * report.cs (Report.Reset): Reset static data.
14983 * rootcontext.cs (RootContext.Reset): Reset static data.
14985 * tree.cs (RootTypes.ctor): Use Location.Null
14987 * typemanager.cs (TypeManager.Reset): Reset static data.
14988 (CoreLookupType): Removed Exit.
14989 (TypeHandle.Reset): Reset static data.
14991 2005-03-10 Raja R Harinath <rharinath@novell.com>
14994 * typemanager.cs (ComputeNamespaces): Import namespaces from
14995 referenced modules too.
14997 2005-03-09 Raja R Harinath <rharinath@novell.com>
14999 * class.cs (TypeContainer.AddToMemberContainer): Use "." rather
15002 2005-03-09 Raja R Harinath <rharinath@novell.com>
15004 * decl.cs (DeclSpace.LookupType): Don't loop but recurse into
15005 enclosing DeclSpace. This ensures that a name-lookup populates
15006 more caches and there are fewer 'TypeExpression's. Carve out
15007 nested type lookup into ...
15008 (LookupNestedTypeInHierarchy): ... this.
15010 2005-03-09 Raja R Harinath <rharinath@novell.com>
15012 Clean up a few partial-class semantics.
15013 Fixes test-357.cs and cs1618-2.cs.
15014 * cs-parser.jay (struct_declaration): Use 'current_class' as
15015 parent of newly-created struct. Remove call to Register ().
15016 Use 'pop_current_class' to complete handing the current struct.
15017 (interface_declaration): Likewise.
15018 (class_declaration): Likewise.
15019 (enum_declaration): Use 'current_class' as parent of newly created
15021 (delegate_declaration): Likewise.
15022 (pop_current_class): New function. This is used to handle closing
15023 up the 'current_class' and 'current_container', and pointing them
15024 to the enclosing class/container.
15025 (CSharpParser): Initialize 'current_class' too.
15026 * decl.cs (MemberCore): Add check for invariant: a partial
15027 container is not a parsed entity, and thus does not enclose any
15029 (DeclSpace.TypeResolveEmitContext): Expose 'type_resolve_ec'.
15030 (DeclSpace.BaseTypeExpr): Use it.
15031 (DeclSpace.LookupType): Add check for invariant.
15032 * class.cs (TypeContainer): Add check for invariant: a nested
15033 class should have the same NamespaceEntry as its enclosing class.
15034 (TypeContainer.EmitFieldInitializers): Make virtual.
15035 (TypeContainer.DefineDefaultConstructor): Adhere to invariant in
15037 (TypeContainer.Register): Remove.
15038 (TypeContainer.DefineType): Set the 'ec' of a PartialContainer to
15039 null. Use TypeResolveEmitContext for resolving base types and
15040 interfaces. Move initialization of Parts.TypeBuilder here from
15042 (TypeContainer.DefineNestedTypes): ... here.
15043 (PartialContainer): Take a Namespace not a NamespaceEntry.
15044 (PartialContainer.Create): Don't use Register. Call the
15045 appropriate Add... function directly.
15046 (ClassPart): Take both the PartialContainer and the enclosing
15047 class as constructor arguments.
15048 (ClassPart.EmitFieldInitializers): Override.
15049 (ClassPart.PartFindNestedTypes): Remove.
15050 (FieldBase.GetInitializerExpression): Resolve the initializer
15051 expression in the emit context of the enclosing class.
15052 * tree.cs (RootTypes): Remove Register ().
15054 2005-03-08 Marek Safar <marek.safar@seznam.cz>
15056 * cs-parser.jay: Removed CS0134.
15058 * driver.cs: Removed CS1901.
15060 * expression.cs (SizeOf.DoResolve): Don't report CS0233
15061 for predefined types.
15063 2005-03-07 Duncan Mak <duncan@novell.com>
15065 * codegen.cs (Save): Catch UnauthorizedAccessException as
15066 well. Fixes bug #73454.
15068 2005-03-07 Marek Safar <marek.safar@seznam.cz>
15070 * cs-tokenizer.cs (xtoken): Add CS1035.
15072 * class.cs (MethodData.Define): Add CS0683.
15073 (FieldMember.ctor): Add CS0681.
15075 2005-03-07 Raja R Harinath <rharinath@novell.com>
15077 * ecore.cs (SimpleName.DoResolve): Rename from
15078 SimpleName.DoResolveAllowStatic.
15079 (SimpleName.DoSimpleNameResolve): Remove 'allow_static' argument.
15080 Pass 'intermediate' flag to MemberStaticCheck.
15081 (SimpleName.MemberStaticCheck): Skip "static check" only in case
15082 of "intermediate" lookups via MemberAccess.
15083 (SimpleName.IdenticalNameAndTypeName): New. Carved out of ...
15084 * expression.cs (MemberAccess.IdenticalNameAndTypeName): ... this.
15086 2005-03-07 Raja R Harinath <rharinath@novell.com>
15089 * ecore.cs (FieldExpr.EmitInstance): Catch cases of CS0120 that
15090 slipped in because of variable names that are identical to a
15091 builtin type's BCL equivalent ('string String;', 'int Int32;').
15092 (PropertyExpr.EmitInstance): Likewise.
15094 2005-03-04 Marek Safar <marek.safar@seznam.cz>
15096 * cs-tokenizer.cs (PreProcessPragma): Add warning 1633, 1635.
15098 * report.cs (warning_ignore_table): Made public.
15100 2005-03-04 Raja R Harinath <rharinath@novell.com>
15103 * class.cs (MethodData.Emit): Pass 'container' to
15104 container.GetObsoleteAttribute instead of 'container.Parent'.
15106 2005-03-03 Marek Safar <marek.safar@seznam.cz>
15108 * cs-parser.jay: Add 1534 error test.
15110 * iterators.cs (Yield.CheckContext): Add error 1629.
15111 (Iterator.ctor): Save unsafe modifier.
15112 (MoveNextMethod.DoEmit): Restore unsafe context.
15114 * namespace.cs (UsingAlias): Better error message.
15116 2005-03-03 Dan Winship <danw@novell.com>
15118 * convert.cs (Error_CannotImplicitConversion): fix two bugs in
15119 the warning message [#73219]
15121 2005-03-03 Raja R Harinath <rharinath@novell.com>
15123 Fix compile with MCS 1.0.0.0.
15124 * cs-tokenizer.cs (PreProcessPragma): Simplify w_disable and
15125 w_restore to not depend on string constant folding.
15127 2005-03-03 Raja R Harinath <rharinath@novell.com>
15129 * decl.cs (DeclSpace.LookupType): Remove 'silent' argument. Move
15130 CS0246 check to users who passed 'silent = false'.
15131 * ecore.cs (TypeLookupExpression.DoResolveAsTypeStep): Add CS0246
15133 (SimpleName.SimpleNameResolve): Update.
15134 * expression.cs (ComposedCast.DoResolveAsTypeStep): Add CS0246 check.
15135 (MemberAccess.IdenticalNameAndTypeName): Update.
15136 * doc.cs (FindDocumentedTypeNonArray): Update.
15138 2005-03-03 Raja R Harinath <rharinath@novell.com>
15140 * codegen.cs (EmitContext): Remove ResolvingTypeTree.
15141 * parameters.cs (ComputeAndDefineParameters): Remove.
15142 * decl.cs (ResolveBaseTypeExpr): Don't set ResolvingTypeTree.
15143 * delegate.cs (Define): Don't invoke ComputeAndDefineParameters.
15144 Use GetParameterInfo.
15146 2005-03-02 Marek Safar <marek.safar@seznam.cz>
15148 * report.cs (StaticClass.DefineContainerMembers): Add warning 628.
15150 2005-03-02 Raja R Harinath <rharinath@novell.com>
15152 Unify DeclSpace.LookupType and DeclSpace.FindType.
15153 * decl.cs (DeclSpace.FindNestedType): New virtual function. This
15154 is in charge of defining nested types on demand.
15155 (DeclSpace.LookupType): Use it when the current_type is a
15156 TypeBuilder. Use LookupTypeDirect for reflected types.
15157 (DeclSpace.FindType): Remove.
15158 (DeclSpace.LookupInterfaceOrClass): Likewise.
15159 (DeclSpace.DefineTypeAndParents): Likewise.
15160 * ecore.cs (SimpleName.ResolveAsTypeStep): Just call
15161 DeclSpace.LookupType.
15162 * doc.cs (FindDocumentedTypeNonArray): Use DeclSpace.LookupType.
15163 * typemanager.cs (LookupType): Simplify.
15164 (AddUserType): Remove type from negative_hits.
15165 * namespace.cs (Namespace.Lookup): Use TypeManager.LookupTypeDirect.
15166 * class.cs (TypeContainer.FindMembers): Move handling of nested
15168 (TypeContainer.FindMembers_NestedTypes): ... here.
15169 (TypeContainer.FindNestedType): Implement override.
15170 (ClassPart.FindNestedType): Delegate to PartialContainer.
15171 (ClassPart.PartFindNestedType): Looks up the nested types of the
15174 2005-03-02 Martin Baulig <martin@ximian.com>
15176 * class.cs (TypeContainer.DoDefineMembers): We also need a default
15177 static constructor in static classes.
15179 2005-03-01 Zoltan Varga <vargaz@freemail.hu>
15181 * attribute.cs: Pass -1 to DefineLPArrayInternal if sizeConst or
15182 sizeParamIndex is not specified.
15184 2005-03-01 Marek Safar <marek.safar@seznam.cz>
15187 * report.cs (WarningMessage.IsEnabled): Missing null check.
15189 2005-02-28 Marek Safar <marek.safar@seznam.cz>
15191 * attribute.cs (DefinePInvokeMethod): Fix, all data are stored
15192 in the fields and not in the properties.
15194 2005-02-28 Zoltan Varga <vargaz@freemail.hu>
15196 * attribute.cs (GetMarshal): Marshal SizeConst and SizeParamIndex
15199 2005-02-28 Marek Safar <marek.safar@seznam.cz>
15201 * attribute.cs: Small refactoring (improved robustness).
15202 (ImplOptions, UnmanagedType, UsageAttribute): Removed members.
15203 (ValidateGuid): Removed.
15204 (Resolve): Removed referenced to above mentioned.
15205 (GetAttributeUsage): Made private and changed to work without
15207 (GetIndexerAttributeValue): Don't crash.
15208 (GetConditionalAttributeValue): Ditto.
15209 (GetClsCompliantAttributeValue): Ditto.
15210 (ExtractSecurityPermissionSet): All attributes exceptions are
15212 (GetPropertyValue): New helper.
15213 (GetMethodImplOptions): New method.
15214 (DefinePInvokeMethod): Reuse common code. Implemented handling of
15215 some missing properties.
15217 * class.cs (ClassOrStruct.ApplyAttributeBuilder): Updated.
15218 (Method.ApplyAttributeBuilder): Updated.
15220 * decl.cs (DeclSpace.ApplyAttributeBuilder): Don't catch shared
15223 2005-02-28 Raja R Harinath <rharinath@novell.com>
15226 * report.cs (Report.SymbolRelatedToPreviousError): Handle
15227 non-simple types (array, pointer, reference).
15229 2005-02-28 Marek Safar <marek.safar@seznam.cz>
15231 * cs-parser.jay: Add errors 1617, 650, 1007, 531, 547, 548
15233 * class.cs (MethodCore.IsDuplicateImplementation): Special error
15235 (Method.CheckBase): Catch wrong destructor here.
15236 (MethodData.Define): Add errors 550, 668.
15238 * cs-tokenizer.cs (PreProcessPragma): Add warning 1634.
15240 * ecore.cs (PropertyExpr.DoResolveLValue): Fixed wrong error code.
15242 * pending.cs (VerifyPendingMethods): Add error 551.
15244 * typemanager.cs (CSharpName): Next error report helper.
15246 2005-02-25 Marek Safar <marek.safar@seznam.cz>
15248 * attribute.cs (Atttribute.Resolve): Add cache for parameter-less
15249 attributes. Removed useless attribute double check.
15250 It saves almost 2MBs for corlib.
15252 2005-02-25 Raja R Harinath <rharinath@novell.com>
15255 * statement.cs (ExpressionStatement.Resolve): Make robust to being
15256 called twice in case of error.
15258 2005-02-23 Chris Toshok <toshok@ximian.com>
15260 Fix compiler portions of #72827.
15261 * statement.cs (Block.Emit): call Begin/EndScope on the
15262 EmitContext instead of the ILGenerator.
15264 * codegen.cs (EmitContext.BeginScope): new method, call
15265 ILGenerator.BeginScope as well as the SymbolWriter's OpenScope (if
15267 (EmitContext.BeginScope): same, but EndScope and CloseScope
15269 * symbolwriter.cs (SymbolWriter.OpenScope): get the current il
15270 offset and call the superclass's OpenScope(int) with it.
15271 (SymbolWriter.CloseScope): get the current il
15272 offset and call superclass's CloseScope(int) with it.
15274 2005-02-23 Marek Safar <marek.safar@seznam.cz>
15276 * anonymous.cs (AnonymousMethod.Compatible): Fixed to report
15277 CS1677 for out and ref as well.
15279 * class.cs (Method.Define): Add error CS1599 detection.
15281 * cs-parser.jay: Add CS1609, CS1670, CS1627 detection.
15283 * cs-tokenizer.cs (xtoken): Add error CS1646 detection.
15285 * delegate.cs (Delegate.Define): Add error CS1599 detection.
15287 * support.cs.cs (ModifierDesc): New helper method.
15289 2005-02-23 Raja R Harinath <rharinath@novell.com>
15290 Abin Thomas <projectmonokochi@rediffmail.com>
15291 Anoob V E <projectmonokochi@rediffmail.com>
15292 Harilal P R <projectmonokochi@rediffmail.com>
15294 Fix #57851, #72718.
15295 * class.cs (ConstructorBuilder.Resolve): Make sure that the second
15296 MemberLookup (used for error reporting) actually returns a result.
15297 Fix error report number (122, not 112).
15299 2005-02-22 Abin Thomas <projectmonokochi@rediffmail.com>
15300 Anoob V E <projectmonokochi@rediffmail.com>
15301 Harilal P R <projectmonokochi@rediffmail.com>
15304 * pending.cs (PendingImplementation.GetAbstractMethods):
15305 Find NonPublic members too.
15307 2005-02-22 Marek Safar <marek.safar@seznam.cz>
15309 * expression.cs.cs (ConditionalLogicalOperator.DoResolve):
15312 * class.cs (MethodCore.CheckMethodAgainstBase):
15313 Add error 239 report.
15315 2005-02-21 Raja R Harinath <rharinath@novell.com>
15318 * expression.cs (Invocation.IsApplicable): Make public.
15319 (Invocation.IsParamsMethodApplicable): Likewise.
15320 * delegate.cs (Delegate.VerifyApplicability): Don't use
15321 Invocation.VerifyArgumentCompat for parameter applicability
15322 testing. Use Invocation.IsApplicable and
15323 Invocation.IsParamsMethodApplicable.
15325 2005-02-21 Marek Safar <marek.safar@seznam.cz>
15327 * ecore.cs (PropertyExpr.DoResolve): Add error 214 report.
15329 * class.cs (Operator.Define): Add error 217 report.
15331 2005-02-21 Raja R Harinath <rharinath@novell.com>
15333 * namespace.cs (UsingEntry.Resolve): Undo change below.
15335 2005-02-21 Raja R Harinath <rharinath@novell.com>
15338 * ecore.cs (Expression.MemberLookupFailed): Add argument to
15339 disable the error message when the extended MemberLookup also
15341 (Expression.MemberLookupFinal): Update.
15342 (SimpleName.DoSimpleNameResolve): Update.
15343 * expression.cs (MemberAccess.ResolveNamespaceOrType):
15344 Don't use MemberLookupFinal.
15345 (New.DoResolve): Update.
15346 (BaseAccess.CommonResolve): Update.
15348 2005-02-21 Raja R Harinath <rharinath@novell.com>
15351 * attribute.cs (Attribute.ResolveType): If a 'resolve_error' had
15352 occured previously, don't resolve again.
15354 2005-02-21 Marek Safar <marek.safar@seznam.cz>
15357 * attribute.cs (Attribute.GetAttributeUsage): Add EmitContext
15358 argument. Call ResolveAttributeUsage for unresolved.
15359 when types doesn't match ctor arguments.
15361 * class.cs (DoDefineMembers.TypeContainer): Removed safety check
15362 for nested attribute classes.
15363 (Class.attribute_usage): Removed.
15364 (Class.ResolveAttributeUsage): Resolves AttributeUsageAttribute
15365 for attribute class.
15367 * ecore.cs (IsAttribute): Removed.
15369 * namespace.cs (UsingEntry.Resolve): Don't destroy NamespaceEntry.
15371 * rootcontext.cs (RegisterAttribute): Removed, attributes are
15373 (attribute_types): Removed.
15374 (EmitCode): Global attributes are emited as the latest.
15376 2005-02-18 Marek Safar <marek.safar@seznam.cz>
15378 * class.cs (EmitFieldInitializers): Don't emit field initializer
15379 for default values when optimilization is on.
15381 * constant.cs (Constant.IsDefaultValue): New property.
15383 * driver.cs: Add /optimize handling.
15387 * literal.cs: Implement new IsDefaultValue property.
15389 * rootcontext.cs (Optimize): New field, holds /optimize option.
15391 2005-02-18 Raja R Harinath <rharinath@novell.com>
15393 Fix crasher in re-opened #72347.
15394 * namespace.cs (Namespace.Lookup): Return null if
15395 DeclSpace.DefineType returns null.
15398 * expression.cs (Argument.Resolve): Handle a case of CS0120 here.
15400 2005-02-18 Raja R Harinath <rharinath@novell.com>
15402 Fix remainder of #63202. Change semantics of DoResolveLValue: it
15403 now returns null if it cannot resolve to an lvalue.
15404 * ecore.cs (Expression.DoResolveLValue): Return 'null' by default.
15405 (Expression.ResolveLValue): Emit CS0131 error if DoResolveLValue
15406 returned null. Remove check for SimpleName.
15407 (EventExpr.DoResolveLValue): New.
15408 * iterators.cs (Iterator.FieldExpression.DoResolveLValue): New.
15409 * expression.cs (Argument.Error_LValueRequired): New. Move CS1510
15411 (Argument.Resolve): ... here. Use it. Use DoResolveLValue to
15412 avoid CS0131 error.
15413 (Unary.ResolveOperator): Move CS0211 check ...
15414 (Unary.DoResolve): ... here. Use DoResolveLValue to avoid
15416 (Unary.DoResolveLValue): Simplify.
15417 (AddressOf.DoResolveLValue): New.
15418 (ArrayAccess.DoResolveLValue): New.
15420 2005-02-16 Marek Safar <marek.safar@seznam.cz>
15422 * attribute.cs (Attribute.Resolve): Add arguments casting for
15423 when types doesn't match ctor arguments.
15425 2005-02-16 Raja R Harinath <rharinath@novell.com>
15427 Fix parts of #63202.
15428 * expression.cs (UnaryMutator.ResolveOperator): Remove redundant
15429 lookup of operator in base type. Ensure that all checks happen
15430 when the operator resolves to an "op_..." method.
15432 2005-02-15 Raja R Harinath <rharinath@novell.com>
15435 * namespace.cs (NamespaceEntry.LookupNamespaceOrType): Add
15436 'ignore_cs0104' parameter. Pass it to ...
15437 (NamespaceEntry.Lookup): ... this.
15438 * decl.cs (DeclSpace.LookupType): Add 'ignore_cs0104' parameter.
15439 * ecore.cs (SimpleName.ResolveAsTypeStep): Update.
15440 (TypeLookupExpression.DoResolveAsTypeStep): Update.
15441 * expression.cs (MemberAccess.IdenticalNameAndTypeName):
15442 Update. Request that cs0104 errors be ignored.
15443 (ComposedCast.ResolveAsTypeStep): Update.
15445 2005-02-14 Raja R Harinath <rharinath@novell.com>
15448 * expression.cs (Invocation.BetterFunction): Remove support for
15449 comparing virtual functions and their overrides.
15450 (Invocation.IsOverride): New.
15451 (Invocation.OverloadResolve): Don't consider 'override' functions
15452 during candidate selection. Store them in a lookaside list.
15453 If the selected method is a 'virtual' function, use the list to
15454 find any overrides that are closer to the LHS type.
15456 2005-02-14 Marek Safar <marek.safar@seznam.cz>
15458 * expression.cs (New.DoResolve): Add complex core type reduction.
15459 (New.Constantify): Converts complex core type syntax like 'new int ()'
15460 to simple constant.
15462 2005-02-14 Raja R Harinath <rharinath@novell.com>
15464 * decl.cs (EntryType.EntryType): New constructor to create an
15465 updated copy of a cache entry.
15466 (MemberCache.AddMethods): Use it.
15467 (MemberCache.ClearDeclaredOnly): Remove.
15468 (MemberCache.MemberCache): Update.
15470 2005-02-11 Miguel de Icaza <miguel@novell.com>
15472 * codegen.cs (EmitContext): Introduce the `MethodIsStatic'
15473 variable. This one is represents the actual low-level declaration
15474 of the method, as opposed to the semantic level `IsStatic'.
15476 An anonymous method which is hosted into a static method might be
15477 actually an instance method. IsStatic would reflect the
15478 container, while MethodIsStatic represents the actual code
15481 * expression.cs (ParameterReference): Use the new MethodIsStatic
15482 instead of IsStatic.
15484 * anonymous.cs (AnonymousMethod.Compatible): Pass the
15485 Modifiers.STATIC to the Anonymous' Method EmitContext if static is
15486 set on the current EmitContext.
15488 * expression.cs (Cast): Overload DoResolveLValue so we can pass
15489 resolve our casted expression as an LValue. This triggers the
15490 proper LValue processing that is later required by Assign.
15494 * cs-tokenizer.cs (pp_and): recurse on pp_and, fixes #61903.
15496 2005-02-11 Marek Safar <marek.safar@seznam.cz>
15498 C# 2.0 Fixed buffer implementation
15500 * anonymous.cs: Update after RegisterHelperClass renaming.
15502 * attribute.cs (AttributeTester.fixed_buffer_cache):
15503 Cache of external fixed buffers.
15504 (AttributeTester.GetFixedBuffer): Returns IFixedBuffer
15505 implementation if field is fixed buffer else null.
15508 (TypeContainer.AddField): Accept FieldMember instead of Field.
15509 (FieldBase.IsFieldClsCompliant): Extracted code from
15510 VerifyClsCompliance descendant customization.
15511 (FixedField): New class handles fixed buffer fields.
15512 (FixedFieldExternal): Keeps information about imported fixed
15514 (IFixedField): Make access to internal or external fixed buffer
15517 * cs-parser.jay: Add fixed buffer parsing.
15519 * ecore.cs (FieldExpr.Emit): Add special emit case for fixed
15522 * expression.cs (Indirection): Extended implementation to accept
15523 fixed buffer field.
15524 (PointerArithmetic.Emit): Get element from fixed buffer as well.
15525 (ElementAccess.MakePointerAccess): Get type as parameter.
15526 (DoResolve): Add fixed buffer field expression conversion.
15527 (DoResolveLValue): Ditto.
15528 (FixedBufferPtr): New class. Moved most of original ArrayPtr.
15529 (ArrayPtr): Derives from FixedBufferPtr.
15530 (ArrayPtr.Emit): Add extra emit for array elements.
15532 * flowanalysis.cs.cs (StructInfo): Use FieldMember.
15534 * rootcontext.cs (CloseTypes): Emit CompilerGenerated attribute
15535 for compiler generated types.
15536 (RegisterCompilerGeneratedType): Renamed from RegisterHelperClass.
15538 * statement.cs (Fixed): Refactored to be easier add fixed buffer
15539 and consume less memory.
15540 (Fixed.Resolve): Add fixed buffer case.
15542 * typemanager.cs (compiler_generated_attr_ctor,
15543 fixed_buffer_attr_ctor): Add new 2.0 compiler attributes.
15544 (HasElementType): Add our own implementation to work on every
15547 2005-02-11 Miguel de Icaza <miguel@novell.com>
15549 * anonymous.cs (CaptureContext): Track whether `this' has been
15552 * expression.cs (This.ResolveBase): Call CaptureThis. Before we
15553 only captured `this' if it was implicitly done (instance
15554 methods/variables were used).
15556 * codegen.cs (EmitContext.CaptureThis): New method to flag that
15557 `this' must be captured.
15559 2005-01-30 Miguel de Icaza <miguel@novell.com>
15561 * anonymous.cs (CreateMethodHost): If there Scope.ScopeTypeBuilder
15562 is null it means that there has been no need to capture anything,
15563 so we just create a sibling.
15565 Renamed `EmitHelperClasses' to `EmitAnonymousHelperClasses'
15567 Just a partial fix. The other half is fairly elusive.
15569 2005-02-10 Raja R Harinath <rharinath@novell.com>
15571 Fix #52586, cs0121-4.cs.
15572 * decl.cs (MemberCache.DeepCopy): Rename from SetupCache. Take
15573 and return a hashtable.
15574 (MemberCache.ClearDeclaredOnly): New.
15575 (MemberCache.MemberCache): Update to change. Make a deep copy of
15576 the method_hash of a base type too.
15577 (MemberCache.AddMethods): Adapt to having a deep copy of the base
15578 type methods. Overwrite entries with the same MethodHandle so
15579 that the ReflectedType is correct. The process leaves in base
15580 virtual functions and their overrides as distinct entries.
15581 (CacheEntry): Now a class instead of a struct. It shouldn't alter
15582 matters since it was boxed in a ArrayList before.
15583 (CacheEntry.Member, CacheEntry.EntryType): Remove 'readonly'
15585 * expression.cs (Invocation.BetterFunction): Simplify. Handle the
15586 case of a virtual function and its override (choose the overload
15588 (Invocation.OverloadResolve): Avoid 'override' members during
15589 'applicable_type' calculation.
15591 2005-02-09 Raja R Harinath <rharinath@novell.com>
15593 Combine two near-redundant caches.
15594 * typemanager.cs (method_params): Rename from method_internal_params.
15595 (TypeManager.GetParameterData): New. Replace
15596 Invocation.GetParameterData.
15597 (TypeManager.LookupParametersByBuilder): Remove.
15598 * expression.cs (Invocation.method_parameter_cache): Remove.
15599 (Invocation.GetParameterData): Remove.
15601 * anonymous.cs, attribute.cs, convert.cs, delegate.cs:
15604 2005-02-08 Raja R Harinath <rharinath@novell.com>
15607 * delegate.cs (Delegate.DefineType): When bootstrapping corlib, if
15608 TypeManager.multicast_delegate_type is null, resolve it by looking
15609 up "System.MulticastDelegate".
15610 * rootcontext.cs (RootContext.ResolveCore): Simplify.
15612 2005-02-07 Abin Thomas (NOSIP) <projectmonokochi@rediffmail.com>
15613 Anoob V.E (NOSIP) <projectmonokochi@rediffmail.com>
15614 Harilal P.R (NOSIP) <projectmonokochi@rediffmail.com>
15617 * statement.cs (LabeledStatement.Resolve): Don't set 'referenced'.
15618 (LabeledStatement.AddReference): New. Set 'referenced'.
15619 (Goto.Resolve): Use it.
15621 2005-02-05 John Luke <john.luke@gmail.com>
15623 * driver.cs: remove duplicate -doc line in Usage ()
15625 2005-02-04 Raja R Harinath <rharinath@novell.com>
15627 * location.cs (Location.AddFile): Fix CS2002 error report.
15629 2005-02-02 Martin Baulig <martin@ximian.com>
15631 * delegate.cs (Delegate.DefineType): Report an internal error if
15632 TypeManager.multicast_delegate_type is null. See bug #72015 for
15635 2005-02-02 Raja R Harinath <rharinath@novell.com>
15637 Fix a crasher in a variant of #31984.
15638 * const.cs (Constant.CheckBase): New override that defers the
15639 new-or-override check in case the base type hasn't been populated
15641 (Constant.Define): Ensure the new-or-override check is performed.
15643 2005-02-01 Duncan Mak <duncan@ximian.com>
15645 * const.cs (LookupConstantValue): Check that `ce' is not null
15646 before calling GetValue ().
15648 2005-02-01 Raja R Harinath <rharinath@novell.com>
15650 Fix test-334.cs (#69519).
15651 * cs-parser.jay (using_alias_directive): Pass in an expression to
15652 NamespaceEntry.UsingAlias.
15653 (using_namespace_directive): Pass in an expression to
15654 NamespaceEntry.Using.
15655 (namespace_name): Don't flatten to a string.
15656 * namespace.cs (NamespaceEntry.AliasEntry): Store an expression.
15657 (NamespaceEntry.AliasEntry.Resolve): Lookup using
15659 (NamespaceEntry.UsingEntry): Likewise.
15660 (NamespaceEntry.Using,NamespaceEntry.UsingAlias): Update to
15662 (NamespaceEntry.LookupForUsing): Remove.
15663 (NamespaceEntry.LookupNamespaceOrType): Add support for dotted
15665 (NamespaceEntry.Lookup): Remove support for dotted names.
15667 2005-02-01 Raja R Harinath <rharinath@novell.com>
15669 * namespace.cs (NamespaceEntry.NamespaceEntry): Simplify, and
15671 (NamespaceEntry.ImplicitParent): Compute on demand.
15672 (NamespaceEntry.Doppelganger): New implicit namespace-entry that
15673 parallels the current.
15674 (NamespaceEntry.LookupForUsing): Use it.
15675 (NamespaceEntry.Lookup): If the current namespace-entry is
15676 implicit, don't search aliases and using tables.
15678 2005-02-01 Raja R Harinath <rharinath@novell.com>
15681 * class.cs (TypeContainer.DoDefineMembers): Don't initialize
15683 (TypeContainer.BaseCache): Compute on demand.
15684 (TypeContainer.FindMembers): Define constants and types if they're
15685 not already created.
15686 (FieldMember.Define): Move resetting of ec.InUnsafe before error
15688 * const.cs (Constant.Define): Make idempotent.
15690 2005-01-29 Miguel de Icaza <miguel@novell.com>
15692 * pending.cs: Produce better code (no nops produced by using Ldarg
15695 * pending.cs (PendingImplementation.DefineProxy): It was not `arg
15696 i - 1' it should be arg + 1.
15700 2005-01-28 Raja R Harinath <rharinath@novell.com>
15702 * attribute.cs (Attribute.CheckAttributeType): Make private
15704 (Attribute.ResolveType): Make virtual.
15705 (GlobalAttribute.ResolveType,GlobalAttribute.Resolve): Simplify
15706 handling of RootContext.Tree.Types.
15708 2005-01-27 Raja R Harinath <rharinath@novell.com>
15710 Update attribute-handling to use the SimpleName/MemberAccess
15712 * cs-parser.jay (attribute): Pass in an expression to the
15713 constructors of Attribute and GlobalAttribute.
15714 * attribute.cs (Attribute): Take an expression for the name.
15715 (Attribute.ResolvePossibleAttributeTypes): New. Resolves the
15716 passed in attribute name expression.
15717 (Attribute.CheckAttributeType): Use it.
15718 * ecore.cs (FullNamedExpression.ResolveAsTypeStep): New.
15719 * expression.cs (MemberAccess.ResolveAsTypeStep): Move body to ...
15720 (MemberAccess.ResolveNamespaceOrType): ... here. Add 'silent'
15721 argument to prevent error messages if the lookup fails.
15723 2005-01-27 Marek Safar <marek.safar@seznam.cz>
15725 * expression.cs (Indirection): Implemented IVariable interface
15726 to support indirection in AddressOf operator.
15727 (PointerArithmetic.Emit): Add optimalization for case where
15728 result can be precomputed.
15730 2005-01-26 Martin Baulig <martin@ximian.com>
15732 * class.cs (TypeContainer.AttributeTargets): Return the correct
15733 AttributeTargets depending on our `Kind' instead of throwing an
15734 exception; fixes #71632.
15736 2005-01-26 Marek Safar <marek.safar@seznam.cz>
15739 * expression.cs (MemberAccess.ResolveMemberAccess): Add CS0176 test for
15742 2005-01-25 Raja R Harinath <rharinath@novell.com>
15745 * expression.cs (MemberAccess.DoResolve): Don't complain with
15746 cs0572 when the LHS of a member access has identical name and type
15749 2005-01-25 Marek Safar <marek.safar@seznam.cz>
15752 * attribute.cs (ExtractSecurityPermissionSet): Catch exceptions from
15754 Create custom PermissionSet only for PermissionSetAttribute.
15756 2005-01-24 Marek Safar <marek.safar@seznam.cz>
15759 * class.cs (StaticClass.DefineContainerMembers): Enable enums and
15760 delegates in static class.
15762 2005-01-24 Martin Baulig <martin@ximian.com>
15764 * flowanalysis.cs (FlowBranching.UsageVector.MergeChild): If we're
15765 merging an implicit block, just use its reachability.
15767 * statement.cs (Block.Resolve): Make the unreachable code check
15768 work wrt. implicit blocks; see test-337 from #63842.
15770 2005-01-21 Alp Toker <alp@atoker.com>
15772 * cs-parser.jay: destructor_declaration's container is PartialContainer
15773 not Class when partial types are used, so use Kind prop instead of
15776 2005-01-22 Miguel de Icaza <miguel@ximian.com>
15778 * cs-parser.jay: Improve error reporting when an interface
15779 declares new types.
15781 2005-01-20 Dick Porter <dick@ximian.com>
15783 * support.cs: SeekableStreamReader fix from Sandor Dobos
15784 (dobos_s@ibcnet.hu) to cope with Position setting when multibyte
15785 chars are read. Fixes bug 70369.
15787 2005-01-20 Raja R Harinath <rharinath@novell.com>
15789 * cs-parser.jay (catch_clause): Simplify current_block handling
15792 2005-01-17 Miguel de Icaza <miguel@ximian.com>
15794 * convert.cs (ImplicitStandardConversionExists): Synchronize the
15795 code with ImplicitStandardConversion to handle the implicit
15796 conversion of method groups into valid delegate invocations.
15798 The problem is that in parameter handling we were using this code
15799 path. Fixes bug #64698
15801 2005-01-19 Raja R Harinath <rharinath@novell.com>
15803 * cs-parser.jay: Fix several infelicities.
15804 - Avoid assigning to the parser value stack. Code like
15805 '$3 = null' is unclean. Synthesize a value for the code block
15807 - Avoid using oob_stack for storing location information. Use ...
15808 (_mark_): ... this. New (empty) rule. Saves the current location
15810 (foreach_statement): Avoid using oob_stack for current_block
15811 handling. Use technique used in for_statement and
15812 using_statement. Synthesize a value for the code block to store
15813 additional intermediate information.
15815 2005-01-13 Miguel de Icaza <miguel@ximian.com>
15817 * ecore.cs (IsAccessorAccessible): Accessibility to private fields
15818 of a different type is only allowed to private fields of a
15819 containing type, not on fields of a base class.
15821 See test-174.cs and error cs0122-9.cs
15823 2005-01-13 Raja R Harinath <rharinath@novell.com>
15825 Fix test-335.cs (bug #58126).
15826 * cs-parser.jay (argument): Split out non-expression parts of the
15827 rule into 'non_simple_argument'.
15828 (invocation_expression): Support parenthesized invocations with
15829 multiple arguments, and with single non-simple arguments.
15831 2005-01-13 Raja R Harinath <rharinath@novell.com>
15833 * cs-tokenizer.cs (xtoken): Reset 'comments_seen' in a couple more
15836 2005-01-12 Raja R Harinath <rharinath@novell.com>
15838 Fix cs0038-1.cs, cs1640-6.cs.
15839 * ecore.cs (Expression.Resolve): Remove special-case for
15840 SimpleName in error-handling.
15841 (Expression.almostMatchedMembers): Relax access permission to
15843 (Expression.MemberLookupFailed): Handle duplicates in
15844 almostMatchedMembers list.
15845 (SimpleName.DoSimpleNameResolve): Catch CS0038 errors earlier.
15846 * expression.cs (New.DoResolve): Report CS1540 for more cases.
15847 * typemanager.cs (GetFullNameSignature): Use the MethodBase
15848 overload if the passed in MemberInfo is a MethodBase.
15850 2005-01-12 Marek Safar <marek.safar@seznam.cz>
15853 * attribute.cs (ExtractSecurityPermissionSet): Don't report error
15854 for non-CAS & merge permission sets properly.
15856 2005-01-11 Raja R Harinath <rharinath@novell.com>
15858 Improve standard-compliance of simple name and member access
15859 resolution. Fixes bugs #52697, #57200, #67520, #69519.
15860 * ecore.cs (FullNamedExpression): New abstract base class
15861 for Namespaces and TypeExpressions.
15862 (ResolveFlags.SimpleName): Remove.
15863 (SimpleName): Remove support for dotted names.
15864 (SimpleName.ResolveAsTypeStep): Simplify. Now just a wrapper to
15865 DeclSpace.FindType and DeclSpace.LookupType.
15866 (SimpleName.DoSimpleNameResolve): Remove support for dotted names.
15867 (Expression.ExprClassName): Make member function.
15868 * expression.cs (MemberAccess.ResolveAsTypeStep): Support LHS being
15869 a namespace. Remove creation of dotted "SimpleName"s.
15870 (MemberAccess.DoResolve): Likewise.
15871 * decl.cs (DeclSpace.Cache): Make private.
15872 (DeclSpace.LookupInterfaceOrClass): Return a FullNamedExpression.
15873 (DeclSpace.FindType): Update.
15874 (DeclSpace.LookupType): Move here from RootContext. Return a
15875 FullNamedExpression.
15876 * namespace.cs (Namespace): Derive from FullNamedExpression
15877 so that it can be part of expression resolution.
15878 (Namespace.Lookup): Return an FullNamedExpression.
15879 (NamespaceEntry.LookupAlias): Lookup aliases only in current
15881 * rootcontext.cs (NamespaceLookup): Remove.
15882 (LookupType): Move to DeclSpace.
15883 * attribute.cs (CheckAttributeType): Update.
15884 * doc.cs (FindDocumentedType): Remove allowAlias argument.
15885 (FindDocumentedTypeNonArray): Likewise.
15887 2005-01-11 Raja R Harinath <rharinath@novell.com>
15889 Fix cs0509.cs, cs1632.cs.
15890 * class.cs (TypeContainer.GetNormalBases): Don't assume !IsClass
15891 is the same as IsInterface.
15892 (TypeContainer.GetClassBases): Likewise.
15893 * statement.cs (LabeledStatement.ig): New field.
15894 (LabeledStatement.LabelTarget): Save ILGenerator which created the
15896 (LabeledStatement.DoEmit): Check that the label was created with
15897 the same ILGenerator.
15899 2005-01-10 Marek Safar <marek.safar@seznam.cz>
15902 * attribute.cs (GetMethodObsoleteAttribute): Need to transform
15903 accessors to its properties.
15905 * ecore.cs (PropertyExpr): Add AccessorTable to help track back
15906 from accessors to property.
15908 2005-01-10 Marek Safar <marek.safar@seznam.cz>
15911 * class.cs (MethodCore.CheckBase): Test base method obsoleteness
15912 only for overrides.
15914 2005-01-08 Miguel de Icaza <miguel@ximian.com>
15916 * attribute.cs: Check for null and empty strings.
15918 I have lost another battle to Paolo.
15920 2005-01-07 Marek Safar <marek.safar@seznam.cz>
15923 * class.cs (PropertyMethod): Set Parent field in ctors.
15924 (SetMethod.InternalParameters): Add unsafe switch hack.
15925 Override MarkForDuplicationCheck where it is appropriate.
15927 * decl.cs (MemberCore.MarkForDuplicationCheck): New method.
15928 It says whether container allows members with the same name.
15929 Base default is no.
15930 (DeclSpace.AddToContainer): Use MarkForDuplicationCheck.
15931 Removed is_method parameter.
15933 2005-01-06 Duncan Mak <duncan@ximian.com>
15935 * cs-tokenizer.cs (xtoken): Redo the work for signaling CS1040
15936 because the previous change led to incorrect reporting of CS1032
15937 ("Cannot define/undefine preprocessor symbols after first token in
15938 file"). Instead of using `tokens_seen' as the only flag that
15939 triggers CS1040, introduce `comments_seen'. This new flag is used
15940 to signify having seen comments on the current line, so it is
15941 unset after a newline.
15943 2005-01-06 Atsushi Enomoto <atsushi@ximian.com>
15945 * doc.cs : When searching for a type, find nested type too.
15946 This fixes bug #71040.
15948 2005-01-06 Atsushi Enomoto <atsushi@ximian.com>
15951 - Warn missing member comment on those classes which also does not
15952 have doc comments. Fixed bug #71041.
15953 - Don't warn missing doc comment on default constructor.
15956 2005-01-06 Duncan Mak <duncan@ximian.com>
15958 * cs-tokenizer.cs (xtoken): After handling traditional C-style
15959 comments, set `tokens_seen' to true. This allows us to detect
15960 misplaced preprocessor directives (i.e. not at the beginning of
15961 the a line, nor after whitespaces). In that case, report error
15962 CS1040. This fixes bug #56460.
15964 * cs-parser.jay (interface_member_declaration): Add checks for
15965 IsExplicitImpl, and report CS0541 error if an interface member is
15966 defined as an explicit interface declaration.
15968 2005-01-06 Marek Safar <marek.safar@seznam.cz>
15971 * class.cs (PropertyMethod): Set Parent field in ctors.
15972 (SetMethod.InternalParameters): Add unsafe switch hack.
15974 * decl.cs (MemberCore.Parent): Cannot be readonly.
15976 2005-01-06 Raja R Harinath <rharinath@novell.com>
15978 * decl.cs (DeclSpace.ResolveType): Remove.
15979 (DeclSpace.ResolveBaseTypeExpr): Rename from ResolveTypeExpr.
15980 Merge in code from ...
15981 (DeclSpace.GetTypeResolvingEmitContext): ... here. Remove.
15982 * class.cs, enum.cs: Update to changes.
15984 2005-01-06 Miguel de Icaza <miguel@ximian.com>
15986 * anonymous.cs: Ensure that we init the scope of our parent if it
15987 has not been initialized yet.
15989 2004-12-30 Duncan Mak <duncan@ximian.com>
15991 * typemanager.cs (TypeManager.CheckStructCycles): Don't crash here
15992 if field.FieldBuilder is null. Fixes #70758.
15994 * convert.cs: Fixed some typos and updated some of the comments.
15995 (ImplicitStandardConversionExists):
15996 (TryImplicitIntConversion): If `target_type' is an interface and
15997 the type of `ic' implements this interface, return true or a new
15998 BoxedCast instead of null. This fixes #70468.
16000 2004-12-29 Duncan Mak <duncan@ximian.com>
16002 * expression.cs (Argument.Emit): Check that Expr is
16003 IMemoryLocation before casting to it, and report CS1510 otherwise.
16007 2004-12-21 Ben Maurer <bmaurer@ximian.com>
16009 * statement.cs (Block.ThisVariable): remove the recursion here, to
16010 make the --profile more sane.
16012 2004-12-17 Carlos Cortez <calberto.cortez@gmail.com>
16014 * driver.cs: Patch to handle a xsp bug that prevents to reference an .exe
16015 assembly, by JB Evain.
16017 2004-12-17 Raja R Harinath <rharinath@novell.com>
16019 * class.cs, decl.cs, ecore.cs, iterators.cs, pending.cs,
16020 rootcontext.cs, typemanager.cs: Make nomenclature consistent.
16021 "parent" refers to enclosing type/class. "base" refers to superclass.
16023 2004-12-17 Raja R Harinath <rharinath@novell.com>
16025 * codegen.cs (CommonAssemblyModulClass.GetClsCompliantAttribute):
16026 Ensure that we only have GlobalAttributes.
16027 * attribute.cs (Attribute.Emit): Make non-virtual.
16028 (GlobalAttribute.Emit): Remove.
16029 (Attribute.Resolve): Make virtual.
16030 (GlobalAttribute.Resolve): New. Set Rootcontext.Tree.Types.NamespaceEntry.
16031 (Attribute.GetConditionalAttributeValue): Take an EmitContext as
16032 the argument. Don't create one.
16033 (Attribute.GetObsoleteAttribute): Likewise.
16034 (Attribute.GetClsCompliantAttributeValue): Likewise.
16035 * class.cs, decl.cs: Update to changes.
16037 2004-12-17 Marek Safar <marek.safar@seznam.cz>
16039 * delegate.cs (NewDelegate.DoResolve): Add error 149 report.
16041 * ecore.cs (Expression.MemberLookupFailed): Fixed error 143.
16043 * statement.cs (Foreach.Resolve): Add error 186 report.
16045 2004-12-16 Marek Safar <marek.safar@seznam.cz>
16047 * expression.cs (Conditional.DoResolve): Add warning 429.
16049 * statement.cs (If.Resolve): Add warning 665.
16051 2004-12-16 Raja R Harinath <rharinath@novell.com>
16053 New invariant: RootContext.Tree.Types.NamespaceEntry == null
16054 except when in the parser, and in GlobalAttribute.
16055 * driver.cs (MainDriver): Reset RootContext.Tree.Types.NamespaceEntry.
16056 * attribute.cs (GlobalAttribute.CheckAttributeType): Reset
16057 RootContext.Tree.Types.NamespaceEntry once work is done.
16058 (GlobalAttribute.Emit): New. Wrapper for Attribute.Emit, but sets
16059 and resets RootContext.Tree.Types.NamespaceEntry.
16061 2004-12-15 Marek Safar <marek.safar@seznam.cz>
16063 * cs-parser.jay: Don't create a block for every variable.
16065 2004-12-14 Miguel de Icaza <miguel@ximian.com>
16067 * location.cs: Provide extra information.
16069 * statement.cs: The instance is not `ldarg_0.THIS' when accessing
16070 variables from the captured environment, it is the ldarg_0.
16072 2004-12-14 Marek Safar <marek.safar@seznam.cz>
16074 * cs-parser.jay: Changed warning level for 642 to 4 until Miguel
16077 * class.cs: Changed warning level for 169 to avoid developer
16078 displeasure from warning flooding. It will be changed back when they
16079 fix most of current BCL warnings.
16081 * RootContext.cs: Pushed default WarningLevel to 3.
16083 * statement.cs: Removed unused variable.
16085 2004-12-14 Marek Safar <marek.safar@seznam.cz>
16087 * class.cs (TypeContainer.GetClassBases): Add error 1521 report.
16088 (TypeContainer.MethodModifiersValid): Refactored to use MemberCore.
16089 Add error 502 report.
16090 (StaticClass.DefineType): Add error 441 report.
16091 (Class.AllowedModifiersProp): New virtual property as temporary
16092 extension to AllowedModifiers.
16093 (Class.DefineType): Add error 418 report. Moved ModFlags check here
16094 to share implementation with StaticClass and don't call virtual
16097 * driver.cs (MainDriver): Add error 1558 test.
16099 * parameter.cs (Parameter.ApplyAttributeBuilder): Add error 662
16100 report. Moved error 36 test here.
16102 * statement.cs (Throw.Resolve): Add error 724 report.
16104 * typemanager.cs: Add out_attribute_type core type.
16106 2004-12-13 Marek Safar <marek.safar@seznam.cz>
16108 * class.cs (TypeContainer.VerifyClsCompliance): Add error
16110 (PropertyBase.VerifyClsCompliance): Add errror 3025 report.
16112 * codegen.cs (ModuleClass.ApplyAttributeBuilder): Add error
16115 * decl.cs (MemberCore.VerifyClsCompliance): Add warning 3021.
16117 * parameter.cs (ReturnParameter.ApplyAttributeBuilder):
16118 Add error 3023 report.
16119 (Parameter.ApplyAttributeBuilder): Add error 3022 report.
16121 * tree.cs (RootTypes.IsClsCompliaceRequired): Add fake
16124 2004-12-12 John Luke <john.luke@gmail.com>
16126 * driver.cs (AddArgs): take -- into account when
16127 adding arguments, fixes bug 65710
16129 2004-12-12 Martin Baulig <martin@ximian.com>
16131 * expression.cs (Unary.TryReduceNegative): Added support for
16132 SByteConstant and ByteConstant.
16133 (Unary.Reduce): Check error values from TryReduceNegative().
16135 2004-12-10 Marek Safar <marek.safar@seznam.cz>
16137 * attributes.cs (Attribute.Resolve): Avoid multiple error report
16138 and report exception as error 182.
16140 2004-12-10 Raja R Harinath <rharinath@novell.com>
16142 * driver.cs (Main): Fix message when there are warnings.
16144 2004-12-09 Miguel de Icaza <miguel@ximian.com>
16146 * delegate.cs: Fixed my fix from yesterday, sorry about that.
16148 2004-12-09 Marek Safar <marek.safar@seznam.cz>
16150 * anonymous.cs, class.cs, convert.cs, doc.cs, support.cs:
16151 Reduced number of warnings.
16153 * class.cs (TypeContainer.VerifyClsCompliance): One if is enough.
16155 2004-12-08 Miguel de Icaza <miguel@ximian.com>
16157 * driver.cs: Removed message.
16159 * delegate.cs: Fix bug introduced in 1.1.x: 70219.
16161 2004-12-08 <vargaz@freemail.hu>
16163 * cs-tokenizer.cs: Add workaround for NET 2.0 beta 1 csc bug.
16165 2004-12-08 Martin Baulig <martin@ximian.com>
16167 * class.cs (TypeContainer.VerifyClsCompliance): Report a CS3003
16168 instead of a CS3002 for properties and indexer.
16170 2004-12-08 Martin Baulig <martin@ximian.com>
16172 * decl.cs (MemberName.ToString): Make this work again.
16174 2004-12-08 Marek Safar <marek.safar@seznam.cz>
16176 * attribute.cs (Resolve): Add error 591 detection.
16178 * class.cs (FieldMember.Define): Add error 1547 detection.
16179 (Indexer.Define): Add error 620 detection.
16180 (Operator.Define): Add error 590 detection.
16182 * ecore.cs: Missing argument for error 79.
16184 * expression.cs (ComposedCast.DoResolveAsTypeStep): Add error 611
16187 2004-12-07 Marek Safar <marek.safar@seznam.cz>
16190 * assign.cs.cs (Assign.DoResolve): Reports error 1648 for value types
16193 2004-12-07 Atsushi Enomoto <atsushi@ximian.com>
16195 * cs-parser.jay : handle doc comments on implicit/explicit operators.
16196 Some operator comments were suppressed.
16197 * doc.cs : Implicit/explicit operator name in doc comments are like
16198 "op_Explicit(type)~returnType", so added suffix handling.
16200 2004-12-07 Martin Baulig <martin@ximian.com>
16203 (MemberCore.GetObsoleteAttribute): Don't create a new EmitContext.
16204 (MemberCore.GetClsCompliantAttributeValue): Likewise.
16205 (DeclSpace.ec): New protected field; store the EmitContext here.
16206 (DeclSpace.EmitContext): New public property; moved here from
16208 (DeclSpace.GetClsCompliantAttributeValue): Don't create a new
16211 * enum.cs (Enum.Define): Store the EmitContext in the `ec' field.
16212 (Enum.Emit): Don't create a new EmitContext.
16214 * delegate.cs (Delegate.DefineType): Always create the
16217 * iterators.cs (Iterators.DefineIterator): Create a new
16218 EmitContext and store it in `ec'.
16220 2004-08-24 Martin Baulig <martin@ximian.com>
16223 (TypeManager.IsSubclassOf): Renamed to IsFamilyAccessible; use
16224 this for accessibility checks.
16225 (TypeManager.IsSubclassOrNestedChildOf): Renamed to
16226 IsNestedFamilyAccessible.
16227 (TypeManager.IsSubclassOf): New method, do what the name actually
16230 2004-12-06 Raja R Harinath <rharinath@novell.com>
16232 Fix crash on cs0657-17.cs.
16233 * codegen.cs (CommonAssemblyModulClass.GetClsCompliantAttribute):
16234 Use RootContext.Tree.Types, not 'new RootTypes ()'.
16235 * attribute.cs (GlobalAttribute.CheckAttributeType): Narrow down
16236 the case where the NamespaceEntry gets overwritten.
16238 2004-12-06 Marek Safar <marek.safar@seznam.cz>
16240 Fixed #69195, #56821
16241 * ecore.cs (ResolveBoolean): Tiny refactoring.
16243 * expression.cs (Binary.DoResolve): Add warning 429 and skipping
16244 of right expression resolving when left is false constant and
16245 operator is LogicalAnd OR true constant and operator is LogicalOr.
16247 * statement.cs (ResolveUnreachable): Always reports warning.
16249 2004-12-05 Miguel de Icaza <miguel@ximian.com>
16251 * class.cs: Distinguish between 1721 and 1722 (just a little help
16252 for the programmer).
16254 2004-12-03 Miguel de Icaza <miguel@ximian.com>
16256 * delegate.cs: Only allow this on new versions of the language.
16258 2004-12-02 Duncan Mak <duncan@ximian.com>
16260 * ecore.cs (PropertyExpr.IsAccessorAccessible): Moved to
16262 (Expression.IsAccessorAccessible): Moved from the PropertyExpr to
16263 here as a static method. Take an additional bool out parameter
16264 `must_do_cs1540_check' for signaling to InstanceResolve.
16265 (PropertyExpr.InstanceResolve): Removed the `must_do_cs1540_check'
16266 member field from PropertyExpr class and made it an argument of
16267 the method instead.
16268 (EventExpr.InstanceResolve): Copied from PropertyExpr, removed the
16269 check for MarshalByRefObject, and report CS0122 instead of CS1540.
16270 (EventExpr.DoResolve): Call IsAccessorAccessible on `add_accessor'
16271 and `remove_accessor' as well as InstanceResolve: report CS0122
16276 2004-12-03 Raja R Harinath <rharinath@novell.com>
16278 Fix test-327.cs, test-328.cs, and put in early infrastructure
16279 for eventually fixing #52697.
16280 * namespace.cs (NamespaceEntry.LookupForUsing): New method.
16281 (NamespaceEntry.LookupNamespaceOrType): New method, refactored
16282 from other methods.
16283 (NamespaceEntry.Lookup): Remove 'ignore_using' flag.
16284 (AliasEntry.Resolve, UsingEntry.Resolve): Use 'LookupForUsing'.
16285 (VerifyUsing, error246): Update.
16286 * rootcontext.cs (RootContext.NamespaceLookup): Just use
16287 'NamespaceEntry.LookupNamespaceOrType'.
16289 2004-12-03 Martin Baulig <martin@ximian.com>
16291 * delegate.cs (NewDelegate.DoResolve): If we have an anonymous
16292 method as our child, call AnonymousMethod.Compatible() on it.
16294 2004-12-03 Raja R Harinath <rharinath@novell.com>
16296 Disable XML documentation support in 'basic' profile.
16297 * decl.cs, class.cs [BOOTSTRAP_WITH_OLDLIB]: Don't import System.Xml.
16298 Redirect XmlElement to System.Object.
16299 * driver.cs, enum.cs, rootcontext.cs: Don't reference System.Xml.
16300 * doc.cs [BOOTSTRAP_WITH_OLDLIB]: Disable compile.
16301 * mcs.exe.sources: Add doc-bootstrap.cs.
16302 * doc-bootstrap.cs: New file. Contains empty stub implementation
16305 2004-12-03 Atsushi Enomoto <atsushi@ximian.com>
16307 * cs-tokenizer.cs : Only '////' is rejected. Other non-whitespace
16308 comments are allowed.
16310 2004-12-03 Carlos Alberto Cortez <calberto.cortez@gmail.com>
16312 * delegate.cs: Add checks for subtypes in paramaters and return values
16313 in VerifyMethod () to add support for Covariance/Contravariance
16316 2004-12-02 Miguel de Icaza <miguel@ximian.com>
16318 * report.cs: Remove extra closing parenthesis.
16320 * convert.cs (Error_CannotImplicitConversion): If the name of the
16321 types are the same, provide some extra information.
16323 * class.cs (FieldBase): Use an unused bit field from the field to
16324 encode the `has_offset' property from the FieldMember. This saves
16325 a couple of Ks on bootstrap compilation.
16327 * delegate.cs (NewDelegate.DoResolve): If we have an anonymous
16328 method as our child, return the AnonymousMethod resolved
16331 * expression.cs (New.DoResolve): Allow return values from
16332 NewDelegate to also include AnonymousMethods.
16336 2004-12-02 Marek Safar <marek.safar@seznam.cz>
16339 * attribute.cs (Resolve): Improved implementation of params
16340 attribute arguments.
16342 * support.cs (ParameterData): Add HasParams to be faster.
16344 2004-12-02 Atsushi Enomoto <atsushi@ximian.com>
16346 all things are for /doc support:
16348 * doc.cs: new file that supports XML documentation generation.
16349 * mcs.exe.sources: added doc.cs.
16351 Handle /doc command line option.
16352 Report error 2006 instead of 5 for missing file name for /doc.
16353 Generate XML documentation when required, after type resolution.
16355 Added support for picking up documentation (/// and /** ... */),
16356 including a new XmlCommentState enumeration.
16358 Added lines to fill Documentation element for field, constant,
16359 property, indexer, method, constructor, destructor, operator, event
16360 and class, struct, interface, delegate, enum.
16361 Added lines to warn incorrect comment.
16363 Added Documentation field (passed only when /doc was specified).
16365 Added DocComment, DocCommentHeader, GenerateDocComment() and
16366 OnGenerateDocComment() and some supporting private members for
16367 /doc feature to MemberCore.
16369 Added GenerateDocComment() on TypeContainer, MethodCore and Operator.
16371 Added overriden DocCommentHeader.
16373 Added overriden DocCommentHeader and GenerateDocComment().
16375 2004-12-01 Miguel de Icaza <miguel@ximian.com>
16377 * cfold.cs (ConstantFold.DoConstantNumericPromotions): After
16378 unwrapping the enumeration values, chain to
16379 DoConstantNumericPromotions again, so we can promote things to the
16380 fundamental types (takes care of enums that are bytes, sbytes).
16384 2004-12-01 Raja R Harinath <rharinath@novell.com>
16386 * attribute.cs (Attribute.CheckAttributeType): Remove complain flag.
16387 Fix long-standing bug in type-lookup. Use FindType instead of
16388 LookupType when ec.ResolvingTypeTree.
16389 (Attribute.ResolveType, Attribute.Resolve)
16390 (Attribute.DefinePInvokeMethod,GlobalAttribute.CheckAttributeType):
16392 (Attributes.Search): Remove internal version. Update.
16393 (Attributes.SearchMulti): Update.
16394 (Attributes.GetClsCompliantAttribute): Remove.
16395 (Attributes.GetIndexerNameAttribute): Remove.
16396 * decl.cs (MemberCore.GetClsCompliantAttributeValue): Update to changes.
16397 (DeclSpace.GetClsCompliantAttributeValue): Likewise.
16398 * class.cs (Indexer.Define): Likewise.
16400 2004-12-01 Marek Safar <marek.safar@seznam.cz>
16403 * ecore.cs: CheckMarshallByRefAccess new virtual method for testing
16404 MarshallByReference members access.
16406 * expression.cs: Use CheckMarshallByRefAccess;
16407 Better error CS0197 message.
16409 * report.cs: Print whole related error message.
16411 2004-11-30 Raja R Harinath <rharinath@novell.com>
16413 * Makefile (mcs.exe) [PROFILE=default]: Keep a copy of mcs.exe in
16414 the current directory to help debugging.
16416 2004-11-29 Marek Safar <marek.safar@seznam.cz>
16418 * class (GetClassBases): Better error 60 report.
16419 (EventProperty): Disabled warning 67 detection.
16421 2004-11-29 Marek Safar <marek.safar@seznam.cz>
16424 * cfold.cs (Assign.DoResolve): Add subtraction for DecimalConstant.
16426 * constant.cs (DecimalConstant.Emit): Don't use int ctor for
16429 2004-11-29 Marek Safar <marek.safar@seznam.cz>
16432 * assign.cs (Assign.DoResolve): Add error 1648, 1650 report.
16434 * decl.cs (MemberCore.MemberName): Error 1648 in compiler.
16436 2004-11-26 Miguel de Icaza <miguel@ximian.com>
16438 * attribute.cs (Attribute.Resolve): Refine error reporting and
16439 report a cs0117 if the identifier does not exist, to distinguish
16440 from 0617 which is a miss-use of the actual identifier.
16442 * ecore.cs (EventExpr.Emit): Refine error report and distinguish
16443 between cs0070 and cs0079.
16445 * class.cs (MemberBase.DoDefine): When reporting a wrong
16446 accessibility level, we use MethodCore to compare instead of
16447 Method (this was a regression in some refactoring effort).
16449 So now we correctly report cs0056 again.
16451 * convert.cs (ImplicitReferenceConversion): Corrected typo, I was
16452 testing the target_type (which was known to be object_type) and
16453 not the source type (which is anonymous_method).
16455 Fixed reporting of error cs1660.
16457 * expression.cs (UserCast.Source): Expose the underlying cast.
16459 * statement.cs (Switch.SwitchGoverningType): Sort the list of
16460 allowed types to find a match to int32 first (most common).
16462 In addition, it ignores any ImplicitUserConversions that did an
16463 internal implicit conversion (as the switch statement allows only
16464 one integral conversion to exist).
16466 * class.cs (PartialContainer.Create): rename `name' to
16467 `member_name' for clarity. Then replace the string calls with a
16468 call to MemberName.GetPartialName, as now using
16469 MemberName.ToString is an error (this is due to the side effects
16470 it had, that were fixed in the past).
16472 This will restore the error reporting on a number of partial class
16473 errors that were missusing this (and getting an exception as a
16474 results, which is now just a plain textual warning, because
16475 yyparse debug output would crash otherwise).
16477 2004-11-26 Raja R Harinath <rharinath@novell.com>
16479 * Makefile (PROGRAM_INSTALL_DIR): Remove.
16481 2004-11-25 Ben Maurer <bmaurer@ximian.com>
16483 * rootcontext.cs (LookupType): Make sure to cache lookups that
16484 don't give us a negative result. This saves about 5% of corlib
16487 2004-11-25 Miguel de Icaza <miguel@ximian.com>
16489 * report.cs (AbstractMessage.Print): messages are sent to stderr
16491 * class.cs (TypeContainer.GetClassBases): It is an error to have a
16492 non-interface in the list of interfaces (at this point, either
16493 parent was properly set, or a base class is being listed in the
16494 interfaces section).
16496 This flags error 1722, and resolves the crash from bug 69259.
16498 2004-11-25 Ben Maurer <bmaurer@ximian.com>
16500 * statement.cs (Using.EmitExpressionFinally): make this work right
16501 for valuetypes. Fixes 69926.
16503 2004-11-25 Miguel de Icaza <miguel@ximian.com>
16505 * const.cs (Const.ChangeType): Cope with the "0 literal can be
16506 converted to an enum" here, before we try to change the underlying
16507 type. This code exists, but it is a different code path than the
16508 one used while encoding constants.
16510 * convert.cs (ImplicitReferenceConversionExists): A surprisingly
16511 old bug: when converting from the null literal to a pointer,
16512 return an EmptyCast, not the NullLiteral.
16514 This fixes #69921, the recent null_type changes probably made this
16515 bug more prominent.
16517 (ImplicitReferenceConversionExists): In addition, resynchronized
16518 the code here, so it matches the same code in
16519 ImplicitReferenceConversionExists for the `from any class-type S
16520 to any interface-type T'.
16523 2004-11-25 Marek Safar <marek.safar@seznam.cz>
16525 * cfold.cs (BinaryFold): Add addition for DecimalConstant.
16527 2004-11-24 Miguel de Icaza <miguel@ximian.com>
16529 * cs-parser.jay: Use verbosity accordingly.
16531 2004-11-24 Marek Safar <marek.safar@seznam.cz>
16533 * expression.cs (Unary.ResolveOperator): Do not report warning;
16534 AddressOf reads from variable.
16536 (LocalVariableReferences.DoResolveBase): Improved my previous fix.
16538 2004-11-24 Marek Safar <marek.safar@seznam.cz>
16542 * attribute.cs (Attributable): Removed CheckTargets.
16543 (Attributes.Emit): Explicit attribute targets are tested here.
16545 * class.cs (EventField.ValidAttributeTargets): Explicit target "field" is
16546 not enabled for interfaces.
16548 * codegen.cs (CommonAssemblyModulClass.AddAttributes): Removed CheckTargets.
16549 (GetAssemblyName): Ouch next bug there.
16551 2004-11-23 Carlos Alberto Cortez <calberto.cortez@gmail.com>
16553 * expression.cs: Error 275 added.
16555 2004-11-23 Marek Safar <marek.safar@seznam.cz>
16557 Fix bug #69177 (Implemented decimal constant support)
16559 * cfold.cs (DoConstantNumericPromotions: Add DecimalConstant.
16560 (BinaryFold): Add DecimalConstant.
16562 * const.cs (Define): Decimal constant
16564 (ChangeType): Add decimal type handling.
16565 (LookupConstantValue): Don't set value for decimal type but
16566 emit DecimalConstantAttribute. Needed for constant optimization.
16568 * constant.cs (ToDecimal): New method.
16569 (ConvertToDecimal): New method.
16570 (IntConstant): Implemented ConvertToDecimal.
16571 (DecimalConstant.Emit): Emit optimized version for decimals in
16574 * expression.cs (ResolveOperator): Changed order of constant
16575 reduction to work correctly with native types which have
16576 overloaded operators.
16577 (ResolveMemberAccess): Extract constant value from attribute
16580 * rootcontext.cs (ResolveCore): Add DecimalConstantAttribute.
16582 * typemanager.cs (TypeManager): Add decimal_constant_attribute_type,
16583 void_decimal_ctor_int_arg, decimal_constant_attribute_ctor.
16584 (ChangeType): Decimal is special.
16585 (TypeToCoreType): Add decimal type.
16587 2004-11-22 Marek Safar <marek.safar@seznam.cz>
16589 * convert.cs (ImplicitConversionRequired): Add error cs0642 for
16592 2004-11-22 Marek Safar <marek.safar@seznam.cz>
16594 * class.cs (EventField.ApplyAttributeBuilder): Fix error
16597 2004-11-19 Marek Safar <marek.safar@seznam.cz>
16599 * class.cs (MemberBase.DoDefine): Fix error cs0508 report.
16601 * pending.cs (PendingImplementation): Grab only interfaces.
16603 2004-11-19 Marek Safar <marek.safar@seznam.cz>
16605 * statement.cs (ForeachHelperMethods): Add location member and
16606 error 202 detection.
16608 2004-11-19 Raja R Harinath <rharinath@novell.com>
16610 * Makefile (EXTRA_DISTFILES): Remove mcs.exe.config. It's
16611 automatically handled by executable.make.
16612 (PROGRAM): Make profile-specific.
16614 2004-11-18 Marek Safar <marek.safar@seznam.cz>
16616 * expression.cs (DoResolveBase): Fixed wrong warning for out
16619 2004-11-18 Martin Baulig <martin@ximian.com>
16621 Merged latest changes into gmcs. Please keep this comment in
16622 here, it makes it easier for me to see what changed in MCS since
16623 the last time I merged.
16625 2004-11-17 Raja R Harinath <rharinath@novell.com>
16627 * typemanager.cs (TypeHandle.GetTypeHandle): Make private.
16628 (TypeHandle.GetMemberCache): New.
16629 (TypeHandle.TypeHandle): Update.
16630 (TypeManager.LookupMemberCache): Rewritten from LookupMemberContainer.
16631 (TypeManager.LookupParentInterfacesCache):
16632 Rename from LookupInterfaceCache. Optimize slightly.
16633 (TypeManager.MemberLookup_FindMembers): Update.
16634 * decl.cs (MemberCache.MemberCache): Set Container to null in the
16635 multi-type variant.
16636 (AddCacheContents): Rename from AddHashtable.
16637 * class.cs (TypeContainer.parent_container): Remove.
16638 (TypeContainer.VerifyClsCompliance): Don't use parent_container.
16639 (TypeContainer.DoDefineMembers): Don't initialize it.
16640 Update to name changes.
16642 2004-11-17 Miguel de Icaza <miguel@ximian.com>
16644 * class.cs (MethodCore.CheckAccessModifiers): New helper routine
16645 that factors the code to check access modifiers on override.
16647 (PropertyBase): Use the code here.
16649 Patch from Lluis S'anchez, fixes bug #69361.
16651 2004-11-15 Miguel de Icaza <miguel@ximian.com>
16653 * anonymous.cs (AnonymousMethod.Error_AddressOfCapturedVar): New
16654 routine that is used to report the use of a captured variable
16655 whose address has been taken.
16657 There are two checks: one when variables are being captured and
16658 the other check is when the address of a variable is taken.
16660 (because an anonymous methods might be resolved before *or* after
16661 the address has been taken) and
16663 * expression.cs (Conditional.DoResolve): Remove the special
16664 casing that Martin added to trueExpr and falseExpr being both
16665 NullLiteral. We get the right behavior now just by introducing
16666 the null_type into the compiler.
16668 * convert.cs (ExplicitConversion): Change the code to use
16669 null_type instead of testing `expr is NullLiteral'.
16670 (ImplicitConversionStandard): use null_type too.
16671 (ImplicitReferenceConversionExists): use null_type too.
16672 (ImplicitReferenceConversion): use null_type too.
16674 * literal.cs: The type of `NullLiteral' is now null_type instead
16676 (Resolve): Set the type here.
16678 * typemanager.cs: Introduce null_type.
16680 2004-11-17 Martin Baulig <martin@ximian.com>
16682 * decl.cs (MemberCache.AddHashtable): Add entries in the opposite
16683 direction, like FindMembers() does. Fixes #69546, testcase is in
16686 2004-11-16 Martin Baulig <martin@ximian.com>
16688 This is based on a patch from Marek Safar, see bug #69082.
16689 Fixes bugs #63705 and #67130.
16691 * typemanager.cs (TypeManager.LookupInterfaceCache): New public
16692 method; create a MemberCache for an interface type and cache the
16695 * decl.cs (IMemberContainer.ParentContainer): Removed.
16696 (IMemberContainer.ParentCache): New property.
16697 (MemberCache.SetupCacheForInterface): Removed.
16698 (MemberCache..ctor): Added .ctor which takes a `Type[]'; use this
16699 to create a cache for an interface's "parent".
16701 * class.cs (TypeContainer.DoDefineMembers): Setup cache for
16704 2004-11-16 Martin Baulig <martin@ximian.com>
16706 Merged back from gmcs; these changes already went into gmcs a
16707 couple of weeks ago.
16710 (TypeManager.AddUserType): Removed the `ifaces' argument.
16711 (TypeManager.RegisterBuilder): Take a `Type []' instead of a
16713 (TypeManager.AddUserInterface): Removed.
16714 (TypeManager.ExpandInterfaces): Return a `Type []' instead of a
16716 (TypeManager.GetInterfaces): Likewise.
16717 (TypeManager.GetExplicitInterfaces): Likewise.
16719 * ecore.cs (TypeExpr.GetInterfaces): Removed.
16721 * class.cs (TypeContainer.base_class_type): Replaced with `ptype'.
16722 (TypeContainer.base_inteface_types): Replaced with `ifaces'.
16724 2004-11-14 Ben Maurer <bmaurer@ximian.com>
16726 * statement.cs: Avoid adding bools to a hashtable.
16728 2004-11-07 Miguel de Icaza <miguel@ximian.com>
16730 * expression.cs (Invocation.OverloadResolve): Flag error if we are
16731 calling an unsafe method from a safe location.
16733 2004-11-06 Marek Safar <marek.safar@seznam.cz>
16736 * codegen.cs (ApplyAttributeBuilder): Do not return; it is only warning.
16738 2004-11-06 Miguel de Icaza <miguel@ximian.com>
16740 * namespace.cs (VerifyUsing): use GetPartialName instead of
16743 2004-11-05 Miguel de Icaza <miguel@ximian.com>
16745 * statement.cs (Return.Resolve): Fix regression in typo: if
16746 `in_exc', we have to request a NeedReturnLabel, this was a typo
16747 introduced in the anonymous method check-in. Fixes #69131.
16749 * Indexers were using the ShortName when defining themselves,
16750 causing a regression in the compiler bootstrap when applying the
16751 patch from 2004-11-02 (first part), now they use their full name
16752 and the bug is gone.
16754 2004-11-04 Zoltan Varga <vargaz@freemail.hu>
16756 * driver.cs: Strip the path from the names of embedded resources. Fixes
16759 2004-11-04 Raja R Harinath <rharinath@novell.com>
16761 Fix error message regression: cs0104-2.cs.
16762 * namespace.cs (NamespaceEntry.Lookup): Remove 'silent' flag.
16763 (AliasEntry.Resolve): Update.
16764 * rootcontext.cs (RootContext.NamespaceLookup): Update. Remove
16766 (RootContext.LookupType): Update.
16768 2004-11-03 Carlos Alberto Cortez <carlos@unixmexico.org>
16770 * cs-parser.jay: Add support for handling accessor modifiers
16771 * class: Add support port accessor modifiers and error checking,
16772 define PropertyMethod.Define as virtual (not abstract anymore)
16773 * ecore.cs: Add checking for proeprties access with access modifiers
16774 * iterators.cs: Modify Accessor constructor call based in the modified
16776 2004-11-02 Ben Maurer <bmaurer@ximian.com>
16778 * expression.cs (StringConcat): Handle being called twice,
16779 as when we have a concat in a field init with more than two
16782 2004-11-02 Miguel de Icaza <miguel@ximian.com>
16784 * class.cs (Event.Define, Indexer.Define, Property.Define): Do not
16785 special case explicit implementations, we should always produce
16786 the .property or .event declaration.
16788 * decl.cs (MemberName): Renamed GetFullName to GetPartialName
16789 since it will not return correct data if people use this
16790 unresolved in the presence of using statements (see test-313).
16792 * class.cs (MethodData.Define): If we are an explicit interface
16793 implementation, set the method name to the full name of the
16794 interface plus the name of the method.
16796 Notice that using the method.MethodName.GetFullName() does not
16797 work, as it will only contain the name as declared on the source
16798 file (it can be a shorthand in the presence of using statements)
16799 and not the fully qualifed type name, for example:
16803 class D : ICloneable {
16804 object ICloneable.Clone () {
16808 Would produce a method called `ICloneable.Clone' instead of
16809 `System.ICloneable.Clone'.
16811 * namespace.cs (Alias.Resolve): Use GetPartialName.
16813 2004-11-01 Marek Safar <marek.safar@seznam.cz>
16815 * cs-parser.jay: Add error 1055 report.
16817 2004-11-01 Miguel de Icaza <miguel@ximian.com>
16819 * assign.cs (Assign.DoResolve): Only do the transform of
16820 assignment into a New if the types are compatible, if not, fall
16821 through and let the implicit code deal with the errors and with
16822 the necessary conversions.
16824 2004-11-01 Marek Safar <marek.safar@seznam.cz>
16826 * cs-parser.jay: Add error 1031 report.
16828 * cs-tokenizer.cs: Add location for error 1038.
16830 2004-10-31 Marek Safar <marek.safar@seznam.cz>
16832 * cs-parser.jay: Add error 1016 report.
16834 2004-10-31 Marek Safar <marek.safar@seznam.cz>
16836 * cs-parser.jay: Add errors 1575,1611 report.
16838 2004-10-31 Marek Safar <marek.safar@seznam.cz>
16840 * cs-parser.jay: Add error 1001 report.
16842 2004-10-31 Marek Safar <marek.safar@seznam.cz>
16845 * attribute.cs (GetMarshal): Add method argument for
16846 caller identification.
16848 * class.cs, codegen.cs, enum.cs, parameter.cs: Added
16849 agument for GetMarshal and RuntimeMissingSupport.
16851 2004-10-31 Marek Safar <marek.safar@seznam.cz>
16853 * attribute.cs (ExtractSecurityPermissionSet): Removed
16854 TypeManager.code_access_permission_type.
16856 * typemanager.cs: Removed TypeManager.code_access_permission_type.
16858 2004-10-27 Miguel de Icaza <miguel@ximian.com>
16860 * expression.cs (LocalVariableReference.DoResolveLValue): Check
16861 for obsolete use of a variable here. Fixes regression on errors
16862 cs0619-25 and cs0619-26.
16864 2004-10-27 Marek Safar <marek.safar@seznam.cz>
16866 Fix #62358, implemented security attribute encoding.
16868 * attribute.cs (Attribute.CheckSecurityActionValididy): New method.
16869 Tests permitted SecurityAction for assembly or other types.
16870 (Assembly.ExtractSecurityPermissionSet): New method. Transforms
16871 data from SecurityPermissionAttribute to PermisionSet class.
16873 * class.cs (ApplyAttributeBuilder): Added special handling
16874 for System.Security.Permissions.SecurityAttribute based types.
16876 * codegen.cs (AssemblyClass.ApplyAttributeBuilder): Added
16877 special handling for System.Security.Permissions.SecurityAttribute
16880 * enum.cs (ApplyAttributeBuilder): Added special handling
16881 for System.Security.Permissions.SecurityAttribute based types.
16883 * parameter.cs (ApplyAttributeBuilder): Added special handling
16884 for System.Security.Permissions.SecurityAttribute based types.
16886 * rootcontext.cs: Next 2 core types.
16888 * typemanager.cs (TypeManager.security_permission_attr_type):
16889 Built in type for the SecurityPermission Attribute.
16890 (code_access_permission_type): Build in type.
16892 2004-10-17 Miguel de Icaza <miguel@ximian.com>
16894 * expression.cs (LocalVariableReference.DoResolveBase, Emit):
16895 Remove the tests for `ec.RemapToProxy' from here, and encapsulate
16896 all of this information into
16897 EmitContext.EmitCapturedVariableInstance.
16899 * codegen.cs (EmitCapturedVariableInstance): move here the
16900 funcionality of emitting an ldarg.0 in the presence of a
16901 remapping. This centralizes the instance emit code.
16903 (EmitContext.EmitThis): If the ScopeInfo contains a THIS field,
16904 then emit a load of this: it means that we have reached the
16905 topmost ScopeInfo: the one that contains the pointer to the
16906 instance of the class hosting the anonymous method.
16908 * anonymous.cs (AddField, HaveCapturedFields): Propagate field
16909 captures to the topmost CaptureContext.
16911 2004-10-12 Miguel de Icaza <miguel@ximian.com>
16913 * expression.cs (LocalVariableReference): Move the knowledge about
16914 the iterators into codegen's EmitCapturedVariableInstance.
16916 2004-10-11 Miguel de Icaza <miguel@ximian.com>
16918 * codegen.cs (EmitContext.ResolveTopBlock): Emit a 1643 when not
16919 all code paths return a value from an anonymous method (it is the
16920 same as the 161 error, but for anonymous methods).
16922 2004-10-08 Miguel de Icaza <miguel@ximian.com>
16924 The introduction of anonymous methods in the compiler changed
16925 various ways of doing things in the compiler. The most
16926 significant one is the hard split between the resolution phase
16927 and the emission phases of the compiler.
16929 For instance, routines that referenced local variables no
16930 longer can safely create temporary variables during the
16931 resolution phase: they must do so from the emission phase,
16932 since the variable might have been "captured", hence access to
16933 it can not be done with the local-variable operations from the runtime.
16937 (Block.Flags): New flag `IsTopLevel' to indicate that this block
16938 is a toplevel block.
16940 (ToplevelBlock): A new kind of Block, these are the blocks that
16941 are created by the parser for all toplevel method bodies. These
16942 include methods, accessors and anonymous methods.
16944 These contain some extra information not found in regular blocks:
16945 A pointer to an optional CaptureContext (for tracking captured
16946 local variables and parameters). A pointer to the parent
16949 (Return.Resolve): Catch missmatches when returning a value from an
16950 anonymous method (error 1662).
16951 Invoke NeedReturnLabel from the Resolve phase instead of the emit
16954 (Break.Resolve): ditto.
16956 (SwitchLabel): instead of defining the labels during the
16957 resolution phase, we now turned the public ILLabel and ILLabelCode
16958 labels into methods called GetILLabelCode() and GetILLabel() that
16959 only define the label during the Emit phase.
16961 (GotoCase): Track the SwitchLabel instead of the computed label
16962 (its contained therein). Emit the code by using
16963 SwitchLabel.GetILLabelCode ().
16965 (LocalInfo.Flags.Captured): A new flag has been introduce to track
16966 whether the Local has been captured or not.
16968 (LocalInfo.IsCaptured): New property, used to tell whether the
16969 local has been captured.
16971 * anonymous.cs: Vastly updated to contain the anonymous method
16974 The main classes here are: CaptureContext which tracks any
16975 captured information for a toplevel block and ScopeInfo used to
16976 track the activation frames for various local variables.
16978 Each toplevel block has an optional capture context associated
16979 with it. When a method contains an anonymous method both the
16980 toplevel method and the anonymous method will create a capture
16981 context. When variables or parameters are captured, they are
16982 recorded on the CaptureContext that owns them, for example:
16986 MyDelegate d = delegate {
16991 Here `a' will be recorded as captured on the toplevel
16992 CapturedContext, the inner captured context will not have anything
16993 (it will only have data if local variables or parameters from it
16994 are captured in a nested anonymous method.
16996 The ScopeInfo is used to track the activation frames for local
16997 variables, for example:
16999 for (int i = 0; i < 10; i++)
17000 for (int j = 0; j < 10; j++){
17001 MyDelegate d = delegate {
17006 At runtime this captures a single captured variable `i', but it
17007 captures 10 different versions of the variable `j'. The variable
17008 `i' will be recorded on the toplevel ScopeInfo, while `j' will be
17009 recorded on a child.
17011 The toplevel ScopeInfo will also track information like the `this'
17012 pointer if instance variables were referenced (this is necessary
17013 as the anonymous method lives inside a nested class in the host
17014 type of the method).
17016 (AnonymousMethod): Expanded to track the Toplevel, implement
17017 `AnonymousMethod.Compatible' to tell whether an anonymous method
17018 can be converted to a target delegate type.
17020 The routine now also produces the anonymous method content
17022 (AnonymousDelegate): A helper class that derives from
17023 DelegateCreation, this is used to generate the code necessary to
17024 produce the delegate for the anonymous method that was created.
17026 * assign.cs: API adjustments for new changes in
17027 Convert.ImplicitStandardConversionExists.
17029 * class.cs: Adjustments to cope with the fact that now toplevel
17030 blocks are of type `ToplevelBlock'.
17032 * cs-parser.jay: Now we produce ToplevelBlocks for toplevel blocks
17033 insteda of standard blocks.
17035 Flag errors if params arguments are passed to anonymous methods.
17037 * codegen.cs (EmitContext): Replace `InAnonymousMethod' with
17038 `CurrentAnonymousMethod' which points to the current Anonymous
17039 Method. The variable points to the AnonymousMethod class that
17040 holds the code being compiled. It is set in the new EmitContext
17041 created for the anonymous method.
17043 (EmitContext.Phase): Introduce a variable and an enumeration to
17044 assist in enforcing some rules about when and where we are allowed
17045 to invoke certain methods (EmitContext.NeedsReturnLabel is the
17046 only one that enfonces this right now).
17048 (EmitContext.HaveCaptureInfo): new helper method that returns
17049 whether we have a CapturedContext initialized.
17051 (EmitContext.CaptureVariable): New method used to register that a
17052 LocalInfo must be flagged for capturing.
17054 (EmitContext.CapturedParameter): New method used to register that a
17055 parameters must be flagged for capturing.
17057 (EmitContext.CapturedField): New method used to register that a
17058 field must be flagged for capturing.
17060 (EmitContext.HaveCapturedVariables,
17061 EmitContext.HaveCapturedFields): Return whether there are captured
17062 variables or fields.
17064 (EmitContext.EmitMethodHostInstance): This is used to emit the
17065 instance for the anonymous method. The instance might be null
17066 (static methods), this (for anonymous methods that capture nothing
17067 and happen to live side-by-side with the current method body) or a
17068 more complicated expression if the method has a CaptureContext.
17070 (EmitContext.EmitTopBlock): Routine that drives the emission of
17071 code: it will first resolve the top block, then emit any metadata
17072 and then emit the code. The split is done so that we can extract
17073 any anonymous methods and flag any captured variables/parameters.
17075 (EmitContext.ResolveTopBlock): Triggers the resolution phase,
17076 during this phase, the ILGenerator should not be used as labels
17077 and local variables declared here might not be accessible to any
17078 code that is part of an anonymous method.
17080 Exceptions to this include the temporary variables that are
17081 created by some statements internally for holding temporary
17084 (EmitContext.EmitMeta): New routine, in charge of emitting all the
17087 (EmitContext.TemporaryReturn): This method is typically called
17088 from the Emit phase, and its the only place where we allow the
17089 ReturnLabel to be defined other than the EmitMeta. The reason is
17090 that otherwise we would have to duplicate a lot of logic in the
17091 Resolve phases of various methods that today is on the Emit
17094 (EmitContext.NeedReturnLabel): This no longer creates the label,
17095 as the ILGenerator is not valid during the resolve phase.
17097 (EmitContext.EmitThis): Extended the knowledge in this class to
17098 work in anonymous methods in addition to iterators.
17100 (EmitContext.EmitCapturedVariableInstance): This emits whatever
17101 code is necessary on the stack to access the instance to a local
17102 variable (the variable will be accessed as a field).
17104 (EmitContext.EmitParameter, EmitContext.EmitAssignParameter,
17105 EmitContext.EmitAddressOfParameter): Routines to support
17106 parameters (not completed at this point).
17108 Removals: Removed RemapLocal and RemapLocalLValue. We probably
17109 will also remove the parameters.
17111 * convert.cs (Convert): Define a `ConstantEC' which points to a
17112 null. This is just to prefity some code that uses
17113 ImplicitStandardConversion code and do not have an EmitContext
17116 The idea is to flag explicitly that at that point in time, it is
17117 known that the conversion will not trigger the delegate checking
17118 code in implicit conversions (which requires a valid
17121 Everywhere: pass new EmitContext parameter since
17122 ImplicitStandardConversionExists now requires it to check for
17123 anonymous method conversions.
17125 (Convert.ImplicitStandardConversionExists): If the type of an
17126 expression is the anonymous_method_type, and the type is a
17127 delegate, we invoke the AnonymousMethod.Compatible method to check
17128 whether an implicit conversion is possible.
17130 (Convert.ImplicitConversionStandard): Only do implicit method
17131 group conversions if the language level is not ISO_1.
17133 * delegate.cs (Delegate.GetInvokeMethod): Common method to get the
17134 MethodInfo for the Invoke method. used by Delegate and
17137 * expression.cs (Binary.DoNumericPromotions): only allow anonymous
17138 method conversions if the target type is a delegate.
17140 Removed extra debugging nops.
17142 (LocalVariableReference): Turn the `local_info' into a public
17145 Add `prepared' field, the same hack used for FieldExprs to cope
17146 with composed assignments, as Local variables do not necessarily
17147 operate purely on the stack as they used to: they can be captured
17150 Add `temp' for a temporary result, like fields.
17152 Refactor DoResolve and DoResolveLValue into DoResolveBase.
17154 It now copes with Local variables that are captured and emits the
17155 proper instance variable to load it from a field in the captured
17158 (ParameterReference.DoResolveBase): During the resolve phase,
17159 capture parameters if we are in an anonymous method.
17161 (ParameterReference.Emit, ParameterReference.AddressOf): If in an
17162 anonymous method, use the EmitContext helper routines to emit the
17163 parameter reference.
17165 * iterators.cs: Set RemapToProxy to true/false during the
17168 * parameters.cs (GetParameterByName): New helper method.
17170 * typemanager.cs (anonymous_method_type) a new type that
17171 represents an anonyous method. This is always an internal type,
17172 used as a fencepost to test against the anonymous-methodness of an
17175 2004-10-20 Marek Safar <marek.safar@seznam.cz>
17177 * class.cs (MethodCore.CheckBase): Add errors 505, 533, 544,
17179 (PropertyBase.FindOutParentMethod): Add errors 545, 546 report.
17181 2004-10-18 Martin Baulig <martin@ximian.com>
17183 * statement.cs (Fixed.Resolve): Don't access the TypeExpr's
17184 `Type' directly, but call ResolveType() on it.
17185 (Catch.Resolve): Likewise.
17186 (Foreach.Resolve): Likewise.
17188 2004-10-18 Martin Baulig <martin@ximian.com>
17190 * expression.cs (Cast.DoResolve): Don't access the TypeExpr's
17191 `Type' directly, but call ResolveType() on it.
17192 (Probe.DoResolve): Likewise.
17193 (ArrayCreation.LookupType): Likewise.
17194 (TypeOf.DoResolve): Likewise.
17195 (SizeOf.DoResolve): Likewise.
17197 2004-10-18 Martin Baulig <martin@ximian.com>
17199 * expression.cs (Invocation.BetterFunction): Put back
17200 TypeManager.TypeToCoreType().
17202 2004-10-18 Raja R Harinath <rharinath@novell.com>
17204 * class.cs (FieldMember.DoDefine): Reset ec.InUnsafe after doing
17207 2004-10-18 Martin Baulig <martin@ximian.com>
17209 * parameter.cs (Parameter.Resolve): Don't access the TypeExpr's
17210 `Type' directly, but call ResolveType() on it.
17212 2004-10-18 Martin Baulig <martin@ximian.com>
17214 * class.cs (FieldMember.Define): Don't access the TypeExpr's
17215 `Type' directly, but call ResolveType() on it.
17216 (MemberBase.DoDefine): Likewise.
17218 * expression.cs (New.DoResolve): Don't access the TypeExpr's
17219 `Type' directly, but call ResolveType() on it.
17220 (ComposedCast.DoResolveAsTypeStep): Likewise.
17222 * statement.cs (LocalInfo.Resolve): Don't access the TypeExpr's
17223 `Type' directly, but call ResolveType() on it.
17225 2004-10-17 John Luke <john.luke@gmail.com>
17227 * class.cs (Operator.GetSignatureForError): use CSharpName
17229 * parameter.cs (Parameter.GetSignatureForError): Returns
17230 correct name even if was not defined.
17232 2004-10-13 Raja R Harinath <rharinath@novell.com>
17235 * class.cs (TypeContainer.EmitContext): New property.
17236 (DefineNestedTypes): Create an emitcontext for each part.
17237 (MethodCore.DoDefineParameters): Use container's emitcontext.
17238 Pass type array to InternalParameters.
17239 (MemberBase.DoDefine): Use container's emitcontext.
17240 (FieldMember.Define): Likewise.
17241 (Event.Define): Likewise.
17242 (SetMethod.GetParameterInfo): Change argument to EmitContext.
17243 Pass type array to InternalParameters.
17244 (SetIndexerMethod.GetParameterInfo): Likewise.
17245 (SetMethod.Define): Pass emitcontext to GetParameterInfo.
17246 * delegate.cs (Define): Pass emitcontext to
17247 ComputeAndDefineParameterTypes and GetParameterInfo. Pass type
17248 array to InternalParameters.
17249 * expression.cs (ParameterReference.DoResolveBase): Pass
17250 emitcontext to GetParameterInfo.
17251 (ComposedCast.DoResolveAsTypeStep): Remove check on
17252 ec.ResolvingTypeTree.
17253 * parameter.cs (Parameter.Resolve): Change argument to
17254 EmitContext. Use ResolveAsTypeTerminal.
17255 (Parameter.GetSignature): Change argument to EmitContext.
17256 (Parameters.ComputeSignature): Likewise.
17257 (Parameters.ComputeParameterTypes): Likewise.
17258 (Parameters.GetParameterInfo): Likewise.
17259 (Parameters.ComputeAndDefineParameterTypes): Likewise.
17260 Re-use ComputeParameterTypes. Set ec.ResolvingTypeTree.
17261 * support.cs (InternalParameters..ctor): Remove variant that takes
17263 * typemanager.cs (system_intptr_expr): New.
17264 (InitExpressionTypes): Initialize it.
17266 2004-10-12 Chris Toshok <toshok@ximian.com>
17268 * cs-parser.jay: fix location for try_statement and catch_clause.
17270 2004-10-11 Martin Baulig <martin@ximian.com>
17272 * report.cs: Don't make --fatal abort on warnings, we have
17273 -warnaserror for that.
17275 2004-10-07 Raja R Harinath <rharinath@novell.com>
17277 More DeclSpace.ResolveType avoidance.
17278 * decl.cs (MemberCore.InUnsafe): New property.
17279 * class.cs (MemberBase.DoDefine): Use ResolveAsTypeTerminal
17280 with newly created EmitContext.
17281 (FieldMember.Define): Likewise.
17282 * delegate.cs (Delegate.Define): Likewise.
17283 * ecore.cs (SimpleName.ResolveAsTypeStep): Lookup with alias
17284 only if normal name-lookup fails.
17285 (TypeExpr.DoResolve): Enable error-checking.
17286 * expression.cs (ArrayCreation.DoResolve): Use ResolveAsTypeTerminal.
17287 (SizeOf.DoResolve): Likewise.
17288 (ComposedCast.DoResolveAsTypeStep): Likewise.
17289 (StackAlloc.DoResolve): Likewise.
17290 * statement.cs (Block.Flags): Add new flag 'Unsafe'.
17291 (Block.Unsafe): New property.
17292 (Block.EmitMeta): Set ec.InUnsafe as appropriate.
17293 (Unsafe): Set 'unsafe' flag of contained block.
17294 (LocalInfo.Resolve): Use ResolveAsTypeTerminal.
17295 (Fixed.Resolve): Likewise.
17296 (Catch.Resolve): Likewise.
17297 (Using.ResolveLocalVariableDecls): Likewise.
17298 (Foreach.Resolve): Likewise.
17300 2004-10-05 John Luke <john.luke@gmail.com>
17302 * cs-parser.jay: add location to error CS0175
17304 2004-10-04 Miguel de Icaza <miguel@ximian.com>
17306 * ecore.cs (Expression.Constantity): Add support for turning null
17309 * const.cs (Const.Define): Allow constants to be reference types
17310 as long as the value is Null.
17312 2004-10-04 Juraj Skripsky <js@hotfeet.ch>
17314 * namespace.cs (NamespaceEntry.Using): No matter which warning
17315 level is set, check if this namespace name has already been added.
17317 2004-10-03 Ben Maurer <bmaurer@ximian.com>
17319 * expression.cs: reftype [!=]= null should always use br[true,false].
17322 2004-10-03 Marek Safar <marek.safar@seznam.cz>
17325 * attribute.cs: Enum conversion moved to
17326 GetAttributeArgumentExpression to be applied to the all
17329 2004-10-01 Raja R Harinath <rharinath@novell.com>
17331 Fix #65833, test-300.cs, cs0122-5.cs, cs0122-6.cs.
17332 * class.c (TypeContainer.DefineType): Flag error if
17333 base types aren't accessible due to access permissions.
17334 * decl.cs (DeclSpace.ResolveType): Move logic to
17335 Expression.ResolveAsTypeTerminal.
17336 (DeclSpace.ResolveTypeExpr): Thin layer over
17337 Expression.ResolveAsTypeTerminal.
17338 (DeclSpace.CheckAccessLevel, DeclSpace.FamilyAccess):
17339 Refactor code into NestedAccess. Use it.
17340 (DeclSpace.NestedAccess): New.
17341 * ecore.cs (Expression.ResolveAsTypeTerminal): Add new
17342 argument to silence errors. Check access permissions.
17343 (TypeExpr.DoResolve, TypeExpr.ResolveType): Update.
17344 * expression.cs (ProbeExpr.DoResolve): Use ResolveAsTypeTerminal.
17345 (Cast.DoResolve): Likewise.
17346 (New.DoResolve): Likewise.
17347 (InvocationOrCast.DoResolve,ResolveStatement): Likewise.
17348 (TypeOf.DoResolve): Likewise.
17350 * expression.cs (Invocation.BetterConversion): Return the Type of
17351 the better conversion. Implement section 14.4.2.3 more faithfully.
17352 (Invocation.BetterFunction): Make boolean. Make correspondence to
17353 section 14.4.2.2 explicit.
17354 (Invocation.OverloadResolve): Update.
17355 (Invocation): Remove is_base field.
17356 (Invocation.DoResolve): Don't use is_base. Use mg.IsBase.
17357 (Invocation.Emit): Likewise.
17359 2004-09-27 Raja R Harinath <rharinath@novell.com>
17361 * README: Update to changes.
17363 2004-09-24 Marek Safar <marek.safar@seznam.cz>
17365 * cs-parser.jay: Reverted 642 warning fix.
17367 2004-09-23 Marek Safar <marek.safar@seznam.cz>
17370 * decl.cs (FindMemberWithSameName): Indexer can have more than
17373 2004-09-23 Marek Safar <marek.safar@seznam.cz>
17375 * expression.cs (LocalVariableReference.DoResolveLValue):
17376 Do not report warning 219 for out values.
17377 (EmptyExpression.Null): New member to avoid extra allocations.
17379 2004-09-23 Marek Safar <marek.safar@seznam.cz>
17381 * cs-parser.jay: Fix wrong warning 642 report.
17383 * cs-tokenizer.cs (CheckNextToken): New helper;
17384 Inspect next character if is same as expected.
17386 2004-09-23 Martin Baulig <martin@ximian.com>
17388 * convert.cs (Convert.ImplicitReferenceConversion): Some code cleanup.
17389 (Convert.ImplicitReferenceConversionExists): Likewise.
17391 2004-09-23 Marek Safar <marek.safar@seznam.cz>
17393 * class.cs (Operator.Define): Add error 448 and 559 report.
17395 2004-09-22 Marek Safar <marek.safar@seznam.cz>
17397 * class.cs (MemberBase.IsTypePermitted): New protected
17398 method for checking error CS0610.
17400 2004-09-22 Marek Safar <marek.safar@seznam.cz>
17402 * class.cs (TypeContainer.HasExplicitLayout): New property
17403 Returns whether container has StructLayout attribute set Explicit.
17404 (FieldMember): New abstract class for consts and fields.
17405 (FieldMember.ApplyAttributeBuilder): Add error 636 and 637 report.
17406 (Field): Reuse FieldMember.
17408 * const.cs (Const): Reuse FieldMember.
17410 * rootcontext.cs: EmitConstants call moved to class.
17412 2004-09-22 Martin Baulig <martin@ximian.com>
17414 Thanks to Peter Sestoft for this bug report.
17416 * expression.cs (Conditional): If both the `trueExpr' and the
17417 `falseExpr' is a NullLiteral, return a NullLiteral.
17419 2004-09-22 Martin Baulig <martin@ximian.com>
17421 * statement.cs (Foreach.EmitCollectionForeach): If we're in an
17422 iterator, use `enumerator.EmitThis()' instead of `ec.EmitThis()'
17423 for the "get_Current" call.
17425 2004-09-22 Martin Baulig <martin@ximian.com>
17427 Marek and me just fixed one of our oldest bugs: #28562 :-)
17429 * ecore.cs (EnumConstant.GetValueAsEnumType): New public method.
17431 * attribute.cs (Attribute.GetAttributeArgumentExpression): If
17432 we're an EnumConstant, just return that.
17433 (Attribute.Resolve): GetAttributeArgumentExpression() may give us
17434 an EnumConstant. In this case, we need to use GetValueAsEnumType()
17435 to get the value which'll actually be written into the attribute.
17436 However, we have to use GetValue() to access the attribute's value
17439 2004-09-22 Marek Safar <marek.safar@seznam.cz>
17441 * constant.cs (Constant.IsNegative): New abstract property
17444 * expression.cs (ArrayAccess.DoResolve): Add warning 251.
17445 (StackAlloc.DoResolve): Reused IsNegative.
17447 2004-09-21 Martin Baulig <martin@ximian.com>
17449 * codegen.cs (VariableStorage): Don't store the ILGenerator here;
17450 if we're used in an iterator, we may be called from different
17453 * statement.cs (Foreach.EmitFinally): Only emit an `Endfinally' if
17454 we actually have an exception block.
17456 2004-09-20 John Luke <jluke@cfl.rr.com>
17458 * class.cs, cs-parser.jay: Improve the error report for 1520:
17459 report the actual line where the error happens, not where the
17460 class was declared.
17462 * assign.cs, delegate.cs, ecore.cs, expression.cs, statement.cs:
17463 Pass location information that was available elsewhere.
17465 2004-09-19 Sebastien Pouliot <sebastien@ximian.com>
17467 * codegen.cs: Fix bug #56621. It is now possible to use MCS on the MS
17468 runtime to delay sign assemblies.
17470 2004-09-19 Miguel de Icaza <miguel@ximian.com>
17472 * cs-parser.jay: Do not report the stack trace, this is barely
17475 2004-08-22 John Luke <john.luke@gmail.com>
17477 * driver.cs : check that a resource id is not already used
17478 before adding it, report CS1508 if it is, bug #63637
17480 2004-09-19 Miguel de Icaza <miguel@ximian.com>
17482 * ecore.cs: Removed dead code.
17484 2004-09-18 Marek Safar <marek.safar@seznam.cz>
17486 * class.cs: Do not report warning CS0067 on the interfaces.
17488 2004-09-16 Marek Safar <marek.safar@seznam.cz>
17490 * cs-parser.jay: Add error 504 report.
17492 2004-09-16 Marek Safar <marek.safar@seznam.cz>
17494 * rootcontext.cs: WarningLevel is 4 by default now.
17496 * statement.cs (Fixed.Resolve): Do not null
17499 2004-09-16 Marek Safar <marek.safar@seznam.cz>
17502 * ecore.cs (PropertyExpr.FindAccessors): Do not perform
17503 deep search when property is not virtual.
17504 (PropertyExpr.ResolveAccessors): Make one call for both
17507 2004-09-15 Marek Safar <marek.safar@seznam.cz>
17510 * statement.cs: Error 152 report constains also location.
17512 2004-09-15 Marek Safar <marek.safar@seznam.cz>
17515 * const.cs: Explicitly set constant as static.
17517 2004-09-15 Marek Safar <marek.safar@seznam.cz>
17520 * cs-parser.jay: Add error 1017 report.
17522 2004-09-15 Marek Safar <marek.safar@seznam.cz>
17524 Fixed bug #59980, #64224
17525 * expression.cs (Invocation.DoResolve): Fixed error CS0571 test.
17527 * typemanager.cs (IsSpecialMethod): Simplified
17529 2004-09-14 Marek Safar <marek.safar@seznam.cz>
17531 * decl.cs (MemberCore.Emit): Resuscitated VerifyObsoleteAttribute
17532 condition with better params.
17534 2004-09-14 Marek Safar <marek.safar@seznam.cz>
17537 * attribute.cs (Resolve): Property has to have both
17540 2004-09-14 Martin Baulig <martin@ximian.com>
17542 * decl.cs (MemberCore.Emit): Always call VerifyObsoleteAttribute().
17544 2004-09-14 Marek Safar <marek.safar@seznam.cz>
17547 * codegen.cs (TestObsoleteMethodUsage): Trace when method is
17548 called and is obsolete then this member suppress message
17549 when call is inside next [Obsolete] method or type.
17551 * expression.cs: Use TestObsoleteMethodUsage member.
17553 2004-09-14 Martin Baulig <martin@ximian.com>
17555 * cs-parser.jay: Sync a bit with the GMCS version.
17557 2004-09-14 Martin Baulig <martin@ximian.com>
17559 * cs-parser.jay (CSharpParser): Don't derive from GenericsParser.
17560 (CSharpParser.yacc_verbose_flag): New public field.
17562 * genericparser.cs: Removed.
17564 2004-09-14 Raja R Harinath <rharinath@novell.com>
17566 * cs-parser.jay (event_declaration): Re-enable cs0071 error.
17568 2004-09-13 Marek Safar <marek.safar@seznam.cz>
17570 * class.cs (MethodCore.CheckBase): Fix bug #65757.
17572 2004-09-10 Martin Baulig <martin@ximian.com>
17574 Backported my MemberName changes from GMCS into MCS.
17576 - we are now using a special `MemberName' class instead of using
17577 strings; in GMCS, the `MemberName' also contains the type
17580 - changed the grammar rules a bit:
17581 * the old `member_name' is now a `namespace_or_type_name':
17582 The rule is that we use `namespace_or_type_name' everywhere
17583 where we expect either a "member name" (GetEnumerator) or a
17584 "member name" with an explicit interface name
17585 (IEnumerable.GetEnumerator).
17586 In GMCS, the explicit interface name may include type arguments
17587 (IEnumerable<T>.GetEnumerator).
17588 * we use `member_name' instead of just `IDENTIFIER' for
17590 The rule is that we use `member_name' wherever a member may
17591 have type parameters in GMCS.
17593 * decl.cs (MemberName): New public class.
17594 (MemberCore.MemberName): New public readonly field.
17595 (MemberCore.ctor): Take a `MemberName' argument, not a string.
17596 (DeclSpace): Likewise.
17598 * delegate.cs (Delegate.ctor): Take a MemberName, not a string.
17599 * enum.cs (Enum.ctor): Likewise.
17601 * namespace.cs (AliasEntry.Alias): Changed type from Expression to
17603 (AliasEntry.ctor): Take a MemberName, not an Expression.
17604 (AliasEntry.UsingAlias): Likewise.
17606 * class.cs (TypeContainer.ctor): Take a MemberName, not a string.
17607 (IMethodData.MemberName): Changed type from string to MemberName.
17608 (MemberBase.ExplicitInterfaceName): Likewise.
17609 (AbstractPropertyEventMethod.SetupName): Make this private.
17610 (AbstractPropertyEventMethod.ctor): Added `string prefix'
17611 argument; compute the member name here.
17612 (AbstractPropertyEventMethod.UpdateName): Recompute the name based
17613 on the `member.MemberName' and the `prefix'.
17615 * cs-parser.jay (attribute_name): Use `namespace_or_type_name',
17617 (struct_declaration): Use `member_name' instead of `IDENTIFIER';
17618 thus, we get a `MemberName' instead of a `string'. These
17619 declarations may have type parameters in GMCS.
17620 (interface_method_declaration, delegate_declaration): Likewise.
17621 (class_declaration, interface_declaration): Likewise.
17622 (method_header): Use `namespace_or_type_name' instead of
17623 `member_name'. We may be an explicit interface implementation.
17624 (property_declaration, event_declaration): Likewise.
17625 (member_name): This is now just an `IDENTIFIER', not a
17626 `namespace_or_type_name'.
17627 (type_name, interface_type): Removed.
17628 (namespace_or_type_name): Return a MemberName, not an Expression.
17629 (primary_expression): Use `member_name' instead of `IDENTIFIER';
17630 call GetTypeExpression() on the MemberName to get an expression.
17631 (IndexerDeclaration.interface_type): Changed type from string to
17633 (MakeName): Operate on MemberName's instead of string's.
17635 2004-09-13 Raja R Harinath <rharinath@novell.com>
17638 * namespace.cs (AliasEntry.Resolve): Implement section 16.3.1.
17639 (NamespaceEntry.Lookup): Add new argument to flag if we want the
17640 lookup to avoid symbols introduced by 'using'.
17641 * rootcontext.cs (NamespaceLookup): Update.
17643 2004-09-12 Marek Safar <marek.safar@seznam.cz>
17645 * class.cs (TypeContainer.DoDefineMembers): Do not call
17646 DefineDefaultConstructor for static classes.
17648 2004-09-12 Marek Safar <marek.safar@seznam.cz>
17650 * attribute.cs (Attribute.Resolve): Add error 653 report.
17652 * class.cs (Class.ApplyAttributeBuilder): Add error 641
17654 (Method.ApplyAttributeBuilder): Add error 685 report.
17655 (Operator.Define): Add error 564 report.
17657 * cs-tokenizer.cs (handle_hex): Add error 1013 report.
17659 * expression.cs (Invocation.DoResolve): Add error
17660 245 and 250 report.
17662 * parameter.cs (Parameter.ApplyAttributeBuilder): Add
17665 2004-09-11 Marek Safar <marek.safar@seznam.cz>
17667 * class.cs (ConstructorInitializer.Resolve):
17668 Wrong error number (515->516).
17670 2004-09-11 Marek Safar <marek.safar@seznam.cz>
17672 * class.cs (Indexer.Define): Add error 631 report.
17674 2004-09-11 Marek Safar <marek.safar@seznam.cz>
17676 * ecore.cs (Error_NegativeArrayIndex): Fix 248 error.
17678 2004-09-11 Marek Safar <marek.safar@seznam.cz>
17680 * expression.cs (Probe.DoResolve): Add error CS0241 report.
17682 2004-09-10 Marek Safar <marek.safar@seznam.cz>
17684 * cs-parser.jay: Added error CS0241 report.
17686 2004-09-10 Raja R Harinath <rharinath@novell.com>
17688 * cs-parser.jay (fixed_statement): Introduce a scope for the
17689 declaration in the 'fixed' statement.
17691 2004-09-09 Marek Safar <marek.safar@seznam.cz>
17693 * cs-parser.jay: Added CS0230 error report.
17695 2004-09-09 Marek Safar <marek.safar@seznam.cz>
17697 * cs-parser.jay: Added errors CS0231 and CS0257 report.
17699 2004-09-09 Marek Safar <marek.safar@seznam.cz>
17701 * expression.cs (Argument.Resolve): Added error CS0192 and
17704 2004-09-09 Marek Safar <marek.safar@seznam.cz>
17706 C# 2.0 #pragma warning feature
17708 * cs-tokenizer.cs (PreProcessPragma): New method;
17709 Handles #pragma directive.
17711 * report.cs (WarningRegions): New class; Support
17712 class for #pragma warning directive. It tests whether
17713 warning is enabled for a given line.
17715 2004-09-08 Miguel de Icaza <miguel@ximian.com>
17717 * const.cs: Add more descriptive error report, tahnks to
17720 2004-09-08 Marek Safar <marek.safar@seznam.cz>
17722 * ecore.cs (FieldExpr.DoResolveLValue): Fixed CS0198 report.
17724 2004-09-07 Miguel de Icaza <miguel@ximian.com>
17726 * expression.cs: Apply patch from Ben: Remove dead code from
17727 ArrayCreation, and remove the TurnintoConstant call in const.cs,
17728 as that code just threw an exception anwyays.
17730 * const.cs: Remove the call to the turnintoconstant, for details
17733 * literal.cs: The type of the null-literal is the null type; So
17734 we use a placeholder type (literal.cs:System.Null, defined here)
17737 * expression.cs (Conditional.DoResolve): Remove some old code that
17738 is no longer needed, conversions have been fixed.
17740 (ArrayCreationExpression.DoResolve): Return false if we fail to
17741 resolve the inner expression.
17743 2004-09-07 Raja R Harinath <rharinath@novell.com>
17746 * cs-parser.jay (delegate_declaration): Record a delegate
17747 declaration as a type declaration.
17748 Reported by Jo Vermeulen <jo@lumumba.luc.ac.be>.
17750 2004-09-06 Miguel de Icaza <miguel@ximian.com>
17752 * parameter.cs: Do not crash if the type can not be resolved.
17754 * expression.cs: Report errors with unsafe pointers, fixes #64896
17756 2004-09-06 Ben Maurer <bmaurer@users.sourceforge.net>
17758 * expression.cs: Pointer arith always needs to do a conv.i
17759 if the operand is a long. fix 65320
17761 2004-09-04 Marek Safar <marek.safar@seznam.cz>
17763 Fixed cs0619-37.cs, cs0619-38.cs
17765 * enum.cs (GetObsoleteAttribute): Removed.
17767 * expression.cs (MemberAccess.DoResolve): Test for [Obsolete]
17768 on Enum member is double staged. The first is tested member
17771 2004-09-04 Marek Safar <marek.safar@seznam.cz>
17773 Fixed #56986, #63631, #65231
17775 * class.cs: (TypeContainer.AddToMemberContainer): New method,
17776 adds member to name container.
17777 (TypeContainer.AddToTypeContainer): New method, adds type to
17779 (AddConstant, AddEnum, AddClassOrStruct, AddDelegate, AddMethod,
17780 AddConstructor, AddInterface, AddField, AddProperty, AddEvent,
17781 AddOperator): Simplified by reusing AddToMemberContainer.
17782 (TypeContainer.UserDefinedStaticConstructor): Changed to property
17784 (Method.CheckForDuplications): Fixed implementation to test all
17786 (MemberBase): Detection whether member is explicit interface
17787 implementation is now in constructor.
17788 (MemberBase.UpdateMemberName): Handles IndexerName.
17789 (Accessor): Changed to keep also location information.
17790 (AbstractPropertyEventMethod): Is derived from MemberCore.
17791 (AbstractPropertyEventMethod.IsDummy): Says whether accessor
17792 will be emited or not.
17793 (PropertyBase.AreAccessorsDuplicateImplementation):
17794 Tests whether accessors are not in collision with some method.
17795 (Operator): Is derived from MethodCore to simplify common
17798 * decl.cs (Flags.TestMethodDuplication): Test for duplication
17800 (DeclSpace.AddToContainer): Adds the member to defined_names
17801 table. It tests for duplications and enclosing name conflicts.
17803 * enum.cs (EnumMember): Clean up to reuse the base structures
17805 2004-09-03 Martin Baulig <martin@ximian.com>
17807 * class.cs (TypeContainer.DefineDefaultConstructor): Put this back
17808 into TypeContainer, to make partial classes work again.
17810 2004-09-03 Martin Baulig <martin@ximian.com>
17812 * rootcontext.cs (RootContext.V2): Removed.
17814 2004-03-23 Martin Baulig <martin@ximian.com>
17816 * expression.cs (Invocation.OverloadResolve): Added `bool
17817 may_fail' argument and use it instead of the Location.IsNull() hack.
17819 2004-09-03 Martin Baulig <martin@ximian.com>
17821 Merged latest changes into gmcs. Please keep this comment in
17822 here, it makes it easier for me to see what changed in MCS since
17823 the last time I merged.
17825 2004-09-03 Raja R Harinath <rharinath@novell.com>
17828 * expression.cs (BetterConversion): Don't allow either conversion
17829 to be null. Remove redundant implicit conversion test when 'q ==
17830 null' -- when this function is invoked, we already know that the
17831 implicit conversion exists.
17832 (BetterFunction): Assume that 'best' is non-null. Remove
17833 redundant reimplementation of IsApplicable when 'best' is null.
17834 (IsParamsMethodApplicable, IsApplicable): Add new parameter for
17835 number of arguments.
17836 (IsAncestralType): Extract from OverloadResolve.
17837 (OverloadResolve): Make robust to the MethodGroupExpr being
17838 unsorted. Implement all the logic of Section 14.5.5.1, and
17839 support overloading of methods from multiple applicable types.
17840 Clean up logic somewhat. Don't pass null methods to BetterFunction.
17842 * report.cs (SymbolRelatedToPreviousError): Cleanup output.
17843 (RealError, Warning): Append type of report to related symbol.
17845 2004-09-03 Marek Safar <marek.safar@seznam.cz>
17847 * enum.cs: Fixed CLS-Compliance checks for enum members.
17848 Error tests cs3008-8.cs, cs3014-8.cs
17850 2004-09-02 Marek Safar <marek.safar@seznam.cz>
17852 Fixed bug #62342, #63102
17853 * class.cs: ImplementIndexer uses member.IsExplicitImpl
17854 like ImplementMethod.
17856 2004-09-02 Marek Safar <marek.safar@seznam.cz>
17858 * attribute.cs (Attribute.GetAttributeArgumentExpression):
17861 2004-09-02 Martin Baulig <martin@ximian.com>
17863 * statement.cs (Using.EmitLocalVariableDeclFinally): Use
17864 TypeManager.GetArgumentTypes() rather than calling GetParameters()
17867 2004-09-01 Marek Safar <marek.safar@seznam.cz>
17869 C# 2.0 Static classes implemented
17871 * class.cs (TypeContainer): instance_constructors,
17872 initialized_fields, initialized_static_fields,
17873 default_constructor, base_inteface_types are protected to be
17874 accessible from StaticClass.
17875 (TypeContainer.DefineDefaultConstructor): New virtual method
17876 for custom default constructor generating
17877 (StaticClass): New class to handle "Static classes" feature.
17879 * cs-parser.jay: Handle static keyword on class like instance
17882 * driver.cs: Added "/langversion" command line switch with two
17883 options (iso-1, default).
17885 2004-08-31 Marek Safar <marek.safar@seznam.cz>
17887 * ecore.cs (FieldExpr.Resolve): Fixed bug #64689.
17889 2004-08-31 Miguel de Icaza <miguel@ximian.com>
17891 * delegate.cs: Style.
17893 2004-08-31 Ben Maurer <bmaurer@users.sourceforge.net>
17895 * delegate.cs: Add seperate instance expr field for miguel.
17897 2004-08-29 Ben Maurer <bmaurer@users.sourceforge.net>
17899 * PointerArithmetic (Resolve): make sure we are not doing
17900 pointer arith on void*. Also, make sure we are resolved
17901 by not setting eclass until resolve.
17903 All callers: Make sure that PointerArithmetic gets resolved.
17905 2004-08-29 Ben Maurer <bmaurer@users.sourceforge.net>
17907 * ArrayCreation (LookupType): If the type does not resolve
17908 to an array, give an error.
17910 2004-08-27 Marek Safar <marek.safar@seznam.cz>
17912 * statement.cs (Try.Resolve): Fixed bug #64222
17914 2004-08-27 Martin Baulig <martin@ximian.com>
17917 (TC.OperatorArrayList.OperatorEntry.CheckPairedOperators): Don't
17920 2004-08-26 Marek Safar <marek.safar@seznam.cz>
17922 * ecore.cs (Constantify): Get underlying type via
17923 System.Enum.GetUnderlyingType to avoid StackOverflow on the
17924 Windows in special cases.
17926 2004-08-26 Marek Safar <marek.safar@seznam.cz>
17928 * typemanager.cs (GetAddMethod): Used GetAddMethod (true)
17929 for obtaining also private methods.
17930 (GetRemoveMethod): Used GetRemoveMethod (true)
17931 for obtaining also private methods.
17933 2004-08-24 Martin Baulig <martin@ximian.com>
17935 * class.cs (Method.Define): Set MethodAttributes.SpecialName and
17936 MethodAttributes.HideBySig for operators.
17938 2004-08-23 Martin Baulig <martin@ximian.com>
17940 Back to the old error reporting system :-)
17942 * report.cs (Message): Removed.
17943 (Report.MessageData, ErrorData, WarningData): Removed.
17944 (Report.Error, Warning): Back to the old system.
17946 2004-08-23 Martin Baulig <martin@ximian.com>
17948 * decl.cs (IMemberContainer.Parent): Renamed to ParentContainer.
17950 * class.cs (TypeContainer.ParentContainer): New public virtual
17951 method; replaces the explicit interface implementation.
17952 (ClassPart.ParentContainer): Override.
17954 2004-08-23 Martin Baulig <martin@ximian.com>
17956 * statement.cs (Switch): Added support for constant switches; see
17957 #59428 or test-285.cs.
17959 2004-08-22 Marek Safar <marek.safar@seznam.cz>
17962 * statement.cs (GetEnumeratorFilter): Removed useless
17963 logic because C# specs is strict. GetEnumerator must be
17966 2004-08-22 Martin Baulig <martin@ximian.com>
17968 * flowanalysis.cs (FlowBranching.UsageVector.MergeChild): If we're
17969 a switch and may break, reset the barrier. Fixes #59867.
17971 2004-08-22 Marek Safar <marek.safar@seznam.cz>
17973 CLS-Compliance speed up (~5% for corlib)
17975 * attribute.cs (AttributeTester.VerifyTopLevelNameClsCompliance):
17976 New method. Tests container for CLS-Compliant names
17978 * class.cs (TypeContainer.VerifyClsName): New method.
17979 Checks whether container name is CLS Compliant.
17980 (Constructor): Implements IMethodData.
17982 * decl.cs (MemberCache.GetPublicMembers ): New method. Builds
17983 low-case table for CLS Compliance test.
17984 (MemberCache.VerifyClsParameterConflict): New method.
17985 Checks method parameters for CS3006 error.
17987 * enum.cs (EnumMember): Is derived from MemberCore.
17988 (Enum.VerifyClsName): Optimized for better performance.
17990 2004-08-06 Marek Safar <marek.safar@seznam.cz>
17992 * report.cs: Renamed Error_T to Error and changed all
17995 2004-08-06 Marek Safar <marek.safar@seznam.cz>
17997 * class.cs (TypeContainer.IndexerArrayList): New inner class
17998 container for indexers.
17999 (TypeContainer.DefaultIndexerName): New constant for default
18000 indexer name. Replaced all "Item" with this constant.
18001 (TypeContainer.DefineIndexers): Moved to IndexerArrayList class.
18003 * typemanager.cs (TypeManager.default_member_ctor): Cache here
18004 DefaultMemberAttribute constructor.
18006 2004-08-05 Martin Baulig <martin@ximian.com>
18008 * flowanalysis.cs (FlowBranching.UsageVector.MergeJumpOrigins):
18011 2004-08-05 Marek Safar <marek.safar@seznam.cz>
18013 * mcs.exe.sources: $(EXTRA_SOURCES) are now here to avoid
18014 multi platforms problem.
18016 * compiler.csproj: Included shared files.
18018 2004-08-04 Marek Safar <marek.safar@seznam.cz>
18020 Fix bug 60333, 55971 in the more general way
18021 * attribute.cs (Attribute.GetAttributeArgumentExpression):
18022 Added arg_type argument for constant conversion.
18023 (Attribute.Resolve): Reuse GetAttributeArgumentExpression.
18025 2004-08-04 Marek Safar <marek.safar@seznam.cz>
18028 * class.cs (TypeContainer ): New inner classes MethodArrayList,
18029 OperatorArrayList, MethodCoreArrayList for typecontainer
18030 containers. Changed class member types to these new types.
18031 (MethodArrayList.DefineMembers): Added test for CS0659.
18033 2004-08-04 Miguel de Icaza <miguel@ximian.com>
18035 * cfold.cs: Synchronize the folding with the code in expression.cs
18036 Binary.DoNumericPromotions for uint operands.
18038 * attribute.cs: Revert patch from Raja, it introduced a regression
18039 while building Blam-1.2.1 (hard to isolate a test case).
18041 2004-08-04 Marek Safar <marek.safar@seznam.cz>
18045 (TypeContainer.Define): Renamed to DefineContainerMembers because of
18047 (MethodCore.parent_method): New member. The method we're overriding
18048 if this is an override method.
18049 (MethodCore.CheckBase): Moved from Method class and made common.
18050 (MethodCore.CheckMethodAgainstBase): Moved from MemberBase and made
18052 (MethodCore.CheckForDuplications): New abstract method. For custom
18053 member duplication search in a container
18054 (MethodCore.FindOutParentMethod): New abstract method. Gets parent
18055 method and its return type.
18056 (Event.conflict_symbol): New member. Symbol with same name in the
18060 (MemberCache.FindMemberWithSameName): New method. The method
18061 is looking for conflict with inherited symbols.
18063 2004-08-04 Martin Baulig <martin@ximian.com>
18065 * codegen.cs (VariableStorage.EmitLoadAddress): New public method.
18067 * statement.cs (Foreach.EmitFinally): Make this work for valuetypes.
18069 2004-08-03 Marek Safar <marek.safar@seznam.cz>
18071 * report.cs (Message): New enum for better error, warning reference in
18073 (MessageData): New inner abstract class. It generally handles printing of
18074 error and warning messages.
18075 Removed unused Error, Warning, Message methods.
18077 2004-08-03 Marek Safar <marek.safar@seznam.cz>
18079 Fix for cs0592-8.cs test
18081 (Attributable.ValidAttributeTargets): Made public.
18082 (Attribute.ExplicitTarget): New member for explicit target value.
18083 (Attribute.CheckTargets): Now we translate explicit attribute
18084 target to Target here.
18086 2004-08-03 Ben Maurer <bmaurer@ximian.com>
18088 * ecore.cs (MethodGroupExpr): new IsBase property.
18090 * expression.cs (BaseAccess): Set IsBase on MethodGroupExpr.
18092 * delegate.cs (DelegateCreation): store a MethodGroupExpr
18093 rather than an instance expr.
18095 (DelegateCreation.Emit): Use the method group rather than
18096 the instance expression. Also, if you have base.Foo as the
18097 method for a delegate, make sure to emit ldftn, not ldftnvirt.
18099 (ResolveMethodGroupExpr): Use the MethodGroupExpr.
18101 (NewDelegate.DoResolve): Only check for the existance of Invoke
18102 if the method is going to be needed. Use MethodGroupExpr.
18104 (NewDelegate.Emit): Remove, DelegateCreation implements this.
18106 * expression.cs: For pointer arith., make sure to use
18107 the size of the type, not the size of the pointer to
18110 2004-08-03 Marek Safar <marek.safar@seznam.cz>
18113 * class.cs (Class): Added error CS0502 test.
18115 2004-08-03 John Luke <jluke@cfl.rr.com>
18116 Raja R Harinath <rharinath@novell.com>
18119 * attribute.cs (Attribute.complained_before): New flag.
18120 (Attribute.ResolveType, Attribute.Resolve),
18121 (Attribute.DefinePInvokeMethod): Set it.
18122 (Attributes.Search): Pass 'complain' to Attribute.ResolveType.
18124 2004-08-03 Martin Baulig <martin@ximian.com>
18126 * expression.cs (Binary.ResolveOperator): Don't abort if we can't
18127 use a user-defined operator; we still need to do numeric
18128 promotions in case one argument is a builtin type and the other
18129 one has an implicit conversion to that type. Fixes #62322.
18131 2004-08-02 Martin Baulig <martin@ximian.com>
18133 * statement.cs (LocalInfo.Flags): Added `IsThis'.
18134 (LocalInfo.IsThis): New public property.
18135 (Block.EmitMeta): Don't create a LocalBuilder for `this'.
18137 2004-08-01 Martin Baulig <martin@ximian.com>
18139 * class.cs (TypeContainer.GetClassBases): Don't set the default
18140 here since we may get called from GetPartialBases().
18141 (TypeContainer.DefineType): If GetClassBases() didn't return a
18142 parent, use the default one.
18144 2004-07-30 Duncan Mak <duncan@ximian.com>
18146 * Makefile (mcs2.exe, mcs3.exe): add $(EXTRA_SOURCES).
18148 2004-07-30 Martin Baulig <martin@ximian.com>
18150 * Makefile (EXTRA_SOURCES): List the symbol writer's sources here.
18152 * class.cs (SourceMethod): New public class, derive from the
18153 symbol writer's ISourceMethod.
18154 (Method): Use the new symbol writer API.
18156 * codegen.cs (CodeGen.InitializeSymbolWriter): Take the filename
18157 as argument and use the new symbol writer.
18160 (SourceFile): Implement the symbol writer's ISourceFile.
18161 (Location.SymbolDocument): Removed.
18162 (Location.SourceFile): New public property.
18164 * symbolwriter.cs: Use the new symbol writer API.
18166 2004-07-30 Raja R Harinath <rharinath@novell.com>
18168 * Makefile (install-local): Remove. Functionality moved to
18171 2004-07-28 Lluis Sanchez Gual <lluis@novell.com>
18173 * Makefile: Install mcs.exe.config file together with mcs.exe.
18174 * mcs.exe.config: Added supportedRuntime entry to make sure it runs in the
18175 correct runtime version.
18177 2004-07-25 Martin Baulig <martin@ximian.com>
18180 (TypeContainer.RegisterOrder): Removed, this was unused.
18181 (TypeContainer, interface_order): Removed.
18182 (TypeContainer.AddClass, AddStruct, AddInterface): Take a
18183 TypeContainer as argument since we can also be called with a
18184 `PartialContainer' for a partial class/struct/interface.
18185 (TypeContainer.IsInterface): Use `Kind == Kind.Interface' instead
18186 of checking whether we're an `Interface' - we could be a
18187 `PartialContainer'.
18188 (PartialContainer.Register): Override; call
18189 AddClass()/AddStruct()/AddInterface() on our parent.
18191 * cs-parser.jay (interface_member_declaration): Add things to the
18192 `current_container', not the `current_class'.
18194 * rootcontext.cs (RegisterOrder): The overloaded version which
18195 takes an `Interface' was unused, removed.
18197 * typemanager.cs (TypeManager.LookupInterface): Return a
18198 `TypeContainer', not an `Interface'.
18199 (TypeManager.IsInterfaceType): The `builder_to_declspace' may
18200 contain a `PartialContainer' for an interface, so check it's
18201 `Kind' to figure out what it is.
18203 2004-07-25 Martin Baulig <martin@ximian.com>
18205 * class.cs (Class.DefaultTypeAttributes): New public constant.
18206 (Struct.DefaultTypeAttributes): Likewise.
18207 (Interface.DefaultTypeAttributes): Likewise.
18208 (PartialContainer.TypeAttr): Override this and add the
18209 DefaultTypeAttributes.
18211 2004-07-25 Martin Baulig <martin@ximian.com>
18213 * decl.cs (DeclSpace.Emit): Removed the `TypeContainer' argument,
18214 we can just use the `Parent' field instead.
18216 2004-07-25 Martin Baulig <martin@ximian.com>
18218 * class.cs (TypeContainer.Emit): Renamed to EmitType().
18220 2004-07-25 Martin Baulig <martin@ximian.com>
18222 * class.cs (TypeContainer.DefineMembers): Call DefineMembers() on
18223 our parts before defining any methods.
18224 (TypeContainer.VerifyImplements): Make this virtual.
18225 (ClassPart.VerifyImplements): Override and call VerifyImplements()
18226 on our PartialContainer.
18228 2004-07-25 Martin Baulig <martin@ximian.com>
18230 * iterators.cs (Iterator.Define): Renamed to DefineIterator().
18232 * decl.cs (DeclSpace.Define): Removed the `TypeContainer'
18233 argument, we can just use the `Parent' field instead.
18236 (MemberBase.CheckBase): Removed the `TypeContainer' argument.
18237 (MemberBase.DoDefine): Likewise.
18239 2004-07-24 Martin Baulig <martin@ximian.com>
18241 * decl.cs (MemberCore.Parent): New public field.
18242 (DeclSpace.Parent): Moved to MemberCore.
18244 * class.cs (MethodCore.ds): Removed; use `Parent' instead.
18245 (MemberBase.ctor): Added TypeContainer argument, pass it to our
18247 (FieldBase, Field, Operator): Likewise.
18248 (EventProperty.ctor): Take a TypeContainer instead of a DeclSpace.
18249 (EventField, Event): Likewise.
18251 2004-07-23 Martin Baulig <martin@ximian.com>
18253 * class.cs (PartialContainer): New public class.
18254 (ClassPart): New public class.
18255 (TypeContainer): Added support for partial classes.
18256 (TypeContainer.GetClassBases): Splitted some of the functionality
18257 out into GetNormalBases() and GetPartialBases().
18259 * cs-tokenizer.cs (Token.PARTIAL): New token.
18260 (Tokenizer.consume_identifier): Added some hacks to recognize
18261 `partial', but only if it's immediately followed by `class',
18262 `struct' or `interface'.
18264 * cs-parser.jay: Added support for partial clases.
18266 2004-07-23 Martin Baulig <martin@ximian.com>
18268 * class.cs (MethodCore.ds): Made this a `TypeContainer' instead of
18269 a `DeclSpace' and also made it readonly.
18270 (MethodCore.ctor): Take a TypeContainer instead of a DeclSpace.
18271 (Method.ctor, Constructor.ctor, Destruktor.ctor): Likewise.
18272 (PropertyBase.ctor, Property.ctor, Indexer.ctor): Likewise.
18274 * cs-parser.jay: Pass the `current_class', not the
18275 `current_container' (at the moment, this is still the same thing)
18276 to a new Method, Property, Event, Indexer or Constructor.
18278 2004-07-23 Martin Baulig <martin@ximian.com>
18280 * cs-parser.jay (CSharpParser): Added a new `current_class' field
18281 and removed the `current_interface' one.
18282 (struct_declaration, class_declaration, interface_declaration):
18283 Set `current_class' to the newly created class/struct/interface;
18284 set their `Bases' and call Register() before parsing their body.
18286 2004-07-23 Martin Baulig <martin@ximian.com>
18288 * class.cs (Kind): New public enum.
18289 (TypeContainer): Made this class abstract.
18290 (TypeContainer.Kind): New public readonly field.
18291 (TypeContainer.CheckDef): New public method; moved here from
18293 (TypeContainer.Register): New public abstract method.
18294 (TypeContainer.GetPendingImplementations): New public abstract
18296 (TypeContainer.GetClassBases): Removed the `is_class' and
18297 `is_iface' parameters.
18298 (TypeContainer.DefineNestedTypes): Formerly known as
18300 (ClassOrStruct): Made this class abstract.
18302 * tree.cs (RootTypes): New public type.
18304 2004-07-20 Martin Baulig <martin@ximian.com>
18306 * tree.cs (Tree.RecordNamespace): Removed.
18307 (Tree.Namespaces): Removed.
18309 * rootcontext.cs (RootContext.IsNamespace): Removed.
18311 * cs-parser.jay (namespace_declaration): Just create a new
18312 NamespaceEntry here.
18314 2004-07-20 Martin Baulig <martin@ximian.com>
18316 * statement.cs (ExceptionStatement): New abstract class. This is
18317 now used as a base class for everyone who's using `finally'.
18318 (Using.ResolveLocalVariableDecls): Actually ResolveLValue() all
18319 our local variables before using them.
18321 * flowanalysis.cs (FlowBranching.StealFinallyClauses): New public
18322 virtual method. This is used by Yield.Resolve() to "steal" an
18323 outer block's `finally' clauses.
18324 (FlowBranchingException): The .ctor now takes an ExceptionStatement
18327 * codegen.cs (EmitContext.StartFlowBranching): Added overloaded
18328 version which takes an ExceptionStatement. This version must be
18329 used to create exception branchings.
18332 (Yield.Resolve): "Steal" all `finally' clauses from containing blocks.
18333 (Iterator.EmitMoveNext): Added exception support; protect the
18334 block with a `fault' clause, properly handle 'finally' clauses.
18335 (Iterator.EmitDispose): Run all the `finally' clauses here.
18337 2004-07-20 Martin Baulig <martin@ximian.com>
18339 * iterator.cs: This is the first of a set of changes in the
18340 iterator code. Match the spec more closely: if we're an
18341 IEnumerable, then GetEnumerator() must be called. The first time
18342 GetEnumerator() is called, it returns the current instance; all
18343 subsequent invocations (if any) must create a copy.
18345 2004-07-19 Miguel de Icaza <miguel@ximian.com>
18347 * expression.cs: Resolve the constant expression before returning
18350 2004-07-19 Martin Baulig <martin@ximian.com>
18352 * iterators.cs (Iterator.MapVariable): Don't define fields twice.
18353 (Iterator.MoveNextMethod.DoEmit): Use `TypeManager.int32_type' as
18354 the return type of the new EmitContext.
18356 2004-07-18 Martin Baulig <martin@ximian.com>
18358 * class.cs (Property.Define): Fix iterators.
18360 * iterators.cs (Iterator.Define): Moved the
18361 `container.AddInterator (this)' call here from the .ctor; only do
18362 it if we resolved successfully.
18364 2004-07-17 Miguel de Icaza <miguel@ximian.com>
18366 * cs-tokenizer.cs (handle_preprocessing_directive): Do not return
18367 `true' for preprocessing directives that we parse. The return
18368 value indicates whether we should return to regular tokenizing or
18369 not, not whether it was parsed successfully.
18371 In the past if we were in: #if false ... #line #endif, we would
18372 resume parsing after `#line'. See bug 61604.
18374 * typemanager.cs: Removed an old hack from Gonzalo to get corlib
18375 building: IsEnumType should return true only for enums, not for
18376 enums or System.Enum itself. This fixes #61593.
18378 Likely what happened is that corlib was wrong: mcs depended on
18379 this bug in some places. The bug got fixed, we had to add the
18380 hack, which caused bug 61593.
18382 * expression.cs (ArrayAccess.GetStoreOpCode): Remove an old hack
18383 that was a workaround for the older conditions.
18385 2004-07-16 Ben Maurer <bmaurer@ximian.com>
18387 * assign.cs: IAssignMethod has a new interface, as documented
18388 inline. All assignment code now uses this new api.
18390 * ecore.cs, expression.cs: All classes which implement
18391 IAssignMethod now use the new interface.
18393 * expression.cs (Invocation): add a hack to EmitCall so that
18394 IndexerAccess can be the target of a compound assignment without
18395 evaluating its arguments twice.
18397 * statement.cs: Handle changes in Invocation api.
18399 2004-07-16 Martin Baulig <martin@ximian.com>
18401 * iterators.cs: Rewrote this. We're now using one single Proxy
18402 class for both the IEnumerable and the IEnumerator interface and
18403 `Iterator' derives from Class so we can use the high-level API.
18405 * class.cs (TypeContainer.AddIterator): New method.
18406 (TypeContainer.DoDefineType): New protected virtual method, which
18407 is called from DefineType().
18408 (TypeContainer.DoDefineMembers): Call DefineType() and
18409 DefineMembers() on all our iterators.
18410 (TypeContainer.Emit): Call Emit() on all our iterators.
18411 (TypeContainer.CloseType): Call CloseType() on all our iterators.
18413 * codegen.cs (EmitContext.CurrentIterator): New public field.
18415 2004-07-15 Martin Baulig <martin@ximian.com>
18418 (TypeManager.not_supported_exception_type): New type.
18420 2004-07-14 Martin Baulig <martin@ximian.com>
18422 * iterators.cs: Use real error numbers.
18424 2004-07-14 Martin Baulig <martin@ximian.com>
18426 * iterator.cs (IteratorHandle.IsIEnumerable): The spec explicitly
18427 requires this to be a System.Collection.IEnumerable and not a
18428 class implementing that interface.
18429 (IteratorHandle.IsIEnumerator): Likewise, for IEnumerator.
18431 2004-07-13 Marek Safar <marek.safar@seznam.cz>
18433 * class.cs: Fixed previous fix, it broke some error tests.
18435 2004-07-12 Martin Baulig <martin@ximian.com>
18437 * enum.cs (Enum.Define): Call Emit() to emit the attributes.
18440 2004-07-09 Miguel de Icaza <miguel@ximian.com>
18442 * assign.cs (LocalTemporary): Add new argument: is_address,If
18443 `is_address' is true, then the value that we store is the address
18444 to the real value, and not the value itself.
18446 * ecore.cs (PropertyExpr): use the new local temporary
18447 stuff to allow us to handle X.Y += z (where X is a struct)
18449 2004-07-08 Martin Baulig <martin@ximian.com>
18451 * statement.cs (Lock.Resolve): Set ec.NeedReturnLabel() if we do
18452 not always return, just like we're doing in Using.Resolve().
18454 2004-07-07 Miguel de Icaza <miguel@ximian.com>
18456 * cs-parser.jay (fixed_statement): flag this as Pinned.
18458 2004-07-06 Miguel de Icaza <miguel@ximian.com>
18460 * typemanager.cs (TypeManager): Removed MakePinned method, this
18461 mechanism is replaced with the .NET 2.x compatible mechanism of
18462 calling `ILGenerator.DeclareLocal (Type t, bool pinned)'.
18464 * statement.cs (LocalInfo): Remove MakePinned, add Pinned property
18465 Rename `Fixed' to `Pinned' as a flag, to distinguish from the
18466 `IsFixed' property which has a different meaning.
18468 2004-07-02 Raja R Harinath <rharinath@novell.com>
18470 * ecore.cs (DoSimpleNameResolve): Expand CS0038 check to all names
18471 visible from inside a nested class, not just the names of the
18472 immediately enclosing class.
18473 Fix for bug #60730.
18475 2004-06-24 Raja R Harinath <rharinath@novell.com>
18477 * expression.cs (BetterConversion): Remove buggy special-case
18478 handling of "implicit constant expression conversions". At this
18479 point, we already know that the conversion is possible -- we're
18480 only checking to see which is better.
18482 2004-06-24 Marek Safar <marek.safar@seznam.cz>
18484 * cs-parser.jay: Added error CS0210 test.
18486 2004-06-24 Marek Safar <marek.safar@seznam.cz>
18488 * cs-parser.jay: Added error CS0134 test.
18490 2004-06-24 Marek Safar <marek.safar@seznam.cz>
18493 * cs-parser.jay: Added error CS0145 test.
18495 2004-06-24 Marek Safar <marek.safar@seznam.cz>
18497 * class.cs (Operator.Define): Added test for errors CS0553, CS0554.
18499 2004-06-23 Ben Maurer <bmaurer@ximian.com>
18501 * expression.cs (StackAlloc.Resolve): The argument may not
18502 be a constant; deal with this case.
18504 2004-06-23 Marek Safar <marek.safar@seznam.cz>
18506 * attribute.cs (IndexerName_GetIndexerName): Renamed to
18507 GetIndexerAttributeValue.
18508 (ScanForIndexerName): Renamed to GetIndexerNameAttribute.
18510 * class.cs (Indexer.Define): Added error tests for CS0415,
18513 2004-06-23 Miguel de Icaza <miguel@ximian.com>
18515 * attribute.cs (Attribute.Resolve): Keep field code in sync with
18518 2004-06-23 Martin Baulig <martin@ximian.com>
18520 * flowanalysis.cs (UsageVector.MergeChild): If we're a loop and we
18521 neither return nor throw, reset the barrier as well. Fixes #60457.
18523 2004-06-22 Atsushi Enomoto <atsushi@ximian.com>
18525 * class.cs : EventAttributes is now set to None by default.
18526 This fixes bug #60459.
18528 2004-06-18 Marek Safar <marek.safar@seznam.cz>
18531 * class.cs (ConstructorInitializer.GetOverloadedConstructor):
18532 Don't throw exception but return null (it's sufficient now).
18534 2004-06-18 Marek Safar <marek.safar@seznam.cz>
18536 * typemanager.cs (GetArgumentTypes): Faster implementation.
18538 2004-06-18 Martin Baulig <martin@ximian.com>
18540 * attribute.cs (Attribute.Resolve): Check whether we're an
18541 EmptyCast which a Constant child. Fixes #60333.
18543 2004-06-17 Ben Maurer <bmaurer@ximian.com>
18545 * statement.cs (EmitCollectionForeach): Account for the fact that
18546 not all valuetypes are in areas which we can take the address of.
18547 For these variables, we store to a temporary variable. Also, make
18548 sure that we dont emit a `callvirt' on a valuetype method.
18550 2004-06-15 Marek Safar <marek.safar@seznam.cz>
18552 * expression.cs (StackAlloc.DoReSolve): Added test for
18553 negative parameter (CS0247).
18555 2004-06-15 Marek Safar <marek.safar@seznam.cz>
18558 * class.cs: (Event.DelegateMethod.Emit): Added synchronization flag.
18560 2004-06-15 Marek Safar <marek.safar@seznam.cz>
18563 * expression.cs: (Binary.DoNumericPromotions): Added conversion for
18566 2004-06-14 Marek Safar <marek.safar@seznam.cz>
18568 Fix bug #58254 & cs1555.cs, cs1556.cs
18569 * driver.cs (MainDriver): Added tests for errors CS1555, CS1556.
18571 2004-06-14 Marek Safar <marek.safar@seznam.cz>
18573 * cs-parser.jay: Added error CS1669 test for indexers.
18575 2004-06-11 Martin Baulig <martin@ximian.com>
18577 * expression.cs (Invocation.IsParamsMethodApplicable): We need to
18578 call this twice: for params and varargs methods.
18580 2004-06-11 Marek Safar <marek.safar@seznam.cz>
18583 (FieldBase.DoDefine, PropertyBase.DoDefine): Added error test CS0610.
18585 2004-06-11 Marek Safar <marek.safar@seznam.cz>
18587 * attribute.cs (Attribute.GetValidTargets): Made public.
18590 (AbstractPropertyEventMethod): New class for better code sharing.
18591 (AbstractPropertyEventMethod.ApplyAttributeBuilder): Add error
18593 (PropertyMethod, DelegateMethod): Derived from AbstractPropertyEventMethod
18595 2004-06-11 Raja R Harinath <rharinath@novell.com>
18598 * ecore.cs (ResolveFlags): Add new 'Intermediate' flag to tell
18599 that the call to Resolve is part of a MemberAccess.
18600 (Expression.Resolve): Use it for SimpleName resolution.
18601 (SimpleName.SimpleNameResolve, SimpleName.DoResolveAllowStatic):
18602 Add 'intermediate' boolean argument.
18603 (SimpleName.DoSimpleNameResolve): Likewise. Use it to disable an
18604 error message when the SimpleName can be resolved ambiguously
18605 between an expression and a type.
18606 * expression.cs (MemberAccess.IdenticalNameAndTypeName): Make
18608 (MemberAccess.Resolve): Pass 'Intermediate' flag to the Resolve()
18609 call on the left-side.
18611 2004-06-11 Marek Safar <marek.safar@seznam.cz>
18614 (MethodCore.VerifyClsCompliance): Added test for error CS3000.
18616 2004-06-11 Marek Safar <marek.safar@seznam.cz>
18618 * attribute.cs (Attribute.Emit): Fixed error CS0579 reporting.
18620 2004-06-11 Martin Baulig <martin@ximian.com>
18622 * expression.cs (Invocation.EmitCall): Use OpCodes.Callvirt for
18623 varargs methods if applicable.
18625 2004-06-11 Martin Baulig <martin@ximian.com>
18627 * expression.cs (Invocation.EmitCall): Don't use
18628 `method.CallingConvention == CallingConventions.VarArgs' since the
18629 method could also have `CallingConventions.HasThis'.
18631 2004-06-11 Marek Safar <marek.safar@seznam.cz>
18633 * class.cs (Event.GetSignatureForError): Implemented.
18634 Fixed crash in error test cs3010.cs
18636 2004-06-10 Miguel de Icaza <miguel@ximian.com>
18638 * cs-tokenizer.cs: Change the way we track __arglist to be
18639 consistent with the other keywords.
18641 2004-06-09 Miguel de Icaza <miguel@ximian.com>
18643 * codegen.cs: FAQ avoider: turn 1577 into a warning for now until
18646 2004-06-09 Sebastien Pouliot <sebastien@ximian.com>
18648 * codegen.cs: Check that all referenced assemblies have a strongname
18649 before strongnaming the compiled assembly. If not report error CS1577.
18650 Fix bug #56563. Patch by Jackson Harper.
18651 * typemanager.cs: Added a method to return all referenced assemblies.
18652 Fix bug #56563. Patch by Jackson Harper.
18654 2004-06-08 Marek Safar <marek.safar@seznam.cz>
18657 (Method.ApplyAttributeBuilder): Moved and added conditional
18658 attribute error tests (CS0577, CS0578, CS0243, CS0582, CS0629).
18661 (DelegateCreation.ResolveMethodGroupExpr): Added error CS1618 test.
18663 2004-06-08 Marek Safar <marek.safar@seznam.cz>
18666 * class.cs: (EventField.attribute_targets): Changed default target.
18668 2004-06-08 Martin Baulig <martin@ximian.com>
18670 * expression.cs (Invocation.EmitCall): Enable varargs methods.
18672 2004-06-08 Martin Baulig <martin@ximian.com>
18674 * rootcontext.cs (ResolveCore): Added "System.RuntimeArgumentHandle".
18676 2004-06-07 Martin Baulig <martin@ximian.com>
18678 Added support for varargs methods.
18680 * cs-tokenizer.cs (Token.ARGLIST): New token for the `__arglist'
18683 * cs-parser.jay: Added support for `__arglist'.
18685 * decl.cs (MemberCache.AddMethods): Don't ignore varargs methods.
18687 * expression.cs (Argument.AType): Added `ArgList'.
18688 (Invocation): Added support for varargs methods.
18689 (ArglistAccess): New public class.
18690 (Arglist): New public class.
18692 * parameter.cs (Parameter.Modifier): Added `ARGLIST'.
18694 * statement.cs (Block.Flags): Added `HasVarargs'. We set this on
18695 a method's top-level block if the method has varargs.
18697 * support.cs (ReflectionParameters, InternalParameters): Added
18698 support for varargs methods.
18700 2004-06-07 Miguel de Icaza <miguel@ximian.com>
18702 * class.cs: Provide location in indexer error report.
18704 * driver.cs: Use standard names.
18706 * namespace.cs: Catch the use of using after a namespace has been
18707 declared also on using aliases.
18709 2004-06-03 Raja R Harinath <rharinath@novell.com>
18712 * typemanager.cs (closure_private_ok, closure_invocation_type)
18713 (closure_qualifier_type, closure_invocation_assembly)
18714 (FilterWithClosure): Move to ...
18715 (Closure): New internal nested class.
18716 (Closure.CheckValidFamilyAccess): Split out from Closure.Filter.
18717 (MemberLookup, RealMemberLookup): Add new almost_match parameter.
18718 * ecore.cs (almostMatchedMembers): New variable to help report CS1540.
18719 (MemberLookup, MemberLookupFailed): Use it.
18720 * expression.cs (New.DoResolve): Treat the lookup for the
18721 constructor as being qualified by the 'new'ed type.
18722 (Indexers.GetIndexersForTypeOrInterface): Update.
18724 2004-06-03 Marek Safar <marek.safar@seznam.cz>
18727 (GetConditionalAttributeValue): New method. Returns
18728 condition of ConditionalAttribute.
18729 (SearchMulti): New method. Returns all attributes of type 't'.
18730 Use it when attribute is AllowMultiple = true.
18731 (IsConditionalMethodExcluded): New method.
18734 (Method.IsExcluded): Implemented. Returns true if method has conditional
18735 attribute and the conditions is not defined (method is excluded).
18736 (IMethodData): Extended interface for ConditionalAttribute support.
18737 (PropertyMethod.IsExcluded): Implemented.
18740 (MemberCore.Flags): Excluded_Undetected, Excluded new caching flags.
18743 (Invocation.IsMethodExcluded): Checks the ConditionalAttribute
18746 2004-06-02 Ben Maurer <bmaurer@users.sourceforge.net>
18748 * expression.cs (ArrayCreationExpression): Make this just an
18749 `expression'. It can't be a statement, so the code here was
18752 2004-06-02 Marek Safar <marek.safar@seznam.cz>
18755 * typemanager.cs (GetFullNameSignature): New method for
18758 2004-06-02 Marek Safar <marek.safar@seznam.cz>
18761 * class.cs (MemberBase.GetSignatureForError): New virtual method.
18762 Use this method when MethodBuilder is null.
18763 (MethodData.DefineMethodBuilder): Encapsulated code to the new method.
18764 Added test for error CS0626 (MONO reports error for this situation).
18765 (IMethodData.GetSignatureForError): Extended interface.
18767 2004-06-01 Marek Safar <marek.safar@seznam.cz>
18770 (AttributeTester.GetObsoleteAttribute): Returns instance of
18771 ObsoleteAttribute when type is obsolete.
18774 (TypeContainer.VerifyObsoleteAttribute): Override.
18775 (Method.GetSignatureForError): New method for usage when MethodBuilder is null.
18776 (MethodCode.VerifyObsoleteAttribute): Override.
18777 (MemberBase.VerifyObsoleteAttribute): Override.
18780 (MemberCore.CheckUsageOfObsoleteAttribute): Tests presence of ObsoleteAttribute
18781 and report proper error.
18784 Delegate.VerifyObsoleteAttribute): Override.
18787 (Expression.CheckObsoleteAttribute): Tests presence of ObsoleteAttribute
18788 and report proper error.
18789 (FieldExpr.DoResolve): Added tests for ObsoleteAttribute.
18792 (Enum.GetObsoleteAttribute): Returns ObsoleteAttribute for both enum type
18796 (Probe.DoResolve, Cast.DoResolve, LocalVariableReference.DoResolve,
18797 New.DoResolve, SizeOf.DoResolve, TypeOf.DoResolce, MemberAccess.DoResolve):
18798 Added test for ObsoleteAttribute.
18801 (Catch): Derived from Statement.
18803 2004-06-01 Marek Safar <marek.safar@seznam.cz>
18805 Fixed bug #59071 & cs0160.cs
18807 * statement.cs (Try.Resolve): Check here whether order of catch
18808 clauses matches their dependencies.
18810 2004-05-31 Miguel de Icaza <miguel@ximian.com>
18812 * Reverted patch to namespace.cs (Use lookuptypedirect). This
18813 caused a regression: #59343. Referencing nested classes from an
18814 assembly stopped working.
18816 2004-05-31 Martin Baulig <martin@ximian.com>
18818 MCS is now frozen for beta 2.
18820 2004-05-30 Ben Maurer <bmaurer@users.sourceforge.net>
18822 * convert.cs: add a trivial cache for overload operator resolution.
18824 2004-05-30 Ben Maurer <bmaurer@users.sourceforge.net>
18826 * decl.cs: If possible, use lookuptypedirect here. We can only do
18827 this if there is no `.' after the namespace. Avoids using
18828 LookupType, which does lots of slow processing.
18829 (FindNestedType) New method, does what it says :-).
18830 * namespace.cs: use LookupTypeDirect.
18831 * rootcontext.cs: use membercache, if possible.
18832 * typemanager.cs (LookupTypeDirect): Cache negative hits too.
18834 2004-05-30 Ben Maurer <bmaurer@users.sourceforge.net>
18837 According to the spec,
18839 In a member access of the form E.I, if E is a single identifier,
18840 and if the meaning of E as a simple-name (§7.5.2) is a constant,
18841 field, property, localvariable, or parameter with the same type as
18842 the meaning of E as a type-name (§3.8), then both possible
18843 meanings of E are permitted.
18845 We did not check that E as a simple-name had the same type as E as
18848 This trivial check gives us 5-7% on bootstrap time.
18850 2004-05-30 Ben Maurer <bmaurer@users.sourceforge.net>
18852 * expression.cs (Invocation.OverloadResolve): Avoid the
18853 use of hashtables and boxing here by allocating on demand.
18855 2004-05-30 Martin Baulig <martin@ximian.com>
18857 * rootcontext.cs (RootContext.LookupType): Don't cache things if
18858 we're doing a silent lookup. Don't try to lookup nested types in
18859 TypeManager.object_type (thanks to Ben Maurer).
18861 2004-05-30 Martin Baulig <martin@ximian.com>
18863 Committing a patch from Ben Maurer.
18865 * rootcontext.cs (RootContext.LookupType): Cache negative results.
18867 2004-05-29 Martin Baulig <martin@ximian.com>
18869 * class.cs (IMethodData.ShouldIgnore): New method.
18871 * typemanager.cs (TypeManager.MethodFlags): Don't take a
18872 `Location' argument, we don't need it anywhere. Use
18873 `IMethodData.ShouldIgnore ()' instead of
18874 `MethodData.GetMethodFlags ()'.
18875 (TypeManager.AddMethod): Removed.
18876 (TypeManager.AddMethod2): Renamed to AddMethod.
18878 2004-05-29 Martin Baulig <martin@ximian.com>
18880 Committing a patch from Benjamin Jemlich <pcgod@gmx.net>.
18882 * convert.cs (Convert.ImplicitReferenceConversion): If we're
18883 converting from a class type S to an interface type and we already
18884 have an object on the stack, don't box it again. Fixes #52578.
18886 2004-05-29 Martin Baulig <martin@ximian.com>
18888 * class.cs (ConstructorInitializer.GetOverloadedConstructor):
18889 Added support for `params' parameters. Fixes #59267.
18891 2004-05-29 Martin Baulig <martin@ximian.com>
18893 * literal.cs (NullPointer): Provide a private .ctor which sets
18894 `type' to TypeManager.object_type. Fixes #59048.
18896 2004-05-29 Martin Baulig <martin@ximian.com>
18898 * expression.cs (MemberAccess.ResolveMemberAccess): If we're an
18899 EventExpr, set `ee.InstanceExpression = left'. Fixes #59188.
18901 * ecore.cs (EventExpr.instance_expr): Make the field private.
18903 2004-05-26 Marek Safar <marek.safar@seznam.cz>
18905 Fixed bug #50080 & cs0214-2.cs
18906 * expression.cs (Cast.DoResolve): Check unsafe context here.
18908 * statement.cs (Resolve.DoResolve): Likewise.
18910 2004-05-26 Martin Baulig <martin@ximian.com>
18912 * namespace.cs (NamespaceEntry.Lookup): Added `bool silent'.
18914 * rootcontext.cs (RootContext.NamespaceLookup): Added `bool silent'.
18915 (RootContext.LookupType): Pass down the `silent' flag.
18917 2004-05-25 Martin Baulig <martin@ximian.com>
18920 (MethodGroupExpr.IdenticalTypeName): New public property.
18921 (Invocation.DoResolve): Don't report a CS0176 if the "instance"
18922 expression actually refers to a type.
18924 2004-05-25 Martin Baulig <martin@ximian.com>
18926 * expression.cs (Invocation.DoResolve): Applied Ben Maurer's patch
18927 for #56176 and made it actually work.
18929 2004-05-25 Martin Baulig <martin@ximian.com>
18931 * ecore.cs (Expression.CacheTemporaries): Make this virtual.
18932 (FieldExpr, PropertyExpr): Override and implement
18933 CacheTemporaries. Fixes #52279.
18935 2004-05-25 Miguel de Icaza <miguel@ximian.com>
18937 * location.cs: In the new compiler listing a file twice is a
18938 warning, not an error.
18940 2004-05-24 Martin Baulig <martin@ximian.com>
18942 * enum.cs (Enum.DefineType): For the `BaseType' to be a
18943 TypeLookupExpression; otherwise, report a CS1008. Fixes #58571.
18945 2004-05-24 Martin Baulig <martin@ximian.com>
18947 * decl.cs (DeclSpace.FindType): Try doing an alias lookup before
18948 walking the `using' list. Fixes #53921.
18950 2004-05-24 Martin Baulig <martin@ximian.com>
18952 * const.cs (Const.LookupConstantValue): Added support for
18953 EmptyCast's; fixes #55251.
18955 2004-05-24 Martin Baulig <martin@ximian.com>
18957 * ecore.cs (SimpleName.SimpleNameResolve): Renamed to
18958 DoSimpleNameResolve() and provide a SimpleNameResolve() wrapper
18959 which does the CS0135 check. The reason is that we first need to
18960 check whether the variable actually exists.
18962 2004-05-24 Martin Baulig <martin@ximian.com>
18964 * class.cs (MemberBase.DoDefine): Use DeclSpace.FindType() rather
18965 than RootContext.LookupType() to find the explicit interface
18966 type. Fixes #58584.
18968 2004-05-24 Raja R Harinath <rharinath@novell.com>
18970 * Makefile: Simplify. Use executable.make.
18971 * mcs.exe.sources: New file. List of sources of mcs.exe.
18973 2004-05-24 Anders Carlsson <andersca@gnome.org>
18977 Use the invariant culture when doing String.Compare for CLS case
18980 2004-05-23 Martin Baulig <martin@ximian.com>
18982 * decl.cs (DeclSpace.FindType): Only check the `using' list if we
18983 don't have any dots. Fixes #52622, added cs0246-8.cs.
18985 * namespace.cs (NamespaceEntry.Lookup): Likewise.
18987 2004-05-23 Marek Safar <marek.safar@seznam.cz>
18989 * class.cs (MemberBase.Define): Reuse MemberType member for
18990 resolved type. Other methods can use it too.
18992 2004-05-23 Martin Baulig <martin@ximian.com>
18994 * ecore.cs (SimpleName.SimpleNameResolve): Only report a CS0135 if
18995 the variable also exists in the current block (otherwise, we need
18996 to report a CS0103). Fixes #58670.
18998 2004-05-23 Martin Baulig <martin@ximian.com>
19000 * flowanalysis.cs (Reachability.Reachable): Compute this
19001 on-the-fly rather than storing it as a field.
19003 2004-05-23 Martin Baulig <martin@ximian.com>
19005 * flowanalysis.cs (Reachability.And): Manually compute the
19006 resulting `barrier' from the reachability.
19008 2004-05-23 Marek Safar <marek.safar@seznam.cz>
19011 * attribute.cs (AttributeTester.GetMethodObsoleteAttribute): Returns
19012 instance of ObsoleteAttribute when symbol is obsolete.
19015 (IMethodData): Extended interface for ObsoleteAttribute support.
19017 2004-05-22 Marek Safar <marek.safar@seznam.cz>
19019 * attribute.cs: Fix bug #55970
19021 2004-05-22 Marek Safar <marek.safar@seznam.cz>
19025 (GetObsoleteAttribute): New method. Creates the instance of
19027 (AttributeTester.GetMemberObsoleteAttribute): Returns instance of
19028 ObsoleteAttribute when member is obsolete.
19029 (AttributeTester.Report_ObsoleteMessage): Common method for
19030 Obsolete error/warning reporting.
19033 (TypeContainer.base_classs_type): New member for storing parent type.
19036 (MemberCore.GetObsoleteAttribute): Returns instance of ObsoleteAttribute
19037 for this MemberCore.
19039 2004-05-21 Marek Safar <marek.safar@seznam.cz>
19041 * attribute.cs, const.cs: Fix bug #58590
19043 2004-05-21 Martin Baulig <martin@ximian.com>
19045 * flowanalysis.cs (FlowBranching.MergeTopBlock): Don't check for
19046 out parameters if the end of the method is unreachable. Fixes
19049 2004-05-21 Marek Safar <marek.safar@seznam.cz>
19051 * codegen.cs, cs-parser.jay: Removed SetAttributes method.
19052 Hari was right, why extra method.
19054 2004-05-21 Marek Safar <marek.safar@seznam.cz>
19056 * attribute.cs, cs-parser.jay: Fix errors/cs0579-7.cs.
19058 2004-05-20 Martin Baulig <martin@ximian.com>
19060 Merged this back from gmcs to keep the differences to a minumum.
19062 * attribute.cs (Attribute.CheckAttributeType): Take an EmitContext
19063 instead of a Declspace.
19064 (Attribute.ResolveType): Likewise.
19065 (Attributes.Search): Likewise.
19066 (Attributes.Contains): Likewise.
19067 (Attributes.GetClsCompliantAttribute): Likewise.
19069 * class.cs (TypeContainer.VerifyMembers): Added EmitContext
19071 (MethodData.ApplyAttributes): Take an EmitContext instead of a
19074 2004-05-19 Marek Safar <marek.safar@seznam.cz>
19076 Fix bug #58688 (MCS does not report error when the same attribute
19079 * attribute.cs (Attribute.Emit): Distinction between null and default.
19081 2004-05-19 Raja R Harinath <rharinath@novell.com>
19083 * cs-parser.jay (attribute): Create a GlobalAttribute for the case
19084 of a top-level attribute without an attribute target.
19085 * attribute.cs (Attribute.Error_AttributeConstructorMismatch):
19087 (Attribute.Conditional_GetConditionName),
19088 (Attribute.Obsolete_GetObsoleteMessage): Update.
19089 (Attribute.IndexerName_GetIndexerName): New. Attribute-specific
19090 part of ScanForIndexerName.
19091 (Attribute.CanIgnoreInvalidAttribute): New function.
19092 (Attribute.ScanForIndexerName): Move to ...
19093 (Attributes.ScanForIndexerName): ... here.
19094 (Attributes.Attrs): Rename from now-misnamed AttributeSections.
19095 (Attributes.Search): New internal variant that can choose not to
19096 complain if types aren't resolved. The original signature now
19098 (Attributes.GetClsCompliantAttribute): Use internal variant, with
19099 complaints suppressed.
19100 (GlobalAttribute.CheckAttributeType): Overwrite ds.NamespaceEntry
19101 only if it not useful.
19102 (CanIgnoreInvalidAttribute): Ignore assembly attribute errors at
19103 top-level for attributes that are shared between the assembly
19104 and a top-level class.
19105 * parameter.cs (ImplicitParameter): Rename from ParameterAtribute.
19106 * class.cs: Update to reflect changes.
19107 (DefineIndexers): Fuse loops.
19108 * codegen.cs (GetAssemblyName): Update to reflect changes. Accept
19109 a couple more variants of attribute names.
19111 2004-05-18 Marek Safar <marek.safar@seznam.cz>
19113 Fix bug #52585 (Implemented explicit attribute declaration)
19116 (Attributable.ValidAttributeTargets): New abstract method. It gets
19117 list of valid attribute targets for explicit target declaration.
19118 (Attribute.Target): It holds target itself.
19119 (AttributeSection): Removed.
19120 (Attribute.CheckTargets): New method. It checks whether attribute
19121 target is valid for the current element.
19124 (EventProperty): New class. For events that are declared like
19125 property (with add and remove accessors).
19126 (EventField): New class. For events that are declared like field.
19129 * cs-parser.jay: Implemented explicit attribute target declaration.
19131 * class.cs, decl.cs, delegate.cs, enum.cs, parameter.cs:
19132 Override ValidAttributeTargets.
19135 (ReturnParameter): Class for applying custom attributes on
19137 (ParameterAtribute): New class. Class for applying custom
19138 attributes on the parameter type.
19140 2004-05-17 Miguel de Icaza <miguel@ximian.com>
19142 * class.cs (MemberBase.DoDefine): Pass UNSAFE on interface
19145 (Method): Allow UNSAFE here.
19147 * modifiers.cs: Support unsafe reporting.
19149 2004-05-17 Marek Safar <marek.safar@seznam.cz>
19151 * decl.cs: Fix bug #58478.
19153 2004-05-17 Gonzalo Paniagua Javier <gonzalo@ximian.com>
19155 * statement.cs: When checking for unreachable code on an EmptyStatement,
19156 set the location. Fixes bug #58488.
19158 2004-05-13 Miguel de Icaza <miguel@ximian.com>
19160 * driver.cs: Add -pkg handling.
19162 From Gonzalo: UseShelLExecute=false
19164 2004-05-12 Marek Safar <marek.safar@seznam.cz>
19167 (Attribute.GetAttributeTargets): New method. Gets AttributeTargets
19169 (Attribute.IsClsCompliaceRequired): Moved to base for better
19171 (Attribute.UsageAttribute): New property for AttributeUsageAttribute
19172 when attribute is AttributeUsageAttribute.
19173 (Attribute.GetValidTargets): Simplified.
19174 (Attribute.GetAttributeUsage): New method returns AttributeUsage
19175 attribute for this type.
19176 (Attribute.ApplyAttributes): Method renamed to Emit and make
19178 (GlobalAttributeSection): New class for special handling of global
19179 attributes (assembly, module).
19180 (AttributeSection.Emit): New method.
19182 * class.cs: Implemented Attributable abstract methods.
19183 (MethodCore.LabelParameters): Moved to Parameter class.
19184 (Accessor): Is back simple class.
19185 (PropertyMethod): Implemented Attributable abstract class.
19186 (DelegateMethod): Implemented Attributable abstract class.
19187 (Event): New constructor for disctintion between normal Event
19188 and Event with accessors.
19190 * cs-parser.jay: Used new Event ctor and GlobalAttributeSection.
19192 * codegen.cs, const.cs, decl.cs, delegate.cs:
19193 (CommonAssemblyModulClass): Implemented Attributable abstract class
19196 * enum.cs: Implement IAttributeSupport interface.
19197 (EnumMember): New class for emum members. Implemented Attributable
19201 (ParameterBase): Is abstract.
19202 (ReturnParameter): New class for easier [return:] attribute handling.
19204 * typemanager.cs: Removed builder_to_attr.
19206 2004-05-11 Raja R Harinath <rharinath@novell.com>
19209 * attribute.cs (Attribute.GetPositionalValue): New function.
19210 * class.cs (TypeContainer.VerifyMembers): New function.
19211 (TypeContainer.Emit): Use it.
19212 (ClassOrStruct): New base class for Class and Struct.
19213 (ClassOrStruct.ApplyAttributeBuilder): New function. Note if
19214 StructLayout(LayoutKind.Explicit) was ascribed to the struct or
19216 (ClassOrStruct.VerifyMembers): If the struct is explicitly laid out,
19217 then each non-static field should have a FieldOffset attribute.
19218 Otherwise, none of the fields should have a FieldOffset attribute.
19219 * rootcontext.cs (RootContext.ResolveCore): Resolve StructLayout
19220 and FieldOffset attributes.
19221 * typemanager.cs (TypeManager.struct_layout_attribute_type)
19222 (TypeManager.field_offset_attribute_type): New core types.
19223 (TypeManager.InitCoreTypes): Initialize them.
19225 2004-05-11 Michal Moskal <malekith@pld-linux.org>
19227 * class.cs (Event.RemoveDelegateMethod.DelegateMethodInfo):
19228 Return correct type.
19231 2004-05-09 Miguel de Icaza <miguel@ximian.com>
19233 * expression.cs (Binary.DoNumericPromotions): 0 long constant can
19234 be implicitly converted to ulong.
19236 * expression.cs: The logic for allowing operator &, | and ^ worked
19237 was wrong, it worked before because we did not report an error in
19238 an else branch. Fixes 57895.
19240 * class.cs: Applied patch from iain@mccoy.id.au Iain McCoy to
19241 allow volatile fields to be reference types.
19243 2004-05-07 Miguel de Icaza <miguel@ximian.com>
19245 * driver.cs: Add support for /debug-
19247 2004-05-07 Raja R Harinath <rharinath@novell.com>
19249 * attribute.cs (Attribute.CheckAttributeType, Attribute.ResolveType):
19250 Add a 'complain' parameter to silence errors.
19251 (Attribute.Resolve): Update to changes. Put in sanity check to catch
19252 silently overlooked type-resolutions.
19253 (Attribute.ScanForIndexerName, Attribute.DefinePInvokeMethod): Update
19254 to reflect changes.
19255 (Attributes.Search): New function.
19256 (Attributes.Contains, Attributes.GetClsCompliantAttribute): Use Search.
19257 (Attributes.GetAttributeFullName): Remove hack.
19258 * class.cs (MethodCore.LabelParameters, MethodData.ApplyAttributes):
19259 Update to reflect changes.
19260 * codegen.cs (CommonAssemblyModulClass.GetClsCompliantAttribute):
19261 Use Attributes.Search instead of nested loops.
19263 2004-05-07 Marek Safar <marek.safar@seznam.cz>
19266 (MemberCore.Flags): Extended for caching presence of CLSCompliantAttribute.
19267 (MemberCore.VerifyClsCompliance): Implemented CS3019 error report.
19268 (DeclSpace.GetClsCompliantAttributeValue): Returns simple bool.
19270 * report.cs: (Report.Warning): Renamed to Warning_T because of
19271 parameter collision.
19273 2004-05-05 Raja R Harinath <rharinath@novell.com>
19275 * expression.cs (MemberAccess.ResolveMemberAccess):
19276 Exit with non-zero status after Report.Error.
19277 * rootcontext.cs (RootContext.BootstrapCorlib_ResolveDelegate):
19279 * typemanager.cs (TypeManager.CoreLookupType): Likewise.
19281 2004-05-04 Lluis Sanchez Gual <lluis@ximian.com>
19283 * support.cs: Don't hang when the file is empty.
19285 2004-05-04 Lluis Sanchez Gual <lluis@ximian.com>
19287 * support.cs: In SeekableStreamReader, compute the preamble size of the
19288 underlying stream. Position changes should take into account that initial
19291 2004-05-03 Todd Berman <tberman@sevenl.net>
19293 * driver.cs: remove unused GetSysVersion function.
19295 2004-05-03 Todd Berman <tberman@sevenl.net>
19297 * driver.cs: Remove the hack from saturday, as well as the hack
19298 from jackson (LoadAssemblyFromGac), also adds the CWD to the
19299 link_paths to get that bit proper.
19301 2004-05-01 Todd Berman <tberman@sevenl.net>
19303 * driver.cs: Try a LoadFrom before a Load, this checks the current
19304 path. This is currently a bug in mono that is be fixed, however, this
19305 provides a workaround for now. This will be removed when the bug
19308 2004-05-01 Sebastien Pouliot <sebastien@ximian.com>
19310 * CryptoConvert.cs: Updated to latest version. Fix issue with
19311 incomplete key pairs (#57941).
19313 2004-05-01 Todd Berman <tberman@sevenl.net>
19315 * driver.cs: Remove '.' from path_chars, now System.* loads properly
19318 2004-04-30 Jackson Harper <jackson@ximian.com>
19320 * codegen.cs: Open keys readonly.
19322 2004-04-30 Gonzalo Paniagua Javier <gonzalo@ximian.com>
19324 * typemanager.cs: don't report cyclic struct layout when a struct
19325 contains 2 or more fields of the same type. Failed for Pango.AttrShape
19326 which has 2 Pango.Rectangle fields.
19328 2004-04-29 Ben Maurer <bmaurer@users.sourceforge.net>
19330 * expression.cs: Handle IntPtr comparisons with IL code
19331 rather than a method call.
19333 2004-04-29 Martin Baulig <martin@ximian.com>
19335 * ecore.cs (PropertyExpr.FindAccessor): New private method. Walk
19336 the list of PropertyInfo's in class hierarchy and find the
19337 accessor. Fixes #56013.
19339 2004-04-29 Martin Baulig <martin@ximian.com>
19341 * typemanager.cs (TypeManager.CheckStructCycles): Fixed.
19343 2004-04-29 Martin Baulig <martin@ximian.com>
19345 Applying a patch from Benjamin Jemlich <pcgod@gmx.net>.
19347 * ecore.cs (FieldExpr.AddressOf): Make this work for valuetypes.
19349 2004-04-29 Martin Baulig <martin@ximian.com>
19351 * class.cs (ConstructorInitializer.Resolve): Check whether the
19352 parent .ctor is accessible. Fixes #52146.
19354 2004-04-29 Martin Baulig <martin@ximian.com>
19356 Applying a patch from Benjamin Jemlich <pcgod@gmx.net>.
19358 * statement.cs (Using.EmitLocalVariableDecls): Use
19359 TypeManager.idisposable_type, not typeof (IDisposable).
19360 (Foreach.EmitCollectionForeach): Added support for valuetypes.
19362 2004-04-29 Martin Baulig <martin@ximian.com>
19364 * class.cs (Event.Define): Don't emit the field and don't set
19365 RTSpecialName and SpecialName for events on interfaces. Fixes
19368 2004-04-29 Raja R Harinath <rharinath@novell.com>
19370 Refactor Attribute.ApplyAttributes.
19371 * attribute.cs (Attributable): New base class for objects that can
19372 have Attributes applied on them.
19373 (Attribute): Make AttributeUsage fields public.
19374 (Attribute.GetFieldValue, Attribute.GetMarshal): Make non-static.
19375 (Attribute.IsInternalCall): New property.
19376 (Attribute.UsageAttr): Convert to a public read-only property.
19377 (Attribute.CheckAttributeType): Use a DeclSpace, not an EmitContext.
19378 (Attribute.ResolveType, Attribute.Resolve)
19379 (Attribute.ScanForIndexerName): Update to reflect changes.
19380 (Attribute.CheckAttributeTarget): Re-format.
19381 (Attribute.ApplyAttributes): Refactor, to various
19382 Attributable.ApplyAttributeBuilder methods.
19383 * decl.cs (MemberCore): Make Attributable.
19384 * class.cs (Accessor): Make Attributable.
19385 (MethodData.ApplyAttributes): Use proper attribute types, not
19387 (TypeContainer.LabelParameters): Pass Parameter to ApplyAttributes.
19388 (TypeContainer.ApplyAttributeBuilder)
19389 (Method.ApplyAttributeBuilder, Constructor.ApplyAttributeBuilder)
19390 (Field.ApplyAttributeBuilder, Accessor.ApplyAttributeBuilder)
19391 (PropertyBase.ApplyAttributeBuilder, Event.ApplyAttributeBuilder)
19392 (Operator.ApplyAttributeBuilder): New factored-out methods.
19393 * const.cs (Const.ApplyAttributeBuilder): Likewise.
19394 * delegate.cs (Delegate.ApplyAttributeBuilder): Likewise.
19395 * enum.cs (Enum.ApplyAttributeBuilder): Likewise.
19396 * parameter.cs (ParameterBase): New Attributable base class
19397 that can also represent Return types.
19398 (Parameter): Update to the changes.
19400 2004-04-29 Jackson Harper <jackson@ximian.com>
19402 * driver.cs: Prefer the corlib system version when looking for
19403 assemblies in the GAC. This is still a hack, but its a better hack
19406 2004-04-29 Marek Safar <marek.safar@seznam.cz>
19408 * decl.cs, enum.cs: Improved error 3005 reporting.
19410 * report.cs (SymbolRelatedToPreviousError): New method for error reporting.
19411 (related_symbols): New private member for list of symbols
19412 related to reported error/warning.
19414 * tree.cs: Do not use now obsolete Report.LocationOfPreviousError.
19416 2004-04-29 Martin Baulig <martin@ximian.com>
19418 * ecore.cs (Expression.Constantify): If we're an enum and
19419 TypeManager.TypeToCoreType() doesn't give us another type, use
19420 t.UnderlyingSystemType. Fixes #56178.
19422 2004-04-29 Martin Baulig <martin@ximian.com>
19424 * decl.cs (MemberCache.SetupCacheForInterface): Look over all our
19425 interfaces and for each interface, only add members directly
19426 declared in that interface. Fixes #53255.
19428 2004-04-28 Martin Baulig <martin@ximian.com>
19430 * expression.cs (ConditionalLogicalOperator): Use a temporary
19431 variable for `left' to avoid that we evaluate it more than once;
19434 2004-04-28 Martin Baulig <martin@ximian.com>
19436 * expression.cs (ComposedCast.DoResolveAsTypeStep): Don't allow
19439 2004-04-28 Martin Baulig <martin@ximian.com>
19441 * statement.cs (LocalInfo.Resolve): Check whether the type is not
19444 * class.cs (MemberBase.CheckParameters, FieldBase.DoDefine): Check
19445 whether the type is not void (CS1547).
19447 2004-04-28 Martin Baulig <martin@ximian.com>
19449 * expression.cs (Unary.DoResolveLValue): Override this and report
19450 CS0131 for anything but Operator.Indirection.
19452 2004-04-28 Martin Baulig <martin@ximian.com>
19454 Committing a patch from Ben Maurer; see bug #50820.
19456 * typemanager.cs (TypeManager.FilterWithClosure): Added CS1540
19459 * ecore.cs (Expression.MemberLookupFailed): Added CS1540 check for
19462 2004-04-28 Martin Baulig <martin@ximian.com>
19464 Committing a patch from Ben Maurer; see bug #50820.
19466 * typemanager.cs (TypeManager.FilterWithClosure): Added CS1540
19469 * ecore.cs (Expression.MemberLookupFailed): Added CS1540 check for
19472 2004-04-28 Martin Baulig <martin@ximian.com>
19474 * statement.cs (Block.LookupLabel): Also lookup in implicit child blocks.
19475 (Block.AddLabel): Call DoLookupLabel() to only search in the
19478 2004-04-28 Martin Baulig <martin@ximian.com>
19480 * cfold.cs (ConstantFold.BinaryFold): Added special support for
19481 comparing StringConstants and NullLiterals in Equality and Inequality.
19483 2004-04-28 Jackson Harper <jackson@ximian.com>
19485 * driver.cs: Attempt to load referenced assemblies from the
19486 GAC. This is the quick and dirty version of this method that
19487 doesnt take into account versions and just takes the first
19488 canidate found. Will be good enough for now as we will not have more
19489 then one version installed into the GAC until I update this method.
19491 2004-04-28 Martin Baulig <martin@ximian.com>
19493 * typemanager.cs (TypeManager.CheckStructCycles): New public
19494 static method to check for cycles in the struct layout.
19496 * rootcontext.cs (RootContext.PopulateTypes): Call
19497 TypeManager.CheckStructCycles() for each TypeContainer.
19498 [Note: We only need to visit each type once.]
19500 2004-04-28 Martin Baulig <martin@ximian.com>
19502 * constant.cs (StringConstant.Emit): Emit Ldnull if we're null.
19504 * const.cs (Const.LookupConstantValue): Return a `bool' signalling
19505 success and added `out object value'. Use a `bool resolved' field
19506 to check whether we've already been called rather than
19507 `ConstantValue != null' since this breaks for NullLiterals.
19509 2004-04-28 Raja R Harinath <rharinath@novell.com>
19511 * driver.cs (Driver.MainDriver) [IsModuleOnly]: Open code the
19512 setting of this flag, since the 'set' method may be non-public.
19514 2004-04-28 Raja R Harinath <rharinath@novell.com>
19516 * flowanalysis.cs (FlowBranchingException.LookupLabel): Add a null
19517 check on current_vector.Block.
19519 2004-04-27 Martin Baulig <martin@ximian.com>
19521 * expression.cs (BaseAccess.CommonResolve): Don't allow `base' in
19522 a field initializer. Fixes #56459.
19524 2004-04-27 Martin Baulig <martin@ximian.com>
19526 * ecore.cs (PropertyExpr.DoResolve/DoResolveLValue): Check whether
19527 we're not attempting to use an indexer. Fixes #52154.
19529 2004-04-27 Martin Baulig <martin@ximian.com>
19531 * statement.cs (Return): Don't create a return label if we don't
19532 need it; reverts my change from January 20th. Thanks to Ben
19535 2004-04-27 Martin Baulig <martin@ximian.com>
19537 According to the spec, `goto' can only leave a nested scope, but
19540 * statement.cs (Block.LookupLabel): Only lookup in the current
19541 block, don't recurse into parent or child blocks.
19542 (Block.AddLabel): Check in parent and child blocks, report
19543 CS0140/CS0158 if we find a duplicate.
19544 (Block): Removed this indexer for label lookups.
19545 (Goto.Resolve): Call LookupLabel() on our current FlowBranching;
19546 this already does the error reporting for us.
19549 (FlowBranching.UsageVector.Block): New public variable; may be null.
19550 (FlowBranching.CreateSibling): Added `Block' argument.
19551 (FlowBranching.LookupLabel): New public virtual method. Lookup a
19552 label for the target of a `goto' and check whether we're not
19553 leaving a `finally'.
19555 2004-04-27 Martin Baulig <martin@ximian.com>
19557 * flowanalysis.cs (FlowBranching.UsageVector.MergeChild): If we're
19558 a finite loop block, also do the ALWAYS->SOMETIMES for throws (not
19561 2004-04-27 Martin Baulig <martin@ximian.com>
19563 * statement.cs (Block.AddLabel): Also check for implicit blocks
19564 and added a CS0158 check.
19566 2004-04-27 Martin Baulig <martin@ximian.com>
19568 * flowanalysis.cs (FlowBranchingLoop): New class.
19569 (FlowBranching.UsageVector.MergeJumpOrigins): Take a list of
19570 UsageVector's instead of an ArrayList.
19571 (FlowBranching.Label): Likewise.
19572 (FlowBranching.UsageVector.MergeBreakOrigins): New method.
19573 (FlowBranching.AddBreakVector): New method.
19575 2004-04-27 Miguel de Icaza <miguel@ximian.com>
19577 * attribute.cs: Small regression fix: only convert the type if we
19578 the type is different, fixes System.Drawing build.
19580 2004-04-27 Martin Baulig <martin@ximian.com>
19582 * attribute.cs (Attribute.Resolve): If we have a constant value
19583 for a named field or property, implicity convert it to the correct
19586 2004-04-27 Raja R Harinath <rharinath@novell.com>
19588 * statement.cs (Block.Block): Implicit blocks share
19589 'child_variable_names' fields with parent blocks.
19590 (Block.AddChildVariableNames): Remove.
19591 (Block.AddVariable): Mark variable as "used by a child block" in
19592 every surrounding block.
19593 * ecore.cs (SimpleName.SimpleNameResolve): If the name has already
19594 been used in a child block, complain about violation of "Invariant
19595 meaning in blocks" rule.
19596 * cs-parser.jay (declare_local_variables): Don't use
19597 AddChildVariableNames.
19598 (foreach_statement): Don't create an implicit block: 'foreach'
19599 introduces a scope.
19601 2004-04-23 Miguel de Icaza <miguel@ximian.com>
19603 * convert.cs (ImplicitNumericConversion): 0 is also positive when
19604 converting from 0L to ulong. Fixes 57522.
19606 2004-04-22 Marek Safar <marek.safar@seznam.cz>
19608 * decl.cs (FindMemberToOverride): Fix wrong warning for case when
19609 derived class hides via 'new' keyword field from base class (test-242.cs).
19610 TODO: Handle this in the more general way.
19612 * class.cs (CheckBase): Ditto.
19614 2004-04-22 Marek Safar <marek.safar@seznam.cz>
19616 * decl.cs (caching_flags): New member for storing cached values
19618 (MemberCore.Flags): New enum where bit flags for caching_flags
19620 (MemberCore.cls_compliance): Moved to caching_flags.
19621 (DeclSpace.Created): Moved to caching_flags.
19623 * class.cs: Use caching_flags instead of DeclSpace.Created
19625 2004-04-21 Miguel de Icaza <miguel@ximian.com>
19627 * ecore.cs (PropertyExpr.GetAccesor): Only perform the 1540 check
19628 if we are only a derived class, not a nested class.
19630 * typemanager.cs: Same as above, but do this at the MemberLookup
19631 level (used by field and methods, properties are handled in
19632 PropertyExpr). Allow for the qualified access if we are a nested
19635 2004-04-21 Marek Safar <marek.safar@seznam.cz>
19637 * class.cs: Refactoring.
19638 (IMethodData): New inteface; Holds links to parent members
19639 to avoid member duplication (reduced memory allocation).
19640 (Method): Implemented IMethodData interface.
19641 (PropertyBase): New inner classes for get/set methods.
19642 (PropertyBase.PropertyMethod): Implemented IMethodData interface
19643 (Event): New inner classes for add/remove methods.
19644 (Event.DelegateMethod): Implemented IMethodData interface.
19646 * cs-parser.jay: Pass DeclSpace to Event class for creation of valid
19647 EmitContext (related to class.cs refactoring).
19649 2004-04-21 Raja R Harinath <rharinath@novell.com>
19651 * delegate.cs (Delegate.VerifyApplicability): If the number of
19652 arguments are the same as the number of parameters, first try to
19653 verify applicability ignoring any 'params' modifier on the last
19657 2004-04-16 Raja R Harinath <rharinath@novell.com>
19659 * class.cs (TypeContainer.AddIndexer): Use
19660 'ExplicitInterfaceName' to determine if interface name was
19661 explicitly specified. 'InterfaceType' is not initialized at this time.
19662 (TypeContainer.DefineIndexers): Remove use of temporary list. The
19663 Indexers array is already in the required order. Initialize
19664 'IndexerName' only if there are normal indexers.
19665 (TypeContainer.DoDefineMembers): Don't initialize IndexerName.
19666 (TypeContainer.Emit): Emit DefaultMember attribute only if
19667 IndexerName is initialized.
19670 2004-04-15 Benjamin Jemlich <pcgod@gmx.net>
19672 * enum.cs (Enum.DefineType): Don't allow char as type for enum.
19675 2004-04-15 Raja R Harinath <rharinath@novell.com>
19677 * attribute.cs (Attribute.CheckAttributeType): Check for ambiguous
19681 * attribute.cs (Attribute.Resolve): Check for duplicate named
19685 2004-04-15 Miguel de Icaza <miguel@ximian.com>
19687 * iterators.cs (MarkYield): track whether we are in an exception,
19688 and generate code accordingly. Use a temporary value to store the
19689 result for our state.
19691 I had ignored a bit the interaction of try/catch with iterators
19692 since their behavior was not entirely obvious, but now it is
19693 possible to verify that our behavior is the same as MS .NET 2.0
19697 2004-04-14 Miguel de Icaza <miguel@ximian.com>
19699 * iterators.cs: Avoid creating temporaries if there is no work to
19702 * expression.cs (ArrayAccess.EmitLoadOpcode): If dealing with
19703 Enumerations, use TypeManager.EnumToUnderlying and call
19706 Based on the patch from Benjamin Jemlich (pcgod@gmx.net), fixes
19709 (This.Emit): Use EmitContext.EmitThis to emit our
19712 (This.EmitAssign): Ditto.
19714 * ecore.cs (FieldExpr.Emit): Remove RemapToProxy special
19715 codepaths, we will move all the functionality into
19718 (FieldExpr.EmitAssign): Ditto.
19720 This fixes several hidden bugs that I uncovered while doing a code
19721 review of this today.
19723 * codegen.cs (EmitThis): reworked so the semantics are more clear
19724 and also support value types "this" instances.
19726 * iterators.cs: Changed so that for iterators in value types, we
19727 do not pass the value type as a parameter.
19729 Initialization of the enumerator helpers is now done in the caller
19730 instead of passing the parameters to the constructors and having
19731 the constructor set the fields.
19733 The fields have now `assembly' visibility instead of private.
19735 2004-04-11 Miguel de Icaza <miguel@ximian.com>
19737 * expression.cs (Argument.Resolve): Check if fields passed as ref
19738 or out are contained in a MarshalByRefObject.
19740 * typemanager.cs, rootcontext.cs: Add System.Marshalbyrefobject as
19741 another compiler type.
19743 2004-04-06 Ben Maurer <bmaurer@users.sourceforge.net>
19745 * class.cs (Indexer.Define): use the new name checking method.
19746 Also, return false on an error.
19747 * cs-tokenizer.cs (IsValidIdentifier): Checks for a valid identifier.
19748 (is_identifier_[start/part]_character): make static.
19750 2004-04-10 Miguel de Icaza <miguel@ximian.com>
19752 * expression.cs (Binary.ResolveOperator): Do no append strings
19753 twice: since we can be invoked more than once (array evaluation)
19754 on the same concatenation, take care of this here. Based on a fix
19755 from Ben (bug #56454)
19757 2004-04-08 Sebastien Pouliot <sebastien@ximian.com>
19759 * codegen.cs: Fix another case where CS1548 must be reported (when
19760 delay-sign isn't specified and no private is available #56564). Fix
19761 loading the ECMA "key" to delay-sign an assembly. Report a CS1548
19762 error when MCS is used on the MS runtime and we need to delay-sign
19763 (which seems unsupported by AssemblyBuilder - see #56621).
19765 2004-04-08 Marek Safar <marek.safar@seznam.cz>
19767 * typemanager.cs (TypeManager.TypeToCoreType): Handle IntPtr too.
19768 (TypeManager.ComputeNamespaces): Faster implementation for
19771 * compiler.csproj: Updated AssemblyName to mcs.
19773 2004-04-07 Miguel de Icaza <miguel@ximian.com>
19775 * rootcontext.cs: Add new types to the boot resolution.
19777 * ecore.cs (TypeExpr.CanInheritFrom): Inheriting from
19778 MulticastDelegate is not allowed.
19780 * typemanager.cs: Add new types to lookup: System.TypedReference
19783 * paramter.cs (Parameter.Resolve): if we are an out/ref parameter,
19784 check for TypedReference or ArgIterator, they are not allowed.
19786 * ecore.cs (BoxedCast): Set the eclass to ExprClass.Value, this
19787 makes us properly catch 1510 in some conditions (see bug 56016 for
19790 2004-04-06 Bernie Solomon <bernard@ugsolutions.com>
19792 * CryptoConvert.cs: update from corlib version
19795 2004-04-05 Miguel de Icaza <miguel@ximian.com>
19797 * class.cs (Indexer.Define): Check indexername declaration
19799 2004-04-05 Marek Safar <marek.safar@seznam.cz>
19801 * attribute.cs (IsClsCompliant): Fixed problem with handling
19802 all three states (compliant, not-compliant, undetected).
19804 2004-03-30 Marek Safar <marek.safar@seznam.cz>
19806 * attribute.cs (Attribute): Location is now public.
19807 (Resolve): Store resolved arguments (pos_values) in attribute class.
19808 Attribute extractors (now GetClsCompliantAttributeValue) can reuse them.
19809 (GetClsCompliantAttributeValue): New method that gets
19810 CLSCompliantAttribute value.
19811 (GetClsCompliantAttribute): Returns CLSCompliantAttribute for DeclSpace
19812 if exists else null.
19813 (AttributeTester): New class for CLS-Compliant verification routines.
19815 * class.cs (Emit): Add CLS-Compliant verification.
19816 (Method.GetSignatureForError): Implemented.
19817 (Constructor.GetSignatureForError): Implemented
19818 (Constructor.HasCompliantArgs): Returns if constructor has
19819 CLS-Compliant arguments.
19820 (Constructor.Emit): Override.
19821 (Construcor.IsIdentifierClsCompliant): New method; For constructors
19822 is needed to test only parameters.
19823 (FieldBase.GetSignatureForError): Implemented.
19824 (TypeContainer): New member for storing base interfaces.
19825 (TypeContainer.FindMembers): Search in base interfaces too.
19827 * codegen.cs (GetClsComplianceAttribute): New method that gets
19828 assembly or module CLSCompliantAttribute value.
19829 (ResolveClsCompliance): New method that resolve CLSCompliantAttribute
19831 (ModuleClass.Emit): Add error 3012 test.
19833 * const.cs (Emit): Override and call base for CLS-Compliant tests.
19835 * decl.cs (ClsComplianceValue): New enum that holds CLS-Compliant
19836 state for all decl types.
19837 (MemberCore.Emit): Emit is now virtual and call VerifyClsCompliance
19838 if CLS-Compliant tests are required.
19839 (IsClsCompliaceRequired): New method. Analyze whether code
19840 must be CLS-Compliant.
19841 (IsExposedFromAssembly): New method. Returns true when MemberCore
19842 is exposed from assembly.
19843 (GetClsCompliantAttributeValue): New method. Resolve CLSCompliantAttribute
19844 value or gets cached value.
19845 (HasClsCompliantAttribute): New method. Returns true if MemberCore
19846 is explicitly marked with CLSCompliantAttribute.
19847 (IsIdentifierClsCompliant): New abstract method. This method is
19848 used to testing error 3005.
19849 (IsIdentifierAndParamClsCompliant): New method. Common helper method
19850 for identifier and parameters CLS-Compliant testing.
19851 (VerifyClsCompliance): New method. The main virtual method for
19852 CLS-Compliant verifications.
19853 (CheckAccessLevel): In one special case (System.Drawing) was TypeBuilder
19854 null. I don't know why is null (too many public members !).
19855 (GetClsCompliantAttributeValue). New method. Goes through class hierarchy
19856 and get value of first CLSCompliantAttribute that found.
19858 * delegate.cs (Emit): Override and call base for CLS-Compliant tests.
19859 (VerifyClsCompliance): Override and add extra tests.
19861 * driver.cs (CSCParseOption): New command line options (clscheck[+|-]).
19862 clscheck- disable CLS-Compliant verification event if assembly is has
19863 CLSCompliantAttribute(true).
19865 * enum.cs (Emit): Override and call base for CLS-Compliant tests.
19866 ApllyAttribute is now called in emit section as in the other cases.
19867 Possible future Emit integration.
19868 (IsIdentifierClsCompliant): New override.
19869 (VerifyClsCompliance): New override.
19870 (GetEnumeratorName): Returns full enum name.
19872 * parameter.cs (GetSignatureForError): Implemented.
19874 * report.cs (WarningData): New struct for Warning message information.
19875 (LocationOfPreviousError): New method.
19876 (Warning): New method. Reports warning based on the warning table.
19877 (Error_T): New method. Reports error based on the error table.
19879 * rootcontext.cs (EmitCode): Added new Emit(s) because CLS-Compliant
19880 verifications are done here.
19882 * tree.cs (RecordDecl): Used new LocationOfPreviousError method.
19884 * typemanager.cs (cls_compliant_attribute_type): New member thath holds
19885 CLSCompliantAttribute.
19886 (all_imported_types): New member holds all imported types from other
19888 (LoadAllImportedTypes): New method fills static table with exported types
19889 from all referenced assemblies.
19890 (Modules): New property returns all assembly modules.
19892 2004-03-30 Miguel de Icaza <miguel@ximian.com>
19894 * cs-parser.jay: Add a rule to catch wrong event syntax instead of
19895 throwing a parser error.
19897 * ecore.cs (PropertyExpr.GetAccessor): Apply patch from Patrik Reali
19898 which removes the hardcoded get_/set_ prefixes for properties, as
19899 IL allows for the properties to be named something else.
19903 * expression.cs: Do not override operand before we know if it is
19904 non-null. Fix 56207
19906 2004-03-29 Ben Maurer <bmaurer@users.sourceforge.net>
19908 * typemanager.cs: support for pinned variables.
19910 2004-03-29 Ben Maurer <bmaurer@users.sourceforge.net>
19912 * decl.cs, typemanager.cs: Avoid using an arraylist
19913 as a buffer if there is only one result set.
19915 2004-03-29 Ben Maurer <bmaurer@users.sourceforge.net>
19917 * expression.cs: Make sure you cant call a static method
19918 with an instance expression, bug #56174.
19920 2004-03-29 Miguel de Icaza <miguel@ximian.com>
19922 * class.cs (IsDuplicateImplementation): Improve error reporting to
19923 flag 663 (method only differs in parameter modifier).
19925 * cs-tokenizer.cs: Do not require whitespace when a ( or " will do
19926 in preprocessor directives.
19928 * location.cs (LookupFile): Allow for the empty path.
19930 * attribute.cs (DefinePInvokeMethod): Fix 56148; I would like a
19931 better approach for some of that patch, but its failing with the
19932 CharSet enumeration. For now try/catch will do.
19934 * typemanager.cs: Do not crash if a struct does not have fields.
19937 2004-03-28 Ben Maurer <bmaurer@users.sourceforge.net>
19939 * expression.cs: cs0213, cant fix a fixed expression.
19942 2004-03-28 Ben Maurer <bmaurer@users.sourceforge.net>
19944 * cs-parser.jay: detect invalid embeded statements gracefully.
19947 2004-03-28 Ben Maurer <bmaurer@users.sourceforge.net>
19949 * ecore.cs, typemanager.cs: Correct impl of cs1540 check.
19952 the invocation type may not be a subclass of the tye of the item/
19953 The type of the item must be a subclass of the invocation item.
19958 2004-03-25 Sebastien Pouliot <sebastien@ximian.com>
19960 * attribute.cs: Added methods to get a string and a bool from an
19961 attribute. Required to information from AssemblyKeyFileAttribute,
19962 AttributeKeyNameAttribute (string) and AssemblyDelaySign (bool).
19963 * codegen.cs: Modified AssemblyName creation to include support for
19964 strongnames. Catch additional exceptions to report them as CS1548.
19965 * compiler.csproj: Updated include CryptoConvert.cs.
19966 * compiler.csproj.user: Removed file - user specific configuration.
19967 * CryptoConvert.cs: New. A COPY of the class CryptoConvert from
19968 Mono.Security assembly. The original class is maintained and tested in
19969 /mcs/class/Mono.Security/Mono.Security.Cryptography/CryptoConvert.cs.
19970 * drivers.cs: Added support for /keyfile, /keycontainer and /delaysign
19971 like CSC 8.0 (C# v2) supports.
19972 * Makefile: Added CryptoConvert.cs to mcs sources.
19973 * rootcontext.cs: Added new options for strongnames.
19975 2004-03-24 Ben Maurer <bmaurer@users.sourceforge.net>
19977 * driver.cs: For --expect-error, report error code `2'
19978 if the program compiled with no errors, error code `1' if
19979 it compiled with an error other than the one expected.
19981 2004-03-24 Sebastien Pouliot <sebastien@ximian.com>
19983 * compiler.csproj: Updated for Visual Studio .NET 2003.
19984 * compiler.csproj.user: Updated for Visual Studio .NET 2003.
19985 * compiler.sln: Updated for Visual Studio .NET 2003.
19987 2004-03-24 Ravi Pratap M <ravi@ximian.com>
19989 * expression.cs: Fix bug #47234. We basically need to apply the
19990 rule that we prefer the conversion of null to a reference type
19991 when faced with a conversion to 'object' (csc behaviour).
19993 2004-03-23 Ben Maurer <bmaurer@users.sourceforge.net>
19995 * statement.cs: Shorter form for foreach, eliminates
19996 a local variable. r=Martin.
19998 2004-03-23 Ben Maurer <bmaurer@users.sourceforge.net>
20000 * constant.cs, ecore.cs, literal.cs: New prop IsZeroInteger that
20001 checks if we can use brtrue/brfalse to test for 0.
20002 * expression.cs: use the above in the test for using brtrue/brfalse.
20003 cleanup code a bit.
20005 2004-03-23 Ben Maurer <bmaurer@users.sourceforge.net>
20007 * expression.cs: Rewrite string concat stuff. Benefits:
20009 - "a" + foo + "b" + "c" becomes "a" + foo + "bc"
20010 - "a" + foo + "b" + bar + "c" + baz ... uses concat (string []).
20011 rather than a concat chain.
20013 * typemanager.cs: Add lookups for more concat overloads.
20015 2004-03-23 Ben Maurer <bmaurer@users.sourceforge.net>
20017 * expression.cs: Emit shorter il code for array init.
20034 2004-03-22 Ben Maurer <bmaurer@users.sourceforge.net>
20036 * statement.cs: Before, two switch blocks would be merged if the
20037 total size of the blocks (end_item - begin_item + 1) was less than
20038 two times the combined sizes of the blocks.
20040 Now, it will only merge if after the merge at least half of the
20045 2004-03-20 Atsushi Enomoto <atsushi@ximian.com>
20047 * class.cs : csc build fix for GetMethods(). See bug #52503.
20049 2004-03-20 Ben Maurer <bmaurer@users.sourceforge.net>
20051 * expression.cs: Make sure fp comparisons work with NaN.
20052 This fixes bug #54303. Mig approved this patch a long
20053 time ago, but we were not able to test b/c the runtime
20056 2004-03-19 Miguel de Icaza <miguel@ximian.com>
20058 * ecore.cs (TypExpr.GetHashCode): implement this overload.
20060 2004-03-19 Martin Baulig <martin@ximian.com>
20062 * class.cs (MemberCore.IsDuplicateImplementation): Report the
20063 error here and not in our caller.
20065 2004-03-19 Martin Baulig <martin@ximian.com>
20067 * interface.cs: Completely killed this file.
20068 (Interface): We're now a TypeContainer and live in class.cs.
20070 * class.cs (TypeContainer.GetClassBases): Added `bool is_iface'
20071 argument; we're now also called for interfaces.
20072 (TypeContainer.DefineMembers): Allow this method being called
20074 (TypeContainer.GetMethods): New public method; formerly known as
20075 Interface.GetMethod(). This is used by PendingImplementation.
20076 (TypeContainer.EmitDefaultMemberAttr): Moved here from Interface;
20077 it's now private and non-static.
20078 (Interface): Moved this here; it's now implemented similar to
20080 (Method, Property, Event, Indexer): Added `bool is_interface'
20081 argument to their .ctor's.
20082 (MemberBase.IsInterface): New public field.
20084 * cs-parser.jay: Create normal Method, Property, Event, Indexer
20085 instances instead of InterfaceMethod, InterfaceProperty, etc.
20086 (opt_interface_base): Removed; we now use `opt_class_base' instead.
20087 (InterfaceAccessorInfo): Create `Get' and `Set' Accessor's.
20089 2004-03-19 Martin Baulig <martin@ximian.com>
20091 * class.cs (MethodCore.IsDuplicateImplementation): New private
20092 method which does the CS0111 checking.
20093 (Method.CheckBase, Constructor.CheckBase, PropertyBase.CheckBase):
20094 Use IsDuplicateImplementation().
20096 2004-03-17 Ben Maurer <bmaurer@users.sourceforge.net>
20098 * decl.cs (FindMemberToOverride): New method to find the correct
20099 method or property to override in the base class.
20101 - Make Method/Property use the above method to find the
20102 version in the base class.
20103 - Remove the InheritableMemberSignatureCompare as it is now
20106 This patch makes large code bases much faster to compile, as it is
20107 O(n) rather than O(n^2) to do this validation.
20109 Also, it fixes bug 52458 which is that nested classes are not
20110 taken into account when finding the base class member.
20112 Reviewed/Approved by Martin.
20114 2004-03-17 Marek Safar <marek.safar@seznam.cz>
20116 * interface.cs: In all interface classes removed redundant
20117 member initialization.
20119 2004-03-16 Martin Baulig <martin@ximian.com>
20121 * class.cs (TypeContainer.GetClassBases): Fix the CS0528 check.
20123 2004-03-15 Miguel de Icaza <miguel@ximian.com>
20125 * decl.cs (DefineTypeAndParents): New helper method to define a
20126 type's containers before the type itself is defined; This is a
20127 bug exposed by the recent changes to Windows.Forms when an
20128 implemented interface was defined inside a class that had not been
20131 * modifiers.cs (MethodAttr): All methods in C# are HideBySig.
20133 (Check): Loop correctly to report errors modifiers
20134 (UNSAFE was not in the loop, since it was the same as TOP).
20136 * interface.cs: Every interface member now takes a ModFlags,
20137 instead of a "is_new" bool, which we set on the base MemberCore.
20139 Every place where we called "UnsafeOk" in the interface, now we
20140 call the proper member (InterfaceMethod.UnsafeOK) instead to get
20141 the unsafe settings from the member declaration instead of the
20142 container interface.
20144 * cs-parser.jay (opt_new): Allow unsafe here per the spec.
20146 * pending.cs (TypeAndMethods): Add `get_indexer_name' and
20147 `set_indexer_name' to the pending bits (one per type).
20149 We fixed a bug today that was picking the wrong method to
20150 override, since for properties the existing InterfaceMethod code
20151 basically ignored the method name. Now we make sure that the
20152 method name is one of the valid indexer names.
20154 2004-03-14 Gustavo Giráldez <gustavo.giraldez@gmx.net>
20156 * support.cs (SeekableStreamReader): Keep track of stream byte
20157 positions and don't mix them with character offsets to the buffer.
20159 Patch from Gustavo Giráldez
20161 2004-03-15 Marek Safar <marek.safar@seznam.cz>
20163 * interface.cs (InterfaceSetGetBase): Removed double member
20164 initialization, base class does it as well.
20166 2004-03-13 Martin Baulig <martin@ximian.com>
20168 * class.cs: Reverted Miguel's latest commit; it makes mcs crash
20169 when compiling corlib.
20171 2004-03-13 Miguel de Icaza <miguel@ximian.com>
20173 * convert.cs (ExplicitConversion): We were reporting an error on
20174 certain conversions (object_type source to a value type, when the
20175 expression was `null') before we had a chance to pass it through
20176 the user defined conversions.
20178 * driver.cs: Replace / and \ in resource specifications to dots.
20181 * class.cs: Add check for duplicate operators. Fixes 52477
20183 2004-03-11 Miguel de Icaza <miguel@ximian.com>
20185 * statement.cs (Switch.SimpleSwitchEmit): Deal with default labels
20186 that are in the middle of the statements, not only at the end.
20189 * class.cs (TypeContainer.AddField): No longer set the
20190 `HaveStaticConstructor' flag, now we call it
20191 `UserDefineStaticConstructor' to diferentiate the slightly
20192 semantic difference.
20194 The situation is that we were not adding BeforeFieldInit (from
20195 Modifiers.TypeAttr) to classes that could have it.
20196 BeforeFieldInit should be set to classes that have no static
20201 http://www.yoda.arachsys.com/csharp/beforefieldinit.html
20203 And most importantly Zoltan's comment:
20205 http://bugzilla.ximian.com/show_bug.cgi?id=44229
20207 "I think beforefieldinit means 'it's ok to initialize the type sometime
20208 before its static fields are used', i.e. initialization does not need
20209 to be triggered by the first access to the type. Setting this flag
20210 helps the JIT to compile better code, since it can run the static
20211 constructor at JIT time, and does not need to generate code to call it
20212 (possibly lots of times) at runtime. Unfortunately, mcs does not set
20213 this flag for lots of classes like String.
20215 csc sets this flag if the type does not have an explicit static
20216 constructor. The reasoning seems to be that if there are only static
20217 initalizers for a type, and no static constructor, then the programmer
20218 does not care when this initialization happens, so beforefieldinit
20221 This bug prevents the AOT compiler from being usable, since it
20222 generates so many calls to mono_runtime_class_init that the AOT code
20223 is much slower than the JITted code. The JITted code is faster,
20224 because it does not generate these calls if the vtable is type is
20225 already initialized, which is true in the majority of cases. But the
20226 AOT compiler can't do this."
20228 2004-03-10 Miguel de Icaza <miguel@ximian.com>
20230 * class.cs (MethodData.Emit): Refactor the code so symbolic
20231 information is generated for destructors; For some reasons we
20232 were taking a code path that did not generate symbolic information
20235 2004-03-11 Ben Maurer <bmaurer@users.sourceforge.net>
20237 * class.cs: Create a Constructor.CheckBase method that
20238 takes care of all validation type code. The method
20239 contains some code that was moved from Define.
20241 It also includes new code that checks for duplicate ctors.
20242 This fixes bug #55148.
20244 2004-03-09 Joshua Tauberer <tauberer@for.net>
20246 * expression.cs (ArrayCreation): Fix: More than 6 nulls in
20247 a { ... }-style array creation invokes EmitStaticInitializers
20248 which is not good for reference-type arrays. String, decimal
20249 and now null constants (NullCast) are not counted toward
20250 static initializers.
20252 2004-03-05 Martin Baulig <martin@ximian.com>
20254 * location.cs (SourceFile.HasLineDirective): New public field;
20255 specifies whether the file contains or is referenced by a "#line"
20257 (Location.DefineSymbolDocuments): Ignore source files which
20258 either contain or are referenced by a "#line" directive.
20260 2004-02-29 Ben Maurer <bmaurer@users.sourceforge.net>
20262 * class.cs (Method.CheckBase): Avoid using FindMembers, we have
20263 direct access to our parent, so check the method inline there.
20265 2004-02-27 Ben Maurer <bmaurer@users.sourceforge.net>
20267 * expression.cs (Invocation.EmitCall): Miguel's last commit
20268 caused a regression. If you had:
20273 In Foo the implict this would be null.
20275 2004-02-27 Miguel de Icaza <miguel@ximian.com>
20277 * expression.cs (Invocation.EmitCall): If the method is not
20278 virtual, do not emit a CallVirt to it, use Call.
20280 * typemanager.cs (GetFullNameSignature): Improve the method to
20281 cope with ".ctor" and replace it with the type name.
20283 * class.cs (ConstructorInitializer.Resolve): Now the method takes
20284 as an argument the ConstructorBuilder where it is being defined,
20285 to catch the recursive constructor invocations.
20287 2004-02-26 Miguel de Icaza <miguel@ximian.com>
20289 * iterators.cs (IteratorHandler.IsIEnumerator, IsIEnumerable): New
20290 routines to check if a type is an enumerable/enumerator allow
20291 classes that implement the IEnumerable or IEnumerator interfaces.
20293 * class.cs (Property, Operator): Implement IIteratorContainer, and
20294 implement SetYields.
20296 (Property.Define): Do the block swapping for get_methods in the
20297 context of iterators. We need to check if Properties also
20298 include indexers or not.
20300 (Operator): Assign the Block before invoking the
20301 OperatorMethod.Define, so we can trigger the Iterator code
20304 * cs-parser.jay (SimpleIteratorContainer): new helper class. Both
20305 Property and Operator classes are not created when we parse the
20306 declarator but until we have the block completed, so we use a
20307 singleton SimpleIteratorContainer.Simple to flag whether the
20308 SetYields has been invoked.
20310 We propagate this setting then to the Property or the Operator to
20311 allow the `yield' to function.
20313 2004-02-25 Marek Safar <marek.safar@seznam.cz>
20315 * codegen.cs: Implemented attribute support for modules.
20316 New AssemblyClass, ModuleClass and CommonAssemblyModulClass for
20317 Assembly/Module functionality.
20319 * attribute.cs, class.cs, cs-parser.jay, delegate.cs, driver.cs, enum.cs
20320 interface.cs, rootcontext.cs, statement.cs, typemanager.cs:
20321 Updated dependencies on CodeGen.ModuleBuilder and CodeGen.AssemblyBuilder.
20323 2004-02-16 Marek Safar <marek.safar@seznam.cz>
20325 * interface.cs (FindMembers): The operation is performed on all base
20326 interfaces and not only on the first. It is required for future CLS Compliance patch.
20328 2004-02-12 Ben Maurer <bmaurer@users.sourceforge.net>
20330 * statement.cs, codegen.cs:
20331 This patch deals with patterns such as:
20333 public class List : IEnumerable {
20335 public MyEnumerator GetEnumerator () {
20336 return new MyEnumerator(this);
20339 IEnumerator IEnumerable.GetEnumerator () {
20343 public struct MyEnumerator : IEnumerator {
20348 Before, there were a few things we did wrong:
20349 1) we would emit callvirt on a struct, which is illegal
20350 2) we emited ldarg when we needed to emit ldarga
20351 3) we would mistakenly call the interface methods on an enumerator
20352 type that derived from IEnumerator and was in another assembly. For example:
20354 public class MyEnumerator : IEnumerator
20356 Would have the interface methods called, even if there were public impls of the
20357 method. In a struct, this lead to invalid IL code.
20359 2004-02-11 Marek Safar <marek.safar@seznam.cz>
20361 * const.cs: Const is now derived from FieldBase. Method EmitConstant name
20364 * delegate.cs (Define): Fixed crash when delegate type is undefined.
20366 2004-02-11 Miguel de Icaza <miguel@ximian.com>
20368 * cs-parser.jay: Fix small regression: we were not testing V2
20369 compiler features correctly.
20371 * interface.cs: If the emit context is null, then create one
20373 2004-02-09 Marek Safar <marek.safar@seznam.cz>
20375 * decl.cs (GetSignatureForError): New virtual method to get full name
20376 for error messages.
20378 * attribute.cs (IAttributeSupport): New interface for attribute setting.
20379 Now it is possible to rewrite ApplyAttributes method to be less if/else.
20381 * interface.cs : All InterfaceXXX classes are now derived from MemberCore.
20382 Duplicated members and code in these classes has been removed.
20383 Better encapsulation in these classes.
20385 2004-02-07 Miguel de Icaza <miguel@ximian.com>
20387 * assign.cs (Assign.DoResolve): When dealing with compound
20388 assignments, there is a new rule in ECMA C# 2.4 (might have been
20389 there before, but it is documented here) that states that in:
20393 If b is of type int, and the `op' is a shift-operator, then the
20394 above is evaluated as:
20398 * expression.cs (Binary.ResolveOperator): Instead of testing for
20399 int/uint/long/ulong, try to implicitly convert to any of those
20400 types and use that in pointer arithmetic.
20402 * delegate.cs (Error_NoMatchingMethodForDelegate): Compute the
20403 method to print information for from the type, not from the
20404 null-method we were given.
20406 2004-02-01 Duncan Mak <duncan@ximian.com>
20408 * cs-tokenizer.cs (get_cmd_arg): Skip over whitespace before
20409 parsing for cmd, fixes bug #53694.
20411 2004-02-04 Marek Safar <marek.safar@seznam.cz>
20413 * class.cs, decl.cs: Fixed problem where IndexerName attribute was ignored
20414 in the member name duplication tests. Property and operator name duplication
20415 was missing too (error tests cs0102-{2,3,4,5}.cs, cs0111-{3,4}.cs).
20417 2004-02-03 Marek Safar <marek.safar@seznam.cz>
20419 * interface.cs (PopulateMethod): Fixed crash when interface method
20420 returns not existing type (error test cs0246-3.cs).
20422 2004-02-02 Ravi Pratap M <ravi@ximian.com>
20424 * cs-parser.jay (interface_accessors): Re-write actions to also
20425 store attributes attached to get and set methods. Fix spelling
20428 (inteface_property_declaration): Modify accordingly.
20430 (InterfaceAccessorInfo): New helper class to store information to pass
20431 around between rules that use interface_accessors.
20433 * interface.cs (Emit): Apply attributes on the get and set
20434 accessors of properties and indexers too.
20436 * attribute.cs (ApplyAttributes): Modify accordingly to use the
20437 right MethodBuilder when applying attributes to the get and set accessors.
20439 2004-01-31 Miguel de Icaza <miguel@ximian.com>
20441 * cs-tokenizer.cs: Applied patch from Marek Safar to fix bug 53386
20443 2004-01-26 Miguel de Icaza <miguel@ximian.com>
20445 * cs-tokenizer.cs: Handle #line hidden from PDC bits.
20447 2004-01-25 Miguel de Icaza <miguel@ximian.com>
20449 * cs-parser.jay: Remove YIELD token, instead use the new grammar
20450 changes that treat `yield' specially when present before `break'
20451 or `return' tokens.
20453 * cs-tokenizer.cs: yield is no longer a keyword.
20455 2004-01-23 Marek Safar <marek.safar@seznam.cz>
20457 * cs-parser.jay, class.cs (DefineDefaultConstructor): Fixed ModFlags
20458 setting for default constructors.
20459 For default constructors are almost every time set wrong Modifier. The
20460 generated IL code has been alright. But inside mcs this values was
20461 wrong and this was reason why several of my CLS Compliance tests
20464 2004-01-22 Martin Baulig <martin@ximian.com>
20466 * cs-parser.jay (namespace_or_type_name): Return an Expression,
20467 not a QualifiedIdentifier. This is what `type_name_expression'
20468 was previously doing.
20469 (type_name_expression): Removed; the code is now in
20470 `namespace_or_type_name'.
20471 (qualified_identifier): Removed, use `namespace_or_type_name'
20473 (QualifiedIdentifier): Removed this class.
20475 2004-01-22 Martin Baulig <martin@ximian.com>
20477 * namespace.cs (NamespaceEntry.UsingAlias): Take an Expression,
20478 not a string as alias name.
20480 2004-01-21 Miguel de Icaza <miguel@ximian.com>
20482 * ecore.cs (FieldInfo.AddressOf): Revert patch from previous
20483 #52730 bug, and instead compute correctly the need to use a
20484 temporary variable when requesting an address based on the
20485 static/instace modified of the field and the constructor.
20487 2004-01-21 Martin Baulig <martin@ximian.com>
20489 * ecore.cs (SimpleName.ResolveAsTypeStep): Lookup in the current
20490 class and namespace before looking up aliases. Fixes #52517.
20492 2004-01-21 Martin Baulig <martin@ximian.com>
20494 * flowanalysis.cs (UsageVector.Merge): Allow variables being
20495 assinged in a 'try'; fixes exception4.cs.
20497 2004-01-21 Marek Safar <marek.safar@seznam.cz>
20498 * class.cs : Implemented parameter-less constructor for TypeContainer
20500 * decl.cs: Attributes are now stored here. New property OptAttributes
20502 * delegate.cs, enum.cs, interface.cs: Removed attribute member.
20504 * rootcontext.cs, tree.cs: Now use parameter-less constructor of TypeContainer
20506 2004-01-21 Marek Safar <marek.safar@seznam.cz>
20508 * typemanager.cs (CSharpSignature): Now reports also inner class name.
20509 (CSharpSignature): New method for indexer and property signature.
20511 2004-01-21 Marek Safar <marek.safar@seznam.cz>
20513 * pending.cs (IsVirtualFilter): Faster implementation.
20515 2004-01-21 Marek Safar <marek.safar@seznam.cz>
20517 * typemanager.cs: Avoid inclusion of same assembly more than once.
20519 2004-01-21 Marek Safar <marek.safar@seznam.cz>
20521 * cs-parser.jay: Fixed problem where the last assembly attribute
20522 has been applied also to following declaration (class, struct, etc.)
20524 2004-01-21 Marek Safar <marek.safar@seznam.cz>
20526 * class.cs: Added error CS0538, CS0539 reporting.
20527 Fixed crash on Microsoft runtime when field type is void.
20529 * cs-parser.jay: Added error CS0537 reporting.
20531 * pending.cs: Added error CS0535 reporting.
20532 Improved error report for errors CS0536, CS0534.
20534 2004-01-20 Miguel de Icaza <miguel@ximian.com>
20536 Merge a few bits from the Anonymous Method MCS tree.
20538 * statement.cs (ToplevelBlock): New class for toplevel methods,
20539 will hold anonymous methods, lifted variables.
20541 * cs-parser.jay: Create toplevel blocks for delegates and for
20542 regular blocks of code.
20544 2004-01-20 Martin Baulig <martin@ximian.com>
20546 * codegen.cs (EmitContext): Removed `InTry', `InCatch',
20547 `InFinally', `InLoop', `TryCatchLevel', `LoopBeginTryCatchLevel'
20548 and `NeedExplicitReturn'; added `IsLastStatement'.
20549 (EmitContext.EmitTopBlock): Emit the explicit "ret" if we either
20550 have a `ReturnLabel' or we're not unreachable.
20552 * flowanalysis.cs (FlowBranching.MergeChild): Actually merge the
20553 child's reachability; don't just override ours with it. Fixes
20554 #58058 (lluis's example).
20555 (FlowBranching): Added public InTryOrCatch(), InCatch(),
20556 InFinally(), InLoop(), InSwitch() and
20557 BreakCrossesTryCatchBoundary() methods.
20559 * statement.cs (Return): Do all error checking in Resolve().
20560 Unless we are the last statement in a top-level block, always
20561 create a return label and jump to it.
20562 (Break, Continue): Do all error checking in Resolve(); also make
20563 sure we aren't leaving a `finally'.
20564 (Block.DoEmit): Set `ec.IsLastStatement' when emitting the last
20565 statement in a top-level block.
20566 (Block.Flags): Added `IsDestructor'.
20567 (Block.IsDestructor): New public property.
20569 2004-01-20 Martin Baulig <martin@ximian.com>
20571 * statement.cs (Break.DoEmit): Set ec.NeedExplicitReturn; fixes #52427.
20573 2004-01-20 Martin Baulig <martin@ximian.com>
20575 * statement.cs (Statement.ResolveUnreachable): New public method.
20576 (If, While): Do the dead-code elimination in Resolve(), not in Emit().
20577 (Block.Resolve): Resolve unreachable statements.
20579 2004-01-19 Ben Maurer <bmaurer@users.sourceforge.net>
20581 * expression.cs: We need to fix the case where we do
20582 not have a temp variable here.
20584 * assign.cs: Only expression compound assignments need
20585 temporary variables.
20587 2004-01-19 Ben Maurer <bmaurer@users.sourceforge.net>
20589 * flowanalysis.cs: Reduce memory allocation in a few ways:
20590 - A block with no variables should not allocate a bit
20592 - A method with no out parameters does not need any tracking
20593 for assignment of the parameters, so we need not allocate
20596 public readonly Type[] VariableTypes;
20597 public readonly string[] VariableNames;
20598 Are redundant. The data is already stored in the variable
20599 map, so we need not allocate another array for it.
20600 - We need to add alot of checks for if (params | locals) == null
20601 due to the first two changes.
20603 2004-01-18 Miguel de Icaza <miguel@ximian.com>
20605 * ecore.cs (FieldExpr.AddressOf): For ValueTypes that do not
20606 implement IMemoryLocation, we store a copy on a local variable and
20607 take the address of it. Patch from Benjamin Jemlich
20609 * cs-parser.jay: Applied patch from Ben Maurer to the "type" rule
20610 to use a special "type_name_expression" rule which reduces the
20611 number of "QualifiedIdentifier" classes created, and instead
20612 directly creates MemberAccess expressions.
20614 2004-01-17 Miguel de Icaza <miguel@ximian.com>
20616 * convert.cs: Applied patch from Benjamin Jemlich (pcgod@gmx.net)
20617 that fixes #52853. Null literal assignment to ValueType
20619 * class.cs (MethodData.Emit): Instead of checking the name of the
20620 method to determine if its a destructor, create a new derived
20621 class from Method called Destructor, and test for that.
20623 * cs-parser.jay: Create a Destructor object instead of a Method.
20625 Based on a fix from Benjamin Jemlich (pcgod@gmx.net)
20629 2004-01-16 Miguel de Icaza <miguel@ximian.com>
20631 * expression.cs (Binary.ResolveOperator): Perform an implicit
20632 conversion from MethodGroups to their delegate types on the
20633 Addition operation.
20635 * delegate.cs: Introduce a new class DelegateCreation that is the
20636 base class for `NewDelegate' and `ImplicitDelegateCreation',
20637 factor some code in here.
20639 * convert.cs (Convert.ImplicitConversionStandard): Add an implicit
20640 conversion from MethodGroups to compatible delegate types.
20642 * ecore.cs (Expression.Resolve): Do not flag error 654
20643 (Methodgroupd needs parenthesis) if running on the V2 compiler, as
20644 we allow conversions from MethodGroups to delegate types now.
20646 * assign.cs (Assign.DoResolve): Do not flag errors on methodgroup
20647 assignments in v2 either.
20649 2004-01-10 Miguel de Icaza <miguel@ximian.com>
20651 * ecore.cs (FieldExpr.AddressOf): Fix generated IL for accessing
20652 static read-only fields in ctors.
20654 Applied patch from Benjamin Jemlich
20656 * expression.cs (UnaryMutator): Avoid leaking local variables.
20658 2004-01-09 Miguel de Icaza <miguel@ximian.com>
20660 * cs-tokenizer.cs (IsCastToken): Allow the various native types
20661 here to return true, as they can be used like this:
20663 (XXX) int.MEMBER ()
20665 Fixed 49836 and all the other dups
20667 2004-01-09 Zoltan Varga <vargaz@freemail.hu>
20669 * driver.cs: Implement /win32res and /win32icon.
20671 2004-01-08 Miguel de Icaza <miguel@ximian.com>
20673 * cs-parser.jay: Add a rule to improve error handling for the
20674 common mistake of placing modifiers after the type.
20676 2004-01-07 Miguel de Icaza <miguel@ximian.com>
20678 * cs-parser.jay (interface_event_declaration): Catch
20679 initialization of events on interfaces, and report cs0068
20681 * cs-parser.jay (interface_event_declaration): Catch
20682 initialization of events.
20684 * ecore.cs: Better report missing constructors.
20686 * expression.cs (Binary.ResolveOperator): My previous bug fix had
20687 the error reporting done in the wrong place. Fix.
20689 * expression.cs (Binary.ResolveOperator): Catch the
20690 operator + (E x, E y) error earlier, and later allow for implicit
20691 conversions in operator +/- (E e, U x) from U to the underlying
20694 * class.cs (TypeContainer.DefineDefaultConstructor): Fix bug
20695 52596, if the container class is abstract, the default constructor
20696 is protected otherwise its public (before, we were always public).
20698 * statement.cs (Fixed.Resolve): Catch a couple more errors in the
20701 (Using.EmitLocalVariableDecls): Applied patch from Benjamin
20702 Jemlich that fixes bug #52597, MCS was generating invalid code for
20703 idisposable structs. Thanks to Ben for following up with this
20706 2004-01-06 Miguel de Icaza <miguel@ximian.com>
20708 * driver.cs: Allow assemblies without code to be generated, fixes
20711 2004-01-07 Nick Drochak <ndrochak@gol.com>
20713 * attribute.cs: Remove unneeded catch variables. Eliminates a warning.
20715 2004-01-05 Miguel de Icaza <miguel@ximian.com>
20717 * cs-parser.jay: Add rules to improve error reporting if fields or
20718 methods are declared at the namespace level (error 116)
20720 * Add rules to catch event add/remove
20722 2004-01-04 David Sheldon <dave-mono@earth.li>
20724 * expression.cs: Added matching ")" to error message for
20727 2004-01-03 Todd Berman <tberman@gentoo.org>
20729 * ecore.cs, attribute.cs:
20730 Applying fix from #52429.
20732 2004-01-03 Ben Maurer <bmaurer@users.sourceforge.net>
20734 * ecore.cs, expression.cs, statement.cs:
20735 Total rewrite of how we handle branching. We
20736 now handle complex boolean expressions with fewer
20737 jumps. As well if (x == 0) no longer emits a ceq.
20739 if (x is Foo) is much faster now, because we generate
20742 Overall, we get a pretty big improvement on our benchmark
20743 tests. The code we generate is smaller and more readable.
20745 I did a full two-stage bootstrap. The patch was reviewed
20746 by Martin and Miguel.
20748 2004-01-03 Ben Maurer <bmaurer@users.sourceforge.net>
20750 * cs-parser.jay: Make primary_expression not take a QI.
20751 we dont need this because the member_access rule covers
20752 us here. So we replace the rule with just IDENTIFIER.
20754 This has two good effects. First, we remove a s/r conflict.
20755 Second, we allocate many fewer QualifiedIdentifier objects.
20757 2004-01-03 Ben Maurer <bmaurer@users.sourceforge.net>
20759 * attribute.cs: Handle MarshalAs attributes as pseudo, and
20760 set the correct information via SRE. This prevents
20761 hanging on the MS runtime. Fixes #29374.
20763 2004-01-03 Ben Maurer <bmaurer@users.sourceforge.net>
20765 * convert.cs: correctly handle conversions to value types
20766 from Enum and ValueType as unboxing conversions.
20768 Fixes bug #52569. Patch by Benjamin Jemlich.
20770 2004-01-02 Ravi Pratap <ravi@ximian.com>
20772 * expression.cs (BetterConversion): Prefer int -> uint
20773 over int -> ulong (csc's behaviour). This fixed bug #52046.
20775 2004-01-02 Ben Maurer <bmaurer@users.sourceforge.net>
20777 * decl.cs (MemberCache.FindMembers): now returns a
20780 * typemanager.cs: In general, go with with ^^.
20781 (CopyNewMethods): take an IList.
20782 (RealMemberLookup): Only allocate an arraylist
20783 if we copy from two sets of methods.
20785 This change basically does two things:
20786 1) Fewer array lists allocated due to CopyNewMethods.
20787 2) the explicit cast in MemberList costed ALOT.
20789 2004-01-02 Zoltan Varga <vargaz@freemail.hu>
20791 * cs-tokenizer.cs (consume_identifier) driver.cs: Cache identifiers in
20792 a hashtable to avoid needless string allocations when an identifier is
20793 used more than once (the common case).
20795 2004-01-01 Ben Maurer <bmaurer@users.sourceforge.net>
20797 * pending.cs: MS's TypeBuilder.GetInterfaces ()
20798 is broken, it will not return anything. So, we
20799 have to use the information we have in mcs to
20802 * typemanager.cs: Add a cache for GetInterfaces,
20803 since this will now be used more often (due to ^^)
20805 (GetExplicitInterfaces) New method that gets the
20806 declared, not effective, interfaces on a type
20807 builder (eg, if you have interface IFoo, interface
20808 IBar, Foo : IFoo, Bar : Foo, IBar, GetExplInt (Bar) ==
20811 This patch makes MCS able to bootstrap itself on
20814 2004-01-01 Ben Maurer <bmaurer@users.sourceforge.net>
20816 * expression.cs: Remove the Nop's that Miguel put
20819 2003-12-31 Ben Maurer <bmaurer@users.sourceforge.net>
20821 * report.cs, codegen.cs: Give the real stack trace to
20822 the error when an exception is thrown.
20824 2003-12-31 Ben Maurer <bmaurer@users.sourceforge.net>
20826 * decl.cs: only allocate hashtables for ifaces if
20829 2003-12-31 Ben Maurer <bmaurer@users.sourceforge.net>
20831 * expression.cs: fix the error from cs0121-2.cs
20832 (a parent interface has two child interfaces that
20833 have a function with the same name and 0 params
20834 and the function is called through the parent).
20836 2003-12-30 Ben Maurer <bmaurer@users.sourceforge.net>
20838 * class.cs, rootcontext.cs, typmanager.cs: do not
20841 2003-12-28 Ben Maurer <bmaurer@users.sourceforge.net>
20843 * codegen.cs: remove stack for the ec flow branching.
20844 It is already a linked list, so no need.
20846 2003-12-27 Ben Maurer <bmaurer@users.sourceforge.net>
20848 * Makefile: Allow custom profiler here.
20850 2003-12-26 Ben Maurer <bmaurer@users.sourceforge.net>
20852 * typemanager.cs (LookupType):
20853 - Use a static char [], because split takes
20854 a param array for args, so it was allocating
20856 - Do not store true in a hashtable, it boxes.
20858 2003-12-26 Ben Maurer <bmaurer@users.sourceforge.net>
20860 * flowanalysis.cs: bytify common enums.
20862 2003-12-25 Ben Maurer <bmaurer@users.sourceforge.net>
20864 * modifiers.cs: Add a new set of flags for the
20865 flags allowed on explicit interface impls.
20866 * cs-parser.jay: catch the use of modifiers in
20867 interfaces correctly.
20868 * class.cs: catch private void IFoo.Blah ().
20870 All related to bug #50572.
20872 2003-12-25 Ben Maurer <bmaurer@users.sourceforge.net>
20874 * decl.cs: Rewrite the consistant accessability checking.
20875 Accessability is not linear, it must be implemented in
20876 a tableish way. Fixes #49704.
20878 2003-12-25 Ben Maurer <bmaurer@users.sourceforge.net>
20880 * expression.cs: Handle negation in a checked context.
20881 We must use subtraction from zero. Fixes #38674.
20883 2003-12-23 Ben Maurer <bmaurer@users.sourceforge.net>
20885 * class.cs: Ignore static void main in DLLs.
20886 * rootcontext.cs: Handle the target type here,
20887 since we are have to access it from class.cs
20888 * driver.cs: account for the above.
20890 2003-12-23 Ben Maurer <bmaurer@users.sourceforge.net>
20892 * report.cs: Give line numbers and files if available.
20894 2003-12-20 Zoltan Varga <vargaz@freemail.hu>
20896 * driver.cs: Implement /addmodule.
20898 * typemanager.cs: Change 'modules' field so it now contains Modules not
20901 2003-12-20 Martin Baulig <martin@ximian.com>
20903 * class.cs (TypeContainer.DefineMembers): Don't do the CS0649 check here.
20904 (FieldBase.IsAssigned): Removed this field.
20905 (FieldBase.SetAssigned): New public method.
20906 (TypeContainer.Emit): Make the CS0169/CS0649 checks actually work.
20908 2003-12-20 Martin Baulig <martin@ximian.com>
20910 * expression.cs (LocalVariableReference.DoResolve): Don't set
20911 `vi.Used' if we're called from DoResolveLValue().
20913 * statement.cs (Block.DoResolve): `ec.DoEndFlowBranching()' now
20914 returns the usage vector it just merged into the current one -
20915 pass this one to UsageWarning().
20916 (Block.UsageWarning): Take the `FlowBranching.UsageVector' instead
20917 of the `EmitContext', don't call this recursively on our children.
20919 2003-12-19 Zoltan Varga <vargaz@freemail.hu>
20921 * driver.cs: Implement /target:module.
20923 2003-12-18 Zoltan Varga <vargaz@freemail.hu>
20925 * support.cs (CharArrayHashtable): New helper class.
20927 * cs-tokenizer.cs: Store keywords in a hashtable indexed by
20928 char arrays, not strings, so we can avoid creating a string in
20929 consume_identifier if the identifier is a keyword.
20931 2003-12-16 Martin Baulig <martin@ximian.com>
20933 * statement.cs (LocalInfo.Assigned): Removed this property.
20934 (LocalInfo.Flags): Removed `Assigned'.
20935 (LocalInfo.IsAssigned): New public method; takes the EmitContext
20936 and uses flow analysis.
20937 (Block.UsageWarning): Made this method private.
20938 (Block.Resolve): Call UsageWarning() if appropriate.
20940 * expression.cs (LocalVariableReference.DoResolve): Always set
20941 LocalInfo.Used here.
20943 2003-12-13 Martin Baulig <martin@ximian.com>
20945 * statement.cs (Statement.DoEmit, Statement.Emit): Don't return
20946 any value here; we're now using flow analysis to figure out
20947 whether a statement/block returns a value.
20949 2003-12-13 Martin Baulig <martin@ximian.com>
20951 * flowanalysis.cs (UsageVector.MergeFinallyOrigins): Made this
20953 (FlowBranching.MergeFinally): Don't call
20954 `branching.CheckOutParameters()' here, this is called in
20956 (FlowBranchingException.AddSibling): Call MergeFinallyOrigins()
20957 when adding the `finally' vector.
20959 2003-12-13 Martin Baulig <martin@ximian.com>
20962 (UsageVector.MergeJumpOrigins, FlowBranching.Label): Make this
20963 actually work and also fix #48962.
20965 2003-12-12 Ben Maurer <bmaurer@users.sourceforge.net>
20967 * decl.cs: Do not check System.Object for nested types,
20968 since we know it does not have any. Big bang for buck:
20971 Run 1: 8.35 seconds
20972 Run 2: 8.32 seconds
20973 corlib: 17.99 seconds
20975 Run 1: 8.17 seconds
20976 Run 2: 8.17 seconds
20977 corlib: 17.39 seconds
20979 2003-12-11 Ben Maurer <bmaurer@users.sourceforge.net>
20981 * class.cs (FindMembers): Allocate arraylists on demand. Most of the
20982 time we are returning 0 members, so we save alot here.
20984 2003-12-11 Martin Baulig <martin@ximian.com>
20986 * flowanalysis.cs (UsageVector.MergeResult): Renamed this back to
20987 `MergeChild()', also just take the `FlowBranching' as argument;
20988 call Merge() on it and return the result.
20989 (FlowBranching.Merge): We don't need to do anything if we just
20992 2003-12-11 Martin Baulig <martin@ximian.com>
20994 * flowanalysis.cs: Use a list of `UsageVector's instead of storing
20995 them in an `ArrayList' to reduce memory usage. Thanks to Ben
20996 Maurer for this idea.
20998 2003-12-11 Martin Baulig <martin@ximian.com>
21000 * flowanalysis.cs (MergeResult): This class is now gone; we now
21001 use the `UsageVector' for this. The reason for this is that if a
21002 branching just has one sibling, we don't need to "merge" them at
21003 all - that's the next step to do.
21004 (FlowBranching.Merge): We now return a `UsageVector' instead of a
21007 2003-12-11 Martin Baulig <martin@ximian.com>
21009 Reworked flow analyis and made it more precise and bug-free. The
21010 most important change is that we're now using a special `Reachability'
21011 class instead of having "magic" meanings of `FlowReturns'. I'll
21012 do some more cleanups and optimizations and also add some more
21013 documentation this week.
21015 * flowanalysis.cs (Reachability): Added `Throws' and `Barrier';
21016 largely reworked this class.
21017 (FlowReturns): Removed `Unreachable' and `Exception'; we now use
21018 the new `Reachability' class instead of having "magic" values here.
21019 (FlowBranching): We're now using an instance of `Reachability'
21020 instead of having separate `Returns', `Breaks' etc. fields.
21022 * codegen.cs (EmitContext.EmitTopBlock): Set `has_ret' solely
21023 based on flow analysis; ignore the return value of block.Emit ().
21025 2003-12-10 Zoltan Varga <vargaz@freemail.hu>
21027 * driver.cs typemanager.cs: Find the mono extensions to corlib even
21028 if they are private.
21030 2003-12-09 Martin Baulig <martin@ximian.com>
21032 * flowanalyis.cs (FlowBranching.Return, Goto, Throw): Removed;
21033 call them directly on the UsageVector.
21035 2003-12-09 Martin Baulig <martin@ximian.com>
21037 * flowanalysis.cs (FlowBranching.MergeChild, MergeTopBlock):
21038 Changed return type from `FlowReturns' to `Reachability'.
21040 2003-12-09 Martin Baulig <martin@ximian.com>
21042 * flowanalysis.cs (FlowBranching.Reachability): New sealed class.
21043 (FlowBranching.MergeResult): Replaced the `Returns', `Breaks' and
21044 `Reachable' fields with a single `Reachability' one.
21046 2003-12-08 Ben Maurer <bmaurer@users.sourceforge.net>
21048 * class.cs (FindMembers): Remove foreach's.
21053 Run 1: 8.74 seconds
21054 Run 2: 8.71 seconds
21057 Run 1: 8.64 seconds
21058 Run 2: 8.58 seconds
21061 2003-12-08 Ben Maurer <bmaurer@users.sourceforge.net>
21066 This patch does a few things:
21067 1. EmptyStatement is now a singleton, so it is never reallocated.
21068 2. All blah is EmptyStatement constructs have been changed to
21069 blah == EmptyStatement.Value, which is much faster and valid
21070 now that EmptyStatement is a singleton.
21071 3. When resolving a block, rather than allocating a new array for
21072 the non-empty statements, empty statements are replaced with
21073 EmptyStatement.Value
21074 4. Some recursive functions have been made non-recursive.
21075 Mainly the performance impact is from (3), however (1) and (2) are needed for
21076 this to work. (4) does not make a big difference in normal situations, however
21077 it makes the profile look saner.
21082 9.25user 0.23system 0:10.28elapsed 92%CPU (0avgtext+0avgdata 0maxresident)k
21083 9.34user 0.13system 0:10.23elapsed 92%CPU (0avgtext+0avgdata 0maxresident)k
21084 Total memory allocated: 56397 KB
21087 9.13user 0.09system 0:09.64elapsed 95%CPU (0avgtext+0avgdata 0maxresident)k
21088 8.96user 0.24system 0:10.13elapsed 90%CPU (0avgtext+0avgdata 0maxresident)k
21089 Total memory allocated: 55666 KB
21091 2003-12-08 Ben Maurer <bmaurer@users.sourceforge.net>
21093 * support.cs: Rewrite DoubleHash to use its own impl. Is faster
21094 than the hashtable in a hashtable version
21096 * decl.cs: Right now, whenever we try to lookup a type inside a namespace,
21097 we always end up concating a string. This results in a huge perf
21098 loss, because many strings have to be tracked by the GC. In this
21099 patch, we first use a hashtable that works with two keys, so that
21100 the strings do not need to be concat'ed.
21104 Run 1: 8.74 seconds
21105 Run 2: 8.71 seconds
21108 Run 1: 8.65 seconds
21109 Run 2: 8.56 seconds
21111 2003-12-08 Ben Maurer <bmaurer@users.sourceforge.net>
21113 * Makefile: Add a new target `do-time' that does a quick and simple
21114 profile, leaving easy to parse output.
21116 2003-12-08 Zoltan Varga <vargaz@freemail.hu>
21118 * codegen.cs (Init): Create the dynamic assembly with
21119 AssemblyBuilderAccess.Save, to enable some optimizations in the runtime.
21121 2003-12-02 Ben Maurer <bmaurer@users.sourceforge.net>
21123 * support.cs: Make the PtrHashtable use only one
21124 instance of its comparer.
21126 2003-11-30 Zoltan Varga <vargaz@freemail.hu>
21128 * typemanager.cs: Fix lookup of GetNamespaces.
21130 2003-11-29 Miguel de Icaza <miguel@ximian.com>
21132 * expression.cs: Removed redundant line.
21134 * statement.cs (Block.Resolve, Block.Emit): Avoid foreach on
21135 ArrayLists, use for loops with bounds.
21137 * flowanalysis.cs (FlowBranching.Merge): Avoid foreach on
21140 * expression.cs (Invocation.OverloadResolve): Avoid foreach on
21141 arraylists, use for loop with bounds.
21143 The above three changes give us a 0.071 second performance
21144 improvement out of 3.294 seconds down to 3.223. On my machine
21145 the above changes reduced the memory usage by 1,387 KB during
21146 compiler bootstrap.
21148 * cs-parser.jay (QualifiedIdentifier): New class used to represent
21149 QualifiedIdentifiers. Before we created a new string through
21150 concatenation, and mostly later on, the result would be
21151 manipulated by DecomposeQI through string manipulation.
21153 This reduced the compiler memory usage for bootstrapping from
21154 59380 KB to 59007 KB on my machine, 373 KB, and also reduced the
21155 compile times in 0.05 seconds.
21157 2003-11-28 Dick Porter <dick@ximian.com>
21159 * support.cs: Do string compares with the Invariant culture.
21167 * class.cs: Use the char forms of IndexOf and LastIndexOf, so that
21168 the comparison is done with the Invariant culture.
21170 2003-11-27 Miguel de Icaza <miguel@ximian.com>
21172 * statement.cs (Foreach.TryType): Use DeclaredOnly to find the
21173 GetEnumerator method.
21175 (ProbeCollectionType): Iterate starting at the most specific type
21176 upwards looking for a GetEnumerator
21178 * expression.cs: Shift count can be up to 31 for int/uint and 63
21181 2003-11-26 Miguel de Icaza <miguel@ximian.com>
21183 * statement.cs (Block.LookupLabel): Also look for the label on the
21184 children blocks. Use a hash table to keep track of visited
21187 * cfold.cs (IntConstant to UIntConstant mapping): Only return if
21188 we actually did transform the other operand, otherwise fall back
21189 to the common codepath that casts to long.
21191 * cs-tokenizer.cs: Use the same code pattern as the int case.
21192 Maybe I should do the parsing myself, and avoid depending on the
21193 Parse routines to get this done.
21195 2003-11-25 Miguel de Icaza <miguel@ximian.com>
21197 * expression.cs: Apply fix from l_m@pacbell.net (Laurent Morichetti),
21198 which fixes bug 51347. This time test it.
21200 * expression.cs: Make TypeOfVoid derive from TypeOf, so code in
21201 attributes for example can not tell the difference between these.
21202 The difference was only a syntax feature of the language.
21204 * attribute.cs: Apply attributes to delegates.
21206 * delegate.cs: Call the apply attributes method.
21208 2003-11-24 Miguel de Icaza <miguel@ximian.com>
21210 * convert.cs (TryImplicitIntConversion): One line bug fix: we were
21211 comparing 0 vs Byte.MinValue, not the value
21213 (ImplicitConversionRequired): When reporting a conversion error,
21214 use error 31 to print out the constant error instead of the
21217 * expression.cs: Apply fix from l_m@pacbell.net (Laurent Morichetti),
21218 which fixes bug 51347.
21220 2003-11-22 Miguel de Icaza <miguel@ximian.com>
21222 * driver.cs: Applied patch from gert.driesen@pandora.be (Gert Driesen)
21223 which fixes the -warnaserror command line option.
21225 2003-11-21 Miguel de Icaza <miguel@ximian.com>
21227 * cfold.cs (DoNumericPromotions): During constant folding of
21228 additions on UIntConstant, special case intconstants with
21229 IntConstants like we do on the expression binary operator.
21231 2003-11-12 Miguel de Icaza <miguel@ximian.com>
21233 * convert.cs (ImplicitReferenceConversion): We were missing a case
21234 (System.Enum are not value types or class types, so we need to
21235 classify them separatedly).
21237 * driver.cs: We do not support error 2007.
21239 2003-11-12 Jackson Harper <jackson@ximian.com>
21241 * driver.cs: Use corlib.dll or mscorlib.dll when looking up the
21242 system directory. Also use the full file name so users can
21243 libraries names mscorlib-o-tron.dll in a non system dir.
21245 2003-11-10 Martin Baulig <martin@ximian.com>
21247 * typemanager.cs (TypeManager.ResolveExpressionTypes): Removed.
21248 (TypeManager.InitCoreTypes): Initialize them here, but instead of
21249 calling `ResolveType()' on them, directly assign their `Type'.
21251 2003-11-08 Martin Baulig <martin@ximian.com>
21253 * class.cs (TypeContainer.GetClassBases): Use TypeExpr's for the
21254 return value and the `out parent' parameter.
21255 (TypeContainer.DefineType): Moved the CS0644 check into
21256 GetClassBases(). Don't pass the interface types to the
21257 `builder.DefineType()'/`builder.DefineNestedType()', but resolve
21258 them later and then call `TypeBuilder.AddInterfaceImplementation()'.
21260 * ecore.cs (TypeExpr.IsAttribute): New property.
21261 (TypeExpr.GetInterfaces): New method.
21263 * interface.cs (Interface.GetInterfaceTypeByName): Return a
21264 TypeExpr instead of a Type.
21265 (Interface.GetInterfaceBases): Return TypeExpr's instead of Type's.
21266 (Interface.DefineType): Don't pass the interface types to the
21267 `builder.Definetype()'/`builder.DefineNestedType()', but resolve
21268 them later and then call `TypeBulider.AddInterfaceImplementation()'.
21270 * typemanager.cs (TypeManager.AddUserType): Take a `TypeExpr[]'
21271 instead of a `Type[]'.
21272 (TypeManager.RegisterBuilder): Likewise.
21273 (TypeManager.AddUserInterface): Likewise.
21274 (TypeManager.ExpandInterfaces): Take a `Type[]' instead of a
21275 `Type[]' and also return a `TypeExpr[]'.
21276 (TypeManager.GetInterfaces): Return a `TypeExpr[]'.
21278 2003-11-08 Martin Baulig <martin@ximian.com>
21280 * decl.cs (DeclSpace.ResolveTypeExpr): Return a TypeExpr, not an
21283 2003-11-08 Martin Baulig <martin@ximian.com>
21285 * decl.cs (DeclSpace.GetTypeResolveEmitContext): Call
21286 TypeManager.ResolveExpressionTypes().
21288 * ecore.cs (Expression.ResolveAsTypeTerminal): Return a TypeExpr
21289 instead of an Expression.
21290 (TypeExpr): This is now an abstract base class for `TypeExpression'.
21291 (TypeExpression): New public class; formerly known as `TypeExpr'.
21293 * expression.cs (ComposedCast): Derive from TypeExpr.
21295 * typemanager.cs (TypeManager.system_*_expr): These are now
21296 TypExpr's instead of Expression's.
21297 (TypeManager.ResolveExpressionTypes): New public static function;
21298 called from DeclSpace.GetTypeResolveEmitContext() to resolve all
21301 2003-11-06 Miguel de Icaza <miguel@ximian.com>
21303 * expression.cs (New.DoResolve): Do not dereference value that
21304 might be a null return.
21306 * statement.cs (Block.EmitMeta): Use the Const.ChangeType to make
21307 sure that the constant value has the right type. Fixes an
21308 unreported bug, similar to 50425.
21310 * const.cs (Const.LookupConstantValue): Call
21311 ImplicitStandardConversionExists before doing a conversion to
21312 avoid havng the TypeManager.ChangeType do conversions.
21314 Reduced the number of casts used
21316 (Const.ChangeType): New routine to enable reuse of the constant
21317 type changing code from statement.
21319 * typemanager.cs (ChangeType): Move common initialization to
21320 static global variables.
21324 * convert.cs (ImplicitReferenceConversion): Somehow we allowed
21325 every value type to go through, even if it was void. Fix that.
21327 * cs-tokenizer.cs: Use is_identifier_start_character on the start
21328 character of the define, and the is_identifier_part_character for
21329 the rest of the string.
21331 2003-11-05 Miguel de Icaza <miguel@ximian.com>
21333 * expression.cs (UnaryMutator.EmitCode): When I updated
21334 LocalVariableReference.DoResolve, I overdid it, and dropped an
21335 optimization done on local variable references.
21337 2003-11-04 Miguel de Icaza <miguel@ximian.com>
21339 * ecore.cs: Convert the return from Ldlen into an int.
21341 2003-10-20 Miguel de Icaza <miguel@ximian.com>
21343 * decl.cs (DeclSpace.GetAccessLevel): Handle NotPublic case for
21344 the accessibility, this is a special case for toplevel non-public
21345 classes (internal for instance).
21347 2003-10-20 Nick Drochak <ndrochak@gol.com>
21349 * ecore.cs: Fix typo and build. Needed another right paren.
21351 2003-10-19 Miguel de Icaza <miguel@ximian.com>
21353 * ecore.cs: Applied fix from Ben Maurer. We were handling in the
21354 `internal' case regular and protected, but not allowing protected
21355 to be evaluated later. Bug 49840
21357 2003-10-15 Miguel de Icaza <miguel@ximian.com>
21359 * statement.cs (Switch.TableSwitchEmit): Compare the upper bound
21360 to kb.Nlast, and not the kb.nFirst to isolate the switch
21363 Extract the underlying type, so enumerations of long/ulong are
21364 treated like long/ulong.
21366 2003-10-14 Miguel de Icaza <miguel@ximian.com>
21368 * expression.cs (New): Overload the meaning of RequestedType to
21369 track the possible creation of the NewDelegate type, since
21370 DoResolve is invoked more than once for new constructors on field
21373 See bugs: #48800 and #37014
21375 * cs-parser.jay (declare_local_constants): Take an arraylist
21376 instead of a single constant.
21378 (local_constant_declaration): It should take a
21379 constant_declarators, not a constant_declarator. Fixes 49487
21381 * convert.cs: Fix error report.
21383 2003-10-13 Jackson Harper <jackson@ximian.com>
21385 * typemanager.cs (TypeToCoreType): Add float and double this fixes
21388 2003-10-09 Martin Baulig <martin@ximian.com>
21390 * class.cs (MethodCore): Added additional `DeclSpace ds' argument
21392 (MethodCore.DoDefineParameters): Removed the TypeContainer
21393 argument; use the DeclSpace which was passed to the .ctor instead.
21394 (MethodCore.CheckParameter): Take a DeclSpace instead of a
21395 TypeContainer; we only need a DeclSpace here.
21397 2003-10-09 Martin Baulig <martin@ximian.com>
21399 * class.cs (MethodData): Added additional `DeclSpace ds' argument
21401 (MethodData.Define, MethodData.Emit): Pass the `ds' to the
21402 EmitContext's .ctor.
21404 2003-10-09 Martin Baulig <martin@ximian.com>
21406 * decl.cs (DeclSpace.AsAccessible): Moved here from TypeContainer.
21407 (AccessLevel, CheckAccessLevel, GetAccessLevel): They're used by
21408 AsAccessible(), moved them as well.
21410 * class.cs (TypeContainer.AsAccessible): Moved to DeclSpace.
21412 2003-10-08 Atsushi Enomoto <ginga@kit.hi-ho.ne.jp>
21414 * cs-parser.jay : Renamed yyName to yyNames related to jay.
21416 2003-10-07 Miguel de Icaza <miguel@ximian.com>
21418 * expression.cs (Binary.Emit.GreatherThanOrEqual): Fix the code
21419 generation for >=, as spotted by Paolo, bug 48679.
21420 Patch from David Waite.
21422 * cs-tokenizer.cs: Add handling for #pragma.
21424 * cs-parser.jay: Allow for both yield and yield return in the
21425 syntax. The anti-cobolization of C# fight will go on!
21427 * class.cs (TypeBuilder.DefineType): Catch error condition here
21428 (Parent.DefineType erroring out and returning null).
21430 * expression.cs (ArrayCreation.EmitDynamicInitializers): When
21431 coping with enumerations variables, we were mistakenly processing
21432 them as a regular value type instead of built-in types. Fixes the
21435 * typemanager.cs (IsBuiltinOrEnum): New method.
21437 2003-09-30 Miguel de Icaza <miguel@ximian.com>
21439 * cs-parser.jay: Upgrade: yield now needs the return clause.
21441 2003-09-19 Martin Baulig <martin@ximian.com>
21443 * decl.cs (MemberCache.SetupCacheForInterface): Take a
21444 `MemberCache parent' argument. Normally, an interface doesn't
21445 have a parent type except System.Object, but we use this in gmcs
21446 for generic type parameters.
21448 2003-09-18 Martin Baulig <martin@ximian.com>
21450 * typemanager.cs (TypeHandle.ctor): Set `IsInterface' solely based
21451 on `type.IsInterface'; don't check whether the type has a parent
21452 to determine whether it's an interface.
21454 2003-09-15 Martin Baulig <martin@ximian.com>
21456 * class.cs (TypeContainer.DefineType): Added an error flag to
21457 avoid reporting duplicate CS0146's ("class definition is
21460 * driver.cs (Driver.MainDriver): Abort if
21461 RootContext.ResolveTree() reported any errors.
21463 2003-09-07 Martin Baulig <martin@ximian.com>
21465 * report.cs (Error, Warning): Added overloaded versions which take
21466 a `params object[] args' and call String.Format().
21468 2003-09-07 Martin Baulig <martin@ximian.com>
21470 * decl.cs (DeclSpace..ctor): Don't call
21471 NamespaceEntry.DefineName() here; do it in RecordDecl() which is
21472 called from Tree.RecordDecl(). Fixes the CS0101 reporting.
21473 (DeclSpace.RecordDecl): New method.
21475 * tree.cs (Tree.RecordDecl): Call ds.RecordDecl().
21477 2003-09-02 Ravi Pratap <ravi@ximian.com>
21479 * attribute.cs (CheckAttributeTarget): Ensure that we allow return
21480 value attributes to be applied to ParameterBuilders.
21482 * class.cs (MethodCore.LabelParameters): Make static and more
21483 generic so that it can be used from other places - like interface
21484 methods, for instance.
21486 * interface.cs (Interface.Emit): Call LabelParameters before
21487 emitting attributes on the InterfaceMethod.
21489 2003-08-26 Martin Baulig <martin@ximian.com>
21491 * ecore.cs (SimpleName.SimpleNameResolve): Look for members before
21492 resolving aliases; fixes #47927.
21494 2003-08-26 Martin Baulig <martin@ximian.com>
21496 * statement.cs (Using.DoResolve): This is internally emitting a
21497 try/finally clause, so we need to set ec.NeedExplicitReturn if we
21498 do not always return. Fixes #47681.
21500 2003-08-26 Martin Baulig <martin@ximian.com>
21502 * decl.cs (MemberCore): Moved WarningNotHiding(),
21503 Error_CannotChangeAccessModifiers() and CheckMethodAgainstBase()
21505 (AdditionResult): Make this nested in DeclSpace.
21506 (DeclSpace.ctor): The .ctor now takes an additional NamespaceEntry
21507 argument; call NamespaceEntry.Define() unless we're nested in a
21510 * namespace.cs (Namespace.DefineName): New public function. This
21511 is called from DeclSpace's .ctor to add
21512 (Namespace.Lookup): Include DeclSpaces in the lookup.
21514 * class.cs (Operator): Derive from MemberBase, not MemberCore.
21516 * const.cs (Const): Derive from MemberBase, not MemberCore.
21518 2003-08-25 Martin Baulig <martin@ximian.com>
21520 * convert.cs (Convert.ExplicitReferenceConversion): When
21521 converting from an interface type to a class, unbox if the target
21522 type is a struct type. Fixes #47822.
21524 2003-08-24 Gonzalo Paniagua Javier <gonzalo@ximian.com>
21526 * typemanager.cs: fixed the values of MethodFlags. Closes #47855 and
21529 2003-08-22 Martin Baulig <martin@ximian.com>
21531 * class.cs (TypeManager.DefineType): When defining a nested type,
21532 call DefineType() on our parent; fixes #47801.
21534 2003-08-22 Martin Baulig <martin@ximian.com>
21536 * class.cs (MethodData.Define): While checking if a method is an
21537 interface implementation, improve the test a bit more to fix #47654.
21539 2003-08-22 Martin Baulig <martin@ximian.com>
21541 * expression.cs (Probe.DoResolve): Check whether `expr' resolved
21542 correctly; fixes #47722.
21544 2003-08-22 Martin Baulig <martin@ximian.com>
21546 * expression.cs (UnaryMutator.ResolveVariable): If the target is a
21547 LocalVariableReference, ensure it's not read-only. Fixes #47536.
21549 * statement.cs (Fixed.DoResolve): Make all variables read-only.
21551 2003-08-22 Martin Baulig <martin@ximian.com>
21553 * ecore.cs (FieldExpr.DoResolveLValue): Static read-only fields
21554 can only be assigned in static constructors. Fixes #47161.
21556 2003-08-22 Martin Baulig <martin@ximian.com>
21558 Rewrote and improved the flow analysis code.
21560 * flowbranching.cs (FlowBranching): Make this class abstract.
21561 (FlowBranching.CreateBranching): New static function to create a
21562 new flow branching.
21563 (FlowBranchingBlock, FlowBranchingException): New classes.
21564 (FlowBranching.UsageVector.Type): New public readonly field.
21565 (FlowBranching.UsageVector.Breaks): Removed the setter.
21566 (FlowBranching.UsageVector.Returns): Removed the setter.
21567 (FlowBranching.UsageVector): Added Break(), Return(),
21568 NeverReachable() and Throw() methods to modify the reachability.
21569 (FlowBranching.UsageVector.MergeChildren): Removed, this is now
21570 done by FlowBranching.Merge().
21571 (FlowBranching.UsageVector.MergeChild): New method; merges the
21572 merge result into the current vector.
21573 (FlowBranching.Merge): New abstract method to merge a branching.
21575 2003-08-12 Martin Baulig <martin@ximian.com>
21577 * expression.cs (Indirection.CacheTemporaries): Create the
21578 LocalTemporary with the pointer type, not its element type.
21580 2003-08-10 Miguel de Icaza <miguel@ximian.com>
21582 * cs-parser.jay: FIRST_KEYWORD, LAST_KEYWORD: used to know if a
21583 token was a keyword or not.
21585 Add `error' options where an IDENTIFIER was expected; Provide
21586 CheckToken and CheckIdentifierToken convenience error reporting
21589 Do not use `DeclSpace.Namespace', use `DeclSpace.NamespaceEntry'.
21591 * decl.cs: Rename `NamespaceEntry Namespace' public field into
21592 NameSpaceEntry NameSpaceEntry.
21594 (LookupInterfaceOrClass): Avoid creating a full qualified name
21595 from namespace and name: avoid doing lookups when we know the
21596 namespace is non-existant. Use new Tree.LookupByNamespace which
21597 looks up DeclSpaces based on their namespace, name pair.
21599 * driver.cs: Provide a new `parser verbose' to display the
21600 exception thrown during parsing. This is turned off by default
21601 now, so the output of a failure from mcs is more graceful.
21603 * namespace.cs: Track all the namespaces defined in a hashtable
21606 (IsNamespace): New method
21608 2003-08-09 Miguel de Icaza <miguel@ximian.com>
21610 * namespace.cs: Remove redundant call; Avoid using MakeFQN when
21611 we know that we need to concatenate (full typename can never be
21616 * statement.cs: Use a bitfield; Do not initialize to null things
21617 which are done by the constructor by default.
21619 * cs-parser.jay: bug fix, parameter was 4, not 3.
21621 * expression.cs: Just use the property;
21623 * statement.cs: No need for GetVariableInfo method.
21625 2003-08-08 Martin Baulig <martin@ximian.com>
21627 * flowanalysis.cs (FlowReturns): This is now nested in the
21628 `FlowBranching' class.
21629 (MyBitVector): Moved this here from statement.cs.
21630 (FlowBranching.SiblingType): New enum type.
21631 (FlowBranching.CreateSibling): Added `SiblingType' argument.
21633 2003-08-07 Martin Baulig <martin@ximian.com>
21635 * flowanalysis.cs (FlowBranchingType): This is now nested in the
21636 `FlowBranching' class and called `BranchingType'.
21638 2003-08-07 Martin Baulig <martin@ximian.com>
21640 * flowanalysis.cs: Moved all the control flow analysis code into
21643 2003-08-07 Martin Baulig <martin@ximian.com>
21645 * assign.cs (Assign.DoResolve): `target' must either be an
21646 IAssignMethod or an EventAccess; report a CS0131 otherwise. Fixes
21649 2003-08-07 Miguel de Icaza <miguel@ximian.com>
21651 * expression.cs (BinaryMethod): This kind of expression is created by the
21652 Binary class if it determines that the operator has to be handled
21655 (BinaryDelegate): This kind of expression is created if we are
21656 dealing with a + or - operator on delegates.
21658 (Binary): remove method, argumetns, and DelegateOperator: when
21659 dealing with methods,
21661 * ecore.cs (EventExpr.EmitAddOrRemove): Update to new layout.
21663 * statement.cs (Block): use bitfields for the three extra booleans
21664 we had in use. Remove unused topblock parameter.
21666 * codegen.cs: Remove unecessary argument to Block.EmitTopBlock
21668 * assign.cs: Drop extra unneeded tests.
21670 2003-08-06 Miguel de Icaza <miguel@ximian.com>
21672 * iterators.cs (Mapvariable): provide a mechanism to use prefixes.
21674 * statement.cs (Foreach): Use VariableStorage instead of
21677 * codegen.cs (VariableStorage): New class used by clients that
21678 require a variable stored: locals or fields for variables that
21679 need to live across yield.
21681 Maybe provide a convenience api for EmitThis+EmitLoad?
21683 (GetTemporaryLocal, FreeTemporaryLocal): Recycle
21686 2003-08-05 Miguel de Icaza <miguel@ximian.com>
21688 * codegen.cs (RemapLocal, RemapLocalLValue, RemapParameter,
21689 RemapParameterLValue): New methods that are used to turn a
21690 precomputed FieldInfo into an expression like this:
21694 The idea is to use this instead of making LocalVariableReference
21695 have more than one meaning.
21697 * cs-parser.jay: Add error production to BASE.
21699 * ecore.cs: Deal with TypeManager.GetField returning null, which
21700 is now a valid return value.
21702 (FieldExprNoAddress): New expression for Fields whose address can
21705 * expression.cs (LocalVariableReference): During the resolve
21706 phases, create new expressions if we are in a remapping context.
21707 Remove code that dealt with remapping here.
21709 (ParameterReference): same.
21711 (ProxyInstance): New expression, like the `This' expression, but
21712 it is born fully resolved. We know what we are doing, so remove
21713 the errors that are targeted to user-provided uses of `this'.
21715 * statement.cs (Foreach): our variable is now stored as an
21716 Expression; During resolution, follow the protocol, dont just
21717 assume it will return this.
21719 2003-08-06 Martin Baulig <martin@ximian.com>
21721 * support.cs (SeekableStreamReader.cs): New public class.
21723 * cs-tokenizer.cs, cs-parser.jay, driver.cs: Use the new
21724 SeekableStreamReader instead of the normal StreamReader.
21726 2003-08-04 Martin Baulig <martin@ximian.com>
21728 * cs-parser.jay (CLOSE_PARENS_CAST, CLOSE_PARENS_NO_CAST,
21729 CLOSE_PARENS_OPEN_PARENS, CLOSE_PARENS_MINUS): New tokens to
21730 deambiguate casts and delegate invocations.
21731 (parenthesized_expression): Use the new tokens to ensure this is
21732 not a cast of method invocation.
21734 * cs-tokenizer.cs (is_punct): Return one of the new special tokens
21735 when reading a `)' and Deambiguate_CloseParens () was previously
21738 * expression.cs (ParenthesizedExpression): New class. This is
21739 just used for the CS0075 test.
21740 (Binary.DoResolve): Check for CS0075.
21742 2003-07-29 Ravi Pratap <ravi@ximian.com>
21744 * expression.cs (Invocation.MakeUnionSet): Patch from Lluis
21745 Sanchez : use TypeManager.ArrayContainsMethod instead of a direct
21746 reference comparison.
21748 (TypeManager.ArrayContainsMethod): When we have a MethodInfo, also
21749 examine the ReturnType for equality - this is necessary in the
21750 cases of implicit and explicit operators whose signature also
21751 includes the return type.
21753 2003-07-26 Miguel de Icaza <miguel@ximian.com>
21755 * namespace.cs: Cache the result of the namespace computation,
21756 instead of computing it every time.
21758 2003-07-24 Miguel de Icaza <miguel@ximian.com>
21760 * decl.cs: Use a global arraylist that we reuse over invocations
21761 to avoid excesive memory consumption. Reduces memory usage on an
21762 mcs compile by one meg (45 average).
21764 * typemanager.cs (LookupTypeReflection): In .NET pointers are
21765 private, work around that.
21767 2003-07-23 Miguel de Icaza <miguel@ximian.com>
21769 * literal.cs (IntLiteral): Define Zero and One static literals.
21771 * cs-parser.jay (integer_literal): use static literals to reduce
21772 memory usage for the most used literals (0, 1 and -1). 211kb
21773 reduced in memory usage.
21775 Replace all calls to `new ArrayList' with `new
21776 ArrayList(4)' which is a good average number for most allocations,
21777 and also requires only 16 bytes of memory for its buffer by
21780 This reduced MCS memory usage in seven megabytes for the RSS after
21783 2003-07-28 Ravi Pratap <ravi@ximian.com>
21785 * expression.cs (Invocation.OverloadResolve): Fix the algorithm to
21786 handle params methods the correct way by forming only one
21787 applicable set with params and normal methods in them. Earlier we
21788 were looking at params methods only if we found no normal methods
21789 which was not the correct thing to do.
21791 (Invocation.BetterFunction): Take separate arguments indicating
21792 when candidate and the best method are params methods in their
21795 This fixes bugs #43367 and #46199.
21797 * attribute.cs: Documentation updates.
21799 (CheckAttribute): Rename to CheckAttributeTarget.
21800 (GetValidPlaces): Rename to GetValidTargets.
21802 * expression.cs (Invocation.IsParamsMethodApplicable): Fix trivial
21803 bug - use Convert.ImplicitConversion, not ImplicitUserConversion!
21807 2003-07-28 Martin Baulig <martin@ximian.com>
21809 * class.cs (TypeContainer.DefineMembers): Use the base type's full
21810 name when looking up the base class of a nested class. Fixes #46977.
21812 2003-07-26 Martin Baulig <martin@ximian.com>
21814 * expression.cs (Indexers.Indexer): New nested struct; contains
21815 getter, setter and the indexer's type.
21816 (Indexers.Properties): This is now an ArrayList of
21817 Indexers.Indexer's.
21818 (IndexerAccess.DoResolveLValue): Correctly set the type if the
21819 indexer doesn't have any getters.
21821 * assign.cs (Assign.DoResolve): Also do the implicit conversions
21822 for embedded property and indexer assignments.
21824 2003-07-26 Martin Baulig <martin@ximian.com>
21826 * cs-tokenizer.cs (Tokenizer.xtoken): Report a CS1040 if a
21827 preprocessor directive is not the first non-whitespace character
21830 2003-07-26 Martin Baulig <martin@ximian.com>
21832 * namespace.cs (NamespaceEntry.Lookup): New method; rewrote the
21833 namespace parsing, follow the spec more closely.
21835 * rootcontext.cs (RootContext.NamespaceLookup): Use the new
21836 NamespaceEntry.Lookup().
21838 2003-07-25 Martin Baulig <martin@ximian.com>
21840 * MethodCore.cs (OverridesSomething): New public field; it's set
21841 from TypeContainer.DefineMembers if this method overrides
21842 something (which doesn't need to be a method). Fix #39462.
21844 2003-07-25 Ravi Pratap <ravi@ximian.com>
21846 * typemanager.cs (GetMembers): Ensure that the list of members is
21847 reversed. This keeps things in sync.
21849 * attribute.cs (Attribute.CheckAttribute): Break as soon as we
21850 find an AttributeUsage attribute.
21852 * expression.cs (Invocation.OverloadResolve): Perform the check
21853 which disallows Invoke to be directly called on a Delegate.
21855 (Error_InvokeOnDelegate): Report error cs1533.
21857 2003-07-25 Martin Baulig <martin@ximian.com>
21859 * expression.cs (Indexers.GetIndexersForType): Only look in the
21860 interface hierarchy if the requested type is already an
21861 interface. Fixes #46788 while keeping #46502 fixed.
21863 2003-07-25 Martin Baulig <martin@ximian.com>
21865 * class.cs (TypeContainer.DefineMembers): Check whether all
21866 readonly fields have been assigned and report warning CS0649 if
21869 * statement.cs (LocalInfo.IsFixed): Always return true if this is
21872 2003-07-24 Ravi Pratap <ravi@ximian.com>
21874 * decl.cs (MemberCache.AddMethods): Reverse the order of the array
21875 returned from GetMethods to make things consistent with the
21876 assumptions MCS makes about ordering of methods.
21878 This should comprehensively fix bug #45127 and it does :-)
21880 * ecore.cs (MethodGroupExpr.DeclaringType): Correct bug - the
21881 ordering is actually reverse.
21883 * Clean up some debug messages I left lying around.
21885 * interface.cs (Populate*): Get rid of code which emits attributes
21886 since the stage in which we emit attributes is the 'Emit' stage,
21887 not the define stage.
21889 (Emit): Move attribute emission for interface members here.
21891 2003-07-22 Ravi Pratap <ravi@ximian.com>
21893 * expression.cs (Invocation.OverloadResolve): Follow the spec more
21894 closely: we eliminate methods in base types when we have an
21895 applicable method in a top-level type.
21897 Please see section 14.5.5.1 for an exact description of what goes
21900 This fixes bug #45127 and a host of other related to corlib compilation.
21902 * ecore.cs (MethodGroupExpr.DeclaringType): The element in the
21903 array is the method corresponding to the top-level type (this is
21904 because of the changes made to icall.c) so we change this
21907 (MethodGroupExpr.Name): This too.
21909 * typemanager.cs (GetElementType): New method which does the right
21910 thing when compiling corlib.
21912 * everywhere: Make use of the above in the relevant places.
21914 2003-07-22 Martin Baulig <martin@ximian.com>
21916 * cs-parser.jay (invocation_expression): Moved
21917 `OPEN_PARENS expression CLOSE_PARENS unary_expression' here from
21918 `cast_expression', but create a InvocationOrCast which later
21919 resolves to either an Invocation or a Cast.
21921 * ecore.cs (ExpressionStatement.ResolveStatement): New virtual
21922 method; call this before EmitStatement() to make sure that this
21923 expression can be used as a statement.
21925 * expression.cs (InvocationOrCast): New class; resolves to either
21926 an Invocation or a Cast.
21928 * statement.cs (StatementExpression): Call ResolveStatement() on
21929 the ExpressionStatement before emitting it.
21931 2003-07-21 Martin Baulig <martin@ximian.com>
21933 * expression.cs (Invocation.VerifyArgumentsCompat): Check whether
21934 `ref' and `out' attributes match; fixes #46220.
21935 (MemberAccess.ResolveMemberAccess): You can't reference a type
21936 through an expression; fixes #33180.
21937 (Indexers.GetIndexersForType): Don't return the indexers from
21938 interfaces the class implements; fixes #46502.
21940 2003-07-21 Martin Baulig <martin@ximian.com>
21942 * class.cs (TypeContainer.CheckPairedOperators): Added CS0660 and
21943 CS0661 checks; fixes bug #30442.
21945 2003-07-21 Martin Baulig <martin@ximian.com>
21947 * decl.cs (AdditionResult): Added `Error'.
21949 * enum.cs (AddEnumMember): Report a CS0076 if name is `value__'.
21951 * typemanager.cs (TypeManager.ChangeType): Catch exceptions;
21952 makes cs0031.cs actually work.
21954 2003-07-20 Martin Baulig <martin@ximian.com>
21956 * namespace.cs: Fixed that bug which caused a crash when compiling
21957 the debugger's GUI.
21959 2003-07-20 Miguel de Icaza <miguel@ximian.com>
21961 * typemanager.cs (LookupTypeReflection): Never expose types which
21962 are NotPublic, NestedPrivate, NestedAssembly, or
21963 NestedFamANDAssem. We used to return these, and later do a check
21964 that would report a meaningful error, but the problem is that we
21965 would not get the real match, if there was a name override.
21967 2003-07-18 Miguel de Icaza <miguel@ximian.com>
21969 * namespace.cs (Namespace, Name): Do not compute the namespace
21970 name dynamically, compute it in the constructor. This reduced
21971 memory usage by 1697 KB.
21973 * driver.cs: Use --pause to pause at the end.
21975 2003-07-17 Peter Williams <peter@newton.cx>
21977 * Makefile: Change the name of the test target so that it doesn't
21978 conflict with the recursive test target.
21980 2003-07-17 Miguel de Icaza <miguel@ximian.com>
21982 * expression.cs (LocalVariableReference.Emit, EmitAssign,
21983 AddressOf): Do not use EmitThis, that was wrong, use the actual
21986 2003-07-15 Miguel de Icaza <miguel@ximian.com>
21988 * class.cs (MethodData.Define): While checking if a method is an
21989 interface implementation, improve the test: If we are not public
21990 (use new test here: use the computed MethodAttributes directly,
21991 instead of the parsed modifier flags) check if the `implementing'
21992 method comes from an interface or not.
21994 * pending.cs (VerifyPendingMethods): Slightly better error
21997 * makefile: add test target that does the mcs bootstrap.
21999 2003-07-16 Ravi Pratap <ravi@ximian.com>
22001 * interface.cs (Define): Do nothing here since there are no
22002 members to populate etc. Move the attribute emission out of here
22003 since this was just totally the wrong place to put it. Attribute
22004 application happens during the 'Emit' phase, not in the 'Define'
22007 (Emit): Add this method and move the attribute emission here
22009 * rootcontext.cs (EmitCode): Call the Emit method on interface
22012 2003-07-14 Ravi Pratap M <ravi@ximian.com>
22014 * expression.cs (OverloadResolve): Report error only if Location
22015 is not 'Null' which means that there was a probe going on.
22017 2003-07-14 Martin Baulig <martin@ximian.com>
22019 * expression.cs (ConditionalLogicalOperator): New public class to
22020 implement user defined conditional logical operators.
22021 This is section 14.11.2 in the spec and bug #40505.
22023 2003-07-14 Martin Baulig <martin@ximian.com>
22025 * ecore.cs (FieldExpr.DoResolveLValue): Fixed bug #46198.
22027 2003-07-14 Martin Baulig <martin@ximian.com>
22029 * codegen.cs (EmitContext.InFixedInitializer): New public field.
22031 * ecore.cs (IVariable.VerifyFixed): New interface method.
22033 * expression.cs (Unary.ResolveOperator): When resolving the `&'
22034 operator, check whether the variable is actually fixed. Fixes bug
22035 #36055. Set a variable definitely assigned when taking its
22036 address as required by the spec.
22038 * statement.cs (LocalInfo.IsFixed): New field.
22039 (LocalInfo.MakePinned): Set `IsFixed' to true.
22041 2003-07-14 Ravi Pratap M <ravi@ximian.com>
22043 * attribute.cs (Attribute.Resolve): While doing a Member lookup
22044 for .ctors, ensure that we only ask for members declared in the
22045 attribute type (BindingFlags.DeclaredOnly).
22049 * expression.cs (Error_WrongNumArguments): Report error 1501
22050 correctly the way CSC does.
22052 2003-07-13 Martin Baulig <martin@ximian.com>
22054 * expression.cs (MemberAccess.ResolveAsTypeStep): Try to do a type
22055 lookup on the fully qualified name, to make things like "X.X" work
22056 where "X.X" is a fully qualified type name, but we also have a
22057 namespace "X" in the using list. Fixes #41975.
22059 2003-07-13 Martin Baulig <martin@ximian.com>
22061 * assign.cs (Assign.GetEmbeddedAssign): New protected virtual
22062 function. If we're a CompoundAssign, we need to create an embedded
22063 CompoundAssign, not an embedded Assign.
22064 (Assign.DoResolve): Make this work for embedded CompoundAssign's.
22067 2003-07-13 Martin Baulig <martin@ximian.com>
22069 * typemanager.cs (TypeManager.IsNestedChildOf): Make this actually
22070 work to fix bug #46088.
22072 2003-07-13 Ravi Pratap <ravi@ximian.com>
22074 * class.cs (Operator.Emit): Do not emit attributes here - it is
22075 taken care of by the Method class that we delegate too. This takes
22076 care of bug #45876.
22078 2003-07-10 Martin Baulig <martin@ximian.com>
22080 * expression.cs (TypeOfVoid): New class.
22081 (TypeOf): Report a CS0673 if it's System.Void. Fixes #42264.
22083 2003-07-10 Martin Baulig <martin@ximian.com>
22085 * class.cs (MethodCore.DoDefineParameters): Added CS0225 check;
22088 2003-07-10 Martin Baulig <martin@ximian.com>
22090 * rootcontext.cs (RootContext.NamespaceLookup): Take a DeclSpace,
22091 not a NamespaceEntry, so we can use DeclSpace.CheckAccessLevel().
22093 * decl.cs (DeclSpace.FindType): Use DeclSpace.CheckAccessLevel().
22095 * typemanager.cs (TypeManager.IsAccessibleFrom): Removed.
22097 2003-07-10 Martin Baulig <martin@ximian.com>
22099 * expression.cs (ArrayCreation): Don't use a byte blob for arrays
22100 of decimal. Fixes #42850.
22102 NOTE: I also fixed the created byte blob, but this doesn't work on
22103 the MS runtime and csc never produces any byte blobs for decimal
22106 2003-07-10 Martin Baulig <martin@ximian.com>
22108 * statement.cs (StructInfo.GetStructInfo): Catch deep cycles in
22109 structs; fixes #32068.
22110 (Block.AddChildVariableNames): Fixed #44302.
22112 2003-07-07 Gonzalo Paniagua Javier <gonzalo@ximian.com>
22114 * namespace.cs: fixed compilation with csc. It's bugzilla #44302.
22116 2003-07-07 Miguel de Icaza <miguel@ximian.com>
22118 * attribute.cs: And this test is onger needed.
22120 2003-07-08 Martin Baulig <martin@ximian.com>
22122 * rootcontext.cs (RootContext.NamespaceLookup): Ignore
22123 inaccessible types. Fixes #36313.
22125 * decl.cs (DeclSpace.FindType): Ignore inaccessible types.
22127 * namespace.cs (NamespaceEntry): Create implicit entries for all
22128 namespaces; ie. if we have `namespace N1.N2.N3 { ... }', we create
22129 implicit entries for N1.N2 and N1.
22131 2003-07-08 Martin Baulig <martin@ximian.com>
22133 Rewrote the handling of namespaces to fix a lot of the issues
22134 wrt. `using' aliases etc.
22136 * namespace.cs (Namespace): Splitted this class into a
22137 per-assembly `Namespace' and a per-file `NamespaceEntry'.
22139 * typemanager.cs (TypeManager.IsNamespace): Removed.
22140 (TypeManager.ComputeNamespaces): Only compute namespaces from
22141 loaded assemblies here, not the namespaces from the assembly we're
22142 currently compiling.
22144 2003-07-08 Martin Baulig <martin@ximian.com>
22146 * rootcontext.cs, class.cs: Fixed the CS1530 reporting.
22148 2003-07-07 Miguel de Icaza <miguel@ximian.com>
22150 * typemanager.cs: Reverted patch from Gonzalo, my previous patch
22153 I thought about the memory savings here, but LookupTypeReflection
22154 is used under already very constrained scenarios. Compiling
22155 corlib or mcs only exposes one hit, so it would not really reduce
22156 any memory consumption.
22158 2003-07-07 Gonzalo Paniagua Javier <gonzalo@ximian.com>
22160 * typemanager.cs: fixes bug #45889 by only adding public types from
22161 other assemblies to the list of known types.
22163 2003-07-07 Miguel de Icaza <miguel@ximian.com>
22165 * attribute.cs (Attribute.Resolve): Add call to CheckAccessLevel
22166 on the type we resolved.
22168 2003-07-05 Martin Baulig <martin@ximian.com>
22170 * pending.cs (PendingImplementation.ParentImplements): Don't
22171 create the proxy if the parent is abstract.
22173 * class.cs (TypeContainer.DefineIndexers): Process explicit
22174 interface implementations first. Fixes #37714.
22176 2003-07-04 Miguel de Icaza <miguel@ximian.com>
22178 * expression.cs (MemberAccess.ResolveMemberAccess): Events are
22179 defined recursively; but since we modify the input parameters
22180 (left is set to `this' temporarily), we reset this value if the
22181 left_is_explicit is false, which gives the original semantics to
22184 * literal.cs (NullPointer): new class used to represent a null
22185 literal in a pointer context.
22187 * convert.cs (Convert.ImplicitReferenceConversion): Is the target
22188 type is a pointer, use a NullPointer object instead of a
22189 NullLiteral. Closes 43687
22191 (ExplicitConversion): Convert pointer values using
22192 the conv opcode to the proper type.
22194 * ecore.cs (New): change ValueTypeVariable property into a method,
22195 that returns whether the valuetype is suitable for being used.
22197 * expression.cs (Binary.DoNumericPromotions): Only return if we
22198 the int constant was a valid uint, and we can return both left and
22199 right as uints. If not, we continue processing, to trigger the
22200 type conversion. This fixes 39018.
22202 * statement.cs (Block.EmitMeta): During constant resolution, set
22203 the CurrentBlock property on the emitcontext, so that we resolve
22204 constants propertly.
22206 2003-07-02 Martin Baulig <martin@ximian.com>
22208 * codegen.cs (EmitContext.NeedExplicitReturn): New public variable.
22209 (EmitContext.EmitTopBlock): Emit an explicit return if it's set.
22211 * statement.cs (Try.Resolve): Set ec.NeedExplicitReturn rather
22212 than emitting it here.
22214 * statement.cs: Fixed some more flow analysis bugs.
22216 2003-07-02 Martin Baulig <martin@ximian.com>
22218 * class.cs (MethodData.Define): When implementing interface
22219 methods, set Final unless we're Virtual.
22221 * decl.cs (MemberCore.CheckMethodAgainstBase): Make the CS0506
22222 check work for interface methods.
22224 2003-07-01 Martin Baulig <martin@ximian.com>
22226 * ecore.cs (EmitContext.This): Replaced this property with a
22227 GetThis() method which takes a Location argument. This ensures
22228 that we get the correct error location for a CS0188.
22230 2003-07-01 Miguel de Icaza <miguel@ximian.com>
22232 * ecore.cs: (Convert.ConvertIntLiteral): Add test for
22233 ImplicitStandardConversion.
22235 * class.cs (TypeContainer.GetClassBases): Small bug fix for 45649.
22237 2003-07-01 Zoltan Varga <vargaz@freemail.hu>
22239 * expression.cs (ResolveOperator): Fix Concat (string, string, string)
22242 2003-06-30 Miguel de Icaza <miguel@ximian.com>
22244 * class.cs (Constructor.Define): Turn off initlocals for unsafe
22247 (MethodData.Define): Turn off initlocals for unsafe methods.
22249 2003-06-29 Miguel de Icaza <miguel@ximian.com>
22251 * decl.cs (DeclSpace.CheckAccessLevel): Make this routine
22252 complete; Fixes #37521.
22254 * delegate.cs: Use Modifiers.TypeAttr to compute the
22255 TypeAttributes, instead of rolling our own. This makes the flags
22256 correct for the delegates.
22258 2003-06-28 Miguel de Icaza <miguel@ximian.com>
22260 * class.cs (Constructor.Define): Set the private flag for static
22261 constructors as well.
22263 * cs-parser.jay (statement_expression): Set the return value to
22264 null, to avoid a crash when we catch an error.
22266 2003-06-24 Miguel de Icaza <miguel@ximian.com>
22268 * cs-parser.jay: Applied patch from Jackson that adds support for
22269 extern and unsafe modifiers to destructor declarations.
22271 * expression.cs: Report error 21 if the user is trying to index a
22274 * driver.cs: Add an error message, suggested by the bug report.
22276 * class.cs (TypeContainer.Emit): Only call EmitFieldInitializers
22277 if we do not have a ": this ()" constructor initializer. Fixes 45149
22279 2003-06-14 Miguel de Icaza <miguel@ximian.com>
22281 * namespace.cs: Add some information to reduce FAQs.
22283 2003-06-13 Miguel de Icaza <miguel@ximian.com>
22285 * cfold.cs (BinaryFold): BitwiseAnd, BitwiseOr: handle other
22286 underlying enumeration types. Fixes #43915.
22288 * expression.cs: Treat ushort/short as legal values to be used in
22289 bitwise operations.
22291 Wed Jun 4 13:19:04 CEST 2003 Paolo Molaro <lupus@ximian.com>
22293 * delegate.cs: transfer custom attributes for paramenters from
22294 the delegate declaration to Invoke and BeginInvoke.
22296 Tue Jun 3 11:11:08 CEST 2003 Paolo Molaro <lupus@ximian.com>
22298 * attribute.cs: handle custom marshalers and emit marshal info
22301 2003-05-28 Hector E. Gomez Morales <hgomez_36@flashmail.com>
22303 * makefile.gnu: Added anonymous.cs to the compiler sources.
22305 2003-05-28 Miguel de Icaza <miguel@ximian.com>
22307 * iterators.cs: Change the name of the proxy class to include two
22310 * cs-parser.jay: Update grammar to include anonymous methods.
22312 * anonymous.cs: new file.
22314 2003-05-27 Miguel de Icaza <miguel@ximian.com>
22316 * class.cs (Field.Define): Add missing test for pointers and
22319 2003-05-27 Ravi Pratap <ravi@ximian.com>
22321 * expression.cs (ArrayAccess.GetStoreOpCode): For System.IntPtr,
22322 we use the stobj opcode.
22324 (ArrayCreation.EmitDynamicInitializers): Revert Miguel's patch
22325 since it wasn't the correct fix.
22327 It still is puzzling that we are required to use stobj for IntPtr
22328 which seems to be a ValueType.
22330 2003-05-26 Miguel de Icaza <miguel@ximian.com>
22332 * ecore.cs (SimpleName.SimpleNameResolve): Consider using aliases
22333 during regular simple name resolution. Now, the trick is that
22334 instead of returning for processing the simplename, we do a
22335 TypeManager.LookupType (ie, a rooted lookup as opposed to a
22336 contextual lookup type). If a match is found, return that, if
22337 not, return for further composition.
22339 This fixes long-standing 30485.
22341 * expression.cs (ArrayCreation.EmitDynamicInitializers): When
22342 using the address to initialize an object, do an Stobj instead of
22343 using the regular Stelem.
22345 (IndexerAccess.Emit, IndexerAccess.EmitAssign):
22346 Pass `is_base_indexer' to Invocation.EmitCall instead of false.
22347 Because if we are a BaseIndexerAccess that value will be true.
22350 * statement.cs (GotoCase.Resolve): Return after reporting an
22351 error, do not attempt to continue.
22353 * expression.cs (PointerArithmetic.Emit): If our operand is a
22354 long, convert our constants to match the operand before
22355 multiplying. Convert to I type before adding. Fixes 43670.
22357 2003-05-14 Ravi Pratap <ravi@ximian.com>
22359 * enum.cs (ImplicitConversionExists) : Rename to
22360 ImplicitEnumConversionExists to remove ambiguity.
22362 * ecore.cs (NullCast): New type of cast expression class which
22363 basically is very similar to EmptyCast with the difference being
22364 it still is a constant since it is used only to cast a null to
22366 (eg. (string) null)
22368 * convert.cs (ImplicitReferenceConversion): When casting a null
22369 literal, we return a NullCast.
22371 * literal.cs (NullLiteralTyped): Remove - I don't see why this
22372 should be around anymore.
22374 The renaming (reported was slightly wrong). Corrections:
22376 ConvertImplicitStandard -> ImplicitConversionStandard
22377 ConvertExplicitStandard -> ExplicitConversionStandard
22379 * expression.cs (StaticCallExpr.MakeSimpleCall): Resolve arguments
22380 before passing them in !
22382 * convert.cs (ImplicitConversionStandard): When comparing for
22383 equal expr and target types, ensure that expr is not a
22386 In general, we must not be checking (expr_type ==
22387 target_type) in the top level conversion methods
22388 (ImplicitConversion, ExplicitConversion etc). This checking is
22389 done in the methods that they delegate to.
22391 2003-05-20 Miguel de Icaza <miguel@ximian.com>
22393 * convert.cs: Move Error_CannotConvertType,
22394 ImplicitReferenceConversion, ImplicitReferenceConversionExists,
22395 ImplicitNumericConversion, ImplicitConversionExists,
22396 ImplicitUserConversionExists, StandardConversionExists,
22397 FindMostEncompassedType, FindMostSpecificSource,
22398 FindMostSpecificTarget, ImplicitUserConversion,
22399 ExplicitUserConversion, GetConversionOperators,
22400 UserDefinedConversion, ConvertImplicit, ConvertImplicitStandard,
22401 TryImplicitIntConversion, Error_CannotConvertImplicit,
22402 ConvertImplicitRequired, ConvertNumericExplicit,
22403 ExplicitReferenceConversionExists, ConvertReferenceExplicit,
22404 ConvertExplicit, ConvertExplicitStandard from the ecore.cs into
22407 Perform the following renames:
22409 StandardConversionExists -> ImplicitStandardConversionExists
22410 ConvertImplicit -> ImplicitConversion
22411 ConvertImplicitStandard -> ImplicitStandardConversion
22412 TryImplicitIntConversion -> ImplicitIntConversion
22413 ConvertImplicitRequired -> ImplicitConversionRequired
22414 ConvertNumericExplicit -> ExplicitNumericConversion
22415 ConvertReferenceExplicit -> ExplicitReferenceConversion
22416 ConvertExplicit -> ExplicitConversion
22417 ConvertExplicitStandard -> ExplicitStandardConversion
22419 2003-05-19 Martin Baulig <martin@ximian.com>
22421 * statement.cs (TypeInfo.StructInfo): Made this type protected.
22422 (TypeInfo): Added support for structs having structs as fields.
22424 * ecore.cs (FieldExpr): Implement IVariable.
22425 (FieldExpr.DoResolve): Call VariableInfo.GetSubStruct() to get the
22426 VariableInfo for the field.
22428 2003-05-18 Martin Baulig <martin@ximian.com>
22430 * expression.cs (This.DoResolve): Report a CS0027 if we're
22431 emitting a field initializer.
22433 2003-05-18 Martin Baulig <martin@ximian.com>
22435 * expression.cs (This.ResolveBase): New public function.
22436 (This.DoResolve): Check for CS0188.
22438 * codegen.cs (EmitContext.This): Just call This.ResolveBase(), not
22441 * ecore.cs (MethodGroupExpr.DoResolve): Set the
22442 `instance_expression' to null if we don't have any non-static
22445 2003-05-18 Martin Baulig <martin@ximian.com>
22447 Reworked the way how local variables and parameters are handled by
22448 the flow analysis code.
22450 * statement.cs (TypeInfo, VariableMap): New public classes.
22451 (VariableInfo): New public class. This is now responsible for
22452 checking whether a variable has been assigned. It is used for
22453 parameters and local variables.
22454 (Block.EmitMeta): Take the InternalParameters as argument; compute
22455 the layout of the flow vectors here.
22456 (Block.LocalMap, Block.ParameterMap): New public properties.
22457 (FlowBranching): The .ctor doesn't get the InternalParameters
22458 anymore since Block.EmitMeta() now computes the layout of the flow
22460 (MyStructInfo): This class is now known as `StructInfo' and nested
22461 in `TypeInfo'; we don't access this directly anymore.
22463 * ecore.cs (IVariable): Added `VariableInfo VariableInfo'
22464 property and removed IsAssigned(), IsFieldAssigned(),
22465 SetAssigned() and SetFieldAssigned(); we now call them on the
22466 VariableInfo so we don't need to duplicate this code everywhere.
22468 * expression.cs (ParameterReference): Added `Block block' argument
22470 (LocalVariableReference, ParameterReference, This): The new
22471 VariableInfo class is now responsible for all the definite
22474 * codegen.cs (EmitContext.IsVariableAssigned, SetVariableAssigned,
22475 IsParameterAssigned, SetParameterAssigned): Removed.
22477 2003-05-18 Martin Baulig <martin@ximian.com>
22479 * typemanager.cs (InitCoreTypes): Try calling
22480 SetCorlibTypeBuilders() with 4 args; if that fails, fall back to
22481 the 3-args-version. Corlib now also needs our `void_type'.
22482 (GetMethod): Added overloaded version which takes an optional
22483 `bool report_errors' to allow lookups of optional methods.
22485 2003-05-12 Martin Baulig <martin@ximian.com>
22487 * statement.cs (VariableInfo): Renamed to LocalInfo since it's
22488 only used for locals and not for parameters.
22490 2003-05-12 Miguel de Icaza <miguel@ximian.com>
22492 * support.cs (InternalParameters.ParameterType): Return the
22493 ExternalType of the parameter.
22495 * parameter.cs (Parameter.ExternalType): drop the two arguments,
22498 2003-05-11 Miguel de Icaza <miguel@ximian.com>
22500 * class.cs (MethodData.Define): Do not set the `newslot' on
22501 interface members, if they are also flagged as "override".
22503 * expression.cs (UnaryMutator.EmitCode): Simple workaround to emit
22504 better code for ++i and i++. This only works for static fields
22505 and local variables.
22507 * typemanager.cs (LookupDeclSpace): Add new method, sometimes we
22508 want to pull the DeclSpace out of the builder_to_declspace instead
22509 of the TypeBuilder (like in TypeContainer.FindMembers).
22511 * class.cs (TypeContainer.FindMembers): Use LookupDeclSpace
22512 instead of LookupTypeContainer. Fixes the crash on .NET for
22513 looking up interface members.
22515 * const.cs: Create our own emit context during the Definition
22516 stage, so that constants are evaluated in the proper context, when
22517 a recursive definition happens.
22519 2003-05-11 Martin Baulig <martin@ximian.com>
22521 * statement.cs (Block.CreateSwitchBlock): New method. Creates a
22522 new block for a switch section.
22523 (Block.AddLabel, Block.LookupLabel): If we're a switch section, do
22524 the adding/lookup in the switch block. Fixes #39828.
22526 2003-05-09 Miguel de Icaza <miguel@ximian.com>
22528 * expression.cs (UnaryMutator.LoadOneAndEmitOp): Missing
22529 functionality: I needed to convert the data after I had performed
22530 the add/sub operation into the operands type size.
22532 * ecore.cs (ImplicitReferenceConversion): When boxing an interface
22533 pass the type for the box operation, otherwise the resulting
22534 object would have been of type object.
22536 (BoxedCast): Add constructor to specify the type to box as.
22538 2003-05-07 Miguel de Icaza <miguel@ximian.com>
22540 * iterators.cs: I was reusing the `count' variable inadvertently,
22541 take steps to not allow this to happen.
22543 2003-05-06 Miguel de Icaza <miguel@ximian.com>
22545 * attribute.cs (Attribute.Resolve): Params attributes are encoded
22546 by creating an array at the point where the params starts and
22547 putting all those arguments there, then adjusting the size of the
22550 2003-05-05 Miguel de Icaza <miguel@ximian.com>
22552 * expression.cs (New.AddressOf): Implement interface
22553 IMemoryLocation. This is used when the `new' operator is used in
22554 the context of an invocation to a method on a value type.
22556 See http://bugzilla.ximian.com/show_bug.cgi?id=#42390 for an
22559 * namespace.cs: Also check the using aliases here.
22561 * driver.cs: Move the test for using validity after the types have
22562 been entered, so we do a single pass that also includes the using
22565 * statement.cs (Try.Resolve): Avoid crashing if there is a failure
22566 in the regular case. CreateSiblingForFinally is doing extra
22569 * attribute.cs (GetAttributeArgumentExpression): Store the result
22570 on an out value, and use the return value to indicate failure
22571 instead of using null (which is a valid return for Constant.GetValue).
22573 * statement.cs: Perform the analysis flow for the increment
22574 portion after the statement, because this will be the real flow of
22575 execution. Fixes #42385
22577 * codegen.cs (EmitContext.EmitArgument,
22578 EmitContext.EmitStoreArgument): New helper functions when the
22579 RemapToProxy flag is set.
22581 * expression.cs (ParameterReference.EmitLdarg): Expose this useful
22584 Add support for remapping parameters.
22586 * iterators.cs: Propagate parameter values; Store parameter
22587 values in the proxy classes.
22589 2003-05-04 Miguel de Icaza <miguel@ximian.com>
22591 * ecore.cs (FieldExpr): Fix an obvious bug. static fields do not
22592 need a proxy reference; I do not know what I was thinking
22594 * cs-parser.jay (constructor_initializer): catch another error,
22595 and display nice message.
22597 (field_declaration): catch void field declaration
22598 to flag a better error.
22600 * class.cs (MemberBase.CheckBase): Report an error instead of a
22601 warning if a new protected member is declared in a struct.
22602 (Field.Define): catch the error of readonly/volatile.
22604 * ecore.cs (FieldExpr.EmitAssign): reuse the field lookup.
22606 (FieldExpr.AddressOf): ditto. Catch error where the address of a
22607 volatile variable is taken
22609 2003-05-02 Miguel de Icaza <miguel@ximian.com>
22611 * statement.cs (Fixed.Resolve): Report an error if we are not in
22614 2003-05-01 Miguel de Icaza <miguel@ximian.com>
22616 * typemanager.cs: reuse the code that handles type clashes for
22617 delegates and enumerations.
22619 * class.cs (Report28): Always report.
22621 * expression.cs (EncodeAsAttribute): Allow nulls here.
22623 2003-04-28 Miguel de Icaza <miguel@ximian.com>
22625 * attribute.cs (Attribute.GetAttributeArgumentExpression): Moved
22626 the functionality for testing whether an expression is valid for
22627 an attribute here. Also handle the case of arrays of elements
22630 * expression.cs (ArrayCreation.EncodeAsAttribute): Add support for
22631 encoding a linear array into an array of objects that are suitable
22632 to be passed to an CustomAttributeBuilder.
22634 * delegate.cs: Check unsafe types being used outside of an Unsafe context.
22636 * ecore.cs: (FieldExpr): Handle field remapping here.
22638 * iteratators.cs: Pass the instance variable (if the method is an
22639 instance method) to the constructors, so we can access the field
22640 variables on the class.
22642 TODO: Test this with structs. I think the THIS variable on
22643 structs might have to be a pointer, and not a refenrece
22645 2003-04-27 Miguel de Icaza <miguel@ximian.com>
22647 * codegen.cs (EmitContext.Mapvariable): Adds a mechanism to map
22648 local variables to fields in a proxy class.
22650 * iterators.cs (PopulateProxy): Rename our internal fields to
22652 Create a <THIS> field if we are an instance method, so we can
22653 reference our parent container variables.
22654 (MapVariable): Called back from the EmitContext code to enter a
22655 new variable to field mapping into the proxy class (we just create
22659 (LocalVariableReference.{Emit,EmitAssign,AddressOf}): Add support
22660 for using the remapped locals to fields.
22662 I placed the code here, because that gives the same semantics to
22663 local variables, and only changes the Emit code.
22665 * statement.cs (Fixed.Resolve): it is not allowed to have fixed
22666 statements inside iterators.
22667 (VariableInfo): Add a FieldBuilder for the cases when we are
22668 remapping local variables to fields in a proxy class
22670 * ecore.cs (SimpleNameResolve): Avoid testing two times for
22671 current_block != null.
22673 * statement.cs (Swithc.SimpleSwitchEmit): Removed code that did
22674 not cope with strings, as it has been moved to the
22675 TableSwitchEmit. Fixed bug in switch generation.
22677 * expression.cs (New.DoResolve): Provide more context for the user
22678 when reporting an error.
22680 * ecore.cs (Expression.LoadFromPtr): Use ldind_i when loading
22683 * expression.cs (MemberAccess.DoResolve): When we get a type back,
22684 check the permissions for it. Note than in a type-resolution
22685 context the check was already present in DeclSpace.ResolveType,
22686 but was missing from the MemberAccess.
22688 (ArrayCreation.CheckIndices): warn if the user has
22689 more nested levels of expressions, but there are no more
22690 dimensions specified. Avoids crash on bug 41906.
22692 2003-04-26 Miguel de Icaza <miguel@ximian.com>
22694 * statement.cs (Block): replace Implicit bool, for a generic
22696 New flag: `Unchecked'. This is used during the EmitMeta phase
22697 (which is out-of-line with the regular Resolve/Emit process for a
22698 statement, as this is done ahead of time, but still gets a chance
22699 to call constant resolve).
22701 (Block.Flags): new enum for adding a new flag.
22703 (Block.EmitMeta): track the state of unchecked.
22705 (Unchecked): Set the "UnChecked" flags on any blocks we enclose,
22706 to enable constant resolution to work there as well.
22708 2003-04-22 Miguel de Icaza <miguel@ximian.com>
22710 * typemanager.cs (ienumerable_type): Also look up
22711 System.Collections.IEnumerable.
22713 2003-04-21 Miguel de Icaza <miguel@ximian.com>
22715 TODO: Test more than one conditional per method.
22717 * class.cs (Indexer.Define): Report the location where the user is
22718 referencing the unsupported feature.
22720 (MethodData): Overload the use of `conditionals' to
22721 minimize the creation of needless ArrayLists. This saves roughly
22722 212kb on my machine.
22724 (Method): Implement the new IIteratorContainer interface.
22725 (Method.SetYields): Implement the method by setting the ModFlags
22726 to contain METHOD_YIELDS.
22728 * expression.cs (Unary.ResolveOperator): Use expr_type, not Expr,
22729 which just got set to null.
22731 * iterators.cs: New file.
22733 (Yield, YieldBreak): New statements.
22735 * statement.cs (Return.Resolve): Flag an error if we are used in
22736 an iterator method.
22738 * codegen.cs (InIterator): New flag set if the code is being
22739 compiled in an iterator method.
22741 * modifiers.cs: New flag METHOD_YIELDS. This modifier is an
22742 internal modifier, and we just use it to avoid adding extra
22743 fields, as this is seldom used.
22745 * cs-parser.jay: Add yield_statement (yield and yield break).
22747 * driver.cs: New flag -v2 to turn on version 2 features.
22749 * cs-tokenizer.cs (Tokenizer): Add yield and __yield to the
22750 hashtable when v2 is enabled.
22752 2003-04-20 Miguel de Icaza <miguel@ximian.com>
22754 * typemanager.cs (TypeManager.NamespaceClash): Use to check if
22755 there is already a namespace defined with this name.
22757 (TypeManager.InitCoreTypes): Remove the temporary workaround, as
22758 people upgraded their corlibs.
22760 (TypeManager.CoreLookupType): Use LookupTypeDirect, as we
22761 always use fully qualified types, no need to use the compiler
22764 (TypeManager.IsNamespace): Use binarysearch.
22766 * class.cs (AddClass, AddStruct, AddInterface, AddEvent,
22767 AddDelegate): I did not quite use the new IsValid API properly: I
22768 have to pass the short-name and the fullname. I was passing only
22769 the basename instead of the fullname sometimes.
22771 (TypeContainer.DefineType): call NamespaceClash.
22773 * interface.cs (Interface.DefineType): use NamespaceClash before
22776 * delegate.cs (Delegate.DefineType): use NamespaceClash before
22779 * enum.cs: (Enum.DefineType): use NamespaceClash before
22782 * typemanager.cs (: 3-line patch that gives us some tasty 11%
22783 speed increase. First, use the negative_hits cache when we get a
22784 negative. Second, add the type with its full original name
22785 instead of the new . and + encoded name (reflection uses + to
22786 separate type from a nested type). Use LookupTypeReflection
22787 directly which bypasses the type->name hashtable (that we already
22788 know does not contain the type.
22790 * decl.cs (DeclSpace.ResolveTypeExpr): track the
22791 location/container type.
22793 * driver.cs: When passing utf8, use directly the UTF8Encoding.
22795 2003-04-19 Miguel de Icaza <miguel@ximian.com>
22797 * decl.cs (ResolveTypeExpr): Mirror check acess here too.
22799 * delegate.cs (NewDelegate.Resolve): Test whether an instance
22800 method is being referenced in the method group from a static
22801 context, and report error 120 if so.
22803 * expression.cs, ecore.cs (Error_UnexpectedKind): New name for
22806 * typemanager.cs: Add intermediate namespaces (if a namespace A.B
22807 is created, we create the A namespace).
22809 * cs-parser.jay: A namespace also introduces a DeclarationFound.
22812 2003-04-18 Miguel de Icaza <miguel@ximian.com>
22814 * typemanager.cs (GetReferenceType, GetPointerType): In .NET each
22815 invocation to ModuleBuilder.GetType with the same values will
22816 return a new type instance, so we need to cache its return
22819 * expression.cs (Binary.ResolveOperator): Only allow the compare
22820 operators on enums if they are of the same type.
22822 * ecore.cs (Expression.ImplicitReferenceConversion): handle target
22823 types of ValueType on their own case. Before we were giving them
22824 the same treatment as objects.
22826 * decl.cs (DeclSpace.IsValid): IsValid takes the short name and
22827 fullname. Short name is used to compare against container name.
22828 Fullname is used to check against defined namespace names.
22830 * class.cs (AddProperty, AddField, AddClass, AddStruct, AddEnum,
22831 AddDelegate, AddEvent): Pass new parameter to DeclSpace.IsValid
22833 (Method.CheckBase): Call parent.
22834 (MemberBase.CheckBase): Check for protected members on sealed
22836 (PropertyBase.CheckBase): Call parent.
22837 (Field.Define): Call parent.
22839 * report.cs: Negative error codes are now mapped to 8000 - code,
22840 so that the display is render more nicely.
22842 * typemanager.cs: Do not use try/catch, instead report a regular
22845 (GetPointerType, GetReferenceType): These methods provide
22846 mechanisms to obtain the T* and T& from a T. We had the code
22847 previously scattered around the code base, and it also used
22848 TypeManager.LookupType that would go through plenty of caches.
22849 This one goes directly to the type source.
22851 In some places we did the Type.GetType followed by
22852 ModuleBuilder.GetType, but not in others, so this unifies the
22853 processing as well.
22855 * namespace.cs (VerifyUsing): Perform a non-lazy approach to using
22856 statements now that we have namespace information.
22858 * typemanager.cs (IsNamespace): New method, returns whether the
22859 string presented is a namespace or not.
22861 (ComputeNamespaces): New public entry point, computes the list of
22862 available namespaces, using the GetNamespaces API call in Mono, or
22863 the slower version in MS.NET.
22865 Now before we start the semantic analysis phase, we have a
22866 complete list of namespaces including everything that the user has
22869 Deleted old code to cache namespaces in .nsc files.
22871 2003-04-17 Miguel de Icaza <miguel@ximian.com>
22873 * class.cs: (TypeContainer.DefineDefaultConstructor): Use the
22874 class/struct location definition Location for the implicit
22875 constructor location.
22877 (Operator.Define): Use the location of the operator for the
22878 implicit Method definition.
22880 (Constructor.Emit): use the constructor location for the implicit
22881 base initializer constructor.
22883 * ecore.cs: Remove ITypeExpression. This interface is now gone,
22884 and the Expression class now contains two new methods:
22886 ResolveAsTypeStep and ResolveAsTypeTerminal. This is used to
22887 isolate type lookup from the rest of the resolution process.
22889 Since we use Expressions to hold type definitions due to the way
22890 we parse the input we have historically overloaded Resolve to
22891 perform the Type lookups if a special flag is passed. Now this is
22892 eliminated and two methods take their place.
22894 The differences in the two methods between xStep and xTerminal is
22895 that xStep is involved in our current lookup system that uses
22896 SimpleNames to compose a name, while xTerminal is used just to
22897 catch the case where the simplename lookup failed.
22899 2003-04-16 Miguel de Icaza <miguel@ximian.com>
22901 * expression.cs (ResolveMemberAccess): Remove redundant code.
22902 TypeExpr expressions are always born fully resolved.
22904 * interface.cs (PopulateMethod): Do not lookup the types twice.
22905 We were doing it once during SemanticAnalysis and once during
22908 * cs-parser.jay: Due to our hack in the grammar, things like A.B[]
22909 in local variable type definitions, were being returned as a
22910 SimpleName (we decomposed everything into a string), that is
22911 because primary_expression was being used instead of a type in the
22912 grammar (reduce/reduce conflicts).
22914 The part that was wrong is that we converted the expression into a
22915 string (an oversimplification in one hand, compounded with primary
22916 expressions doing string concatenation).
22922 Would return "A.B.C[]" as a SimpleName. This stopped things like
22923 using clauses from working on this particular context. And a type
22924 was being matched directly against "A.B.C[]".
22926 We now use the correct approach, and allow for ComposedCast to be
22927 part of the unary expression. So the "A.B.C []" become a composed
22928 cast of "A.B.C" (as a nested group of MemberAccess with a
22929 SimpleName at the end) plus the rank composition "[]".
22933 2003-04-10 Miguel de Icaza <miguel@ximian.com>
22935 * decl.cs (CheckAccessLevel): Implement the NestedPrivate rules
22936 for the access level checking.
22938 * class.cs: Cosmetic changes. Renamed `TypeContainer parent' to
22939 `TypeContainer container', because I kept getting confused when I
22940 was debugging this code.
22942 * expression.cs (Indexers): Instead of tracking getters/setters,
22943 we now track them in parallel. We create one arraylist less, but
22944 most importantly it is possible now for the LValue code to find a
22945 matching get for a set.
22947 (IndexerAccess.DoResolveLValue): Update the code.
22948 GetIndexersForType has been modified already to extract all the
22949 indexers from a type. The code assumed it did not.
22951 Also make the code set the correct return type for the indexer.
22952 This was fixed a long time ago for properties, but was missing for
22953 indexers. It used to be void_type.
22955 (Binary.Emit): Test first for doubles instead of
22956 floats, as they are more common.
22958 (Binary.EmitBranchable): Use the .un version of the branch opcodes
22959 when dealing with floats and the <=, >= operators. This fixes bug
22962 * statement.cs (Foreach.EmitArrayForeach): bug fix: The code used
22963 to load the array value by emitting a load on the foreach variable
22964 type. This was incorrect.
22966 We now emit the code to load an element using the the array
22967 variable type, and then we emit the conversion operator.
22971 2003-04-10 Zoltan Varga <vargaz@freemail.hu>
22973 * attribute.cs: Avoid allocation of ArrayLists in the common case.
22975 2003-04-09 Miguel de Icaza <miguel@ximian.com>
22977 * class.cs (MethodSignature.InheritableMemberSignatureCompare):
22978 test for protection before we test for signatures.
22980 (MethodSignature.ToString): implement.
22982 * expression.cs (Unary.TryReduceNegative): Add missing minus sign
22983 to the case where we reduced into a LongConstant.
22985 * decl.cs (CheckAccessLevel): If the type is an array, we can not
22986 depend on whether the information is acurrate, because the
22987 Microsoft runtime will always claim that the array type is public,
22988 regardless of the real state.
22990 If the type is a pointer, another problem happens: the type is
22991 reported as non-public in Microsoft.
22993 In both cases we have to call CheckAccessLevel recursively with
22994 the underlying type as the argument to be tested.
22996 2003-04-08 Miguel de Icaza <miguel@ximian.com>
22998 * assign.cs (Assign.Emit): If we are dealing with a compound
22999 assignment expression, we should use the code path that stores the
23000 intermediate result in a temporary value. This fixes #40903.
23002 *expression.cs (Indirection.ToString): Provide ToString method for
23005 2003-04-08 Zoltan Varga <vargaz@freemail.hu>
23007 * class.cs: Null out fields holding references to Block objects so
23008 they can be garbage collected.
23010 * expression.cs (OverloadResolve): Remove unused local.
23012 2003-04-07 Martin Baulig <martin@ximian.com>
23014 * codegen.cs (EmitContext.CurrentFile): New public field.
23015 (EmitContext.Mark): Use the CurrentFile to check whether the
23016 location is in the correct file.
23017 (EmitContext.EmitTopBlock): Initialize CurrentFile here.
23019 2003-04-07 Martin Baulig <martin@ximian.com>
23021 * ecore.cs (Expression.ResolveBoolean): Don't call ec.Mark().
23023 * codegen.cs (EmitContext.EmitTopBlock): Don't call Mark() on the
23024 location. [FIXME: The location argument which gets passed to this
23025 method is sometimes wrong!]
23027 2003-04-07 Nick Drochak <ndrochak@gol.com>
23029 * codegen.cs: Be more verbose when we can't find the symbol writer dll.
23031 2003-04-07 Miguel de Icaza <miguel@ximian.com>
23033 * expression.cs (Indirection.EmitAssign): We were using the
23034 temporary, but returning immediately instead of continuing the
23037 2003-04-06 Martin Baulig <martin@ximian.com>
23039 * ecore.cs (SimpleName.SimpleNameResolve): Don't report an error
23040 if it's a nested child, but also deriving from the outer class.
23043 * typemanager.cs (IsNestedChildOf): Make this work if it's a
23044 nested child, but also deriving from the outer class. See
23046 (FilterWithClosure): We may access private members of the outer
23047 class if we're a nested child and deriving from the outer class.
23048 (RealMemberLookup): Only set `closure_private_ok' if the
23049 `original_bf' contained BindingFlags.NonPublic.
23051 2003-04-05 Martin Baulig <martin@ximian.com>
23053 * statement.cs (FlowBranching.UsageVector.MergeChildren): Fix bug #40670.
23055 2003-04-02 Miguel de Icaza <miguel@ximian.com>
23057 * class.cs (Event.Define): Do not allow abstract events to have
23060 2003-04-01 Miguel de Icaza <miguel@ximian.com>
23062 * cs-parser.jay: Add error productions for ADD/REMOVE missing a
23063 block in event declarations.
23065 * ecore.cs (FieldExpr.AddressOf): If our instance expression is a
23066 value type, get its address.
23068 * expression.cs (Is.Emit): For action `LeaveOnStack' we were
23069 leaving a class on the stack instead of a boolean value (int
23070 0/1). Change the code so we compare against null, and then the
23071 result against zero.
23073 * class.cs (TypeContainer.GetClassBases): We were checking for the
23074 parent class being sealed too late.
23076 * expression.cs (Binary.Emit): For <= and >= when dealing with
23077 floating point values, use cgt.un and clt.un instead of cgt and
23080 2003-04-01 Zoltan Varga <vargaz@freemail.hu>
23082 * statement.cs: Apply the same optimization as MS: skip the
23083 GetEnumerator returning an IEnumerator, and use the one returning a
23084 CharEnumerator instead. This allows us to avoid the try-finally block
23087 2003-03-31 Gaurav Vaish <gvaish_mono@lycos.com>
23089 * cs-parser.jay: Attributes cannot be applied to
23090 namespaces. Fixes #40473
23092 2003-03-31 Gonzalo Paniagua Javier <gonzalo@ximian.com>
23095 (Add*): check if the name is valid using the full name for constants,
23096 fields, properties and events.
23098 2003-03-28 Miguel de Icaza <miguel@ximian.com>
23100 * enum.cs (Enum.DefineType, Enum.IsValidEnumConstant): Also allow
23101 char constants to be part of the enumeration.
23103 * expression.cs (Conditional.DoResolve): Add support for operator
23104 true. Implements the missing functionality from 14.12
23106 * class.cs (TypeContainer.CheckPairedOperators): Report error for missmatch on
23107 operator true/false as required by the spec.
23109 * expression.cs (Unary.ResolveOperator): In LogicalNot, do an
23110 implicit conversion to boolean.
23112 * statement.cs (Statement.ResolveBoolean): A boolean expression is
23113 also one where the type implements `operator true'.
23115 * ecore.cs (Expression.GetOperatorTrue): New helper routine to
23116 get an expression that will invoke operator true based on an
23119 (GetConversionOperators): Removed the hack that called op_True
23122 (Expression.ResolveBoolean): Move this from Statement.
23124 2003-03-17 Miguel de Icaza <miguel@ximian.com>
23126 * ecore.cs (FieldExpr): do not allow initialization of initonly
23127 fields on derived classes
23129 2003-03-13 Martin Baulig <martin@ximian.com>
23131 * statement.cs (Block.Emit): Call ig.BeginScope() and
23132 ig.EndScope() when compiling with debugging info; call
23133 LocalBuilder.SetLocalSymInfo _after_ opening the scope.
23135 2003-03-08 Miguel de Icaza <miguel@ximian.com>
23137 * expression.cs (Indexers): Do not construct immediately, allow
23138 for new members to be appended as we go. Fixes 38143
23140 2003-03-07 Gonzalo Paniagua Javier <gonzalo@ximian.com>
23142 * expression.cs: save/restore context when resolving an unchecked
23145 2003-03-05 Miguel de Icaza <miguel@ximian.com>
23147 * cfold.cs: Catch division by zero in modulus operator during
23150 2003-03-03 Miguel de Icaza <miguel@ximian.com>
23152 * interface.cs (Interface.DefineMembers): Avoid defining members
23155 2003-02-27 Miguel de Icaza <miguel@ximian.com>
23157 * driver.cs: handle the +/- options for -noconfig
23159 * statement.cs (Unckeched.Resolve): Also track the state of
23160 unchecked in the Resolve phase.
23162 2003-02-27 Martin Baulig <martin@ximian.com>
23164 * ecore.cs (Expression.MemberLookup): Don't create a
23165 MethodGroupExpr for something which is not a method. Fixes #38291.
23167 2003-02-25 Miguel de Icaza <miguel@ximian.com>
23169 * class.cs (MemberBase.CheckParameters): Also check that the type
23170 is unmanaged if it is a pointer.
23172 * expression.cs (SizeOf.Resolve): Add location information.
23174 * statement.cs (Block.EmitMeta): Flag error (208) if a pointer to
23175 a managed type is declared.
23177 * expression.cs (Invocation.VerifyArgumentsCompat): Check for the
23178 parameter modifiers as well. Fixes bug 38606
23180 * class.cs: Very sad. Am backing out the speed up changes
23181 introduced by the ArrayList -> Array in the TypeContainer, as they
23182 were not actually that much faster, and introduced a bug (no error
23183 reports on duplicated methods).
23185 * assign.cs (CompoundAssign.DoLResolve): Resolve the original
23186 source first, this will guarantee that we have a valid expression
23187 before calling in lower levels functions that will require a
23188 resolved object. Then use this original_source in the
23189 target.ResolveLValue instead of the original source that was
23192 Another change. Use target.Resolve instead of LValueResolve.
23193 Although we are resolving for LValues, we will let the Assign code
23194 take care of that (it will be called again from Resolve). This
23195 basically allows code like this:
23197 class X { X operator + (X x, object o) {} X this [int idx] { get; set; } }
23198 class Y { void A (X x) { x [0] += o; }
23200 The problem was that the indexer was trying to resolve for
23201 set_Item (idx, object o) and never finding one. The real set_Item
23202 was set_Item (idx, X). By delaying the process we get the right
23207 2003-02-23 Martin Baulig <martin@ximian.com>
23209 * statement.cs (Block.Emit): Override this and set ec.CurrentBlock
23210 while calling DoEmit ().
23212 * codegen.cs (EmitContext.Mark): Don't mark locations in other
23213 source files; if you use the #line directive inside a method, the
23214 compiler stops emitting line numbers for the debugger until it
23215 reaches the end of the method or another #line directive which
23216 restores the original file.
23218 2003-02-23 Martin Baulig <martin@ximian.com>
23220 * statement.cs (FlowBranching.UsageVector.MergeChildren): Fix bug #37708.
23222 2003-02-23 Martin Baulig <martin@ximian.com>
23224 * statement.cs (Block.AddChildVariableNames): We need to call this
23225 recursively, not just for our immediate children.
23227 2003-02-23 Martin Baulig <martin@ximian.com>
23229 * class.cs (Event.Define): Always make the field private, like csc does.
23231 * typemanager.cs (TypeManager.RealMemberLookup): Make events
23232 actually work, fixes bug #37521.
23234 2003-02-23 Miguel de Icaza <miguel@ximian.com>
23236 * delegate.cs: When creating the various temporary "Parameters"
23237 classes, make sure that we call the ComputeAndDefineParameterTypes
23238 on those new parameters (just like we do with the formal ones), to
23239 allow them to be resolved in the context of the DeclSpace.
23241 This fixes the bug that Dick observed in Bugzilla #38530.
23243 2003-02-22 Miguel de Icaza <miguel@ximian.com>
23245 * expression.cs (ResolveMemberAccess): When resolving a constant,
23246 do not attempt to pull a constant if the value was not able to
23247 generate a valid constant.
23249 * const.cs (LookupConstantValue): Do not report more errors than required.
23251 2003-02-19 Gonzalo Paniagua Javier <gonzalo@ximian.com>
23253 * expression.cs: fixes bug #38328.
23255 2003-02-18 Miguel de Icaza <miguel@ximian.com>
23257 * class.cs: Changed all the various members that can be part of a
23258 class from being an ArrayList to be an Array of the right type.
23259 During the DefineType type_list, interface_list, delegate_list and
23260 enum_list are turned into types, interfaces, delegates and enums
23263 And during the member population, indexer_list, event_list,
23264 constant_list, field_list, instance_constructor_list, method_list,
23265 operator_list and property_list are turned into their real arrays.
23267 Although we could probably perform this operation earlier, for
23268 good error reporting we need to keep the lists and remove the
23269 lists for longer than required.
23271 This optimization was triggered by Paolo profiling the compiler
23272 speed on the output of `gen-sample-program.pl' perl script.
23274 * decl.cs (DeclSpace.ResolveType): Set the ContainerType, so we do
23275 not crash in methods like MemberLookupFailed that use this field.
23277 This problem arises when the compiler fails to resolve a type
23278 during interface type definition for example.
23280 2003-02-18 Miguel de Icaza <miguel@ximian.com>
23282 * expression.cs (Indexers.GetIndexersForType): Interfaces do not
23283 inherit from System.Object, so we have to stop at null, not only
23284 when reaching System.Object.
23286 2003-02-17 Miguel de Icaza <miguel@ximian.com>
23288 * expression.cs: (Indexers.GetIndexersForType): Martin's fix used
23289 DeclaredOnly because the parent indexer might have had a different
23290 name, but did not loop until the top of the hierarchy was reached.
23292 The problem this one fixes is 35492: when a class implemented an
23293 indexer from an interface, we were getting the interface method
23294 (which was abstract) and we were flagging an error (can not invoke
23297 This also keeps bug 33089 functioning, and test-148 functioning.
23299 * typemanager.cs (IsSpecialMethod): The correct way of figuring
23300 out if a method is special is to see if it is declared in a
23301 property or event, or whether it is one of the predefined operator
23302 names. This should fix correctly #36804.
23304 2003-02-15 Miguel de Icaza <miguel@ximian.com>
23306 The goal here is to remove the dependency on EmptyCast.Peel ().
23307 Killing it completely.
23309 The problem is that currently in a number of places where
23310 constants are expected, we have to "probe" for an EmptyCast, and
23311 Peel, which is not the correct thing to do, as this will be
23312 repetitive and will likely lead to errors.
23314 The idea is to remove any EmptyCasts that are used in casts that
23315 can be reduced to constants, so we only have to cope with
23318 This bug hunt was triggered by Bug 37363 and the desire to remove
23319 the duplicate pattern where we were "peeling" emptycasts to check
23320 whether they were constants. Now constants will always be
23323 * ecore.cs: Use an enumconstant here instead of wrapping with
23326 * expression.cs (Cast.TryReduce): Ah, the tricky EnumConstant was
23327 throwing me off. By handling this we can get rid of a few hacks.
23329 * statement.cs (Switch): Removed Peel() code.
23331 2003-02-14 Miguel de Icaza <miguel@ximian.com>
23333 * class.cs: Location information for error 508
23335 * expression.cs (New.DoResolve): Add a guard against double
23336 resolution of an expression.
23338 The New DoResolve might be called twice when initializing field
23339 expressions (see EmitFieldInitializers, the call to
23340 GetInitializerExpression will perform a resolve on the expression,
23341 and later the assign will trigger another resolution
23343 This leads to bugs (#37014)
23345 * delegate.cs: The signature for EndInvoke should contain any ref
23346 or out parameters as well. We were not doing this in the past.
23348 * class.cs (Field.Define): Do not overwrite the type definition
23349 inside the `volatile' group. Turns out that volatile enumerations
23350 were changing the type here to perform a validity test, which
23353 2003-02-12 Miguel de Icaza <miguel@ximian.com>
23355 * ecore.cs (FieldExpr.AddressOf): In the particular case of This
23356 and structs, we do not want to load the instance variable
23358 (ImplicitReferenceConversion, ImplicitReferenceConversionExists):
23359 enum_type has to be handled like an object reference (implicit
23360 conversions exists from this to object), but the regular IsClass
23361 and IsValueType tests will never return true for this one.
23363 Also we use TypeManager.IsValueType instead of type.IsValueType,
23364 just for consistency with the rest of the code (this is only
23365 needed if we ever use the construct exposed by test-180.cs inside
23366 corlib, which we dont today).
23368 2003-02-12 Zoltan Varga <vargaz@freemail.hu>
23370 * attribute.cs (ApplyAttributes): apply all MethodImplAttributes, not
23373 2003-02-09 Martin Baulig <martin@ximian.com>
23375 * namespace.cs (Namespace..ctor): Added SourceFile argument.
23376 (Namespace.DefineNamespaces): New static public method; this is
23377 called when we're compiling with debugging to add all namespaces
23378 to the symbol file.
23380 * tree.cs (Tree.RecordNamespace): Added SourceFile argument and
23381 pass it to the Namespace's .ctor.
23383 * symbolwriter.cs (SymbolWriter.OpenMethod): Added TypeContainer
23384 and MethodBase arguments; pass the namespace ID to the symwriter;
23385 pass the MethodBase instead of the token to the symwriter.
23386 (SymbolWriter.DefineNamespace): New method to add a namespace to
23389 2003-02-09 Martin Baulig <martin@ximian.com>
23391 * symbolwriter.cs: New file. This is a wrapper around
23392 ISymbolWriter with a cleaner API. We'll dynamically Invoke()
23393 methods here in near future.
23395 2003-02-09 Martin Baulig <martin@ximian.com>
23397 * codegen.cs (EmitContext.Mark): Just pass the arguments to
23398 ILGenerator.MarkSequencePoint() which are actually used by the
23401 2003-02-09 Martin Baulig <martin@ximian.com>
23403 * location.cs (SourceFile): New public sealed class. This
23404 contains the name and an index which is used in the location's token.
23405 (Location): Reserve an appropriate number of bits in the token for
23406 the source file instead of walking over that list, this gives us a
23407 really huge performance improvement when compiling with debugging.
23409 * driver.cs (Driver.parse, Driver.tokenize_file): Take a
23410 `SourceFile' argument instead of a string.
23411 (Driver.ProcessFile): Add all the files via Location.AddFile(),
23412 but don't parse/tokenize here, we need to generate the list of all
23413 source files before we do that.
23414 (Driver.ProcessFiles): New static function. Parses/tokenizes all
23417 * cs-parser.jay (CSharpParser): Take a `SourceFile' argument
23418 instead of a string.
23420 * cs-tokenizer.cs (Tokenizer): Take `SourceFile' argument instead
23423 2003-02-09 Martin Baulig <martin@ximian.com>
23425 * cs-tokenizer.cs (Tokenizer.PreProcessLine): Also reset the
23426 filename on `#line default'.
23428 Sat Feb 8 17:03:16 CET 2003 Paolo Molaro <lupus@ximian.com>
23430 * statement.cs: don't clear the pinned var when the fixed statement
23431 returns from the method (fixes bug#37752).
23433 Sat Feb 8 12:58:06 CET 2003 Paolo Molaro <lupus@ximian.com>
23435 * typemanager.cs: fix from mathpup@mylinuxisp.com (Marcus Urban)
23438 2003-02-07 Martin Baulig <martin@ximian.com>
23440 * driver.cs: Removed the `--debug-args' command line argument.
23442 * codegen.cs (CodeGen.SaveSymbols): Removed, this is now done
23443 automatically by the AsssemblyBuilder.
23444 (CodeGen.InitializeSymbolWriter): We don't need to call any
23445 initialization function on the symbol writer anymore. This method
23446 doesn't take any arguments.
23448 2003-02-03 Miguel de Icaza <miguel@ximian.com>
23450 * driver.cs: (AddAssemblyAndDeps, LoadAssembly): Enter the types
23451 from referenced assemblies as well.
23453 2003-02-02 Martin Baulig <martin@ximian.com>
23455 * class.cs (MethodData.Emit): Generate debugging info for external methods.
23457 2003-02-02 Martin Baulig <martin@ximian.com>
23459 * class.cs (Constructor.Emit): Open the symbol writer before
23460 emitting the constructor initializer.
23461 (ConstructorInitializer.Emit): Call ec.Mark() to allow
23462 single-stepping through constructor initializers.
23464 2003-01-30 Miguel de Icaza <miguel@ximian.com>
23466 * class.cs: Handle error 549: do not allow virtual methods in
23469 2003-02-01 Jackson Harper <jackson@latitudegeo.com>
23471 * decl.cs: Check access levels when resolving types
23473 2003-01-31 Jackson Harper <jackson@latitudegeo.com>
23475 * statement.cs: Add parameters and locals set in catch blocks that might
23476 return to set vector
23478 2003-01-29 Miguel de Icaza <miguel@ximian.com>
23480 * class.cs (Operator): Set the SpecialName flags for operators.
23482 * expression.cs (Invocation.DoResolve): Only block calls to
23483 accessors and operators on SpecialName methods.
23485 (Cast.TryReduce): Handle conversions from char constants.
23488 Tue Jan 28 17:30:57 CET 2003 Paolo Molaro <lupus@ximian.com>
23490 * statement.cs: small memory and time optimization in FlowBranching.
23492 2003-01-28 Pedro Mart <yoros@wanadoo.es>
23494 * expression.cs (IndexerAccess.DoResolveLValue): Resolve the same
23495 problem that the last fix but in the other sid (Set).
23497 * expression.cs (IndexerAccess.DoResolve): Fix a problem with a null
23498 access when there is no indexer in the hierarchy.
23500 2003-01-27 Jackson Harper <jackson@latitudegeo.com>
23502 * class.cs: Combine some if statements.
23504 2003-01-27 Gonzalo Paniagua Javier <gonzalo@ximian.com>
23506 * driver.cs: fixed bug #37187.
23508 2003-01-27 Pedro Martinez Juliá <yoros@wanadoo.es>
23510 * expression.cs (IndexerAccess.DoResolve): Before trying to resolve
23511 any indexer, it's needed to build a list with all the indexers in the
23512 hierarchy (AllGetters), else we have problems. Fixes #35653.
23514 2003-01-23 Miguel de Icaza <miguel@ximian.com>
23516 * class.cs (MethodData.Define): It is wrong for an interface
23517 implementation to be static in both cases: explicit and implicit.
23518 We were only handling this in one case.
23520 Improve the if situation there to not have negations.
23522 * class.cs (Field.Define): Turns out that we do not need to check
23523 the unsafe bit on field definition, only on usage. Remove the test.
23525 2003-01-22 Gonzalo Paniagua Javier <gonzalo@ximian.com>
23527 * driver.cs: use assembly.Location instead of Codebase (the latest
23528 patch made mcs fail when using MS assemblies).
23530 2003-01-21 Tim Haynes <thaynes@openlinksw.com>
23532 * driver.cs: use DirectorySeparatorChar instead of a hardcoded "/" to
23533 get the path to *corlib.dll.
23535 2003-01-21 Nick Drochak <ndrochak@gol.com>
23539 * typemanager.cs: Remove compiler warnings
23541 2003-01-20 Duncan Mak <duncan@ximian.com>
23543 * AssemblyInfo.cs: Bump the version number to 0.19.
23545 2003-01-20 Gonzalo Paniagua Javier <gonzalo@ximian.com>
23547 * cs-tokenizer.cs: little fixes to line numbering when #line is used.
23549 2003-01-18 Zoltan Varga <vargaz@freemail.hu>
23551 * class.cs (Constructor::Emit): Emit debugging info for constructors.
23553 2003-01-17 Miguel de Icaza <miguel@ximian.com>
23555 * cs-parser.jay: Small fix: we were not comparing the constructor
23556 name correctly. Thanks to Zoltan for the initial pointer.
23558 2003-01-16 Jackson Harper <jackson@latitudegeo.com>
23560 * cs-tokenizer.cs: Set file name when specified with #line
23562 2003-01-15 Miguel de Icaza <miguel@ximian.com>
23564 * cs-parser.jay: Only perform the constructor checks here if we
23565 are named like the class; This will help provider a better
23566 error. The constructor path is taken when a type definition is
23567 not found, but most likely the user forgot to add the type, so
23568 report that rather than the constructor error.
23570 Tue Jan 14 10:36:49 CET 2003 Paolo Molaro <lupus@ximian.com>
23572 * class.cs, rootcontext.cs: small changes to avoid unnecessary memory
23575 2003-01-13 Jackson Harper <jackson@latitudegeo.com>
23577 * cs-parser.jay: Add cleanup call.
23579 2003-01-13 Duncan Mak <duncan@ximian.com>
23581 * cs-tokenizer.cs (Cleanup): Rename to 'cleanup' to make it more
23582 consistent with other methods.
23584 2003-01-13 Jackson Harper <jackson@latitudegeo.com>
23586 * cs-tokenizer.cs: Add Cleanup method, also fix #region error messages.
23588 Sun Jan 12 19:58:42 CET 2003 Paolo Molaro <lupus@ximian.com>
23590 * attribute.cs: only set GuidAttr to true when we have a
23593 2003-01-09 Gonzalo Paniagua Javier <gonzalo@ximian.com>
23597 * typemanager.cs: fixes to allow mcs compile corlib with the new
23598 Type.IsSubclassOf fix.
23600 2003-01-08 Miguel de Icaza <miguel@ximian.com>
23602 * expression.cs (LocalVariableReference.DoResolve): Classify a
23603 constant as a value, not as a variable. Also, set the type for
23606 * cs-parser.jay (fixed_statement): take a type instead of a
23607 pointer_type, so we can produce a better error message later.
23609 * statement.cs (Fixed.Resolve): Flag types that are not pointers
23612 (For.DoEmit): Make inifinite loops have a
23613 non-conditional branch back.
23615 (Fixed.DoEmit): First populate the pinned variables, then emit the
23616 statement, then clear the variables. Before I was emitting the
23617 code once for each fixed piece.
23620 2003-01-08 Martin Baulig <martin@ximian.com>
23622 * statement.cs (FlowBranching.MergeChild): A break in a
23623 SWITCH_SECTION does not leave a loop. Fixes #36155.
23625 2003-01-08 Martin Baulig <martin@ximian.com>
23627 * statement.cs (FlowBranching.CheckOutParameters): `struct_params'
23628 lives in the same number space than `param_map'. Fixes #36154.
23630 2003-01-07 Miguel de Icaza <miguel@ximian.com>
23632 * cs-parser.jay (constructor_declaration): Set the
23633 Constructor.ModFlags before probing for it. This makes the
23634 compiler report 514, 515 and 132 (the code was there, but got
23637 * statement.cs (Goto.Resolve): Set `Returns' to ALWAYS.
23638 (GotoDefault.Resolve): Set `Returns' to ALWAYS.
23639 (GotoCase.Resolve): Set `Returns' to ALWAYS.
23641 Tue Jan 7 18:32:24 CET 2003 Paolo Molaro <lupus@ximian.com>
23643 * enum.cs: create the enum static fields using the enum type.
23645 Tue Jan 7 18:23:44 CET 2003 Paolo Molaro <lupus@ximian.com>
23647 * class.cs: don't try to create the ParamBuilder for the return
23648 type if it's not needed (and handle it breaking for the ms runtime
23651 2003-01-06 Jackson Harper <jackson@latitudegeo.com>
23653 * cs-tokenizer.cs: Add REGION flag to #region directives, and add checks to make sure that regions are being poped correctly
23655 2002-12-29 Miguel de Icaza <miguel@ximian.com>
23657 * cs-tokenizer.cs (get_cmd_arg): Fixups to allow \r to terminate
23658 the command. This showed up while compiling the JANET source
23659 code, which used \r as its only newline separator.
23661 2002-12-28 Miguel de Icaza <miguel@ximian.com>
23663 * class.cs (Method.Define): If we are an operator (because it
23664 reuses our code), then set the SpecialName and HideBySig. #36128
23666 2002-12-22 Miguel de Icaza <miguel@ximian.com>
23668 * ecore.cs (FieldExpr.DoResolve): Instead of throwing an
23669 exception, report error 120 `object reference required'.
23671 * driver.cs: Add --pause option, used during to measure the size
23672 of the process as it goes with --timestamp.
23674 * expression.cs (Invocation.DoResolve): Do not allow methods with
23675 SpecialName to be invoked.
23677 2002-12-21 Miguel de Icaza <miguel@ximian.com>
23679 * cs-tokenizer.cs: Small fix to the parser: compute the ascii
23680 number before adding it.
23682 2002-12-21 Ravi Pratap <ravi@ximian.com>
23684 * ecore.cs (StandardImplicitConversion): When in an unsafe
23685 context, we allow conversion between void * to any other pointer
23686 type. This fixes bug #35973.
23688 2002-12-20 Jackson Harper <jackson@latitudegeo.com>
23690 * codegen.cs: Use Path.GetFileNameWithoutExtension so an exception
23691 is not thrown when extensionless outputs are used
23693 2002-12-20 Gonzalo Paniagua Javier <gonzalo@ximian.com>
23695 * rootcontext.cs: fixed compilation of corlib.
23697 2002-12-19 Miguel de Icaza <miguel@ximian.com>
23699 * attribute.cs (Attributes.Contains): Add new method.
23701 * class.cs (MethodCore.LabelParameters): if the parameter is an
23702 `out' parameter, check that no attribute `[In]' has been passed.
23704 * enum.cs: Handle the `value__' name in an enumeration.
23706 2002-12-14 Jaroslaw Kowalski <jarek@atm.com.pl>
23708 * decl.cs: Added special case to allow overrides on "protected
23711 2002-12-18 Ravi Pratap <ravi@ximian.com>
23713 * attribute.cs (Attributes.AddAttributeSection): Rename to this
23714 since it makes much more sense.
23716 (Attributes.ctor): Don't require a Location parameter.
23718 * rootcontext.cs (AddGlobalAttributeSection): Rename again.
23720 * attribute.cs (ApplyAttributes): Remove extra Location parameters
23721 since we already have that information per attribute.
23723 * everywhere : make appropriate changes.
23725 * class.cs (LabelParameters): Write the code which actually
23726 applies attributes to the return type. We can't do this on the MS
23727 .NET runtime so we flag a warning in the case an exception is
23730 2002-12-18 Miguel de Icaza <miguel@ximian.com>
23732 * const.cs: Handle implicit null conversions here too.
23734 2002-12-17 Ravi Pratap <ravi@ximian.com>
23736 * class.cs (MethodCore.LabelParameters): Remove the extra
23737 Type [] parameter since it is completely unnecessary. Instead
23738 pass in the method's attributes so that we can extract
23739 the "return" attribute.
23741 2002-12-17 Miguel de Icaza <miguel@ximian.com>
23743 * cs-parser.jay (parse): Use Report.Error to flag errors instead
23744 of ignoring it and letting the compile continue.
23746 * typemanager.cs (ChangeType): use an extra argument to return an
23747 error condition instead of throwing an exception.
23749 2002-12-15 Miguel de Icaza <miguel@ximian.com>
23751 * expression.cs (Unary.TryReduce): mimic the code for the regular
23752 code path. Perform an implicit cast in the cases where we can
23753 implicitly convert to one of the integral types, and then reduce
23754 based on that constant. This fixes bug #35483.
23756 2002-12-14 Gonzalo Paniagua Javier <gonzalo@ximian.com>
23758 * typemanager.cs: fixed cut & paste error in GetRemoveMethod.
23760 2002-12-13 Gonzalo Paniagua Javier <gonzalo@ximian.com>
23762 * namespace.cs: fixed bug #35489.
23764 2002-12-12 Miguel de Icaza <miguel@ximian.com>
23766 * class.cs: Remove some dead code.
23768 * cs-parser.jay: Estimate the number of methods needed
23769 (RootContext.MethodCount);
23771 * cs-tokenizer.cs: Use char arrays for parsing identifiers and
23772 numbers instead of StringBuilders.
23774 * support.cs (PtrHashtable): Add constructor with initial size;
23775 We can now reduce reallocations of the method table.
23777 2002-12-10 Ravi Pratap <ravi@ximian.com>
23779 * attribute.cs (ApplyAttributes): Keep track of the emitted
23780 attributes on a per-target basis. This fixes bug #35413.
23782 2002-12-10 Miguel de Icaza <miguel@ximian.com>
23784 * driver.cs (MainDriver): On rotor encoding 28591 does not exist,
23785 default to the Windows 1252 encoding.
23787 (UnixParseOption): Support version, thanks to Alp for the missing
23790 * AssemblyInfo.cs: Add nice assembly information.
23792 * cs-tokenizer.cs: Add fix from Felix to the #if/#else handler
23795 * cs-parser.jay: Allow a trailing comma before the close bracked
23796 in the attribute_section production.
23798 * ecore.cs (FieldExpr.AddressOf): Until I figure out why the
23799 address of the instance was being taken, I will take this out,
23800 because we take the address of the object immediately here.
23802 2002-12-09 Ravi Pratap <ravi@ximian.com>
23804 * typemanager.cs (AreMultipleAllowed): Take care of the most
23805 obvious case where attribute type is not in the current assembly -
23808 2002-12-08 Miguel de Icaza <miguel@ximian.com>
23810 * ecore.cs (SimpleName.DoResolve): First perform lookups on using
23811 definitions, instead of doing that afterwards.
23813 Also we use a nice little hack, depending on the constructor, we
23814 know if we are a "composed" name or a simple name. Hence, we
23815 avoid the IndexOf test, and we avoid
23817 * codegen.cs: Add code to assist in a bug reporter to track down
23818 the source of a compiler crash.
23820 2002-12-07 Ravi Pratap <ravi@ximian.com>
23822 * attribute.cs (Attribute.ApplyAttributes) : Keep track of which attribute
23823 types have been emitted for a given element and flag an error
23824 if something which does not have AllowMultiple set is used more
23827 * typemanager.cs (RegisterAttributeAllowMultiple): Keep track of
23828 attribute types and their corresponding AllowMultiple properties
23830 (AreMultipleAllowed): Check the property for a given type.
23832 * attribute.cs (Attribute.ApplyAttributes): Register the AllowMultiple
23833 property in the case we have a TypeContainer.
23835 (Attributes.AddAttribute): Detect duplicates and just skip on
23836 adding them. This trivial fix catches a pretty gross error in our
23837 attribute emission - global attributes were being emitted twice!
23839 Bugzilla bug #33187 is now fixed.
23841 2002-12-06 Miguel de Icaza <miguel@ximian.com>
23843 * cs-tokenizer.cs (pp_expr): Properly recurse here (use pp_expr
23844 instead of pp_and).
23846 * expression.cs (Binary.ResolveOperator): I can only use the
23847 Concat (string, string, string) and Concat (string, string,
23848 string, string) if the child is actually a concatenation of
23851 2002-12-04 Miguel de Icaza <miguel@ximian.com>
23853 * cs-tokenizer.cs: Small fix, because decimal_digits is used in a
23854 context where we need a 2-character lookahead.
23856 * pending.cs (PendingImplementation): Rework so we can keep track
23857 of interface types all the time, and flag those which were
23858 implemented by parents as optional.
23860 2002-12-03 Miguel de Icaza <miguel@ximian.com>
23862 * expression.cs (Binary.ResolveOperator): Use
23863 String.Concat(string,string,string) or
23864 String.Concat(string,string,string,string) when possible.
23866 * typemanager: More helper methods.
23869 Tue Dec 3 19:32:04 CET 2002 Paolo Molaro <lupus@ximian.com>
23871 * pending.cs: remove the bogus return from GetMissingInterfaces()
23872 (see the 2002-11-06 entry: the mono runtime is now fixed in cvs).
23874 2002-12-02 Gonzalo Paniagua Javier <gonzalo@ximian.com>
23876 * namespace.cs: avoid duplicated 'using xxx' being added to
23877 using_clauses. This prevents mcs from issuing and 'ambiguous type' error
23878 when we get more than one 'using' statement for the same namespace.
23879 Report a CS0105 warning for it.
23881 2002-11-30 Miguel de Icaza <miguel@ximian.com>
23883 * cs-tokenizer.cs (consume_identifier): use read directly, instead
23884 of calling getChar/putback, uses internal knowledge of it.
23886 (xtoken): Reorder tokenizer so most common patterns are checked
23887 first. This reduces the compilation time in another 5% (from 8.11s
23888 average to 7.73s for bootstrapping mcs on my Mobile p4/1.8ghz).
23890 The parsing time is 22% of the compilation in mcs, and from that
23891 64% is spent on the tokenization process.
23893 I tried using a binary search for keywords, but this is slower
23894 than the hashtable. Another option would be to do a couple of
23897 * Not use a StringBuilder, instead use an array of chars,
23898 with a set value. Notice that this way we could catch
23899 the 645 error without having to do it *afterwards*.
23901 * We could write a hand-parser to avoid the hashtable
23902 compares altogether.
23904 The identifier consumption process takes 37% of the tokenization
23905 time. Another 15% is spent on is_number. 56% of the time spent
23906 on is_number is spent on Int64.Parse:
23908 * We could probably choose based on the string length to
23909 use Int32.Parse or Int64.Parse and avoid all the 64-bit
23912 Another 3% is spend on wrapping `xtoken' in the `token' function.
23914 Handle 0xa0 as whitespace (#34752)
23916 2002-11-26 Miguel de Icaza <miguel@ximian.com>
23918 * typemanager.cs (IsCLRType): New routine to tell whether a type
23919 is one of the builtin types.
23921 Maybe it needs to use TypeCodes to be faster. Maybe we could use
23922 typecode in more places instead of doing pointer comparissions.
23923 We could leverage some knowledge about the way the typecodes are
23926 New code to cache namespaces in assemblies, it is currently not
23927 invoked, to be used soon.
23929 * decl.cs (DeclSpace.MakeFQN): Simple optimization.
23931 * expression.cs (Binary.ResolveOperator): specially handle
23932 strings, and do not perform user-defined operator overloading for
23935 2002-11-24 Miguel de Icaza <miguel@ximian.com>
23937 * cs-tokenizer.cs: Avoid calling Char.IsDigit which is an
23938 internalcall as it is a pretty simple operation; Avoid whenever
23939 possible to call Char.IsLetter.
23941 (consume_identifier): Cut by half the number of
23942 hashtable calls by merging the is_keyword and GetKeyword behavior.
23944 Do not short-circuit, because if we do, we
23945 report errors (ie, #if false && true would produce an invalid
23949 2002-11-24 Martin Baulig <martin@ximian.com>
23951 * expression.cs (Cast.TryReduce): If we're in checked syntax,
23952 check constant ranges and report a CS0221. Fixes #33186.
23954 2002-11-24 Martin Baulig <martin@ximian.com>
23956 * cs-parser.jay: Make this work for uninitialized variable
23957 declarations in the `for' initializer. Fixes #32416.
23959 2002-11-24 Martin Baulig <martin@ximian.com>
23961 * ecore.cs (Expression.ConvertExplicit): Make casting from/to
23962 System.Enum actually work. Fixes bug #32269, added verify-6.cs.
23964 2002-11-24 Martin Baulig <martin@ximian.com>
23966 * expression.cs (Binary.DoNumericPromotions): Added `check_user_conv'
23967 argument; if true, we also check for user-defined conversions.
23968 This is only needed if both arguments are of a user-defined type.
23969 Fixes #30443, added test-175.cs.
23970 (Binary.ForceConversion): Pass the location argument to ConvertImplicit.
23972 * ecore.cs (Expression.ImplicitUserConversionExists): New method.
23974 2002-11-24 Martin Baulig <martin@ximian.com>
23976 * expression.cs (ArrayAccess.GetStoreOpcode): New public static
23977 function to get the store opcode.
23978 (Invocation.EmitParams): Call ArrayAccess.GetStoreOpcode() and
23979 only emit the Ldelema if the store opcode is Stobj. You must run
23980 both test-34 and test-167 to test this. Fixes #34529.
23982 2002-11-23 Martin Baulig <martin@ximian.com>
23984 * ecore.cs (Expression.MemberLookup): Added additional
23985 `qualifier_type' argument which is used when we're being called
23986 from MemberAccess.DoResolve() and null if we're called from a
23988 (Expression.MemberLookupFailed): New method to report errors; this
23989 does the CS1540 check and reports the correct error message.
23991 * typemanager.cs (MemberLookup): Added additional `qualifier_type'
23992 argument for the CS1540 check and redone the way how we're dealing
23993 with private members. See the comment in the source code for details.
23994 (FilterWithClosure): Reverted this back to revision 1.197; renamed
23995 `closure_start_type' to `closure_qualifier_type' and check whether
23996 it's not null. It was not this filter being broken, it was just
23997 being called with the wrong arguments.
23999 * expression.cs (MemberAccess.DoResolve): use MemberLookupFinal()
24000 and pass it the correct `qualifier_type'; this also does the error
24003 2002-11-22 Miguel de Icaza <miguel@ximian.com>
24005 * expression.cs (Invocation.EmitParams): If the we are dealing
24006 with a non-built-in value type, load its address as well.
24008 (ArrayCreation): Use a a pretty constant instead
24009 of the hardcoded value 2. Use 6 instead of 2 for the number of
24010 static initializers.
24012 (ArrayCreation.EmitDynamicInitializers): Peel enumerations,
24013 because they are not really value types, just glorified integers.
24015 * driver.cs: Do not append .exe, the CSC compiler does not do it.
24017 * ecore.cs: Remove redundant code for enumerations, make them use
24018 the same code path as everything else, fixes the casting issue
24019 with enumerations in Windows.Forms.
24021 * attribute.cs: Do only cast to string if it is a string, the
24022 validation happens later.
24024 * typemanager.cs: Temproary hack to avoid a bootstrap issue until
24025 people upgrade their corlibs.
24027 * ecore.cs: Oops, enumerations were not following the entire code path
24029 2002-11-21 Miguel de Icaza <miguel@ximian.com>
24031 * typemanager.cs (FilterWithClosure): Commented out the test for
24032 1540 in typemanager.cs, as it has problems when accessing
24033 protected methods from a parent class (see test-174.cs).
24035 * attribute.cs (Attribute.ValidateGuid): new method.
24036 (Attribute.Resolve): Use above.
24038 2002-11-19 Miguel de Icaza <miguel@ximian.com>
24040 * enum.cs: In FindMembers, perform a recursive lookup for values. (34308)
24042 * ecore.cs (SimpleName.SimpleNameResolve): Remove the special
24043 handling for enumerations, as we only needed the TypeContainer
24044 functionality to begin with (this is required for the fix below to
24045 work for enums that reference constants in a container class for
24048 * codegen.cs (EmitContext): Make TypeContainer a DeclSpace.
24050 * enum.cs (Enum.Define): Use `this' instead of parent, so we have
24051 a valid TypeBuilder to perform lookups on.o
24053 * class.cs (InheritableMemberSignatureCompare): Use true in the
24054 call to GetGetMethod and GetSetMethod, because we are comparing
24055 the signature, and we need to get the methods *even* if they are
24058 (PropertyBase.CheckBase): ditto.
24060 * statement.cs (Switch.ResolveAndReduce, Block.EmitMeta,
24061 GotoCase.Resolve): Use Peel on EmpytCasts.
24063 * ecore.cs (EmptyCast): drop child, add Peel method.
24065 2002-11-17 Martin Baulig <martin@ximian.com>
24067 * ecore.cs (EmptyCast.Child): New public property.
24069 * statement.cs (SwitchLabel.ResolveAndReduce): Check whether the
24070 label resolved to an EmptyCast. Fixes #34162.
24071 (GotoCase.Resolve): Likewise.
24072 (Block.EmitMeta): Likewise.
24074 2002-11-17 Martin Baulig <martin@ximian.com>
24076 * expression.cs (Invocation.BetterConversion): Prefer int over
24077 uint; short over ushort; long over ulong for integer literals.
24078 Use ImplicitConversionExists instead of StandardConversionExists
24079 since we also need to check for user-defined implicit conversions.
24080 Fixes #34165. Added test-173.cs.
24082 2002-11-16 Martin Baulig <martin@ximian.com>
24084 * expression.cs (Binary.EmitBranchable): Eliminate comparisions
24085 with the `true' and `false' literals. Fixes #33151.
24087 2002-11-16 Martin Baulig <martin@ximian.com>
24089 * typemanager.cs (RealMemberLookup): Reverted Miguel's patch from
24090 October 22nd; don't do the cs1540 check for static members.
24092 * ecore.cs (PropertyExpr.ResolveAccessors): Rewrote this; we're
24093 now using our own filter here and doing the cs1540 check again.
24095 2002-11-16 Martin Baulig <martin@ximian.com>
24097 * support.cs (InternalParameters): Don't crash if we don't have
24098 any fixed parameters. Fixes #33532.
24100 2002-11-16 Martin Baulig <martin@ximian.com>
24102 * decl.cs (MemberCache.AddMethods): Use BindingFlags.FlattenHierarchy
24103 when looking up static methods to make this work on Windows.
24106 2002-11-16 Martin Baulig <martin@ximian.com>
24108 * ecore.cs (PropertyExpr.VerifyAssignable): Check whether we have
24109 a setter rather than using PropertyInfo.CanWrite.
24111 2002-11-15 Nick Drochak <ndrochak@gol.com>
24113 * class.cs: Allow acces to block member by subclasses. Fixes build
24116 2002-11-14 Martin Baulig <martin@ximian.com>
24118 * class.cs (Constructor.Emit): Added the extern/block check.
24121 2002-11-14 Martin Baulig <martin@ximian.com>
24123 * expression.cs (IndexerAccess.DoResolve): Do a DeclaredOnly
24124 iteration while looking for indexers, this is needed because the
24125 indexer may have a different name in our base classes. Fixed the
24126 error reporting (no indexers at all, not get accessor, no
24127 overloaded match). Fixes bug #33089.
24128 (IndexerAccess.DoResolveLValue): Likewise.
24130 2002-11-14 Martin Baulig <martin@ximian.com>
24132 * class.cs (PropertyBase.CheckBase): Make this work for multiple
24133 indexers. Fixes the first part of bug #33089.
24134 (MethodSignature.InheritableMemberSignatureCompare): Added support
24137 2002-11-13 Ravi Pratap <ravi@ximian.com>
24139 * attribute.cs (Attribute.Resolve): Catch the
24140 NullReferenceException and report it since it isn't supposed to
24143 2002-11-12 Miguel de Icaza <miguel@ximian.com>
24145 * expression.cs (Binary.EmitBranchable): Also handle the cases for
24146 LogicalOr and LogicalAnd that can benefit from recursively
24147 handling EmitBranchable. The code now should be nice for Paolo.
24149 2002-11-08 Miguel de Icaza <miguel@ximian.com>
24151 * typemanager.cs (LookupType): Added a negative-hit hashtable for
24152 the Type lookups, as we perform quite a number of lookups on
24153 non-Types. This can be removed once we can deterministically tell
24154 whether we have a type or a namespace in advance.
24156 But this might require special hacks from our corlib.
24160 * ecore.cs (TryImplicitIntConversion): Handle conversions to float
24161 and double which avoids a conversion from an integer to a double.
24163 * expression.cs: tiny optimization, avoid calling IsConstant,
24164 because it effectively performs the lookup twice.
24166 2002-11-06 Miguel de Icaza <miguel@ximian.com>
24168 But a bogus return here to keep the semantics of the old code
24169 until the Mono runtime is fixed.
24171 * pending.cs (GetMissingInterfaces): New method used to remove all
24172 the interfaces that are already implemented by our parent
24173 classes from the list of pending methods.
24175 * interface.cs: Add checks for calls after ResolveTypeExpr.
24177 2002-11-05 Miguel de Icaza <miguel@ximian.com>
24179 * class.cs (Class.Emit): Report warning 67: event not used if the
24180 warning level is beyond 3.
24182 * ecore.cs (Expression.ConvertExplicit): Missed a check for expr
24183 being a NullLiteral.
24185 * cs-parser.jay: Fix, Gonzalo reverted the order of the rank
24188 * class.cs (TypeContainer.GetClassBases): Cover a missing code
24189 path that might fail if a type can not be resolved.
24191 * expression.cs (Binary.Emit): Emit unsigned versions of the
24194 * driver.cs: use error 5.
24196 2002-11-02 Gonzalo Paniagua Javier <gonzalo@gnome-db.org>
24198 * cs-parser.jay: simplified a rule and 5 SR conflicts dissapeared.
24200 2002-11-01 Miguel de Icaza <miguel@ximian.com>
24202 * cs-parser.jay (switch_section): A beautiful patch from Martin
24203 Baulig that fixed 33094.
24205 2002-10-31 Miguel de Icaza <miguel@ximian.com>
24207 * ecore.cs (PropertyExpr.DoResolveLValue, PropertyExpr.DoResolve):
24208 Check whether the base is abstract and report an error if so.
24210 * expression.cs (IndexerAccess.DoResolveLValue,
24211 IndexerAccess.DoResolve): ditto.
24213 (Invocation.DoResolve): ditto.
24215 (Invocation.FullMethodDesc): Improve the report string.
24217 * statement.cs (Block): Eliminate IsVariableDefined as it is
24218 basically just a wrapper for GetVariableInfo.
24220 * ecore.cs (SimpleName): Use new
24222 * support.cs (ReflectionParamter.ParameterType): We unwrap the
24223 type, as we return the actual parameter ref/unref state on a
24226 2002-10-30 Miguel de Icaza <miguel@ximian.com>
24228 * support.cs: Return proper flags REF/OUT fixing the previous
24231 * expression.cs: Reverted last patch, that was wrong. Is_ref is
24232 not used to mean `ref' but `ref or out' in ParameterReference
24234 * delegate.cs (FullDelegateDesc): use ParameterDesc to get the
24235 full type signature instead of calling TypeManger.CSharpName
24238 * support.cs (InternalParameters.ParameterDesc): Do not compare
24239 directly to the modflags, because REF/OUT will actually be bitsets
24242 * delegate.cs (VerifyMethod): Check also the modifiers.
24244 * cs-tokenizer.cs: Fix bug where floating point values with an
24245 exponent where a sign was missing was ignored.
24247 * driver.cs: Allow multiple assemblies to be specified in a single
24250 2002-10-28 Miguel de Icaza <miguel@ximian.com>
24252 * cs-parser.jay: Ugly. We had to add a multiplicative_expression,
24253 because identifiers after a parenthesis would end up in this kind
24254 of production, and we needed to desamiguate it for having casts
24257 (UserDefinedType *) xxx
24259 2002-10-24 Miguel de Icaza <miguel@ximian.com>
24261 * typemanager.cs (RealMemberLookup): when we deal with a subclass,
24262 we should set on the Bindingflags.NonPublic, but not turn on
24263 private_ok. private_ok controls whether a Private member is
24264 returned (this is chekced on the filter routine), while the
24265 BindingFlags.NonPublic just controls whether private/protected
24266 will be allowed. This fixes the problem part of the problem of
24267 private properties being allowed to be used in derived classes.
24269 * expression.cs (BaseAccess): Provide an DoResolveLValue method,
24270 so we can call the children DoResolveLValue method (this will
24271 properly signal errors on lvalue assignments to base properties)
24273 * ecore.cs (PropertyExpr.ResolveAccessors): If both setter and
24274 getter are null, and we have a property info, we know that this
24275 happened because the lookup failed, so we report an error 122 for
24276 protection level violation.
24278 We also silently return if setter and getter are null in the
24279 resolve functions, this condition only happens if we have flagged
24280 the error before. This is the other half of the problem.
24282 (PropertyExpr.ResolveAccessors): Turns out that PropertyInfo does
24283 not have accessibility information, that is why we were returning
24284 true in the filter function in typemanager.cs.
24286 To properly report 122 (property is inaccessible because of its
24287 protection level) correctly, we report this error in ResolveAccess
24288 by failing if both the setter and the getter are lacking (ie, the
24291 DoResolve and DoLResolve have been modified to check for both
24292 setter/getter being null and returning silently, the reason being
24293 that I did not want to put the knowledge about this error in upper
24296 int old = Report.Errors;
24297 x = new PropertyExpr (...);
24298 if (old != Report.Errors)
24303 So the property expr is returned, but it is invalid, so the error
24304 will be flagged during the resolve process.
24306 * class.cs: Remove InheritablePropertySignatureCompare from the
24307 class, as we no longer depend on the property signature to compute
24308 whether it is possible to implement a method or not.
24310 The reason is that calling PropertyInfo.GetGetMethod will return
24311 null (in .NET, in Mono it works, and we should change this), in
24312 cases where the Get Method does not exist in that particular
24317 class X { public virtual int A { get { return 1; } } }
24319 class Z : Y { public override int A { get { return 2; } } }
24321 Would fail in Z because the parent (Y) would not have the property
24322 defined. So we avoid this completely now (because the alternative
24323 fix was ugly and slow), and we now depend exclusively on the
24326 (PropertyBase.CheckBase): Use a method-base mechanism to find our
24327 reference method, instead of using the property.
24329 * typemanager.cs (GetPropertyGetter, GetPropertySetter): These
24330 routines are gone now.
24332 * typemanager.cs (GetPropertyGetter, GetPropertySetter): swap the
24333 names, they were incorrectly named.
24335 * cs-tokenizer.cs: Return are more gentle token on failure.
24337 * pending.cs (PendingImplementation.InterfaceMethod): This routine
24338 had an out-of-sync index variable, which caused it to remove from
24339 the list of pending methods the wrong method sometimes.
24341 2002-10-22 Miguel de Icaza <miguel@ximian.com>
24343 * ecore.cs (PropertyExpr): Do not use PropertyInfo.CanRead,
24344 CanWrite, because those refer to this particular instance of the
24345 property, and do not take into account the fact that we can
24346 override single members of a property.
24348 Constructor requires an EmitContext. The resolution process does
24349 not happen here, but we need to compute the accessors before,
24350 because the resolution does not always happen for properties.
24352 * typemanager.cs (RealMemberLookup): Set private_ok if we are a
24353 subclass, before we did not update this flag, but we did update
24356 (GetAccessors): Drop this routine, as it did not work in the
24357 presence of partially overwritten set/get methods.
24359 Notice that this broke the cs1540 detection, but that will require
24362 2002-10-22 Gonzalo Paniagua Javier <gonzalo@ximian.com>
24366 * driver.cs: issue a warning instead of an error if we don't support
24367 debugging for the platform. Also ignore a couple of errors that may
24368 arise when trying to write the symbols. Undo my previous patch.
24370 2002-10-22 Gonzalo Paniagua Javier <gonzalo@ximian.com>
24372 * driver.cs: ignore /debug switch except for Unix platforms.
24374 2002-10-23 Nick Drochak <ndrochak@gol.com>
24376 * makefile: Remove mcs2.exe and mcs3.exe on 'make clean'
24378 2002-10-21 Miguel de Icaza <miguel@ximian.com>
24380 * driver.cs: Do not make mcs-debug conditional, so we do not break
24381 builds that use it.
24383 * statement.cs (UsageVector.MergeChildren): I would like Martin to
24384 review this patch. But basically after all the children variables
24385 have been merged, the value of "Breaks" was not being set to
24386 new_breaks for Switch blocks. I think that it should be set after
24387 it has executed. Currently I set this to the value of new_breaks,
24388 but only if new_breaks is FlowReturn.ALWAYS, which is a bit
24389 conservative, but I do not understand this code very well.
24391 I did not break anything in the build, so that is good ;-)
24393 * cs-tokenizer.cs: Also allow \r in comments as a line separator.
24395 2002-10-20 Mark Crichton <crichton@gimp.org>
24397 * cfold.cs: Fixed compile blocker. Really fixed it this time.
24399 2002-10-20 Nick Drochak <ndrochak@gol.com>
24401 * cfold.cs: Fixed compile blocker.
24403 2002-10-20 Miguel de Icaza <miguel@ximian.com>
24405 * driver.cs: I was chekcing the key, not the file.
24407 2002-10-19 Ravi Pratap <ravi@ximian.com>
24409 * ecore.cs (UserDefinedConversion): Get rid of the bogus error
24410 message that we were generating - we just need to silently return
24413 2002-10-19 Miguel de Icaza <miguel@ximian.com>
24415 * class.cs (Event.Define): Change my previous commit, as this
24416 breaks the debugger. This is a temporary hack, as it seems like
24417 the compiler is generating events incorrectly to begin with.
24419 * expression.cs (Binary.ResolveOperator): Added support for
24420 "U operator - (E x, E y)"
24422 * cfold.cs (BinaryFold): Added support for "U operator - (E x, E
24425 * ecore.cs (FieldExpr.AddressOf): We had a special code path for
24426 init-only variables, but this path did not take into account that
24427 there might be also instance readonly variables. Correct this
24430 This fixes bug 32253
24432 * delegate.cs (NewDelegate.DoResolve): Catch creation of unsafe
24435 * driver.cs: Change the extension for modules to `netmodule'
24437 * cs-parser.jay: Improved slightly the location tracking for
24438 the debugger symbols.
24440 * class.cs (Event.Define): Use Modifiers.FieldAttr on the
24441 modifiers that were specified instead of the hardcoded value
24442 (FamAndAssem). This was basically ignoring the static modifier,
24443 and others. Fixes 32429.
24445 * statement.cs (Switch.SimpleSwitchEmit): Simplified the code, and
24446 fixed a bug in the process (32476)
24448 * expression.cs (ArrayAccess.EmitAssign): Patch from
24449 hwang_rob@yahoo.ca that fixes bug 31834.3
24451 2002-10-18 Miguel de Icaza <miguel@ximian.com>
24453 * driver.cs: Make the module extension .netmodule.
24455 2002-10-16 Miguel de Icaza <miguel@ximian.com>
24457 * driver.cs: Report an error if the resource file is not found
24458 instead of crashing.
24460 * ecore.cs (PropertyExpr.EmitAssign): Pass IsBase instead of
24461 false, like Emit does.
24463 2002-10-16 Nick Drochak <ndrochak@gol.com>
24465 * typemanager.cs: Remove unused private member. Also reported mcs
24466 bug to report this as a warning like csc.
24468 2002-10-15 Martin Baulig <martin@gnome.org>
24470 * statement.cs (Statement.Emit): Made this a virtual method; emits
24471 the line number info and calls DoEmit().
24472 (Statement.DoEmit): New protected abstract method, formerly knows
24473 as Statement.Emit().
24475 * codegen.cs (EmitContext.Mark): Check whether we have a symbol writer.
24477 2002-10-11 Miguel de Icaza <miguel@ximian.com>
24479 * class.cs: Following the comment from 2002-09-26 to AddMethod, I
24480 have fixed a remaining problem: not every AddXXXX was adding a
24481 fully qualified name.
24483 Now everyone registers a fully qualified name in the DeclSpace as
24484 being defined instead of the partial name.
24486 Downsides: we are slower than we need to be due to the excess
24487 copies and the names being registered this way.
24489 The reason for this is that we currently depend (on the corlib
24490 bootstrap for instance) that types are fully qualified, because
24491 we dump all the types in the namespace, and we should really have
24492 types inserted into the proper namespace, so we can only store the
24493 basenames in the defined_names array.
24495 2002-10-10 Martin Baulig <martin@gnome.org>
24497 * expression.cs (ArrayAccess.EmitStoreOpcode): Reverted the patch
24498 from bug #31834, see the bug report for a testcase which is
24501 2002-10-10 Martin Baulig <martin@gnome.org>
24503 * codegen.cs (EmitContext.Breaks): Removed, we're now using the
24504 flow analysis code for this.
24506 * statement.cs (Do, While, For): Tell the flow analysis code about
24508 (FlowBranching.UsageVector): Added support for infinite loops.
24509 (Block.Resolve): Moved the dead code elimination here and use flow
24512 2002-10-09 Miguel de Icaza <miguel@ximian.com>
24514 * class.cs (Field.Define): Catch cycles on struct type
24517 * typemanager.cs (IsUnmanagedtype): Do not recursively check
24518 fields if the fields are static. We only need to check instance
24521 * expression.cs (As.DoResolve): Test for reference type.
24523 * statement.cs (Using.ResolveExpression): Use
24524 ConvertImplicitRequired, not ConvertImplicit which reports an
24526 (Using.ResolveLocalVariableDecls): ditto.
24528 * expression.cs (Binary.ResolveOperator): Report errors in a few
24529 places where we had to.
24531 * typemanager.cs (IsUnmanagedtype): Finish implementation.
24533 2002-10-08 Miguel de Icaza <miguel@ximian.com>
24535 * expression.cs: Use StoreFromPtr instead of extracting the type
24536 and then trying to use Stelem. Patch is from hwang_rob@yahoo.ca
24538 * ecore.cs (ImplicitReferenceConversion): It is possible to assign
24539 an enumeration value to a System.Enum, but System.Enum is not a
24540 value type, but an class type, so we need to box.
24542 (Expression.ConvertExplicit): One codepath could return
24543 errors but not flag them. Fix this. Fixes #31853
24545 * parameter.cs (Resolve): Do not allow void as a parameter type.
24547 2002-10-06 Martin Baulig <martin@gnome.org>
24549 * statemenc.cs (FlowBranching.SetParameterAssigned): Don't crash
24550 if it's a class type and not a struct. Fixes #31815.
24552 2002-10-06 Martin Baulig <martin@gnome.org>
24554 * statement.cs: Reworked the flow analysis code a bit to make it
24555 usable for dead code elimination.
24557 2002-10-06 Gonzalo Paniagua Javier <gonzalo@ximian.com>
24559 * cs-parser.jay: allow empty source files. Fixes bug #31781.
24561 2002-10-04 Miguel de Icaza <miguel@ximian.com>
24563 * expression.cs (ComposedCast.DoResolveType): A quick workaround
24564 to fix the test 165, will investigate deeper.
24566 2002-10-04 Martin Baulig <martin@gnome.org>
24568 * statement.cs (FlowBranching.UsageVector.MergeChildren): Make
24569 finally blocks actually work.
24570 (Try.Resolve): We don't need to create a sibling for `finally' if
24571 there is no finally block.
24573 2002-10-04 Martin Baulig <martin@gnome.org>
24575 * class.cs (Constructor.Define): The default accessibility for a
24576 non-default constructor is private, not public.
24578 2002-10-04 Miguel de Icaza <miguel@ximian.com>
24580 * class.cs (Constructor): Make AllowedModifiers public, add
24583 * cs-parser.jay: Perform the modifiers test here, as the
24584 constructor for the Constructor class usually receives a zero
24585 because of the way we create it (first we create, later we
24586 customize, and we were never checking the modifiers).
24588 * typemanager.cs (Typemanager.LookupTypeDirect): This new function
24589 is a version of LookupTypeReflection that includes the type-name
24590 cache. This can be used as a fast path for functions that know
24591 the fully qualified name and are only calling into *.GetType() to
24592 obtain a composed type.
24594 This is also used by TypeManager.LookupType during its type
24597 (LookupType): We now also track the real type name, as sometimes
24598 we can get a quey for the real type name from things like
24599 ComposedCast. This fixes bug 31422.
24601 * expression.cs (ComposedCast.Resolve): Since we are obtaining a
24602 complete type fullname, it does not have to go through the type
24603 resolution system to obtain the composed version of the type (for
24604 obtaining arrays or pointers).
24606 (Conditional.Emit): Use the EmitBoolExpression to
24607 generate nicer code, as requested by Paolo.
24609 (ArrayCreation.CheckIndices): Use the patch from
24610 hwang_rob@yahoo.ca to validate the array initializers.
24612 2002-10-03 Miguel de Icaza <miguel@ximian.com>
24614 * class.cs (ConstructorInitializer.Emit): simplify code by using
24615 Invocation.EmitCall, and at the same time, fix the bugs in calling
24616 parent constructors that took variable arguments.
24618 * ecore.cs (Expression.ConvertNumericExplicit,
24619 Expression.ImplicitNumericConversion): Remove the code that
24620 manually wrapped decimal (InternalTypeConstructor call is now gone
24623 * expression.cs (Cast.TryReduce): Also handle decimal types when
24624 trying to perform a constant fold on the type.
24626 * typemanager.cs (IsUnmanagedtype): Partially implemented.
24628 * parameter.cs: Removed ResolveAndDefine, as it was not needed, as
24629 that only turned off an error report, and did nothing else.
24631 2002-10-02 Miguel de Icaza <miguel@ximian.com>
24633 * driver.cs: Handle and ignore /fullpaths
24635 2002-10-01 Miguel de Icaza <miguel@ximian.com>
24637 * expression.cs (Binary.ResolveOperator): Catch the case where
24638 DoNumericPromotions returns true,
24640 (Binary.DoNumericPromotions): Simplify the code, and the tests.
24642 2002-09-27 Miguel de Icaza <miguel@ximian.com>
24644 * ecore.cs (EventExpr.Emit): Instead of emitting an exception,
24647 2002-09-26 Miguel de Icaza <miguel@ximian.com>
24649 * ecore.cs (ConvertNumericExplicit): It is not enough that the
24650 conversion exists, but it is also required that the conversion be
24651 performed. This manifested in "(Type64Enum) 2".
24653 * class.cs (TypeManager.AddMethod): The fix is not to change
24654 AddEnum, because that one was using a fully qualified name (every
24655 DeclSpace derivative does), but to change the AddMethod routine
24656 that was using an un-namespaced name. This now correctly reports
24657 the duplicated name.
24659 Revert patch until I can properly fix it. The issue
24660 is that we have a shared Type space across all namespaces
24661 currently, which is wrong.
24663 Options include making the Namespace a DeclSpace, and merge
24664 current_namespace/current_container in the parser.
24666 2002-09-25 Miguel de Icaza <miguel@ximian.com>
24668 * cs-parser.jay: Improve error reporting when we get a different
24669 kind of expression in local_variable_type and
24670 local_variable_pointer_type.
24672 Propagate this to avoid missleading errors being reported.
24674 * ecore.cs (ImplicitReferenceConversion): treat
24675 TypeManager.value_type as a target just like object_type. As
24680 Is valid, and needs to result in the int 1 being boxed before it
24681 is assigned to the value type v.
24683 * class.cs (TypeContainer.AddEnum): Use the basename, not the name
24684 to validate the enumeration name.
24686 * expression.cs (ArrayAccess.EmitAssign): Mimic the same test from
24687 EmitDynamicInitializers for the criteria to use Ldelema. Thanks
24688 to hwang_rob@yahoo.ca for finding the bug and providing a patch.
24690 * ecore.cs (TryImplicitIntConversion): When doing an
24691 implicit-enumeration-conversion, check if the type is 64-bits and
24692 perform a conversion before passing to EnumConstant.
24694 2002-09-23 Miguel de Icaza <miguel@ximian.com>
24696 * decl.cs (Error_AmbiguousTypeReference); New routine used to
24697 report ambiguous type references. Unlike the MS version, we
24698 report what the ambiguity is. Innovation at work ;-)
24700 (DeclSpace.FindType): Require a location argument to
24701 display when we display an ambiguous error.
24703 * ecore.cs: (SimpleName.DoResolveType): Pass location to FindType.
24705 * interface.cs (GetInterfaceTypeByName): Pass location to FindType.
24707 * expression.cs (EmitDynamicInitializers): Apply patch from
24708 hwang_rob@yahoo.ca that fixes the order in which we emit our
24711 2002-09-21 Martin Baulig <martin@gnome.org>
24713 * delegate.cs (Delegate.VerifyApplicability): Make this work if the
24714 delegate takes no arguments.
24716 2002-09-20 Miguel de Icaza <miguel@ximian.com>
24718 * constant.cs: Use Conv_U8 instead of Conv_I8 when loading longs
24721 * expression.cs: Extract the underlying type.
24723 * ecore.cs (StoreFromPtr): Use TypeManager.IsEnumType instad of IsEnum
24725 * decl.cs (FindType): Sorry about this, fixed the type lookup bug.
24727 2002-09-19 Miguel de Icaza <miguel@ximian.com>
24729 * class.cs (TypeContainer.DefineType): We can not use the nice
24730 PackingSize with the size set to 1 DefineType method, because it
24731 will not allow us to define the interfaces that the struct
24734 This completes the fixing of bug 27287
24736 * ecore.cs (Expresion.ImplicitReferenceConversion): `class-type S'
24737 means also structs. This fixes part of the problem.
24738 (Expresion.ImplicitReferenceConversionExists): ditto.
24740 * decl.cs (DeclSparce.ResolveType): Only report the type-not-found
24741 error if there were no errors reported during the type lookup
24742 process, to avoid duplicates or redundant errors. Without this
24743 you would get an ambiguous errors plus a type not found. We have
24744 beaten the user enough with the first error.
24746 (DeclSparce.FindType): Emit a warning if we have an ambiguous
24749 * ecore.cs (SimpleName.DoResolveType): If an error is emitted
24750 during the resolution process, stop the lookup, this avoids
24751 repeated error reports (same error twice).
24753 * rootcontext.cs: Emit a warning if we have an ambiguous reference.
24755 * typemanager.cs (LookupType): Redo the type lookup code to match
24756 the needs of System.Reflection.
24758 The issue is that System.Reflection requires references to nested
24759 types to begin with a "+" sign instead of a dot. So toplevel
24760 types look like: "NameSpace.TopLevelClass", and nested ones look
24761 like "Namespace.TopLevelClass+Nested", with arbitrary nesting
24764 2002-09-19 Martin Baulig <martin@gnome.org>
24766 * codegen.cs (EmitContext.EmitTopBlock): If control flow analysis
24767 says that a method always returns or always throws an exception,
24768 don't report the CS0161.
24770 * statement.cs (FlowBranching.UsageVector.MergeChildren): Always
24771 set `Returns = new_returns'.
24773 2002-09-19 Martin Baulig <martin@gnome.org>
24775 * expression.cs (MemberAccess.ResolveMemberAccess): When resolving
24776 to an enum constant, check for a CS0176.
24778 2002-09-18 Miguel de Icaza <miguel@ximian.com>
24780 * class.cs (TypeContainer.CheckPairedOperators): Now we check
24781 for operators that must be in pairs and report errors.
24783 * ecore.cs (SimpleName.DoResolveType): During the initial type
24784 resolution process, when we define types recursively, we must
24785 check first for types in our current scope before we perform
24786 lookups in the enclosing scopes.
24788 * expression.cs (MakeByteBlob): Handle Decimal blobs.
24790 (Invocation.VerifyArgumentsCompat): Call
24791 TypeManager.TypeToCoreType on the parameter_type.GetElementType.
24792 I thought we were supposed to always call this, but there are a
24793 few places in the code where we dont do it.
24795 2002-09-17 Miguel de Icaza <miguel@ximian.com>
24797 * driver.cs: Add support in -linkres and -resource to specify the
24798 name of the identifier.
24800 2002-09-16 Miguel de Icaza <miguel@ximian.com>
24802 * ecore.cs (StandardConversionExists): Sync with the conversion
24803 code: allow anything-* to void* conversions.
24805 (FindMostSpecificSource): Use an Expression argument
24806 instead of a Type, because we might be handed over a Literal which
24807 gets a few more implicit conversions that plain types do not. So
24808 this information was being lost.
24810 Also, we drop the temporary type-holder expression when not
24813 2002-09-17 Martin Baulig <martin@gnome.org>
24815 * class.cs (PropertyBase.CheckBase): Don't check the base class if
24816 this is an explicit interface implementation.
24818 2002-09-17 Martin Baulig <martin@gnome.org>
24820 * class.cs (PropertyBase.CheckBase): Make this work for indexers with
24821 different `IndexerName' attributes.
24823 * expression.cs (BaseIndexerAccess): Rewrote this class to use IndexerAccess.
24824 (IndexerAccess): Added special protected ctor for BaseIndexerAccess and
24825 virtual CommonResolve().
24827 2002-09-16 Miguel de Icaza <miguel@ximian.com>
24829 * enum.cs (LookupEnumValue): Use the EnumConstant declared type,
24830 and convert that to the UnderlyingType.
24832 * statement.cs (Foreach.Resolve): Indexers are just like variables
24833 or PropertyAccesses.
24835 * cs-tokenizer.cs (consume_string): Track line numbers and columns
24836 inside quoted strings, we were not doing this before.
24838 2002-09-16 Martin Baulig <martin@gnome.org>
24840 * ecore.cs (MethodGroupExpr.DoResolve): If we have an instance expression,
24841 resolve it. This is needed for the definite assignment check of the
24842 instance expression, fixes bug #29846.
24843 (PropertyExpr.DoResolve, EventExpr.DoResolve): Likewise.
24845 2002-09-16 Nick Drochak <ndrochak@gol.com>
24847 * parameter.cs: Fix compile error. Cannot reference static member
24848 from an instance object. Is this an mcs bug?
24850 2002-09-14 Martin Baulig <martin@gnome.org>
24852 * decl.cs (MemberCache.SetupCacheForInterface): Don't add an interface
24853 multiple times. Fixes bug #30295, added test-166.cs.
24855 2002-09-14 Martin Baulig <martin@gnome.org>
24857 * statement.cs (Block.Emit): Don't emit unreachable code.
24858 (Switch.SimpleSwitchEmit, Switch.TableSwitchEmit): Check for missing
24859 `break' statements.
24860 (Goto.Emit, Continue.Emit): Set ec.Breaks = true.
24862 2002-09-14 Martin Baulig <martin@gnome.org>
24864 * parameter.cs (Parameter.Attributes): Make this work if Modifier.ISBYREF
24867 2002-09-14 Martin Baulig <martin@gnome.org>
24869 * typemanager.cs (TypeManager.IsNestedChildOf): This must return false
24870 if `type == parent' since in this case `type.IsSubclassOf (parent)' will
24871 be false on the ms runtime.
24873 2002-09-13 Martin Baulig <martin@gnome.org>
24875 * ecore.cs (SimpleName.SimpleNameResolve): Include the member name in
24876 the CS0038 error message.
24878 2002-09-12 Miguel de Icaza <miguel@ximian.com>
24880 * expression.cs (CheckedExpr, UnCheckedExpr): If we have a
24881 constant inside, return it.
24883 2002-09-12 Martin Baulig <martin@gnome.org>
24885 * cfold.cs (ConstantFold.DoConstantNumericPromotions): Check whether an
24886 implicit conversion can be done between enum types.
24888 * enum.cs (Enum.LookupEnumValue): If the value is an EnumConstant,
24889 check whether an implicit conversion to the current enum's UnderlyingType
24890 exists and report an error if not.
24892 * codegen.cs (CodeGen.Init): Delete the symbol file when compiling
24893 without debugging support.
24895 * delegate.cs (Delegate.CloseDelegate): Removed, use CloseType instead.
24896 Fixes bug #30235. Thanks to Ricardo Fernández Pascual.
24898 2002-09-12 Martin Baulig <martin@gnome.org>
24900 * typemanager.cs (TypeManager.IsNestedChildOf): New method.
24902 * ecore.cs (IMemberExpr.DeclaringType): New property.
24903 (SimpleName.SimpleNameResolve): Check whether we're accessing a
24904 nonstatic member of an outer type (CS0038).
24906 2002-09-11 Miguel de Icaza <miguel@ximian.com>
24908 * driver.cs: Activate the using-error detector at warning level
24909 4 (at least for MS-compatible APIs).
24911 * namespace.cs (VerifyUsing): Small buglett fix.
24913 * pending.cs (PendingImplementation): pass the container pointer.
24915 * interface.cs (GetMethods): Allow for recursive definition. Long
24916 term, I would like to move every type to support recursive
24917 definitions, not the current ordering mechanism that we have right
24920 The situation is this: Attributes are handled before interfaces,
24921 so we can apply attributes to interfaces. But some attributes
24922 implement interfaces, we will now handle the simple cases
24923 (recursive definitions will just get an error).
24925 * parameter.cs: Only invalidate types at the end if we fail to
24928 2002-09-09 Martin Baulig <martin@gnome.org>
24930 * ecore.cs (PropertyExpr.Emit): Also check for
24931 TypeManager.system_int_array_get_length so this'll also work when
24932 compiling corlib. Fixes #30003.
24934 2002-09-09 Martin Baulig <martin@gnome.org>
24936 * expression.cs (ArrayCreation.MakeByteBlob): Added support for enums
24937 and throw an exception if we can't get the type's size. Fixed #30040,
24940 2002-09-09 Martin Baulig <martin@gnome.org>
24942 * ecore.cs (PropertyExpr.DoResolve): Added check for static properies.
24944 * expression.cs (SizeOf.DoResolve): Sizeof is only allowed in unsafe
24945 context. Fixes bug #30027.
24947 * delegate.cs (NewDelegate.Emit): Use OpCodes.Ldvirtftn for
24948 virtual functions. Fixes bug #30043, added test-164.cs.
24950 2002-09-08 Ravi Pratap <ravi@ximian.com>
24952 * attribute.cs : Fix a small NullRef crash thanks to my stupidity.
24954 2002-09-08 Nick Drochak <ndrochak@gol.com>
24956 * driver.cs: Use an object to get the windows codepage since it's not a
24959 2002-09-08 Miguel de Icaza <miguel@ximian.com>
24961 * statement.cs (For.Emit): for infinite loops (test == null)
24962 return whether there is a break inside, not always "true".
24964 * namespace.cs (UsingEntry): New struct to hold the name of the
24965 using definition, the location where it is defined, and whether it
24966 has been used in a successful type lookup.
24968 * rootcontext.cs (NamespaceLookup): Use UsingEntries instead of
24973 2002-09-06 Ravi Pratap <ravi@ximian.com>
24975 * attribute.cs : Fix incorrect code which relied on catching
24976 a NullReferenceException to detect a null being passed in
24977 where an object was expected.
24979 2002-09-06 Miguel de Icaza <miguel@ximian.com>
24981 * statement.cs (Try): flag the catch variable as assigned
24983 * expression.cs (Cast): Simplified by using ResolveType instead of
24984 manually resolving.
24986 * statement.cs (Catch): Fix bug by using ResolveType.
24988 2002-09-06 Ravi Pratap <ravi@ximian.com>
24990 * expression.cs (BetterConversion): Special case for when we have
24991 a NullLiteral as the argument and we have to choose between string
24992 and object types - we choose string the way csc does.
24994 * attribute.cs (Attribute.Resolve): Catch the
24995 NullReferenceException and report error #182 since the Mono
24996 runtime no more has the bug and having this exception raised means
24997 we tried to select a constructor which takes an object and is
25000 2002-09-05 Ravi Pratap <ravi@ximian.com>
25002 * expression.cs (Invocation.OverloadResolve): Flag a nicer error
25003 message (1502, 1503) when we can't locate a method after overload
25004 resolution. This is much more informative and closes the bug
25007 * interface.cs (PopulateMethod): Return if there are no argument
25008 types. Fixes a NullReferenceException bug.
25010 * attribute.cs (Attribute.Resolve): Ensure we allow TypeOf
25011 expressions too. Previously we were checking only in one place for
25012 positional arguments leaving out named arguments.
25014 * ecore.cs (ImplicitNumericConversion): Conversion from underlying
25015 type to the enum type is not allowed. Remove code corresponding to
25018 (ConvertNumericExplicit): Allow explicit conversions from
25019 the underlying type to enum type. This precisely follows the spec
25020 and closes a bug filed by Gonzalo.
25022 2002-09-04 Gonzalo Paniagua Javier <gonzalo@ximian.com>
25025 * compiler.csproj.user: patch from Adam Chester (achester@bigpond.com).
25027 2002-09-03 Miguel de Icaza <miguel@ximian.com>
25029 * statement.cs (SwitchLabel.ResolveAndReduce): In the string case,
25030 it was important that we stored the right value after the
25031 reduction in `converted'.
25033 2002-09-04 Martin Baulig <martin@gnome.org>
25035 * location.cs (Location.SymbolDocument): Use full pathnames for the
25038 2002-08-30 Miguel de Icaza <miguel@ximian.com>
25040 * expression.cs (ComposedCast): Use DeclSparce.ResolveType instead
25041 of the expression resolve mechanism, because that will catch the
25042 SimpleName error failures.
25044 (Conditional): If we can not resolve the
25045 expression, return, do not crash.
25047 2002-08-29 Gonzalo Paniagua Javier <gonzalo@ximian.com>
25050 (location): display token name instead of its number.
25052 2002-08-28 Martin Baulig <martin@gnome.org>
25054 * expression.cs (Binary.ResolveOperator): Don't silently return
25055 but return an error if an operator cannot be applied between two
25058 2002-08-28 Martin Baulig <martin@gnome.org>
25060 * class.cs (Constructor.Define): Set the permission attributes
25061 correctly instead of making all constructors public.
25063 2002-08-28 Martin Baulig <martin@gnome.org>
25065 * ecore.cs (Expression.DoResolve): Do a TypeManager.MemberLook
25066 for private members before reporting a CS0103; if we find anything,
25069 2002-08-28 Martin Baulig <martin@gnome.org>
25071 * typemanager.cs (TypeManager.FilterWithClosure): It's not enough
25072 to check whether `closure_start_type == closure_invocation_type',
25073 we also need to check whether `m.DeclaringType == closure_invocation_type'
25074 before bypassing the permission checks. We might be accessing
25075 protected/private members from the base class.
25076 (TypeManager.RealMemberLookup): Only set private_ok if private
25077 members were requested via BindingFlags.NonPublic.
25079 * ecore.cs (MethodGroupExpr.IsExplicitImpl): New property.
25081 * expression.cs (MemberAccess.ResolveMemberAccess): Set
25082 MethodGroupExpr.IsExplicitImpl if appropriate.
25083 (Invocation.DoResolve): Don't report the CS0120 for explicit
25084 interface implementations.
25086 2002-08-27 Martin Baulig <martin@gnome.org>
25088 * expression.cs (Invocation.DoResolve): If this is a static
25089 method and we don't have an InstanceExpression, we must report
25092 2002-08-25 Martin Baulig <martin@gnome.org>
25094 * expression.cs (Binary.ResolveOperator): Don't allow `!=' and
25095 `==' between a valuetype and an object.
25097 2002-08-25 Miguel de Icaza <miguel@ximian.com>
25099 * ecore.cs (TypeExpr): Provide a ToString method.
25101 2002-08-24 Martin Baulig <martin@gnome.org>
25103 * codegen.cs (CodeGen.InitMonoSymbolWriter): The symbol file is
25104 now called proggie.dbg and it's a binary file.
25106 2002-08-23 Martin Baulig <martin@gnome.org>
25108 * decl.cs (MemberCache.AddMethods): Ignore varargs methods.
25110 2002-08-23 Martin Baulig <martin@gnome.org>
25112 * struct.cs (MyStructInfo.ctor): Make this work with empty
25113 structs; it's not allowed to use foreach() on null.
25115 2002-08-23 Martin Baulig <martin@gnome.org>
25117 * codegen.cs (CodeGen.InitMonoSymbolWriter): Tell the symbol
25118 writer the full pathname of the generated assembly.
25120 2002-08-23 Martin Baulig <martin@gnome.org>
25122 * statements.cs (FlowBranching.UsageVector.MergeChildren):
25123 A `finally' block never returns or breaks; improved handling of
25126 2002-08-23 Martin Baulig <martin@gnome.org>
25128 * statement.cs (Throw.Resolve): Allow `throw null'.
25130 2002-08-23 Martin Baulig <martin@gnome.org>
25132 * expression.cs (MemberAccess.ResolveMemberAccess): If this is an
25133 EventExpr, don't do a DeclaredOnly MemberLookup, but check whether
25134 `ee.EventInfo.DeclaringType == ec.ContainerType'. The
25135 MemberLookup would return a wrong event if this is an explicit
25136 interface implementation and the class has an event with the same
25139 2002-08-23 Martin Baulig <martin@gnome.org>
25141 * statement.cs (Block.AddChildVariableNames): New public method.
25142 (Block.AddChildVariableName): Likewise.
25143 (Block.IsVariableNameUsedInChildBlock): Likewise.
25144 (Block.AddVariable): Check whether a variable name has already
25145 been used in a child block.
25147 * cs-parser.jay (declare_local_variables): Mark all variable names
25148 from the current block as being used in a child block in the
25151 2002-08-23 Martin Baulig <martin@gnome.org>
25153 * codegen.cs (CodeGen.InitializeSymbolWriter): Abort if we can't
25154 find the symbol writer.
25156 * driver.cs: csc also allows the arguments to /define being
25157 separated by commas, not only by semicolons.
25159 2002-08-23 Martin Baulig <martin@gnome.org>
25161 * interface.cs (Interface.GetMembers): Added static check for events.
25163 2002-08-15 Martin Baulig <martin@gnome.org>
25165 * class.cs (MethodData.EmitDestructor): In the Expression.MemberLookup
25166 call, use ec.ContainerType.BaseType as queried_type and invocation_type.
25168 * ecore.cs (Expression.MemberLookup): Added documentation and explained
25169 why the MethodData.EmitDestructor() change was necessary.
25171 2002-08-20 Martin Baulig <martin@gnome.org>
25173 * class.cs (TypeContainer.FindMembers): Added static check for events.
25175 * decl.cs (MemberCache.AddMembers): Handle events like normal members.
25177 * typemanager.cs (TypeHandle.GetMembers): When queried for events only,
25178 use Type.GetEvents(), not Type.FindMembers().
25180 2002-08-20 Martin Baulig <martin@gnome.org>
25182 * decl.cs (MemberCache): Added a special method cache which will
25183 be used for method-only searched. This ensures that a method
25184 search will return a MethodInfo with the correct ReflectedType for
25187 2002-08-20 Martin Baulig <martin@gnome.org>
25189 * decl.cs (DeclSpace.FindMembers): Made this public.
25191 2002-08-20 Gonzalo Paniagua Javier <gonzalo@ximian.com>
25193 * delegate.cs: fixed build on windows.
25194 [FIXME: Filed as bug #29150: MCS must report these errors.]
25196 2002-08-19 Ravi Pratap <ravi@ximian.com>
25198 * ecore.cs (StandardConversionExists): Return a false
25199 if we are trying to convert the void type to anything else
25200 since that is not allowed.
25202 * delegate.cs (DelegateInvocation.DoResolve): Ensure that
25203 we flag error 70 in the event an event is trying to be accessed
25204 directly from outside the declaring type.
25206 2002-08-20 Martin Baulig <martin@gnome.org>
25208 * typemanager.cs, decl.cs: Moved MemberList, IMemberContainer and
25209 MemberCache from typemanager.cs to decl.cs.
25211 2002-08-19 Martin Baulig <martin@gnome.org>
25213 * class.cs (TypeContainer): Implement IMemberContainer.
25214 (TypeContainer.DefineMembers): Create the MemberCache.
25215 (TypeContainer.FindMembers): Do better BindingFlags checking; only
25216 return public members if BindingFlags.Public was given, check
25217 whether members are static.
25219 2002-08-16 Martin Baulig <martin@gnome.org>
25221 * decl.cs (DeclSpace.Define): Splitted this in Define and
25222 DefineMembers. DefineMembers is called first and initializes the
25225 * rootcontext.cs (RootContext.DefineMembers): New function. Calls
25226 DefineMembers() on all our DeclSpaces.
25228 * class.cs (TypeContainer.Define): Moved all code to DefineMembers(),
25229 but call DefineMembers() on all nested interfaces. We call their
25230 Define() in our new Define() function.
25232 * interface.cs (Interface): Implement IMemberContainer.
25233 (Interface.Define): Moved all code except the attribute stuf to
25235 (Interface.DefineMembers): Initialize the member cache.
25237 * typemanager.cs (IMemberFinder): Removed this interface, we don't
25238 need this anymore since we can use MemberCache.FindMembers directly.
25240 2002-08-19 Martin Baulig <martin@gnome.org>
25242 * typemanager.cs (MemberCache): When creating the cache for an
25243 interface type, add all inherited members.
25244 (TypeManager.MemberLookup_FindMembers): Changed `ref bool searching'
25245 to `out bool used_cache' and documented it.
25246 (TypeManager.MemberLookup): If we already used the cache in the first
25247 iteration, we don't need to do the interfaces check.
25249 2002-08-19 Martin Baulig <martin@gnome.org>
25251 * decl.cs (DeclSpace.FindMembers): New abstract method. Moved this
25252 here from IMemberFinder and don't implement this interface anymore.
25253 (DeclSpace.MemberCache): Moved here from IMemberFinder.
25255 * typemanager.cs (IMemberFinder): This interface is now only used by
25256 classes which actually support the member cache.
25257 (TypeManager.builder_to_member_finder): Renamed to builder_to_declspace
25258 since we only put DeclSpaces into this Hashtable.
25259 (MemberLookup_FindMembers): Use `builder_to_declspace' if the type is
25260 a dynamic type and TypeHandle.GetTypeHandle() otherwise.
25262 2002-08-16 Martin Baulig <martin@gnome.org>
25264 * typemanager.cs (ICachingMemberFinder): Removed.
25265 (IMemberFinder.MemberCache): New property.
25266 (TypeManager.FindMembers): Merged this with RealFindMembers().
25267 This function will never be called from TypeManager.MemberLookup()
25268 so we can't use the cache here, just the IMemberFinder.
25269 (TypeManager.MemberLookup_FindMembers): Check whether the
25270 IMemberFinder has a MemberCache and call the cache's FindMembers
25272 (MemberCache): Rewrote larger parts of this yet another time and
25273 cleaned it up a bit.
25275 2002-08-15 Miguel de Icaza <miguel@ximian.com>
25277 * driver.cs (LoadArgs): Support quoting.
25279 (Usage): Show the CSC-like command line arguments.
25281 Improved a few error messages.
25283 2002-08-15 Martin Baulig <martin@gnome.org>
25285 * typemanager.cs (IMemberContainer.Type): New property.
25286 (IMemberContainer.IsInterface): New property.
25288 The following changes are conditional to BROKEN_RUNTIME, which is
25289 defined at the top of the file.
25291 * typemanager.cs (MemberCache.MemberCache): Don't add the base
25292 class'es members, but add all members from TypeHandle.ObjectType
25293 if we're an interface.
25294 (MemberCache.AddMembers): Set the Declared flag if member.DeclaringType
25295 is the current type.
25296 (MemberCache.CacheEntry.Container): Removed this field.
25297 (TypeHandle.GetMembers): Include inherited members.
25299 2002-08-14 Gonzalo Paniagua Javier <gonzalo@ximian.com>
25301 * typemanager.cs: fixed compilation and added a comment on a field that
25304 2002-08-15 Martin Baulig <martin@gnome.org>
25306 * class.cs (ConstructorInitializer.Resolve): In the
25307 Expression.MemberLookup call, use the queried_type as
25310 * typemanager.cs (IMemberContainer.GetMembers): Removed the `bool
25311 declared' attribute, it's always true.
25312 (IMemberContainer.Parent, IMemberContainer.Name): New properties.
25313 (TypeManager.MemberLookup_FindMembers): [FIXME FIXME FIXME] Added
25314 temporary wrapper for FindMembers which tells MemberLookup whether
25315 members from the base classes are included in the return value.
25316 This will go away soon.
25317 (TypeManager.MemberLookup): Use this temporary hack here; once the
25318 new MemberCache is completed, we don't need to do the DeclaredOnly
25319 looping here anymore since the MemberCache will take care of this.
25320 (TypeManager.IsSubclassOrNestedChildOf): Allow `type == parent'.
25321 (MemberCache): When creating the MemberCache for a class, get
25322 members from the current class and all its base classes.
25323 (MemberCache.CacheEntry.Container): New field. This is a
25324 temporary hack until the Mono runtime is fixed to distinguish
25325 between ReflectedType and DeclaringType. It allows us to use MCS
25326 with both the MS runtime and the unfixed Mono runtime without
25327 problems and without accecting performance.
25328 (MemberCache.SearchMembers): The DeclaredOnly looping from
25329 TypeManager.MemberLookup is now done here.
25331 2002-08-14 Martin Baulig <martin@gnome.org>
25333 * statement.cs (MyStructInfo.MyStructInfo): Don't call
25334 Type.GetFields on dynamic types but get the fields from the
25335 corresponding TypeContainer.
25336 (MyStructInfo.GetStructInfo): Added check for enum types.
25338 * typemanager.cs (MemberList.IsSynchronized): Implemented.
25339 (MemberList.SyncRoot): Implemented.
25340 (TypeManager.FilterWithClosure): No need to check permissions if
25341 closure_start_type == closure_invocation_type, don't crash if
25342 closure_invocation_type is null.
25344 2002-08-13 Martin Baulig <martin@gnome.org>
25346 Rewrote TypeContainer.FindMembers to use a member cache. This
25347 gives us a speed increase of about 35% for the self-hosting MCS
25348 build and of about 15-20% for the class libs (both on GNU/Linux).
25350 * report.cs (Timer): New class to get enhanced profiling. This
25351 whole class is "TIMER" conditional since it remarkably slows down
25354 * class.cs (MemberList): New class. This is an IList wrapper
25355 which we're now using instead of passing MemberInfo[]'s around to
25356 avoid copying this array unnecessarily.
25357 (IMemberFinder.FindMember): Return a MemberList, not a MemberInfo [].
25358 (ICachingMemberFinder, IMemberContainer): New interface.
25359 (TypeManager.FilterWithClosure): If `criteria' is null, the name
25360 has already been checked, otherwise use it for the name comparision.
25361 (TypeManager.FindMembers): Renamed to RealMemberFinder and
25362 provided wrapper which tries to use ICachingMemberFinder.FindMembers
25363 if possible. Returns a MemberList, not a MemberInfo [].
25364 (TypeHandle): New class, implements IMemberContainer. We create
25365 one instance of this class per type, it contains a MemberCache
25366 which is used to do the member lookups.
25367 (MemberCache): New class. Each instance of this class contains
25368 all members of a type and a name-based hash table.
25369 (MemberCache.FindMembers): This is our new member lookup
25370 function. First, it looks up all members of the requested name in
25371 the hash table. Then, it walks this list and sorts out all
25372 applicable members and returns them.
25374 2002-08-13 Martin Baulig <martin@gnome.org>
25376 In addition to a nice code cleanup, this gives us a performance
25377 increase of about 1.4% on GNU/Linux - not much, but it's already
25378 half a second for the self-hosting MCS compilation.
25380 * typemanager.cs (IMemberFinder): New interface. It is used by
25381 TypeManager.FindMembers to call FindMembers on a TypeContainer,
25382 Enum, Delegate or Interface.
25383 (TypeManager.finder_to_member_finder): New PtrHashtable.
25384 (TypeManager.finder_to_container): Removed.
25385 (TypeManager.finder_to_delegate): Removed.
25386 (TypeManager.finder_to_interface): Removed.
25387 (TypeManager.finder_to_enum): Removed.
25389 * interface.cs (Interface): Implement IMemberFinder.
25391 * delegate.cs (Delegate): Implement IMemberFinder.
25393 * enum.cs (Enum): Implement IMemberFinder.
25395 * class.cs (TypeContainer): Implement IMemberFinder.
25397 2002-08-12 Martin Baulig <martin@gnome.org>
25399 * ecore.cs (TypeExpr.DoResolveType): Mark this as virtual.
25401 2002-08-12 Martin Baulig <martin@gnome.org>
25403 * ecore.cs (ITypeExpression): New interface for expressions which
25405 (TypeExpression): Renamed to TypeLookupExpression.
25406 (Expression.DoResolve): If we're doing a types-only lookup, the
25407 expression must implement the ITypeExpression interface and we
25408 call DoResolveType() on it.
25409 (SimpleName): Implement the new ITypeExpression interface.
25410 (SimpleName.SimpleNameResolve): Removed the ec.OnlyLookupTypes
25411 hack, the situation that we're only looking up types can't happen
25412 anymore when this method is called. Moved the type lookup code to
25413 DoResolveType() and call it.
25414 (SimpleName.DoResolveType): This ITypeExpression interface method
25415 is now doing the types-only lookup.
25416 (TypeExpr, TypeLookupExpression): Implement ITypeExpression.
25417 (ResolveFlags): Added MaskExprClass.
25419 * expression.cs (MemberAccess): Implement the ITypeExpression
25421 (MemberAccess.DoResolve): Added support for a types-only lookup
25422 when we're called via ITypeExpression.DoResolveType().
25423 (ComposedCast): Implement the ITypeExpression interface.
25425 * codegen.cs (EmitContext.OnlyLookupTypes): Removed. Call
25426 Expression.Resolve() with ResolveFlags.Type instead.
25428 2002-08-12 Martin Baulig <martin@gnome.org>
25430 * interface.cs (Interface.Define): Apply attributes.
25432 * attribute.cs (Attribute.ApplyAttributes): Added support for
25433 interface attributes.
25435 2002-08-11 Martin Baulig <martin@gnome.org>
25437 * statement.cs (Block.Emit): Only check the "this" variable if we
25438 do not always throw an exception.
25440 * ecore.cs (PropertyExpr.DoResolveLValue): Implemented, check
25441 whether the property has a set accessor.
25443 2002-08-11 Martin Baulig <martin@gnome.org>
25445 Added control flow analysis support for structs.
25447 * ecore.cs (ResolveFlags): Added `DisableFlowAnalysis' to resolve
25448 with control flow analysis turned off.
25449 (IVariable): New interface.
25450 (SimpleName.SimpleNameResolve): If MemberAccess.ResolveMemberAccess
25451 returns an IMemberExpr, call DoResolve/DoResolveLValue on it.
25452 (FieldExpr.DoResolve): Resolve the instance expression with flow
25453 analysis turned off and do the definite assignment check after the
25454 resolving when we know what the expression will resolve to.
25456 * expression.cs (LocalVariableReference, ParameterReference):
25457 Implement the new IVariable interface, only call the flow analysis
25458 code if ec.DoFlowAnalysis is true.
25459 (This): Added constructor which takes a Block argument. Implement
25460 the new IVariable interface.
25461 (MemberAccess.DoResolve, MemberAccess.DoResolveLValue): Call
25462 DoResolve/DoResolveLValue on the result of ResolveMemberLookup().
25463 This does the definite assignment checks for struct members.
25465 * class.cs (Constructor.Emit): If this is a non-static `struct'
25466 constructor which doesn't have any initializer, call
25467 Block.AddThisVariable() to tell the flow analysis code that all
25468 struct elements must be initialized before control returns from
25471 * statement.cs (MyStructInfo): New public class.
25472 (UsageVector.this [VariableInfo vi]): Added `int field_idx'
25473 argument to this indexer. If non-zero, check an individual struct
25474 member, not the whole struct.
25475 (FlowBranching.CheckOutParameters): Check struct members.
25476 (FlowBranching.IsVariableAssigned, SetVariableAssigned): Added
25477 overloaded versions of these methods which take an additional
25478 `int field_idx' argument to check struct members.
25479 (FlowBranching.IsParameterAssigned, SetParameterAssigned): Added
25480 overloaded versions of these methods which take an additional
25481 `string field_name' argument to check struct member.s
25482 (VariableInfo): Implement the IVariable interface.
25483 (VariableInfo.StructInfo): New public property. Returns the
25484 MyStructInfo instance of the variable if it's a struct or null.
25485 (Block.AddThisVariable): New public method. This is called from
25486 Constructor.Emit() for non-static `struct' constructor which do
25487 not have any initializer. It creates a special variable for the
25488 "this" instance variable which will be checked by the flow
25489 analysis code to ensure that all of the struct's fields are
25490 initialized before control returns from the constructor.
25491 (UsageVector): Added support for struct members. If a
25492 variable/parameter is a struct with N members, we reserve a slot
25493 in the usage vector for each member. A struct is considered fully
25494 initialized if either the struct itself (slot 0) or all its
25495 members are initialized.
25497 2002-08-08 Martin Baulig <martin@gnome.org>
25499 * driver.cs (Driver.MainDriver): Only report an error CS5001
25500 if there were no compilation errors.
25502 * codegen.cs (EmitContext.EmitContext): Use the DeclSpace's
25503 `UnsafeContext' property to determine whether the parent is in
25504 unsafe context rather than checking the parent's ModFlags:
25505 classes nested in an unsafe class are unsafe as well.
25507 2002-08-08 Martin Baulig <martin@gnome.org>
25509 * statement.cs (UsageVector.MergeChildren): Distinguish between
25510 `Breaks' and `Returns' everywhere, don't set `Breaks' anymore if
25511 we return. Added test17() and test18() to test-154.cs.
25513 2002-08-08 Martin Baulig <martin@gnome.org>
25515 * typemanager.cs (TypeManager.FilterWithClosure): If we have
25516 Family access, make sure the invoking type isn't a subclass of the
25517 queried type (that'd be a CS1540).
25519 * ecore.cs (Expression.MemberLookup): Added overloaded version of
25520 this method which takes an additional `Type invocation_type'.
25522 * expression.cs (BaseAccess.DoResolve): Use the base type as
25523 invocation and query type.
25524 (MemberAccess.DoResolve): If the lookup failed and we're about to
25525 report a CS0122, try a lookup with the ec.ContainerType - if this
25526 succeeds, we must report a CS1540.
25528 2002-08-08 Martin Baulig <martin@gnome.org>
25530 * ecore.cs (IMemberExpr): Added `bool IsInstance' property.
25531 (MethodGroupExpr): Implement the IMemberExpr interface.
25533 * expression (MemberAccess.ResolveMemberAccess): No need to have
25534 any special code for MethodGroupExprs anymore, they're now
25537 2002-08-08 Martin Baulig <martin@gnome.org>
25539 * typemanager.cs (TypeManager.FilterWithClosure): Check Assembly,
25540 Family, FamANDAssem and FamORAssem permissions.
25541 (TypeManager.IsSubclassOrNestedChildOf): New public method.
25543 2002-08-08 Martin Baulig <martin@gnome.org>
25545 * statement.cs (FlowBranchingType): Added LOOP_BLOCK.
25546 (UsageVector.MergeChildren): `break' breaks unless we're in a switch
25549 Thu Aug 8 10:28:07 CEST 2002 Paolo Molaro <lupus@ximian.com>
25551 * driver.cs: implemented /resource option to embed managed resources.
25553 2002-08-07 Martin Baulig <martin@gnome.org>
25555 * class.cs (FieldBase.Initializer): Renamed to `init' and made private.
25556 (FieldBase.HasFieldInitializer): New public property.
25557 (FieldBase.GetInitializerExpression): New public method. Resolves and
25558 returns the field initializer and makes sure it is only resolved once.
25559 (TypeContainer.EmitFieldInitializers): Call
25560 FieldBase.GetInitializerExpression to get the initializer, this ensures
25561 that it isn't resolved multiple times.
25563 * codegen.cs (EmitContext): Added `bool IsFieldInitialier'. This tells
25564 the resolving process (SimpleName/MemberLookup) that we're currently
25565 emitting a field initializer (which must not access any instance members,
25566 this is an error CS0236).
25568 * ecore.cs (SimpleName.Error_ObjectRefRequired): Added EmitContext
25569 argument, if the `IsFieldInitializer' flag is set, we must report and
25570 error CS0236 and not an error CS0120.
25572 2002-08-07 Martin Baulig <martin@gnome.org>
25574 * ecore.cs (IMemberExpr): New public interface.
25575 (FieldExpr, PropertyExpr, EventExpr): Implement IMemberExpr.
25576 (SimpleName.SimpleNameResolve): Call MemberAccess.ResolveMemberAccess
25577 if the expression is an IMemberExpr.
25579 * expression.cs (MemberAccess.ResolveMemberAccess): Allow `left'
25580 to be null, implicitly default to `this' if we're non-static in
25581 this case. Simplified the code a lot by using the new IMemberExpr
25582 interface. Also fixed bug #28176 here.
25584 2002-08-06 Martin Baulig <martin@gnome.org>
25586 * cs-parser.jay (SimpleLookup): Removed. We need to create
25587 ParameterReferences during semantic analysis so that we can do a
25588 type-only search when resolving Cast, TypeOf and SizeOf.
25589 (block): Pass the `current_local_parameters' to the Block's
25592 * class.cs (ConstructorInitializer): Added `Parameters parameters'
25593 argument to the constructor.
25594 (ConstructorInitializer.Resolve): Create a temporary implicit
25595 block with the parameters.
25597 * ecore.cs (SimpleName.SimpleNameResolve): Resolve parameter
25598 references here if we aren't doing a type-only search.
25600 * statement.cs (Block): Added constructor which takes a
25601 `Parameters parameters' argument.
25602 (Block.Parameters): New public property.
25604 * support.cs (InternalParameters.Parameters): Renamed `parameters'
25605 to `Parameters' and made it public readonly.
25607 2002-08-06 Martin Baulig <martin@gnome.org>
25609 * ecore.cs (Expression.Warning): Made this public as well.
25611 * report.cs (Report.Debug): Print the contents of collections.
25613 2002-08-06 Martin Baulig <martin@gnome.org>
25615 * ecore.cs (Expression.ResolveFlags): New [Flags] enum. This is
25616 used to tell Resolve() which kinds of expressions it may return.
25617 (Expression.Resolve): Added overloaded version of this method which
25618 takes a `ResolveFlags flags' argument. This can be used to tell
25619 Resolve() which kinds of expressions it may return. Reports a
25621 (Expression.ResolveWithSimpleName): Removed, use Resolve() with
25622 ResolveFlags.SimpleName.
25623 (Expression.Error118): Added overloaded version of this method which
25624 takes a `ResolveFlags flags' argument. It uses the flags to determine
25625 which kinds of expressions are allowed.
25627 * expression.cs (Argument.ResolveMethodGroup): New public method.
25628 Resolves an argument, but allows a MethodGroup to be returned.
25629 This is used when invoking a delegate.
25631 * TODO: Updated a bit.
25633 2002-08-06 Gonzalo Paniagua Javier <gonzalo@ximian.com>
25635 Fixed compilation with csc.
25637 * ecore.cs: Expression.Error made public. Is this correct? Should
25638 Warning be made public too?
25640 * expression.cs: use ea.Location instead of ea.loc.
25641 [FIXME: Filed as bug #28607: MCS must report these errors.]
25643 2002-08-06 Martin Baulig <martin@gnome.org>
25645 * ecore.cs (Expression.loc): Moved the location here instead of
25646 duplicating it in all derived classes.
25647 (Expression.Location): New public property.
25648 (Expression.Error, Expression.Warning): Made them non-static and
25649 removed the location argument.
25650 (Expression.Warning): Added overloaded version which takes an
25651 `int level' argument.
25652 (Expression.Error118): Make this non-static and removed the
25653 expression and location arguments.
25654 (TypeExpr): Added location argument to the constructor.
25656 * expression.cs (StaticCallExpr): Added location argument to
25658 (Indirection, PointerArithmetic): Likewise.
25659 (CheckedExpr, UnCheckedExpr): Likewise.
25660 (ArrayAccess, IndexerAccess, UserCast, ArrayPtr): Likewise.
25661 (StringPtr): Likewise.
25664 2002-08-05 Martin Baulig <martin@gnome.org>
25666 * expression.cs (BaseAccess.DoResolve): Actually report errors.
25668 * assign.cs (Assign.DoResolve): Check whether the source
25669 expression is a value or variable.
25671 * statement.cs (Try.Resolve): Set ec.InTry/InCatch/InFinally
25672 while resolving the corresponding blocks.
25674 * interface.cs (Interface.GetInterfaceTypeByName): Actually report
25675 an error, don't silently return null.
25677 * statement.cs (Block.AddVariable): Do the error reporting here
25678 and distinguish between CS0128 and CS0136.
25679 (Block.DoResolve): Report all unused labels (warning CS0164).
25680 (LabeledStatement): Pass the location to the constructor.
25681 (LabeledStatement.HasBeenReferenced): New property.
25682 (LabeledStatement.Resolve): Set it to true here.
25684 * statement.cs (Return.Emit): Return success even after reporting
25685 a type mismatch error (CS0126 or CS0127), this is what csc does and
25686 it avoids confusing the users with any consecutive errors.
25688 2002-08-05 Martin Baulig <martin@gnome.org>
25690 * enum.cs (Enum.LookupEnumValue): Catch circular definitions.
25692 * const.cs (Const.LookupConstantValue): Catch circular definitions.
25694 * expression.cs (MemberAccess.DoResolve): Silently return if an
25695 error has already been reported.
25697 * ecore.cs (Expression.MemberLookupFinal): Silently return if an
25698 error has already been reported.
25700 2002-08-05 Martin Baulig <martin@gnome.org>
25702 * statement.cs (UsageVector): Only initialize the `parameters'
25703 vector if we actually have any "out" parameters.
25705 2002-08-05 Martin Baulig <martin@gnome.org>
25707 * expression.cs (Binary.ResolveOperator): When combining delegates,
25708 they must have the same type.
25710 2002-08-05 Martin Baulig <martin@gnome.org>
25712 * typemanager.cs (TypeManager.GetArgumentTypes): Don't call
25713 PropertyInfo.GetIndexParameters() on dynamic types, this doesn't
25714 work with the ms runtime and we also don't need it: if we're a
25715 PropertyBuilder and not in the `indexer_arguments' hash, then we
25716 are a property and not an indexer.
25718 * class.cs (TypeContainer.AsAccessible): Use Type.IsArray,
25719 Type.IsPointer and Type.IsByRef instead of Type.HasElementType
25720 since the latter one doesn't work with the ms runtime.
25722 2002-08-03 Martin Baulig <martin@gnome.org>
25724 Fixed bugs #27998 and #22735.
25726 * class.cs (Method.IsOperator): New public field.
25727 (Method.CheckBase): Report CS0111 if there's already a method
25728 with the same parameters in the current class. Report CS0508 when
25729 attempting to change the return type of an inherited method.
25730 (MethodData.Emit): Report CS0179 if a method doesn't have a body
25731 and it's not marked abstract or extern.
25732 (PropertyBase): New abstract base class for Property and Indexer.
25733 (PropertyBase.CheckBase): Moved here from Property and made it work
25735 (PropertyBase.Emit): Moved here from Property.Emit, Indexer.Emit is
25736 the same so we can reuse it there.
25737 (Property, Indexer): Derive from PropertyBase.
25738 (MethodSignature.inheritable_property_signature_filter): New delegate
25739 to find properties and indexers.
25741 * decl.cs (MemberCore.CheckMethodAgainstBase): Added `string name'
25742 argument and improved error reporting.
25744 * parameter.cs (Parameters.GetEmptyReadOnlyParameters): Renamed to
25745 EmptyReadOnlyParameters and made it a property.
25747 * typemanager.cs (TypeManager.GetArgumentTypes): Added overloaded
25748 version of this method which takes a `PropertyInfo indexer'.
25749 (TypeManager.RegisterIndexer): New method.
25751 * class.cs: Added myself as author of this file :-)
25753 2002-08-03 Gonzalo Paniagua Javier <gonzalo@ximian.com>
25755 * class.cs: fixed compilation on windoze.
25757 2002-08-03 Martin Baulig <martin@gnome.org>
25759 * interface.cs (Interface.GetInterfaceBases): Check whether all
25760 base interfaces are at least as accessible than the current one.
25762 * class.cs (TypeContainer.GetClassBases): Check whether base types
25763 are at least as accessible than the current type.
25764 (TypeContainer.AsAccessible): Implemented and made non-static.
25765 (MemberBase.CheckParameters): Report errors if the accessibility
25768 * delegate.cs (Delegate.Delegate): The default visibility is
25769 internal for top-level types and private for nested types.
25770 (Delegate.Define): Report errors if the accessibility checks fail.
25772 * enum.cs (Enum.Enum): The default visibility is internal for
25773 top-level types and private for nested types.
25774 (Enum.DefineType): Compute the correct visibility.
25776 * modifiers.cs (Modifiers.TypeAttr): Added a version of this
25777 function which takes a `bool is_toplevel' instead of a TypeContainer.
25779 * typemanager.cs (TypeManager.IsBuiltinType): `void' is also a
25782 2002-08-02 Martin Baulig <martin@gnome.org>
25784 * expression.cs (LocalVariableReferenc): Added constructor which
25785 takes additional `VariableInfo vi' and `bool is_readonly' arguments.
25786 (LocalVariableReference.IsReadOnly): New property.
25787 (LocalVariableReference.DoResolveLValue): Report a CS1604 if the
25788 variable is readonly, use our own readonly flag to do this; you can
25789 use the new constructor to get a writable reference to a read-only
25792 * cs-parser.jay (foreach_statement, using_statement): Get a writable
25793 reference to the local variable.
25795 2002-08-01 Miguel de Icaza <miguel@ximian.com>
25797 * rootcontext.cs (ResolveCore): Also include System.Exception
25799 * statement.cs (Block.Emit): Do not emit the dead-code warnings if
25800 we reach an EmptyStatement.
25802 (Catch.DoResolve, Throw.DoResolve): Throwing the System.Exception
25805 * expression.cs (Binary.ResolveOperator): Check error result in
25808 use brtrue/brfalse directly and avoid compares to null.
25810 2002-08-02 Martin Baulig <martin@gnome.org>
25812 * class.cs (TypeContainer.Define): Define all nested interfaces here.
25813 Fixes bug #28407, added test-155.cs.
25815 2002-08-01 Martin Baulig <martin@gnome.org>
25817 * class.cs (Event.EmitDefaultMethod): Make this work with static
25818 events. Fixes #28311, added verify-3.cs.
25820 2002-08-01 Martin Baulig <martin@gnome.org>
25822 * statement.cs (ForeachHelperMethods): Added `enumerator_type' and
25823 `is_disposable' fields.
25824 (Foreach.GetEnumeratorFilter): Set `hm.enumerator_type' and
25825 `hm.is_disposable' if we're using the collection pattern.
25826 (Foreach.EmitCollectionForeach): Use the correct type for the
25827 enumerator's local variable, only emit the try/finally block if
25828 necessary (fixes #27713).
25830 2002-08-01 Martin Baulig <martin@gnome.org>
25832 * ecore.cs (Expression.report118): Renamed to Error118 and made
25835 * statement.cs (Throw.Resolve): Check whether the expression is of
25836 the correct type (CS0118) and whether the type derives from
25837 System.Exception (CS0155).
25838 (Catch.Resolve): New method. Do the type lookup here and check
25839 whether it derives from System.Exception (CS0155).
25840 (Catch.CatchType, Catch.IsGeneral): New public properties.
25842 * typemanager.cs (TypeManager.exception_type): Added.
25844 2002-07-31 Miguel de Icaza <miguel@ximian.com>
25846 * driver.cs: Updated About function.
25848 2002-07-31 Martin Baulig <martin@gnome.org>
25850 Implemented Control Flow Analysis.
25852 * codegen.cs (EmitContext.DoFlowAnalysis): New public variable.
25853 (EmitContext.CurrentBranching): Added.
25854 (EmitContext.StartFlowBranching): Added.
25855 (EmitContext.EndFlowBranching): Added.
25856 (EmitContext.KillFlowBranching): Added.
25857 (EmitContext.IsVariableAssigned): Added.
25858 (EmitContext.SetVariableAssigned): Added.
25859 (EmitContext.IsParameterAssigned): Added.
25860 (EmitContext.SetParameterAssigned): Added.
25861 (EmitContext.EmitTopBlock): Added `InternalParameters ip' argument.
25862 Added control flow analysis stuff here.
25864 * expression.cs (Unary.DoResolve): If the operator is Oper.AddressOf,
25865 resolve the expression as lvalue.
25866 (LocalVariableReference.DoResolve): Check whether the variable has
25867 already been assigned.
25868 (ParameterReference.DoResolveLValue): Override lvalue resolve to mark
25869 the parameter as assigned here.
25870 (ParameterReference.DoResolve): Check whether the parameter has already
25872 (Argument.Resolve): If it's a `ref' or `out' argument, resolve the
25873 expression as lvalue.
25875 * statement.cs (FlowBranching): New class for the flow analysis code.
25876 (Goto): Resolve the label in Resolve, not in Emit; added flow analysis.
25877 (LabeledStatement.IsDefined): New public property.
25878 (LabeledStatement.AddUsageVector): New public method to tell flow
25879 analyis that the label may be reached via a forward jump.
25880 (GotoCase): Lookup and resolve the label in Resolve, not in Emit; added
25882 (VariableInfo.Number): New public field. This is used by flow analysis
25883 to number all locals of a block.
25884 (Block.CountVariables): New public property. This is the number of
25885 local variables in this block (including the locals from all parent
25887 (Block.EmitMeta): Number all the variables.
25889 * statement.cs: Added flow analysis support to all classes.
25891 2002-07-31 Martin Baulig <martin@gnome.org>
25893 * driver.cs: Added "--mcs-debug" argument if MCS_DEBUG is defined.
25894 To get debugging messages, compile mcs with /define:MCS_DEBUG and
25895 then use this argument.
25897 * report.cs (Report.Debug): Renamed to conditional to "MCS_DEBUG".
25899 * makefile.gnu (MCS_FLAGS): Include $(MCS_DEFINES), the user may
25900 use this to specify /define options.
25902 2002-07-29 Martin Baulig <martin@gnome.org>
25904 * statement.cs (Fixed): Moved all code that does variable lookups
25905 and resolvings from Emit to Resolve.
25907 * statement.cs (For): Moved all code that does variable lookups
25908 and resolvings from Emit to Resolve.
25910 * statement.cs (Using): Moved all code that does variable lookups
25911 and resolvings from Emit to Resolve.
25913 2002-07-29 Martin Baulig <martin@gnome.org>
25915 * attribute.cs (Attribute.Resolve): Explicitly catch a
25916 System.NullReferenceException when creating the
25917 CustromAttributeBuilder and report a different warning message.
25919 2002-07-29 Martin Baulig <martin@gnome.org>
25921 * support.cs (ParameterData.ParameterName): Added method to
25922 get the name of a parameter.
25924 * typemanager.cs (TypeManager.IsValueType): New public method.
25926 2002-07-29 Martin Baulig <martin@gnome.org>
25928 * parameter.cs (Parameter.Modifier): Added `ISBYREF = 8'. This
25929 is a flag which specifies that it's either ref or out.
25930 (Parameter.GetParameterInfo (DeclSpace, int, out bool)): Changed
25931 the out parameter to `out Parameter.Modifier mod', also set the
25932 Parameter.Modifier.ISBYREF flag on it if it's either ref or out.
25934 * support.cs (InternalParameters.ParameterModifier): Distinguish
25935 between Parameter.Modifier.OUT and Parameter.Modifier.REF, set the
25936 Parameter.Modifier.ISBYREF flag if it's either ref or out.
25938 * expression.cs (Argument.GetParameterModifier): Distinguish
25939 between Parameter.Modifier.OUT and Parameter.Modifier.REF, set the
25940 Parameter.Modifier.ISBYREF flag if it's either ref or out.
25942 2002-07-29 Martin Baulig <martin@gnome.org>
25944 * expression.cs (ParameterReference.ParameterReference): Added
25945 `Location loc' argument to the constructor.
25947 * cs-parser.jay: Pass location to ParameterReference.
25949 2002-07-28 Miguel de Icaza <miguel@ximian.com>
25951 * statement.cs (Try): Initialize the location.
25953 * cs-parser.jay: pass location to Try.
25955 * expression.cs (Unary.Reduce): Change the prototype to return
25956 whether a constant fold could be performed or not. The result is
25957 returned in an out parameters. In the case of Indirection and
25958 AddressOf, we want to perform the full tests.
25960 2002-07-26 Miguel de Icaza <miguel@ximian.com>
25962 * statement.cs (Statement.Emit): Flag dead code.
25964 2002-07-27 Andrew Birkett <andy@nobugs.org>
25966 * expression.cs (Unary.Reduce): Handle AddressOf and Indirection.
25968 2002-07-27 Martin Baulig <martin@gnome.org>
25970 * class.cs (MethodData.Define): Put back call to
25971 TypeManager.AddMethod(), accidentally commented this out.
25973 * report.cs (Debug): New public method to print debugging information,
25974 this is `[Conditional ("DEBUG")]'.
25976 2002-07-26 Martin Baulig <martin@gnome.org>
25978 * cs-parser.jay (CSharpParser): Added `Stack switch_stack'.
25979 (switch_statement): Push the current_block to the switch_stack and
25980 pop it again when we're done with the switch.
25981 (switch_section): The new block is a child of the current_block.
25982 Fixes bug #24007, added test-152.cs.
25984 2002-07-27 Martin Baulig <martin@gnome.org>
25986 * expression.cs (Invocation.EmitArguments): When calling a varargs
25987 function with only its fixed arguments, we need to pass an empty
25990 2002-07-27 Martin Baulig <martin@gnome.org>
25992 Mono 0.13 has been released.
25994 2002-07-25 Miguel de Icaza <miguel@ximian.com>
25996 * driver.cs: Rename --resource to --linkres, because that is what
25997 we do currently, we dont support --resource yet.
25999 * cs-tokenizer.cs: Fix test for reporting endif mismatches.
26001 2002-07-25 Martin Baulig <martin@gnome.org>
26003 * class.cs (MethodData): New public class. This is a `method builder'
26004 class for a method or one accessor of a Property/Indexer/Event.
26005 (MethodData.GetMethodFlags): Moved here from MemberBase.
26006 (MethodData.ApplyAttributes): Likewise.
26007 (MethodData.ApplyObsoleteAttribute): Likewise.
26008 (MethodData.ApplyConditionalAttribute): Likewise.
26009 (MethodData.ApplyDllImportAttribute): Likewise.
26010 (MethodData.CheckAbstractAndExternal): Likewise.
26011 (MethodData.Define): Formerly knows as MemberBase.DefineMethod().
26012 (MethodData.Emit): Formerly known as Method.Emit().
26013 (MemberBase): Moved everything which was specific to a single
26014 accessor/method to MethodData.
26015 (Method): Create a new MethodData and call Define() and Emit() on it.
26016 (Property, Indexer, Event): Create a new MethodData objects for each
26017 accessor and call Define() and Emit() on them.
26019 2002-07-25 Martin Baulig <martin@gnome.org>
26021 Made MethodCore derive from MemberBase to reuse the code from there.
26022 MemberBase now also checks for attributes.
26024 * class.cs (MethodCore): Derive from MemberBase, not MemberCore.
26025 (MemberBase.GetMethodFlags): Moved here from class Method and marked
26027 (MemberBase.DefineAccessor): Renamed to DefineMethod(), added
26028 `CallingConventions cc' and `Attributes opt_attrs' arguments.
26029 (MemberBase.ApplyAttributes): New virtual method; applies the
26030 attributes to a method or accessor.
26031 (MemberBase.ApplyObsoleteAttribute): New protected virtual method.
26032 (MemberBase.ApplyConditionalAttribute): Likewise.
26033 (MemberBase.ApplyDllImportAttribute): Likewise.
26034 (MemberBase.CheckAbstractAndExternal): Likewise.
26035 (MethodCore.ParameterTypes): This is now a property instead of a
26036 method, it's initialized from DoDefineParameters().
26037 (MethodCore.ParameterInfo): Removed the set accessor.
26038 (MethodCore.DoDefineParameters): New protected virtual method to
26039 initialize ParameterTypes and ParameterInfo.
26040 (Method.GetReturnType): We can now simply return the MemberType.
26041 (Method.GetMethodFlags): Override the MemberBase version and add
26042 the conditional flags.
26043 (Method.CheckBase): Moved some code from Define() here, call
26044 DoDefineParameters() here.
26045 (Method.Define): Use DoDefine() and DefineMethod() from MemberBase
26046 here to avoid some larger code duplication.
26047 (Property.Emit, Indexer.Emit): Call CheckAbstractAndExternal() to
26048 ensure that abstract and external accessors don't declare a body.
26050 * attribute.cs (Attribute.GetValidPieces): Make this actually work:
26051 `System.Attribute.GetCustomAttributes (attr.Type)' does a recursive
26052 lookup in the attribute's parent classes, so we need to abort as soon
26053 as we found the first match.
26054 (Attribute.Obsolete_GetObsoleteMessage): Return the empty string if
26055 the attribute has no arguments.
26057 * typemanager.cs (TypeManager.AddMethod): Now takes a MemberBase instead
26060 2002-07-24 Gonzalo Paniagua Javier <gonzalo@ximian.com>
26062 * cs-parser.jay: reverted previous patch.
26064 2002-07-24 Gonzalo Paniagua Javier <gonzalo@ximian.com>
26066 * cs-parser.jay: fixed bug #22119.
26068 2002-07-24 Gonzalo Paniagua Javier <gonzalo@ximian.com>
26070 * attribute.cs: fixed compilation. The error was:
26071 "attribute.cs(571,17): error CS0177: The out parameter 'is_error' must
26072 be assigned to before control leaves the current method."
26073 [FIXME: Filed as bug #28186: MCS must report this error.]
26075 2002-07-25 Martin Baulig <martin@gnome.org>
26077 * attribute.cs (Attribute.Conditional_GetConditionName): New static
26078 method to pull the condition name ouf of a Conditional attribute.
26079 (Attribute.Obsolete_GetObsoleteMessage): New static method to pull
26080 the obsolete message and error flag out of an Obsolete attribute.
26082 * class.cs (Method.GetMethodFlags): New public method to get the
26083 TypeManager.MethodFlags for this method.
26084 (Method.ApplyConditionalAttribute, Method.ApplyObsoleteAttribute): New
26086 (Method.Define): Get and apply the Obsolete and Conditional attributes;
26087 if we're overriding a virtual function, set the new private variable
26088 `parent_method'; call the new TypeManager.AddMethod().
26090 * typemanager.cs (TypeManager.AddMethod): New static method. Stores
26091 the MethodBuilder and the Method in a PtrHashtable.
26092 (TypeManager.builder_to_method): Added for this purpose.
26093 (TypeManager.MethodFlags): Added IsObsoleteError.
26094 (TypeManager.GetMethodFlags): Added `Location loc' argument. Lookup
26095 Obsolete and Conditional arguments in MethodBuilders. If we discover
26096 an Obsolete attribute, emit an appropriate warning 618 / error 619 with
26097 the message from the attribute.
26099 2002-07-24 Martin Baulig <martin@gnome.org>
26101 * cs-tokenizer.cs: Eat up trailing whitespaces and one-line comments in
26102 preprocessor directives, ensure that the argument to #define/#undef is
26103 exactly one identifier and that it's actually an identifier.
26105 Some weeks ago I did a `#define DEBUG 1' myself and wondered why this
26108 2002-07-24 Martin Baulig <martin@gnome.org>
26110 * statement.cs (Foreach.ForeachHelperMethods): Added `Type element_type',
26111 initialize it to TypeManager.object_type in the constructor.
26112 (Foreach.GetEnumeratorFilter): Set `hm.element_type' to the return type
26113 of the `hm.get_current' method if we're using the collection pattern.
26114 (Foreach.EmitCollectionForeach): Use `hm.element_type' as the source type
26115 for the explicit conversion to make it work when we're using the collection
26116 pattern and the `Current' property has a different return type than `object'.
26119 2002-07-24 Martin Baulig <martin@gnome.org>
26121 * delegate.cs (Delegate.VerifyMethod): Simply return null if the method
26122 does not match, but don't report any errors. This method is called in
26123 order for all methods in a MethodGroupExpr until a matching method is
26124 found, so we don't want to bail out if the first method doesn't match.
26125 (NewDelegate.DoResolve): If none of the methods in the MethodGroupExpr
26126 matches, report the 123. Fixes #28070.
26128 2002-07-24 Martin Baulig <martin@gnome.org>
26130 * expression.cs (ArrayAccess.EmitStoreOpcode): Moved the
26131 TypeManager.TypeToCoreType() to the top of the method so the
26132 following equality checks will work. Fixes #28107.
26134 2002-07-24 Martin Baulig <martin@gnome.org>
26136 * cfold.cs (ConstantFold.DoConstantNumericPromotions): "If either
26137 operand is of type uint, and the other operand is of type sbyte,
26138 short or int, the operands are converted to type long." -
26139 Actually do what this comment already told us. Fixes bug #28106,
26142 2002-07-24 Martin Baulig <martin@gnome.org>
26144 * class.cs (MethodBase): New abstract class. This is now a base
26145 class for Property, Indexer and Event to avoid some code duplication
26146 in their Define() and DefineMethods() methods.
26147 (MethodBase.DoDefine, MethodBase.DefineAccessor): Provide virtual
26148 generic methods for Define() and DefineMethods().
26149 (FieldBase): Derive from MemberBase, not MemberCore.
26150 (Property): Derive from MemberBase, not MemberCore.
26151 (Property.DefineMethod): Moved all the code from this method to the
26152 new MethodBase.DefineAccessor(), just call it with appropriate
26154 (Property.Define): Call the new Property.DoDefine(), this does some
26155 sanity checks and we don't need to duplicate the code everywhere.
26156 (Event): Derive from MemberBase, not MemberCore.
26157 (Event.Define): Use the new MethodBase.DefineAccessor() to define the
26158 accessors, this will also make them work with interface events.
26159 (Indexer): Derive from MemberBase, not MemberCore.
26160 (Indexer.DefineMethod): Removed, call MethodBase.DefineAccessor() insstead.
26161 (Indexer.Define): Use the new MethodBase functions.
26163 * interface.cs (InterfaceEvent.InterfaceEvent): Added `Location loc'
26164 argument to the constructor.
26165 (Interface.FindMembers): Added support for interface events.
26166 (Interface.PopluateEvent): Implemented.
26168 Added test-149.cs for this. This also fixes bugs #26067 and #24256.
26170 2002-07-22 Miguel de Icaza <miguel@ximian.com>
26172 * class.cs (TypeContainer.AddMethod): Adding methods do not use IsValid,
26173 but this is required to check for a method name being the same as
26174 the containing class.
26178 2002-07-22 Gonzalo Paniagua Javier <gonzalo@ximian.com>
26180 * interface.cs: initialize variable.
26182 2002-07-23 Martin Baulig <martin@gnome.org>
26184 Implemented the IndexerName attribute in interfaces.
26186 * class.cs (TypeContainer.DefineIndexers): Don't set the indexer
26187 name if this is an explicit interface implementation.
26188 (Indexer.InterfaceIndexerName): New public variable. If we're
26189 implementing an interface indexer, this is the IndexerName in that
26190 interface. Otherwise, it's the IndexerName.
26191 (Indexer.DefineMethod): If we're implementing interface indexer,
26192 set InterfaceIndexerName. Use the new Pending.IsInterfaceIndexer
26193 and Pending.ImplementIndexer methods.
26194 (Indexer.Define): Also define the PropertyBuilder if we're
26195 implementing an interface indexer and this is neither an explicit
26196 interface implementation nor do the IndexerName match the one in
26199 * pending.cs (TypeAndMethods): Added `MethodInfo [] need_proxy'.
26200 If a method is defined here, then we always need to create a proxy
26201 for it. This is used when implementing interface indexers.
26202 (Pending.IsInterfaceIndexer): New public method.
26203 (Pending.ImplementIndexer): New public method.
26204 (Pending.InterfaceMethod): Added `MethodInfo need_proxy' argument.
26205 This is used when implementing interface indexers to define a proxy
26207 (Pending.VerifyPendingMethods): Look in the `need_proxy' array and
26208 define a proxy if necessary.
26210 * interface.cs (Interface.IndexerName): New public variable.
26211 (Interface.PopulateIndexer): Set the IndexerName.
26212 (Interface.DefineIndexers): New private method. Populate all the
26213 indexers and make sure their IndexerNames match.
26215 * typemanager.cs (IndexerPropertyName): Added support for interface
26218 2002-07-22 Martin Baulig <martin@gnome.org>
26220 * codegen.cs (EmitContext.HasReturnLabel): New public variable.
26221 (EmitContext.EmitTopBlock): Always mark the ReturnLabel and emit a
26222 ret if HasReturnLabel.
26223 (EmitContext.TryCatchLevel, LoopBeginTryCatchLevel): New public
26226 * statement.cs (Do.Emit, While.Emit, For.Emit, Foreach.Emit): Save
26227 and set the ec.LoopBeginTryCatchLevel.
26228 (Try.Emit): Increment the ec.TryCatchLevel while emitting the block.
26229 (Continue.Emit): If the ec.LoopBeginTryCatchLevel is smaller than
26230 the current ec.TryCatchLevel, the branch goes out of an exception
26231 block. In this case, we need to use Leave and not Br.
26233 2002-07-22 Martin Baulig <martin@gnome.org>
26235 * statement.cs (Try.Emit): Emit an explicit ret after the end of the
26236 block unless the block does not always return or it is contained in
26237 another try { ... } catch { ... } block. Fixes bug #26506.
26238 Added verify-1.cs to the test suite.
26240 2002-07-22 Martin Baulig <martin@gnome.org>
26242 * statement.cs (Switch.TableSwitchEmit): If we don't have a default,
26243 then we do not always return. Fixes bug #24985.
26245 2002-07-22 Martin Baulig <martin@gnome.org>
26247 * expression.cs (Invocation.OverloadedResolve): Do the BetterFunction()
26248 lookup on a per-class level; ie. walk up the class hierarchy until we
26249 found at least one applicable method, then choose the best among them.
26250 Fixes bug #24463 and test-29.cs.
26252 2002-07-22 Martin Baulig <martin@gnome.org>
26254 * typemanager.cs (TypeManager.ArrayContainsMethod): Don't check the
26255 return types of the methods. The return type is not part of the
26256 signature and we must not check it to make the `new' modifier work.
26257 Fixes bug #27999, also added test-147.cs.
26258 (TypeManager.TypeToCoreType): Added TypeManager.type_type.
26260 * expression.cs (Invocation.DoResolve): Call TypeManager.TypeToCoreType()
26261 on the method's return type.
26263 2002-07-21 Martin Baulig <martin@gnome.org>
26265 * assign.cs: Make this work if the rightmost source is a constant and
26266 we need to do an implicit type conversion. Also adding a few more tests
26267 to test-38.cs which should have caught this.
26269 * makefile.gnu: Disable debugging, there's already the mcs-mono2.exe
26270 target in the makefile for this. The makefile.gnu is primarily intended
26271 for end-users who don't want to debug the compiler.
26273 2002-07-21 Martin Baulig <martin@gnome.org>
26275 * assign.cs: Improved the Assign class so it can now handle embedded
26276 assignments (X = Y = Z = something). As a side-effect this'll now also
26277 consume less local variables. test-38.cs now passes with MCS, added
26278 a few new test cases to that test.
26280 2002-07-20 Martin Baulig <martin@gnome.org>
26282 * expression.cs (Binary.EmitBranchable): Emit correct unsigned branch
26283 instructions. Fixes bug #27977, also added test-146.cs.
26285 2002-07-19 Gonzalo Paniagua Javier <gonzalo@ximian.com>
26287 * cs-tokenizer.cs: fixed getHex ().
26289 2002-07-19 Martin Baulig <martin@gnome.org>
26291 * expression.cs (Invocation.EmitParams): Use TypeManager.LookupType(),
26292 not Type.GetType() to lookup the array type. This is needed when
26293 we're constructing an array of a user-defined type.
26294 (ArrayAccess.EmitDynamicInitializers): Only emit the Ldelema for
26295 single-dimensional arrays, but also for single-dimensial arrays of
26298 2002-07-19 Martin Baulig <martin@gnome.org>
26300 * expression.cs (New.DoEmit): Create a new LocalTemporary each time
26301 this function is called, it's not allowed to share LocalBuilders
26302 among ILGenerators.
26304 2002-07-19 Martin Baulig <martin@gnome.org>
26306 * expression.cs (Argument.Resolve): Report an error 118 when trying
26307 to pass a type as argument.
26309 2002-07-18 Martin Baulig <martin@gnome.org>
26311 * ecore.cs (Expression.ImplicitNumericConversion): Don't emit a
26312 Conv_R_Un for the signed `long' type.
26314 2002-07-15 Miguel de Icaza <miguel@ximian.com>
26316 * expression.cs (MemberAccess.DoResolve): Do not reuse the field
26317 `expr' for the temporary result, as that will fail if we do
26318 multiple resolves on the same expression.
26320 2002-07-05 Miguel de Icaza <miguel@ximian.com>
26322 * ecore.cs (SimpleNameResolve): Use ec.DeclSpace instead of
26323 ec.TypeContainer for looking up aliases.
26325 * class.cs (TypeContainer): Remove LookupAlias from here.
26327 * decl.cs (DeclSpace); Move here.
26329 2002-07-01 Miguel de Icaza <miguel@ximian.com>
26331 * class.cs (FindMembers): Only call filter if the constructor
26332 bulider is not null.
26334 Also handle delegates in `NestedTypes' now. Now we will perform
26335 type lookups using the standard resolution process. This also
26338 * decl.cs (DeclSpace.ResolveType): New type resolution routine.
26339 This uses Expressions (the limited kind that can be parsed by the
26340 tree) instead of strings.
26342 * expression.cs (ComposedCast.ToString): Implement, used to flag
26343 errors since now we have to render expressions.
26345 (ArrayCreation): Kill FormElementType. Use ComposedCasts in
26348 * ecore.cs (SimpleName.ToString): ditto.
26350 * cs-parser.jay: Instead of using strings to assemble types, use
26351 Expressions to assemble the type (using SimpleName, ComposedCast,
26352 MemberAccess). This should fix the type lookups in declarations,
26353 because we were using a different code path for this.
26355 * statement.cs (Block.Resolve): Continue processing statements
26356 even when there is an error.
26358 2002-07-17 Miguel de Icaza <miguel@ximian.com>
26360 * class.cs (Event.Define): Also remove the `remove' method from
26361 the list of pending items.
26363 * expression.cs (ParameterReference): Use ldarg.N (0..3) to
26364 generate more compact code.
26366 2002-07-17 Martin Baulig <martin@gnome.org>
26368 * const.cs (Const.LookupConstantValue): Add support for constant
26369 `unchecked' and `checked' expressions.
26370 Also adding test case test-140.cs for this.
26372 2002-07-17 Martin Baulig <martin@gnome.org>
26374 * statement.cs (Foreach.GetEnumeratorFilter): When compiling corlib,
26375 check whether mi.ReturnType implements the IEnumerator interface; the
26376 `==' and the IsAssignableFrom() will fail in this situation.
26378 2002-07-16 Ravi Pratap <ravi@ximian.com>
26380 * ecore.cs (SimpleName.SimpleNameResolve) : Apply Gonzalo's fix
26383 2002-07-16 Gonzalo Paniagua Javier <gonzalo@ximian.com>
26385 * expression.cs: fixed bug #27811.
26387 2002-07-14 Miguel de Icaza <miguel@ximian.com>
26389 * expression.cs (ParameterReference.AddressOf): Patch from Paolo
26390 Molaro: when we are a ref, the value already contains a pointer
26391 value, do not take the address of it.
26393 2002-07-14 Rafael Teixeira <rafaelteixeirabr@hotmail.com>
26394 * removed mb-parser.jay and mb-tokenizer.cs
26396 Sat Jul 13 19:38:03 CEST 2002 Paolo Molaro <lupus@ximian.com>
26398 * expression.cs: check against the building corlib void type.
26400 Sat Jul 13 19:35:58 CEST 2002 Paolo Molaro <lupus@ximian.com>
26402 * ecore.cs: fix for valuetype static readonly fields: when
26403 initializing them, we need their address, not the address of a copy.
26405 Sat Jul 13 17:32:53 CEST 2002 Paolo Molaro <lupus@ximian.com>
26407 * typemanager.cs: register also enum_type in corlib.
26409 Sat Jul 13 15:59:47 CEST 2002 Paolo Molaro <lupus@ximian.com>
26411 * class.cs: allow calling this (but not base) initializers in structs.
26413 Sat Jul 13 15:12:06 CEST 2002 Paolo Molaro <lupus@ximian.com>
26415 * ecore.cs: make sure we compare against the building base types
26418 Sat Jul 13 15:10:32 CEST 2002 Paolo Molaro <lupus@ximian.com>
26420 * typemanager.cs: fix TypeToCoreType() to handle void and object
26421 (corlib gets no more typerefs after this change).
26423 2002-07-12 Miguel de Icaza <miguel@ximian.com>
26425 * expression.cs (ArrayCreation.EmitArrayArguments): use
26426 Conv.Ovf.U4 for unsigned and Conv.Ovf.I4 for signed.
26428 (ArrayAccess.LoadArrayAndArguments): Use Conv_Ovf_I and
26429 Conv_Ovf_I_Un for the array arguments. Even if C# allows longs as
26430 array indexes, the runtime actually forbids them.
26432 * ecore.cs (ExpressionToArrayArgument): Move the conversion code
26433 for array arguments here.
26435 * expression.cs (EmitLoadOpcode): System.Char is a U2, use that
26436 instead of the default for ValueTypes.
26438 (New.DoEmit): Use IsValueType instead of
26439 IsSubclassOf (value_type)
26440 (New.DoResolve): ditto.
26441 (Invocation.EmitCall): ditto.
26443 * assign.cs (Assign): ditto.
26445 * statement.cs (Unsafe): Ok, so I got the semantics wrong.
26446 Statements *are* currently doing part of their resolution during
26449 Expressions do always resolve during resolve, but statements are
26450 only required to propagate resolution to their children.
26452 2002-07-11 Miguel de Icaza <miguel@ximian.com>
26454 * driver.cs (CSCParseOption): Finish the /r: and /lib: support.
26456 (LoadAssembly): Do not add the dll if it is already specified
26458 (MainDriver): Add the System directory to the link path at the end,
26459 after all the other -L arguments.
26461 * expression.cs (ArrayAccess.EmitLoadOpcode): I was using the
26462 wrong opcode for loading bytes and bools (ldelem.i1 instead of
26463 ldelem.u1) and using the opposite for sbytes.
26465 This fixes Digger, and we can finally run it.
26467 * driver.cs (UnixParseOption): Move the option parsing here.
26468 (CSCParseOption): Implement CSC-like parsing of options.
26470 We now support both modes of operation, the old Unix way, and the
26471 new CSC-like way. This should help those who wanted to make cross
26472 platform makefiles.
26474 The only thing broken is that /r:, /reference: and /lib: are not
26475 implemented, because I want to make those have the same semantics
26476 as the CSC compiler has, and kill once and for all the confussion
26477 around this. Will be doing this tomorrow.
26479 * statement.cs (Unsafe.Resolve): The state is checked during
26480 resolve, not emit, so we have to set the flags for IsUnsfe here.
26482 2002-07-10 Miguel de Icaza <miguel@ximian.com>
26484 * expression.cs (MemberAccess.ResolveMemberAccess): Since we can
26485 not catch the Error_ObjectRefRequired in SimpleName (as it is
26486 possible to have a class/instance variable name that later gets
26487 deambiguated), we have to check this here.
26489 2002-07-10 Ravi Pratap <ravi@ximian.com>
26491 * class.cs (TypeContainer.GetFieldFromEvent): Move away from here,
26492 make static and put into Expression.
26494 (Event.Define): Register the private field of the event with the
26495 TypeManager so that GetFieldFromEvent can get at it.
26497 (TypeManager.RegisterPrivateFieldOfEvent): Implement to
26498 keep track of the private field associated with an event which
26501 (TypeManager.GetPrivateFieldOfEvent): Implement to get at the
26504 * ecore.cs (GetFieldFromEvent): RE-write to use the above methods.
26506 2002-07-10 Miguel de Icaza <miguel@ximian.com>
26508 * expression.cs (Binary.EmitBranchable): this routine emits the
26509 Binary expression in a branchable context. This basically means:
26510 we need to branch somewhere, not just get the value on the stack.
26512 This works together with Statement.EmitBoolExpression.
26514 * statement.cs (Statement.EmitBoolExpression): Use
26517 2002-07-09 Miguel de Icaza <miguel@ximian.com>
26519 * statement.cs (For): Reduce the number of jumps in loops.
26521 (For): Implement loop inversion for the For statement.
26523 (Break): We can be breaking out of a Try/Catch controlled section
26524 (foreach might have an implicit try/catch clause), so we need to
26525 use Leave instead of Br.
26527 * ecore.cs (FieldExpr.AddressOf): Fix for test-139 (augmented
26528 now). If the instace expression supports IMemoryLocation, we use
26529 the AddressOf method from the IMemoryLocation to extract the
26530 address instead of emitting the instance.
26532 This showed up with `This', as we were emitting the instance
26533 always (Emit) instead of the Address of This. Particularly
26534 interesting when This is a value type, as we dont want the Emit
26535 effect (which was to load the object).
26537 2002-07-08 Miguel de Icaza <miguel@ximian.com>
26539 * attribute.cs: Pass the entry point to the DefinePInvokeMethod
26541 * statement.cs (Checked): Set the CheckedState during the resolve
26542 process too, as the ConvCast operations track the checked state on
26543 the resolve process, and not emit.
26545 * cs-parser.jay (namespace_member_declaration): Flag that we have
26546 found a declaration when we do. This is used to flag error 1529
26548 * driver.cs: Report ok when we display the help only.
26550 2002-07-06 Andrew Birkett <adb@tardis.ed.ac.uk>
26552 * cs-tokenizer.cs (xtoken): Improve handling of string literals.
26554 2002-07-04 Miguel de Icaza <miguel@ximian.com>
26556 * cs-tokenizer.cs (define): We also have to track locally the
26557 defines. AllDefines is just used for the Conditional Attribute,
26558 but we also need the local defines for the current source code.
26560 2002-07-03 Miguel de Icaza <miguel@ximian.com>
26562 * statement.cs (While, For, Do): These loops can exit through a
26563 Break statement, use this information to tell whether the
26564 statement is the last piece of code.
26566 (Break): Flag that we break.
26568 * codegen.cs (EmitContexts): New `Breaks' state variable.
26570 2002-07-03 Martin Baulig <martin@gnome.org>
26572 * class.cs (TypeContainer.MethodModifiersValid): Allow override
26573 modifiers in method declarations in structs. Otherwise, you won't
26574 be able to override things like Object.Equals().
26576 2002-07-02 Miguel de Icaza <miguel@ximian.com>
26578 * class.cs (Method, Property, Indexer): Do not allow the public
26579 modifier to be used in explicit interface implementations.
26581 (TypeContainer.MethodModifiersValid): Catch virtual, abstract and
26582 override modifiers in method declarations in structs
26584 2002-07-02 Andrew Birkett <adb@tardis.ed.ac.uk>
26586 * cs-tokenizer.cs (adjust_int, adjust_real): Do not abort on
26587 integer or real overflow, report an error
26589 2002-07-02 Martin Baulig <martin@gnome.org>
26591 * typemanager.cs (TypeManager.InitCoreTypes): When compiling
26592 corlib, dynamically call AssemblyBuilder.SetCorlibTypeBuilders()
26593 to tell the runtime about our newly created System.Object and
26594 System.ValueType types.
26596 2002-07-02 Miguel de Icaza <miguel@ximian.com>
26598 * expression.cs (This): Use Stobj/Ldobj when we are a member of a
26599 struct instead of Ldarg/Starg.
26601 2002-07-02 Martin Baulig <martin@gnome.org>
26603 * expression.cs (Indirection.Indirection): Call
26604 TypeManager.TypeToCoreType() on `expr.Type.GetElementType ()'.
26606 2002-07-02 Martin Baulig <martin@gnome.org>
26608 * expression.cs (ArrayAccess.EmitStoreOpcode): If the type is a
26609 ValueType, call TypeManager.TypeToCoreType() on it.
26610 (Invocations.EmitParams): Call TypeManager.TypeToCoreType() on
26611 the OpCodes.Newarr argument.
26613 2002-07-02 Martin Baulig <martin@gnome.org>
26615 * expression.cs (Invocation.EmitCall): When compiling corlib,
26616 replace all calls to the system's System.Array type to calls to
26617 the newly created one.
26619 * typemanager.cs (TypeManager.InitCodeHelpers): Added a few more
26620 System.Array methods.
26621 (TypeManager.InitCoreTypes): When compiling corlib, get the methods
26622 from the system's System.Array type which must be replaced.
26624 Tue Jul 2 19:05:05 CEST 2002 Paolo Molaro <lupus@ximian.com>
26626 * typemanager.cs: load unverifiable_code_ctor so we can build
26627 corlib using the correct type. Avoid using GetTypeCode() with
26629 * rootcontext.cs: uses TypeManager.unverifiable_code_ctor and
26630 TypeManager.object_type to allow building corlib.
26632 Tue Jul 2 19:03:19 CEST 2002 Paolo Molaro <lupus@ximian.com>
26634 * ecore.cs: handle System.Enum separately in LoadFromPtr().
26636 2002-07-01 Martin Baulig <martin@gnome.org>
26638 * class.cs: Make the last change actually work, we need to check
26639 whether `ifaces != null' to avoid a crash.
26641 Mon Jul 1 16:15:03 CEST 2002 Paolo Molaro <lupus@ximian.com>
26643 * class.cs: when we build structs without fields that implement
26644 interfaces, we need to add the interfaces separately, since there is
26645 no API to both set the size and add the interfaces at type creation
26648 Mon Jul 1 14:50:47 CEST 2002 Paolo Molaro <lupus@ximian.com>
26650 * expression.cs: the dimension arguments to the array constructors
26651 need to be converted if they are a long.
26653 Mon Jul 1 12:26:12 CEST 2002 Paolo Molaro <lupus@ximian.com>
26655 * class.cs: don't emit ldarg.0 if there is no parent constructor
26656 (fixes showstopper for corlib).
26658 2002-06-29 Martin Baulig <martin@gnome.org>
26660 MCS now compiles corlib on GNU/Linux :-)
26662 * attribute.cs (Attribute.ApplyAttributes): Treat Accessors like Method,
26663 ie. check for MethodImplOptions.InternalCall.
26665 * class.cs (TypeContainer.DefineType): When compiling corlib, both parent
26666 and TypeManager.attribute_type are null, so we must explicitly check
26667 whether parent is not null to find out whether it's an attribute type.
26668 (Property.Emit): Always call Attribute.ApplyAttributes() on the GetBuilder
26669 and SetBuilder, not only if the property is neither abstract nor external.
26670 This is necessary to set the MethodImplOptions on the accessor methods.
26671 (Indexer.Emit): Call Attribute.ApplyAttributes() on the GetBuilder and
26672 SetBuilder, see Property.Emit().
26674 * rootcontext.cs (RootContext.PopulateTypes): When compiling corlib, don't
26675 populate "System.Object", "System.ValueType" and "System.Attribute" since
26676 they've already been populated from BootCorlib_PopulateCoreTypes().
26678 2002-06-29 Martin Baulig <martin@gnome.org>
26680 * ecore.cs (Expression.ImplicitReferenceConversionExists): If expr
26681 is the NullLiteral, we also need to make sure that target_type is not
26684 2002-06-29 Martin Baulig <martin@gnome.org>
26686 * rootcontext.cs (RootContext.ResolveCore): We must initialize
26687 `TypeManager.multicast_delegate_type' and `TypeManager.delegate_type'
26688 before calling BootstrapCorlib_ResolveDelegate ().
26690 2002-06-27 Gonzalo Paniagua Javier <gonzalo@ximian.com>
26692 * statement.cs: fixed build-breaker. All tests passed ok.
26694 2002-06-27 Martin Baulig <martin@gnome.org>
26696 * typemanager.cs (TypeManager.VerifyUnManaged): Added explicit check
26697 for System.Decimal when compiling corlib.
26699 2002-06-27 Martin Baulig <martin@gnome.org>
26701 * statement.cs (Switch.TableSwitchEmit): Make this work with empty
26702 switch blocks which contain nothing but a default clause.
26704 2002-06-26 Andrew <adb@tardis.ed.ac.uk>
26706 * ../errors/cs1501-3.cs: Added new test for struct ctr typechecks.
26708 2002-06-27 Martin Baulig <martin@gnome.org>
26710 * ecore.cs (PropertyExpr.PropertyExpr): Call
26711 TypeManager.TypeToCoreType() on the `pi.PropertyType'.
26713 * typemanager.cs (TypeManager.TypeToCoreType): Return if the type
26714 is already a TypeBuilder.
26716 2002-06-27 Martin Baulig <martin@gnome.org>
26718 * ecore.cs (Expression.ImplicitReferenceConversionExists): Use
26719 `target_type == TypeManager.array_type', not IsAssignableFrom() in
26720 the "from an array-type to System.Array" case. This makes it work
26721 when compiling corlib.
26723 2002-06-27 Martin Baulig <martin@gnome.org>
26725 * ecore.cs (Expression.SimpleNameResolve): If the expression is a
26726 non-static PropertyExpr, set its InstanceExpression. This makes
26727 the `ICollection.Count' property work in System/Array.cs.
26729 2002-06-25 Andrew Birkett <adb@tardis.ed.ac.uk>
26731 * driver.cs: Made error handling more consistent. Errors now
26732 tracked by Report class, so many methods which used to return int
26733 now return void. Main() now prints success/failure and
26734 errors/warnings message.
26736 Renamed '--probe' compiler argument to '--expect-error'. Removed
26737 the magic number return values (123 and 124). Now, if the
26738 expected error occurs, the compiler exits with success (exit value
26739 0). If the compilation completes without seeing that particular
26740 error, the compiler exits with failure (exit value 1). The
26741 makefile in mcs/errors has been changed to handle the new behaviour.
26743 * report.cs: Made 'expected error' number a property and renamed
26744 it from 'Probe' to 'ExpectedError'.
26746 * genericparser.cs: Removed error handling support, since it is
26747 now all done by Report class.
26749 * cs-parser.jay, mb-parser.jay: Errors are tracked by Report
26750 class, so parse() no longer returns an int.
26752 * namespace.cs: Use Report.Error instead of GenericParser.error
26754 2002-06-22 Miguel de Icaza <miguel@ximian.com>
26756 * class.cs (TypeContainer.AddMethod, TypeContainer.AddIndexer,
26757 TypeContainer.AddOperator): At the front of the list put the
26758 explicit implementations, so they get resolved/defined first.
26760 2002-06-21 Miguel de Icaza <miguel@ximian.com>
26762 * class.cs (TypeContainer.VerifyImplements): Verifies that a given
26763 interface type is implemented by this TypeContainer. Used during
26764 explicit interface implementation.
26766 (Property.Define, Indexer.Define, Method.Define): Validate that
26767 the given interface in the explicit implementation is one of the
26768 base classes for the containing type.
26770 Also if we are explicitly implementing an interface, but there is
26771 no match in the pending implementation table, report an error.
26773 (Property.Define): Only define the property if we are
26774 not explicitly implementing a property from an interface. Use the
26775 correct name also for those properties (the same CSC uses,
26776 although that is really not needed).
26778 (Property.Emit): Do not emit attributes for explicitly implemented
26779 properties, as there is no TypeBuilder.
26781 (Indexer.Emit): ditto.
26783 Hiding then means that we do not really *implement* a pending
26784 implementation, which makes code fail.
26786 2002-06-22 Martin Baulig <martin@gnome.org>
26788 * ecore.cs (Expression.Constantify): Call TypeManager.TypeToCoreType() on
26789 the return value of Object.GetType(). [FIXME: we need to do this whenever
26790 we get a type back from the reflection library].
26792 Fri Jun 21 13:37:57 CEST 2002 Paolo Molaro <lupus@ximian.com>
26794 * typemanager.cs: make ExpandInterfaces() slip duplicated interfaces.
26796 2002-06-20 Miguel de Icaza <miguel@ximian.com>
26798 * attribute.cs: Return null if we can not look up the type.
26800 * class.cs (TypeContainer.GetClassBases): Use ExpandInterfaces on
26801 the interface types found.
26803 * interface.cs (Interface.GetInterfaceBases): Use ExpandInterfaces on the
26804 interface types found.
26806 * typemanager.cs (GetInterfaces): Make this routine returns alll
26807 the interfaces and work around the lame differences between
26808 System.Type and System.Reflection.Emit.TypeBuilder in the results
26809 result for GetInterfaces.
26811 (ExpandInterfaces): Given an array of interface types, expand and
26812 eliminate repeated ocurrences of an interface. This expands in
26813 context like: IA; IB : IA; IC : IA, IB; the interface "IC" to
26816 2002-06-21 Martin Baulig <martin@gnome.org>
26818 * typemanager.cs (TypeManager.EnumToUnderlying): It's now safe to call this function
26821 2002-06-21 Martin Baulig <martin@gnome.org>
26823 * typemanager.cs (TypeManager.TypeToCoreType): New function. When compiling corlib
26824 and called with one of the core types, return the corresponding typebuilder for
26827 * expression.cs (ArrayAccess.DoResolve): Call TypeManager.TypeToCoreType() on the
26830 2002-06-21 Martin Baulig <martin@gnome.org>
26832 * ecore.cs (Expression.ExplicitReferenceConversionExists): Use
26833 `target_type.IsArray' instead of `target_type.IsSubclassOf (TypeManager.array_type)'.
26834 (Expression.ConvertReferenceExplicit): Likewise.
26836 * expression.cs (ElementAccess.DoResolve): Likewise.
26837 (ElementAccess.DoResolveLValue): Likewise.
26839 2002-06-10 Martin Baulig <martin@gnome.org>
26841 * interface.cs (Interface.PopulateIndexer): When creating the setter, we need to
26842 add the "value" parameter to the parameter list.
26844 * statement.cs (Fixed.Emit): Pass the return value of the child block's Emit()
26847 2002-06-19 Miguel de Icaza <miguel@ximian.com>
26849 * expression.cs (ArrayCreation.ExpressionToArrayArgument): Convert
26850 the argument to an int, uint, long or ulong, per the spec. Also
26851 catch negative constants in array creation.
26853 Thu Jun 20 17:56:48 CEST 2002 Paolo Molaro <lupus@ximian.com>
26855 * class.cs: do not allow the same interface to appear twice in
26856 the definition list.
26858 Wed Jun 19 22:33:37 CEST 2002 Paolo Molaro <lupus@ximian.com>
26860 * ecore.cs: don't use ldlen with System.Array.
26862 Wed Jun 19 20:57:40 CEST 2002 Paolo Molaro <lupus@ximian.com>
26864 * ecore.cs: stobj requires a type argument. Handle indirect stores on enums.
26866 Wed Jun 19 20:17:59 CEST 2002 Paolo Molaro <lupus@ximian.com>
26868 * modifiers.cs: produce correct field attributes for protected
26869 internal. Easy fix so miguel can work on ther harder stuff:-)
26871 2002-06-18 Miguel de Icaza <miguel@ximian.com>
26873 * pending.cs: New file. Move the code from class.cs here.
26874 Support clearning the pending flag for all methods (when not doing
26875 explicit interface implementation).
26877 Tue Jun 18 10:36:22 CEST 2002 Paolo Molaro <lupus@ximian.com>
26879 * rootcontext.cs: added a couple more types needed to bootstrap.
26881 2002-06-17 Miguel de Icaza <miguel@ximian.com>
26883 * typemanager.cs (GetConstructor): Use DeclaredOnly to look the
26884 constructor in the type, instead of any constructor in the type
26885 hierarchy. Thanks to Paolo for finding this bug (it showed up as
26886 a bug in the Mono runtime when applying the params attribute).
26888 2002-06-16 Rafael Teixeira <rafaelteixeirabr@hotmail.com>
26889 * changed namespace.cs to use "GenericParser.error(...)" instead of "CSharpParser.error(...)"
26891 2002-06-14 Rachel Hestilow <hestilow@ximian.com>
26893 * expression.cs (Unary.ResolveOperator): Use TypeManager
26894 to resolve the type.
26896 2002-06-13 Ravi Pratap <ravi@ximian.com>
26898 * cs-parser.jay (enum_member_declaration): Pass in the attributes
26901 * enum.cs (AddEnumMember): Add support to store the attributes associated
26902 with each member too.
26904 * attribute.cs (CheckAttribute, ApplyAttributes): Update to handle
26905 field builders too - this takes care of the enum member case.
26907 2002-06-10 Rachel Hestilow <hestilow@ximian.com>
26909 * typemanager.cs (TypeManager.VerifyUnManaged): Allow
26910 address-of operator on both value types and pointers.
26912 2002-06-10 Martin Baulig <martin@gnome.org>
26914 * interface.cs (Interface.PopulateIndexer): Add the indexer's
26915 PropertyBuilder to the `property_builders' list.
26917 * expression.cs (Indexers.GetIndexersForTypeOrInterface): New private method.
26918 (Indexers.GetIndexersForType): Call GetIndexersForTypeOrInterface() on the
26919 `lookup_type' and all its interfaces. Unfortunately, Type.FindMembers() won't
26920 find any indexers which are inherited from an interface.
26922 2002-06-09 Martin Baulig <martin@gnome.org>
26924 * const.cs (Const.LookupConstantValue): Convert `Expr' to a literal of
26925 the same type as the constant if necessary. There's also a test-130.cs
26928 * enum.cs (Enum.ChangeEnumType): Moved to typemanager.cs and made public.
26930 * typemanager.cs (TypeManager.ChangeType): Previously known as
26931 Enum.ChangeEnumType().
26933 2002-06-09 Martin Baulig <martin@gnome.org>
26935 * expression.cs (Cast.TryReduce): Added support for consts.
26937 2002-06-08 Ravi Pratap <ravi@ximian.com>
26939 * class.cs (Accessor): Hold attributes information so we can pass
26942 * cs-parser.jay (get_accessor_declaration, set_accessor_declaration):
26943 Modify to pass in attributes attached to the methods.
26945 (add_accessor_declaration, remove_accessor_declaration): Ditto.
26947 * attribute.cs (ApplyAttributes, CheckAttribute): Update accordingly
26948 to handle the Accessor kind :-)
26950 * class.cs (Property.Emit, Event.Emit): Apply attributes to the accessors
26952 2002-06-08 Martin Baulig <martin@gnome.org>
26954 * expression.cs (Unary.TryReduceNegative): Added support for
26957 2002-06-08 Martin Baulig <martin@gnome.org>
26959 * enum.cs (Enum.LookupEnumValue): Don't report an error if the
26960 name can't be found in the `defined_names' - the caller will do a
26961 MemberLookup in this case and thus find methods in System.Enum
26962 such as Enum.IsDefined().
26964 2002-06-08 Martin Baulig <martin@gnome.org>
26966 * enum.cs (Enum.ChangeEnumType): This is a custom version of
26967 Convert.ChangeType() which works with TypeBuilder created types.
26968 (Enum.LookupEnumValue, Enum.Define): Use it here.
26970 * class.cs (TypeContainer.RegisterRequiredImplementations): Added
26971 `TypeBuilder.BaseType != null' check.
26972 (TypeContainer.FindMembers): Only lookup parent members if we
26973 actually have a parent.
26974 (Method.EmitDestructor): Added `ec.ContainerType.BaseType != null' check.
26975 (ConstructorInitializer.Resolve): Likewise.
26977 * interface.cs (Interface.FindMembers): Added
26978 `TypeBuilder.BaseType != null' check.
26980 * rootcontext.cs (RootContext.ResolveCore): Added
26981 "System.Runtime.CompilerServices.IndexerNameAttribute" to
26982 classes_second_stage.
26984 * typemanager.cs (TypeManager.InitCoreTypes): Don't initialize
26985 debug_type and trace_type when compiling with --nostdlib.
26987 2002-06-07 Martin Baulig <martin@gnome.org>
26989 * class.cs (TypeContainer): Added `have_nonstatic_fields' field.
26990 (AddField): Set it to true when adding a non-static field.
26991 (DefineType): Use `have_nonstatic_fields' to find out whether we
26992 have non-static fields, not `Fields != null'.
26994 2002-06-02 Miguel de Icaza <miguel@ximian.com>
26996 * ecore.cs (SimpleNameResolve): Removed simple bug (we were
26997 dereferencing a null on the static-field code path)
26999 2002-05-30 Martin Baulig <martin@gnome.org>
27001 * codegen.cs (InitMonoSymbolWriter): Added `string[] args' argument
27002 to take command line arguments. Use reflection to call the new
27003 custom `Initialize' function on the symbol writer and pass it the
27004 command line arguments.
27006 * driver.cs (--debug-args): New command line argument to pass command
27007 line arguments to the symbol writer.
27009 2002-05-28 Miguel de Icaza <miguel@ximian.com>
27011 * assign.cs (DoResolve): Forgot to do the implicit conversion to
27012 the target type for indexers and properties. Thanks to Joe for
27015 2002-05-27 Miguel de Icaza <miguel@ximian.com>
27017 * typemanager.cs (MethodFlags): returns the method flags
27018 (Obsolete/ShouldIgnore) that control warning emission and whether
27019 the invocation should be made, or ignored.
27021 * expression.cs (Invocation.Emit): Remove previous hack, we should
27022 not do this on matching a base type, we should do this based on an attribute
27024 Only emit calls to System.Diagnostics.Debug and
27025 System.Diagnostics.Trace if the TRACE and DEBUG defines are passed
27026 on the command line.
27028 * rootcontext.cs: Global settings for tracing and debugging.
27030 * cs-tokenizer.cs (define): New utility function to track
27031 defines. Set the global settings for TRACE and DEBUG if found.
27033 2002-05-25 Ravi Pratap <ravi@ximian.com>
27035 * interface.cs (Populate*): Pass in the TypeContainer as well as
27036 the DeclSpace as parameters so that we can create EmitContexts and
27037 then use that to apply attributes etc.
27039 (PopulateMethod, PopulateEvent, PopulateProperty)
27040 (PopulateIndexer): Apply attributes everywhere.
27042 * attribute.cs (CheckAttribute): Include InterfaceMethod, InterfaceEvent
27045 (ApplyAttributes): Update accordingly.
27047 We now apply interface attributes for all members too.
27049 2002-05-26 Miguel de Icaza <miguel@ximian.com>
27051 * class.cs (Indexer.Define); Correctly check if we are explicit
27052 implementation (instead of checking the Name for a ".", we
27053 directly look up if the InterfaceType was specified).
27055 Delay the creation of the PropertyBuilder.
27057 Only create the PropertyBuilder if we are not an explicit
27058 interface implementation. This means that explicit interface
27059 implementation members do not participate in regular function
27060 lookups, and hence fixes another major ambiguity problem in
27061 overload resolution (that was the visible effect).
27063 (DefineMethod): Return whether we are doing an interface
27066 * typemanager.cs: Temporary hack until we get attributes in
27067 interfaces (Ravi is working on that) and we get IndexerName
27068 support in interfaces.
27070 * interface.cs: Register the indexers as properties.
27072 * attribute.cs (Attribute.Resolve): Catch the error, and emit a
27073 warning, I have verified that this is a bug in the .NET runtime
27074 (JavaScript suffers of the same problem).
27076 * typemanager.cs (MemberLookup): When looking up members for
27077 interfaces, the parent of an interface is the implicit
27078 System.Object (so we succeed in searches of Object methods in an
27079 interface method invocation. Example: IEnumerable x; x.ToString
27082 2002-05-25 Miguel de Icaza <miguel@ximian.com>
27084 * class.cs (Event): Events should also register if they do
27085 implement the methods that an interface requires.
27087 * typemanager.cs (MemberLookup); use the new GetInterfaces
27090 (GetInterfaces): The code used to lookup interfaces for a type is
27091 used in more than one place, factor it here.
27093 * driver.cs: Track the errors at the bottom of the file, we kept
27096 * delegate.cs (NewDelegate.Emit): We have to emit a null as the
27097 instance if the method we are calling is static!
27099 2002-05-24 Miguel de Icaza <miguel@ximian.com>
27101 * attribute.cs (ApplyAttributes): Make this function filter out
27102 the IndexerName attribute (as that attribute in reality is never
27103 applied) and return the string constant for the IndexerName
27106 * class.cs (TypeContainer.Emit): Validate that all the indexers
27107 have the same IndexerName attribute, and if so, set the
27108 DefaultName attribute on the class.
27110 * typemanager.cs: The return value might contain other stuff (not
27111 only methods). For instance, consider a method with an "Item"
27112 property and an Item method.
27114 * class.cs: If there is a problem with the parameter types,
27117 2002-05-24 Ravi Pratap <ravi@ximian.com>
27119 * ecore.cs (ImplicitConversionExists): Wrapper function which also
27120 looks at user defined conversion after making a call to
27121 StandardConversionExists - we need this for overload resolution.
27123 * expression.cs : Update accordingly the various method calls.
27125 This fixes 2 bugs filed against implicit user defined conversions
27127 2002-05-22 Miguel de Icaza <miguel@ximian.com>
27129 * statement.cs: Track the result of the assignment.
27131 2002-05-21 Miguel de Icaza <miguel@ximian.com>
27133 * expression.cs (MemberAccess): Improved error reporting for
27134 inaccessible members.
27136 2002-05-22 Martin Baulig <martin@gnome.org>
27138 * makefile (mcs-mono2.exe): New target. This is mcs compiled with
27139 itself with debugging support.
27141 2002-05-22 Martin Baulig <martin@gnome.org>
27143 * typemanager.cs ("System.Runtime.InteropServices.StructLayoutAttribute"):
27144 Removed, this isn't needed anymore.
27146 2002-05-20 Martin Baulig <martin@gnome.org>
27148 * typemanager.cs (InitEnumUnderlyingTypes): "System.Char" can't
27149 be underlying type for an enum.
27151 2002-05-20 Miguel de Icaza <miguel@ximian.com>
27153 * typemanager.cs (InitEnumUnderlyingTypes): New helper function
27154 that splits out the loading of just the core types.
27156 * rootcontext.cs (ResolveCore): Split the struct resolution in
27157 two, so we can load the enumeration underlying types before any
27160 * expression.cs (Is): Bandaid until we fix properly Switch (see
27161 bug #24985 for details).
27163 * typemanager.cs (ImplementsInterface): The hashtable will contain
27164 a null if there are no interfaces implemented.
27166 2002-05-18 Miguel de Icaza <miguel@ximian.com>
27168 * cs-parser.jay (indexer_declarator): It is fine to have array
27171 2002-05-17 Miguel de Icaza <miguel@ximian.com>
27173 * typemanager.cs: (RegisterBuilder): New function used to register
27174 TypeBuilders that implement interfaces. Since
27175 TypeBuilder.GetInterfaces (as usual) does not work with lame
27177 (AddUserType): register interfaces.
27179 (ImplementsInterface): Use the builder_to_ifaces hash if we are
27180 dealing with TypeBuilder. Also, arrays are showing up as
27181 SymbolTypes, which are not TypeBuilders, but whose GetInterfaces
27182 methods can not be invoked on them!
27184 * ecore.cs (ExplicitReferenceConversionExists): Made public.
27185 (ImplicitReferenceConversionExists): Split out from
27186 StandardConversionExists.
27188 * expression.cs (As): We were only implementing one of the three
27189 cases for the as operator. We now implement them all.
27190 (Is): Implement the various other cases for Is as well.
27192 * typemanager.cs (CACHE): New define used to control if we want or
27193 not the FindMembers cache. Seems to have a negative impact on
27194 performance currently
27196 (MemberLookup): Nested types have full acess to
27197 enclosing type members
27199 Remove code that coped with instance/static returns for events, we
27200 now catch this in RealFindMembers.
27202 (RealFindMembers): only perform static lookup if the instance
27203 lookup did not return a type or an event.
27205 2002-05-17 Miguel de Icaza <miguel@ximian.com>
27207 * assign.cs (CompoundAssign): We pass more semantic information
27208 now to Compound Assignments than we did before: now we have all
27209 the information at hand, and now we resolve the target *before* we
27210 do the expression expansion, which allows the "CacheValue" method
27211 to have the effect we intended (before, a [x] += 1 would generate
27212 two differen ArrayAccess expressions from the ElementAccess,
27213 during the resolution process).
27215 (CompoundAssign.DoResolve): Resolve target and original_source here.
27217 2002-05-16 Miguel de Icaza <miguel@ximian.com>
27219 * expression.cs (ArrayAccess): dropped debugging information.
27221 * typemanager.cs: Small bug fix: I was always returning i_members,
27222 instead of one of i_members or s_members (depending on which had
27225 * assign.cs (IAssignMethod.CacheTemporaries): New method. This
27226 method is invoked before any code generation takes place, and it
27227 is a mechanism to inform that the expression will be invoked more
27228 than once, and that the method should use temporary values to
27229 avoid having side effects
27231 (Assign.Emit): Call CacheTemporaries in the IAssignMethod.
27233 * ecore.cs (Expression.CacheTemporaries): Provide empty default
27236 * expression.cs (Indirection, ArrayAccess): Add support for
27237 CacheTemporaries in these two bad boys.
27239 * ecore.cs (LoadFromPtr): figure out on our own if we need to use
27240 ldobj or ldind_ref.
27241 (StoreFromPtr): Handle stobj as well.
27243 * expression.cs (UnaryMutator): Share more code.
27245 * typemanager.cs (FindMembers): Thanks to Paolo for tracking this
27246 down: I was not tracking the Filter function as well, which
27247 was affecting the results of the cache.
27249 2002-05-15 Miguel de Icaza <miguel@ximian.com>
27251 * attribute.cs: Remove the hack to handle the CharSet property on
27254 2002-05-14 Miguel de Icaza <miguel@ximian.com>
27256 * attribute.cs (DoResolve): More uglyness, we now only try to
27257 resolve the attribute partially, to extract the CharSet
27258 information (only if we are a StructLayout attribute). Otherwise
27260 (GetExtraTypeInfo): Add some code to conditionally kill in the
27261 future this. I am more and more convinced that the .NET
27262 framework has special code to handle the attribute setting on
27265 * expression.cs (IsParamsMethodApplicable): Revert my previous
27266 foreach change here, it was wrong.
27268 2002-05-13 Miguel de Icaza <miguel@ximian.com>
27270 * cs-tokenizer.cs: (pp_primary): Eat the ')' at the end.
27271 (pp_expr): do not abort on unknown input, just return.
27272 (eval): abort if there are pending chars.
27274 * attribute.cs (Attribute.Resolve): Positional parameters are
27275 optional. Deal with that case.
27277 * class.cs (DefineType): Call Attribute.GetExtraTypeInfo to fetch
27278 the Ansi/Unicode/Auto information for the type.
27280 (TypeContainer.DefineType): instantiate the EmitContext here, as
27281 we will be using it during the type definition (to resolve
27282 attributes) and during the emit phase.
27284 * attribute.cs (Attribute.GetExtraTypeInfo): This routine is used
27285 to pull type information out of the attributes
27287 (Attribute.Resolve): track the constructor builder, and allow for
27288 multiple invocations (structs and classes will use this).
27290 * ecore.cs (MemberLookupFinal): new version with all the
27291 parameters customizable.
27293 * expression.cs (New.DoResolve): Use MemberLookupFinal to locate
27294 constructors. Return if the result value is null (as the error
27295 would have been flagged already by MemberLookupFinal)
27297 Do not allow instances of abstract classes or interfaces to be
27300 * class.cs: (MethodSignature.InheritableMemberSignatureCompare):
27301 We have to compare the assembly property here when dealing with
27302 FamANDAssem and Assembly access modifiers, because we might be
27303 creating an assembly from *modules* (that means that we are not
27304 getting TypeBuilders for types defined in other modules that are
27305 part of this assembly).
27307 (Method.Emit): If the method is marked abstract and has a body,
27310 (TypeContainer.DefineMembers): If both the defined member and the
27311 parent name match are methods, then do not emit any warnings: let
27312 the Method.Define routine take care of flagging warnings. But if
27313 there is a mismatch (method overrides something else, or method is
27314 overriwritten by something, then emit warning).
27316 (MethodSignature.MemberSignatureCompare): If the sig.ret_type is
27317 set to null, this means `do not check for the return type on the
27320 (Method.Define): set the return type for the method signature to
27321 null, so that we get methods with the same name and parameters and
27322 different return types. This is used to flag warning 114 (you are
27323 hiding a method, and you probably want to use the new/override
27326 * typemanager.cs (MemberLookup): Implemented proper access
27327 control, closing a long standing set of bug reports. The problem
27328 was that the Framework only has two bits: Public and NonPublic,
27329 and NonPublic includes private and protected methods, but we need
27330 to enforce the FamANDAssem, FamOrAssem and Family.
27332 2002-05-11 Miguel de Icaza <miguel@ximian.com>
27334 * statement.cs (GotoCase): Return true: Ammounts to giving up
27335 knowledge on whether we return or not, and letting the other case
27336 be responsible for it.
27338 2002-05-10 Miguel de Icaza <miguel@ximian.com>
27340 * driver.cs: Do not load directories for each file processed, only
27341 do it if there is a pattern.
27343 * ecore.cs: Report readonly assigns here as well, as we might have
27344 been resolved only by MemberAccess.
27346 (SimpleName.SimpleNameResolve): Also be useful for LValue
27347 resolution. We need this to propagate assign to local readonly variables
27349 * typemanager.cs: Use a ptrhashtable for the criteria, because we
27350 do not want to reuse potential criteria memory.
27352 * class.cs (MyEventBuilder): Set reflected_type;
27354 * ecore.cs (Constantify): Added support for constifying bools.
27356 (RootContext.LookupType): Added a cache for values looked up in
27357 the declaration space.
27359 * typemanager.cs (FindMembers): Now is a front-end to
27360 RealFindMembers, and provides a two-level hashtable-based cache to
27363 15% performance improvement: from 22.5 to 19.2 seconds.
27365 * expression.cs (IsParamsMethodApplicable): use foreach.
27366 (Invocation.DoResolve): ditto.
27367 (New.DoResolve): ditto.
27368 (ArrayCreation.DoResolve): ditto.
27370 * ecore.cs (FindMostEncompassingType): use foreach.
27372 * delegate.cs (NewDelegate.DoResolve): Use foreach
27374 * ecore.cs (Expression.FindMostSpecificSource): Use foreach.
27375 (RemoveMethods): use foreach.
27377 * expression.cs (Invocation.MakeUnionSet): Optimization: Use two
27378 nested foreach statements instead of for, and also break out of
27379 the inner loop once a match is found.
27381 (Invocation.OverloadResolve): Use foreach, simplify the code.
27383 2002-05-08 Miguel de Icaza <miguel@ximian.com>
27385 * cfold.cs (BinaryFold): During an enumeration evaluation context,
27386 we actually unwrap the expression to allow for extra information
27389 * expression.cs: Use Shr_Un on unsigned operations.
27391 2002-05-08 Ravi Pratap <ravi@ximian.com>
27393 * ecore.cs (FindMostEncompass*): Fix trivial bug where the set of
27394 applicable operators was not being considered correctly. This closes
27395 the bug Miguel reported.
27397 Wed May 8 16:40:50 CEST 2002 Paolo Molaro <lupus@ximian.com>
27399 * attribute.cs: check that the type derives from System.Attribute
27400 and report the correct error in that case (moved the duplicate code to
27401 its own method, too).
27403 Wed May 8 11:50:31 CEST 2002 Paolo Molaro <lupus@ximian.com>
27405 * attribute.cs: lookup attribute type name as the spec says: first the
27406 bare attribute name and then name + "Attribute" (nant compiles with
27407 mcs after this fix).
27409 2002-05-07 Miguel de Icaza <miguel@ximian.com>
27411 * expression.cs (Unary.TryReduceNegative): Ah! Tricky! Tricky!
27412 Because of the way we parse things, we should try to see if a
27413 UIntConstant can fit in an integer.
27415 2002-05-07 Ravi Pratap <ravi@ximian.com>
27417 * ecore.cs (GetConversionOperators): Do not pick up op_True operators
27418 when we are in an explicit context.
27420 (ConvertReferenceExplicit): When converting from Iface type S to Class
27421 T make sure the rules are implemented as an OR.
27423 * parameter.cs (ParameterType): Make it a property for now although the
27424 purpose really isn't anything immediate.
27426 * expression.cs (Is*Applicable): Do better checking on the parameter type
27427 of a ref/out parameter. The ones from the system assemblies are already
27428 marked with the correct type so we don't need to do any correction.
27430 * ecore.cs (StandardConversionExists): Conversion from Interface types to
27431 the object type is standard too so include that.
27433 2002-05-06 Miguel de Icaza <miguel@ximian.com>
27435 * ecore.cs (StandardConversionExists): Augment with missing code:
27436 deal with IntConstant, LongConstants and Enumerations.
27438 * assign.cs: Report the error, instead of failing silently
27440 * rootcontext.cs (AddGlobalAttributes): Track attributes on the
27441 typecontainer that they are declared, because the
27442 typecontainer/namespace will have the list of using clauses that
27443 need to be applied.
27445 Assembly Attributes were escaping the normal registration
27448 (EmitCode): Apply attributes within an EmitContext that represents
27449 the container they were declared on.
27451 * cs-parser.jay: Track bases for structs. How did I get this wrong?
27453 2002-05-06 Ravi Pratap <ravi@ximian.com>
27455 * ecore.cs (FindMostEncompassingType, FindMostEncompassedType):
27456 Revamp completely - make much cleaner as we now operate only
27459 (FindMostSpecificSource, FindMostSpecificTarget): New methods
27460 to implement the logic detailed in the spec more correctly.
27462 (UserDefinedConversion): Update accordingly.
27464 2002-05-06 Miguel de Icaza <miguel@ximian.com>
27466 * statement.cs: Return flow analysis information up.
27468 * cs-tokenizer.cs (adjust_real): Share code between LITERAL_DOUBLE
27471 (token): Do not consume an extra character before calling
27474 2002-05-06 Piers Haken <piersh@friskit.com>
27476 * cs-parser.jay: add 'override' attribute to System.Object.Finalize
27478 2002-05-06 Miguel de Icaza <miguel@ximian.com>
27480 * class.cs (Constructor.Emit): Set the IsStatic flag in the
27481 EmitContext during the instance constructor initializer
27482 resolution, to stop access to instance variables.
27484 This is mandated by the spec, last paragraph of the `constructor
27485 initializers' section.
27487 2002-05-05 Miguel de Icaza <miguel@ximian.com>
27489 * cs-parser.jay, class.cs (Accessor): new class used to represent
27490 an accessor (get or set). In the past we used `null' to represent
27491 a missing accessor. But this is ambiguous because there was no
27492 way to tell in abstract indexers/properties if one of them was
27495 Now there is a way of addressing that.
27497 * expression.cs (Indexers.GetIndexersForType): Use TypeManager.MemberLookup
27498 instead of FindMembers.
27500 * class.cs (TypeContainer.EmitFieldInitializer): Do not typecast
27501 the result of Assign.Resolve as Assign, but rather as ExpressionStatement.
27503 * attribute.cs: Treat indexers and properties as the same in terms
27504 of applying attributes
27506 * ecore.cs (FindMostEncompassedType): Use statically initialized
27507 EmptyExpressions()s like we do elsewhere to avoid creating useless
27508 objects (and we take this out of the tight loop).
27510 (GetConversionOperators): Move the code to extract the actual
27511 operators to a separate routine to clean things up.
27513 2002-05-04 Miguel de Icaza <miguel@ximian.com>
27515 * ecore.cs (FieldExpr): Remove un-needed tests for null, since now
27516 events are always registered FieldBuilders.
27518 * class.cs (FieldBase): New class shared by Fields
27520 * delegate.cs: If we are a toplevel delegate, use our full name.
27521 If we are a nested delegate, then only use our tail name.
27523 2002-05-02 Ravi Pratap <ravi@ximian.com>
27525 * expression.cs (IsApplicable): Ensure that we add the "&" to
27526 ref/out types before comparing it with the type of the argument.
27528 (IsParamsMethodApplicable): Ditto.
27530 (Argument.Type): Use TypeManager.LookupType instead of Type.GetType -
27533 * delegate.cs : Handle the case when we have more than one applicable
27534 method. Flag an error only when we finish checking all.
27536 2002-05-02 Miguel de Icaza <miguel@ximian.com>
27538 * expression.cs: Add support for boolean static initializers.
27540 2002-05-01 Miguel de Icaza <miguel@ximian.com>
27542 * attribute.cs: Use proper cast for Events, since we use a MyEventBuilder.
27544 * parameter.cs (ComputeParameterTypes,
27545 ComputeAndDefineParameterTypes): Better error handling: now we
27546 clear the `types' cache if we fail during any of the type lookups.
27547 We also return the status code correctly to our caller
27549 * delegate.cs: If we fail to define a delegate, abort the extra
27552 * expression.cs (Binary.ResolveOperator): for
27553 operator==(object,object) and operator !=(object, object) we also
27554 have to verify that there is an implicit conversion from one to
27557 (ArrayAccess.DoResolve): Array Access can operate on
27560 2002-04-30 Miguel de Icaza <miguel@ximian.com>
27562 * assign.cs (CompoundAssign): A new class used as a "flag" that
27563 the assignment actually is happening as part of a compound
27564 assignment operator.
27566 During compound assignment, a few new rules exist to enable things
27573 x op= y can be evaluated as x = (T) (x op y) (ie, an explicit cast
27574 to the type of x) if y is implicitly convertible to the type of x,
27575 and the operator is a builtin operator and the return type of the
27576 operator is explicitly convertible to the type of x.
27578 * rootcontext.cs: Reset warning level to 2. 4 catches various
27579 "interesting" features in mcs, we must clean this up at some
27580 point, but currently am trying to kill other bugs ;-)
27582 * ecore.cs (SimpleName.SimpleNameResolve): Perform member lookups
27583 in container classes as well.
27585 * expression.cs (Binary.ResolveOperator): Handle string case
27586 before anything else (as operator overloading does emit an error
27587 before doing anything else).
27589 This code could go away when we move to a table driven model, but
27590 i could not come up with a good plan last night.
27592 2002-04-30 Lawrence Pit <loz@cable.a2000.nl>
27594 * typemanager.cs (CSharpName): reimplementation using regex.
27595 * class.cs: added null check for fields in Emit
27596 * rootcontext.cs: set warninglevel to 4
27598 2002-04-29 Miguel de Icaza <miguel@ximian.com>
27600 * typemanager.cs (CSharpName): reimplemented with Lupus
27603 2002-04-28 Miguel de Icaza <miguel@ximian.com>
27605 * statement.cs (If): correclty implement Resolve, because we were
27606 not catching sem errors in there. The same process is needed
27608 (Return, StatementExpression, For, While, Do, Throw, Lock): Implement Resolve
27611 (Statement.Warning_DeadCodeFound): Factorize code.
27612 (While): Report dead code here too.
27614 (Statement): Added Resolve virtual method to allow
27615 for resolution split from the emit code.
27617 2002-04-26 Miguel de Icaza <miguel@ximian.com>
27619 * statement.cs (EmitBoolExpression): No longer try to resolve the
27621 (MakeBoolean): New utility function that resolve, implicitly
27622 converts to boolean and tags the expression.
27625 (If, Do): Implement dead code elimination.
27626 (While): Implement loop inversion
27628 (Do, While, For, If): Resolve the expression prior to calling our
27631 2002-04-22 Lawrence Pit <loz@cable.a2000.nl>
27634 - added method Report28 (warning: program has more than one entry point)
27635 - added method IsEntryPoint, implements paragraph 10.1 of the spec
27636 - modified method Method.Define, the part at the end of the method
27638 * rootcontext.cs: added static public Location EntryPointLocation;
27640 * ../errors/cs0028.cs : Add test case for the above warning.
27643 - modified method CSharpName to allow arrays of primitive type to
27644 be printed nicely (e.g. instead of System.Int32[][] it now prints
27646 - added method CSharpSignature: returns the signature of a method
27647 in string format to be used in reporting errors, warnings, etc.
27649 * support.cs: InternalParameters.ParameterDesc variable tmp initialized
27652 2002-04-26 Ravi Pratap <ravi@ximian.com>
27654 * delegate.cs (Define): Fix extremely silly bug where I was
27655 setting the type of the 'object' parameter of the BeginInvoke
27656 method to System.IAsyncResult instead of System.Object ;-)
27658 2002-04-26 Miguel de Icaza <miguel@ximian.com>
27660 * class.cs (ConstructorInitializer.Resolve): Also use DeclaredOnly
27663 (Constructor.Emit): return if we fail to initialize the
27664 constructor. Another door closed!
27666 * expression.cs (New.DoResolve): Improve error message (from -6 to
27667 1501). Use DeclaredOnly lookup to find the exact constructor.
27669 * typemanager.cs (MemberLookup): If DeclaredOnly is set, do not
27670 loop. This is useful.
27672 * cs-parser.jay: Adjust the default parameters so that destructors
27673 have the proper signature.
27675 2002-04-26 Martin Baulig <martin@gnome.org>
27677 * driver.cs (LoadAssembly): If `assembly' contains any characters
27678 which are only valid in path names and not in assembly names
27679 (currently slash, backslash and point), use Assembly.LoadFrom ()
27680 instead of Assembly.Load () on the `assembly' (before iteration
27681 over the link_paths).
27683 2002-04-26 Martin Baulig <martin@gnome.org>
27685 * cs-tokenizer.cs (is_hex): Correctly handle lowercase chars.
27687 2002-04-25 Miguel de Icaza <miguel@ximian.com>
27689 * class.cs (Property): use the new typemanager.MemberLookup
27691 (TypeContainer.MemberLookup): Implement using the
27692 TypeManager.MemberLookup now.
27694 * typemanager.cs: Make MemberLookup a function of the TypeManager,
27695 and return MemberInfos, so that these can be used without an
27696 EmitContext (what we had before).
27698 2002-04-24 Miguel de Icaza <miguel@ximian.com>
27700 * expression.cs: Fix the case where the argument to params if the
27701 type of the params. I omitted handling this before. Fixed
27703 2002-04-22 Miguel de Icaza <miguel@ximian.com>
27705 * driver.cs: Call BootCorlib_PopulateCoreType
27707 * class.cs (Property.CheckBase): Check for properties only, not
27710 * interface.cs: Temporary hack: try/catch around the
27711 CustomAttributeBuilder, because I am getting an exception that I
27714 * rootcontext.cs (BootCorlib_PopulateCoreType): Populate some
27715 types whose definitions are required to be there (attributes are
27716 defined before standard types).
27718 Compute definitions as we boot the various types, as they are used
27719 immediately (value_type class will need object_type, but if we do
27720 not initialize object_type, we will pass a null, which will let
27721 the runtime pick the System.Object from the existing corlib, which
27722 is not what we want).
27724 2002-04-22 Patrik Torstensson <totte@labs2.com>
27726 * cs-tokenizer.cs: fixed a number of trim() issues.
27728 2002-04-22 Ravi Pratap <ravi@ximian.com>
27730 * expression.cs (Argument.Type): Ensure that we return the correct
27731 type when we have out or ref parameters [in which case we
27734 2002-04-22 Miguel de Icaza <miguel@ximian.com>
27736 * class.cs (Property, Indexer): Allow extern modifier in there.
27738 * typemanager.cs (InitBaseTypes): Initializes object_type and
27739 value_type, since those will be used early on during the bootstrap
27740 process to compile corlib.
27742 (InitCoreTypes): Move code from here to InitBaseTypes.
27744 2002-04-21 Miguel de Icaza <miguel@ximian.com>
27746 * ecore.cs (PropertyExpr): Optimize calls to Array::get_Length on
27747 single-dimension arrays as using the ldlen opcode.
27749 Daniel Lewis discovered this optimization.
27751 * typemanager.cs: Add signature for System.Array::get_Length
27753 2002-04-20 Gonzalo Paniagua Javier <gonzalo@ximian.com>
27755 * statement.cs: report the error when the foreach does not apply to an
27756 array nor a collection.
27758 2002-04-19 Miguel de Icaza <miguel@ximian.com>
27760 * expression.cs: Add implicit conversions to the operator ~.
27762 * constant.cs (DecimalConstant.Emit): Emit decimal value.
27764 * typemanager.cs: Locate the decimal constructor.
27766 2002-04-17 Gonzalo Paniagua Javier <gonzalo@ximian.com>
27768 * attribute.cs: use the new property of TypeOf.
27769 * expression.cs: added 'get' property around typearg.
27771 These changes fix a build breaker reported by NickD. Is this the
27772 correct way to fix? If not, please, revert my changes and make it
27775 2002-04-17 Miguel de Icaza <miguel@ximian.com>
27777 * attribute.cs: Add support for typeof in attribute invocations.
27778 I am not sure that this is right though.
27780 2002-04-14 Duncan Mak <duncan@ximian.com>
27782 * cfold.cs (BinaryFold): Catch DivideByZeroException in the
27783 Binary.Operator.Division case.
27785 2002-04-13 Ravi Pratap <ravi@ximian.com>
27787 * class.cs (DefineType): Ensure that we do a proper check on
27788 attribute types and also register it with the TypeManager.
27790 (TypeContainer.Targets): The default for attribute types is
27791 AttributeTargets.All.
27793 * attribute.cs (ApplyAttributes): Registering the attribute type
27794 is done elsewhere, not when we discover we have a Usage attribute.
27796 2002-04-12 Ravi Pratap <ravi@ximian.com>
27798 * expression.cs (VerifyArgumentsCompat): Implement Miguel's suggestion
27799 and get rid of is_delegate parameter.
27801 * everywhere : update.
27803 2002-04-12 Ravi Pratap <ravi@ximian.com>
27805 * cs-parser.jay (compilation_unit): Revamp completely to use
27806 some new ideas that I got from Rhys' grammar to solve the problems
27807 with assembly level attributes.
27809 (outer_declaration): New grammar production.
27811 (attribute_sections): Add.
27813 (opt_attributes): Base on attribute_sections
27815 (namespace_declaration): Allow opt_attributes to tackle the case
27816 when we have assembly level attributes - we are clever in this
27819 * attribute.cs (ApplyAttributes): Do not worry about assembly
27820 attributes in the non-global context.
27822 * rootcontext.cs (AddGlobalAttributes): Go back to using this
27823 instead of SetGlobalAttributes.
27825 * class.cs, rootcontext.cs : Ensure we define and generate
27826 attribute types before anything else.
27828 * attribute.cs (CheckAttribute and GetValidPlaces): Handle the exception
27829 and flag the new error -20 for the case when the attribute type
27830 does not have valid targets specified. csc does not catch this.
27832 * ../errors/errors.txt : update for error # -20
27834 2002-04-11 Ravi Pratap <ravi@ximian.com>
27836 * support.cs (InternalParameters.ParameterModifier): Do some null
27837 checking and return sane values.
27839 * class.cs (Method.Define): If we are a PInvoke method, ensure
27840 that we are static and extern. Report error # 601
27842 * ../errors/cs0601.cs : Add test case for the above error.
27844 2002-04-07 Ravi Pratap <ravi@ximian.com>
27846 * rootcontext.cs (attribute_types): We need to keep type of
27847 all attribute types separately and emit code for them first.
27849 (RegisterAttribute) : Implement.
27851 * class.cs (DefineType): Check if the current Type is a custom
27852 attribute type and register it accordingly.
27854 * rootcontext.cs (AddGlobalAttributes): Fix silly bug where we were
27855 adding the first attribute twice and rename to
27857 (SetGlobalAttributes): this.
27859 * rootcontext.cs (NamespaceLookup): Run through the aliases too and perform
27862 * attribute.cs (ApplyAttributes): Take an additional argument telling us
27863 if we are processing global arguments. Hmm, I am unsure of this.
27865 2002-04-12 Gonzalo Paniagua Javier <gonzalo@ximian.com>
27867 * expression.cs: added static array of strings to avoid calling
27868 Enum.ToString () for Operator in Binary. Significant recover of
27871 2002-04-10 Miguel de Icaza <miguel@ximian.com>
27873 * class.cs (FindMembers): Allow the Builders of the various
27874 members to be null. If they are skip them. This only happens
27875 during the PInvoke declaration.
27877 2002-04-09 Miguel de Icaza <miguel@ximian.com>
27879 * parameter.cs (Parameters.ComputeParameterTypes): Flag the
27880 failure, so we do not keep going afterwards.
27882 * expression.cs: (Invocation.OverloadResolve): I believe Ravi
27883 wanted to pass `false' as the `is_delegate' argument. If this is
27884 the case, why not use delegate_type == null to mean `is_delegate =
27885 false' and anything else as is_delegate = true.
27887 Tue Apr 9 05:40:12 2002 Piers Haken <piersh@friskit.com>
27889 * statement.cs: fixed SimpleSwitchEmit to make 'goto case' goto the
27890 code for the section, not the beginning of the tests.
27892 2002-04-08 Miguel de Icaza <miguel@ximian.com>
27894 * cfold.cs: Handle operator + (Enum x, Underlying x)
27896 * expression.cs (Binary): same. Warn about errors where we have
27897 Enum/Enum in operator + as well.
27899 Mon Apr 8 06:29:03 2002 Piers Haken <piersh@friskit.com>
27902 - added support for switch(bool)
27903 - optimize loading of I8/U8 constants (ldc.i4, iconv_i8)
27904 - add TableSwitchEmit() to handle table-based switch statements
27906 2002-04-05 Ravi Pratap <ravi@ximian.com>
27908 * expression.cs (Invocation.OverloadResolve): Factor out code which
27909 does parameter compatibility checking with arguments so that we can
27910 re-use the code even from Delegate.VerifyApplicability
27912 (VerifyArgumentsCompat): Move above code here.
27914 * delegate.cs (VerifyApplicability): Get rid of duplicate code
27915 and instead make a call to the above method.
27917 2002-03-31 Ravi Pratap <ravi@ximian.com>
27919 * typemanager.cs (attribute_type): Corresponds to System.Attribute.
27920 We use it to keep track of classes which are attribute types.
27922 2002-04-02 Miguel de Icaza <miguel@ximian.com>
27924 * delegate.cs (Delegate.Define): Correctly define the types in the
27925 presence of fixed and array parameters.
27927 * class.cs (TypeContainers.FindMembers): Use NonPublic flag while
27930 * ecore.cs (Expression.MemberLookup): Reset binding flags to not
27931 include NonPublic after the first iteration.
27933 * class.cs (Indexer.CheckBase): Only check if both parents are
27936 * cs-parser.jay (accessor_body): If empty, set to null.
27938 * ecore.cs (SimpleName.SimpleNameResolve): We did not have the
27939 same code path here to resolve constants names that we did have in
27940 MemberAccess.DoResolve. There is too much code duplicated here.
27942 2002-04-01 Miguel de Icaza <miguel@ximian.com>
27944 * statement.cs, makefile: Drop Statementcollection and just use ArrayLists
27946 * ecore.cs: Optimize UserDefinedConversion by minimizing the calls
27949 * cs-tokenizer.cs: Reuse a single StringBuilder for assembling
27950 tokens, numbers and strings.
27952 * ecore.cs (MethodGroupExpr): Make Emit warn about missing
27955 * delegate.cs: Use ComputeAndDefineParameterTypes for both the
27956 asyncronous parameters and the regular parameters.
27958 * codegen.cs (CodeGen.Init): Use the constructor that allows us to
27959 specify the target directory.
27961 * expression.cs: (This.DoResolve): Simplify
27962 (As.Emit): Optimize, do not generate IsInst if the expression is
27963 always of the given type.
27965 (Is.DoResolve): Bug fix, we were reporting both always/never for
27968 * (Invocation.MakeUnionSet): Simplify vastly and optimize, we were
27969 creating too many unnecessary arrays.
27971 2002-03-31 Miguel de Icaza <miguel@ximian.com>
27973 * class.cs (EmitFieldInitializer): Use Assign expression to assign
27974 fields instead of rolling our own initializer. Takes care of all
27975 implicit conversions, and drops unnecessary static checks/argument.
27977 2002-03-31 Dick Porter <dick@ximian.com>
27979 * driver.cs: use the GetDirectories() return values properly, and
27980 use "/" as path separator.
27982 2002-03-30 Miguel de Icaza <miguel@ximian.com>
27984 * expression.cs (Unary): Optimize - - expr into expr.
27985 (Binary): Optimize a + (-b) into a -b.
27987 * codegen.cs (CodeGen): Made all methods static.
27989 2002-03-29 Miguel de Icaza <miguel@ximian.com>
27993 * decl.cs: Rename `definition' into `TypeBuilder' and drop the
27994 TypeBuilder property.
27996 * cs-parser.jay: Drop the use of RecordXXX and use RecordDecl
27999 * tree.cs: Removed the various RecordXXXX, and replaced with a
28000 single RecordDecl. Removed all the accessor methods, and just
28001 left a single access point Type
28003 * enum.cs: Rename DefineEnum to DefineType.
28005 * decl.cs: New abstract method `DefineType' used to unify the
28006 Defines for Enumerations, Interfaces, TypeContainers and
28009 (FindType): Moved LookupInterfaceOrClass here. Moved the
28010 LookupBaseClasses method that used to live in class.cs and
28011 interface.cs here, and renamed to FindType.
28013 * delegate.cs: Implement DefineType. Take advantage of the
28014 refactored pattern for locating the parent builder without taking
28015 the parent_builder argument (which we know does not work if we are
28016 nested, and triggering a toplevel definition).
28018 2002-03-28 Miguel de Icaza <miguel@ximian.com>
28020 * decl.cs (MemberCore.CheckMethodAgainstBase): Test if the
28021 accessibility of a member has changed during override and report
28024 * class.cs (Method.Define, Property.Define): Only complain on
28025 overrides if the method is private, any other accessibility is
28026 fine (and since we just checked the permission is the same, we are
28029 * cs-tokenizer.cs: only line, region, endregion, if, endif, else
28030 and elif are processed always. The other pre-processing
28031 directives are only processed if we are "taking" the path
28033 2002-03-29 Martin Baulig <martin@gnome.org>
28035 * class.cs (Method.Emit): Only emit symbolic debugging info if the
28036 current location is not Null.
28038 * codegen.cs (CodeGen.SaveSymbols): Split out symbol writing code into
28039 a separate method so we can profile it.
28041 * driver.cs (ShowTime): We need to use `(int) span.TotalSeconds' since
28042 `span.Seconds' are just seconds, but no minutes or hours.
28043 (MainDriver): Profile the CodeGen.SaveSymbols calls.
28045 2002-03-28 Miguel de Icaza <miguel@ximian.com>
28047 * class.cs (Method.Define), (Property.Define), (Indexer.Define):
28048 Remove the gratuitous set of Final:
28050 // If an interface implementation, then we can set Final.
28051 if (((flags & MethodAttributes.Abstract) == 0) &&
28052 implementing.DeclaringType.IsInterface)
28053 flags |= MethodAttributes.Final;
28055 I do not know what I was smoking when I used that.
28058 * cs-parser.jay, delegate.cs: Make Delegate be a DeclSpace, first
28059 step into fixing the name resolution issues for delegates and
28060 unifying the toplevel name resolution.
28062 2002-03-28 Martin Baulig <martin@gnome.org>
28064 * class.cs (Method.Emit): If we have a symbol writer, call its
28065 OpenMethod(), CloseMethod() and SetMethodSourceRange() methods to
28066 tell it about the current method.
28068 * codegen.cs (EmitContext.Mark): New public method. Tell the symbol
28069 writer that we're going to emit the first byte of IL code for a new
28070 statement (a new source line).
28071 (EmitContext.EmitTopBlock): If we have a symbol writer, call
28072 EmitContext.Mark() before emitting any code.
28074 * location.cs (SymbolDocument): Return null when we're Null.
28076 * statement.cs (Statement): Moved the `Location loc' variable here.
28077 (Statement.EmitBoolExpression): If we have a symbol writer, call
28078 ec.Mark() before emitting any code to tell it that we're at the
28079 beginning of a new statement.
28080 (StatementExpression): Added `Location' argument to the constructor.
28081 (Block): Added public readonly variable `StartLocation' and public
28082 variable `EndLocation'. The latter is to be set using SetEndLocation().
28083 (Block): Added constructor which takes a start and end location.
28084 (Block.SetEndLocation): New method. This sets the end location.
28085 (Block.EmitMeta): If we have a symbol writer, tell it the names of the
28086 local variables we create.
28087 (Block.Emit): If we have a symbol writer, call ec.Mark() before emitting
28088 each statement and do also mark the begin and end of the block.
28090 * cs-parser.jay (block : OPEN_BRACE): Use the new `Block' constructor to
28091 tell it the current lexer.Location, use Location.Null for the end of the
28093 (block : OPEN_BRACE opt_statement_list CLOSE_BRACE): When closing the
28094 current block, set its end location using SetEndLocation().
28095 (statement_expression): StatementExpression constructor now takes the
28096 lexer.Location as additional argument.
28097 (for_statement, declare_local_variables): Likewise.
28098 (declare_local_variables): When creating a new implicit block, use the
28099 new Block constructor and pass it the lexer.Location.
28101 2002-03-28 Miguel de Icaza <miguel@ximian.com>
28103 * ecore.cs (Expression.MemberLookup): On interfaces, lookup
28104 members also on the parent interfaces recursively.
28106 2002-03-27 Miguel de Icaza <miguel@ximian.com>
28108 * report.cs: Use new formats, since Gonzalo finished the missing
28111 * expression.cs (Binary.ResolveOperator): added missing operator|
28112 operator& and operator^ for bool/bool.
28114 * cs-parser.jay: CheckDef now takes a Location argument that is
28115 used to report errors more precisly (instead of reporting the end
28116 of a definition, we try to track something which is a lot closer
28117 to the source of the problem).
28119 * cs-tokenizer.cs: Track global token use, so we can properly flag
28120 the use of #define/#undef after the first token has been seen.
28122 Also, rename the reportXXXX to Error_DescriptiveName
28124 * decl.cs (DeclSpace.IsTopLevel): Move property here from
28125 TypeContainer, so that Enum and Interface can use this too.
28127 * class.cs (TypeContainer.LookupInterfaceOrClass,
28128 GetInterfaceOrClass, GetClassBases, DefineType): Drop the
28129 `builder' argument. Typically this was used to pass the parent
28130 builder (a ModuleBuilder or a TypeBuilder from whoever triggered
28133 The problem is that a nested class could trigger the definition of
28134 a toplevel class, and the builder would be obviously wrong in that
28137 So we drop this argument, and we compute dynamically the
28138 TypeBuilder/ModuleBuilder (the correct information was available
28139 to us anyways from DeclSpace.Parent)
28141 * interface.cs (Interface.DefineInterface): Drop builder
28142 parameter cleanup like class.cs
28144 * enum.cs (Enum.DefineEnum): Drop builder parameter. Clean up
28147 * statement.cs (Switch.EmitObjectInteger): Emit short/ushort
28150 (Try.Emit): Propagate the returns value from the statement.
28152 (Return.Emit): Even if we are leavning
28154 * driver.cs: Catch IOExpcetion for Directory.GetFiles as well.
28156 * modifiers.cs: Fix the computation of MethodAttributes flags.
28158 Tue Mar 26 21:14:36 CET 2002 Paolo Molaro <lupus@ximian.com>
28160 * driver.cs: allow compilation of files that start with '/'.
28161 Add a default case when checking the argument of --target.
28163 2002-03-25 Miguel de Icaza <miguel@ximian.com>
28165 * interface.cs: Implement the same search algorithm for types in
28166 the interface code.
28168 * delegate.cs: Do not allow multiple definition.
28170 * Recovered ChangeLog that got accidentally amputated
28172 * interface.cs (Interface.DefineInterface): Prevent from double definitions.
28174 * rootcontext.cs: Load manually enum to allow core classes to
28175 contain enumerations.
28177 * enum.cs, ecore.cs, driver.cs, attribute.cs, class.cs, expression.cs:
28178 Update to new static methods in TypeManager.
28180 * typemanager.cs (GetMethod, GetConstructor): Use our
28181 implementation of FindMembers to find the members, since during
28182 corlib compilation, the types are TypeBuilders and GetMethod and
28183 GetConstructor do not work.
28185 Make all methods in TypeManager static.
28187 (InitCodeHelpers): Split the functionality from
28188 the InitCodeTypes function.
28190 * driver.cs: Call InitCodeHelpers after we have populated the
28193 * cs-parser.jay (delegate_declaration): we did not used to compute
28194 the delegate name correctly for void delegates.
28196 2002-03-24 Miguel de Icaza <miguel@ximian.com>
28198 * rootcontext.cs (RootContext): Init the interface_resolve_order
28199 and type_container_resolve_order always.
28201 (ResolveCore, BootstrapCorlib_ResolveClass,
28202 BootstrapCorlib_ResolveStruct): New functions to bootstrap the
28203 compiler when compiling with --nostdlib
28205 * class.cs (TypeContainer.DefineType): Check that our parent is
28206 not null. This test is most important when we are bootstraping
28209 * codegen.cs: Split out the symbol writing code.
28211 2002-03-25 Martin Baulig <martin@gnome.org>
28213 * driver.cs (-g): Made -g an alias for --debug.
28215 2002-03-24 Martin Baulig <martin@gnome.org>
28217 * codegen.cs (SymbolWriter): New public variable. Returns the
28218 current symbol writer.
28219 (CodeGen): Added `bool want_debugging_support' argument to the
28220 constructor. If true, tell the ModuleBuild that we want debugging
28221 support and ask it for the ISymbolWriter.
28222 (Save): If we have a symbol writer, call it's Close() method after
28223 saving the assembly.
28225 * driver.c (--debug): New command line argument to create a
28226 debugger information file.
28228 * location.cs (SymbolDocument): New public property. Returns an
28229 ISymbolDocumentWriter object for the current source file or null
28230 if we don't have a symbol writer.
28232 2002-03-21 Miguel de Icaza <miguel@ximian.com>
28234 * driver.cs (LoadAssembly): Correctly return when all the paths
28235 have been tried and not before.
28237 * statement.cs (Switch.Emit): return the actual coverage for this
28238 statement (returns/not-returns)
28240 (Switch.SimpleSwitchEmit): Do not generate jumps to the end of the
28241 switch of the statement if we are the last switch section. That
28242 kills two problems: try/catch problems (we used to emit an empty
28243 nop at the end) and switch statements where all branches would
28246 2002-03-19 Miguel de Icaza <miguel@ximian.com>
28248 * driver.cs: Add default assemblies (the equivalent to the
28249 Microsoft CSC.RSP file)
28251 * cs-tokenizer.cs: When updating `cols and setting it to zero,
28252 also update tokens_seen and set it to false.
28254 * driver.cs: Implement --recurse for Mike.
28256 * driver.cs (SplitPathAndPattern): Small bug fix, I was not
28257 correctly splitting out the paths.
28259 2002-03-18 Miguel de Icaza <miguel@ximian.com>
28261 * interface.cs (Interface.PopulateProperty): Instead of using
28262 `parent' as the declaration space for the set parameters, use
28265 * support.cs (InternalParameters): InternalParameters constructor
28266 takes a DeclSpace instead of a TypeContainer.
28268 * expression.cs (ArrayCreation.EmitDynamicInitializers): If value
28269 types are being initialized, load the address of it before calling
28272 (New): Provide a mechanism to disable the generation of local
28273 value type temporaries when the caller will be providing us with
28274 an address to store it.
28276 (ArrayCreation.EmitDynamicInitializers): Use it.
28278 2002-03-17 Miguel de Icaza <miguel@ximian.com>
28280 * expression.cs (Invocation.EmitArguments): Only probe for array
28281 property if there is more than one argument. Sorry about that.
28283 * class.cs (Invocation.EmitArguments): Fix to emit arguments for
28284 empty param arrays.
28286 * class.cs (Method.LabelParameters): Fix incorrect code path that
28287 prevented the `ParamArrayAttribute' from being applied to the
28290 2002-03-16 Miguel de Icaza <miguel@ximian.com>
28292 * support.cs (ReflectionParameters): Correctly compute whether the
28293 last argument is a params array. Fixes the problem with
28296 * typemanager.cs: Make the assemblies array always be non-null
28297 (empty, but non-null)
28299 * tree.cs (RecordDecl): New function that abstracts the recording
28300 of names. This reports error 101, and provides a pointer to the
28301 previous declaration. Fixes a crash in the compiler.
28303 * cs-parser.jay (constructor_declaration): Update to new grammar,
28304 and provide a constructor_body that can be empty.
28306 2002-03-15 Miguel de Icaza <miguel@ximian.com>
28308 * driver.cs: Add support for --resources.
28310 * expression.cs: (FetchGetMethod, FetchAddressMethod, EmitAssign):
28311 Make all types for the various array helper methods be integer.
28313 * ecore.cs (Expression.ConvertNumericExplicit): Pass the
28314 CheckState to ConvCast.
28316 (ConvCast): Now it takes a `checked' state argument, to avoid
28317 depending on the emit context for the conversion, and just using
28318 the resolve time setting.
28320 * expression.cs (ArrayCreation.EmitArrayArguments): New function,
28321 instead of Invocation.EmitArguments. We do not emit the original
28322 arguments, instead we emit those which have been converted to
28323 unsigned int expressions.
28325 * statement.cs (Block.EmitMeta): Drop tracking of indexes.
28327 * codegen.cs: ditto.
28329 * expression.cs (LocalVariableReference): Drop the use of the
28330 Store function that depended on the variable index.
28332 * statement.cs (VariableInfo): Drop the `Idx' property from this
28333 class, as this is not taking into account the indexes for
28334 temporaries tat we generate during the execution, getting the
28337 * class.cs: First emit class initializers, then call the parent
28340 * expression.cs (Binary): Fix opcode emision.
28341 (UnaryMutator.EmitCode): Support checked code generation
28343 * ecore.cs (MemberLookup): TypeManager.FindMembers will return
28344 matches for events for both the Static and Instance scans,
28345 pointing to the same element. Fix that.
28347 2002-03-14 Miguel de Icaza <miguel@ximian.com>
28349 * rootcontext.cs (ResolveTree): Always set the
28350 interface_resolve_order, because nested interfaces will be calling
28353 * class.cs (GetInterfaceOrClass): Track the same resolution
28354 process used by TypeManager.LookupType. This fixes the nested
28355 type lookups in class declarations (separate path from
28358 (TypeContainer.DefineType): Also define nested interfaces.
28359 (TypeContainer.RegisterOrder): New public function used to
28360 register the order in which child interfaces need to be closed.
28362 Nested interfaces need to be closed after their parents have been
28365 * interface.cs (InterfaceAttr): Put all the logic for computing
28366 the interface attribute here.
28368 (DefineInterface): Register our interface order with the
28369 RootContext or with the TypeContainer depending on the case.
28371 2002-03-12 Miguel de Icaza <miguel@ximian.com>
28373 * cs-parser.jay: rework foreach statement to work with the new
28374 changes to the policy on SimpleNames.
28376 * report.cs: support Stacktrace on warnings as well.
28378 * makefile: drop --unsafe and /unsafe from the compile.
28380 2002-03-13 Ravi Pratap <ravi@ximian.com>
28382 * ecore.cs (StandardConversionExists): Modify to take an Expression
28383 as the first parameter. Ensure we do null -> reference type conversion
28386 * Everywhere : update calls accordingly, making use of MyEmptyExpr to store
28387 temporary Expression objects.
28389 Wed Mar 13 12:32:40 CET 2002 Paolo Molaro <lupus@ximian.com>
28391 * interface.cs: workaround bug in method overloading resolution
28392 (there is already a bugzilla bug for it).
28394 2002-03-12 Miguel de Icaza <miguel@ximian.com>
28396 We could also solve this problem by having a separate path for
28397 performing type lookups, instead of DoResolve, we could have a
28398 ResolveType entry point, and only participating pieces of the
28399 production (simplename, deref, array) would implement this.
28401 * codegen.cs (EmitContext): New field OnlyLookupTypes used to
28402 signal SimpleName to only resolve type names and not attempt to
28403 resolve anything else.
28405 * expression.cs (Cast): Set the flag.
28407 * ecore.cs (SimpleName): Use the OnlyLookupTypes flag
28409 * class.cs: Only report 108 if there is no `new' modifier.
28411 * cs-parser.jay: rework foreach statement to work with the new
28412 changes to the policy on SimpleNames.
28414 * report.cs: support Stacktrace on warnings as well.
28416 * makefile: drop --unsafe and /unsafe from the compile.
28418 2002-03-11 Miguel de Icaza <miguel@ximian.com>
28420 * ecore.cs (SimpleName.SimpleNameResolve): Perform local variable
28421 lookups here, instead of doing that at parse time. This means
28422 that our grammar will not introduce `LocalVariableReferences' as
28423 expressions at this point. That solves the problem of code like
28427 static void Main ()
28431 This is only half the fix. The full fix requires parameters to
28432 also be handled in this way.
28434 * Everywhere: Use ec.DeclSpace on calls to LookupType, as this
28435 makes the use more obvious of the DeclSpace. The
28436 ec.TypeContainer.TypeBuilder is now only used to pull the
28437 TypeBuilder for it.
28439 My theory is that I can get rid of the TypeBuilder completely from
28440 the EmitContext, and have typecasts where it is used (from
28441 DeclSpace to where it matters).
28443 The only pending problem is that the code that implements Aliases
28444 is on TypeContainer, and probably should go in DeclSpace.
28446 * ecore.cs (SimpleName.SimpleNameResolve): Perform local variable
28447 lookups here, instead of doing that at parse time. This means
28448 that our grammar will not introduce `LocalVariableReferences' as
28449 expressions at this point. That solves the problem of code like
28453 static void Main ()
28457 This is only half the fix. The full fix requires parameters to
28458 also be handled in this way.
28460 * class.cs (Property.DefineMethod): When implementing an interface
28461 method, set newslot, when implementing an abstract method, do not
28462 set the flag (before we tried never setting it, or always setting
28463 it, which is the difference).
28464 (Indexer.DefineMethod): same.
28465 (Method.DefineMethod): same.
28467 * ecore.cs: Only set the status used flag if we get back a Field.
28469 * attribute.cs: Temporary hack, so Paolo can keep working.
28471 2002-03-08 Ravi Pratap <ravi@ximian.com>
28473 * attribute.cs (Attribute.UnmanagedType): This is to keep track of
28474 the unmanaged type in the case we have a MarshalAs attribute.
28476 (Resolve): Handle the case when we are parsing the special MarshalAs
28477 attribute [we need to store the unmanaged type to use later]
28479 * typemanager.cs (marshal_as_attr_type): Built in type for the
28480 MarshalAs Attribute.
28482 * attribute.cs (ApplyAttributes): Recognize the MarshalAs attribute
28483 on parameters and accordingly set the marshalling info.
28485 2002-03-09 Miguel de Icaza <miguel@ximian.com>
28487 * class.cs: Optimizing slightly by removing redundant code after
28488 we switched to the `NoTypes' return value.
28489 (Property.DefineMethod): use NoTypes here too.
28491 This fixes the bug I introduced in my last batch of changes.
28493 2002-03-05 Ravi Pratap <ravi@ximian.com>
28495 * tree.cs (RecordEnum): Add. We now keep track of enums too.
28497 * class.cs (LookupInterfaceOrClass): Check against the list of recorded
28498 Enums since those are types too.
28500 * cs-parser.jay (enum_declaration): Record enums as we parse them.
28502 * enum.cs (DefineEnum): Return if the TypeBuilder has already been defined
28503 thanks to a call during the lookup process.
28505 2002-03-07 Miguel de Icaza <miguel@ximian.com>
28507 * statement.cs (Foreach): Lots of work to accomodate a particular
28508 kind of foreach statement that I had not kept in mind. It is
28509 possible to have foreachs on classes that provide a GetEnumerator
28510 method that return objects that implement the "pattern" for using
28511 a foreach, there is no need to support GetEnumerator
28514 This is needed to compile nant.
28516 * decl.cs: Only report 114 if the member is not `Finalize' and if
28517 the warning level is at least 2.
28519 * class.cs: Moved the compare function from Method to
28522 (MethodSignature.InheritableMemberSignatureCompare): Add new
28523 filter function that is used to extract inheritable methods from a
28526 (Method.Define): Use the new `inheritable_method_signature_filter'
28529 * cs-tokenizer.cs (get_cmd_arg): Do not add white space to the
28532 2002-03-06 Miguel de Icaza <miguel@ximian.com>
28534 * ecore.cs (Expression.ConvertReferenceExplicit): Removed dead code.
28536 * cs-parser.jay: Add opt_semicolon to the interface declaration.
28538 * expression.cs: Pass location information to
28539 ConvertImplicitStandard.
28541 * class.cs: Added debugging code to track return values from
28544 2002-03-05 Miguel de Icaza <miguel@ximian.com>
28546 * expression.cs (Is.DoResolve): If either side of the `is' is an
28547 interface, do not flag the warning.
28549 * ecore.cs (ImplicitReferenceConversion): We need a separate test
28552 * report.cs: Allow for --fatal to be used with --probe.
28554 * typemanager.cs (NoTypes): Move the definition for the empty Type
28557 * class.cs (TypeContainer.FindMembers): Also look for methods defined by
28559 (TypeContainer.DefineProxy): New function used to proxy to parent
28560 implementations when implementing interfaces.
28561 (TypeContainer.ParentImplements): used to lookup if our parent
28562 implements a public function that is required by an interface.
28563 (TypeContainer.VerifyPendingMethods): Hook this up.
28565 * typemanager.cs (TypeManager, AddModule, AddAssembly): Make the
28566 `modules' and `assemblies' arraylists into arrays. We only grow
28567 these are the very early start up of the program, so this improves
28568 the speedof LookupType (nicely measured).
28570 * expression.cs (MakeByteBlob): Replaced unsafe code with
28571 BitConverter, as suggested by Paolo.
28573 * cfold.cs (ConstantFold.Binary): Special case: perform constant
28574 folding of string concatenation, but if either side is a string,
28575 and the other is not, then return null, and let the runtime use
28576 the concatenation on the string plus the object (using
28577 `Object.ToString').
28579 2002-03-04 Miguel de Icaza <miguel@ximian.com>
28581 Constant Folding has been implemented now.
28583 * expression.cs (Unary.Reduce): Do not throw an exception, catch
28584 the error instead on types that are not supported in one's
28587 * constant.cs (Constant and all children): New set of functions to
28588 perform implict and explicit conversions.
28590 * ecore.cs (EnumConstant): Implement the new functions to perform
28591 conversion by proxying to the child expression.
28593 * codegen.cs: (ConstantCheckState): Constant evaluation has its
28594 own separate setting that can not be turned off from the command
28595 line using --unchecked or --checked and is only controlled using
28596 the checked/unchecked statements and expressions. This setting is
28597 used by the constant folder to flag errors.
28599 * expression.cs (CheckedExpr, UncheckedExpr): Set the
28600 ConstantCheckState as well.
28602 During Resolve, they also have to flag the state, because the
28603 constant folder runs completely in the Resolve phase.
28605 * statement.cs (Checked, Unchecked): Set the ConstantCheckState as
28608 2002-03-01 Miguel de Icaza <miguel@ximian.com>
28610 * cfold.cs: New file, this file contains the constant folder.
28612 * ecore.cs (IMemoryLocation.AddressOf): Now takes an extra
28613 argument to track whether we are using the resulting address to
28614 load or store a value and provide better error messages.
28616 (FieldExpr.Emit, FieldExpr.EmitAssign, FieldExpr.AddressOf): Use
28617 new AddressOf arguments.
28619 * statement.cs (Foreach.EmitCollectionForeach): Update
28621 * expression.cs (Argument.Emit): Call AddressOf with proper
28622 arguments to track usage.
28624 (New.DoEmit): Call AddressOf with new arguments.
28626 (Unary.Emit): Adjust AddressOf call.
28628 2002-03-01 Ravi Pratap <ravi@ximian.com>
28630 * cs-parser.jay (member_access): Change the case for pre-defined types
28631 to use a MemberAccess instead of a SimpleName. Thanks to Felix again for
28634 * class.cs (Operator::Emit): If we are abstract or extern, we don't have
28637 * attribute.cs (CheckAttribute, ApplyAttribute): Ensure that we treat operators
28638 essentially like methods and apply attributes like MethodImplOptions to them too.
28640 * ecore.cs (SimpleName.SimpleNameResolve): Perform a check on ec.TypeContainer.TypeBuilder
28643 * codegen.cs (EmitContext): The constructor now takes in an extra argument specifying the
28644 DeclSpace as the distinction is important. We provide sane defaults as usually the TypeContainer
28647 * Update code everywhere accordingly.
28649 * ecore.cs : Change references to ec.TypeContainer to ec.DeclSpace where appropriate.
28651 * cs-parser.jay (enum_declaration): Set the current namespace of the enum.
28653 2002-02-28 Ravi Pratap <ravi@ximian.com>
28655 * rootcontext.cs (LookupType): As we cycle through the chain of namespaces
28656 try performing lookups against those instead of jumping straight into using
28657 the 'using' clauses.
28659 (ImplicitParent): Add. Thanks to Felix Arrese-Igor for this idea.
28661 (LookupType): Perform lookups in implicit parents too.
28663 * class.cs (GetInterfaceOrClass): Modify to perform the exact same lookup
28664 sequence as RootContext.LookupType.
28666 * rootcontext.cs (NamespaceLookup): Split out code from LookupType which tries
28667 the various cases of namespace lookups into this method.
28669 2002-03-01 Miguel de Icaza <miguel@ximian.com>
28671 * cs-parser.jay: Add support for [Attribute ()] (empty arguments
28672 in positional arguments)
28674 * class.cs (Operator): Update the AllowedModifiers to contain
28677 * cs-parser.jay: Update operator declaration to allow for the
28678 operator body to be empty.
28680 * cs-tokenizer.cs: Added '\u' unicode support in strings and hex
28683 2002-02-27 Miguel de Icaza <miguel@ximian.com>
28685 * class.cs (Method.Emit): Label parameters.
28687 * driver.cs: Return 1 or 0 as the program exit code.
28689 2002-02-26 Miguel de Icaza <miguel@ximian.com>
28691 * expression.cs: Special case the `null' object when trying to
28692 auto-compute the type, as anything can be explicitly converted to
28695 * ecore.cs (Expression.ConvertExplicit): Bug fix, thanks for
28696 spotting this Paolo.
28698 (Expression.ImplicitNumericConversion): Perform comparissions of
28699 the type using the underlying type in the case of an enumeration
28700 rather than using the enumeration type for the compare.
28702 Cope with the underlying == type case, which is not possible to
28705 (Expression.ConvertNumericExplicit): Perform comparissions of
28706 the type using the underlying type in the case of an enumeration
28707 rather than using the enumeration type for the compare.
28709 * driver.cs: If the user does not supply an extension, assume .exe
28711 * cs-parser.jay (if_statement): Rewrote so that we can track the
28712 location for the if statement.
28714 * expression.cs (Binary.ConstantFold): Only concat strings when
28715 the operation is "+", not everything ;-)
28717 * statement.cs (Statement.EmitBoolExpression): Take a location
28719 (If, While, Do): Track location.
28721 * expression.cs (Binary.ResolveOperator): In the object + string
28722 case, I was missing a call to ConvertImplicit
28724 2002-02-25 Ravi Pratap <ravi@ximian.com>
28726 * parameter.cs (Parameter.ExternalType): Take in extra DeclSpace and
28727 Location arguments. Ensure we use RootContext.LookupType to do our work
28728 and not try to do a direct Type.GetType and ModuleBuilder.GetType
28730 * interface.cs (PopulateMethod): Handle the type of the parameter being
28733 * expression.cs (Invocation.BetterFunction): Handle the case when we
28734 have a params method with no fixed arguments and a call is made with no
28737 2002-02-25 Miguel de Icaza <miguel@ximian.com>
28739 * cs-tokenizer.cs: Add support for the quote-escape-sequence in
28740 the verbatim-string-literal
28742 * support.cs (InternalParameters.ParameterModifier): handle null
28744 (InternalParameters.ParameterType): ditto.
28746 * parameter.cs (VerifyArgs): Also check if the fixed parameter is
28747 duplicating the name of the variable parameter.
28748 (GetParameterByName): Fix bug where we were not looking up array
28749 paramters if they were the only present (thanks Paolo!).
28750 (GetParameterInfo): We only have an empty set of types if both
28751 fixed and array are set to null.
28752 (GetParameterInfo-idx): Handle FixedParameter == null
28754 * cs-parser.jay: Handle the case where there is no catch
28755 statements (missing null test).
28757 2002-02-22 Miguel de Icaza <miguel@ximian.com>
28759 * driver.cs (MainDriver): Be conservative on our command line
28762 Catch DirectoryNotFoundException when calling GetFiles.
28764 (SplitPathAndPattern): Used to split the input specification into
28765 a path and a pattern that we can feed to Directory.GetFiles.
28767 2002-02-21 Miguel de Icaza <miguel@ximian.com>
28769 * statement.cs (Fixed): Implement the last case of the Fixed
28770 statement (string handling).
28772 * expression.cs (StringPtr): New class used to return a char * to
28773 a string; Used by the Fixed statement.
28775 * typemanager.cs: Add char_ptr_type. Add get_OffsetToStringData method.
28777 * expression.cs (Binary.ResolveOperator): Remove redundant
28778 MemberLookup pn parent type.
28779 Optimize union call, we do not need a union if the types are the same.
28780 (Unary.ResolveOperator): REmove redundant MemberLookup on parent
28783 Specialize the use of MemberLookup everywhere, instead of using
28784 the default settings.
28786 (StackAlloc): Implement stackalloc keyword.
28788 * cs-parser.jay: Add rule to parse stackalloc.
28790 * driver.cs: Handle /h, /help, /?
28792 * expression.cs (MakeByteBlob): Removed the hacks we had in place
28793 before we supported unsafe code.
28795 * makefile: add --unsafe to the self compilation of mcs.
28797 2002-02-20 Miguel de Icaza <miguel@ximian.com>
28799 * expression.cs (PointerArithmetic): New class that is used to
28800 perform pointer arithmetic.
28801 (Binary.Resolve): Handle pointer arithmetic
28802 Handle pointer comparission.
28803 (ArrayPtr): Utility expression class that is used to take the
28804 address of an array.
28806 (ElementAccess): Implement array access for pointers
28808 * statement.cs (Fixed): Implement fixed statement for arrays, we
28809 are missing one more case before we are done.
28811 * expression.cs (Indirection): Implement EmitAssign and set the
28812 ExprClass to Variable. This allows pointer dereferences to be
28813 treated as variables, and to have values assigned to them.
28815 * ecore.cs (Expression.StoreFromPtr): New utility function to
28816 store values dereferencing.
28818 2002-02-20 Ravi Pratap <ravi@ximian.com>
28820 * expression.cs (Binary.ResolveOperator): Ensure that we are
28821 not trying to operate on a void type - this fixes the reported
28824 * decl.cs (CheckMethodAgainstBase): Do not allow overriding if
28825 the parent implementation is sealed.
28827 * ../errors/cs0239.cs : Add.
28829 * attribute.cs (ApplyAttributes): Handle Modulebuilders too.
28831 * typemanager.cs (unverifiable_code_type): Corresponds to
28832 System.Security.UnverifiableCodeAttribute. We need to emit this for modules
28833 which have unsafe code in them.
28835 * rootcontext.cs (EmitCode): Emit the above attribute when we are in an
28838 2002-02-19 Miguel de Icaza <miguel@ximian.com>
28840 * cs-tokenizer.cs: Add support for @"litreal strings"
28842 Make tokenizer accept pre-processor directives
28843 on any column (remove the old C-like limitation).
28845 * rootcontext.cs (EmitCode): Emit any global attributes.
28846 (AddGlobalAttributes): Used to keep track of assembly attributes.
28848 * attribute.cs (ApplyAttributes): Support AssemblyAttributes.
28850 * cs-parser.jay: Add support for global attributes.
28852 2002-02-17 Miguel de Icaza <miguel@ximian.com>
28854 * expression.cs (Indirection): New helper class. Unary will
28855 create Indirection classes to be able to implement the
28856 IMemoryLocation interface on it.
28858 2002-02-16 Miguel de Icaza <miguel@ximian.com>
28860 * cs-parser.jay (fixed_statement): reference the right statement.
28862 * statement.cs (Fixed.Emit): Finish implementing the fixed
28863 statement for the &x case.
28865 2002-02-14 Miguel de Icaza <miguel@ximian.com>
28867 * class.cs (Property.Define, Method.Define): Remove newslot when
28870 * modifiers.cs: My use of NewSlot when `Abstract' was set was
28871 wrong. NewSlot should only be used if the `new' keyword is present.
28873 * driver.cs (GetSystemDir): Use CodeBase instead of FullName for
28874 locating our system dir. Sorry about this.
28876 2002-02-13 Miguel de Icaza <miguel@ximian.com>
28878 * driver.cs (GetSystemDir): Compute correctly the location of our
28879 system assemblies. I was using the compiler directory instead of
28880 the library directory.
28882 2002-02-13 Ravi Pratap <ravi@ximian.com>
28884 * expression.cs (BetterFunction): Put back in what Miguel commented out
28885 since it is the correct fix. The problem is elsewhere ;-)
28887 (IsParamsMethodApplicable): Fix bug where we were not checking that the fixed
28888 parameters of the parms method are themselves compatible or not !
28890 (StandardConversionExists): Fix very dangerous bug where we were forgetting
28891 to check that a class implements an interface before saying that an implicit
28892 conversion was allowed. Use ImplementsInterface to do the checking.
28894 2002-02-13 Miguel de Icaza <miguel@ximian.com>
28896 * class.cs (Method.Define): Track whether we are an explicit
28897 implementation or not. And only call DefineMethodOverride if we
28898 are an explicit implementation.
28900 (Property.DefineMethod): Ditto.
28902 2002-02-11 Ravi Pratap <ravi@ximian.com>
28904 * expression.cs (BetterFunction): Catch hideous bug which was
28905 preventing us from detecting ambiguous calls due to implicit casts i.e
28908 2002-01-29 Miguel de Icaza <miguel@ximian.com>
28910 * support.cs (Pair): Remove un-needed method. I figured why I was
28911 getting the error in cs-parser.jay, the variable in a foreach loop
28912 is readonly, and the compiler does not really treat this as a variable.
28914 * cs-parser.jay (fixed_statement): Fix grammar. Use ASSIGN
28915 instead of EQUALS in grammar.
28917 * typemanager.cs (VerifyUnmanaged): Report correct error (208)
28919 * expression.cs (Unary.DoResolve): Check whether the argument is
28922 2002-01-28 Miguel de Icaza <miguel@ximian.com>
28924 * support.cs: Api for Pair to set a value. Despite the fact that
28925 the variables are public the MS C# compiler refuses to compile
28926 code that accesses the field if the variable is part of a foreach
28929 * statement.cs (Fixed): Begin implementation of the fixed
28932 (Block.AddVariable): Return the VariableInfo on success and null
28933 on failure instead of true/false.
28935 * cs-parser.jay (foreach): Catch errors on variables already
28936 defined (we were ignoring this value before) and properly unwind
28937 the block hierarchy
28939 (fixed_statement): grammar for the fixed statement.
28941 2002-01-25 Miguel de Icaza <miguel@ximian.com>
28943 * expression.cs (UnaryMutator.IsIncrementableNumber): Allow also
28944 pointer types to be incretemented.
28946 (SizeOf): Implement.
28948 * cs-parser.jay (pointer_member_access): Implement
28949 expr->IDENTIFIER production.
28951 * expression.cs (IndexerAccess.DoResolve, ArrayAccess.DoResolve,
28952 MemberAccess.DoResolve, Invocation.DoResolve): Check for pointers
28955 (Unary): Implement indirection.
28957 * ecore.cs (Expression.UnsafeError): Reports error 214 (pointer
28958 use in non-unsafe context).
28960 (SimpleName.DoResolve): Check for pointers in field access on safe
28963 (Expression.LoadFromPtr): Factor the load-indirect code in this
28964 function. This was duplicated in UnboxCast and ParameterReference
28966 2002-01-24 Miguel de Icaza <miguel@ximian.com>
28968 * expression.cs (ComposedCast): report an error if a pointer cast
28969 is used in a safe region.
28971 * ecore.cs (Expression.ConvertExplicit): Add rules for implicit
28972 pointer type casts in unsafe context.
28974 * codegen.cs (EmitContext): Set up IsUnsafe.
28976 * cs-parser.jay (non_expression_type): Add productions for pointer
28979 * expression.cs (Invocation.EmitCall): Remove chunk of buggy
28980 code. We should not use force into static mode if the method is
28981 not virtual. Fixes bug in MIS
28983 * statement.cs (Do.Emit, While.Emit, For.Emit,
28984 Statement.EmitBoolExpression): Add support to Do and While to
28985 propagate infinite loop as `I do return' semantics.
28987 Improve the For case to also test for boolean constants.
28989 * attribute.cs (Attribute.ApplyAttributes): Add ParameterBuilder
28990 to the list of attributes we can add.
28992 Remove `EmitContext' argument.
28994 * class.cs (Method.Define): Apply parameter attributes.
28995 (Constructor.Define): Apply parameter attributes.
28996 (MethodCore.LabelParameters): Move here the core of labeling
28999 * support.cs (ReflectionParameters.ParameterModifier,
29000 InternalParameters.ParameterModifier): Use IsByRef on the type and
29001 only return the OUT bit for these parameters instead of in/out/ref
29004 This is because I miss-understood things. The ParameterInfo.IsIn
29005 and IsOut represent whether the parameter has the [In] and [Out]
29008 2002-01-22 Miguel de Icaza <miguel@ximian.com>
29010 * ecore.cs (FieldExpr.Emit): Release temporaries.
29012 * assign.cs (LocalTemporary.Release): new function.
29014 * codegen.cs (EmitContext.GetTemporaryStorage,
29015 EmitContext.FreeTemporaryStorage): Rework the way we deal with
29016 temporary storage. Now we can "put back" localbuilders when we
29019 2002-01-21 Miguel de Icaza <miguel@ximian.com>
29021 * ecore.cs (FieldExpr.Emit): Handle initonly fields specially: we
29022 need to make a copy of the variable to generate verifiable code.
29024 2002-01-19 Miguel de Icaza <miguel@ximian.com>
29026 * driver.cs: Compute dynamically the system directory.
29028 * ecore.cs (CopyNewMethods): reworked, exposed, made public.
29029 Slower, but more generally useful. Used by the abstract
29030 registering implementation.
29032 * expression.cs (ResolveMemberAccess): Reorder the way we evaluate
29033 the rules for the special rule on Type/instances. First check if
29034 we have the same name, and if so, try that special static path
29035 rather than the instance path.
29037 2002-01-18 Miguel de Icaza <miguel@ximian.com>
29039 * cs-parser.jay: Emit 642 (warning: possible empty statement) for
29042 * class.cs (TypeBuilder.DefineType): Do not allow inheritance from
29043 Enum, ValueType, Delegate or Array for non-corlib compiles.
29045 * cs-tokenizer.cs: Catch long identifiers (645)
29047 * typemanager.cs (IndexerPropetyName): Ravi never tested this
29050 * class.cs (TypeContainer.RegisterRequiredImplementations): Bug
29051 fix, we were returning too early, so we were not registering
29052 pending methods from abstract classes.
29054 Do not register pending methods if the class is abstract.
29056 * expression.cs (Conditional.DoResolve): Report circular implicit
29057 conversions when we neecd to compute it for conditional
29060 (Is.DoResolve): If the expression is always of the provided type,
29061 flag warning 183. If the expression can not ever be of the
29062 provided type flag warning 184.
29064 * class.cs: Catch 169 as well.
29066 * ecore.cs (FieldExpr): For now in AddressOf mark as assigned and
29069 2002-01-18 Nick Drochak <ndrochak@gol.com>
29071 * makefile: remove path to beta2 csc.exe. path to csc.exe must be in PATH instead.
29073 2002-01-17 Miguel de Icaza <miguel@ximian.com>
29075 * interface.cs: (PopulateMethod): Check for pointers being defined
29076 only if the unsafe context is active.
29077 (PopulateProperty): ditto.
29078 (PopulateIndexer): ditto.
29080 * class.cs (Method, Method.Define): Allow `unsafe' modifier to be
29081 specified. If pointers are present, make sure that they are
29082 present in an unsafe context.
29083 (Constructor, Constructor.Define): ditto.
29084 (Field, Field.Define): ditto.
29085 (Property, Property.Define): ditto.
29086 (Event, Event.Define): ditto.
29088 * interface.cs (Interface.GetInterfaceTypeByName): Only lookup the
29089 hashtable if there are classes or structs defined.
29091 * expression.cs (LocalVariableReference.DoResolve): Simplify this
29092 code, as the constant resolution moved.
29094 * statement.cs (Block.EmitMeta): Resolve all constants as we emit
29095 the metadata, so we can flag error 133.
29097 * decl.cs (MemberCore.UnsafeOK): New function to test that a
29098 pointer is being declared in an unsafe context.
29100 2002-01-16 Miguel de Icaza <miguel@ximian.com>
29102 * modifiers.cs (Modifiers.Check): Require a Location argument.
29103 Report error 227 for Unsafe use.
29105 * typemanager.cs: Remove IsPointerType, we should be using Type.IsPointer
29107 * statement.cs (For.Emit): If the test is null, then report that
29108 we do `return', as we wont reach anything afterwards.
29110 (Switch.SwitchGoverningType): Track the expression that matched
29113 * driver.cs: Allow negative numbers as an error code to flag.
29115 * cs-parser.jay: Handle 1551.
29117 * namespace.cs: Add 1537 checking (repeated using alias namespaces).
29119 2002-01-15 Miguel de Icaza <miguel@ximian.com>
29121 * cs-parser.jay: Report 1518 (type declaration can only contain
29122 class, struct, interface, enum or delegate)
29124 (switch_label): Report 1523 (keywords `case' or `default' must
29127 (opt_switch_sections): Report 1522 (empty switch)
29129 * driver.cs: Report 1515 (response file specified multiple times)
29130 Report 1516 (Source file specified multiple times).
29132 * expression.cs (Argument.Resolve): Signal 1510
29134 (BaseAccess.Resolve, BaseIndexer.Resolve): Signal 1511 (base
29135 access not allowed in static code)
29137 2002-01-11 Ravi Pratap <ravi@ximian.com>
29139 * typemanager.cs (IsPointerType): Utility method which we are going
29142 * ecore.cs (ImplicitReferenceConversion): A pointer type cannot be cast to
29143 the object type, so we take care of that.
29145 * expression.cs (FullMethodDesc): Also include the return type in descriptions.
29147 * support.cs (ParameterDesc): Fix minor bug which was causing params tags to be
29148 added to non-params parameters :-)
29150 * typemanager.cs (CSharpName): Include 'void' type too.
29152 (void_ptr_type): Include in the set of core types.
29154 * ecore.cs (ConvertImplicit): Make use of ConvertImplicitStandard instead of
29157 (ConvertImplicitStandard): Handle standard implicit pointer conversions when we have
29160 * cs-parser.jay (local_variable_pointer_type): Add support for 'void *' as I had
29161 completely forgotten about it.
29163 2002-01-10 Ravi Pratap <ravi@ximian.com>
29165 * cs-parser.jay (pointer_type): Add. This begins our implementation
29166 of parsing rules for unsafe code.
29168 (unsafe_statement): Implement.
29170 (embedded_statement): Modify to include the above.
29172 * statement.cs (Unsafe): Implement new class for unsafe blocks.
29174 * codegen.cs (EmitContext.InUnsafe): Add. This determines
29175 if the current context is an unsafe one.
29177 * cs-parser.jay (local_variable_pointer_type): Since local variable types
29178 are handled differently, we need separate rules for them.
29180 (local_variable_declaration): Update to use local_variable_pointer_type
29181 to allow variable declarations of unmanaged pointer types.
29183 * expression.cs (Unary.ResolveOperator): Ensure that the '&' operator is used only
29184 in unsafe contexts.
29186 * ../errors/cs0214.cs : Add.
29188 2002-01-16 Nick Drochak <ndrochak@gol.com>
29190 * makefile: remove 'response' file when cleaning.
29192 2002-01-15 Miguel de Icaza <miguel@ximian.com>
29194 * cs-parser.jay: Report 1524.
29196 2002-01-14 Miguel de Icaza <miguel@ximian.com>
29198 * typemanager.cs (RegisterMethod): drop checking if we have
29199 registered this from here
29201 2002-01-12 Miguel de Icaza <miguel@ximian.com>
29203 * class.cs (Method.EmitDestructor): Implement calling our base
29206 * statement.cs (Try.Emit): Fix to reset the InFinally to the old
29207 value of InFinally.
29209 * codegen.cs (EmitContext.EmitTopBlock): Destructors will call
29210 this routine and will wrap the call in a try/catch block. Deal
29213 2002-01-11 Miguel de Icaza <miguel@ximian.com>
29215 * ecore.cs (Expression.MemberLookup): instead of taking a
29216 parameter `same_type' that was used to tell whether we could
29217 access private members we compute our containing type from the
29220 (FieldExpr): Added partial support for volatile fields. This does
29221 not work for volatile fields exposed from assemblies, as I can not
29222 figure out how to extract the modreq from it.
29224 Updated all the source files to use this.
29226 * codegen.cs (EmitContext): Compute ContainerType ahead of time,
29227 because it is referenced by MemberLookup very often.
29229 2002-01-09 Ravi Pratap <ravi@ximian.com>
29231 * typemanager.cs (IndexerPropertyName): If we have a TypeBuilder, use
29232 TypeBuilder.GetCustomAttributes to retrieve what we need.
29234 Get rid of redundant default_member_attr_type as this is the same as
29235 default_member_type which already exists.
29237 * interface.cs, attribute.cs : Update accordingly.
29239 2002-01-08 Miguel de Icaza <miguel@ximian.com>
29241 * typemanager.cs: Enable IndexerPropertyName again. It does not
29242 work for TYpeBuilders though. Ravi, can you please fix this?
29244 * cs-tokenizer.cs: Accept _ as a name in pp-expressions.
29246 * expression.cs (Argument.Emit): Handle the case of ref objects
29247 being passed to ref functions;
29249 (ParameterReference.EmitLoad): Loads the content of the pointer
29250 without dereferencing.
29252 2002-01-07 Miguel de Icaza <miguel@ximian.com>
29254 * cs-tokenizer.cs: Implemented the pre-processing expressions.
29256 2002-01-08 Ravi Pratap <ravi@ximian.com>
29258 * class.cs (Indexer.DefineMethod): Incorporate the interface
29259 type in the name of the method if we are doing explicit interface
29262 * expression.cs (ConversionExists): Remove as it is completely obsolete.
29264 (BetterConversion): Fix extremely trivial bug where we were referring to
29265 ConversionExists instead of StandardConversionExists ! Hooray, things are fine
29268 * ../errors/bug16.cs : Add although we have fixed it.
29270 2002-01-07 Miguel de Icaza <miguel@ximian.com>
29272 * expression.cs (BaseIndexer): Begin implementation.
29274 * class.cs (TypeContainer.IsInterfaceMethod): Bug fix.
29276 * cs-parser.jay (indexer_declarator): Use qualified_identifier
29277 production directly to remove a shift/reduce, and implement
29278 explicit interface implementation.
29280 * cs-tokenizer.cs: Fix tokenizer, it was consuming one extra char
29281 after a floating point suffix.
29283 * expression.cs (DoNumericPromotions): Improved the conversion for
29284 uint/uint. If we have a constant, we avoid doing a typecast to a
29287 * class.cs (Indexer): Implement explicit interface implementation
29290 Sat Jan 5 16:08:23 CET 2002 Paolo Molaro <lupus@ximian.com>
29292 * class.cs: make the default instance constructor public and hidebysig.
29294 2001-01-03 Ravi Pratap <ravi@ximian.com>
29296 * interface.cs (EmitDefaultMemberAttr): Make this helper method static
29297 so we can call it from elsewhere.
29299 * class.cs (TypeContainer.Emit): Emit the attribute here too. The rule is that
29300 we emit it internally if the class has a defined indexer; otherwise the user
29301 emits it by decorating the class definition with the DefaultMemberAttribute.
29303 * attribute.cs (ApplyAttributes): Perform checks to see that the DefaultMember
29304 attribute is not used on a type which defines an indexer.
29306 * cs-tokenizer.cs (get_cmd_arg): Ensure we trim whitespace and also include the tab
29307 character when we skip whitespace.
29309 * ../errors/cs0646.cs : Add.
29311 2002-01-03 Miguel de Icaza <miguel@ximian.com>
29313 * ecore.cs (SimpleName.ResolveSimpleName): Report error 120
29316 * makefile: Add practical target `mcs3.exe' which builds the third
29317 generation compiler.
29319 * expression.cs (New): Fix structures constructor calling.
29321 * class.cs (Property, Method, Indexer): Emit Final flag on the
29322 method if we are an interface implementation and we are not
29325 * ecore.cs (PropertyExpr): New public field `IsBase', tells
29326 whether this property is referencing a `base' method.
29328 * expression.cs (Invocation.EmitCall): take an extra argument:
29329 is_base, this is used to determine whether the `call' or
29330 `callvirt' opcode should be used.
29333 * delegate.cs: update EmitCall.
29335 * class.cs (Method.Define): Set NewSlot for the cases where we are
29336 not implementing an interface method.
29338 (Property.Define): ditto.
29340 2002-01-02 Miguel de Icaza <miguel@ximian.com>
29342 * cs-tokenizer.cs: (Tokenizer.escape): Escape '\r' as '\r' not as
29343 'r'. Allows mcs to parse itself fully.
29345 2002-01-02 Ravi Pratap <ravi@ximian.com>
29347 * expression.cs (ArrayCreation.num_automatic_initializers): Keep track
29348 of the number of initializers that require the InitializeArray method.
29350 (CheckIndices): Store the Expression in all cases - not the plain value. Also
29351 update the above field where necessary.
29353 (MakeByteBlob): Update accordingly.
29355 (DoEmit): Call EmitStaticInitializers only if the number of initializers is
29358 (EmitDynamicInitializers): Update in accordance with the new optimization.
29360 (ArrayAccess.EmitStoreOpcode): Include char type along with short and ushort - the
29361 same OpCode applies.
29363 * cs-parser.jay : Fix some glaring errors I introduced.
29365 2002-01-01 Ravi Pratap <ravi@ximian.com>
29367 * parameters.cs (AddVariable, AddConstant): Pass in current_local_parameters
29368 so that we can check for name clashes there too.
29370 * typemanager.cs (default_member_attr_type): The attribute that we need to emit
29371 for interface indexers.
29373 * interfaces.cs (Define): Emit the default member attribute.
29375 * expression.cs (MakeByteBlob): Fix extremely trivial bug where the wrong
29376 variable was being referred to while setting the value ;-)
29378 2002-01-01 Miguel de Icaza <miguel@ximian.com>
29380 * expression.cs (MakeByteBlob): Optimize: we do not need to fill
29381 byte-by-byte information when we know the data is zero.
29383 Make the block always a multiple of 4, because
29384 DefineInitializedData has a bug.
29386 * assign.cs: Fix, we should assign from the temporary, not from
29389 * expression.cs (MakeByteBlob): Fix my incorrect code.
29391 2001-12-31 Miguel de Icaza <miguel@ximian.com>
29393 * typemanager.cs (EnumToUnderlying): This function is used to get
29394 the underlying type from an enumeration, because it does not
29397 * constant.cs: Use the I4_S form for values between -128 and 127.
29399 * statement.cs (Block.LookupLabel): Looks up a label.
29400 (Block): Drop support for labeled blocks.
29402 (LabeledStatement): New kind of statement that represents a label
29405 (Goto): Finally implement this bad boy.
29407 * cs-parser.jay: Update to reflect new mechanism to implement
29410 2001-12-30 Miguel de Icaza <miguel@ximian.com>
29412 * codegen.cs (EmitContext.This): a codegen property that keeps the
29413 a single instance of this instead of creating many different this
29416 * delegate.cs (Delegate.DoResolve): Update to use the property;
29418 * ecore.cs (SimpleName.SimpleNameResolve): Ditto
29420 * expression.cs (BaseAccess.DoResolve): Ditto.
29422 2001-12-29 Ravi Pratap <ravi@ximian.com>
29424 * typemanager.cs (methodimpl_attr_type): Add to hold the type
29425 corresponding to System.Runtime.CompilerServices.MethodImplAttribute.
29427 (InitCoreTypes): Update accordingly.
29429 * attribute.cs (Resolve): Remember if the attribute is a MethodImplAttribute
29430 so we can quickly store the state.
29432 (ApplyAttributes): Set the correct implementation flags
29433 for InternalCall methods.
29435 2001-12-29 Miguel de Icaza <miguel@ximian.com>
29437 * expression.cs (EmitCall): if a method is not virtual, then do
29438 not use callvirt on it.
29440 (ArrayAccess.EmitAssign): storing non-builtin value types (ie,
29441 user defined stuff) requires the use of stobj, which takes an
29442 address on the stack instead of an array and an index. So emit
29443 the Ldelema operation for it.
29445 (EmitStoreOpcode): Use stobj for valuetypes.
29447 (UnaryMutator.EmitCode): Use the right 1 value depending on
29448 whether we are dealing with int64/uint64, float or doubles.
29450 * class.cs (TypeContainer.AddConstructor): Fix the logic to define
29451 constructors that I implemented last night.
29453 (Constructor.IsDefault): Fix to work properly for static
29456 * cs-parser.jay (CheckDef): report method signature errors.
29457 Update error number 103 to be 132.
29459 * decl.cs: New AdditionResult enumeration value: MethodExists.
29460 Although we do this check for methods later on in the semantic
29461 analysis, catching repeated default constructors is so easy that
29462 we catch these here.
29464 * expression.cs (Binary.DoNumericPromotions): Fix the uint64 type
29467 (ParameterReference.EmitAssign, Emit): handle
29470 (ArrayAccess.EmitLoadOpcode): Handle bool type here.
29471 (ArrayAccess.EmitStoreOpcode): ditto.
29473 * cs-tokenizer.cs (is_punct): Eliminated empty computation.
29475 * expression.cs (MakeByteBlob): Complete all the missing types
29476 (uint, short, ushort, byte, sbyte)
29478 * class.cs: Only init instance field initializers on instance
29481 Rename `constructors' to instance_constructors.
29483 (TypeContainer.AddConstructor): Only add constructors to the list
29484 if it is not static.
29486 Make sure that we handle default_static_constructor independently
29487 everywhere where we handle instance_constructors
29489 2001-12-28 Miguel de Icaza <miguel@ximian.com>
29491 * class.cs: Do not lookup or create a base initializer for a
29492 static constructor.
29494 (ConstructorInitializer.Resolve): use the proper type to lookup
29497 * cs-parser.jay: Report error 1585 (modifiers between type and name).
29499 * enum.cs, interface.cs: Remove CloseType, this is taken care by
29502 * decl.cs: CloseType is now an virtual method, the default
29503 implementation just closes this type.
29505 2001-12-28 Ravi Pratap <ravi@ximian.com>
29507 * attribute.cs (DefinePInvokeMethod): Set the implementation flags
29508 to PreserveSig by default. Also emit HideBySig on such methods.
29510 Basically, set the defaults to standard values.
29512 * expression.cs (Invocation.BetterFunction): We need to make sure that for each
29513 argument, if candidate is better, it can't be worse than the best !
29515 (Invocation): Re-write bits to differentiate between methods being
29516 applicable in their expanded form and their normal form - for params
29519 Get rid of use_standard everywhere as only standard conversions are allowed
29520 in overload resolution.
29522 More spec conformance.
29524 2001-12-27 Miguel de Icaza <miguel@ximian.com>
29526 * driver.cs: Add --timestamp, to see where the compiler spends
29529 * ecore.cs (SimpleName.DoResolve): Do not create an implicit
29530 `this' in static code.
29532 (SimpleName.DoResolve): Implement in terms of a helper function
29533 that allows static-references to be passed upstream to
29536 (Expression.ResolveWithSimpleName): Resolve specially simple
29537 names when called by MemberAccess to implement the special
29540 (Expression.ImplicitReferenceConversion): Handle conversions from
29541 Null to reference types before others, as Null's type is
29544 * expression.cs (Invocation.EmitCall): Handle the special case of
29545 calling methods declared on a reference type from a ValueType
29546 (Base classes System.Object and System.Enum)
29548 (MemberAccess.Resolve): Only perform lookups on Enumerations if
29549 the left hand side is a TypeExpr, not on every enumeration.
29551 (Binary.Resolve): If types are reference types, then do a cast to
29552 object on operators != and == of both arguments.
29554 * typemanager.cs (FindMembers): Extract instance and static
29555 members if requested.
29557 * interface.cs (PopulateProperty): Use void_type instead of null
29558 as the return type for the setter method.
29560 (PopulateIndexer): ditto.
29562 2001-12-27 Ravi Pratap <ravi@ximian.com>
29564 * support.cs (ReflectionParameters): Fix minor bug where we
29565 were examining the wrong parameter for the ParamArray attribute.
29567 Cope with requests for the type of the parameter at position
29568 greater than the params parameter's. We now return the element
29569 type of the params array as that makes more sense.
29571 * expression.cs (Invocation.IsParamsMethodApplicable): Update
29572 accordingly as we no longer have to extract the element type
29575 (Invocation.OverloadResolve): Update.
29577 2001-12-27 Miguel de Icaza <miguel@ximian.com>
29579 * statement.cs (Foreach.GetEnumeratorFilter): Do not compare
29580 against IEnumerator, test whether the return value is a descendant
29581 of the IEnumerator interface.
29583 * class.cs (Indexer.Define): Use an auxiliary method to implement
29584 the other bits of the method definition. Begin support for
29585 explicit interface implementation.
29587 (Property.DefineMethod): Use TypeManager.void_type instead of null
29588 for an empty return value.
29590 2001-12-26 Miguel de Icaza <miguel@ximian.com>
29592 * expression.cs (MemberAccess.ResolveMemberAccess): if we are
29593 dealing with a FieldExpr which is composed of a FieldBuilder, in
29594 the code path we did extract the constant, but we should have
29595 obtained the underlying value to be able to cast it (otherwise we
29596 end up in an infinite loop, this is what Ravi was running into).
29598 (ArrayCreation.UpdateIndices): Arrays might be empty.
29600 (MemberAccess.ResolveMemberAccess): Add support for section
29601 14.5.4.1 that deals with the special case of E.I when E is a type
29602 and something else, that I can be a reference to a static member.
29604 (ArrayCreation.MakeByteBlob): It is not an error to not be able to
29605 handle a particular array type to create byte blobs, it is just
29606 something we dont generate byteblobs for.
29608 * cs-tokenizer.cs (get_cmd_arg): Ignore \r in commands and
29611 * location.cs (Push): remove the key from the hashtable that we
29612 are about to add. This happens for empty files.
29614 * driver.cs: Dispose files after we have parsed them.
29616 (tokenize): new function that only runs the tokenizer on its
29617 input, for speed testing.
29619 2001-12-26 Ravi Pratap <ravi@ximian.com>
29621 * class.cs (Event.Define): Define the private field only if there
29622 are no accessors defined.
29624 * expression.cs (ResolveMemberAccess): If there is no associated
29625 field with the event, that means we have an event defined with its
29626 own accessors and we should flag error cs0070 since transforming
29627 ourselves into a field is not valid in that case.
29629 * ecore.cs (SimpleName.DoResolve): Same as above.
29631 * attribute.cs (DefinePInvokeMethod): Set the default calling convention
29632 and charset to sane values.
29634 2001-12-25 Ravi Pratap <ravi@ximian.com>
29636 * assign.cs (DoResolve): Perform check on events only if they
29637 are being accessed outside the declaring type.
29639 * cs-parser.jay (event_declarations): Update rules to correctly
29640 set the type of the implicit parameter etc.
29642 (add_accessor, remove_accessor): Set current local parameters.
29644 * expression.cs (Binary): For delegate addition and subtraction,
29645 cast the return value from the method into the appropriate delegate
29648 2001-12-24 Ravi Pratap <ravi@ximian.com>
29650 * typemanager.cs (RegisterDelegateData, GetDelegateData): Get rid
29651 of these as the workaround is unnecessary.
29653 * delegate.cs (NewDelegate.DoResolve): Get rid of bits which registered
29654 delegate data - none of that is needed at all.
29656 Re-write bits to extract the instance expression and the delegate method
29659 * expression.cs (Binary.ResolveOperator): Handle the '-' binary operator
29662 * attribute.cs (ApplyAttributes): New method to take care of common tasks
29663 of attaching attributes instead of duplicating code everywhere.
29665 * everywhere : Update code to do attribute emission using the above method.
29667 2001-12-23 Miguel de Icaza <miguel@ximian.com>
29669 * expression.cs (IsParamsMethodApplicable): if there are not
29670 parameters, return immediately.
29672 * ecore.cs: The 0 literal can be implicity converted to an enum
29675 (SimpleName.DoResolve): First lookup the type, then lookup the
29678 (FieldExpr.Emit): If the InstanceExpression is a ValueType, we
29679 want to get its address. If the InstanceExpression is not
29680 addressable, store the result in a temporary variable, then get
29683 * codegen.cs: Only display 219 errors on warning level or above.
29685 * expression.cs (ArrayAccess): Make it implement the
29686 IMemoryLocation interface.
29688 (Binary.DoResolve): handle the operator == (object a, object b)
29689 and operator != (object a, object b) without incurring into a
29690 BoxedCast (because 5 != o should never be performed).
29692 Handle binary enumerator operators.
29694 (EmitLoadOpcode): Use Ldelema if the object we are loading is a
29695 value type, otherwise use Ldelem_ref.
29697 Use precomputed names;
29699 (AddressOf): Implement address of
29701 * cs-parser.jay (labeled_statement): Fix recursive block
29702 addition by reworking the production.
29704 * expression.cs (New.DoEmit): New has a special case:
29706 If we are dealing with a ValueType, we have a few
29707 situations to deal with:
29709 * The target of New is a ValueType variable, that is
29710 easy, we just pass this as the variable reference
29712 * The target of New is being passed as an argument,
29713 to a boxing operation or a function that takes a
29716 In this case, we need to create a temporary variable
29717 that is the argument of New.
29720 2001-12-23 Ravi Pratap <ravi@ximian.com>
29722 * rootcontext.cs (LookupType): Check that current_type is not null before
29723 going about looking at nested types.
29725 * ecore.cs (EventExpr.EmitAddOrRemove): Rename from EmitAssign as we do
29726 not implement the IAssignMethod interface any more.
29728 * expression.cs (MemberAccess.ResolveMemberAccess): Handle EventExprs specially
29729 where we tranform them into FieldExprs if they are being resolved from within
29730 the declaring type.
29732 * ecore.cs (SimpleName.DoResolve): Do the same here.
29734 * assign.cs (DoResolve, Emit): Clean up code considerably.
29736 * ../errors/bug10.cs : Add.
29738 * ../errors/cs0070.cs : Add.
29740 * typemanager.cs : Use PtrHashtable for Delegate data hashtable etc.
29742 * assign.cs : Get rid of EventIsLocal everywhere.
29744 2001-12-23 Miguel de Icaza <miguel@ximian.com>
29746 * ecore.cs (ConvertIntLiteral): finished the implementation.
29748 * statement.cs (SwitchLabel): Convert the value we are using as a
29749 key before looking up the table.
29751 2001-12-22 Miguel de Icaza <miguel@ximian.com>
29753 * codegen.cs (EmitTopBlock): Require a Location argument now.
29755 * cs-parser.jay (constructor_declarator): We need to setup
29756 current_local_parameters before we parse the
29757 opt_constructor_initializer, to allow the variables to be bound
29758 to the constructor arguments.
29760 * rootcontext.cs (LookupType): First lookup nested classes in our
29761 class and our parents before we go looking outside our class.
29763 * expression.cs (ConstantFold): Extract/debox the values at the
29766 * rootcontext.cs (EmitCode): Resolve the constants first before we
29767 resolve the types. This is not really needed, but it helps debugging.
29769 * statement.cs: report location.
29771 * cs-parser.jay: pass location to throw statement.
29773 * driver.cs: Small bug fix.
29775 * report.cs: Updated format to be 4-zero filled digits.
29777 2001-12-22 Ravi Pratap <ravi@ximian.com>
29779 * expression.cs (CheckIndices): Fix minor bug where the wrong
29780 variable was being referred to ;-)
29782 (DoEmit): Do not call EmitStaticInitializers when the
29783 underlying type is System.Object.
29785 2001-12-21 Ravi Pratap <ravi@ximian.com>
29787 * ecore.cs (EventExpr.Resolve): Implement to correctly set the type
29788 and do the usual workaround for SRE.
29790 * class.cs (MyEventBuilder.EventType): New member to get at the type
29791 of the event, quickly.
29793 * expression.cs (Binary.ResolveOperator): Handle delegate addition.
29795 * assign.cs (Assign.DoResolve): Handle the case when the target
29796 is an EventExpr and perform the necessary checks.
29798 * ecore.cs (EventExpr.EmitAssign): Implement the IAssignMethod
29801 (SimpleName.MemberStaticCheck): Include check for EventExpr.
29803 (EventExpr): Set the type in the constructor itself since we
29804 are meant to be born fully resolved.
29806 (EventExpr.Define): Revert code I wrote earlier.
29808 * delegate.cs (NewDelegate.Resolve): Handle the case when the MethodGroup's
29809 instance expression is null. The instance expression is a This in that case
29810 or a null, depending on whether it is a static method or not.
29812 Also flag an error if the reference to a method is ambiguous i.e the MethodGroupExpr
29813 refers to more than one method.
29815 * assign.cs (DoResolve): Check whether the event belongs to the same Type container
29816 and accordingly flag errors.
29818 2001-12-21 Miguel de Icaza <miguel@ximian.com>
29820 * statement.cs (Throw.Emit): Add support for re-throwing exceptions.
29822 2001-12-22 Miguel de Icaza <miguel@ximian.com>
29824 * location.cs (ToString): Provide useful rutine.
29826 2001-12-21 Miguel de Icaza <miguel@ximian.com>
29828 * ecore.cs (Expression.ConvertIntLiteral): Do not return Constant
29829 objects, return the actual integral boxed.
29831 * statement.cs (SwitchLabel): define an ILLabel for each
29834 (Switch.CheckSwitch): If the value is a Literal, extract
29835 the underlying literal.
29837 Also in the unused hashtable we had, add the SwitchLabel so we can
29838 quickly look this value up.
29840 * constant.cs: Implement a bunch of new constants. Rewrite
29841 Literal based on this. Made changes everywhere to adapt to this.
29843 * expression.cs (Expression.MakeByteBlob): Optimize routine by
29844 dereferencing array only once, and also copes with enumrations.
29846 bytes are two bytes wide, not one.
29848 (Cast): Perform constant conversions.
29850 * ecore.cs (TryImplicitIntConversion): Return literals instead of
29851 wrappers to the literals here.
29853 * expression.cs (DoNumericPromotions): long literals can converted
29854 to ulong implicity (this is taken care of elsewhere, but I was
29855 missing this spot).
29857 * ecore.cs (Expression.Literalize): Make the return type Literal,
29858 to improve type checking.
29860 * rootcontext.cs: Lookup for nested classes in our class hierarchy.
29862 2001-12-20 Miguel de Icaza <miguel@ximian.com>
29864 * literal.cs: Revert code from ravi that checked the bounds. The
29865 bounds are sane by the definition of the type itself.
29867 * typemanager.cs: Fix implementation of ImplementsInterface. We
29868 need to actually look up in our parent hierarchy for interfaces
29871 * const.cs: Use the underlying type for enumerations
29873 * delegate.cs: Compute the basename for the delegate creation,
29874 that should fix the delegate test case, and restore the correct
29875 Type Lookup semantics in rootcontext
29877 * rootcontext.cs: Revert Ravi's last patch. The correct way of
29878 referencing a nested type with the Reflection API is using the "+"
29881 * cs-parser.jay: Do not require EOF token at the end.
29883 2001-12-20 Ravi Pratap <ravi@ximian.com>
29885 * rootcontext.cs (LookupType): Concatenate type names with
29886 a '.' instead of a '+' The test suite passes again.
29888 * enum.cs (Enum.DefineEnum): Set RTSpecialName on the 'value__'
29889 field of the enumeration.
29891 * expression.cs (MemberAccess.ResolveMemberAccess): Add support for
29892 the case when the member is an EventExpr.
29894 * ecore.cs (EventExpr.InstanceExpression): Every event which is not
29895 static has an associated instance expression.
29897 * typemanager.cs (RegisterEvent): The usual workaround, now for events.
29899 (GetAddMethod, GetRemoveMethod): Workarounds, as usual.
29901 * class.cs (Event.Define): Register event and perform appropriate checks
29904 We define the Add and Remove methods even if the use provides none because
29905 in that case, we provide default implementations ourselves.
29907 Define a private field of the type of the event. This is done by the CSC compiler
29908 and we should be doing it too ;-)
29910 * typemanager.cs (delegate_combine_delegate_delegate, delegate_remove_delegate_delegate):
29911 More methods we use in code we generate.
29913 (multicast_delegate_type, delegate_type): Two separate types since the distinction
29916 (InitCoreTypes): Update accordingly for the above.
29918 * class.cs (Event.Emit): Generate code for default accessors that we provide
29920 (EmitDefaultMethod): Do the job in the above.
29922 * delegate.cs (DefineDelegate): Use TypeManager.multicast_delegate_type in the
29925 2001-12-20 Miguel de Icaza <miguel@ximian.com>
29927 * class.cs (Indexer.Define): Fix bug, we were setting both Get/Set
29928 builders even if we were missing one.
29930 * interface.cs, class.cs, enum.cs: When calling DefineNestedType
29931 pass the Basename as our class name instead of the Name. The
29932 basename will be correctly composed for us.
29934 * parameter.cs (Paramters): Now takes a Location argument.
29936 * decl.cs (DeclSpace.LookupType): Removed convenience function and
29937 make all the code call directly LookupType in RootContext and take
29938 this chance to pass the Location information everywhere.
29940 * Everywhere: pass Location information.
29942 2001-12-19 Miguel de Icaza <miguel@ximian.com>
29944 * class.cs (Constructor.Define): Updated way of detecting the
29945 length of the parameters.
29947 (TypeContainer.DefineType): Use basename as the type name for
29950 (TypeContainer.Define): Do not recursively define types here, as
29951 definition is taken care in order by the RootContext.
29953 * tree.cs: Keep track of namespaces in a per-file basis.
29955 * parameter.cs (Parameter.ComputeSignature): Update to use
29958 (Parameters.GetSignature): ditto.
29960 * interface.cs (InterfaceMethod.GetSignature): Take a DeclSpace
29961 instead of a TypeContainer.
29963 (Interface.SemanticAnalysis): Use `this' instead of our parent to
29964 resolve names. Because we need to be resolve in our context, not
29967 * driver.cs: Implement response files.
29969 * class.cs (TypeContainer.DefineType): If we are defined, do not
29970 redefine ourselves.
29972 (Event.Emit): Emit the code for add/remove handlers.
29973 (Event.Define): Save the MethodBuilders for add/remove.
29975 * typemanager.cs: Use pair here too.
29977 * cs-parser.jay: Replaced use of DictionaryEntry for Pair because
29978 DictionaryEntry requires the first argument to be non-null.
29980 (enum_declaration): Compute full name for registering the
29983 (delegate_declaration): Instead of using
29984 formal_parameter_list, use opt_formal_parameter_list as the list
29987 * cs-tokenizer.cs (PropertyParsing): renamed from `properties'
29988 (EventParsing): New property that controls whether `add' and
29989 `remove' are returned as tokens or identifiers (for events);
29991 2001-12-19 Ravi Pratap <ravi@ximian.com>
29993 * class.cs (Event.Define): Revamp use of EventBuilder completely. We now
29994 use MyEventBuilder only and let it wrap the real builder for us.
29996 (MyEventBuilder): Revamp constructor etc.
29998 Implement all operations that we perform on EventBuilder in precisely the same
30001 (FindMembers): Update to use the EventBuilder member.
30003 (Event.Emit): Update accordingly.
30005 2001-12-18 Ravi Pratap <ravi@ximian.com>
30007 * class.cs (MyEventBuilder.Set*): Chain to the underlying builder
30008 by calling the appropriate methods.
30010 (GetCustomAttributes): Make stubs as they cannot possibly do anything
30013 (Event.Emit): Use MyEventBuilder everywhere - even to set attributes.
30015 2001-12-17 Ravi Pratap <ravi@ximian.com>
30017 * delegate.cs (Delegate.Populate): Check that the return type
30018 and various parameters types are indeed accessible.
30020 * class.cs (Constructor.Define): Same here.
30022 (Field.Define): Ditto.
30024 (Event.Define): Ditto.
30026 (Operator.Define): Check that the underlying Method defined itself
30027 correctly - so it's MethodBuilder should not be null.
30029 * delegate.cs (DelegateInvocation.DoResolve): Bale out if the type of the Instance
30030 expression happens to be null.
30032 * class.cs (MyEventBuilder): Workaround for SRE lameness. Implement various abstract
30033 members but as of now we don't seem to be able to do anything really useful with it.
30035 (FindMembers): Handle events separately by returning the MyEventBuilder of the event,
30036 not the EventBuilder.
30038 2001-12-18 Miguel de Icaza <miguel@ximian.com>
30040 * cs-tokenizer.cs: Add support for defines.
30041 Add support for #if, #elif, #else, #endif
30043 (eval_var): evaluates a variable.
30044 (eval): stubbed for evaluating functions.
30046 * cs-parser.jay: Pass the defines information
30048 * driver.cs: Add --define command line option.
30050 * decl.cs: Move MemberCore here.
30052 Make it the base class for DeclSpace. This allows us to catch and
30053 report 108 and 109 for everything now.
30055 * class.cs (TypeContainer.Define): Extract all the members
30056 before populating and emit the warning 108 (new keyword required
30057 to override) instead of having each member implement this.
30059 (MemberCore.Define): New abstract method, we will be using this in
30060 the warning reporting engine in Populate.
30062 (Operator.Define): Adjust to new MemberCore protocol.
30064 * const.cs (Const): This does not derive from Expression, it is a
30065 temporary object we use to create fields, it is a MemberCore.
30067 * class.cs (Method.Define): Allow the entry point to be in a
30070 * driver.cs: Rewrite the argument handler to clean it up a bit.
30072 * rootcontext.cs: Made it just an auxiliary namespace feature by
30073 making everything static.
30075 * driver.cs: Adapt code to use RootContext type name instead of
30078 * delegate.cs: Remove RootContext argument.
30080 * class.cs: (Struct, TypeContainer, Class): Remove RootContext
30083 * class.cs (Event.Define): The lookup can fail.
30085 * cs-tokenizer.cs: Begin implementation of pre-procesor.
30087 * expression.cs: Resolve the this instance before invoking the code.
30089 2001-12-17 Miguel de Icaza <miguel@ximian.com>
30091 * cs-parser.jay: Add a production in element_access that allows
30092 the thing to become a "type" reference. This way we can parse
30093 things like "(string [])" as a type.
30095 Note that this still does not handle the more complex rules of
30099 * delegate.cs (Delegate.Populate): Register the delegage constructor builder here.
30101 * ecore.cs: (CopyNewMethods): new utility function used to
30102 assemble the list of methods from running FindMembers.
30104 (MemberLookup): Rework FindMembers so that
30106 2001-12-16 Miguel de Icaza <miguel@ximian.com>
30108 * class.cs (TypeContainer): Remove Delegates who fail to be
30111 * delegate.cs (Populate): Verify that we dont get null return
30112 values. TODO: Check for AsAccessible.
30114 * cs-parser.jay: Use basename to emit error 574 (destructor should
30115 have the same name as container class), not the full name.
30117 * cs-tokenizer.cs (adjust_int): Fit the integer in the best
30118 possible representation.
30120 Also implements integer type suffixes U and L.
30122 2001-12-15 Miguel de Icaza <miguel@ximian.com>
30124 * expression.cs (ArrayCreation.DoResolve): We need to do the
30125 argument resolution *always*.
30127 * decl.cs: Make this hold the namespace. Hold the root context as
30129 (LookupType): Move here.
30131 * enum.cs, class.cs, interface.cs: Adapt to new hierarchy.
30133 * location.cs (Row, Name): Fixed the code, it was always returning
30134 references to the first file.
30136 * interface.cs: Register properties defined through interfaces.
30138 * driver.cs: Add support for globbing on the command line
30140 * class.cs (Field): Make it derive from MemberCore as well.
30143 2001-12-15 Ravi Pratap <ravi@ximian.com>
30145 * class.cs (Event::Define): Check that the type of the event is a delegate
30146 type else flag error #66.
30148 Also, re-use TypeContainer.MethodModifiersValid here too as the rules are the
30151 * attribute.cs (DefinePInvokeMethod): Handle named arguments and process
30152 values of EntryPoint, CharSet etc etc.
30154 Pass in the values to TypeBuilder.DefinePInvokeMethod; determine Type etc neatly.
30156 * class.cs (FindMembers): If a method is in transit, its MethodBuilder will
30157 be null and we should ignore this. I am not sure if this is really clean. Apparently,
30158 there's no way of avoiding hitting this because the call is coming from SimpleName.DoResolve,
30159 which needs this to do its work.
30161 * ../errors/cs0066.cs : Add.
30163 2001-12-14 Miguel de Icaza <miguel@ximian.com>
30165 * typemanager.cs: (GetPropertyGetter, GetPropertyGetter): New
30168 * class.cs: (MethodSignature.MethodSignature): Removed hack that
30169 clears out the parameters field.
30170 (MemberSignatureCompare): Cleanup
30172 (MemberCore): New base class used to share code between MethodCore
30175 (RegisterRequiredImplementations) BindingFlags.Public requires
30176 either BindingFlags.Instace or Static. Use instance here.
30178 (Property): Refactored code to cope better with the full spec.
30180 * parameter.cs (GetParameterInfo): Return an empty array instead
30183 * class.cs (Property): Abstract or extern properties have no bodies.
30185 * parameter.cs (GetParameterInfo): return a zero-sized array.
30187 * class.cs (TypeContainer.MethodModifiersValid): Move all the
30188 method modifier validation to the typecontainer so we can reuse
30189 this on properties.
30191 (MethodCore.ParameterTypes): return an empty sized array of types.
30193 (Property.Define): Test property modifier validity.
30195 Add tests for sealed/override too.
30197 (Method.Emit): abstract or extern methods have no bodies.
30199 2001-12-14 Ravi Pratap <ravi@ximian.com>
30201 * class.cs (Method.IsPInvoke): Get rid of it as it is an expensive
30204 (Method::Define, ::Emit): Modify accordingly.
30206 * expression.cs (Invocation::OverloadResolve): Handle error # 121.
30208 (ArrayCreation::MakeByteBlob): Handle floats and doubles.
30210 * makefile: Pass in /unsafe.
30212 2001-12-13 Miguel de Icaza <miguel@ximian.com>
30214 * class.cs (MakeKey): Kill routine.
30216 * class.cs (TypeContainer.Define): Correctly define explicit
30217 method implementations (they require the full interface name plus
30220 * typemanager.cs: Deply the PtrHashtable here and stop using the
30221 lame keys. Things work so much better.
30223 This of course broke everyone who depended on `RegisterMethod' to
30224 do the `test for existance' test. This has to be done elsewhere.
30226 * support.cs (PtrHashtable): A hashtable that avoid comparing with
30227 the object stupid Equals method (because, that like fails all over
30228 the place). We still do not use it.
30230 * class.cs (TypeContainer.SetRequiredInterface,
30231 TypeContainer.RequireMethods): Killed these two routines and moved
30232 all the functionality to RegisterRequiredImplementations.
30234 (TypeContainer.RegisterRequiredImplementations): This routine now
30235 registers all the implementations required in an array for the
30236 interfaces and abstract methods. We use an array of structures
30237 which can be computed ahead of time to reduce memory usage and we
30238 also assume that lookups are cheap as most classes will not
30239 implement too many interfaces.
30241 We also avoid creating too many MethodSignatures.
30243 (TypeContainer.IsInterfaceMethod): Update and optionally does not
30244 clear the "pending" bit if we find that there are problems with
30247 (TypeContainer.VerifyPendingMethods): Update to report errors of
30248 methods that look like implementations but are not.
30250 (TypeContainer.Define): Add support for explicit interface method
30253 2001-12-12 Miguel de Icaza <miguel@ximian.com>
30255 * typemanager.cs: Keep track of the parameters here instead of
30256 being a feature of the TypeContainer.
30258 * class.cs: Drop the registration of parameters here, as
30259 InterfaceMethods are also interface declarations.
30261 * delegate.cs: Register methods with the TypeManager not only with
30262 the TypeContainer. This code was buggy.
30264 * interface.cs: Full registation here.
30266 2001-12-11 Miguel de Icaza <miguel@ximian.com>
30268 * expression.cs: Remove reducer for binary expressions, it can not
30271 * const.cs: Put here the code that used to go into constant.cs
30273 * constant.cs: Put here the code for constants, this is a new base
30274 class for Literals.
30276 * literal.cs: Make Literal derive from Constant.
30278 2001-12-09 Miguel de Icaza <miguel@ximian.com>
30280 * statement.cs (Return.Emit): Report error 157 if the user
30281 attempts to return from a finally block.
30283 (Return.Emit): Instead of emitting a return, jump to the end of
30286 * codegen.cs (EmitContext): ReturnValue, ReturnLabel: new
30287 LocalBuilder to store the result of the function. ReturnLabel is
30288 the target where we jump.
30291 2001-12-09 Radek Doulik <rodo@ximian.com>
30293 * cs-parser.jay: remember alias in current namespace
30295 * ecore.cs (SimpleName::DoResolve): use aliases for types or
30298 * class.cs (LookupAlias): lookup alias in my_namespace
30300 * namespace.cs (UsingAlias): add alias, namespace_or_type pair to
30302 (LookupAlias): lookup alias in this and if needed in parent
30305 2001-12-08 Miguel de Icaza <miguel@ximian.com>
30309 * rootcontext.cs: (ModuleBuilder) Made static, first step into
30310 making things static. I need this to avoid passing the
30311 TypeContainer when calling ParameterType.
30313 * support.cs (InternalParameters.ParameterType): Remove ugly hack
30314 that did string manipulation to compute the type and then call
30315 GetType. Use Parameter.ParameterType instead.
30317 * cs-tokenizer.cs: Consume the suffix for floating values.
30319 * expression.cs (ParameterReference): figure out whether this is a
30320 reference parameter or not. Kill an extra variable by computing
30321 the arg_idx during emission.
30323 * parameter.cs (Parameters.GetParameterInfo): New overloaded
30324 function that returns whether a parameter is an out/ref value or not.
30326 (Parameter.ParameterType): The type of the parameter (base,
30327 without ref/out applied).
30329 (Parameter.Resolve): Perform resolution here.
30330 (Parameter.ExternalType): The full type (with ref/out applied).
30332 * statement.cs (Using.Emit, Using.EmitExpression): Implement
30333 support for expressions on the using statement.
30335 2001-12-07 Miguel de Icaza <miguel@ximian.com>
30337 * statement.cs (Using.EmitLocalVariableDecls): Split the
30338 localvariable handling of the using statement.
30340 (Block.EmitMeta): Keep track of variable count across blocks. We
30341 were reusing slots on separate branches of blocks.
30343 (Try.Emit): Emit the general code block, we were not emitting it.
30345 Check the type of the declaration to be an IDisposable or
30346 something that can be implicity converted to it.
30348 Emit conversions if required.
30350 * ecore.cs (EmptyExpression): New utility class.
30351 (Expression.ImplicitConversionExists): New utility function.
30353 2001-12-06 Miguel de Icaza <miguel@ximian.com>
30355 * statement.cs (Using): Implement.
30357 * expression.cs (LocalVariableReference): Support read only variables.
30359 * statement.cs: Remove the explicit emit for the Leave opcode.
30360 (VariableInfo): Add a readonly field.
30362 2001-12-05 Miguel de Icaza <miguel@ximian.com>
30364 * ecore.cs (ConvCast): new class used to encapsulate the various
30365 explicit integer conversions that works in both checked and
30366 unchecked contexts.
30368 (Expression.ConvertNumericExplicit): Use new ConvCast class to
30369 properly generate the overflow opcodes.
30371 2001-12-04 Miguel de Icaza <miguel@ximian.com>
30373 * statement.cs: The correct type for the EmptyExpression is the
30374 element_type, not the variable type. Ravi pointed this out.
30376 2001-12-04 Ravi Pratap <ravi@ximian.com>
30378 * class.cs (Method::Define): Handle PInvoke methods specially
30379 by using DefinePInvokeMethod instead of the usual one.
30381 * attribute.cs (DefinePInvokeMethod): Implement as this is what is called
30382 above to do the task of extracting information and defining the method.
30384 2001-12-04 Ravi Pratap <ravi@ximian.com>
30386 * expression.cs (ArrayCreation::EmitStaticInitializers): Get rid
30387 of the condition for string type.
30389 (Emit): Move that here.
30391 (ArrayCreation::CheckIndices): Keep string literals in their expression
30394 (EmitDynamicInitializers): Handle strings appropriately.
30396 2001-12-04 Miguel de Icaza <miguel@ximian.com>
30398 * codegen.cs (EmitContext): Replace multiple variables with a
30399 single pointer to the current Switch statement.
30401 * statement.cs (GotoDefault, Switch): Adjust to cleaned up
30404 2001-12-03 Miguel de Icaza <miguel@ximian.com>
30408 * statement.cs (GotoDefault), cs-parser.jay: Implement `goto
30411 (Foreach.Emit): Foreach on arrays was not setting
30412 up the loop variables (for break/continue).
30414 (GotoCase): Semi-implented.
30416 2001-12-03 Ravi Pratap <ravi@ximian.com>
30418 * attribute.cs (CheckAttribute): Handle system attributes by using
30419 Attribute.GetAttributes to examine information we need.
30421 (GetValidPlaces): Same here.
30423 * class.cs (Method::Define): Catch invalid use of extern and abstract together.
30425 * typemanager.cs (dllimport_type): Core type for System.DllImportAttribute.
30427 * class.cs (Method.IsPinvoke): Used to determine if we are a PInvoke method.
30429 (Method::Define): Set appropriate flags if we have a DllImport attribute.
30431 (Method::Emit): Handle the case when we are a PInvoke method.
30433 2001-12-03 Miguel de Icaza <miguel@ximian.com>
30435 * expression.cs: Use ResolveWithSimpleName on compound names.
30437 2001-12-02 Ravi Pratap <ravi@ximian.com>
30439 * constant.cs (EmitConstant): Make sure we resolve the associated expression
30440 before trying to reduce it.
30442 * typemanager.cs (RegisterConstant, LookupConstant): Implement.
30444 * constant.cs (LookupConstantValue): Implement.
30446 (EmitConstant): Use the above in emitting the constant.
30448 * expression.cs (MemberAccess::ResolveMemberAccess): Handle constants
30449 that are user-defined by doing a LookupConstantValue on them.
30451 (SimpleName::DoResolve): When we have a FieldExpr, cope with constants
30454 2001-11-29 Miguel de Icaza <miguel@ximian.com>
30456 * expression.cs (BaseAccess, BaseIndexer): Also split this out.
30458 (BaseAccess.DoResolve): Implement.
30460 (MemberAccess.DoResolve): Split this routine into a
30461 ResolveMemberAccess routine that can be used independently
30463 2001-11-28 Miguel de Icaza <miguel@ximian.com>
30465 * expression.cs (Probe, Is, As): Split Probe in two classes Is and
30466 As that share bits of the implementation. Is returns a boolean,
30467 while As returns the Type that is being probed.
30469 2001-12-01 Ravi Pratap <ravi@ximian.com>
30471 * enum.cs (LookupEnumValue): Re-write various bits, return an object value
30472 instead of a Literal - much easier.
30474 (EnumInTransit): Remove - utterly useless :-)
30476 (Populate): Re-write bits - remove duplicate code etc. The code is much neater now.
30478 * expression.cs (MemberLookup): Cope with user-defined enums when they are in transit.
30480 * enum.cs (LookupEnumValue): Auto-compute next values by going down the dependency
30481 chain when we have no associated expression.
30483 2001-11-30 Ravi Pratap <ravi@ximian.com>
30485 * constant.cs (Define): Use Location while reporting the errror.
30487 Also emit a warning when 'new' is used and there is no inherited
30490 * enum.cs (EnumInTransit): Used to tell if an enum type is in the process of being
30493 (LookupEnumValue): Implement to lookup an enum member's value and define it
30496 (Populate): Re-write accordingly to use the above routine.
30498 2001-11-27 Miguel de Icaza <miguel@ximian.com>
30500 * expression.cs (This): Fix prototype for DoResolveLValue to
30501 override the base class DoResolveLValue.
30503 * cs-parser.cs: Report errors cs574 and cs575 (destructor
30506 * ecore.cs (FieldExpr.EmitAssign): Handle value types specially
30507 (we need to load the address of the field here). This fixes
30510 (FieldExpr.DoResolveLValue): Call the DoResolve
30511 function to initialize the Instance expression.
30513 * statement.cs (Foreach.Emit): Fix the bug where we did not invoke
30514 correctly the GetEnumerator operation on a value type.
30516 * cs-parser.jay: Add more simple parsing error catches.
30518 * statement.cs (Switch): Add support for string switches.
30519 Handle null specially.
30521 * literal.cs (NullLiteral): Make NullLiteral objects singletons.
30523 2001-11-28 Ravi Pratap <ravi@ximian.com>
30525 * cs-parser.jay (local_constant_declaration): Use declare_local_constant.
30527 (declare_local_constant): New helper function.
30529 * statement.cs (AddConstant): Keep a separate record of constants
30531 (IsConstant): Implement to determine if a variable is a constant.
30533 (GetConstantExpression): Implement.
30535 * expression.cs (LocalVariableReference): Handle the case when it is a constant.
30537 * statement.cs (IsVariableDefined): Re-write.
30539 2001-11-27 Ravi Pratap <ravi@ximian.com>
30541 * class.cs (TypeContainer::FindMembers): Look for constants
30542 in the case when we are looking for MemberTypes.Field
30544 * expression.cs (MemberAccess::DoResolve): Check that in the
30545 case we are a FieldExpr and a Literal, we are not being accessed
30546 by an instance reference.
30548 * cs-parser.jay (local_constant_declaration): Implement.
30550 (declaration_statement): Implement for constant declarations.
30552 2001-11-26 Miguel de Icaza <miguel@ximian.com>
30554 * statement.cs (Switch): Catch double defaults.
30556 (Switch): More work on the switch() statement
30557 implementation. It works for integral values now, need to finish
30561 2001-11-24 Miguel de Icaza <miguel@ximian.com>
30563 * ecore.cs (Expression.ConvertIntLiteral): New function to convert
30564 integer literals into other integer literals. To be used by
30567 2001-11-24 Ravi Pratap <ravi@ximian.com>
30569 * expression.cs (ArrayCreation): Get rid of ArrayExprs : we save
30572 (EmitDynamicInitializers): Cope with the above since we extract data
30573 directly from ArrayData now.
30575 (ExpectInitializers): Keep track of whether initializers are mandatory
30578 (Bounds): Make it a hashtable to prevent the same dimension being
30579 recorded for every element in that dimension.
30581 (EmitDynamicInitializers): Fix bug which prevented the Set array method
30584 Also fix bug which was causing the indices to be emitted in the reverse
30587 2001-11-24 Miguel de Icaza <miguel@ximian.com>
30589 * expression.cs (ArrayCreation): Implement the bits that Ravi left
30590 unfinished. They do not work, because the underlying code is
30593 2001-11-22 Miguel de Icaza <miguel@ximian.com>
30595 * cs-parser.jay: Remove bogus fixme.
30597 * statement.cs (Switch, SwitchSection, SwithLabel): Started work
30598 on Switch statement.
30600 2001-11-23 Ravi Pratap <ravi@ximian.com>
30602 * typemanager.cs (IsDelegateType, IsEnumType): Fix logic to determine
30605 * expression.cs (ArrayCreation::CheckIndices): Get rid of the require_constant
30606 parameter. Apparently, any expression is allowed.
30608 (ValidateInitializers): Update accordingly.
30610 (CheckIndices): Fix some tricky bugs thanks to recursion.
30612 * delegate.cs (NewDelegate::DoResolve): Re-write large portions as
30613 I was being completely brain-dead.
30615 (VerifyMethod, VerifyApplicability, VerifyDelegate): Make static
30616 and re-write acordingly.
30618 (DelegateInvocation): Re-write accordingly.
30620 * expression.cs (ArrayCreation::Emit): Handle string initialization separately.
30622 (MakeByteBlob): Handle types more correctly.
30624 * expression.cs (ArrayCreation:Emit): Write preliminary code to do
30625 initialization from expressions but it is incomplete because I am a complete
30628 2001-11-22 Miguel de Icaza <miguel@ximian.com>
30630 * statement.cs (If.Emit): Fix a bug that generated incorrect code
30631 on If. Basically, we have to return `true' (ie, we do return to
30632 our caller) only if both branches of the if return.
30634 * expression.cs (Binary.Emit): LogicalOr and LogicalAnd are
30635 short-circuit operators, handle them as short circuit operators.
30637 (Cast.DoResolve): Resolve type.
30638 (Cast.Cast): Take an expression as the target type.
30640 * cs-parser.jay (cast_expression): Remove old hack that only
30641 allowed a limited set of types to be handled. Now we take a
30642 unary_expression and we resolve to a type during semantic
30645 Use the grammar productions from Rhys to handle casts (this is
30646 not complete like Rhys syntax yet, we fail to handle that corner
30647 case that C# has regarding (-x), but we will get there.
30649 2001-11-22 Ravi Pratap <ravi@ximian.com>
30651 * class.cs (EmitFieldInitializer): Take care of the case when we have a
30652 field which is an array type.
30654 * cs-parser.jay (declare_local_variables): Support array initialization too.
30656 * typemanager.cs (MakeKey): Implement.
30658 (everywhere): Use the above appropriately.
30660 * cs-parser.jay (for_statement): Update for array initialization while
30661 declaring variables.
30663 * ecore.cs : The error message was correct, it's the variable's names that
30664 were misleading ;-) Make the code more readable.
30666 (MemberAccess::DoResolve): Fix the code which handles Enum literals to set
30667 the correct type etc.
30669 (ConvertExplicit): Handle Enum types by examining the underlying type.
30671 2001-11-21 Ravi Pratap <ravi@ximian.com>
30673 * parameter.cs (GetCallingConvention): Always return
30674 CallingConventions.Standard for now.
30676 2001-11-22 Miguel de Icaza <miguel@ximian.com>
30678 * expression.cs (Binary.ResolveOperator): Update the values of `l'
30679 and `r' after calling DoNumericPromotions.
30681 * ecore.cs: Fix error message (the types were in the wrong order).
30683 * statement.cs (Foreach.ProbeCollectionType): Need to pass
30684 BindingFlags.Instance as well
30686 * ecore.cs (Expression.TryImplicitIntConversion): Wrap the result
30687 implicit int literal conversion in an empty cast so that we
30688 propagate the right type upstream.
30690 (UnboxCast): new class used to unbox value types.
30691 (Expression.ConvertExplicit): Add explicit type conversions done
30694 (Expression.ImplicitNumericConversion): Oops, forgot to test for
30695 the target type before applying the implicit LongLiterals to ULong
30698 2001-11-21 Miguel de Icaza <miguel@ximian.com>
30700 * cs-parser.jay (for_statement): Reworked the way For works: now
30701 we declare manually any variables that are introduced in
30702 for_initializer to solve the problem of having out-of-band code
30703 emition (that is what got for broken).
30705 (declaration_statement): Perform the actual variable declaration
30706 that used to be done in local_variable_declaration here.
30708 (local_variable_declaration): Do not declare anything, just pass
30709 the information on a DictionaryEntry
30711 2001-11-20 Ravi Pratap <ravi@ximian.com>
30713 * expression.cs (ArrayCreation::CheckIndices): The story continues :-) Complete
30714 re-write of the logic to now make it recursive.
30716 (UpdateIndices): Re-write accordingly.
30718 Store element data in a separate ArrayData list in the above methods.
30720 (MakeByteBlob): Implement to dump the array data into a byte array.
30722 2001-11-19 Ravi Pratap <ravi@ximian.com>
30724 * expression.cs (ArrayCreation): Factor out some code from ValidateInitializers
30727 * constant.cs (Define): Implement.
30729 (EmitConstant): Re-write fully.
30731 Pass in location info.
30733 * class.cs (Populate, Emit): Call Constant::Define and Constant::EmitConstant
30736 * cs-parser.jay (constant_declarator): Use VariableDeclaration instead of
30737 DictionaryEntry since we need location info too.
30739 (constant_declaration): Update accordingly.
30741 * expression.cs (ArrayCreation): Make ValidateInitializers simpler by factoring
30742 code into another method : UpdateIndices.
30744 2001-11-18 Ravi Pratap <ravi@ximian.com>
30746 * expression.cs (ArrayCreation::ValidateInitializers): Update to perform
30747 some type checking etc.
30749 2001-11-17 Ravi Pratap <ravi@ximian.com>
30751 * expression.cs (ArrayCreation::ValidateInitializers): Implement
30752 bits to provide dimension info if the user skips doing that.
30754 Update second constructor to store the rank correctly.
30756 2001-11-16 Ravi Pratap <ravi@ximian.com>
30758 * expression.cs (ArrayCreation::ValidateInitializers): Poke around
30759 and try to implement.
30761 * ../errors/cs0150.cs : Add.
30763 * ../errors/cs0178.cs : Add.
30765 2001-11-16 Miguel de Icaza <miguel@ximian.com>
30767 * statement.cs: Implement foreach on multi-dimensional arrays.
30769 * parameter.cs (Parameters.GetParameterByName): Also lookup the
30770 name of the params argument.
30772 * expression.cs: Use EmitStoreOpcode to get the right opcode while
30773 initializing the array.
30775 (ArrayAccess.EmitStoreOpcode): move the opcode generation here, so
30776 we can use this elsewhere.
30778 * statement.cs: Finish implementation of foreach for single
30781 * cs-parser.jay: Use an out-of-band stack to pass information
30782 around, I wonder why I need this.
30784 foreach_block: Make the new foreach_block the current_block.
30786 * parameter.cs (Parameters.GetEmptyReadOnlyParameters): New
30787 function used to return a static Parameters structure. Used for
30788 empty parameters, as those are created very frequently.
30790 * cs-parser.jay, class.cs: Use GetEmptyReadOnlyParameters
30792 2001-11-15 Ravi Pratap <ravi@ximian.com>
30794 * interface.cs : Default modifier is private, not public. The
30795 make verify test passes again.
30797 2001-11-15 Ravi Pratap <ravi@ximian.com>
30799 * support.cs (ReflectionParameters): Fix logic to determine
30800 whether the last parameter is a params one. Test 9 passes again.
30802 * delegate.cs (Populate): Register the builders we define with
30803 RegisterParameterForBuilder. Test 19 passes again.
30805 * cs-parser.jay (property_declaration): Reference $6 instead
30806 of $$ to get at the location.
30808 (indexer_declaration): Similar stuff.
30810 (attribute): Ditto.
30812 * class.cs (Property): Register parameters for the Get and Set methods
30813 if they exist. Test 23 passes again.
30815 * expression.cs (ArrayCreation::Emit): Pass null for the method in the
30816 call to EmitArguments as we are sure there aren't any params arguments.
30817 Test 32 passes again.
30819 * suppor.cs (ParameterDesc, ParameterModifier): Fix trivial bug causing
30820 IndexOutOfRangeException.
30822 * class.cs (Property::Define): Register property using TypeManager.RegisterProperty
30823 Test 33 now passes again.
30825 2001-11-15 Miguel de Icaza <miguel@ximian.com>
30827 * cs-parser.jay: Kill horrendous hack ($??? = lexer.Location) that
30828 broke a bunch of things. Will have to come up with a better way
30829 of tracking locations.
30831 * statement.cs: Implemented foreach for single dimension arrays.
30833 2001-11-09 Miguel de Icaza <miguel@ximian.com>
30835 * enum.cs (Enum.Emit): Delay the lookup of loc until we run into
30836 an error. This removes the lookup from the critical path.
30838 * cs-parser.jay: Removed use of temporary_loc, which is completely
30841 2001-11-14 Miguel de Icaza <miguel@ximian.com>
30843 * support.cs (ReflectionParameters.ParameterModifier): Report
30844 whether the argument is a PARAMS argument or not.
30846 * class.cs: Set the attribute `ParamArrayAttribute' on the
30847 parameter argument.
30849 * typemanager.cs: Define param_array_type (ParamArrayAttribute)
30850 and cons_param_array_attribute (ConstructorInfo for
30851 ParamArrayAttribute).,
30853 * codegen.cs: Emit the return using the `Return' statement, that
30854 way we can report the error correctly for missing return values.
30856 * class.cs (Method.Emit): Clean up.
30858 * expression.cs (Argument.Resolve): Take another argument: the
30859 location where this argument is used. Notice that this is not
30860 part of the "Argument" class as to reduce the size of the
30861 structure (we know the approximate location anyways).
30863 Test if the argument is a variable-reference, if not, then
30864 complain with a 206.
30866 (Argument.Emit): Emit addresses of variables.
30868 (Argument.FullDesc): Simplify.
30870 (Invocation.DoResolve): Update for Argument.Resolve.
30872 (ElementAccess.DoResolve): ditto.
30874 * delegate.cs (DelegateInvocation.Emit): Invocation of Invoke
30875 method should be virtual, as this method is always virtual.
30877 (NewDelegate.DoResolve): Update for Argument.Resolve.
30879 * class.cs (ConstructorInitializer.DoResolve): ditto.
30881 * attribute.cs (Attribute.Resolve): ditto.
30883 2001-11-13 Miguel de Icaza <miguel@ximian.com>
30885 * statement.cs (Foreach.Emit): Use EmitAssign instead of Store.
30887 * expression.cs (ParameterReference): Drop IStackStorage and implement
30888 IAssignMethod instead.
30890 (LocalVariableReference): ditto.
30892 * ecore.cs (FieldExpr): Drop IStackStorage and implement
30893 IAssignMethod instead.
30895 2001-11-13 Miguel de Icaza <miguel@ximian.com>
30897 * parameter.cs, expression.cs, class.cs, ecore.cs: Made all
30898 enumerations that are used in heavily used structures derive from
30899 byte in a laughable and pathetic attempt to reduce memory usage.
30900 This is the kind of pre-optimzations that you should not do at
30901 home without adult supervision.
30903 * expression.cs (UnaryMutator): New class, used to handle ++ and
30904 -- separatedly from the other unary operators. Cleans up the
30905 code, and kills the ExpressionStatement dependency in Unary.
30907 (Unary): Removed `method' and `Arguments' from this class, making
30908 it smaller, and moving it all to SimpleCall, so I can reuse this
30909 code in other locations and avoid creating a lot of transient data
30910 strucutres when not required.
30912 * cs-parser.jay: Adjust for new changes.
30914 2001-11-11 Miguel de Icaza <miguel@ximian.com>
30916 * enum.cs (Enum.Populate): If there is a failure during
30919 * cs-parser.jay (opt_enum_base): we used to catch type errors
30920 here, but this is really incorrect. The type error should be
30921 catched during semantic analysis.
30923 2001-12-11 Ravi Pratap <ravi@ximian.com>
30925 * cs-parser.jay (operator_declarator, conversion_operator_declarator): Set
30926 current_local_parameters as expected since I, in my stupidity, had forgotten
30929 * attribute.cs (GetValidPlaces): Fix stupid bug.
30931 * class.cs (Method::Emit): Perform check on applicability of attributes.
30933 (Constructor::Emit): Ditto.
30935 (Field::Emit): Ditto.
30937 (Field.Location): Store location information.
30939 (Property, Event, Indexer, Operator): Ditto.
30941 * cs-parser.jay (field_declaration): Pass in location for each field.
30943 * ../errors/cs0592.cs : Add.
30945 2001-11-12 Ravi Pratap <ravi@ximian.com>
30947 * typemanager.cs (attribute_usage_type): New static member for System.AttributeUsage.
30949 (InitCoreTypes): Update accordingly.
30951 (RegisterAttrType, LookupAttr): Implement.
30953 * attribute.cs (Attribute.Targets, AllowMultiple, Inherited): New fields to hold
30954 info about the same.
30956 (Resolve): Update to populate the above as necessary.
30958 (Error592): Helper.
30960 (GetValidPlaces): Helper to the above.
30962 (CheckAttribute): Implement to perform validity of attributes on declarative elements.
30964 * class.cs (TypeContainer::Emit): Update attribute emission code to perform checking etc.
30966 2001-11-12 Ravi Pratap <ravi@ximian.com>
30968 * attribute.cs (Attribute::Resolve): Expand to handle named arguments too.
30970 * ../errors/cs0617.cs : Add.
30972 2001-11-11 Ravi Pratap <ravi@ximian.com>
30974 * enum.cs (Emit): Rename to Populate to be more consistent with what
30975 we expect it to do and when exactly it is called.
30977 * class.cs, rootcontext.cs : Update accordingly.
30979 * typemanager.cs (RegisterField, GetValue): Workarounds for the fact that
30980 FieldInfo.GetValue does not work on dynamic types ! S.R.E lameness strikes again !
30982 * enum.cs (Populate): Register fields with TypeManager.RegisterField.
30984 * expression.cs (MemberAccess.DoResolve): Adjust code to obtain the value
30985 of a fieldinfo using the above, when dealing with a FieldBuilder.
30987 2001-11-10 Ravi Pratap <ravi@ximian.com>
30989 * ../errors/cs0031.cs : Add.
30991 * ../errors/cs1008.cs : Add.
30993 * ../errrors/cs0543.cs : Add.
30995 * enum.cs (DefineEnum): Check the underlying type and report an error if not a valid
30998 (FindMembers): Implement.
31000 * typemanager.cs (FindMembers): Re-write to call the appropriate methods for
31001 enums and delegates too.
31003 (enum_types): Rename to builder_to_enum.
31005 (delegate_types): Rename to builder_to_delegate.
31007 * delegate.cs (FindMembers): Implement.
31009 2001-11-09 Ravi Pratap <ravi@ximian.com>
31011 * typemanager.cs (IsEnumType): Implement.
31013 * enum.cs (Emit): Re-write parts to account for the underlying type
31014 better and perform checking etc.
31016 (GetNextDefaultValue): Helper to ensure we don't overshoot max value
31017 of the underlying type.
31019 * literal.cs (GetValue methods everywhere): Perform bounds checking and return
31022 * enum.cs (error31): Helper to report error #31.
31024 * cs-parser.jay (enum_declaration): Store location of each member too.
31026 * enum.cs (member_to_location): New hashtable.
31028 (AddEnumMember): Update location hashtable.
31030 (Emit): Use the location of each member while reporting errors.
31032 2001-11-09 Miguel de Icaza <miguel@ximian.com>
31034 * cs-parser.jay: A for_initializer if is a
31035 local_variable_declaration really ammount to have an implicit
31036 block with the variable declaration and no initializer for for.
31038 * statement.cs (For.Emit): Cope with null initializers.
31040 This fixes the infinite loop on for initializers.
31042 2001-11-08 Miguel de Icaza <miguel@ximian.com>
31044 * enum.cs: More cleanup.
31046 * ecore.cs: Remove dead code.
31048 * class.cs (Property.Emit): More simplification.
31049 (Event.Emit): ditto.
31051 Reworked to have less levels of indentation.
31053 2001-11-08 Ravi Pratap <ravi@ximian.com>
31055 * class.cs (Property): Emit attributes.
31065 * enum.cs (Emit): Ditto.
31067 * rootcontext.cs (ResolveTree, EmitCode, CloseTypes): Do the same for
31070 * class.cs (Field, Event, etc.): Move attribute generation into the
31071 Emit method everywhere.
31073 * enum.cs (Enum): Revamp to use the same definition semantics as delegates so
31074 we have a DefineEnum, CloseEnum etc. The previous way of doing things was not right
31075 as we had no way of defining nested enums !
31077 * rootcontext.cs : Adjust code accordingly.
31079 * typemanager.cs (AddEnumType): To keep track of enum types separately.
31081 2001-11-07 Ravi Pratap <ravi@ximian.com>
31083 * expression.cs (EvalConstantExpression): Move into ecore.cs
31085 * enum.cs (Enum): Rename some members and make them public and readonly
31086 according to our convention.
31088 * modifiers.cs (EnumAttr): Implement as we need to set only visibility flags,
31091 * enum.cs (Enum::Define): Use the above instead of TypeAttr.
31093 (Enum::Emit): Write a simple version for now which doesn't try to compute
31094 expressions. I shall modify this to be more robust in just a while.
31096 * class.cs (TypeContainer::Emit): Make sure we include Enums too.
31098 (TypeContainer::CloseType): Create the Enum types too.
31100 * attribute.cs (Resolve): Use the new Reduce method instead of EvalConstantExpression.
31102 * expression.cs (EvalConstantExpression): Get rid of completely.
31104 * enum.cs (Enum::Emit): Use the new expression reducer. Implement assigning
31105 user-defined values and other cases.
31107 (IsValidEnumLiteral): Helper function.
31109 * expression.cs (ExprClassfromMemberInfo): Modify to not do any literalizing
31110 out there in the case we had a literal FieldExpr.
31112 (MemberAccess:DoResolve): Do the literalizing of the FieldExpr here.
31114 (Literalize): Revamp a bit to take two arguments.
31116 (EnumLiteral): New class which derives from Literal to wrap enum literals.
31118 2001-11-06 Ravi Pratap <ravi@ximian.com>
31120 * cs-parser.jay (compilation_unit): Remove extra opt_attributes for now.
31122 * expression.cs (ArrayCreation::ValidateInitializers): Implement.
31124 (Resolve): Use the above to ensure we have proper initializers.
31126 2001-11-05 Ravi Pratap <ravi@ximian.com>
31128 * expression.cs (Expression::EvalConstantExpression): New method to
31129 evaluate constant expressions.
31131 * attribute.cs (Attribute::Resolve): Modify bits to use the above function.
31133 2001-11-07 Miguel de Icaza <miguel@ximian.com>
31135 * expression.cs (ArrayCreation.Emit): Some bits to initialize data
31138 (Binary.ResolveOperator): Handle operator != (object a, object b)
31139 and operator == (object a, object b);
31141 (Binary.DoNumericPromotions): Indicate whether the numeric
31142 promotion was possible.
31144 (ArrayAccess.DoResolve, ArrayAccess.Emit, ArrayAccess.EmitAssign):
31147 Made the ArrayAccess implement interface IAssignMethod instead of
31148 IStackStore as the order in which arguments are passed reflects
31151 * assign.cs: Instead of using expr.ExprClass to select the way of
31152 assinging, probe for the IStackStore/IAssignMethod interfaces.
31154 * typemanager.cs: Load InitializeArray definition.
31156 * rootcontext.cs (RootContext.MakeStaticData): Used to define
31157 static data that can be used to initialize arrays.
31159 2001-11-05 Miguel de Icaza <miguel@ximian.com>
31161 * expression.cs: Handle operator== and operator!= for booleans.
31163 (Conditioal.Reduce): Implement reducer for the ?: operator.
31165 (Conditional.Resolve): Implement dead code elimination.
31167 (Binary.Resolve): Catch string literals and return a new
31168 concatenated string.
31170 (Unary.Reduce): Implement reduction of unary expressions.
31172 * ecore.cs: Split out the expression core handling here.
31174 (Expression.Reduce): New method used to perform constant folding
31175 and CSE. This is needed to support constant-expressions.
31177 * statement.cs (Statement.EmitBoolExpression): Pass true and false
31178 targets, and optimize for !x.
31180 2001-11-04 Ravi Pratap <ravi@ximian.com>
31182 * attribute.cs (Attribute::Resolve): Implement guts. Note that resolution
31183 of an attribute gives us a CustomAttributeBuilder which we use accordingly to
31184 set custom atttributes.
31186 * literal.cs (Literal::GetValue): New abstract method to return the actual
31187 value of the literal, cast as an object.
31189 (*Literal): Implement GetValue method.
31191 * cs-parser.jay (positional_argument_list, named_argument_list): Add not just plain
31192 expressions to the arraylist but objects of type Argument.
31194 * class.cs (TypeContainer::Emit): Emit our attributes too.
31196 (Method::Emit, Constructor::Emit): Ditto.
31198 * cs-parser.jay (constructor_declaration): Set attributes too, which we seemed
31199 to be ignoring earlier.
31201 2001-11-03 Ravi Pratap <ravi@ximian.com>
31203 * attribute.cs (AttributeSection::Define): Implement to do the business
31204 of constructing a CustomAttributeBuilder.
31206 (Attribute): New trivial class. Increases readability of code.
31208 * cs-parser.jay : Update accordingly.
31210 (positional_argument_list, named_argument_list, named_argument): New rules
31212 (attribute_arguments): Use the above so that we are more correct.
31214 2001-11-02 Ravi Pratap <ravi@ximian.com>
31216 * expression.cs (Invocation::IsParamsMethodApplicable): Implement
31217 to perform all checks for a method with a params parameter.
31219 (Invocation::OverloadResolve): Update to use the above method and therefore
31220 cope correctly with params method invocations.
31222 * support.cs (InternalParameters::ParameterDesc): Provide a desc for
31225 * class.cs (ConstructorInitializer::Resolve): Make sure we look for Non-public
31226 constructors in our parent too because we can't afford to miss out on
31229 * attribute.cs (AttributeSection): New name for the class Attribute
31231 Other trivial changes to improve readability.
31233 * cs-parser.jay (opt_attributes, attribute_section etc.): Modify to
31234 use the new class names.
31236 2001-11-01 Ravi Pratap <ravi@ximian.com>
31238 * class.cs (Method::Define): Complete definition for params types too
31240 (Indexer::Define): Ditto.
31242 * support.cs (InternalParameters::ParameterType, ParameterDesc, ParameterModifier):
31243 Cope everywhere with a request for info about the array parameter.
31245 2001-11-01 Ravi Pratap <ravi@ximian.com>
31247 * tree.cs (RecordNamespace): Fix up to check for the correct key.
31249 * cs-parser.jay (GetQualifiedIdentifier): New Helper method used in
31250 local_variable_type to extract the string corresponding to the type.
31252 (local_variable_type): Fixup the action to use the new helper method.
31254 * codegen.cs : Get rid of RefOrOutParameter, it's not the right way to
31257 * expression.cs : Clean out code which uses the above.
31259 2001-10-31 Ravi Pratap <ravi@ximian.com>
31261 * typemanager.cs (RegisterMethod): Check if we already have an existing key
31262 and bale out if necessary by returning a false.
31264 (RegisterProperty): Ditto.
31266 * class.cs (everywhere): Check the return value from TypeManager.RegisterMethod
31267 and print out appropriate error messages.
31269 * interface.cs (everywhere): Ditto.
31271 * cs-parser.jay (property_declaration, event_declaration, indexer_declaration): Pass
31272 location to constructor.
31274 * class.cs (Property, Event, Indexer): Update accordingly.
31276 * ../errors/cs111.cs : Added.
31278 * expression.cs (Invocation::IsApplicable): New static method to determine applicability
31279 of a method, as laid down by the spec.
31281 (Invocation::OverloadResolve): Use the above method.
31283 2001-10-31 Ravi Pratap <ravi@ximian.com>
31285 * support.cs (InternalParameters): Get rid of crap taking in duplicate info. We
31286 now take a TypeContainer and a Parameters object.
31288 (ParameterData): Modify return type of ParameterModifier method to be
31289 Parameter.Modifier and not a string.
31291 (ReflectionParameters, InternalParameters): Update accordingly.
31293 * expression.cs (Argument::GetParameterModifier): Same here.
31295 * support.cs (InternalParameters::ParameterType): Find a better way of determining
31296 if we are a ref/out parameter. Actually, the type shouldn't be holding the '&'
31297 symbol in it at all so maybe this is only for now.
31299 2001-10-30 Ravi Pratap <ravi@ximian.com>
31301 * support.cs (InternalParameters): Constructor now takes an extra argument
31302 which is the actual Parameters class.
31304 (ParameterDesc): Update to provide info on ref/out modifiers.
31306 * class.cs (everywhere): Update call to InternalParameters to pass in
31307 the second argument too.
31309 * support.cs (ParameterData): Add ParameterModifier, which is a method
31310 to return the modifier info [ref/out etc]
31312 (InternalParameters, ReflectionParameters): Implement the above.
31314 * expression.cs (Argument::ParameterModifier): Similar function to return
31315 info about the argument's modifiers.
31317 (Invocation::OverloadResolve): Update to take into account matching modifiers
31320 * class.cs (Indexer::Define): Actually define a Parameter object and put it onto
31321 a new SetFormalParameters object which we pass to InternalParameters.
31323 2001-10-30 Ravi Pratap <ravi@ximian.com>
31325 * expression.cs (NewArray): Merge into the ArrayCreation class.
31327 2001-10-29 Ravi Pratap <ravi@ximian.com>
31329 * expression.cs (NewArray): Merge classes NewBuiltinArray and
31330 NewUserdefinedArray into one as there wasn't much of a use in having
31333 * expression.cs (Argument): Change field's name to ArgType from Type.
31335 (Type): New readonly property which returns the proper type, taking into
31336 account ref/out modifiers.
31338 (everywhere): Adjust code accordingly for the above.
31340 * codegen.cs (EmitContext.RefOrOutParameter): New field to determine
31341 whether we are emitting for a ref or out parameter.
31343 * expression.cs (Argument::Emit): Use the above field to set the state.
31345 (LocalVariableReference::Emit): Update to honour the flag and emit the
31348 * parameter.cs (Attributes): Set the correct flags for ref parameters.
31350 * expression.cs (Argument::FullDesc): New function to provide a full desc.
31352 * support.cs (ParameterData): Add method ParameterDesc to the interface.
31354 (ReflectionParameters, InternalParameters): Implement the above method.
31356 * expression.cs (Invocation::OverloadResolve): Use the new desc methods in
31359 (Invocation::FullMethodDesc): Ditto.
31361 2001-10-29 Miguel de Icaza <miguel@ximian.com>
31363 * cs-parser.jay: Add extra production for the second form of array
31366 * expression.cs (ArrayCreation): Update to reflect the above
31369 * Small changes to prepare for Array initialization.
31371 2001-10-28 Miguel de Icaza <miguel@ximian.com>
31373 * typemanager.cs (ImplementsInterface): interface might be null;
31374 Deal with this problem;
31376 Also, we do store negative hits on the cache (null values), so use
31377 this instead of calling t.GetInterfaces on the type everytime.
31379 2001-10-28 Ravi Pratap <ravi@ximian.com>
31381 * typemanager.cs (IsBuiltinType): New method to help determine the same.
31383 * expression.cs (New::DoResolve): Get rid of array creation code and instead
31384 split functionality out into different classes.
31386 (New::FormArrayType): Move into NewBuiltinArray.
31388 (Invocation::EmitArguments): Get rid of the MethodBase argument. Appears
31391 (NewBuiltinArray): New class to handle creation of built-in arrays.
31393 (NewBuiltinArray::DoResolve): Implement guts of array creation. Also take into
31394 account creation of one-dimensional arrays.
31396 (::Emit): Implement to use Newarr and Newobj opcodes accordingly.
31398 (NewUserdefinedArray::DoResolve): Implement.
31400 * cs-parser.jay (local_variable_type): Fix up to add the rank to the variable too.
31402 * typemanager.cs (AddModule): Used to add a ModuleBuilder to the list of modules
31403 we maintain inside the TypeManager. This is necessary to perform lookups on the
31406 (LookupType): Update to perform GetType on the module builders too.
31408 * driver.cs (Driver): Add the ModuleBuilder to the list maintained by the TypeManager.
31410 * exprssion.cs (NewUserdefinedArray::Emit): Implement.
31412 2001-10-23 Ravi Pratap <ravi@ximian.com>
31414 * expression.cs (New::DoResolve): Implement guts of array creation.
31416 (New::FormLookupType): Rename to FormArrayType and modify ever so slightly.
31418 2001-10-27 Miguel de Icaza <miguel@ximian.com>
31420 * expression.cs: Fix bug I introduced lsat night that broke
31423 (Expression.Resolve): Report a 246 error (can not resolve name)
31424 if we find a SimpleName in the stream.
31426 (Expression.ResolveLValue): Ditto.
31428 (Expression.ResolveWithSimpleName): This function is a variant of
31429 ResolveName, this one allows SimpleNames to be returned without a
31430 warning. The only consumer of SimpleNames is MemberAccess
31432 2001-10-26 Miguel de Icaza <miguel@ximian.com>
31434 * expression.cs (Invocation::DoResolve): Catch SimpleNames that
31435 might arrive here. I have my doubts that this is correct.
31437 * statement.cs (Lock): Implement lock statement.
31439 * cs-parser.jay: Small fixes to support `lock' and `using'
31441 * cs-tokenizer.cs: Remove extra space
31443 * driver.cs: New flag --checked, allows to turn on integer math
31446 * typemanger.cs: Load methodinfos for Threading.Monitor.Enter and
31447 Threading.Monitor.Exit
31449 2001-10-23 Miguel de Icaza <miguel@ximian.com>
31451 * expression.cs (IndexerAccess::DoResolveLValue): Set the
31452 Expression Class to be IndexerAccess.
31454 Notice that Indexer::DoResolve sets the eclass to Value.
31456 2001-10-22 Miguel de Icaza <miguel@ximian.com>
31458 * class.cs (TypeContainer::Emit): Emit code for indexers.
31460 * assign.cs (IAssignMethod): New interface implemented by Indexers
31461 and Properties for handling assignment.
31463 (Assign::Emit): Simplify and reuse code.
31465 * expression.cs (IndexerAccess, PropertyExpr): Implement
31466 IAssignMethod, clean up old code.
31468 2001-10-22 Ravi Pratap <ravi@ximian.com>
31470 * typemanager.cs (ImplementsInterface): New method to determine if a type
31471 implements a given interface. Provides a nice cache too.
31473 * expression.cs (ImplicitReferenceConversion): Update checks to use the above
31476 (ConvertReferenceExplicit): Ditto.
31478 * delegate.cs (Delegate::Populate): Update to define the parameters on the
31479 various methods, with correct names etc.
31481 * class.cs (Operator::OpType): New members Operator.UnaryPlus and
31482 Operator.UnaryNegation.
31484 * cs-parser.jay (operator_declarator): Be a little clever in the case where
31485 we have a unary plus or minus operator.
31487 * expression.cs (Unary): Rename memebers of Operator enum to UnaryPlus and
31490 * everywhere : update accordingly.
31492 * everywhere : Change Negate and BitComplement to LogicalNot and OnesComplement
31495 * class.cs (Method::Define): For the case where we are implementing a method
31496 inherited from an interface, we need to set the MethodAttributes.Final flag too.
31497 Also set MethodAttributes.NewSlot and MethodAttributes.HideBySig.
31499 2001-10-21 Ravi Pratap <ravi@ximian.com>
31501 * interface.cs (FindMembers): Implement to work around S.R.E
31504 * typemanager.cs (IsInterfaceType): Implement.
31506 (FindMembers): Update to handle interface types too.
31508 * expression.cs (ImplicitReferenceConversion): Re-write bits which
31509 use IsAssignableFrom as that is not correct - it doesn't work.
31511 * delegate.cs (DelegateInvocation): Derive from ExpressionStatement
31512 and accordingly override EmitStatement.
31514 * expression.cs (ConvertReferenceExplicit): Re-write similary, this time
31515 using the correct logic :-)
31517 2001-10-19 Ravi Pratap <ravi@ximian.com>
31519 * ../errors/cs-11.cs : Add to demonstrate error -11
31521 2001-10-17 Miguel de Icaza <miguel@ximian.com>
31523 * assign.cs (Assign::Resolve): Resolve right hand side first, and
31524 then pass this as a hint to ResolveLValue.
31526 * expression.cs (FieldExpr): Add Location information
31528 (FieldExpr::LValueResolve): Report assignment to readonly
31531 (Expression::ExprClassFromMemberInfo): Pass location information.
31533 (Expression::ResolveLValue): Add new method that resolves an
31536 (Expression::DoResolveLValue): Default invocation calls
31539 (Indexers): New class used to keep track of indexers in a given
31542 (IStackStore): Renamed from LValue, as it did not really describe
31543 what this did. Also ResolveLValue is gone from this interface and
31544 now is part of Expression.
31546 (ElementAccess): Depending on the element access type
31548 * typemanager.cs: Add `indexer_name_type' as a Core type
31549 (System.Runtime.CompilerServices.IndexerNameAttribute)
31551 * statement.cs (Goto): Take a location.
31553 2001-10-18 Ravi Pratap <ravi@ximian.com>
31555 * delegate.cs (Delegate::VerifyDelegate): New method to verify
31556 if two delegates are compatible.
31558 (NewDelegate::DoResolve): Update to take care of the case when
31559 we instantiate a delegate from another delegate.
31561 * typemanager.cs (FindMembers): Don't even try to look up members
31562 of Delegate types for now.
31564 2001-10-18 Ravi Pratap <ravi@ximian.com>
31566 * delegate.cs (NewDelegate): New class to take care of delegate
31569 * expression.cs (New): Split the delegate related code out into
31570 the NewDelegate class.
31572 * delegate.cs (DelegateInvocation): New class to handle delegate
31575 * expression.cs (Invocation): Split out delegate related code into
31576 the DelegateInvocation class.
31578 2001-10-17 Ravi Pratap <ravi@ximian.com>
31580 * expression.cs (New::DoResolve): Implement delegate creation fully
31581 and according to the spec.
31583 (New::DoEmit): Update to handle delegates differently.
31585 (Invocation::FullMethodDesc): Fix major stupid bug thanks to me
31586 because of which we were printing out arguments in reverse order !
31588 * delegate.cs (VerifyMethod): Implement to check if the given method
31589 matches the delegate.
31591 (FullDelegateDesc): Implement.
31593 (VerifyApplicability): Implement.
31595 * expression.cs (Invocation::DoResolve): Update to accordingly handle
31596 delegate invocations too.
31598 (Invocation::Emit): Ditto.
31600 * ../errors/cs1593.cs : Added.
31602 * ../errors/cs1594.cs : Added.
31604 * delegate.cs (InstanceExpression, TargetMethod): New properties.
31606 2001-10-16 Ravi Pratap <ravi@ximian.com>
31608 * typemanager.cs (intptr_type): Core type for System.IntPtr
31610 (InitCoreTypes): Update for the same.
31612 (iasyncresult_type, asynccallback_type): Ditto.
31614 * delegate.cs (Populate): Fix to use System.Intptr as it is indeed
31617 * typemanager.cs (AddDelegateType): Store a pointer to the Delegate class
31620 * delegate.cs (ConstructorBuilder, InvokeBuilder, ...): New members to hold
31621 the builders for the 4 members of a delegate type :-)
31623 (Populate): Define the BeginInvoke and EndInvoke methods on the delegate
31626 * expression.cs (New::DoResolve): Implement guts for delegate creation.
31628 * ../errors/errors.txt : Update for an error (-11) which only we catch :-)
31630 2001-10-15 Miguel de Icaza <miguel@ximian.com>
31632 * statement.cs (Break::Emit): Implement.
31633 (Continue::Emit): Implement.
31635 (For::Emit): Track old being/end loops; Set Begin loop, ack end loop
31636 (While::Emit): Track old being/end loops; Set Begin loop, ack end loop
31637 (Do::Emit): Track old being/end loops; Set Begin loop, ack end loop
31638 (Foreach::Emit): Track old being/end loops; Set Begin loop, ack
31641 * codegen.cs (EmitContext::LoopEnd, EmitContext::LoopBegin): New
31642 properties that track the label for the current loop (begin of the
31643 loop and end of the loop).
31645 2001-10-15 Ravi Pratap <ravi@ximian.com>
31647 * delegate.cs (Emit): Get rid of it as there doesn't seem to be any ostensible
31648 use of emitting anything at all.
31650 * class.cs, rootcontext.cs : Get rid of calls to the same.
31652 * delegate.cs (DefineDelegate): Make sure the class we define is also sealed.
31654 (Populate): Define the constructor correctly and set the implementation
31657 * typemanager.cs (delegate_types): New hashtable to hold delegates that
31660 (AddDelegateType): Implement.
31662 (IsDelegateType): Implement helper method.
31664 * delegate.cs (DefineDelegate): Use AddDelegateType instead of AddUserType.
31666 * expression.cs (New::DoResolve): Check if we are trying to instantiate a delegate type
31667 and accordingly handle it.
31669 * delegate.cs (Populate): Take TypeContainer argument.
31670 Implement bits to define the Invoke method. However, I still haven't figured out
31671 how to take care of the native int bit :-(
31673 * cs-parser.jay (delegate_declaration): Fixed the bug that I had introduced :-)
31674 Qualify the name of the delegate, not its return type !
31676 * expression.cs (ImplicitReferenceConversion): Implement guts of implicit array
31679 (StandardConversionExists): Checking for array types turns out to be recursive.
31681 (ConvertReferenceExplicit): Implement array conversion.
31683 (ExplicitReferenceConversionExists): New method to determine precisely that :-)
31685 2001-10-12 Ravi Pratap <ravi@ximian.com>
31687 * cs-parser.jay (delegate_declaration): Store the fully qualified
31688 name as it is a type declaration.
31690 * delegate.cs (ReturnType, Name): Rename members to these. Make them
31693 (DefineDelegate): Renamed from Define. Does the same thing essentially,
31694 as TypeContainer::DefineType.
31696 (Populate): Method in which all the definition of the various methods (Invoke)
31699 (Emit): Emit any code, if necessary. I am not sure about this really, but let's
31702 (CloseDelegate): Finally creates the delegate.
31704 * class.cs (TypeContainer::DefineType): Update to define delegates.
31705 (Populate, Emit and CloseType): Do the same thing here too.
31707 * rootcontext.cs (ResolveTree, PopulateTypes, EmitCode, CloseTypes): Include
31708 delegates in all these operations.
31710 2001-10-14 Miguel de Icaza <miguel@ximian.com>
31712 * expression.cs: LocalTemporary: a new expression used to
31713 reference a temporary that has been created.
31715 * assign.cs: Handle PropertyAccess back here, so that we can
31716 provide the proper semantic access to properties.
31718 * expression.cs (Expression::ConvertReferenceExplicit): Implement
31719 a few more explicit conversions.
31721 * modifiers.cs: `NEW' modifier maps to HideBySig.
31723 * expression.cs (PropertyExpr): Make this into an
31724 ExpressionStatement, and support the EmitStatement code path.
31726 Perform get/set error checking, clean up the interface.
31728 * assign.cs: recognize PropertyExprs as targets, and if so, turn
31729 them into toplevel access objects.
31731 2001-10-12 Miguel de Icaza <miguel@ximian.com>
31733 * expression.cs: PropertyExpr::PropertyExpr: use work around the
31736 * typemanager.cs: Keep track here of our PropertyBuilders again to
31737 work around lameness in SRE.
31739 2001-10-11 Miguel de Icaza <miguel@ximian.com>
31741 * expression.cs (LValue::LValueResolve): New method in the
31742 interface, used to perform a second resolution pass for LValues.
31744 (This::DoResolve): Catch the use of this in static methods.
31746 (This::LValueResolve): Implement.
31748 (This::Store): Remove warning, assigning to `this' in structures
31751 (Invocation::Emit): Deal with invocation of
31752 methods on value types. We need to pass the address to structure
31753 methods rather than the object itself. (The equivalent code to
31754 emit "this" for structures leaves the entire structure on the
31755 stack instead of a pointer to it).
31757 (ParameterReference::DoResolve): Compute the real index for the
31758 argument based on whether the method takes or not a `this' pointer
31759 (ie, the method is static).
31761 * codegen.cs (EmitContext::GetTemporaryStorage): Used to store
31762 value types returned from functions when we need to invoke a
31763 method on the sturcture.
31766 2001-10-11 Ravi Pratap <ravi@ximian.com>
31768 * class.cs (TypeContainer::DefineType): Method to actually do the business of
31769 defining the type in the Modulebuilder or Typebuilder. This is to take
31770 care of nested types which need to be defined on the TypeBuilder using
31771 DefineNestedMethod.
31773 (TypeContainer::GetClassBases): Implement. Essentially the code from the
31774 methods in RootContext, only ported to be part of TypeContainer.
31776 (TypeContainer::GetInterfaceOrClass): Ditto.
31778 (TypeContainer::LookupInterfaceOrClass, ::MakeFQN): Ditto.
31780 * interface.cs (Interface::DefineInterface): New method. Does exactly
31781 what RootContext.CreateInterface did earlier, only it takes care of nested types
31784 (Interface::GetInterfaces): Move from RootContext here and port.
31786 (Interface::GetInterfaceByName): Same here.
31788 * rootcontext.cs (ResolveTree): Re-write.
31790 (PopulateTypes): Re-write.
31792 * class.cs (TypeContainer::Populate): Populate nested types too.
31793 (TypeContainer::Emit): Emit nested members too.
31795 * typemanager.cs (AddUserType): Do not make use of the FullName property,
31796 instead just use the name argument passed in as it is already fully
31799 (FindMembers): Check in the Builders to TypeContainer mapping instead of the name
31800 to TypeContainer mapping to see if a type is user-defined.
31802 * class.cs (TypeContainer::CloseType): Implement.
31804 (TypeContainer::DefineDefaultConstructor): Use Basename, not Name while creating
31805 the default constructor.
31807 (TypeContainer::Populate): Fix minor bug which led to creating default constructors
31810 (Constructor::IsDefault): Fix up logic to determine if it is the default constructor
31812 * interface.cs (CloseType): Create the type here.
31814 * rootcontext.cs (CloseTypes): Re-write to recursively close types by running through
31817 Remove all the methods which are now in TypeContainer.
31819 2001-10-10 Ravi Pratap <ravi@ximian.com>
31821 * delegate.cs (Define): Re-write bits to define the delegate
31824 2001-10-10 Miguel de Icaza <miguel@ximian.com>
31826 * makefile: Renamed the compiler to `mcs.exe' instead of compiler.exe
31828 * expression.cs (ImplicitReferenceConversion): handle null as well
31829 as a source to convert to any reference type.
31831 * statement.cs (Return): Perform any implicit conversions to
31832 expected return type.
31834 Validate use of return statement.
31836 * codegen.cs (EmitContext): Pass the expected return type here.
31838 * class.cs (Method, Constructor, Property): Pass expected return
31839 type to EmitContext.
31841 2001-10-09 Miguel de Icaza <miguel@ximian.com>
31843 * expression.cs: Make DoResolve take an EmitContext instead of a
31846 Replaced `l' and `location' for `loc', for consistency.
31848 (Error, Warning): Remove unneeded Tc argument.
31850 * assign.cs, literal.cs, constant.cs: Update to new calling
31853 * codegen.cs: EmitContext now contains a flag indicating whether
31854 code is being generated in a static method or not.
31856 * cs-parser.jay: DecomposeQI, new function that replaces the old
31857 QualifiedIdentifier. Now we always decompose the assembled
31858 strings from qualified_identifier productions into a group of
31861 2001-10-08 Miguel de Icaza <miguel@ximian.com>
31863 * rootcontext.cs: Deal with field-less struct types correctly now
31864 by passing the size option to Define Type.
31866 * class.cs: Removed hack that created one static field.
31868 2001-10-07 Miguel de Icaza <miguel@ximian.com>
31870 * statement.cs: Moved most of the code generation here.
31872 2001-10-09 Ravi Pratap <ravi@ximian.com>
31874 * expression.cs (New::DoResolve): Revert changes for array creation, doesn't
31877 (ElementAccess): Remove useless bits for now - keep checks as the spec
31880 2001-10-08 Ravi Pratap <ravi@ximian.com>
31882 * expression.cs (ElementAccess::DoResolve): Remove my crap code
31883 and start performing checks according to the spec.
31885 2001-10-07 Ravi Pratap <ravi@ximian.com>
31887 * cs-parser.jay (type_suffix*): Remove - they are redundant. Use
31888 rank_specifiers instead.
31890 (rank_specifiers): Change the order in which the rank specifiers are stored
31892 (local_variable_declaration): Use opt_rank_specifier instead of type_suffixes.
31894 * expression.cs (ElementAccess): Implement the LValue interface too.
31896 2001-10-06 Ravi Pratap <ravi@ximian.com>
31898 * expression.cs (ConvertExplicitStandard): Add. Same as ConvertExplicit
31899 except that user defined conversions are not included.
31901 (UserDefinedConversion): Update to use the ConvertExplicitStandard to
31902 perform the conversion of the return type, if necessary.
31904 (New::DoResolve): Check whether we are creating an array or an object
31905 and accordingly do the needful.
31907 (New::Emit): Same here.
31909 (New::DoResolve): Implement guts of array creation.
31911 (New::FormLookupType): Helper function.
31913 2001-10-07 Miguel de Icaza <miguel@ximian.com>
31915 * codegen.cs: Removed most of the code generation here, and move the
31916 corresponding code generation bits to the statement classes.
31918 Added support for try/catch/finalize and throw.
31920 * cs-parser.jay: Added support for try/catch/finalize.
31922 * class.cs: Catch static methods having the flags override,
31923 virtual or abstract.
31925 * expression.cs (UserCast): This user cast was not really doing
31926 what it was supposed to do. Which is to be born in fully resolved
31927 state. Parts of the resolution were being performed at Emit time!
31931 2001-10-05 Miguel de Icaza <miguel@ximian.com>
31933 * expression.cs: Implicity convert the result from UserCast.
31935 2001-10-05 Ravi Pratap <ravi@ximian.com>
31937 * expression.cs (Expression::FindMostEncompassingType): Fix bug which
31938 prevented it from working correctly.
31940 (ConvertExplicit): Make the first try, a call to ConvertImplicitStandard, not
31941 merely ConvertImplicit.
31943 2001-10-05 Miguel de Icaza <miguel@ximian.com>
31945 * typemanager.cs: Make the LookupTypeContainer function static,
31946 and not per-instance.
31948 * class.cs: Make static FindMembers (the one that takes a Type
31951 * codegen.cs: Add EmitForeach here.
31953 * cs-parser.jay: Make foreach a toplevel object instead of the
31954 inline expansion, as we need to perform semantic analysis on it.
31956 2001-10-05 Ravi Pratap <ravi@ximian.com>
31958 * expression.cs (Expression::ImplicitUserConversion): Rename to
31959 UserDefinedConversion.
31961 (Expression::UserDefinedConversion): Take an extra argument specifying
31962 whether we look for explicit user conversions too.
31964 (Expression::ImplicitUserConversion): Make it a call to UserDefinedConversion.
31966 (UserDefinedConversion): Incorporate support for user defined explicit conversions.
31968 (ExplicitUserConversion): Make it a call to UserDefinedConversion
31969 with the appropriate arguments.
31971 * cs-parser.jay (cast_expression): Record location too.
31973 * expression.cs (Cast): Record location info.
31975 (Expression::ConvertExplicit): Take location argument.
31977 (UserImplicitCast): Change name to UserCast. Take an extra constructor argument
31978 to determine if we are doing explicit conversions.
31980 (UserCast::Emit): Update accordingly.
31982 (Expression::ConvertExplicit): Report an error if everything fails.
31984 * ../errors/cs0030.cs : Add.
31986 2001-10-04 Miguel de Icaza <miguel@ximian.com>
31988 * modifiers.cs: If the ABSTRACT keyword is present, also set the
31989 virtual and newslot bits.
31991 * class.cs (TypeContainer::RegisterRequiredImplementations):
31992 Record methods we need.
31994 (TypeContainer::MakeKey): Helper function to make keys for
31995 MethodBases, since the Methodbase key is useless.
31997 (TypeContainer::Populate): Call RegisterRequiredImplementations
31998 before defining the methods.
32000 Create a mapping for method_builders_to_methods ahead of time
32001 instead of inside a tight loop.
32003 (::RequireMethods): Accept an object as the data to set into the
32004 hashtable so we can report interface vs abstract method mismatch.
32006 2001-10-03 Miguel de Icaza <miguel@ximian.com>
32008 * report.cs: Make all of it static.
32010 * rootcontext.cs: Drop object_type and value_type computations, as
32011 we have those in the TypeManager anyways.
32013 Drop report instance variable too, now it is a global.
32015 * driver.cs: Use try/catch on command line handling.
32017 Add --probe option to debug the error reporting system with a test
32020 * report.cs: Add support for exiting program when a probe
32021 condition is reached.
32023 2001-10-03 Ravi Pratap <ravi@ximian.com>
32025 * expression.cs (Binary::DoNumericPromotions): Fix the case when
32026 we do a forcible conversion regardless of type, to check if
32027 ForceConversion returns a null.
32029 (Binary::error19): Use location to report error.
32031 (Unary::error23): Use location here too.
32033 * ../errors/cs0019.cs : Check in.
32035 * ../errors/cs0023.cs : Check in.
32037 * expression.cs (Expression.MemberLookup): Return null for a rather esoteric
32038 case of a non-null MethodInfo object with a length of 0 !
32040 (Binary::ResolveOperator): Flag error if overload resolution fails to find
32041 an applicable member - according to the spec :-)
32042 Also fix logic to find members in base types.
32044 (Unary::ResolveOperator): Same here.
32046 (Unary::report23): Change name to error23 and make first argument a TypeContainer
32047 as I was getting thoroughly confused between this and error19 :-)
32049 * expression.cs (Expression::ImplicitUserConversion): Re-write fully
32050 (::FindMostEncompassedType): Implement.
32051 (::FindMostEncompassingType): Implement.
32052 (::StandardConversionExists): Implement.
32054 (UserImplicitCast): Re-vamp. We now need info about most specific
32055 source and target types so that we can do the necessary conversions.
32057 (Invocation::MakeUnionSet): Completely re-write to make sure we form a proper
32058 mathematical union with no duplicates.
32060 2001-10-03 Miguel de Icaza <miguel@ximian.com>
32062 * rootcontext.cs (RootContext::PopulateTypes): Populate containers
32063 in order from base classes to child classes, so that we can in
32064 child classes look up in our parent for method names and
32065 attributes (required for handling abstract, virtual, new, override
32066 constructs: we need to instrospect our base class, and if we dont
32067 populate the classes in order, the introspection might be
32068 incorrect. For example, a method could query its parent before
32069 the parent has any methods and would determine that the parent has
32070 no abstract methods (while it could have had them)).
32072 (RootContext::CreateType): Record the order in which we define the
32075 2001-10-02 Miguel de Icaza <miguel@ximian.com>
32077 * class.cs (TypeContainer::Populate): Also method definitions can
32078 fail now, keep track of this.
32080 (TypeContainer::FindMembers): Implement support for
32081 DeclaredOnly/noDeclaredOnly flag.
32083 (Constructor::Emit) Return the ConstructorBuilder.
32085 (Method::Emit) Return the MethodBuilder.
32086 Check for abstract or virtual methods to be public.
32088 * rootcontext.cs (RootContext::CreateType): Register all the
32089 abstract methods required for the class to be complete and the
32090 interface methods that must be implemented.
32092 * cs-parser.jay: Report error 501 (method requires body if it is
32093 not marked abstract or extern).
32095 * expression.cs (TypeOf::Emit): Implement.
32097 * typemanager.cs: runtime_handle_type, new global type.
32099 * class.cs (Property::Emit): Generate code for properties.
32101 2001-10-02 Ravi Pratap <ravi@ximian.com>
32103 * expression.cs (Unary::ResolveOperator): Find operators on base type
32104 too - we now conform exactly to the spec.
32106 (Binary::ResolveOperator): Same here.
32108 * class.cs (Operator::Define): Fix minor quirk in the tests.
32110 * ../errors/cs0215.cs : Added.
32112 * ../errors/cs0556.cs : Added.
32114 * ../errors/cs0555.cs : Added.
32116 2001-10-01 Miguel de Icaza <miguel@ximian.com>
32118 * cs-tokenizer.cs: Reimplemented Location to be a struct with a
32119 single integer which is really efficient
32121 2001-10-01 Ravi Pratap <ravi@ximian.com>
32123 * expression.cs (Expression::ImplicitUserConversion): Use location
32124 even in the case when we are examining True operators.
32126 * class.cs (Operator::Define): Perform extensive checks to conform
32127 with the rules for operator overloading in the spec.
32129 * expression.cs (Expression::ImplicitReferenceConversion): Implement
32130 some of the other conversions mentioned in the spec.
32132 * typemanager.cs (array_type): New static member for the System.Array built-in
32135 (cloneable_interface): For System.ICloneable interface.
32137 * driver.cs (Driver::Driver): Initialize TypeManager's core types even before
32138 we start resolving the tree and populating types.
32140 * ../errors/errors.txt : Update for error numbers -7, -8, -9, -10
32142 2001-10-01 Miguel de Icaza <miguel@ximian.com>
32144 * expression.cs (Expression::ExprClassFromMemberInfo,
32145 Expression::Literalize): Create literal expressions from
32146 FieldInfos which are literals.
32148 (ConvertNumericExplicit, ImplicitNumericConversion): Fix a few
32149 type casts, because they were wrong. The test suite in tests
32152 (ImplicitNumericConversion): ushort to ulong requires a widening
32155 Int32 constant to long requires widening cast as well.
32157 * literal.cs (LongLiteral::EmitLong): Do not generate i4 constants
32158 for integers because the type on the stack is not i4.
32160 2001-09-30 Miguel de Icaza <miguel@ximian.com>
32162 * expression.cs (report118): require location argument.
32164 * parameter.cs: Do not dereference potential null value.
32166 * class.cs: Catch methods that lack the `new' keyword when
32167 overriding a name. Report warnings when `new' is used without
32168 anything being there to override.
32170 * modifiers.cs: Handle `NEW' as MethodAttributes.NewSlot.
32172 * class.cs: Only add constructor to hashtable if it is non-null
32173 (as now constructors can fail on define).
32175 (TypeManager, Class, Struct): Take location arguments.
32177 Catch field instance initialization in structs as errors.
32179 accepting_filter: a new filter for FindMembers that is static so
32180 that we dont create an instance per invocation.
32182 (Constructor::Define): Catch errors where a struct constructor is
32185 * cs-parser.jay: Pass location information for various new
32188 * delegate.cs (Delegate): take a location argument.
32190 * driver.cs: Do not call EmitCode if there were problesm in the
32191 Definition of the types, as many Builders wont be there.
32193 * decl.cs (Decl::Decl): Require a location argument.
32195 * cs-tokenizer.cs: Handle properly hex constants that can not fit
32196 into integers, and find the most appropiate integer for it.
32198 * literal.cs: Implement ULongLiteral.
32200 * rootcontext.cs: Provide better information about the location of
32201 failure when CreateType fails.
32203 2001-09-29 Miguel de Icaza <miguel@ximian.com>
32205 * rootcontext.cs (RootContext::PopulateTypes): Populates structs
32208 * expression.cs (Binary::CheckShiftArguments): Add missing type
32210 (Binary::ResolveOperator): Add type to the logical and and logical
32211 or, Bitwise And/Or and Exclusive Or code paths, it was missing
32214 (Binary::DoNumericPromotions): In the case where either argument
32215 is ulong (and most signed types combined with ulong cause an
32216 error) perform implicit integer constant conversions as well.
32218 2001-09-28 Miguel de Icaza <miguel@ximian.com>
32220 * expression.cs (UserImplicitCast): Method should always be
32222 (Invocation::BetterConversion): Simplified test for IntLiteral.
32224 (Expression::ImplicitNumericConversion): Split this routine out.
32225 Put the code that performs implicit constant integer conversions
32228 (Expression::Resolve): Become a wrapper around DoResolve so we can
32229 check eclass and type being set after resolve.
32231 (Invocation::Badness): Remove this dead function
32233 (Binary::ResolveOperator): Do not compute the expensive argumnets
32234 unless we have a union for it.
32236 (Probe::Emit): Is needs to do an isinst and then
32237 compare against null.
32239 (::CanConvert): Added Location argument. If the Location argument
32240 is null (Location.Null), then we do not report errors. This is
32241 used by the `probe' mechanism of the Explicit conversion. We do
32242 not want to generate an error for something that the user
32243 explicitly requested to be casted. But the pipeline for an
32244 explicit cast first tests for potential implicit casts.
32246 So for now, if the Location is null, it means `Probe only' to
32247 avoid adding another argument. Might have to revise this
32250 (ClassCast): New class used to type cast objects into arbitrary
32251 classes (used in Explicit Reference Conversions).
32253 Implement `as' as well.
32255 Reverted all the patches from Ravi below: they were broken:
32257 * The use of `level' as a mechanism to stop recursive
32258 invocations is wrong. That was there just to catch the
32259 bug with a strack trace but not as a way of addressing
32262 To fix the problem we have to *understand* what is going
32263 on and the interactions and come up with a plan, not
32264 just get things going.
32266 * The use of the type conversion cache that I proposed
32267 last night had an open topic: How does this work across
32268 protection domains. A user defined conversion might not
32269 be public in the location where we are applying the
32270 conversion, a different conversion might be selected
32271 (ie, private A->B (better) but public B->A (worse),
32272 inside A, A->B applies, but outside it, B->A will
32275 * On top of that (ie, even if the above is solved),
32276 conversions in a cache need to be abstract. Ie, `To
32277 convert from an Int to a Short use an OpcodeCast', not
32278 `To convert from an Int to a Short use the OpcodeCast on
32279 the variable 5' (which is what this patch was doing).
32281 2001-09-28 Ravi Pratap <ravi@ximian.com>
32283 * expression.cs (Invocation::ConversionExists): Re-write to use
32284 the conversion cache
32286 (Expression::ConvertImplicit): Automatic bailing out if level != 0. Also
32287 cache all conversions done, not just user-defined ones.
32289 (Invocation::BetterConversion): The real culprit. Use ConversionExists
32290 to determine if a conversion exists instead of acutually trying to
32291 perform the conversion. It's faster too.
32293 (Expression::ConvertExplicit): Modify to use ConversionExists to check
32294 and only then attempt the implicit conversion.
32296 2001-09-28 Ravi Pratap <ravi@ximian.com>
32298 * expression.cs (ConvertImplicit): Use a cache for conversions
32299 already found. Check level of recursion and bail out if necessary.
32301 2001-09-28 Miguel de Icaza <miguel@ximian.com>
32303 * typemanager.cs (string_concat_string_string, string_concat_object_object):
32304 Export standard methods that we expect for string operations.
32306 * statement.cs (Block::UsageWarning): Track usage of variables and
32307 report the errors for not used variables.
32309 * expression.cs (Conditional::Resolve, ::Emit): Implement ?:
32312 2001-09-27 Miguel de Icaza <miguel@ximian.com>
32314 * codegen.cs: remove unnneded code
32316 * expression.cs: Removed BuiltinTypeAccess class
32318 Fix the order in which implicit conversions are
32321 The previous fixed dropped support for boxed conversions (adding a
32322 test to the test suite now)
32324 (UserImplicitCast::CanConvert): Remove test for source being null,
32325 that code is broken. We should not feed a null to begin with, if
32326 we do, then we should track the bug where the problem originates
32327 and not try to cover it up here.
32329 Return a resolved expression of type UserImplicitCast on success
32330 rather than true/false. Ravi: this is what I was talking about,
32331 the pattern is to use a static method as a "constructor" for
32334 Also, do not create arguments until the very last minute,
32335 otherwise we always create the arguments even for lookups that
32336 will never be performed.
32338 (UserImplicitCast::Resolve): Eliminate, objects of type
32339 UserImplicitCast are born in a fully resolved state.
32341 * typemanager.cs (InitCoreTypes): Init also value_type
32342 (System.ValueType).
32344 * expression.cs (Cast::Resolve): First resolve the child expression.
32346 (LValue): Add new method AddressOf to be used by
32349 Change the argument of Store to take an EmitContext instead of an
32350 ILGenerator, because things like FieldExpr need to be able to call
32351 their children expression to generate the instance code.
32353 (Expression::Error, Expression::Warning): Sugar functions for
32356 (Expression::MemberLookup): Accept a TypeContainer instead of a
32357 Report as the first argument.
32359 (Expression::ResolvePrimary): Killed. I still want to improve
32360 this as currently the code is just not right.
32362 (Expression::ResolveMemberAccess): Simplify, but it is still
32365 (Unary::Resolve): Catch errors in AddressOf operators.
32367 (LocalVariableReference::Emit, ::Store, ::AddressOf): typecast
32368 index to a byte for the short-version, or the compiler will choose
32369 the wrong Emit call, which generates the wrong data.
32371 (ParameterReference::Emit, ::Store): same.
32373 (FieldExpr::AddressOf): Implement.
32375 * typemanager.cs: TypeManager: made public variable instead of
32378 * driver.cs: document --fatal.
32380 * report.cs (ErrorMessage, WarningMessage): new names for the old
32381 Error and Warning classes.
32383 * cs-parser.jay (member_access): Turn built-in access to types
32384 into a normal simplename
32386 2001-09-27 Ravi Pratap <ravi@ximian.com>
32388 * expression.cs (Invocation::BetterConversion): Fix to cope
32389 with q being null, since this was introducing a bug.
32391 * expression.cs (ConvertImplicit): Do built-in conversions first.
32393 2001-09-27 Ravi Pratap <ravi@ximian.com>
32395 * expression.cs (UserImplicitCast::Resolve): Fix bug.
32397 2001-09-27 Ravi Pratap <ravi@ximian.com>
32399 * class.cs (TypeContainer::AddConstructor): Fix a stupid bug
32400 I had introduced long ago (what's new ?).
32402 * expression.cs (UserImplicitCast::CanConvert): Static method to do
32403 the work of all the checking.
32404 (ConvertImplicit): Call CanConvert and only then create object if necessary.
32405 (UserImplicitCast::CanConvert, ::Resolve): Re-write.
32407 (Unary::Operator): Rename Add and Subtract to Addition and Subtraction because
32408 that is the right way.
32410 (Invocation::MakeUnionSet): Convenience function to make unions of sets for
32411 overloading resolution. Use everywhere instead of cutting and pasting code.
32413 (Binary::ResolveOperator): Use MakeUnionSet.
32415 (UserImplicitCast::CanConvert, ::Resolve): Update to take care of the case when
32416 we have to convert to bool types. Not complete yet.
32418 2001-09-27 Miguel de Icaza <miguel@ximian.com>
32420 * typemanager.cs (TypeManager::CSharpName): support ushort.
32422 * expression.cs (Expression::TryImplicitIntConversion): Attempts
32423 to provide an expression that performsn an implicit constant int
32424 conversion (section 6.1.6).
32425 (Expression::ConvertImplicitRequired): Reworked to include
32426 implicit constant expression conversions.
32428 (Expression::ConvertNumericExplicit): Finished.
32430 (Invocation::Emit): If InstanceExpression is null, then it means
32431 that we perform a call on this.
32433 2001-09-26 Miguel de Icaza <miguel@ximian.com>
32435 * expression.cs (Unary::Emit): Remove some dead code.
32436 (Probe): Implement Resolve and Emit for `is'.
32437 (Expression::ConvertImplicitRequired): Attempt to do constant
32438 expression conversions here. Maybe should be moved to
32439 ConvertImplicit, but I am not sure.
32440 (Expression::ImplicitLongConstantConversionPossible,
32441 Expression::ImplicitIntConstantConversionPossible): New functions
32442 that tell whether is it possible to apply an implicit constant
32443 expression conversion.
32445 (ConvertNumericExplicit): Started work on explicit numeric
32448 * cs-parser.jay: Update operator constants.
32450 * parameter.cs (Parameters::GetParameterInfo): Hook up VerifyArgs
32451 (Parameters::GetSignature): Hook up VerifyArgs here.
32452 (Parameters::VerifyArgs): Verifies that no two arguments have the
32455 * class.cs (Operator): Update the operator names to reflect the
32456 ones that the spec expects (as we are just stringizing the
32459 * expression.cs (Unary::ResolveOperator): Fix bug: Use
32460 MethodInfo's ReturnType instead of LookupMethodByBuilder as the
32461 previous usage did only work for our methods.
32462 (Expression::ConvertImplicit): Handle decimal implicit numeric
32463 conversions as well.
32464 (Expression::InternalTypeConstructor): Used to invoke constructors
32465 on internal types for default promotions.
32467 (Unary::Emit): Implement special handling for the pre/post
32468 increment/decrement for overloaded operators, as they need to have
32469 the same semantics as the other operators.
32471 (Binary::ResolveOperator): ditto.
32472 (Invocation::ConversionExists): ditto.
32473 (UserImplicitCast::Resolve): ditto.
32475 2001-09-26 Ravi Pratap <ravi@ximian.com>
32477 * expression.cs (Unary::Emit and Binary::Emit): If we have an overloaded
32478 operator, return after emitting body. Regression tests pass again !
32480 * expression.cs (ConvertImplicit): Take TypeContainer as first argument
32481 (Unary::ForceConversion, Binary::ForceConversion): Ditto.
32482 (Invocation::OverloadResolve): Ditto.
32483 (Invocation::BetterFunction, BetterConversion, ConversionExists): Ditto.
32485 * everywhere : update calls to the above methods accordingly.
32487 2001-09-26 Miguel de Icaza <miguel@ximian.com>
32489 * assign.cs (Assign): Make it inherit from ExpressionStatement.
32491 * expression.cs (ExpressionStatement): New base class used for
32492 expressions that can appear in statements, so that we can provide
32493 an alternate path to generate expression that do not leave a value
32496 (Expression::Emit, and all the derivatives): We no longer return
32497 whether a value is left on the stack or not. Every expression
32498 after being emitted leaves a single value on the stack.
32500 * codegen.cs (EmitContext::EmitStatementExpression): Use the
32501 facilties of ExpressionStatement if possible.
32503 * cs-parser.jay: Update statement_expression.
32505 2001-09-25 Miguel de Icaza <miguel@ximian.com>
32507 * driver.cs: Change the wording of message
32509 2001-09-25 Ravi Pratap <ravi@ximian.com>
32511 * expression.cs (Binary::ResolveOperator): Had forgottten to set
32512 the type of the expression to the return type of the method if
32513 we have an overloaded operator match ! The regression tests pass again !
32514 (Unary::ResolveOperator): Ditto.
32516 * expression.cs (Invocation::ConversionExists): Correct the member lookup
32517 to find "op_Implicit", not "implicit" ;-)
32518 (UserImplicitCast): New class to take care of user-defined implicit conversions.
32519 (ConvertImplicit, ForceConversion): Take TypeContainer argument
32521 * everywhere : Correct calls to the above accordingly.
32523 * expression.cs (UserImplicitCast::Resolve, ::Emit): Implement.
32524 (ConvertImplicit): Do user-defined conversion if it exists.
32526 2001-09-24 Miguel de Icaza <miguel@ximian.com>
32528 * assign.cs: track location.
32529 (Resolve): Use implicit conversions on assignment.
32531 * literal.cs: Oops. Not good, Emit of short access values should
32532 pass (Bytes) or the wrong argument will be selected.
32534 * expression.cs (Unary::Emit): Emit code for -expr.
32536 (Unary::ResolveOperator): Handle `Substract' for non-constants
32537 (substract from zero from the non-constants).
32538 Deal with Doubles as well.
32540 (Expression::ConvertImplicitRequired): New routine that reports an
32541 error if no implicit conversion exists.
32543 (Invocation::OverloadResolve): Store the converted implicit
32544 expressions if we make them
32546 2001-09-24 Ravi Pratap <ravi@ximian.com>
32548 * class.cs (ConstructorInitializer): Take a Location argument.
32549 (ConstructorBaseInitializer): Same here.
32550 (ConstructorThisInitializer): Same here.
32552 * cs-parser.jay : Update all calls accordingly.
32554 * expression.cs (Unary, Binary, New): Take location argument.
32555 Update accordingly everywhere.
32557 * cs-parser.jay : Update all calls to the above to take a location
32560 * class.cs : Ditto.
32562 2001-09-24 Ravi Pratap <ravi@ximian.com>
32564 * expression.cs (Invocation::BetterFunction): Take TypeContainer argument
32565 (Invocation::BetterConversion): Same here
32566 (Invocation::ConversionExists): Ditto.
32568 (Invocation::ConversionExists): Implement.
32570 2001-09-22 Ravi Pratap <ravi@ximian.com>
32572 * expression.cs (OverloadResolve): Improve some more to catch errors 1502 and 1503
32573 Also take an additional TypeContainer argument.
32575 * All over : Pass in TypeContainer as argument to OverloadResolve.
32577 * typemanager.cs (CSharpName): Update to check for the string type and return
32580 * expression.cs (Invocation::FullMethodDesc): New static method to return a string fully describing
32583 2001-09-21 Ravi Pratap <ravi@ximian.com>
32585 * expression.cs (Invocation::OverloadResolve): Re-write to conform more to the spec.
32586 (Invocation::BetterFunction): Implement.
32587 (Invocation::BetterConversion): Implement.
32588 (Invocation::ConversionExists): Skeleton, no implementation yet.
32590 Okay, things work fine !
32592 2001-09-21 Miguel de Icaza <miguel@ximian.com>
32594 * typemanager.cs: declare and load enum_type, delegate_type and
32597 * expression.cs (Expression::Emit): Now emit returns a value that
32598 tells whether a value is left on the stack or not. This strategy
32599 might be reveted tomorrow with a mechanism that would address
32600 multiple assignments.
32601 (Expression::report118): Utility routine to report mismatches on
32604 (Unary::Report23): Report impossible type/operator combination
32607 (Unary::IsIncrementableNumber): Whether the type can be
32608 incremented or decremented with add.
32609 (Unary::ResolveOperator): Also allow enumerations to be bitwise
32611 (Unary::ResolveOperator): Implement ++, !, ~,
32613 (Invocation::Emit): Deal with new Emit convetion.
32615 * All Expression derivatives: Updated their Emit method to return
32616 whether they leave values on the stack or not.
32618 * codegen.cs (CodeGen::EmitStatement): Pop values left on the
32619 stack for expressions that are statements.
32621 2001-09-20 Miguel de Icaza <miguel@ximian.com>
32623 * expression.cs (LValue): New interface. Must be implemented by
32625 (LocalVariableReference, ParameterReference, FieldExpr): Implement
32628 * assign.cs (Assign::Emit, Assign::Resolve): Use new LValue
32629 interface for generating code, simplifies the code.
32631 2001-09-20 Ravi Pratap <ravi@ximian.com>
32633 * expression.cs (everywhere): Comment out return statements in ::Resolve
32634 methods to avoid the warnings.
32636 2001-09-20 Miguel de Icaza <miguel@ximian.com>
32638 * driver.cs (parse): Report error 2001 if we can not open the
32641 * expression.cs (SimpleName::ResolveSimpleName): Error if we can
32644 * cs-parser.jay (QualifierIdentifier): Pass location to SimpleName
32647 * statement.cs (Block::EmitMeta): Reuse the count across all the variables,
32648 otherwise nested blocks end up with the same index.
32650 * codegen.cs (CodeGen::EmitTopBlock): Pass initial sequence
32652 * expression.cs: Instead of having FIXMEs in the Resolve
32653 functions, throw exceptions so it is obvious that we are facing a
32656 * cs-parser.jay (invocation_expression): Pass Location information.
32658 * codegen.cs (CodeGen::Save, CodeGen::CodeGen, CodeGen::Basename):
32659 Use a basename for those routines because .NET does not like paths
32662 * class.cs (TypeContainer::AddMethod): Do not call DefineName if the name was
32665 2001-09-19 Miguel de Icaza <miguel@ximian.com>
32667 * typemanager.cs (TypeManager::CoreLookupType): A function to make sure that we
32668 are loading the correct data types (throws an exception if not).
32669 (TypeManager::InitCoreTypes): Use CoreLookupType
32671 * expression.cs (Unary::ResolveOperator): return the child
32672 expression for expressions which are just +expr.
32673 (Unary::ResolveOperator): Return negative literals for -LITERAL
32674 expressions (otherwise they are Unary {Literal}).
32675 (Invocation::Badness): Take into account `Implicit constant
32676 expression conversions'.
32678 * literal.cs (LongLiteral): Implement long literal class.
32679 (IntLiteral): export the `Value' of the intliteral.
32681 2001-09-19 Ravi Pratap <ravi@ximian.com>
32683 * expression.cs (Binary::Emit): Finally get the emission right ! Woo!
32685 * class.cs (Operator::Define): Change the methodname prefix to 'op_'
32686 instead of 'Operator'
32688 * expression.cs (Binary::ResolveOperator): Update accordingly.
32689 (Unary::Operator): Change names to 'Add' and 'Subtract' instead 'Plus'
32692 * cs-parser.jay (unary_expression): Update to use the new names.
32694 * gen-treedump.cs (GetUnary): Same here.
32696 * expression.cs (Unary::Resolve): Implement.
32697 (Binary::ResolveOperator): Re-write bits to quietly continue if no overloaded
32698 operators are found instead of making noise ;-)
32699 (Unary::ResolveOperator): New method to do precisely the same thing which
32700 Binary::ResolveOperator does for Binary expressions.
32701 (Unary.method, .Arguments): Add.
32702 (Unary::OperName): Implement.
32703 (Unary::ForceConversion): Copy and Paste !
32705 * class.cs (Operator::Define): Fix a small bug for the case when we have
32708 * expression.cs (Unary::Emit): Implement. Need to find the right Opcodes
32709 for the inbuilt operators. Only overloading works for now ;-)
32711 2001-09-18 Miguel de Icaza <miguel@ximian.com>
32713 * expression.cs (CheckedExpr::Resolve, CheckedExpr::Emit,
32714 UnCheckedExpr::Resolve, UnCheckedExpr::Emit): Implement.
32716 * expression.cs (This::Emit): Implement.
32717 (This::Resolve): Implement.
32718 (TypeOf:Resolve): Implement.
32719 (Expression::ResolveSimpleName): Add an implicit this to instance
32721 (MemberAccess::Resolve): Deal with Parameters and Fields.
32722 Bind instance variable to Field expressions.
32723 (FieldExpr::Instance): New field used to track the expression that
32724 represents the object instance.
32725 (FieldExpr::Resolve): Track potential errors from MemberLookup not
32727 (FieldExpr::Emit): Implement.
32729 * codegen.cs (EmitIf, EmitStatement, EmitBlock): Propagate whether
32730 the last instruction contains a return opcode to avoid generating
32731 the last `ret' instruction (this generates correct code, and it is
32732 nice to pass the peverify output).
32734 * class.cs (TypeContainer::EmitFieldInitializers): Implement field
32735 initializer for static and instance variables.
32736 (Constructor::Emit): Allow initializer to be null in the case of
32737 static constructors. Only emit initializer for instance
32740 (TypeContainer::FindMembers): Return a null array if there are no
32743 Also fix the code for the MemberTypes.Method branch, as it was not
32744 scanning that for operators (or tried to access null variables before).
32746 * assign.cs (Assign::Emit): Handle instance and static fields.
32750 * driver.cs: Stop compilation if there are parse errors.
32752 * cs-parser.jay (constructor_declaration): Provide default base
32753 initializer for non-static constructors.
32754 (constructor_declarator): Do not provide a default base
32755 initializers if none was specified.
32756 Catch the fact that constructors should not have parameters.
32758 * class.cs: Do not emit parent class initializers for static
32759 constructors, that should be flagged as an error.
32761 2001-09-18 Ravi Pratap <ravi@ximian.com>
32763 * class.cs (RegisterMethodBuilder): Remove : it's unnecessary.
32764 Move back code into TypeContainer::Populate.
32766 2001-09-18 Ravi Pratap <ravi@ximian.com>
32768 * class.cs (TypeContainer::AddConstructor): Fix the check to
32769 compare against Name, not Basename.
32770 (Operator::OpType): Change Plus and Minus to Add and Subtract.
32772 * cs-parser.jay : Update accordingly.
32774 * class.cs (TypeContainer::FindMembers): For the case where we are searching
32775 for methods, don't forget to look into the operators too.
32776 (RegisterMethodBuilder): Helper method to take care of this for
32777 methods, constructors and operators.
32778 (Operator::Define): Completely revamp.
32779 (Operator.OperatorMethod, MethodName): New fields.
32780 (TypeContainer::Populate): Move the registering of builders into
32781 RegisterMethodBuilder.
32782 (Operator::Emit): Re-write.
32784 * expression.cs (Binary::Emit): Comment out code path to emit method
32785 invocation stuff for the case when we have a user defined operator. I am
32786 just not able to get it right !
32788 2001-09-17 Miguel de Icaza <miguel@ximian.com>
32790 * expression.cs (Expression::OverloadResolve): Drop TypeContainer
32793 (Expression::MemberLookup): Provide a version that allows to
32794 specify the MemberTypes and BindingFlags.
32796 * statement.cs (Block::GetVariableInfo): Forgot to recurse here,
32797 so it was not fetching variable information from outer blocks.
32799 * modifiers.cs: (Modifiers::TypeAttr): Invert condition on
32800 Beforefieldinit as it was buggy.
32802 * rootcontext.cs (::LookupInterfaceOrClass): Removed an Error -200
32803 that Ravi put here.
32805 * class.cs (Constructor::Emit): Only emit if block is not null.
32806 (TypeContainer::EmitDefaultConstructor): Removed routine, now we
32807 deal with this by semantically definining it as if the user had
32810 (TypeContainer::FindMembers): Removed ad-hoc hack to deal with
32811 constructors as we now "emit" them at a higher level.
32813 (TypeContainer::DefineDefaultConstructor): Used to define the
32814 default constructors if none was provided.
32816 (ConstructorInitializer): Add methods Resolve and Emit.
32818 * expression.cs: Cast to ConstructorInfo instead of MethodInfo
32820 2001-09-17 Ravi Pratap <ravi@ximian.com>
32822 * class.cs (TypeContainer::EmitDefaultConstructor): Register
32823 the default constructor builder with our hashtable for methodbuilders
32826 * expression.cs (Invocation::OverloadResolve): Add a check for pd == null
32827 and argument_count is 0 in which case we have a match.
32828 (Binary::ResolveOperator): More null checking and miscellaneous coding
32831 2001-09-17 Ravi Pratap <ravi@ximian.com>
32833 * rootcontext.cs (IsNameSpace): Compare against null.
32835 * everywhere : Correct spelling to 'Greater' and to 'Subtract'
32837 * class.cs (Operator::OpType): Change names to match the ones in Binary::Operator
32838 and Unary::Operator.
32840 * cs-parser.jay (operator_declaration, CheckBinaryOperator, CheckUnaryOperator): Update
32843 * expression.cs (Binary::method): New member to hold the MethodBase for the case when
32844 we have overloaded operators.
32845 (Binary::ResolveOperator): Implement the part which does the operator overload
32848 * class.cs (Operator::Emit): Implement.
32849 (TypeContainer::Emit): Emit the operators we have too.
32851 * expression.cs (Binary::Emit): Update to emit the appropriate code for
32852 the case when we have a user-defined operator.
32854 2001-09-17 Miguel de Icaza <miguel@ximian.com>
32856 * rootcontext.cs: Fix bug: tree.Namespaces might be null.
32858 2001-09-16 Ravi Pratap <ravi@ximian.com>
32860 * class.cs (EmitStaticFieldInitializers, EmitFieldInitializers): Make public.
32861 (TypeContainer::EmitConstructor): Remove and move code into Contructor::Emit.
32862 (Constructor::Emit): Implement.
32863 (EmitStaticFieldInitializers, EmitFieldInitializers): Ensure we return immediately
32864 if we have no work to do.
32865 (TypeContainer::Emit): Pass in TypeContainer as argument to the constructor's
32868 * interface.cs (Interface::InterfaceAttr): Re-write to be more correct and complete.
32869 (Interface::IsTopLevel): Add. Same as TypeContainer::IsTopLevel.
32871 * class.cs (TypeContainer::IsTopLevel): Modify to use parent.Parent instead
32874 2001-09-15 Ravi Pratap <ravi@ximian.com>
32876 * tree.cs (Tree::namespaces): New hashtable to keep track of namespaces
32878 (Tree::RecordNamespace): Method to do what the name says ;-)
32879 (Tree::Namespaces): Property to get at the namespaces hashtable.
32881 * cs-parser.jay (namespace_declaration): Call RecordNamespace to
32884 * rootcontext.cs (IsNamespace): Fixed it :-)
32886 2001-09-14 Miguel de Icaza <miguel@ximian.com>
32888 * class.cs (TypeContainer::FindMembers): Add support for
32890 (MethodCore): New class that encapsulates both the shared aspects
32891 of a Constructor and a Method.
32892 (Method, Constructor): Factored pieces into MethodCore.
32894 * driver.cs: Added --fatal which makes errors throw exceptions.
32895 Load System assembly as well as part of the standard library.
32897 * report.cs: Allow throwing exceptions on errors for debugging.
32899 * modifiers.cs: Do not use `parent', instead use the real type
32900 container to evaluate permission settings.
32902 * class.cs: Put Ravi's patch back in. He is right, and we will
32903 have to cope with the
32905 2001-09-14 Ravi Pratap <ravi@ximian.com>
32907 * modifiers.cs (TypeAttr, MethodAttr, FieldAttr): Map protected internal to
32908 FamORAssem, not FamANDAssem.
32910 2001-09-14 Miguel de Icaza <miguel@ximian.com>
32912 * driver.cs: Added --parse option that only parses its input files
32915 * class.cs: Reverted last change from Ravi to IsTopLevel. That is
32916 incorrect. IsTopLevel is not used to tell whether an object is
32917 root_types or not (that can be achieved by testing this ==
32918 root_types). But to see if this is a top-level *class* (not
32919 necessarly our "toplevel" container).
32921 2001-09-14 Ravi Pratap <ravi@ximian.com>
32923 * enum.cs (Enum::Define): Modify to call the Lookup method on the
32924 parent instead of a direct call to GetType.
32926 2001-09-14 Ravi Pratap <ravi@ximian.com>
32928 * class.cs (TypeContainer::TypeAttr): Remove property code and move it into
32929 Modifiers.TypeAttr. This should just be a call to that method.
32931 * modifiers.cs (TypeAttr): Re-write and take an extra argument, the TypeContainer
32932 object so that we can determine if we are top-level or not.
32934 * delegate.cs (Delegate::Define): Update call to TypeAttr method to pass in the
32937 * enum.cs (Enum::Define): Ditto.
32939 * modifiers.cs (FieldAttr): Re-write.
32941 * class.cs (TypeContainer::IsTopLevel): Change accessibility to public.
32942 (TypeContainer::HaveStaticConstructor): New property to provide access
32943 to precisely that info.
32945 * modifiers.cs (MethodAttr): Re-write.
32946 (EventAttr): Remove altogether as there seems to be no ostensible use for it.
32948 * class.cs (TypeContainer::IsTopLevel): Re-write. root_types doesn't seem to be the parent
32949 of top-level types as claimed.
32951 2001-09-13 Miguel de Icaza <miguel@ximian.com>
32953 * expression.cs (MemberLookup): Fruitless attempt to lookup
32954 constructors. Maybe I need to emit default constructors? That
32955 might be it (currently .NET emits this for me automatically).
32956 (Invocation::OverloadResolve): Cope with Arguments == null.
32957 (Invocation::EmitArguments): new function, shared by the new
32958 constructor and us.
32959 (Invocation::Emit): Handle static and instance methods. Emit
32960 proper call instruction for virtual or non-virtual invocations.
32961 (New::Emit): Implement.
32962 (New::Resolve): Implement.
32963 (MemberAccess:Resolve): Implement.
32964 (MethodGroupExpr::InstanceExpression): used conforming to the spec
32965 to track instances.
32966 (FieldExpr::Resolve): Set type.
32968 * support.cs: Handle empty arguments.
32970 * cs-parser.jay (CompositeLookup, QualifierIdentifier,
32971 SimpleLookup): Auxiliary routines to help parse a qualifier
32974 Update qualifier_identifier rule.
32976 * codegen.cs: Removed debugging messages.
32978 * class.cs: Make this a global thing, this acts just as a "key" to
32979 objects that we might have around.
32981 (Populate): Only initialize method_builders_to_methods once.
32983 * expression.cs (PropertyExpr): Initialize type from the
32986 * codegen.cs (EmitContext::EmitBoolExpression): Use propper
32987 Resolve pattern. Attempt to implicitly convert value to boolean.
32990 * expression.cs: Set the type for the int32/int32 argument case.
32991 (Binary::ResolveOperator): Set the return type to boolean for
32992 comparission operators
32994 * typemanager.cs: Remove debugging print code.
32996 (Invocation::Resolve): resolve type.
32998 * class.cs: Allocate a MemberInfo of the correct size, as the code
32999 elsewhere depends on the test to reflect the correct contents.
33001 (Method::) Keep track of parameters, due to System.Reflection holes
33003 (TypeContainer::Populate): Keep track of MethodBuilders to Method
33006 (TypeContainer::FindMembers): Use ArrayList and then copy an array
33007 of the exact size and return that.
33009 (Class::LookupMethodByBuilder): New function that maps
33010 MethodBuilders to its methods. Required to locate the information
33011 on methods because System.Reflection bit us again.
33013 * support.cs: New file, contains an interface ParameterData and
33014 two implementations: ReflectionParameters and InternalParameters
33015 used to access Parameter information. We will need to grow this
33018 * expression.cs (Invocation::GetParameterData): implement a cache
33019 and a wrapper around the ParameterData creation for methods.
33020 (Invocation::OverloadResolve): Use new code.
33022 2001-09-13 Ravi Pratap <ravi@ximian.com>
33024 * class.cs (TypeContainer::EmitField): Remove and move into
33025 (Field::Define): here and modify accordingly.
33026 (Field.FieldBuilder): New member.
33027 (TypeContainer::Populate): Update accordingly.
33028 (TypeContainer::FindMembers): Implement.
33030 2001-09-13 Miguel de Icaza <miguel@ximian.com>
33032 * statement.cs: (VariableInfo::VariableType): New field to be
33033 initialized with the full type once it is resolved.
33035 2001-09-12 Miguel de Icaza <miguel@ximian.com>
33037 * parameter.cs (GetParameterInfo): Use a type cache to compute
33038 things only once, and to reuse this information
33040 * expression.cs (LocalVariableReference::Emit): Implement.
33041 (OpcodeCast::Emit): fix.
33043 (ParameterReference::Resolve): Implement.
33044 (ParameterReference::Emit): Implement.
33046 * cs-parser.jay: Fix bug introduced by Ravi, variable initializers
33047 that are expressions need to stay as Expressions.
33049 * typemanager.cs (CSharpName): Returns the C# name of a type if
33052 * expression.cs (Expression::ConvertImplicit): New function that
33053 implements implicit type conversions.
33055 (Expression::ImplicitReferenceConversion): Implements implicit
33056 reference conversions.
33058 (EmptyCast): New type for transparent casts.
33060 (OpcodeCast): New type for casts of types that are performed with
33061 a sequence of bytecodes.
33063 (BoxedCast): New type used for casting value types into reference
33064 types. Emits a box opcode.
33066 (Binary::DoNumericPromotions): Implements numeric promotions of
33067 and computation of the Binary::Type.
33069 (Binary::EmitBranchable): Optimization.
33071 (Binary::Emit): Implement code emission for expressions.
33073 * typemanager.cs (TypeManager): Added two new core types: sbyte
33076 2001-09-12 Ravi Pratap <ravi@ximian.com>
33078 * class.cs (TypeContainer::FindMembers): Method which does exactly
33079 what Type.FindMembers does, only we don't have to use reflection. No
33080 implementation yet.
33082 * typemanager.cs (typecontainers): New hashtable to hold the corresponding
33083 typecontainer objects as we need to get at them.
33084 (TypeManager::AddUserType): Overload to take an extra argument, the TypeContainer.
33086 * rootcontext.cs : Correspondingly modify called to AddUserType to pass the
33087 typecontainer object.
33089 * expression.cs (MemberLookup): Modify signature to take a RootContext object instead
33090 of just a Report object.
33092 2001-09-11 Ravi Pratap <ravi@ximian.com>
33094 * class.cs (Event::Define): Go back to using the prefixes "add_" and
33096 (TypeContainer::Populate): Now define the delegates of the type too.
33097 (TypeContainer.Delegates): Property to access the list of delegates defined
33100 * delegates.cs (Delegate::Define): Implement partially.
33102 * modifiers.cs (TypeAttr): Handle more flags.
33104 2001-09-11 Ravi Pratap <ravi@ximian.com>
33106 * class.cs (Indexer::Define): Fix for loop iteration condition to be just <
33108 (Operator::Define): Re-write logic to get types by using the LookupType method
33109 instead of blindly doing a Type.GetType ! How stupid can I get ;-) ?
33110 (Indexer::Define): Ditto.
33111 (Event::Define): Ditto.
33112 (Property::Define): Ditto.
33114 2001-09-10 Ravi Pratap <ravi@ximian.com>
33116 * class.cs (TypeContainer::Populate): Now define operators too.
33117 (TypeContainer.Operators): New property to access the list of operators
33119 (Operator.OperatorMethodBuilder): New member to hold the method builder
33120 for the operator we are defining.
33121 (Operator::Define): Implement.
33123 2001-09-10 Ravi Pratap <ravi@ximian.com>
33125 * class.cs (Event::Define): Make the prefixes of the accessor methods
33126 addOn_ and removeOn_
33128 * genericparser.cs (GenericParser::error): Overloaded method to handle the case
33129 of the location being passed in too. Ideally, this should go later since all
33130 error reporting should be done through the Report object.
33132 * class.cs (TypeContainer.Indexers): New property to access the list of indexers.
33133 (Populate): Iterate thru the indexers we have and define them too.
33134 (Indexer.GetMethodBuilder, .SetMethodBuilder): New members to hold the method builders
33135 for the get and set accessors.
33136 (Indexer::Define): Implement.
33138 2001-09-09 Miguel de Icaza <miguel@ximian.com>
33140 * expression.cs (Binary::Resolve): Beginning of it. I scratched
33141 my previous implementation, did not work.
33143 * typemanager.cs: Add a couple of missing types (the longs).
33145 * literal.cs: Use TypeManager.bool_type instead of getting it.
33147 * expression.cs (EventExpr): New kind of expressions.
33148 (Expressio::ExprClassFromMemberInfo): finish
33150 2001-09-08 Miguel de Icaza <miguel@ximian.com>
33152 * assign.cs: Emit stores to static fields differently.
33154 2001-09-08 Ravi Pratap <ravi@ximian.com>
33156 * Merge in changes and adjust code to tackle conflicts. Backed out my
33157 code in Assign::Resolve ;-)
33159 2001-09-08 Ravi Pratap <ravi@ximian.com>
33161 * cs-parser.jay (CheckAttributeTarget): Modify call to error to use
33162 instead Report.Error and also pass in the location.
33163 (CSharpParser::Lexer): New readonly property to return the reference
33164 to the Tokenizer object.
33165 (declare_local_variables): Use Report.Error with location instead of plain
33169 * class.cs (Operator::CheckUnaryOperator): Move into cs-parser.jay.
33170 (Operator.CheckBinaryOperator): Ditto.
33172 * cs-parser.jay (operator_declarator): Update accordingly.
33174 * cs-parser.jay (CheckUnaryOperator): Modify to use Report.Error
33175 (CheckBinaryOperator): Same here.
33177 * rootcontext.cs (LookupType): Add an extra lookup which simply does a lookup
33178 on the name without any prefixes of namespace names etc. This is because we
33179 already might have something already fully qualified like
33180 'System.Console.WriteLine'
33182 * assign.cs (Resolve): Begin implementation. Stuck ;-)
33184 2001-09-07 Ravi Pratap <ravi@ximian.com>
33186 * cs-tokenizer.cs (location): Return a string which also contains
33189 * expression.cs (ElementAccess): New class for expressions of the
33190 type 'element access.'
33191 (BaseAccess): New class for expressions of the type 'base access.'
33192 (CheckedExpr, UnCheckedExpr): New classes for Checked and Unchecked expressions
33195 * cs-parser.jay (element_access): Implement action.
33196 (base_access): Implement actions.
33197 (checked_expression, unchecked_expression): Implement.
33199 * cs-parser.jay (local_variable_type): Correct and implement.
33200 (type_suffixes, type_suffix_list, type_suffix): Implement actions.
33202 * cs-tokenizer.cs (real_type_suffix): Comment out the extra getchar.
33204 * cs-parser.jay (rank_specifiers): Remove space while concatenating the type's
33205 name and the specifiers.
33207 * interface.cs (InterfaceAttr): New property to return the corresponding TypeAttributes
33209 * rootcontext.cs (CreateInterface): Use the InterfaceAttr property instead of
33210 making them all public ;-)
33212 * cs-parser.jay (error): Remove entirely as we have an implementation in the base
33215 2001-09-07 Miguel de Icaza <miguel@ximian.com>
33217 * expression.cs (ExprClassFromMemberInfo): Return FieldExpr and
33219 (FieldExpr, PropertyExprs): New resolved expressions.
33220 (SimpleName::MemberStaticCheck): Perform static checks for access
33221 to non-static fields on static methods. Maybe this should be
33222 generalized for MemberAccesses.
33223 (SimpleName::ResolveSimpleName): More work on simple name
33226 * cs-parser.jay (primary_expression/qualified_identifier): track
33227 the parameter index.
33229 * codegen.cs (CodeGen::Save): Catch save exception, report error.
33230 (EmitContext::EmitBoolExpression): Chain to expression generation
33231 instead of temporary hack.
33232 (::EmitStatementExpression): Put generic expression code generation.
33234 * assign.cs (Assign::Emit): Implement variable assignments to
33235 local variables, parameters and fields.
33237 2001-09-06 Miguel de Icaza <miguel@ximian.com>
33239 * statement.cs (Block::GetVariableInfo): New method, returns the
33240 VariableInfo for a variable name in a block.
33241 (Block::GetVariableType): Implement in terms of GetVariableInfo
33243 * literal.cs (IntLiteral::Emit, FloatLiteral::Emit,
33244 DoubleLiteral::Emit, CharLiteral::Emit, BoolLiteral::Emit): Implement
33246 2001-09-06 Ravi Pratap <ravi@ximian.com>
33248 * cs-parser.jay (operator_declaration): Continue on my quest : update
33249 to take attributes argument.
33250 (event_declaration): Ditto.
33251 (enum_declaration): Ditto.
33252 (indexer_declaration): Ditto.
33254 * class.cs (Operator::Operator): Update constructor accordingly.
33255 (Event::Event): Ditto.
33257 * delegate.cs (Delegate::Delegate): Same here.
33259 * enum.cs (Enum::Enum): Same here.
33261 2001-09-05 Ravi Pratap <ravi@ximian.com>
33263 * cs-parser.jay (CheckAttributeTarget): Update to use the right error number.
33265 * ../tests/cs0658.cs : New file to demonstrate error 0658.
33267 * attribute.cs (Attributes): New class to encapsulate all attributes which were
33268 being passed around as an arraylist.
33269 (Attributes::AddAttribute): Method to add attribute sections.
33271 * cs-parser.jay (opt_attributes): Modify actions to use the new Attributes class.
33272 (struct_declaration): Update accordingly.
33273 (constant_declaration): Update.
33274 (field_declaration): Update.
33275 (method_header): Update.
33276 (fixed_parameter): Update.
33277 (parameter_array): Ditto.
33278 (property_declaration): Ditto.
33279 (destructor_declaration): Ditto.
33281 * class.cs (Struct::Struct): Update constructors accordingly.
33282 (Class::Class): Ditto.
33283 (Field::Field): Ditto.
33284 (Method::Method): Ditto.
33285 (Property::Property): Ditto.
33286 (TypeContainer::OptAttribute): update property's return type.
33288 * interface.cs (Interface.opt_attributes): New member.
33289 (Interface::Interface): Update to take the extra Attributes argument.
33291 * parameter.cs (Parameter::Parameter): Ditto.
33293 * constant.cs (Constant::Constant): Ditto.
33295 * interface.cs (InterfaceMemberBase): New OptAttributes field.
33296 (InterfaceMemberBase::InterfaceMemberBase): Update constructor to take
33297 the attributes as a parameter.
33298 (InterfaceProperty): Update constructor call.
33299 (InterfaceEvent): Ditto.
33300 (InterfaceMethod): Ditto.
33301 (InterfaceIndexer): Ditto.
33303 * cs-parser.jay (interface_indexer_declaration): Update call to constructor to
33304 pass the attributes too.
33305 (interface_event_declaration): Ditto.
33306 (interface_property_declaration): Ditto.
33307 (interface_method_declaration): Ditto.
33308 (interface_declaration): Ditto.
33310 2001-09-05 Miguel de Icaza <miguel@ximian.com>
33312 * class.cs (Method::Define): Track the "static Main" definition to
33313 create an entry point.
33315 * rootcontext.cs (RootContext::EntryPoint): MethodInfo that holds the
33316 EntryPoint if we find it.
33318 * codegen.cs (EmitContext::EmitInvocation): Emit invocations.
33319 (EmitContext::ig): Make this variable public.
33321 * driver.cs: Make the default output file be the first file name
33322 with the .exe extension.
33324 Detect empty compilations
33326 Handle various kinds of output targets. Handle --target and
33327 rename -t to --dumper.
33329 * expression.cs, literal.cs, assign.cs, constant.cs: All `Resolve'
33330 methods inherited from Expression return now an Expression. This
33331 will is used during the tree rewriting as we resolve them during
33334 (Expression::MemberLookup): Implements the MemberLookup (7.3) from
33335 the spec. Missing entirely is the information about
33336 accessability of elements of it.
33338 (Expression::ExprClassFromMemberInfo): New constructor for
33339 Expressions that creates a fully initialized Expression based on
33340 a MemberInfo that is one of Eventinfo, FieldINfo, PropertyInfo or
33343 (Invocation::Resolve): Begin implementing resolution of invocations.
33345 * literal.cs (StringLiteral): Implement Emit.
33347 2001-09-05 Ravi Pratap <ravi@ximian.com>
33349 * cs-parser.jay (error): Add new modifier because we are hiding an inherited
33352 2001-09-04 Ravi Pratap <ravi@ximian.com>
33354 * cs-parser.jay (attribute_arguments): Implement actions.
33355 (attribute): Fix bug in production. Implement action.
33356 (attribute_list): Implement.
33357 (attribute_target): Implement.
33358 (attribute_target_specifier, opt_target_specifier): Implement
33359 (CheckAttributeTarget): New method to check if the attribute target
33361 (attribute_section): Implement.
33362 (opt_attributes): Implement.
33364 * attribute.cs : New file to handle attributes.
33365 (Attribute): Class to hold attribute info.
33367 * cs-parser.jay (opt_attribute_target_specifier): Remove production
33368 (attribute_section): Modify production to use 2 different rules to
33369 achieve the same thing. 1 s/r conflict down !
33370 Clean out commented, useless, non-reducing dimension_separator rules.
33372 * class.cs (TypeContainer.attributes): New member to hold list
33373 of attributes for a type.
33374 (Struct::Struct): Modify to take one more argument, the attribute list.
33375 (Class::Class): Ditto.
33376 (Field::Field): Ditto.
33377 (Method::Method): Ditto.
33378 (Property::Property): Ditto.
33380 * cs-parser.jay (struct_declaration): Update constructor call to
33381 pass in the attributes too.
33382 (class_declaration): Ditto.
33383 (constant_declaration): Ditto.
33384 (field_declaration): Ditto.
33385 (method_header): Ditto.
33386 (fixed_parameter): Ditto.
33387 (parameter_array): Ditto.
33388 (property_declaration): Ditto.
33390 * constant.cs (Constant::Constant): Update constructor similarly.
33391 Use System.Collections.
33393 * parameter.cs (Parameter::Parameter): Update as above.
33395 2001-09-02 Ravi Pratap <ravi@ximian.com>
33397 * class.cs (TypeContainer::AddDelegate): New method to add a delegate.
33398 (TypeContainer.delegates): New member to hold list of delegates.
33400 * cs-parser.jay (delegate_declaration): Implement the action correctly
33401 this time as I seem to be on crack ;-)
33403 2001-09-02 Miguel de Icaza <miguel@ximian.com>
33405 * rootcontext.cs (RootContext::IsNamespace): new function, used to
33406 tell whether an identifier represents a namespace.
33408 * expression.cs (NamespaceExpr): A namespace expression, used only
33409 temporarly during expression resolution.
33410 (Expression::ResolveSimpleName, ::ResolvePrimary, ::ResolveName):
33411 utility functions to resolve names on expressions.
33413 2001-09-01 Miguel de Icaza <miguel@ximian.com>
33415 * codegen.cs: Add hook for StatementExpressions.
33417 * class.cs: Fix inverted test for static flag in methods.
33419 2001-09-02 Ravi Pratap <ravi@ximian.com>
33421 * class.cs (Operator::CheckUnaryOperator): Correct error number used
33422 to make it coincide with MS' number.
33423 (Operator::CheckBinaryOperator): Ditto.
33425 * ../errors/errors.txt : Remove error numbers added earlier.
33427 * ../errors/cs1019.cs : Test case for error # 1019
33429 * ../errros/cs1020.cs : Test case for error # 1020
33431 * cs-parser.jay : Clean out commented cruft.
33432 (dimension_separators, dimension_separator): Comment out. Ostensibly not
33433 used anywhere - non-reducing rule.
33434 (namespace_declarations): Non-reducing rule - comment out.
33436 * enum.cs (Enum::AddEnum): Rename to AddEnumMember as I was getting confused
33437 with TypeContainer::AddEnum.
33439 * delegate.cs : New file for delegate handling classes.
33440 (Delegate): Class for declaring delegates.
33442 * makefile : Update.
33444 * cs-parser.jay (delegate_declaration): Implement.
33446 2001-09-01 Ravi Pratap <ravi@che.iitm.ac.in>
33448 * class.cs (Event::Define): Implement.
33449 (Event.EventBuilder): New member.
33451 * class.cs (TypeContainer::Populate): Update to define all enums and events
33453 (Events): New property for the events arraylist we hold. Shouldn't we move to using
33454 readonly fields for all these cases ?
33456 2001-08-31 Ravi Pratap <ravi@che.iitm.ac.in>
33458 * class.cs (Property): Revamp to use the convention of making fields readonly.
33459 Accordingly modify code elsewhere.
33461 * class.cs : Apply patch from Mr. Mandar <go_mono@hotmail.com> for implementing
33462 the Define method of the Property class.
33464 * class.cs : Clean up applied patch and update references to variables etc. Fix
33466 (TypeContainer::Populate): Update to define all the properties we have. Also
33467 define all enumerations.
33469 * enum.cs (Define): Implement.
33471 2001-08-31 Ravi Pratap <ravi@che.iitm.ac.in>
33473 * cs-parser.jay (overloadable_operator): The semantic value is an
33474 enum of the Operator class.
33475 (operator_declarator): Implement actions.
33476 (operator_declaration): Implement.
33478 * class.cs (Operator::CheckUnaryOperator): New static method to help in checking
33479 validity of definitions.
33480 (Operator::CheckBinaryOperator): Static method to check for binary operators
33481 (TypeContainer::AddOperator): New method to add an operator to a type.
33483 * cs-parser.jay (indexer_declaration): Added line to actually call the
33484 AddIndexer method so it gets added ;-)
33486 * ../errors/errors.txt : Update to include new error numbers. Are these numbers
33487 already taken care of by the MS compiler ?
33489 2001-08-29 Ravi Pratap <ravi@che.iitm.ac.in>
33491 * class.cs (Operator): New class for operator declarations.
33492 (Operator::OpType): Enum for the various operators.
33494 2001-08-29 Ravi Pratap <ravi@che.iitm.ac.in>
33496 * class.cs (TypeContainer::AddIndexer): Remove FIXME comment. We
33497 ostensibly handle this in semantic analysis.
33499 * cs-parser.jay (general_catch_clause): Comment out
33500 (specific_catch_clauses, specific_catch_clause): Ditto.
33501 (opt_general_catch_clause, opt_specific_catch_clauses): Ditto
33502 (catch_args, opt_catch_args): New productions.
33503 (catch_clause): Rewrite to use the new productions above
33504 (catch_clauses): Modify accordingly.
33505 (opt_catch_clauses): New production to use in try_statement
33506 (try_statement): Revamp. Basically, we get rid of one unnecessary rule
33507 and re-write the code in the actions to extract the specific and
33508 general catch clauses by being a little smart ;-)
33510 * ../tests/try.cs : Fix. It's not 'finalize' my friend, it's 'finally' !
33511 Hooray, try and catch statements parse fine !
33513 2001-08-28 Ravi Pratap <ravi@che.iitm.ac.in>
33515 * statement.cs (Block::GetVariableType): Fix logic to extract the type
33516 string from the hashtable of variables.
33518 * cs-parser.jay (event_accessor_declarations): Trivial fix. Man, how did
33519 I end up making that mistake ;-)
33520 (catch_clauses): Fixed gross error which made Key and Value of the
33521 DictionaryEntry the same : $1 !!
33523 2001-08-28 Ravi Pratap <ravi@che.iitm.ac.in>
33525 * cs-tokenizer.cs (initTokens): Add keywords 'add' and 'remove'
33527 * cs-parser.jay (event_declaration): Correct to remove the semicolon
33528 when the add and remove accessors are specified.
33530 2001-08-28 Ravi Pratap <ravi@che.iitm.ac.in>
33532 * cs-parser.jay (IndexerDeclaration): New helper class to hold
33533 information about indexer_declarator.
33534 (indexer_declarator): Implement actions.
33535 (parsing_indexer): New local boolean used to keep track of whether
33536 we are parsing indexers or properties. This is necessary because
33537 implicit_parameters come into picture even for the get accessor in the
33538 case of an indexer.
33539 (get_accessor_declaration, set_accessor_declaration): Correspondingly modified.
33541 * class.cs (Indexer): New class for indexer declarations.
33542 (TypeContainer::AddIndexer): New method to add an indexer to a type.
33543 (TypeContainer::indexers): New member to hold list of indexers for the
33546 2001-08-27 Ravi Pratap <ravi@che.iitm.ac.in>
33548 * cs-parser.jay (add_accessor_declaration): Implement action.
33549 (remove_accessor_declaration): Implement action.
33550 (event_accessors_declaration): Implement
33551 (variable_declarators): swap statements for first rule - trivial.
33553 * class.cs (Event): New class to hold information about event
33555 (TypeContainer::AddEvent): New method to add an event to a type
33556 (TypeContainer::events): New member to hold list of events.
33558 * cs-parser.jay (event_declaration): Implement actions.
33560 2001-08-27 Ravi Pratap <ravi@che.iitm.ac.in>
33562 * cs-parser.jay (dim_separators): Implement. Make it a string
33563 concatenating all the commas together, just as they appear.
33564 (opt_dim_separators): Modify accordingly
33565 (rank_specifiers): Update accordingly. Basically do the same
33566 thing - instead, collect the brackets here.
33567 (opt_rank_sepcifiers): Modify accordingly.
33568 (array_type): Modify to actually return the complete type string
33569 instead of ignoring the rank_specifiers.
33570 (expression_list): Implement to collect the expressions
33571 (variable_initializer): Implement. We make it a list of expressions
33572 essentially so that we can handle the array_initializer case neatly too.
33573 (variable_initializer_list): Implement.
33574 (array_initializer): Make it a list of variable_initializers
33575 (opt_array_initializer): Modify accordingly.
33577 * expression.cs (New::NType): Add enumeration to help us
33578 keep track of whether we have an object/delegate creation
33579 or an array creation.
33580 (New:NewType, New::Rank, New::Indices, New::Initializers): New
33581 members to hold data about array creation.
33582 (New:New): Modify to update NewType
33583 (New:New): New Overloaded contructor for the array creation
33586 * cs-parser.jay (array_creation_expression): Implement to call
33587 the overloaded New constructor.
33589 2001-08-26 Ravi Pratap <ravi@che.iitm.ac.in>
33591 * class.cs (TypeContainer::Constructors): Return member
33592 constructors instead of returning null.
33594 2001-08-26 Miguel de Icaza <miguel@ximian.com>
33596 * typemanager.cs (InitCoreTypes): Initialize the various core
33597 types after we have populated the type manager with the user
33598 defined types (this distinction will be important later while
33599 compiling corlib.dll)
33601 * expression.cs, literal.cs, assign.cs, constant.cs: Started work
33602 on Expression Classification. Now all expressions have a method
33603 `Resolve' and a method `Emit'.
33605 * codegen.cs, cs-parser.jay: Fixed the bug that stopped code
33606 generation from working. Also add some temporary debugging
33609 2001-08-24 Miguel de Icaza <miguel@ximian.com>
33611 * codegen.cs: Lots of code generation pieces. This is only the
33612 beginning, will continue tomorrow with more touches of polish. We
33613 handle the fundamentals of if, while, do, for, return. Others are
33614 trickier and I need to start working on invocations soon.
33616 * gen-treedump.cs: Bug fix, use s.Increment here instead of
33619 * codegen.cs (EmitContext): New struct, used during code
33620 emission to keep a context. Most of the code generation will be
33623 * cs-parser.jay: Add embedded blocks to the list of statements of
33624 this block. So code generation proceeds in a top down fashion.
33626 2001-08-23 Miguel de Icaza <miguel@ximian.com>
33628 * statement.cs: Add support for multiple child blocks.
33630 2001-08-22 Miguel de Icaza <miguel@ximian.com>
33632 * codegen.cs (EmitCode): New function, will emit the code for a
33633 Block of code given a TypeContainer and its ILGenerator.
33635 * statement.cs (Block): Standard public readonly optimization.
33636 (Block::Block constructors): Link children.
33637 (Block::Child): Child Linker.
33638 (Block::EmitVariables): Emits IL variable declarations.
33640 * class.cs: Drop support for MethodGroups here, delay until
33642 (Method::): Applied the same simplification that I did before, and
33643 move from Properties to public readonly fields.
33644 (Method::ParameterTypes): Returns the parameter types for the
33645 function, and implements a cache that will be useful later when I
33646 do error checking and the semantic analysis on the methods is
33648 (Constructor::GetCallingConvention): Renamed from CallingConvetion
33649 and made a method, optional argument tells whether this is a class
33650 or a structure to apply the `has-this' bit.
33651 (Method::GetCallingConvention): Implement, returns the calling
33653 (Method::Define): Defines the type, a second pass is performed
33654 later to populate the methods.
33656 (Constructor::ParameterTypes): implement a cache similar to the
33657 one on Method::ParameterTypes, useful later when we do semantic
33660 (TypeContainer::EmitMethod): New method. Emits methods.
33662 * expression.cs: Removed MethodGroup class from here.
33664 * parameter.cs (Parameters::GetCallingConvention): new method.
33666 2001-08-21 Miguel de Icaza <miguel@ximian.com>
33668 * class.cs (TypeContainer::Populate): Drop RootContext from the
33671 (Constructor::CallingConvention): Returns the calling convention.
33672 (Constructor::ParameterTypes): Returns the constructor parameter
33675 (TypeContainer::AddConstructor): Keep track of default constructor
33676 and the default static constructor.
33678 (Constructor::) Another class that starts using `public readonly'
33679 instead of properties.
33681 (Constructor::IsDefault): Whether this is a default constructor.
33683 (Field::) use readonly public fields instead of properties also.
33685 (TypeContainer::TypeAttr, TypeContainer::AddConstructor): Keep
33686 track of static constructors; If none is used, turn on
33687 BeforeFieldInit in the TypeAttributes.
33689 * cs-parser.jay (opt_argument_list): now the return can be null
33690 for the cases where there are no arguments.
33692 (constructor_declarator): If there is no implicit `base' or
33693 `this', then invoke the default parent constructor.
33695 * modifiers.cs (MethodAttr): New static function maps a set of
33696 modifiers flags into a MethodAttributes enum
33697 (FieldAttr): renamed from `Map'. So now we have FieldAttr,
33698 MethodAttr, TypeAttr to represent the various mappings where the
33699 modifiers are used.
33700 (FieldAttr): Map also `readonly' to `FieldAttributes.InitOnly'
33702 2001-08-19 Miguel de Icaza <miguel@ximian.com>
33704 * parameter.cs (GetParameterInfo): Fix bug where there would be no
33707 * interface.cs (PopulateIndexer): Implemented the code generator
33708 for interface indexers.
33710 2001-08-17 Miguel de Icaza <miguel@ximian.com>
33712 * interface.cs (InterfaceMemberBase): Now we track the new status
33715 (PopulateProperty): Implement property population. Woohoo! Got
33716 Methods and Properties going today.
33718 Removed all the properties for interfaces, and replaced them with
33719 `public readonly' fields.
33721 2001-08-16 Miguel de Icaza <miguel@ximian.com>
33723 * interface.cs (AddEvent, AddMethod, AddIndexer, AddProperty):
33724 initialize their hashtables/arraylists only when they are needed
33725 instead of doing this always.
33727 * parameter.cs: Handle refs and out parameters.
33729 * cs-parser.jay: Use an ArrayList to construct the arguments
33730 instead of the ParameterCollection, and then cast that to a
33733 * parameter.cs: Drop the use of ParameterCollection and use
33734 instead arrays of Parameters.
33736 (GetParameterInfo): Use the Type, not the Name when resolving
33739 2001-08-13 Miguel de Icaza <miguel@ximian.com>
33741 * parameter.cs: Eliminate the properties Name, Type and ModFlags,
33742 and instead use public readonly fields.
33744 * class.cs: Put back walking code for type containers.
33746 2001-08-11 Miguel de Icaza <miguel@ximian.com>
33748 * class.cs (MakeConstant): Code to define constants.
33750 * rootcontext.cs (LookupType): New function. Used to locate types
33753 2001-08-08 Miguel de Icaza <miguel@ximian.com>
33755 * rootcontext.cs: OH MY! My trick works! It is amazing how nice
33756 this System.Reflection code is. Kudos to Microsoft
33758 * typemanager.cs: Implement a type cache and avoid loading all
33759 types at boot time. Wrap in LookupType the internals. This made
33760 the compiler so much faster. Wow. I rule!
33762 * driver.cs: Make sure we always load mscorlib first (for
33763 debugging purposes, nothing really important).
33765 * Renamespaced things that were on `CSC' to `CIR'. Maybe I should
33766 have moved to `CSC' rather than `CIR'. Oh man! The confussion!
33768 * rootcontext.cs: Lookup types on their namespace; Lookup types
33769 on namespaces that have been imported using the `using' keyword.
33771 * class.cs (TypeContainer::TypeAttr): Virtualize.
33772 (Class::TypeAttr): Return attributes suitable for this bad boy.
33773 (Struct::TypeAttr): ditto.
33774 Handle nested classes.
33775 (TypeContainer::) Remove all the type visiting code, it is now
33776 replaced with the rootcontext.cs code
33778 * rootcontext.cs (GetClassBases): Added support for structs.
33780 2001-08-06 Miguel de Icaza <miguel@ximian.com>
33782 * interface.cs, statement.cs, class.cs, parameter.cs,
33783 rootcontext.cs, gen-treedump.cs, enum.cs, cs-parse.jay:
33784 Drop use of TypeRefs, and use strings instead.
33786 2001-08-04 Miguel de Icaza <miguel@ximian.com>
33790 * class.cs (Struct::Struct): set the SEALED flags after
33791 checking the modifiers.
33792 (TypeContainer::TypeAttr): new property, returns the
33793 TypeAttributes for a class.
33795 * cs-parser.jay (type_list): Oops, list production was creating a
33796 new list of base types.
33798 * rootcontext.cs (StdLib): New property.
33799 (GetInterfaceTypeByName): returns an interface by type name, and
33800 encapsulates error handling here.
33801 (GetInterfaces): simplified.
33802 (ResolveTree): Encapsulated all the tree resolution here.
33803 (CreateClass, GetClassBases, GetInterfaceOrClass): Create class
33806 * driver.cs: Add support for --nostdlib, to avoid loading the
33807 default assemblies.
33808 (Main): Do not put tree resolution here.
33810 * rootcontext.cs: Beginning of the class resolution.
33812 2001-08-03 Miguel de Icaza <miguel@ximian.com>
33814 * rootcontext.cs: Provide better error reporting.
33816 * cs-parser.jay (interface_base): set our $$ to be interfaces.
33818 * rootcontext.cs (CreateInterface): Handle the case where there
33819 are no parent interfaces.
33821 (CloseTypes): Routine to flush types at the end.
33822 (CreateInterface): Track types.
33823 (GetInterfaces): Returns an array of Types from the list of
33824 defined interfaces.
33826 * typemanager.c (AddUserType): Mechanism to track user types (puts
33827 the type on the global type hash, and allows us to close it at the
33830 2001-08-02 Miguel de Icaza <miguel@ximian.com>
33832 * tree.cs: Removed RecordType, added RecordClass, RecordStruct and
33833 RecordInterface instead.
33835 * cs-parser.jay: Updated to reflect changes above.
33837 * decl.cs (Definition): Keep track of the TypeBuilder type that
33838 represents this type here. Not sure we will use it in the long
33839 run, but wont hurt for now.
33841 * driver.cs: Smaller changes to accomodate the new code.
33843 Call ResolveInterfaceBases, Call ResolveClassBases, Save assembly
33846 * rootcontext.cs (CreateInterface): New method, used to create
33847 the System.TypeBuilder type for interfaces.
33848 (ResolveInterfaces): new entry point to resolve the interface
33850 (CodeGen): Property, used to keep track of the code generator.
33852 2001-07-26 Miguel de Icaza <miguel@ximian.com>
33854 * cs-parser.jay: Add a second production for delegate_declaration
33857 (enum_body): Put an opt_comma here instead of putting it on
33858 enum_body or enum_member_declarations so we can handle trailing
33859 commas on enumeration members. Gets rid of a shift/reduce.
33861 (type_list): Need a COMMA in the middle.
33863 (indexer_declaration): Tell tokenizer to recognize get/set
33865 * Remove old targets.
33867 * Re-add the parser target.
33869 2001-07-13 Simon Cozens <simon@simon-cozens.org>
33871 * cs-parser.jay: Add precendence rules for a number of operators
33872 ot reduce the number of shift/reduce conflicts in the grammar.
33874 2001-07-17 Miguel de Icaza <miguel@ximian.com>
33876 * tree.cs: moved IGenerator interface and renamed it to ITreeDump
33879 Get rid of old crufty code.
33881 * rootcontext.cs: Use this to keep track of the parsed
33882 representation and the defined types available to the program.
33884 * gen-treedump.cs: adjust for new convention.
33886 * type.cs: Split out the type manager, and the assembly builder
33889 * typemanager.cs: the type manager will live here now.
33891 * cil-codegen.cs: And the code generator here.
33893 2001-07-14 Sean MacIsaac <macisaac@ximian.com>
33895 * makefile: Fixed up for easy making.
33897 2001-07-13 Simon Cozens <simon@simon-cozens.org>
33899 * cs-parser.jay (rank_specifier): Remove a conflict by reordering
33902 (unary_expression): Expand pre_increment_expression and
33903 post_decrement_expression to reduce a shift/reduce.
33905 2001-07-11 Simon Cozens
33907 * cs-tokenizer.cs: Hex numbers should begin with a 0.
33909 Improve allow_keyword_as_indent name.
33911 2001-06-19 Miguel de Icaza <miguel@ximian.com>
33913 * Adjustments for Beta2.
33915 2001-06-13 Miguel de Icaza <miguel@ximian.com>
33917 * decl.cs: Added `Define' abstract method.
33918 (InTransit): new property, used to catch recursive definitions.
33920 * interface.cs: Implement `Define'.
33922 * modifiers.cs: Map Modifiers.constants to
33923 System.Reflection.TypeAttribute flags.
33925 * class.cs: Keep track of types and user-defined types.
33926 (BuilderInit): New method for creating an assembly
33927 (ResolveType): New function to launch the resolution process, only
33928 used by interfaces for now.
33930 * cs-parser.jay: Keep track of Classes, Structs and Interfaces
33931 that are inserted into the name space.
33933 2001-06-08 Miguel de Icaza <miguel@ximian.com>
33935 * ARGH. I have screwed up my tree so many times due to the use of
33936 rsync rather than using CVS. Going to fix this at once.
33938 * driver.cs: Objetify driver. Load assemblies, use assemblies to
33941 2001-06-07 Miguel de Icaza <miguel@ximian.com>
33943 * Experiment successful: Use System.Type rather that our own
33946 2001-05-25 Miguel de Icaza <miguel@ximian.com>
33948 * cs-parser.jay: Removed nsAliases from here.
33950 Use new namespaces, handle `using XXX;'
33952 * namespace.cs: Reimplemented namespace handling, use a recursive
33953 definition of the class. Now we can keep track of using clauses
33954 and catch invalid using clauses.
33956 2001-05-24 Miguel de Icaza <miguel@ximian.com>
33958 * gen-treedump.cs: Adapted for all the renaming.
33960 * expression.cs (Expression): this class now has a Type property
33961 which returns an expression Type.
33963 (Probe::, New::, TypeOf::, SizeOf::, Constant::): renamed from
33964 `Type', as this has a different meaning now in the base
33966 2001-05-22 Miguel de Icaza <miguel@ximian.com>
33968 * interface.cs, class.cs: Removed from all the sources the
33969 references to signature computation, as we can not do method
33970 signature computation during the parsing time, as we are not
33971 trying to solve at that point distinguishing:
33975 void a (NS.Blah x) {}
33978 Which depending on the context might be valid or not, as we do not
33979 know if Blah is the same thing as NS.Blah at that point.
33981 * Redid everything so the code uses TypeRefs now instead of
33982 Types. TypeRefs are just temporary type placeholders, that need
33983 to be resolved. They initially have a pointer to a string and the
33984 current scope in which they are used. This is used later by the
33985 compiler to resolve the reference to an actual Type.
33987 * DeclSpace is no longer a CIR.Type, and neither are
33988 TypeContainers (Class and Struct) nor Interfaces nor Enums. They
33989 are all DeclSpaces, but no Types.
33991 * type.cs (TypeRefManager): This implements the TypeRef manager,
33992 which keeps track of all the types that need to be resolved after
33993 the parsing has finished.
33995 2001-05-13 Miguel de Icaza <miguel@ximian.com>
33997 * ARGH. We are going to have to store `foreach' as a class rather
33998 than resolving it, as we need to verify error 1579 after name
33999 resolution. *OR* we could keep a flag that says `This request to
34000 IEnumerator comes from a foreach statement' which we can then use
34001 to generate the error.
34003 2001-05-10 Miguel de Icaza <miguel@ximian.com>
34005 * class.cs (TypeContainer.AddMethod): we now add methods to the
34006 MethodGroup instead of the method hashtable.
34008 * expression.cs: Add MethodGroup abstraction, which gets us one
34009 step closer to the specification in the way we handle method
34012 * cs-parser.jay (primary_expression): qualified_identifier now
34013 tried to match up an identifier to a local variable reference or
34014 to a parameter reference.
34016 current_local_parameters is now a parser global variable that
34017 points to the current parameters for the block, used during name
34020 (property_declaration): Now creates an implicit `value' argument to
34023 2001-05-09 Miguel de Icaza <miguel@ximian.com>
34025 * parameter.cs: Do not use `param' arguments as part of the
34026 signature, per the spec.
34028 2001-05-08 Miguel de Icaza <miguel@ximian.com>
34030 * decl.cs: Base class for classes, structs and interfaces. This
34031 is the "Declaration Space"
34033 * cs-parser.jay: Use CheckDef for checking declaration errors
34034 instead of having one on each function.
34036 * class.cs: Factor out some code for handling error handling in
34037 accordance to the "Declarations" section in the "Basic Concepts"
34038 chapter in the ECMA C# spec.
34040 * interface.cs: Make all interface member classes derive from
34041 InterfaceMemberBase.
34043 2001-05-07 Miguel de Icaza <miguel@ximian.com>
34045 * Many things: all interfaces are parsed and generated in
34046 gen-treedump. Support for member variables, constructors,
34047 destructors, properties, constants is there.
34049 Beginning of the IL backend, but very little done, just there for
34052 2001-04-29 Miguel de Icaza <miguel@ximian.com>
34054 * cs-parser.jay: Fix labeled statement.
34056 * cs-tokenizer.cs (escape): Escape " and ' always.
34057 ref_line, ref_name: keep track of the line/filename as instructed
34058 by #line by the compiler.
34061 2001-04-27 Miguel de Icaza <miguel@ximian.com>
34063 * System.CodeDOM/CodeBinaryOperatorExpression.cs: Rearrange enum
34064 to match the values in System.CodeDOM.
34066 Divid renamed to Divide.
34068 * System.CodeDOM/CodeForLoopStatement.cs: Always have valid
34070 (Statements.set): remove.
34072 * System.CodeDOM/CodeCatchClause.cs: always have a valid
34075 * System.CodeDOM/CodeIfStatement.cs: trueStatements and
34076 falseStatements always have valid values.
34078 * cs-parser.jay: Use System.CodeDOM now.