1 2010-07-14 Marek Safar <marek.safar@gmail.com>
3 * namespace.cs, import.cs: When importing nested type via type
4 arguments set their parent type correctly (Fixes #622051).
6 2010-07-14 Marek Safar <marek.safar@gmail.com>
9 * attribute.cs: Add default lookup flags.
11 2010-07-12 Marek Safar <marek.safar@gmail.com>
13 * generic.cs: Don't use Report directly.
15 * expression.cs, ecore.cs: UserOperatorCall uses MethodSpec without
16 MethodGroupExpr, will be simplified later.
18 2010-07-09 Marek Safar <marek.safar@gmail.com>
20 * property.cs, parameters.cs: Inflated IndexerSpec parameters.
22 * import.cs: Don't build unused parameters.
24 2010-07-08 Marek Safar <marek.safar@gmail.com>
26 * expression.cs (Invocation): Don't recreate simple-name expression.
28 2010-07-07 Marek Safar <marek.safar@gmail.com>
30 * ecore.cs: Don't report NRE warning for lifted null.
32 2010-07-07 Marek Safar <marek.safar@gmail.com>
34 * typemanager.cs, convert.cs, expression.cs: Another reference
35 equality implementation attack (Fixes #620025, #579058).
37 2010-07-05 Marek Safar <marek.safar@gmail.com>
39 * context.cs, expression.cs, ecore.cs: BaseThis is fully based on
40 this expression (Fixes #619904).
42 2010-07-05 Marek Safar <marek.safar@gmail.com>
44 * membercache.cs, class.cs: Don't use base member to check for
45 property or indexer base implementation.
47 2010-07-03 Marek Safar <marek.safar@gmail.com>
49 * membercache.cs: Copy Membercache member state flags for 2 stage
50 inflate (Fixes #619555).
52 * ecore.cs: Use resolved accessors everywhere.
54 2010-07-02 Marek Safar <marek.safar@gmail.com>
57 * membercache.cs, property.cs: Check accessors of base property and
60 2010-07-02 Marek Safar <marek.safar@gmail.com>
62 * modifiers.cs, membercache.cs, import.cs, class.cs: Moved imported
63 override method checks into import.
65 * expression.cs: Removed redundant check.
67 2010-06-30 Marek Safar <marek.safar@gmail.com>
69 * nullable.cs, expression.cs, statement.cs, method.cs, ecore.cs,
70 delegate.cs, cs-parser.jay, visit.cs: Use MemberAccess to resolve
71 base access expression, it has all bits done correctly.
73 2010-06-30 Marek Safar <marek.safar@gmail.com>
75 * support.cs: Removed unused code.
77 * ecore.cs: Don't use memberlookup for operators.
79 2010-06-30 Marek Safar <marek.safar@gmail.com>
81 * typemanager.cs, membercache.cs, convert.cs, expression.cs,
82 ecore.cs: Replace remaining MethodLookup with correct user operator
83 lookup (to do correct deep lookup). Clean up most of outstanding
84 quirks in binary operator overload resolution.
86 2010-06-29 Marek Safar <marek.safar@gmail.com>
88 * import.cs: Operators must have between 1 and 2 parameters.
90 * method.cs: Switch destructor to direct membercache lookup
92 2010-06-29 Marek Safar <marek.safar@gmail.com>
94 * driver.cs, expression.cs: Use Membercache for StringConcat when
95 it got all what is needed.
97 2010-06-29 Marek Safar <marek.safar@gmail.com>
99 * membercache.cs, expression.cs, statement.cs, doc.cs, ecore.cs:
100 Changed FindMembers to allocate a new list only when a filter is
101 used. Saves decent chunk of memory and should save even more in the
102 future when the filter is not used that often.
104 2010-06-28 Marek Safar <marek.safar@gmail.com>
106 * field.cs, property.cs, assign.cs, const.cs, expression.cs,
107 ecore.cs, class.cs, cs-parser.jay, enum.cs: Don't use intermediate
108 structure for simple type fields (saves memory and makes few things
109 simpler). Clean up some hacks mostly for events.
111 2010-06-25 Marek Safar <marek.safar@gmail.com>
113 * statement.cs, cs-parser.jay: Don't create expensive block for
116 2010-06-24 Marek Safar <marek.safar@gmail.com>
118 * statement.cs, report.cs: Rethrow internal error when reporting is
121 * ecore.cs: Check for identical name only when simple name is set.
124 2010-06-24 Marek Safar <marek.safar@gmail.com>
126 A fix for bug #616809
127 * generic.cs, expression.cs, ecore.cs: Added a new type expression
128 for open generic type to pass unbound type arguments to typeof
131 2010-06-24 Marek Safar <marek.safar@gmail.com>
133 * statement.cs: Foreach collection implementation refactoring to
134 search for GetEnumerator more preciselly. Fixes #431453 and more
137 * linq.cs, decl.cs, ecore.cs, delegate.cs: Update methodgroup api.
139 2010-06-23 Marek Safar <marek.safar@gmail.com>
141 * cs-parser.jay: Track more locations.
143 2010-06-22 Marek Safar <marek.safar@gmail.com>
145 * cs-tokenizer.cs, location.cs, cs-parser.jay: Track more locations.
147 2010-06-18 Marek Safar <marek.safar@gmail.com>
149 * cs-tokenizer.cs, anonymous.cs, expression.cs, statement.cs,
150 support.cs, location.cs, cs-parser.jay: Some work on full ast mode.
152 2010-06-18 Marek Safar <marek.safar@gmail.com>
154 * convert.cs, typespec.cs, method.cs: Fixed few more dynamic
157 2010-06-18 Marek Safar <marek.safar@gmail.com>
159 * typemanager.cs, namespace.cs: Report more predefined types and
160 imported types collision types as a warning.
161 Fixes #537414, #601157
163 2010-06-18 Marek Safar <marek.safar@gmail.com>
165 * generic.cs: Overrides base method constraint can use method type
168 * import.cs: Removed redundant cache.
170 2010-06-17 Marek Safar <marek.safar@gmail.com>
172 * generic.cs: Propagate type only inflate downwards.
174 2010-06-17 Marek Safar <marek.safar@gmail.com>
176 A fix for bug #614955
177 * method.cs: Do not reject binary dynamic operators.
179 2010-06-17 Marek Safar <marek.safar@gmail.com>
181 * typespec.cs: Internal types have no generic parameters.
184 2010-06-17 Marek Safar <marek.safar@gmail.com>
186 A fix for bug #614955
187 * cs-parser.jay: Correctly set expression mode for default parameter
190 2010-06-17 Marek Safar <marek.safar@gmail.com>
192 A fix for bug #615023
193 * ecore.cs: Resolve dynamic namespace and keyword collision in the
194 favour of the keyword.
196 2010-06-17 Marek Safar <marek.safar@gmail.com>
198 A fix for bug #614917
199 * convert.cs: Allow more undocumented 0 like values to enum type
202 2010-06-17 Marek Safar <marek.safar@gmail.com>
204 * generic.cs, method.cs: Inflate copied type parameters from base
205 class or explicit interfaces.
207 * convert.cs: Fixed conversion between two type parameters.
210 2010-06-16 Marek Safar <marek.safar@gmail.com>
212 * membercache.cs, convert.cs: Correctly resize an array used by
215 2010-06-15 Marek Safar <marek.safar@gmail.com>
217 A fix for bug #599601
218 * dynamic.cs, ecore.cs: A new flag for dynamic resolver to ignore
219 generated member access left expression.
221 2010-06-16 Marek Safar <marek.safar@gmail.com>
223 * expression.cs: Dispatch dynamic invocation solely on left
226 2010-06-16 Marek Safar <marek.safar@gmail.com>
228 * expression.cs, statement.cs: Always persist explicit cast
229 semantic at expression level.
231 2010-06-15 Marek Safar <marek.safar@gmail.com>
233 * expression.cs, attribute.cs: Enable generic type parameters
236 2010-06-15 Marek Safar <marek.safar@gmail.com>
238 A fix for bug #612146
239 * generic.cs: Don't use fixed array for inflated type parameter
240 interface constraints.
242 2010-06-15 Marek Safar <marek.safar@gmail.com>
244 * typespec.cs: ElementTypeSpec has to use its own ITypeDefinition.
246 * report.cs: Unwrap elements for related symbols reporting.
248 2010-06-15 Marek Safar <marek.safar@gmail.com>
250 A fix for bug #612796
251 * cs-tokenizer.cs: Offset correctly keywords the first character
254 2010-06-15 Marek Safar <marek.safar@gmail.com>
256 A fix for bug #613397
257 * expression.cs: Removed too aggressive object initializers
260 2010-06-15 Marek Safar <marek.safar@gmail.com>
262 * parameter.cs, property.cs, membercache.cs, decl.cs, iterators.cs,
263 anonymous.cs, expression.cs, support.cs, method.cs, pending.cs,
264 class.cs, cs-parser.jay: Simplify parsing of accessors by removing
265 any intermediate steps and fake nodes, also saves few MBs of memory.
267 2010-06-11 Marek Safar <marek.safar@gmail.com>
269 * modifiers.cs, rootcontext.cs, location.cs, cs-parser.jay: More
270 precise modifiers parsing.
272 2010-06-09 Marek Safar <marek.safar@gmail.com>
274 * cs-tokenizer.cs, anonymous.cs, expression.cs, cs-parser.jay:
275 Fixed few shift/reduce conflicts.
277 2010-06-09 Marek Safar <marek.safar@gmail.com>
279 * typemanager.cs, parameter.cs, dynamic.cs, typespec.cs,
280 expression.cs, ecore.cs, cs-parser.jay: Fully parse composed type
281 specifiers and stop using string in AST.
283 2010-06-07 Marek Safar <marek.safar@gmail.com>
285 * typemanager.cs, eval.cs, iterators.cs, anonymous.cs, expression.cs
286 method.cs, class.cs, delegate.cs, cs-parser.jay, driver.cs, visit.cs
287 enum.cs: Hold location of predefined types.
289 2010-06-07 Marek Safar <marek.safar@gmail.com>
291 A fix for bug #610878
292 * pending.cs: Clone cached list before modifying.
294 2010-06-04 Marek Safar <marek.safar@gmail.com>
296 * convert.cs, typespec.cs, expression.cs: Start using array member
297 kind for better conversion checks.
299 * import.cs, report.cs: Report better error message for runtime
302 2010-06-04 Marek Safar <marek.safar@gmail.com>
304 * membercache.cs, convert.cs, nullable.cs, expression.cs: Optimize
305 user defined conversion probing and simplify user conversion for
306 nullabe types. Fixes #610940.
308 2010-06-03 Marek Safar <marek.safar@gmail.com>
310 A fix for bug #610919
311 * parameter.cs, property.cs, cs-parser.jay: Use independent implicit
312 parameters for explicit event accessors. Anonymous method capturing
313 won't otherwise work for event implicit parameter.
315 2010-06-02 Marek Safar <marek.safar@gmail.com>
317 A fix for bug #610088
318 * nullable.cs, expression.cs, statement.cs, method.cs, ecore.cs:
319 Ignore overrides for base overload resolution as for non-base
320 expressions and convert the best candidate to closest override
323 2010-06-01 Marek Safar <marek.safar@gmail.com>
325 A fix for bug #610139
326 * generic.cs, convert.cs: Recursively check effective base interface
328 2010-06-01 Marek Safar <marek.safar@gmail.com>
330 * statement.cs: Handle nullable types and type parameters in using
331 statement, avoid boxing value types. Also fixes #571010
333 2010-06-01 Marek Safar <marek.safar@gmail.com>
335 * convert.cs, expression.cs: Emit unbox for underlying nullable
338 2010-05-29 Marek Safar <marek.safar@gmail.com>
340 A fix for bug #610126
341 * expression.cs: Don't use branch optimization for types bigger than
344 2010-05-28 Marek Safar <marek.safar@gmail.com>
346 A fix for bug #609088
347 * import.cs: Check private modifier correctly.
349 2010-05-28 Marek Safar <marek.safar@gmail.com>
351 A fix for bug #609049
352 * ecore.cs: Don't ignore override methods when looking for base
355 2010-05-27 Marek Safar <marek.safar@gmail.com>
357 A fix for bugs #608007, #572540, #566130, #476358
359 * generic.cs, linq.cs, expression.cs, statement.cs, cs-parser.jay:
360 More tricky refactoring of implicit linq blocks.
362 2010-05-25 Marek Safar <marek.safar@gmail.com>
364 * linq.cs, cs-parser.jay: Keep location for all linq clauses.
366 2010-05-25 Marek Safar <marek.safar@gmail.com>
368 * context.cs, expression.cs, cs-parser.jay: Don't store current
369 block in This expression (it's too early for linq blocks).
371 2010-05-21 Marek Safar <marek.safar@gmail.com>
373 * expression.cs: Use constrained prefix more broadly to avoid boxing.
375 2010-05-20 Marek Safar <marek.safar@gmail.com>
377 A fix for bug #591149
378 * nullable.cs: Don't double wrap same expression.
380 2010-05-20 Marek Safar <marek.safar@gmail.com>
382 A fix for bug #569827
383 * anonymous.cs: Any issued error in probing mode means no match.
385 2010-05-20 Marek Safar <marek.safar@gmail.com>
387 * expression.cs: Search for base indexer using the closest match
390 2010-05-20 Marek Safar <marek.safar@gmail.com>
392 A fix for bug #572071
393 * method.cs: Set override constraints using unexpanded interface
396 2010-05-20 Marek Safar <marek.safar@gmail.com>
398 A fix for bug #572071
399 * ecore.cs: Include secondary extension method lookup in probing
402 2010-05-19 Marek Safar <marek.safar@gmail.com>
404 A fix for bug #515801
405 * typespec.cs (MayBecomeEqualGenericTypes): Recursively check
408 2010-05-19 Marek Safar <marek.safar@gmail.com>
410 A fix for bug #515801
411 * pending.cs: Advance counter correctly.
413 2010-05-19 Marek Safar <marek.safar@gmail.com>
415 A fix for bug #480139
416 * method.cs, pending.cs: Indexer override uses base name.
418 2010-05-19 Marek Safar <marek.safar@gmail.com>
420 A fix for bug #424064
421 * generic.cs: Replace original with inflated type parameter on
424 2010-05-19 Marek Safar <marek.safar@gmail.com>
426 A fix for bug #359733
427 * parameter.cs: Extension attribute can be defined in each assembly.
429 2010-05-18 Marek Safar <marek.safar@gmail.com>
431 A fix for bug #446507
432 * method.cs: Only one method can implement an interface.
434 2010-05-18 Marek Safar <marek.safar@gmail.com>
436 A fix for bug #594905
437 * convert.cs, constant.cs, expression.cs, literal.cs, ecore.cs:
438 Typed null can be used as a source for expression methods.
440 2010-05-18 Marek Safar <marek.safar@gmail.com>
442 A fix for bug #606551
443 * namespace.cs: Using directive imports only types and not nested
446 2010-05-17 Marek Safar <marek.safar@gmail.com>
448 * typespec.cs, expression.cs, statement.cs, ecore.cs, complete.cs,
449 delegate.cs: Member instance is resolved after member overload
450 definitely resolves static/instance property of member expression.
451 Fixes #545047, #358848, #456605, #460016, #603299
453 2010-05-12 Marek Safar <marek.safar@gmail.com>
455 A fix for bug #604981
456 * generic.cs, decl.cs, anonymous.cs: Reset more type arguments
457 details for nested anonymous methods stories.
459 2010-05-11 Marek Safar <marek.safar@gmail.com>
461 A fix for bug #604735
462 * namespace.cs: Don't report namespace collision.
464 2010-05-11 Marek Safar <marek.safar@gmail.com>
466 A fix for bug #604748
467 * class.cs, typespec.cs: Search full imported attribute hierarchy
470 2010-05-11 Marek Safar <marek.safar@gmail.com>
472 * namespace.cs: Ignore missing dependencies failure at
475 2010-05-11 Marek Safar <marek.safar@gmail.com>
477 A fix for bug #604640
478 * namespace.cs: Don't resolve using constraints too early.
480 2010-05-11 Marek Safar <marek.safar@gmail.com>
482 A fix for bug #604239
483 * generic.cs: Copy partial type constraints to partial container.
485 2010-05-10 Marek Safar <marek.safar@gmail.com>
487 A fix for bug #557210
488 * import.cs: Relax underlying enum field rules.
490 2010-05-10 Marek Safar <marek.safar@gmail.com>
492 A fix for bug #603476
493 * property.cs: Implement IParametersMember for indexer accessors.
495 2010-05-07 Marek Safar <marek.safar@gmail.com>
497 A fix for bug #601141
498 * class.cs: Update all partial modifiers.
500 2010-05-06 Marek Safar <marek.safar@gmail.com>
502 A fix for bug #601708
503 * method.cs, membercache.cs: Destructors cannot be hidden.
505 2010-05-06 Marek Safar <marek.safar@gmail.com>
507 A fix for bug #602551
508 * class.cs: Resursive reference of type definition is allowed.
510 2010-05-06 Marek Safar <marek.safar@gmail.com>
512 * anonymous.cs: Mutate cached storey instance types too.
514 2010-05-06 Marek Safar <marek.safar@gmail.com>
516 A fix for bug #602443
517 * convert.cs: Explicit enum conversion cannot involve user operators
519 2010-05-05 Miguel de Icaza <miguel@novell.com>
521 * class.cs (TypeContainer.DefineBaseTypes)
522 (TypeContainer.CheckRecursiveDefinition): check for the iface not
523 being null, as we could have failed resolution and crashed;
526 * cs-parser.jay: Productions to catch common mistakes when other
527 punctuation operators are used instead of comma. Fixes 571702
529 2010-05-05 Marek Safar <marek.safar@gmail.com>
531 * anonymous.cs: Mutate correct set of constraints.
533 2010-05-05 Marek Safar <marek.safar@gmail.com>
535 A fix for bug #602842
536 * expression.cs: Resolve all array bound arguments.
538 2010-05-05 Marek Safar <marek.safar@gmail.com>
540 * import.cs: Don't import private fields.
542 2010-04-30 Marek Safar <marek.safar@gmail.com>
544 Partially based on patch by <sami.lamti@gmail.com>
546 * eval.cs, ecore.cs: Fixed eval show methods.
548 2010-04-30 Marek Safar <marek.safar@gmail.com>
550 * generic.cs, delegate.cs: Implement output type inference of
551 methodgroup now when the specification was cleared at least little
554 2010-04-29 Marek Safar <marek.safar@gmail.com>
556 A fix for bug #575611
557 * class.cs: Fix recursive unmanaged recursice sruct check.
559 2010-04-29 Marek Safar <marek.safar@gmail.com>
561 A fix for bug #479776
562 * expression.cs: Implement typeof unbounded nested generic types.
564 2010-04-29 Marek Safar <marek.safar@gmail.com>
566 A fix for bug #474953
567 * class.cs: Fix valid recursive base type definition.
569 2010-04-29 Marek Safar <marek.safar@gmail.com>
571 A fix for bug #421737
572 * convert.cs, expression.cs: A boxing conversion exists from a
573 nullable-type to a reference type, if a boxing conversion exists
574 from the underlying non-nullable-value-type to the reference type.
576 2010-04-29 Marek Safar <marek.safar@gmail.com>
578 A fix for bug #376875
579 * import.cs: Import volatile modifier.
581 2010-04-29 Marek Safar <marek.safar@gmail.com>
583 A fix for bug #372412
584 * typespec.cs, expression.cs, codegen.cs: Emit readonly prefix for
587 2010-04-29 Marek Safar <marek.safar@gmail.com>
589 A fix for bug #568955
590 * statements.cs: Handle recursive scope initializers.
592 2010-04-28 Marek Safar <marek.safar@gmail.com>
594 A fix for bug #566511
595 * anonymous.cs: Always get inflated version of hoisted variable
596 on generic type definition.
598 2010-04-28 Marek Safar <marek.safar@gmail.com>
600 * import.cs, membercache.cs: Relax rules for valid properties.
602 2010-04-28 Marek Safar <marek.safar@gmail.com>
604 * import.cs: Intern arrays used in generic arguments.
606 2010-04-28 Marek Safar <marek.safar@gmail.com>
608 A fix for bug #600398
609 * convert.cs: Actually use effective base type for the comparison.
611 2010-04-28 Marek Safar <marek.safar@gmail.com>
613 A fix for bug #600326
614 * ecore.cs: Pass arity to base member lookup.
616 2010-04-28 Marek Safar <marek.safar@gmail.com>
618 A fix for bug #573385
619 * expression.cs: MemberAccess is of generic type based on right
622 2010-05-28 Marek Safar <marek.safar@gmail.com>
624 * cs-tokenizer.cs: Made tab size configurable.
626 2010-05-27 Marek Safar <marek.safar@gmail.com>
628 * attribute.cs: Ensure Obsolete members are defined before doing
631 2010-05-27 Marek Safar <marek.safar@gmail.com>
633 * visit.cs: Add DOM visitor skeleton.
637 2010-05-27 Marek Safar <marek.safar@gmail.com>
639 * attribute.cs, codegen.cs: Drop COMPILER_ACCESS hack.
641 2010-05-27 Marek Safar <marek.safar@gmail.com>
643 * *.cs: Major rewrite of compiler internals to better work with
644 unmodified System.Reflection.Emit. Some of the key changes are
645 - TypeSpec replaces reflection specific System.Type.
646 - All Type(TypeSpec) operations are now done in compiler therefore
647 no dependency on SRE to inflate generic members and types or to
648 query unclosed types.
649 - MemberCache is now the only and full hierarchical topology.
650 - Generic constraints are implemented properly.
651 - And as a bonus compilation is on average 30% faster.
653 2010-04-15 Jb Evain <jbevain@novell.com>
655 * dmcs.exe.config: update the runtime version to .net 4.0 RTM.
657 2010-04-12 Marek Safar <marek.safar@gmail.com>
659 * expression.cs, attribute.cs, parameter.cs: More attribute type
662 2010-04-12 Marek Safar <marek.safar@gmail.com>
664 A fix for bug #593342
666 * generic.cs, parameter.cs, argument.cs, field.cs, property.cs,
667 decl.cs, roottypes.cs, constant.cs, nullable.cs, expression.cs,
668 method.cs, ecore.cs, class.cs, delegate.cs, attribute.cs,
669 codegen.cs: Add custom attribute encoder to deal with unfinished
670 types and easier corlib bootstrap from its own types.
672 2010-03-26 Marek Safar <marek.safar@gmail.com>
674 * cs-parser.jay: Report invalid constraint types.
676 2010-03-16 Jb Evain <jbevain@novell.com>
678 * Makefile: rename the net_2_1 profile to moonlight.
680 2010-03-11 Marek Safar <marek.safar@gmail.com>
682 * statement.cs, cs-parser.jay: Use correct location for empty
685 2010-03-11 Marek Safar <marek.safar@gmail.com>
687 * cs-parser.jay: Disable Location from expression.
689 * generic.cs: Check constraints for overrides in the parser.
691 2010-03-09 Marek Safar <marek.safar@gmail.com>
693 * cs-parser.jay (GetLocation): Use an expression when available.
695 2010-03-04 Marek Safar <marek.safar@gmail.com>
697 A fix for bug #582579
698 * ecore.cs (FieldExpr): Don't optimize cross reference loads.
700 2010-03-04 Marek Safar <marek.safar@gmail.com>
702 A patch by kornelpal@gmail.com
704 * dynamic.cs, anonymous.cs, rootcontext.cs, class.cs: Don't make
705 compiler generated classes sealed by default. Emit and close top
706 level compiler generated classes as well.
708 * support.cs: Use RuntimeHelpers.GetHashCode.
710 2010-03-03 Rolf Bjarne Kvinge <RKvinge@novell.com>
712 * Makefile: We need to use the internal bootstrapping gmcs for
713 net_2_1_bootstrap too now.
715 2010-03-02 Raja R Harinath <harinath@hurrynot.org>
717 * expression.cs (IndexerAccess.ResolveAccessor): Add CS1540 check.
719 2010-03-02 Marek Safar <marek.safar@gmail.com>
721 * cs-tokenizer.cs: Missed few locations in previous fix.
723 2010-03-02 Marek Safar <marek.safar@gmail.com>
725 * cs-tokenizer.cs, argument.cs, dynamic.cs, assign.cs, anonymous.cs,
726 nullable.cs, expression.cs, statement.cs, cs-parser.jay, cfold.cs:
727 Report correct location for operator errors.
729 2010-03-02 Marek Safar <marek.safar@gmail.com>
731 * typemanager.cs (IsDynamicType): Don't check external types when
732 the attribute is not external.
734 2010-02-24 Marek Safar <marek.safar@gmail.com>
736 A fix for bug #582579
737 * decl.cs (IsExposedFromAssembly): Use PartialContainer for parent
740 2010-02-24 Marek Safar <marek.safar@gmail.com>
742 A fix for bug #581804
743 * ecore.cs: Fixed type comparison.
745 2010-02-08 Miguel de Icaza <miguel@novell.com>
747 * namespace.cs (CompletionGetTypesStartingWith): Do not include
748 private types in the completion results.
750 * cs-parser.jay: Bubble completions after "from x in ?" and "from x
753 2010-02-17 Marek Safar <marek.safar@gmail.com>
755 * generic.cs, field.cs, decl.cs, cs-parser.jay: Simplify special
758 2010-02-14 Miguel de Icaza <miguel@novell.com>
760 * eval.cs: Do not do the report printer dance unless the user has
761 set the DescribeTypes feature.
763 2010-02-10 Marek Safar <marek.safar@gmail.com>
765 * argument.cs, dynamic.cs, expression.cs: Track RC API changes.
767 2010-02-08 Marek Safar <marek.safar@gmail.com>
769 A fix for bug #577029
770 * anonymous.cs: Fixed TypeBuilder* check.
772 2010-02-06 Miguel de Icaza <miguel@novell.com>
774 * eval.cs (CompileBlock): Also undo if there are problems during
775 semantic analysis, fixes various cases where invalid C# code would
776 be reported, but the internal changes would not be undone.
778 2010-02-03 Miguel de Icaza <miguel@novell.com>
780 * driver.cs: Change the --fatal flag to allow a number to be
781 passed, this ignores the first N fatal errors. Useful to debug
782 errors that do not happen on the first hit.
784 * cs-parser.jay (invocation_expression): accept both the
785 CLOSE_PARENS and COMPLETE_COMPLETION, this allows completions
786 inside an invocation.
788 * driver.cs: Expose FatalErrors.
790 * eval.cs: Initialize the printer's Fatal property from the
791 Driver's FatalError flag, this allows csharp --fatal to work
794 Add support for calling Describe (typeof (TYPE)) if the expression
797 2010-02-02 Marek Safar <marek.safar@gmail.com>
799 A fix for bug #574991
800 * rootcontext.cs, class.cs, driver.cs: Hide enhanced warnings behind
803 2010-02-02 Marek Safar <marek.safar@gmail.com>
805 A fix for bug #575986
806 * expression.cs: Don't mutate typeof type definitions.
808 2010-01-28 Marek Safar <marek.safar@gmail.com>
810 * decl.cs: Use only one set of modifiers.
812 2010-01-26 Marek Safar <marek.safar@gmail.com>
814 A fix for bug #573329
815 * eval.cs: Don't disable error reporting completely on silent mode.
817 2010-01-25 Marek Safar <marek.safar@gmail.com>
819 A fix for bug #573312
820 * constant.cs, expression.cs, ecore.cs: Emit correct offset for
821 pointer index of unknown size types greater than 2.
823 2010-01-15 Marek Safar <marek.safar@gmail.com>
825 * *.cs: Use only 1 member kind enum.
827 2010-01-15 Marek Safar <marek.safar@gmail.com>
829 * *.cs: Add event specification.
831 2010-01-14 Marek Safar <marek.safar@gmail.com>
833 * membercache.cs: Extracted from decl.cs.
835 * *.cs: Put more infrastructure in place.
837 2010-01-13 Marek Safar <marek.safar@gmail.com>
839 * *.cs: Add property specification, unused yet.
841 2010-01-13 Marek Safar <marek.safar@gmail.com>
843 * property.cs: Move all property based declarations into a new file.
845 2010-01-13 Marek Safar <marek.safar at gmail.com>
847 * expression.cs (Conditional): Resolve reduced expression.
849 2010-01-13 Marek Safar <marek.safar at gmail.com>
851 * *.cs: Introduced non-generic method specification.
853 2010-01-07 Marek Safar <marek.safar@gmail.com>
855 * method.cs: Move all method based declarations into a new file.
857 2010-01-07 Marek Safar <marek.safar@gmail.com>
859 * *.cs: Extract field specification.
861 2009-12-17 Marek Safar <marek.safar@gmail.com>
863 * field.cs: Extracted from class.cs
865 2009-12-15 Marek Safar <marek.safar@gmail.com>
867 * attribute.cs (GetFixedBuffer): Work on field definition only.
869 2009-12-15 Marek Safar <marek.safar@gmail.com>
871 * *.cs: Clean up NET_4_0 conditional where possible.
873 2009-12-14 Rodrigo Kumpera <rkumpera@novell.com>
875 support.cs (DynamicType): Assembly property returns the assembly builder.
876 This is required due to how compiler context works in corlib.
878 2009-12-14 Marek Safar <marek.safar@gmail.com>
880 A fix for bug #564376
881 * assign.cs (LocalTemporary): Removed no longer needed special
884 2009-12-11 Marek Safar <marek.safar@gmail.com>
886 * modifiers.cs, decl.cs, iterators.cs, const.cs, anonymous.cs,
887 class.cs, delegate.cs, cs-parser.jay, enum.cs: Turn modifiers into
888 enum for easier debugging.
890 2009-12-10 Marek Safar <marek.safar@gmail.com>
892 * decl.cs, anonymous.cs, class.cs: Sealed Define it's now main entry
895 * parameter.cs, delegate.cs, dynamic.cs: Don't use builder methods
898 2009-12-10 Marek Safar <marek.safar@gmail.com>
900 * cs-parser.jay, statement.cs: Handle parser error in code
903 2009-12-10 Marek Safar <marek.safar@gmail.com>
905 * ecore.cs: Ignore base imported methods when they are already
908 * eval.cs: Handle non-existent keys.
910 * report.cs, driver.cs: Make fatal work with console printer only.
912 2009-12-08 Rodrigo Kumpera <rkumpera@novell.com>
914 * typemanager.cs (MakeGenericMethod): Fix stupid mistake.
916 2009-12-08 Rodrigo Kumpera <rkumpera@novell.com>
918 * typemanager.cs: Add MakeGenericMethod that checks if the method
919 is really the generic method definition.
921 ecore.cs (MethodGroupExpr:IsApplicable): Use new TypeManager function
922 to inflate generic methods.
924 2009-12-08 Marek Safar <marek.safar@gmail.com>
926 A fix for bug #561149
927 * anonymous.cs: Use actual type parameters when checking for generic
930 2009-12-08 Marek Safar <marek.safar@gmail.com>
932 A fix for bug #561369
933 * expression.cs (DoNumericPromotion): Fixed typo.
935 2009-12-08 Marek Safar <marek.safar@gmail.com>
937 *.cs: Moving to generics world.
939 cs-parser.jay: Removed current_array_type.
941 2009-12-07 Marek Safar <marek.safar@gmail.com>
943 *.cs: Moving to generics world.
945 2009-12-04 Marek Safar <marek.safar@gmail.com>
947 *.cs: Moving to generics world (day 2).
949 2009-12-03 Marek Safar <marek.safar@gmail.com>
951 *.cs: Moving to generics world.
953 2009-12-02 Marek Safar <marek.safar@gmail.com>
955 * typemanager.cs, parameter.cs, class.cs, delegate.cs, attribute.cs:
956 Encode dynamic type attribute for elements where attributes cannot
959 2009-12-01 Marek Safar <marek.safar@gmail.com>
961 argument.cs, assign.cs, expression.cs, cs-parser.jay: Named
964 2009-12-01 Marek Safar <marek.safar@gmail.com>
966 A fix for bug #360455
967 * class.cs: Never report a unused warning for generic events to
968 workaround wrong expression type.
970 2009-11-30 Marek Safar <marek.safar@gmail.com>
972 A fix for bug #558305
973 * decl.cs, class.cs: Check partial method definitions using correct
976 2009-11-30 Marek Safar <marek.safar@gmail.com>
978 * argument.cs: Don't cache rarely used dynamic flag.
980 2009-11-27 Marek Safar <marek.safar@gmail.com>
982 * cs-parser.jay: Use jay global stacks (saves over 3MB for corlib).
984 2009-11-27 Marek Safar <marek.safar@gmail.com>
986 * ecore.cs (SimpleName): Removed no longer needed in_transit as
987 Resolve is now non-reentrant (saves ~0.6MB for corlib).
989 2009-11-26 Marek Safar <marek.safar@gmail.com>
991 A fix for bug #545081
992 * decl.cs: Check private nested types of nested types recursively.
994 2009-11-26 Marek Safar <marek.safar@gmail.com>
996 A fix for bug #558305
997 * location.cs: Ignore self referencing #line directive
999 2009-11-26 Marek Safar <marek.safar@gmail.com>
1001 A fix for bug #558292
1002 * class.cs: Allow single unsafe fixed buffer fields.
1004 2009-11-26 Marek Safar <marek.safar@gmail.com>
1006 * expression: Optimize few more zero-based operations.
1008 2009-11-26 Marek Safar <marek.safar@gmail.com>
1010 * cs-tokenizer.cs, cs-parser.jay: Simplify literal parsing, also
1011 avoids boxing of literal values.
1013 2009-11-26 Marek Safar <marek.safar@gmail.com>
1015 * cs-tokenizer.cs, argument.cs, eval.cs, linq.cs, decl.cs,
1016 expression.cs, ecore.cs, location.cs, cs-parser.jay, attribute.cs,
1017 codegen.cs: LocatedToken redesing to avoid excessive allocation and
1018 boxing (saves ~7MB for corlib). Also fixes presise token location.
1020 2009-11-25 Marek Safar <marek.safar@gmail.com>
1022 * ecore.cs, cs-parser.jay: Keep parser structures local. Share
1023 common data buckers.
1025 2009-11-24 Marek Safar <marek.safar@gmail.com>
1027 * expression.cs: Lower static array initializer barrier.
1029 * support.cs, driver.cs: Share reader buffer.
1031 2009-11-23 Marek Safar <marek.safar@gmail.com>
1033 * cs-tokenizer.cs, support.cs: Some tokenizer optimizations.
1035 2009-11-23 Marek Safar <marek.safar@gmail.com>
1037 * cs-tokenizer.cs, support.cs: Use Dictionary instead of Hashtable,
1038 cleanup some obsolete code.
1040 2009-11-20 Marek Safar <marek.safar@gmail.com>
1042 * context.cs, expression.cs, ecore.cs, complete.cs: Cleaned up
1045 2009-11-20 Marek Safar <marek.safar@gmail.com>
1047 * *.cs: Resolved expressions are never resolved again, this helps to
1048 uncover some not easy to find bugs and improve the performance.
1050 2009-11-19 Marek Safar <marek.safar@gmail.com>
1052 * *.cs: Made constant expressions fully compatible with any other
1055 2009-11-19 Marek Safar <marek.safar@gmail.com>
1057 * *.cs: DoResolve is a worker method and has to be protected.
1059 2009-11-18 Marek Safar <marek.safar@gmail.com>
1061 * *.cs: More context specific handling.
1063 2009-11-17 Marek Safar <marek.safar@gmail.com>
1065 * *.cs: More context specific handling.
1067 2009-11-16 Marek Safar <marek.safar@gmail.com>
1069 * dynamic.cs, class.cs: Removed few fixed user types conversions.
1071 * symbolwriter.cs: Uses public ILOffset.
1073 2009-11-13 Marek Safar <marek.safar@gmail.com>
1075 A fix for bug #553650
1076 * generic.cs: Another missing TypeToCoreType, still too many to fix.
1078 2009-11-13 Marek Safar <marek.safar@gmail.com>
1080 A fix for bug #555170
1082 * class.cs, delegate.cs, enum.cs: Constants have to be available
1083 for parameters resolve.
1085 2009-11-12 Marek Safar <marek.safar@gmail.com>
1087 * typemanager.cs, argument.cs, support.cs, delegate.cs: Dynamic
1090 2009-11-12 Marek Safar <marek.safar@gmail.com>
1092 * argument.cs, context.cs, expression.cs, ecore.cs: Dynamic binding
1093 with a statically known candidate set.
1095 2009-11-11 Scott Peterson <lunchtimemama@gmail.com>
1097 * generic.cs: Made type inflation for generic constraint checks
1098 recursive. This fixes BGO #553655.
1100 2009-11-11 Marek Safar <marek.safar@gmail.com>
1102 * dynamic.cs, decl.cs, expression.cs, ecore.cs: More dynamic type
1105 2009-11-10 Marek Safar <marek.safar@gmail.com>
1107 * typemanager.cs, generic.cs, parameter.cs, argument.cs, dynamic.cs,
1108 linq.cs, rootcontext.cs, ecore.cs, class.cs, delegate.cs,
1109 attribute.cs: Add some dynamic error checking.
1111 2009-11-07 Marek Safar <marek.safar@gmail.com>
1113 A fix for bug #553465
1115 * expression.cs: Fixed mixed version of expression tree anonymous
1118 2009-11-06 Marek Safar <marek.safar@gmail.com>
1120 A fix for bug #553031
1122 * linq.cs, expression.cs, class.cs, cs-parser.jay: Initialize
1123 expression tree version of anonymous type with members declaration.
1125 2009-11-05 Marek Safar <marek.safar@gmail.com>
1127 * parameter.cs: Handle nullable parameter default expression.
1129 * argument.cs, dynamic.cs, expression.cs, support.cs, ecore.cs,
1130 class.cs, attribute.cs: Check for wrong dynamic arguments.
1132 2009-11-05 Marek Safar <marek.safar@gmail.com>
1134 * statement.cs: Dynamic statements.
1136 2009-11-04 Marek Safar <marek.safar@gmail.com>
1138 * dynamic.cs, assign.cs, context.cs, expression.cs, ecore.cs:
1139 Compound assignments over dynamic type.
1141 2009-11-03 Marek Safar <marek.safar@gmail.com>
1143 * argument.cs, dynamic.cs, expression.cs, delegate.cs: Dynamic
1144 constructor arguments.
1146 2009-10-30 Marek Safar <marek.safar@gmail.com>
1148 * dynamic.cs, convert.cs, assign.cs, constant.cs, expression.cs,
1149 codegen.cs: Unary mutator on dynamic member access expression.
1151 2009-10-29 Marek Safar <marek.safar@gmail.com>
1153 A fix for bug #550580
1154 * convert.cs: Don't eliminate explicit precission casts.
1156 2009-10-28 Marek Safar <marek.safar@gmail.com>
1158 A fix for bug #550404
1160 * parameter.cs, iterators.cs, context.cs, anonymous.cs,
1161 expression.cs, statement.cs, ecore.cs: Quote any nested expression
1164 2009-10-27 Marek Safar <marek.safar@gmail.com>
1166 * constant.cs, nullable.cs: Create nullable-null as LiftedNull
1169 * class.cs: Allow nullable binary user operators.
1171 2009-10-26 Marek Safar <marek.safar@gmail.com>
1173 * expression.cs: Move binary expression optimization at the end of
1176 2009-10-23 Marek Safar <marek.safar@gmail.com>
1178 * constant.cs, nullable.cs, expression.cs, literal.cs, cfold.cs:
1179 Separate NullConstant from NullLiteral.
1181 2009-10-23 Marek Safar <marek.safar@gmail.com>
1183 * typemanager.cs, eval.cs, decl.cs, roottypes.cs, context.cs,
1184 anonymous.cs, expression.cs, rootcontext.cs, ecore.cs, class.cs,
1185 flowanalysis.cs, cs-parser.jay, driver.cs, codegen.cs: Split
1186 ModuleContainer. Add common unclosed member check routine.
1188 2009-10-22 Marek Safar <marek.safar@gmail.com>
1190 * argument.cs: Use literal flag for real literals only.
1192 * dynamic.cs: Use correct return type for custom delegates.
1194 2009-10-22 Marek Safar <marek.safar@gmail.com>
1196 * dynamic.cs, expression.cs: Pass logical binary flag to dynamic
1199 2009-10-22 Marek Safar <marek.safar@gmail.com>
1201 * dynamic.cs, ecore.cs: Dynamic invocation with void return type.
1203 2009-10-21 Marek Safar <marek.safar@gmail.com>
1205 * dynamic.cs, convert.cs, expression.cs, ecore.cs: Wrap array index
1208 2009-10-21 Marek Safar <marek.safar@gmail.com>
1210 * typemanager.cs, dynamic.cs, expression.cs: Don't resolve runtime
1213 2009-10-20 Marek Safar <marek.safar@gmail.com>
1215 * argument.cs, dynamic.cs, expression.cs: Latest API update.
1217 2009-10-19 Marek Safar <marek.safar@gmail.com>
1219 * typemanager.cs, expression.cs: Dynamic array initializer.
1221 2009-10-16 Marek Safar <marek.safar@gmail.com>
1223 * typemanager.cs, rootcontext.cs: Clear -nostdlib flag when object
1226 2009-10-16 Marek Safar <marek.safar@gmail.com>
1228 A fix for bug #493523, #507067
1229 * convert.cs, nullable.cs, expression.cs: Do implicit and explicit
1230 standard nullable conversion using underlying standard conversion
1231 and not full conversion.
1233 2009-10-15 Marek Safar <marek.safar@gmail.com>
1235 * dynamic.cs, expression.cs, ecore.cs, delegate.cs: Check return
1236 type in VerifyArgumentsCompat.
1238 2009-10-15 Marek Safar <marek.safar@gmail.com>
1240 * nullable.cs, expression.cs, statement.cs, namespace.cs, ecore.cs:
1241 Reject variable used with type arguments.
1243 2009-10-14 Marek Safar <marek.safar@gmail.com>
1245 * argument.cs, dynamic.cs, assign.cs, expression.cs, ecore.cs:
1246 Implement dynamic expressions assignment.
1248 2009-10-14 Marek Safar <marek.safar@gmail.com>
1250 * expression.cs: Build underlying expression when resolving unary
1253 2009-10-14 Marek Safar <marek.safar@gmail.com>
1255 * expression.cs: Emit enum array initializer using binary blob.
1257 2009-10-08 Marek Safar <marek.safar@gmail.com>
1259 * typemanager.cs, constant.cs: Optimize decimal constants which fit
1262 2009-10-07 Marek Safar <marek.safar@gmail.com>
1264 * typemanager.cs: Reset object_type.
1266 * assign: Made SimpleAssign public.
1268 2009-10-06 Marek Safar <marek.safar@gmail.com>
1270 * typemanager.cs, decl.cs, namespace.cs, ecore.cs, class.cs: Pass
1271 invocation assembly to IsThisOrFriendAssembly.
1273 2009-10-05 Marek Safar <marek.safar@gmail.com>
1275 * expression.cs: Equality comparison of generic parameter with
1278 2009-10-05 Marek Safar <marek.safar@gmail.com>
1280 A fix for bug #543570
1281 * generic.cs: Import predefined constraints correctly.
1283 2009-10-02 Marek Safar <marek.safar@gmail.com>
1285 * ecore.cs: Don't crash on overloads with optional paremeters where
1286 arguments count overflows.
1288 * parameter.cs: Import optional parameter constants using optional
1291 2009-10-01 Marek Safar <marek.safar@gmail.com>
1293 * Makefile: Default is gmcs compiler.
1295 2009-10-01 Marek Safar <marek.safar@gmail.com>
1297 * cs-parser.jay: Fixed few NRE.
1299 2009-10-01 Marek Safar <marek.safar@gmail.com>
1301 * cs-parser.jay, driver.cs: Expose parser exception in verbose mode.
1303 2009-09-30 Marek Safar <marek.safar@gmail.com>
1305 * linq.cs, convert.cs, assign.cs, expression.cs, ecore.cs: Add
1306 ShimExpression, ImplicitCast.
1308 2009-09-30 Marek Safar <marek.safar@gmail.com>
1310 A fix for bug #542959
1311 * delegate.cs: Emit correct delegate instance variable when there
1312 are static and non-static overloads.
1314 2009-09-29 Marek Safar <marek.safar@gmail.com>
1316 * dynamic.cs, linq.cs, anonymous.cs, expression.cs, statement.cs,
1317 ecore.cs, cs-parser.jay: Unary expression dynamic compiler.
1319 2009-09-28 Marek Safar <marek.safar@gmail.com>
1321 A fix for bug #542487
1322 * ecore.cs: Resolve extension methods hidden by properties.
1324 2009-09-25 Marek Safar <marek.safar@gmail.com>
1326 * expression.cs, ecore.cs: More dynamic binary expressions.
1328 2009-09-22 Marek Safar <marek.safar@gmail.com>
1330 * nullable.cs, expression.cs: Fixed null lifted conversion for
1331 bitwise enum operations.
1333 2009-09-22 Marek Safar <marek.safar@gmail.com>
1335 * convert.cs, ecore.cs: Fixed explicit unsafe coversion of long
1336 values in checked context.
1338 2009-09-22 Marek Safar <marek.safar@gmail.com>
1340 * expression.cs, ecore.cs: Fixed array index constant conversion.
1342 2009-09-20 Miguel de Icaza <miguel@novell.com>
1344 * expression.cs: Do not crash when MemberLookup returns something
1345 that is not a MemberExpr here. Report error 582 instead.
1349 2009-09-18 Marek Safar <marek.safar@gmail.com>
1351 * decl.cs, class.cs: Check protected property accessors.
1353 2009-09-18 Marek Safar <marek.safar@gmail.com>
1355 * dynamic.cs, assign.cs: Dynamic compound assignment.
1357 2009-09-17 Marek Safar <marek.safar@gmail.com>
1359 * expression.cs: Fixed compound assignment explicit conversion.
1361 2009-09-17 Marek Safar <marek.safar@gmail.com>
1363 * expression.cs, ecore.cs: Cannot infer variables from method group.
1365 2009-09-16 Marek Safar <marek.safar@gmail.com>
1367 * argument.cs, dynamic.cs, convert.cs, context.cs, anonymous.cs,
1368 constant.cs, nullable.cs, expression.cs, literal.cs, ecore.cs,
1369 codegen.cs: Dynamic binary operations scaffolding.
1371 2009-09-15 Marek Safar <marek.safar@gmail.com>
1373 * expression.cs: Fixes nullable promotion for enum type variables.
1375 2009-09-11 Marek Safar <marek.safar@gmail.com>
1377 * driver.cs, dynamic.cs: Reset more static variables.
1379 2009-09-11 Marek Safar <marek.safar@gmail.com>
1381 * dynamic.cs, expression.cs, rootcontext.cs, namespace.cs, ecore.cs,
1382 driver.cs: Introduced Expression::MakeExpression.
1384 2009-09-11 Marek Safar <marek.safar@gmail.com>
1386 * eval.cs: Exposed MessageOutput instead of cleaning up eval API.
1388 2009-09-09 Marek Safar <marek.safar@gmail.com>
1390 * eval.cs, report.cs: Use Console.Out for all eval error or warning
1393 2009-09-09 Marek Safar <marek.safar@gmail.com>
1395 A fix for bug #518707
1396 * expression.cs (Is): Optimize only generic parameter type
1397 expression probing value type generic parameter.
1399 2009-09-09 Marek Safar <marek.safar@gmail.com>
1401 A fix for bug #532571
1402 * ecore.cs: Check for simple name type arguments used with
1405 2009-09-08 Marek Safar <marek.safar@gmail.com>
1407 A fix for bug #497421
1408 * generic.cs (CheckConstraint): Don't use buildin types to check for
1409 parameterless constructor.
1411 2009-09-08 Marek Safar <marek.safar@gmail.com>
1413 A fix for bug #537402
1414 * generic.cs (CheckConstraint): Correctly inflate generic type
1415 arguments when checking generic method.
1417 2009-09-08 Marek Safar <marek.safar@gmail.com>
1419 A fix for bug #536463
1420 * decl.cs (AddToContainer): Don't report collision between explicit
1421 and parameterless non-explicit members.
1423 2009-09-08 Marek Safar <marek.safar@gmail.com>
1425 * eval.cs: Reset more static stuff.
1427 2009-09-07 Marek Safar <marek.safar@gmail.com>
1429 A fix for bug #324625
1430 * expression.cs, ecore.cs: Create nested generic type expression
1431 using declaring and not current type.
1433 2009-09-07 Marek Safar <marek.safar@gmail.com>
1435 * *.cs: Changed Report class to accept various output printers and
1436 be an instance class. An expression resolver can now use different
1437 message reporter for each call and Report.Error can safely throw
1438 an exception. Part of ongoing work to turn mcs into proper library.
1440 2009-09-04 Marek Safar <marek.safar@gmail.com>
1442 * statement.cs, ecore.cs: Removed error reporting from emit code.
1444 2009-09-04 Marek Safar <marek.safar@gmail.com>
1446 * cs-parser.jay, parameter.cs: Moved parser check out of constructor
1448 2009-09-03 Marek Safar <marek.safar@gmail.com>
1450 * anonymous.cs, expression.cs, statement.cs, cs-parser.jay: Moved
1451 parser checks out of constructors.
1453 2009-09-02 Marek Safar <marek.safar@gmail.com>
1455 * expression.cs, statement.cs, ecore.cs: Use common Report.Error.
1457 2009-09-02 Marek Safar <marek.safar@gmail.com>
1459 A fix for bug #535448
1460 * anonymous.cs, class.cs: Copy return label between all contexts.
1462 2009-09-02 Marek Safar <marek.safar@gmail.com>
1464 A fix for bug #535395
1465 * namespace.cs: Resolve context can be null.
1467 2009-08-25 Marek Safar <marek.safar@gmail.com>
1469 A fix for bug #533912
1470 * generic.cs: Use correct context for constraints resolving.
1472 2009-08-25 Marek Safar <marek.safar@gmail.com>
1474 A fix for bug #532630
1475 * driver.cs: Trim conditional symbols.
1477 2009-08-25 Marek Safar <marek.safar@gmail.com>
1479 * context.cs: New file.
1481 * *.exe.sources, *.csproj: Updated.
1483 2009-08-25 Marek Safar <marek.safar@gmail.com>
1485 * generic.cs, parameter.cs, decl.cs, statement.cs, namespace.cs,
1486 class.cs, generic-mcs.cs, codegen.cs: Add GetSignatureForError to
1487 IMembercontext, some small cleanups.
1489 2009-08-24 Marek Safar <marek.safar@gmail.com>
1491 * *.cs: Split ResolveContext and EmitContext.
1493 2009-08-24 Marek Safar <marek.safar@gmail.com>
1495 * *.cs: Only ResolveContext implements IMemberContext.
1497 2009-08-21 Marek Safar <marek.safar@gmail.com>
1499 * *.cs: Renamed IResolveContext to IMemberContext.
1501 2009-08-21 Marek Safar <marek.safar@gmail.com>
1503 * *.cs: Detached ResolveContext from EmitContext.
1505 2009-08-21 Marek Safar <marek.safar@gmail.com>
1507 * codegen.cs: Moved flow-analysis to BlockContext.
1509 2009-08-21 Marek Safar <marek.safar@gmail.com>
1511 * *.cs: Detached BlockContext from EmitContext.
1513 2009-08-20 Gonzalo Paniagua Javier <gonzalo@novell.com>
1515 * statement.cs: avoid nullref when the return value of GetEnumerator()
1516 does not contain any MoveNext() method.
1518 2009-08-19 Marek Safar <marek.safar@gmail.com>
1520 * *.cs: Removed IResolveContext::GenericDeclContainer.
1522 2009-08-19 Marek Safar <marek.safar@gmail.com>
1524 * class.cs, delegate.cs: Changed Delegate to be TypeContainer based.
1526 2009-08-19 Marek Safar <marek.safar@gmail.com>
1528 * generic.cs, iterators.cs, expression.cs, statement.cs, ecore.cs,
1529 cs-parser.jay, attribute.cs, codegen.cs: Better error reports.
1531 2009-08-18 Marek Safar <marek.safar@gmail.com>
1533 * *.cs: Removed boolean fields from EmitContext.
1535 2009-08-18 Marek Safar <marek.safar@gmail.com>
1537 * *.cs: Add IResolveContext::IsStatic.
1539 2009-08-18 Marek Safar <marek.safar@gmail.com>
1541 * *.cs: Moved TopBlock's methods from EmitContext to TopBlock.
1543 2009-08-17 Marek Safar <marek.safar@gmail.com>
1545 * *.cs: Removed DeclContainer from EmitContext.
1547 2009-08-17 Marek Safar <marek.safar@gmail.com>
1549 * *.cs: Add IResolveContext::CurrentTypeParameters.
1551 2009-08-14 Marek Safar <marek.safar@gmail.com>
1553 * *.cs: Removed TypeContainer and ContainerType from EmitContext.
1555 2009-08-14 Marek Safar <marek.safar@gmail.com>
1557 * decl.cs, expression.cs, namespace.cs, ecore.cs, class.cs,
1558 codegen.cs: Add IResolveContext::LookupExtensionMethod.
1560 2009-08-13 Marek Safar <marek.safar@gmail.com>
1562 * decl.cs: Look in PartialContainer for parent type parameters.
1564 2009-08-13 Marek Safar <marek.safar@gmail.com>
1566 * decl.cs, namespace.cs, ecore.cs, class.cs, attribute.cs,
1567 codegen.cs: Add IResolveContext::LookupTypeParameter.
1569 2009-08-13 Marek Safar <marek.safar@gmail.com>
1571 * lambda.cs, expression.cs, statement.cs, namespace.cs, ecore.cs:
1572 Moved resolved logic from Emit to Resolve.
1574 2009-08-13 Marek Safar <marek.safar@gmail.com>
1576 * parameter.cs, decl.cs, roottypes.cs, class.cs, attribute.cs,
1577 codegen.cs: Reworked atttributes handling of ResolveContext.
1579 2009-08-12 Marek Safar <marek.safar@gmail.com>
1581 * decl.cs, ecore.cs, class.cs, attribute.cs, codegen.cs: Pushed
1582 LookupNamespaceOrType to ResolveContext.
1584 2009-08-12 Marek Safar <marek.safar@gmail.com>
1586 * typemanager.cs, decl.cs, expression.cs, namespace.cs, ecore.cs,
1587 class.cs: Removed unused parameters and methods.
1589 2009-08-11 Marek Safar <marek.safar@gmail.com>
1591 * generic.cs, lambda.cs, anonymous.cs, statement.cs, generic-mcs.cs,
1592 codegen.cs: Finding the best common type of a set of expressions for
1595 2009-08-07 Marek Safar <marek.safar@gmail.com>
1597 * dynamic.cs, expression.cs: More dynamic conversions.
1599 2009-08-06 Miguel de Icaza <miguel@novell.com>
1601 * generic.cs: This loop was incorrect, it was increment ii, but
1602 checking for `i'. This was a change introduced to fix #327497,
1605 * class.cs: Catch another case for cs0533 error, fixes #324782.
1607 2009-08-06 Rodrigo Kumpera <rkumpera@novell.com>
1609 * typemanager.cs (GetGenericArguments): SRE returns null for
1610 generic methods on type builder instances if they are not generic
1611 themselves. For example, for Foo<int>::Bar() it returns null, but
1612 not for Foo<int>::Bar<>() or Foo<int>::Bar<double>().
1614 2009-08-05 Marek Safar <marek.safar@gmail.com>
1616 * argument.cs, dynamic.cs, expression.cs, ecore.cs, class.cs,
1617 delegate.cs: Work on dynamic binding.
1619 2009-08-04 Marek Safar <marek.safar@gmail.com>
1621 A second fix for bug #525342
1622 * class.cs: Attach partial method attributes to method
1625 2009-08-03 Marek Safar <marek.safar@gmail.com>
1627 * typemanager.cs, parameter.cs, support.cs, class.cs: Dynamic type
1630 * rootcontext.cs: Default to langversion v4.
1632 2009-08-03 Marek Safar <marek.safar@gmail.com>
1634 * pending.cs: Check return type before member info is set.
1636 2009-08-03 Marek Safar <marek.safar@gmail.com>
1638 * anonymous.cs: Fully initialize generic hoisted field expression.
1640 2009-08-02 Miguel de Icaza <miguel@novell.com>
1642 * cs-parser.jay: Flag variables declared on the interactive shell
1643 as used to prevent the 168 warning about local variable not being
1646 2009-07-31 Marek Safar <marek.safar@gmail.com>
1648 * parameter.cs, dynamic.cs, support.cs, class.cs, delegate.cs,
1649 attribute.cs: Emit dynamic export attribute.
1651 2009-07-30 Marek Safar <marek.safar@gmail.com>
1653 * expression.cs: More verifier work.
1655 2009-07-29 Marek Safar <marek.safar@gmail.com>
1657 * nullable.cs: Fixed SRE crash during corlib compilation.
1659 2009-07-29 Marek Safar <marek.safar@gmail.com>
1661 * generic.cs, typemanager.cs, decl.cs, iterators.cs, convert.cs,
1662 nullable.cs, expression.cs, ecore.cs, class.cs, attribute.cs:
1663 More TypeManager.TypeToCoreType needed.
1665 2009-07-29 Marek Safar <marek.safar@gmail.com>
1667 * anonymous.cs: Update after recent SRE fixes.
1669 2009-07-28 Marek Safar <marek.safar@gmail.com>
1671 * typemanager.cs, expression.cs, ecore.cs, delegate.cs: Use correct
1672 version of GetFieldHandle for fields of generic types.
1674 2009-07-27 Marek Safar <marek.safar@gmail.com>
1676 * typemanager.cs, argument.cs, convert.cs, assign.cs, expression.cs,
1677 ecore.cs: Add TypeManager.IsDynamicType,
1678 PredefinedAttributes.Dynamic.
1680 2009-07-27 Marek Safar <marek.safar@gmail.com>
1682 A fix for bug #415375
1683 * expression.cs: Fixed object and reference type parameter
1686 2009-07-27 Marek Safar <marek.safar@gmail.com>
1688 A fix for bug #525342
1689 * class.cs: Attach partial method attributes to method
1692 2009-07-24 Marek Safar <marek.safar@gmail.com>
1694 * argument.cs, dynamic.cs, expression.cs, class.cs, attribute.cs:
1697 2009-07-24 Marek Safar <marek.safar@gmail.com>
1699 * anonymous.cs (MutateField): Add imported types handling.
1701 2009-07-23 Marek Safar <marek.safar@gmail.com>
1703 * expression.cs, delegate.cs: Moved arguments resolve into their
1704 counterparts expressions. Removed argument resolve from
1705 CollectionElementInitializer.
1707 2009-07-23 Marek Safar <marek.safar@gmail.com>
1709 A fix for bug #523683
1710 * convert.cs, delegate.cs: Use common overload mechanism for method
1711 group conversion check.
1713 2009-07-22 Marek Safar <marek.safar@gmail.com>
1715 A fix for bug #523899
1716 * generics.cs: Exact type inference with other bound types.
1718 2009-07-22 Raja R Harinath <harinath@hurrynot.org>
1720 Don't complain when the same type is implemented by the output
1721 assembly as well as multiple referenced assemblies
1722 * namespace.cs (RootNamespace.LookupTypeReflection): Add
1723 'must_be_unique' flag.
1724 (GlobalRootNamespace): Update to changes.
1725 (Namespace.LookupType): Pass 'must_be_unique' only when we don't
1726 already have a type in hand.
1728 2009-07-22 Marek Safar <marek.safar@gmail.com>
1730 * expression.cs: More verifier instrumentation.
1732 * statement.cs: Do proper throw expression conversion.
1734 2009-07-22 Marek Safar <marek.safar@gmail.com>
1736 A fix for bug #522789
1737 * expression.cs: Mutate invocation return type.
1739 2009-07-16 Marek Safar <marek.safar@gmail.com>
1741 * anonymous.cs: Split assignable and readonly generated variable
1744 2009-07-16 Marek Safar <marek.safar@gmail.com>
1746 A fix for bug #521671
1747 * statement.cs: Fixed crash when checking missing type.
1749 2009-07-16 Marek Safar <marek.safar@gmail.com>
1751 * typemanager.cs, generic.cs, argument.cs, linq.cs, convert.cs,
1752 assign.cs, expression.cs, statement.cs, support.cs, ecore.cs,
1753 class.cs, driver.cs: Work on dynamic binding.
1755 * dynamic.cs: New file.
1757 * *.sources, *.proj: Updated.
1759 2009-07-15 Marek Safar <marek.safar@gmail.com>
1761 * expression.cs (Conditional): Avoid double Resolve.
1763 2009-07-13 Marcus Griep <marcus@griep.us>
1765 * ecore.cs: Fix obscure bug with resolving members of interfaces
1766 that hide parent interface members. Fixes bug #444388 and corrects
1769 2009-07-13 Marek Safar <marek.safar@gmail.com>
1771 * expression.cs (LocalVariableReference): Bounce resolve.
1773 2009-07-10 Marek Safar <marek.safar@gmail.com>
1775 * typemanager.cs, lambda.cs, parameter.cs, convert.cs, anonymous.cs,
1776 expression.cs, literal.cs, ecore.cs, complete.cs: Moved internal
1779 * support.cs: New dynamic type wrapper.
1781 2009-07-08 Marek Safar <marek.safar@gmail.com>
1783 * ecore.cs, cs-parser.jay: Better error reporting for implicitly
1784 typed local variable.
1786 2009-07-06 Marek Safar <marek.safar@gmail.com>
1788 A fix for bug #519005
1789 * anonymous.cs: Use null_type as no return type placeholder.
1791 2009-07-02 Marek Safar <marek.safar@gmail.com>
1793 * generic.cs: Handle type inference of identical type parameters
1794 with different bounds.
1796 2009-07-01 Marek Safar <marek.safar@gmail.com>
1798 * expression.cs, class.cs: Events variance.
1800 * cs-parser.jay: Interface events error messages.
1802 2009-07-01 Marek Safar <marek.safar@gmail.com>
1804 * generic.cs, argument.cs: Updated type inference logic to C# 4.0.
1806 2009-06-29 Marek Safar <marek.safar@gmail.com>
1808 * parameter.cs, convert.cs, expression.cs, class.cs: Default
1809 parameter expression can be value-type New.
1811 * cs-parser.jay: Clean up too many parameter modifier boolean flags.
1813 2009-06-26 Marek Safar <marek.safar@gmail.com>
1815 * generic.cs, argument.cs, expression.cs, ecore.cs, cs-parser.jay:
1816 Implemented C# 4.0 named arguments.
1818 2009-06-24 Marek Safar <marek.safar@gmail.com>
1820 * typemanager.cs, parameter.cs, iterators.cs, convert.cs,
1821 expression.cs, ecore.cs, delegate.cs: Removed unnecessary ArgList
1822 parameter modifier. Also fixes bug #515497.
1824 2009-06-24 Marek Safar <marek.safar@gmail.com>
1826 * *.cs: Replaced ArrayList with Arguments in need of a nonsequential
1827 arguments expression to be implemented.
1829 *.sources: Add argument.cs
1831 2009-06-23 Marek Safar <marek.safar@gmail.com>
1833 * parameter.cs: Moved GetParameterIndexByName to base class.
1835 * expression.cs, statement.cs, ecore.cs, delegate.cs: Removed
1836 unused AType. Use argument's version of GetExpressionTree.
1838 2009-06-22 Marek Safar <marek.safar@gmail.com>
1840 * expression.cs, cs-parser.jay, attribute.cs, codegen.cs: Named
1843 2009-06-17 Marek Safar <marek.safar@gmail.com>
1845 A fix for bug #514096
1846 * class.cs: Allow IntPtr/UIntPtr fields to be volatile.
1848 2009-06-17 Marek Safar <marek.safar@gmail.com>
1850 * expression.cs: The first multi-dimensional array nested array
1851 initializers was not checked.
1853 * statement.cs (Switch): Fixed error message to reflect 2.0 changes.
1855 2009-06-17 Marek Safar <marek.safar@gmail.com>
1857 A fix for bug #513400
1858 * nullable.cs (EmitEquality): Operands emit could be simplified for
1859 built-in types when we now emit user operators differently.
1861 2009-06-16 Marek Safar <marek.safar@gmail.com>
1863 * ecore.cs: Report inaccessible delegate methods correctly.
1865 2009-06-16 Marek Safar <marek.safar@gmail.com>
1867 * parameter.cs, expression.cs, ecore.cs, class.cs, delegate.cs,
1868 cs-parser.jay: Implemented C# 4.0 optional parameters.
1870 2009-06-16 Marek Safar <marek.safar@gmail.com>
1872 * driver.cs: Removed broken DefineManifestResource.
1874 2009-06-16 Raja R Harinath <harinath@hurrynot.org>
1876 * Makefile [net_2_0_bootstrap]: Don't explicitly mention net_1_1.
1877 Use $(BOOTSTRAP_PROFILE) instead.
1879 2009-06-12 Jb Evain <jbevain@novell.com>
1881 * rootcontext.cs: add a Platform field.
1882 * driver.cs: handle /platform.
1883 * codegen.cs: pass the proper flags according to
1884 the platform when saving the assembly.
1886 2009-06-11 Marek Safar <marek.safar@gmail.com>
1888 * parameter.cs, const.cs, report.cs, cs-parser.jay, attribute.cs:
1889 Add optional parameters grammar.
1891 2009-06-10 Marek Safar <marek.safar@gmail.com>
1893 * eval.cs, anonymous.cs, report.cs, rootcontext.cs, cs-parser.jay,
1894 driver.cs: Split lang version and metadata version.
1896 2009-06-10 Marek Safar <marek.safar@gmail.com>
1898 * decl.cs: Better overload ctor collision error message.
1900 2009-06-05 Jb Evain <jbevain@novell.com>
1902 * driver.cs (EmbededResource): avoid using an internal method
1903 in gmcs to embed manifest resources.
1905 2009-06-04 Sebastien Pouliot <sebastien@ximian.com>
1907 * generic.cs, parameter.cs: Avoid using 'var' so we can bootstrap
1908 the compiler from older mono versions (like moon's bots)
1910 2009-06-04 Marek Safar <marek.safar@gmail.com>
1912 * namespace.cs (LookupTypeReflection): Ignore collisions between
1915 2009-06-04 Marek Safar <marek.safar@gmail.com>
1917 * codegen.cs: Enabled generic type forwarders.
1919 2009-06-04 Marek Safar <marek.safar@gmail.com>
1921 * dmcs.*: Add another version of SRE compiler.
1923 2009-06-03 Marek Safar <marek.safar@gmail.com>
1925 * generic.cs, typemanager.cs, parameter.cs, convert.cs,
1926 generic-mcs.cs: Fixed variant type conversions.
1928 2009-06-02 Marek Safar <marek.safar@gmail.com>
1930 A fix for bug #507863
1931 * codegen.cs: Fixes a crash on invalid string value attribute.
1933 2009-06-01 Marek Safar <marek.safar@gmail.com>
1935 A fix for bug #508334
1936 * typemanager.cs, parameter.cs, convert.cs, expression.cs, ecore.cs,
1937 cs-parser.jay: Fully import __arglist modifier.
1939 2009-05-29 Marek Safar <marek.safar@gmail.com>
1941 * generic.cs, typemanager.cs, parameter.cs, ecore.cs, class.cs,
1942 delegate.cs, generic-mcs.cs: Rewrote type variance checks to
1943 actually work with closed generic types.
1945 2009-05-27 Alan McGovern <amcgovern@novell.com>
1947 * class.cs, decl.cs, delegate.cs, parameter.cs:
1948 Fix the build by replacing the use of 'var' with the actual type.
1950 2009-05-27 Marek Safar <marek.safar@gmail.com>
1952 * generic.cs, parameter.cs, decl.cs, ecore.cs, class.cs, delegate.cs
1953 cs-parser.jay, generic-mcs.cs: Report wrong variant types
1956 * driver.cs, rootcontext.cs, report.cs: Add 3.0 language version
1959 2009-05-26 Rodrigo Kumpera <rkumpera@novell.com>
1960 Marek Safar <marek.safar@gmail.com>
1962 A fix for bug #377509
1963 * parameter.cs: Use predefined and not empty name for implicit
1966 2009-05-21 Marek Safar <marek.safar@gmail.com>
1968 * class.cs: Don't report wrong warnings for event fields.
1970 2009-05-21 Marek Safar <marek.safar@gmail.com>
1972 A fix for bug #504667
1973 * class.cs: Check for static class using parent container instead of
1976 2009-05-08 Marek Safar <marek.safar@gmail.com>
1978 A fix for bug #496922
1979 * expression.cs: Always use temporary variable when using object
1982 2009-04-28 Marek Safar <marek.safar@gmail.com>
1984 A fix for bug #495112
1985 * class.cs (IsUnmanagedType): Handle recursive unmanaged types using
1988 2009-04-27 Miguel de Icaza <miguel@novell.com>
1990 * driver.cs: Add a flag to work as a replacement for CSC in VS.
1992 2009-04-24 Miguel de Icaza <miguel@novell.com>
1994 * complete.cs: No idea how gonzalo got a null in the list, but
1997 2009-04-24 Miguel de Icaza <miguel@novell.com>
1999 * complete.cs (CompletionElementInitializer): New completion class
2000 to support completing inside a C# 3 element initializer, so this
2001 allows completion for Silverlight situations where it is very
2004 new TextBlock () { Fo<TAB>
2006 (CompletionSimpleName): Expose the prefix that was
2007 passed to the simple name.
2009 * cs-parser.jay (object_or_collection_initializer): Add support
2010 for element_initializers.
2012 * expression.cs (CollectionOrObjectInitializers.DoResolve):
2013 special case completion expressions as this method aggressively
2014 collects data before it operates, and errors were being thrown
2015 earlier than we were able to complete.
2017 2009-04-23 Miguel de Icaza <miguel@novell.com>
2019 * eval.cs: Make getcompletions silent and enable debugging output
2020 if the -v option is passed.
2022 * namespace.cs (NamespaceEntry.CompletionGetTypesStartingWith):
2023 Consider looking up the namespace that matches the prefix being
2026 This is part of the support for allowing completions like:
2027 `System.Co<TAB>' to complete to System.Console.
2029 * complete.cs (CompletionSimpleName.AppendResults): Make this
2032 2009-04-21 Raja R Harinath <harinath@hurrynot.org>
2034 * cs-parser.jay (GetTokenName): Mark GENERATE_COMPLETION and
2035 COMPLETE_COMPLETION as internal.
2037 2009-04-17 Miguel de Icaza <miguel@novell.com>
2039 * complete.cs: Include namespace resolution in simple names as
2040 well as global types and types in the using scope in the
2043 * namespace.cs: Supporting infrastrcture to provide completions
2044 based on the current using scope.
2046 * eval.cs: Introduce an entry point that allows for initialization
2047 to return a list of the files passed on the command line.
2049 2009-04-14 Marek Safar <marek.safar@gmail.com>
2051 A fix for bug #494243
2052 * report.cs (SymbolRelatedToPreviousError): Fixed NRE.
2054 2009-04-13 Marek Safar <marek.safar@gmail.com>
2056 A fix for bug #493887
2057 * statement.cs: Don't skip string multi-section with default or
2058 null label when populating string hashtable.
2060 2009-04-06 Marek Safar <marek.safar@gmail.com>
2062 A fix for bug #492329
2063 * expression.cs (New): Load variable when assigning type parameter
2066 2009-04-06 Marek Safar <marek.safar@gmail.com>
2068 A fix for bug #488960
2069 * decl.cs: Compare MVAR types using non-null values.
2071 2009-03-27 Marek Safar <marek.safar@gmail.com>
2073 * typemanager.cs, expression.cs: Removed unused nullable checks.
2075 2009-03-27 Marek Safar <marek.safar@gmail.com>
2077 * *.cs: Removed some gmcs conditionals.
2079 2009-03-26 Marek Safar <marek.safar@gmail.com>
2081 * generic.cs, support.cs: Moved generics stuff out of support.cs
2083 2009-03-24 Marek Safar <marek.safar@gmail.com>
2085 * ecore.cs, expression.cs: Use queried type for MethodGroupExpr
2088 2009-03-23 Marek Safar <marek.safar@gmail.com>
2090 * attribute.cs: Consider all members for error reporting when
2091 checking named arguments.
2093 2009-03-23 Marek Safar <marek.safar@gmail.com>
2095 A fix for bug #487625
2096 * namespace.cs: Use a warning for all predefined type conflicts.
2098 2009-03-23 Marek Safar <marek.safar@gmail.com>
2100 A fix for bug #485706
2101 * statement.cs: Explicitly type catch type argument to pass verifier
2104 2009-03-22 Miguel de Icaza <miguel@novell.com>
2106 Initial support to provide code completion facilities to consumers
2107 of the evaluator API.
2109 * cs-tokenizer.cs (CompleteOnEOF): this new property is used to
2110 support the completion engine. When we reach the end of the
2111 input stream instead of returning EOF, when this flag is true the
2112 tokenizer instead produces:
2114 One GENERATE_COMPLETION token: this token then must be
2115 handled in the grammar at every point where the user
2116 would likely request a completion.
2118 As many COMPLETE_COMPLETION tokens as necessary. These
2119 tokens are generated to assist the parser in unwinding and
2120 producing a valid parse tree.
2122 The parser rules do not have to be perfect, the parser needs to be
2123 augmented with judicious use of GENERATE_COMPLETION tokens to
2124 improve the areas where we can provide completion and the parser
2125 needs to add support for COMPLETE_COMPLETION tokens in productions
2128 It is common to not have enough support for COMPLETE_COMPLETION
2129 under certain rules and that even if we generated the
2130 GENERATE_COMPLETION token that the resulting tree will be invalid
2131 due to the missing rules that support COMPLETE_COMPLETION.
2133 The final EOF token is produced by having the parser notify the
2134 tokenizer when it reaches the root production that the next token
2137 * support.cs (CompletionResult): New Exception. This exception
2138 is thrown to return the completion results when one of the special
2139 completion expressions is reached.
2141 This exception is thrown by the completing ExpressionStatements
2142 classes that live in complete.cs
2144 * complete.cs (CompletingExpression): a new base class for
2145 completing expressions. This derives from the
2146 ExpressionStatement class and not from Expression as it allows
2147 completion to happen not only where expressions are expected in
2148 the grammar, but also where statements are expected.
2150 (CompletionSimpleName): A new class used to provide completions
2151 for SimpleNames. This currently only resolves to local
2152 variables from the evaluator context (GetVars call).
2154 (CompletionMemberAccess): Implements support for completing member
2157 * cs-parser.jay: Add support for completion in a few places.
2159 * eval.cs (GetCompletions): New public API for the evaluator that
2160 returns a list of possible completions given the input. The
2161 return value is an array of completions
2163 * anonymous.cs (Compatible): If the exception thrown from the
2164 resolved expression is a CompletionResult exception let that one
2165 through instead of printing a diagnostic error in the try/catch.
2167 2009-03-22 Miguel de Icaza <miguel@novell.com>
2171 * driver.cs (Main): Use Environment.Exit to quit quickly and
2172 prevent the compiler from doing the usual wait for helper thread
2175 This is to prevent a slowdown that was reported by Gonzalo on
2178 2009-03-19 Marek Safar <marek.safar@gmail.com>
2180 * ecore.cs: Load build-in types directly instead of accessing
2183 2009-03-18 Marek Safar <marek.safar@gmail.com>
2185 * ecore.cs: Always use unbox.any when available.
2187 2009-03-18 Marek Safar <marek.safar@gmail.com>
2189 * class.cs: Always set TypeAttributes.BeforeFieldInit conditionally.
2191 2009-03-17 Marek Safar <marek.safar@gmail.com>
2193 * generic.cs: Removed obsolete version of type inference.
2195 2009-03-16 Marek Safar <marek.safar@gmail.com>
2197 * typemanager.cs, decl.cs, roottypes.cs, anonymous.cs, nullable.cs,
2198 expression.cs, rootcontext.cs, namespace.cs, ecore.cs, class.cs,
2199 delegate.cs, flowanalysis.cs, cs-parser.jay, driver.cs,
2200 attribute.cs, codegen.cs: Changed RootTypes to be ModuleContainer.
2202 2009-03-11 Marek Safar <marek.safar@gmail.com>
2204 A fix for bug #482996
2205 * anonymous.cs: Make sure we are not infering return type when
2206 checking type compatibility.
2208 2009-03-11 Marek Safar <marek.safar@gmail.com>
2210 * typemanager.cs, generic.cs, parameter.cs, decl.cs, const.cs,
2211 rootcontext.cs, namespace.cs, class.cs, delegate.cs, driver.cs,
2212 generic-mcs.cs, attribute.cs, codegen.cs: Maintain predefined
2213 attributes in their own structure. Needed when accessing their
2214 properties before they are resolved.
2216 2009-03-09 Marek Safar <marek.safar@gmail.com>
2218 * cs-tokenizer.cs: Optimized GetKeyword using an array instead of
2219 hashtable (~10x faster).
2221 * driver.cs: Removed wrong Reset.
2223 2009-03-08 Marek Safar <marek.safar@gmail.com>
2225 * class.cs: Use correct common base type for unmanaged delayed
2228 * rootcontext.cs: Wrap unhandled exception.
2230 2009-03-06 Raja R Harinath <harinath@hurrynot.org>
2232 Make SeekableStreamReader self-tuning and arbitrarily seekable
2233 * support.cs (SeekableStreamReader.ResetStream): New. Allocates
2235 (SeekableStreamReader.Position.set): Use it. Simplify logic
2236 which, as a side-effect, makes it arbitrarily-seekable. Tune the
2237 buffer size when the stream needs to be re-read from the beginning.
2239 2009-03-05 Marek Safar <marek.safar@gmail.com>
2241 A fix for bug #480100
2242 * parameter.cs: A parameter is not hoisted when used directly as ET.
2244 2009-03-04 Marek Safar <marek.safar@gmail.com>
2246 * statement.cs: Fixed an issue when using variable is of interface
2249 2009-03-03 Marek Safar <marek.safar@gmail.com>
2251 A fix for bug #480319
2252 * report.cs, driver.cs: Support -warnaserror-:<warning list> option.
2254 2009-03-03 Marek Safar <marek.safar@gmail.com>
2256 A fix for bug #480867
2257 * typemanager.cs, expression.cs, ecore.cs: Changed method group
2258 expression to have no valid type.
2260 2009-03-03 Marek Safar <marek.safar@gmail.com>
2262 A fix for bug #481258
2263 * class.cs: Set extension method flag in partial container.
2265 2009-03-03 Marek Safar <marek.safar@gmail.com>
2267 * statement.cs, typemanager.cs: Use expression for StringEmitter.
2269 * attribute.cs: Add sanity check.
2271 2009-02-27 Marek Safar <marek.safar@gmail.com>
2273 * class.cs: Add external constructor error.
2275 2009-02-26 Marek Safar <marek.safar@gmail.com>
2277 A fix for bug #475354
2278 * convert.cs, nullable.cs, expression.cs, statement.cs: Emit
2279 correctly user defined nullable equality operators.
2281 2009-02-25 Marek Safar <marek.safar@gmail.com>
2283 A fix for bug #479532
2284 * expression.cs: Implement NewInitialize::AddressOf.
2286 2009-02-25 Marek Safar <marek.safar@gmail.com>
2288 A fix for bug #413633
2289 * expression.cs: Iterate all base class-constraint types.
2291 2009-02-24 Marek Safar <marek.safar@gmail.com>
2293 A fix for bug #479209
2294 * literal.cs: Mutate null underlying type.
2296 2009-02-24 Marek Safar <marek.safar@gmail.com>
2298 A fix for bug #476295
2299 * convert.cs: Avoid wrapping implicitly convertible reference type.
2301 2009-02-23 Marek Safar <marek.safar@gmail.com>
2303 * iterators.cs: Create MemberName correctly.
2305 2009-02-23 Marek Safar <marek.safar@gmail.com>
2307 A fix for bug #478655
2308 * literal.cs: Check also underlying null type conversion.
2310 2009-02-21 Marek Safar <marek.safar@gmail.com>
2312 * generic.cs, ecore.cs, class.cs: Removed redundant AsAccessible.
2314 2009-02-20 Marek Safar <marek.safar@gmail.com>
2316 A fix for bug #477447
2317 * statement.cs: Add reference to correct parent storey when this
2318 is accessible from deep children storey (more than 1 level).
2320 2009-02-19 Marek Safar <marek.safar@gmail.com>
2322 A fix for bug #475860 by David Mitchell <dmitchell@logos.com>
2323 * class.cs: Define base type members before setting up member cache.
2325 2009-02-18 Marek Safar <marek.safar@gmail.com>
2327 A fix for bug #477378
2328 * nullable.cs, expression.cs, statement.cs: More precise null type
2331 2009-02-18 Marek Safar <marek.safar@gmail.com>
2333 A fix for bug #472805
2334 * typemanager.cs, namespace.cs: Import only visible extension method
2337 2009-02-18 Marek Safar <marek.safar@gmail.com>
2339 A fix for bug #476895
2340 * attribute.cs: Use correct resolve context for attribute type.
2342 2009-02-18 Marek Safar <marek.safar@gmail.com>
2344 A fix for bug #476266
2345 * anonymous.cs: Mutate multi-dimensional arrays.
2347 2009-02-18 Marek Safar <marek.safar@gmail.com>
2349 A fix for bug #476400
2350 * statement.cs, expression.cs: Removed wrong Dispose optimization.
2352 2009-02-18 Marek Safar <marek.safar@gmail.com>
2354 A fix for bug #476811
2355 * generics.cs: Fixed null-literal check.
2357 2009-02-17 Marek Safar <marek.safar@gmail.com>
2359 * typemanager.cs, convert.cs, flowanalysis.cs, driver.cs,
2360 expression.cs, ecore.cs, rootcontext.cs, eval.cs, class.cs: More
2361 messing with static variables.
2363 2009-02-16 Marek Safar <marek.safar@gmail.com>
2365 A fix for bug #475965
2366 * generics.cs: Check generic parameter type after extracting from
2369 2009-02-16 Marek Safar <marek.safar@gmail.com>
2371 A fix for bug #475823
2372 * convert.cs, expression.cs, literal.cs, ecore.cs, cfold.cs: Add
2375 2009-02-14 Marek Safar <marek.safar@gmail.com>
2377 * modifiers.cs, decl.cs, ecore.cs, class.cs, flowanalysis.cs:
2378 Simplified event field definition using backing field and not
2379 field builder directly.
2381 * expression.cs (EmitLdArg): Optimize fast paths.
2383 2009-02-13 Marek Safar <marek.safar@gmail.com>
2385 A fix for bug #475327
2386 * expression.cs (ArrayCreation): Don't mutate values optimized away.
2388 2009-02-13 Marek Safar <marek.safar@gmail.com>
2390 A fix for bug #475342
2391 * cs-parser.jay: Using 'super' instead of 'base' to call base
2392 constructor crashes compiler.
2394 2009-02-13 Marek Safar <marek.safar@gmail.com>
2396 A fix for bug #475354
2397 * expression.cs (Constantify): Add nullable types.
2399 * const.cs (EmitDecimalConstant): Avoid explicit cast.
2401 2009-02-12 Marek Safar <marek.safar@gmail.com>
2403 A fix for bug #475246
2404 * expression.cs: More broken flowanalysis hacking needed.
2406 2009-02-12 Marek Safar <marek.safar@gmail.com>
2408 * attribute.cs: Compare only ref/out array modifiers.
2410 2009-02-11 Marek Safar <marek.safar@gmail.com>
2412 * statement.cs: Use member cache when looking for foreach members.
2414 2009-02-11 Marek Safar <marek.safar@gmail.com>
2416 * expression.cs: Don't expose internal initializer types.
2418 * statement.cs: Check also explicit conversions for goto case.
2420 2009-02-11 Marek Safar <marek.safar@gmail.com>
2422 * convert.cs, statement.cs: Removed usage of IsAssignableFrom.
2424 2009-02-10 Marek Safar <marek.safar@gmail.com>
2426 * *.cs: Replace null-type with NullLiteral where appropriate.
2428 2009-02-09 Marek Safar <marek.safar@gmail.com>
2430 * expression.cs: Initializer of reference argument use temporary
2431 variable to be verifiable.
2433 * parameter.cs: Share EmitLdArg.
2435 2009-02-09 Marek Safar <marek.safar@gmail.com>
2437 A fix for bug #473559
2438 * class.cs: Fixed: Not reporting error about nested class with the
2441 2009-02-06 Scott Peterson <lunchtimemama@gmail.com>
2443 Contributed under the MIT/X11 license.
2445 * generic.cs: Added VerifyVariantTypeParameters which performs new
2446 variance verification logic. The old logic, based on the spec, was
2447 wrong because the spec is full of LIES!
2449 * generic-mcs.cs: Stubbed out the VerifyVariantTypeParameters method.
2451 *typemanager.cs: Moved variance verification logic to GenericTypeExpr.
2454 * ecore.cs: Added calls to the new variance verification logic.
2457 * delegate.cs: Removed calls to the old variance verification logic.
2459 2009-02-06 Marek Safar <marek.safar@gmail.com>
2461 * delegate.cs: Use cached Invoke method directly.
2463 2009-02-06 Marek Safar <marek.safar@gmail.com>
2465 * expression.cs: Emit expression tree for hoisted variable access.
2467 2009-02-04 Marek Safar <marek.safar@gmail.com>
2469 * namespace.cs: Add better extension class check.
2471 2009-02-05 Scott Peterson <lunchtimemama@gmail.com>
2473 * generic.cs: Fixed typeo (TypeParameter.Variacne).
2475 2009-02-04 Scott Peterson <lunchtimemama@gmail.com>
2477 This patch adds initial generic variance support to the compiler.
2478 It is contributed under the MIT/X11 license.
2480 * typemanager.cs: Modified ImplementsInterface to check variance.
2481 Added VerifyVariantTypeParameters which checks the specified type to see
2482 if it uses a variant type parameter as a type argument (which is not
2483 allowed). Added IsVariantOf which determins if the first type is a
2484 variant of the second. NOTE: This only supports reference types at
2485 the moment to conform with the current level of VM support. When the
2486 VM supports value types, this will follow step.
2488 * generic.cs: Added the Variance enum. Added a Variance property to
2489 TypeParameter and added variance support to definition phase. Added a
2490 Variance property to TypeParameterName. Also check to make sure that
2491 no variant types appear in generic method parameters.
2493 * cs-tokenizer.cs: Modified parse_less_than to tokenize the variance
2494 keywords if the langversion supports it.
2496 * parameter.cs: Added Parameter.VerifyNoVariantTypeParameters to ensure
2497 that variant types are only used in legal positions. Also added
2498 ParametersCompiled.VerifyNoVariantTypeParameters to check all of its
2501 * decl.cs: Construct TypeParameter with the variance information.
2503 * convert.cs: Checks variance in ImplicitReferenceConversionExists
2504 and ImplicitConversionStandard.
2506 * rootcontext.cs: Added new "Future" language version.
2508 * class.cs: In TypeContainer.DoDefineMembers, ensure that contravariant
2509 type parameters are not used as type arguments in interface inheritance.
2510 In MemberBase.DoMemberDependentChecks, ensure that contravariant type
2511 parameters are not used as method return types. In MemberBase.
2512 ResolveMemberType, ensure that variant type parameters are not used
2513 as type arguments. Also call VerifyNoVariantTypeParameters on every
2514 set of parameters which are resolved.
2516 * delegate.cs: Modified Delegate.Define to ensure that variant
2517 parameters are not used as type arguments and that a contravariant
2518 parameter is not used as the return type. Also call
2519 VerifyNoVariantTypeParameters on the delegate parameters.
2521 * cs-parser.jay: Modified grammar to support "in" and "out" keywords
2522 to specify generic variance.
2524 * driver.cs: Added support for LanguageVersion.Future in the form of
2525 "-langversion:future".
2527 * generic-mcs.cs: Stubbed out new members in generic.cs.
2529 2009-02-03 Marek Safar <marek.safar@gmail.com>
2531 * class.cs, generic.cs: Emit type parameter constraints for nested
2534 2009-02-02 Marek Safar <marek.safar@gmail.com>
2536 A fix for bug #471213
2537 * class.cs: Avoid emitting backing field for abstract event fields.
2539 2009-02-01 Marek Safar <marek.safar@gmail.com>
2541 A fix for bug #359731
2542 * cs-tokenizer.cs, cs-parser.jay: Correctly parse nested query
2545 2009-01-30 Marek Safar <marek.safar@gmail.com>
2547 A fix for bug #470767
2548 * statement.cs: Introduced BlockScopeExpression, needed when
2549 expression tree conversion has to emit scope variables.
2551 2009-01-29 Marek Safar <marek.safar@gmail.com>
2553 * class.cs: Remove duplicate CallingConvention.
2555 2009-01-29 Marek Safar <marek.safar@gmail.com>
2557 *.cs: Rename Parameters to ParametersCompiled and ParametersImported
2558 when I finally found the right naming convention.
2560 2009-01-29 Marek Safar <marek.safar@gmail.com>
2562 * cs-tokenizer.cs: Put back different open parens optimization.
2564 2009-01-28 Marek Safar <marek.safar@gmail.com>
2566 A fix for bug #470227
2567 * cs-tokenizer.cs: Remove too agressive parser optimization.
2569 2009-01-28 Marek Safar <marek.safar@gmail.com>
2571 A fix for bug #324319
2572 * class.cs: Remove too early base type resolve.
2574 2009-01-27 Marek Safar <marek.safar@gmail.com>
2576 A fix for bug #324319
2577 * ecore.cs: Explicitly type null when assigning to type argument to
2578 make pass verifier check.
2580 2009-01-27 Marek Safar <marek.safar@gmail.com>
2582 * anonymous.cs: Fixed recent regression when initializing captured
2585 2009-01-26 Marek Safar <marek.safar@gmail.com>
2587 A fix for bug #469019
2588 * anonymous.cs: Use all parent type parameters when instantiating
2589 nested generic storey.
2591 2009-01-26 Marek Safar <marek.safar@gmail.com>
2593 * expression.cs: Check for null instance methodgroup expression.
2595 2009-01-26 Marek Safar <marek.safar@gmail.com>
2597 A fix for bug #469244
2598 * cs-tokenizer.cs, cs-parser.jay: Fixed parsing of nullable type
2599 instance inside a conditional expression.
2601 2009-01-23 Marek Safar <marek.safar@gmail.com>
2603 * typemanager.cs, generic.cs, parameter.cs, decl.cs, anonymous.cs,
2604 expression.cs, report.cs, ecore.cs, attribute.cs: Use common
2605 GetElementType and HasElementType. IsValueType clean up.
2607 2009-01-23 Marek Safar <marek.safar@gmail.com>
2609 * nullable.cs: Use common EmitCall.
2611 * expression.cs: Emit constraint. for virtual calls only.
2613 2009-01-23 Marek Safar <marek.safar@gmail.com>
2615 * typemanager.cs, generic.cs, eval.cs, convert.cs, const.cs,
2616 expression.cs, statement.cs, rootcontext.cs, ecore.cs, class.cs,
2617 driver.cs, attribute.cs, enum.cs: Split IsValueType and IsStruct
2620 2009-01-22 Jb Evain <jbevain@novell.com>
2622 * anonymous.cs: make anonymous types' ToString implementation
2623 match what csc outputs.
2625 2009-01-21 Marek Safar <marek.safar@gmail.com>
2627 * typemanager.cs, ecore.cs, iterator.cs: TypeLookupExpression clean
2630 2009-01-17 Marek Safar <marek.safar@gmail.com>
2632 * convert.cs, ecore.cs: Explicitly casts type arguments to pass
2635 2009-01-16 Marek Safar <marek.safar@gmail.com>
2637 * nullable.cs (LiftedBinaryOperator): Check for all possible null
2640 2009-01-15 Marek Safar <marek.safar@gmail.com>
2642 A fix for bug #466634
2643 * statement.cs: Add reference for nested storey when only this
2646 2009-01-15 Marek Safar <marek.safar@gmail.com>
2648 A fix for bug #466474
2649 * codegen.cs: Emit SecurityPermissionAttribute when -unsafe option
2652 2009-01-15 Marek Safar <marek.safar@gmail.com>
2654 * iterators.cs, anonymous.cs, expression.cs, statement.cs, ecore.cs:
2655 Fixed nested stories parent referencing process. Also fixes #463985.
2657 2009-01-06 Marek Safar <marek.safar@gmail.com>
2659 * decl.cs, iterators.cs, expression.cs, statement.cs, doc.cs,
2660 class.cs, cs-parser.jay, codegen.cs: Clean up destructor
2661 implementation. Also fixes #463108.
2663 2009-01-05 Marek Safar <marek.safar@gmail.com>
2665 A fix for bug #416109
2666 * decl.cs: Issue correct CLSAttribute warning location.
2668 2009-01-05 Marek Safar <marek.safar@gmail.com>
2670 A fix for bug #456775
2671 * attribute.cs: Use attribute owner scope when resolving attribute
2674 2009-01-05 Marek Safar <marek.safar@gmail.com>
2676 A fix for bug #457257
2677 * decl.cs: Fixed incorrect member declaring type comparison.
2679 2009-01-05 Marek Safar <marek.safar@gmail.com>
2681 A fix for bug #460896
2682 * driver.cs: Handle /RES resources as embeddable.
2684 2009-01-05 Marek Safar <marek.safar@gmail.com>
2686 A fix for bug #462515
2687 * ecore.cs: Report inacessible members upwards.
2689 2009-01-05 Marek Safar <marek.safar@gmail.com>
2691 A fix for bug #463190, #463192
2692 * decl.cs, namespace.cs: Also import internal extension classes.
2694 2009-01-04 Marek Safar <marek.safar@gmail.com>
2696 A fix for bug #463415
2697 * generic.cs: Use right index for RemoveDependentTypes.
2699 2009-01-02 Marek Safar <marek.safar@gmail.com>
2701 A fix for bug #463196
2702 * expression.cs: Fixed enum to null comparison.
2704 2009-01-02 Marek Safar <marek.safar@gmail.com>
2706 A fix for bug #463121
2707 * nullable.cs: Fixed nullable user equality operator comparison.
2709 2009-01-02 Marek Safar <marek.safar@gmail.com>
2711 A fix for bug #462950
2712 * class.cs, decl.cs: Use full explicit name when defining automatic
2713 property backing field.
2715 2009-01-02 Marek Safar <marek.safar@gmail.com>
2717 A fix for bug #462592
2718 * pending.cs: Emit type arguments for generic proxy method.
2720 2008-12-30 Marek Safar <marek.safar@gmail.com>
2722 * expression.cs (As): Mutate all type arguments.
2724 2008-12-29 Marek Safar <marek.safar@gmail.com>
2726 A fix for bug #462622
2727 * anonymous.cs: Resolve anonymous type GetHashCode in unchecked
2730 2008-12-29 Marek Safar <marek.safar@gmail.com>
2732 A fix for bug #450782
2733 * ecore.cs: Consider more variables of form V.I to be fixed.
2735 2008-12-29 Marek Safar <marek.safar@gmail.com>
2737 A fix for bug #460712
2738 * typemanager.cs: Core types could be imported.
2740 2008-12-28 Marek Safar <marek.safar@gmail.com>
2742 A fix for bugs #460847, #460772, #458049, #457339, #447807
2743 * generic.cs, parameter.cs, lambda.cs, linq.cs, anonymous.cs
2744 statement.cs, ecore.cs, class.cs, delegate.cs, flowanalysis.cs
2745 cs-parser.jay, driver.cs: LINQ implementation upgrade to deal with
2746 user lambdas used inside query clauses.
2748 2008-12-18 Marek Safar <marek.safar@gmail.com>
2750 A fix for bug #460229
2751 * cs-tokenizer.cs: Ignore wrongly placed BOM markers.
2753 2008-12-18 Marek Safar <marek.safar@gmail.com>
2755 A fix for bug #459952
2756 * decl.cs, namespace.cs: Use common CheckAccessLevel.
2758 2008-12-18 Marek Safar <marek.safar@gmail.com>
2760 A fix for bug #459630
2761 * convert.cs: Enum to valuetype conversion is not allowed.
2763 2008-12-18 Marek Safar <marek.safar@gmail.com>
2765 A fix for bug #457087
2766 * generic.cs: Don't crash when constraint comes from type
2769 2008-12-16 Marek Safar <marek.safar@gmail.com>
2771 A fix for bug #459221
2772 * anonymous.cs, statement.cs: Delay only captured this
2775 2008-12-12 Marek Safar <marek.safar@gmail.com>
2777 A fix for bug #457489
2778 * anonymous.cs, statement.cs: Split anonymous storey instantiation
2779 and initialization to capture scope initializers correctly.
2781 2008-12-11 Marek Safar <marek.safar@gmail.com>
2783 * generic.cs, parameter.cs, expression.cs, statement.cs, doc.cs:
2784 ParameterReference refactoring.
2786 2008-12-03 Marek Safar <marek.safar@gmail.com>
2788 * typemanager.cs, namespace.cs, driver.cs: Allow ExtensionAttribute
2789 to be imported from any assembly.
2791 2008-12-03 Marek Safar <marek.safar@gmail.com>
2793 * parameter.cs, lambda.cs, linq.cs, iterators.cs, anonymous.cs
2794 statement.cs, class.cs, cs-parser.jay: Removed duplicate parameters
2795 from anonymous method and lambda expression.
2797 2008-12-01 Marek Safar <marek.safar@gmail.com>
2799 A fix for bug #448560
2800 * expression.cs (As): Box any generic type arguments to be
2803 2008-11-29 Raja R Harinath <harinath@hurrynot.org>
2805 Add tripwire for implicit conversion bugs
2806 * ecore.cs (MethodGroupExpr.Error_ArgumentCountWrong): New helper
2808 (MethodGroupExpr.OverloadResolve): Add sanity check between
2809 IsApplicable and VerifyArgumentsCompat.
2810 (VerifyArgumentsCompat): Report CS1501 where appropriate.
2812 2008-11-29 Raja R Harinath <harinath@hurrynot.org>
2814 Fix build break in System.Data_test
2815 * convert.cs (ImplicitConversionExists): Move NullLiteral
2817 (ImplicitStandardConversionExists): ... here.
2819 2008-11-28 Marek Safar <marek.safar@gmail.com>
2821 * literal.cs: Emit correctly explicit null to nullable cast.
2823 2008-11-28 Marek Safar <marek.safar@gmail.com>
2825 * ecore.cs, generics.cs: Fixed crash when type arguments fail to
2828 2008-11-28 Marek Safar <marek.safar@gmail.com>
2830 A fix for bug #449005
2831 * convert.cs, nullable.cs: Use only one implicit nullable
2834 2008-11-27 Marek Safar <marek.safar@gmail.com>
2836 * convert.cs, literal.cs: More Convert cleanup is needed.
2838 2008-11-27 Marek Safar <marek.safar@gmail.com>
2840 * decl.cs, class.cs: Fixed misleading error message.
2842 2008-11-26 Marek Safar <marek.safar@gmail.com>
2844 A fix for bug #449005
2845 * nullable.cs (EmitEquality): Disable optimization for user operator
2848 2008-11-25 Marek Safar <marek.safar@gmail.com>
2850 A fix for bug #447027
2851 * anonymous.cs (HoistedVariable): Cache also outer access to deal
2852 with context variables stored as expression instances.
2854 2008-11-25 Marek Safar <marek.safar@gmail.com>
2856 A fix for bug #447027
2857 * delegate.cs: Fixed delegate VerifyMethod logic.
2859 2008-11-24 Marek Safar <marek.safar@gmail.com>
2861 * ecore.cs, delegate.cs: MethodGroup expressions can be applicable
2864 2008-11-21 Marek Safar <marek.safar@gmail.com>
2866 * typemanager.cs, decl.cs, anonymous.cs, class.cs, enum.cs: Rewrote
2867 member type resolve to follow normal flow, instead of random
2870 2008-11-21 Marek Safar <marek.safar@gmail.com>
2872 * iterators.cs (GetEnumeratorStatement): Re-use already resolved
2875 2008-11-21 Marek Safar <marek.safar@gmail.com>
2877 * const.cs: Emit decimal array constant as literal.
2879 2008-11-20 Marek Safar <marek.safar@gmail.com>
2881 * iterators.cs, ecore.cs: Removed CurrentBlock statement.
2883 2008-11-19 Marek Safar <marek.safar@gmail.com>
2885 * eval.cs, location.cs, driver.cs (Location.SourceFiles): Turned
2886 into real property (saves 8 MB for corlib compilation).
2888 2008-11-19 Marek Safar <marek.safar@gmail.com>
2890 * generic.cs, lambda.cs, linq.cs, iterators.cs, anonymous.cs,
2891 nullable.cs, expression.cs, statement.cs, ecore.cs, cs-parser.jay
2892 generic-mcs.cs: Small cleanup of TypeArguments.
2894 2008-11-18 Marek Safar <marek.safar@gmail.com>
2896 * generic.cs, iterators.cs, anonymous.cs, nullable.cs, ecore.cs,
2897 expression.cs, namespace.cs, generic-mcs.cs, class.cs: Small cleanup
2898 of ConstructedType expression, renamed to GenericTypeExpr.
2900 2008-11-17 Marek Safar <marek.safar@gmail.com>
2902 A fix for bug #445303
2903 * location.cs (IsConditionalDefined): Handle undefined global
2906 2008-11-17 Marek Safar <marek.safar@gmail.com>
2908 A fix for bug #444678
2909 * expression.cs (TryReduceConstant): Always create new constant
2912 2008-11-17 Marek Safar <marek.safar@gmail.com>
2914 A fix for bug #444673
2915 * ecore.cs: Ignore open generic types when used as generic type
2918 2008-11-17 Marek Safar <marek.safar@gmail.com>
2920 A fix for bug #445458
2921 * expression.cs, cs-parser.jay: Don't crash when an expression
2924 2008-11-17 Marek Safar <marek.safar@gmail.com>
2926 A fix for bug #445464
2927 * expression.cs, cs-parser.jay: Fixed typeof of non-generic type
2928 inside unbound type.
2930 2008-11-14 Jb Evain <jbevain@novell.com>
2932 * driver.cs: ignore empty -nowarn argument such as
2933 the one in -nowarn:12,13,,.
2935 2008-11-13 Marek Safar <marek.safar@gmail.com>
2937 A fix for bug #444271
2938 * anonymous.cs: Rescan parent storeys when best candidate was
2941 2008-11-13 Marek Safar <marek.safar@gmail.com>
2943 * generic.cs, expression.cs, ecore.cs, cs-parser.jay: Removed
2944 useless UnboundTypeExpression.
2946 * attribute.cs: Do check obsolete attribute on generic types.
2948 2008-11-12 Marek Safar <marek.safar@gmail.com>
2950 A fix for bugs #425680, #400139
2951 * ecore.cs, expression.cs: Trying to do some almost_matched_members
2954 2008-11-11 Marek Safar <marek.safar@gmail.com>
2956 A fix for bug #435747
2957 * assign.cs, expression.cs: Cleanup New assignment to emit correcly
2958 compound value types assignment. Few micro optimizations added.
2960 2008-11-10 Marek Safar <marek.safar@gmail.com>
2962 A fix for bug #442610
2963 * anonymous.cs (MutateConstructor): More SRE hacking.
2965 2008-11-10 Marek Safar <marek.safar@gmail.com>
2967 A fix for bug #442579
2968 * ecore.cs: Also initialize expanded form of a method with 1 params
2971 2008-11-06 Marek Safar <marek.safar@gmail.com>
2973 * expression.cs (UnaryMutator): Do early l-side check.
2975 2008-11-05 Miguel de Icaza <miguel@novell.com>
2977 * codegen.cs (InitDynamic): also setup Assembly.Name like we do in
2978 Init, otherwise we would crash later on when checking for friend
2981 * eval.cs: Do not hide errors from invalid calls to LoadAssembly.
2982 Otherwise we never get any meaningful information as to what
2985 2008-11-05 Marek Safar <marek.safar@gmail.com>
2987 A fix for bug #436318
2988 * driver.cs, report.cs: Add -warnaserror:Wn to command line options.
2990 2008-11-05 Miguel de Icaza <miguel@novell.com>
2992 * namespace.cs: Turns out that it was a really bad idea to hide
2993 the errors for namespaces not found here in eval mode.
2995 * eval.cs: When we process using clauses, only enter those into
2996 the list of valid using clauses after they have been validated.
2998 The above change gives the proper semantics: it does not
2999 senselessly report the same errors with broken using statements by
3000 never storing them in the first place when they are invalid.
3002 2008-11-05 Marek Safar <marek.safar@gmail.com>
3004 A fix for bug #421839
3005 * cs-parser.jay: Remove expression from coalesce rule to force lower
3006 priority than the assignment operator.
3008 2008-11-05 Marek Safar <marek.safar@gmail.com>
3010 A fix for bug #437875
3011 * nullable.cs: Compile correctly method group operand used with null
3012 coalescing operator.
3014 2008-11-04 Marek Safar <marek.safar@gmail.com>
3016 A fix for bug #434589
3017 * expression.cs (Binary): Ignore lifted conversions when at least
3018 one operand is of reference type.
3020 2008-11-04 Marek Safar <marek.safar@gmail.com>
3022 * cs-parser.jay: Better syntax error report.
3024 2008-11-03 Marek Safar <marek.safar@gmail.com>
3026 A fix for bug #436792
3027 * cs-parser.jay: Use GetLocation to access location.
3029 2008-11-03 Marek Safar <marek.safar@gmail.com>
3031 A fix for bug #440774
3032 * cs-parser.jay: Also set current_array_type when parsing local
3035 2008-11-03 Marek Safar <marek.safar@gmail.com>
3037 A fix for bug #440785
3038 * expression.cs (As): Don't resolve self modifing expression
3041 2008-11-03 Marek Safar <marek.safar@gmail.com>
3043 A fix for bug #439447
3044 * cs-tokenizer.cs: Tokenize surrogates only where allowed.
3046 2008-11-03 Marek Safar <marek.safar@gmail.com>
3048 A fix for bug #437571
3049 * cs-parser.jay: Fixes internal error for invalid expression
3052 2008-10-17 Marek Safar <marek.safar@gmail.com>
3054 * ecore.cs: Resolve correctly ambiguous params delegate methods.
3056 2008-10-17 Marek Safar <marek.safar@gmail.com>
3058 * generic.cs, anonymous.cs: Simplified GetDeclarations.
3060 2008-10-17 Marek Safar <marek.safar@gmail.com>
3062 * cs-tokenizer.cs: More precise cast parsing.
3064 2008-10-16 Martin Baulig <martin@ximian.com>
3066 * anonymous.cs (AnonymousMethodStorey): Put back the
3067 `hoisted_locals' hashtable and use it in EmitType().
3069 2008-10-15 Marek Safar <marek.safar@gmail.com>
3071 * cs-tokenizer.cs, nullable.cs, expression.cs, statement.cs,
3072 cs-parser.jay: Tokenizer optimizations and memory reduction, saves
3075 2008-10-14 Marek Safar <marek.safar@gmail.com>
3077 * cs-tokenizer.cs: Add bool type to the list of valid cast tokens.
3079 2008-10-14 Marek Safar <marek.safar@gmail.com>
3081 * statement.cs: Mutate scope initializers.
3083 2008-10-14 Marek Safar <marek.safar@gmail.com>
3085 * expression.cs: Use typeless value for This constant.
3087 * ecore.cs: Access FieldInfo via GetConstructedFieldInfo.
3089 2008-10-14 Marek Safar <marek.safar@gmail.com>
3091 * cs-tokenizer.cs, cs-parser.jay: Unify context sensite keyword
3094 2008-10-13 Marek Safar <marek.safar@gmail.com>
3096 * cs-tokenizer.cs: Add missing alias qualifier and dotted generic
3099 2008-10-13 Marek Safar <marek.safar@gmail.com>
3101 * cs-tokenizer.cs, expression.cs, cs-parser.jay: Reworked parens
3102 parser and tokenizer. Fixes many ambiguities including #433258.
3104 2008-10-10 Marek Safar <marek.safar@gmail.com>
3106 * cs-parser.jay: Fixed missing accessor recovery.
3108 2008-10-10 Marek Safar <marek.safar@gmail.com>
3110 A fix for bug #433701
3111 * expression.cs: Better error message.
3113 2008-10-10 Marek Safar <marek.safar@gmail.com>
3115 * cs-parser.jay, expression.cs: Start reporting real parser errors.
3117 * Makefile: Disabled unused debug symbols.
3119 Also fixes: #320556, #321097, #321656, #321876, #351316
3121 2008-10-09 Miguel de Icaza <miguel@novell.com>
3123 * eval.cs: rename "<interactive>" to "{interactive}", to work
3124 around a requirement in the compiler that this be a valid
3125 filename, and in Windows it is not (433886).
3127 2008-10-09 Marek Safar <marek.safar@gmail.com>
3129 * cs-tokenizer.cs, cs-parser.jay: Fixed more subtle parser problems
3131 2008-10-08 Marek Safar <marek.safar@gmail.com>
3133 * cs-tokenizer.cs, eval.cs, anonymous.cs, statement.cs, class.cs
3134 cs-parser.jay: Generic type declaration and type arguments cleanup.
3136 2008-10-05 Marek Safar <marek.safar@gmail.com>
3138 * cs-parser.jay: Allow parsing weird array creation construct.
3140 2008-10-05 Marek Safar <marek.safar@gmail.com>
3142 * cs-parser.jay: Conflicts reduction.
3144 2008-10-04 Marek Safar <marek.safar@gmail.com>
3146 * cs-parser.jay: Conflicts reduction.
3148 2008-10-04 Raja R Harinath <harinath@hurrynot.org>
3151 * flowanalysis.cs (MyBitvector.MakeShared): Rename from 'Shared'
3152 property. Add a 'count' hint about the use of the shared vector.
3153 Ensure that we don't leak out dirty bits.
3154 (UsageVector.MergeChild): Throw away information about variables
3156 Based on patch and analysis by Moritz Kroll <Moritz.Kroll@gmx.de>.
3158 2008-10-03 Marek Safar <marek.safar@gmail.com>
3160 A fix for bug #431746
3161 * iterators.cs, anonymous.cs: Re-initialize hoisted iterator
3162 parameters when iterator is created.
3164 2008-10-03 Marek Safar <marek.safar@gmail.com>
3166 A fix for bug #431827
3167 * expression.cs: Fixed right based pointer arithmetic operations
3170 2008-10-03 Marek Safar <marek.safar@gmail.com>
3172 A fix for bug #353779
3173 * assign.cs, expression.cs: Fixed compound assignment conversions.
3175 2008-10-02 Marek Safar <marek.safar@gmail.com>
3177 A fix for bug #375262
3178 * statement.cs: Refactor ArrayForeach to be usable with string
3179 indexer. Optimized single dimentional arrays foreach.
3181 2008-10-02 Marek Safar <marek.safar@gmail.com>
3183 A fix for bug #431255
3184 * anonymous.cs, expression.cs: Removed broken optimization.
3186 2008-10-01 Marek Safar <marek.safar@gmail.com>
3188 * anonymous.cs: Use full type parameters of parent generic
3189 containers. Removed unnecessary AddParentStoreyReference call.
3191 2008-10-01 Marek Safar <marek.safar@gmail.com>
3193 A fix for bug #324702
3194 * class.cs: Use better shorter names for explicit interface member
3197 * ecore.cs, typemanager.cs: Convert only mscorlib predefined names.
3199 2008-10-01 Marek Safar <marek.safar@gmail.com>
3201 * expression.cs: Use new interface to check fixed expression.
3203 2008-10-01 Marek Safar <marek.safar@gmail.com>
3205 A fix for bug #421101
3206 * expression.cs, statement.cs, ecore.cs: Use IFixedExpression
3207 interface to check for fixed fixed-buffers.
3209 2008-10-01 Marek Safar <marek.safar@gmail.com>
3211 A fix for bug #429264
3212 * assign.cs, anonymous.cs, ecore.cs: More type mutators added.
3214 * delegate.cs: Removed unnecessary casts.
3216 2008-09-30 Marek Safar <marek.safar@gmail.com>
3218 A fix for bug #352151
3219 * decl.cs, iterators.cs, anonymous.cs, report.cs, namespace.cs,
3220 class.cs: Fixed already defined explicit interface members check.
3222 2008-09-29 Rodrigo Kumpera <rkumpera@novell.com>
3224 cs-tokenizer.cs: Fix typo.
3226 2008-09-28 Miguel de Icaza <miguel@novell.com>
3228 * eval.cs (InteractiveBase): The quit command now just sets a
3229 flag, instead of calling Environment.Exit(), it is milder on
3232 CompiledMethod is now in Mono.CSharp, not nested inside
3233 the Evaluator, it was inconvenient to use.
3235 2008-09-27 Miguel de Icaza <miguel@novell.com>
3237 * eval.cs (Evaluator): Introduce Compile method, to allow compiled
3238 code to be invoked without having to reparse.
3240 2008-09-27 Miguel de Icaza <miguel@novell.com>
3242 * ecore.cs: The recent changes to FieldExpr broke this as well.
3243 Fixes LINQ queries in the interactive shell.
3245 * Multiple files: indentation fixing for the Mono coding
3246 guidelines for the switch statement.
3248 * eval.cs: Make the Evaluator API thread safe.
3250 2008-09-26 Marek Safar <marek.safar@gmail.com>
3252 * anonymous.cs, statement.cs, class.cs, cs-parser.jay: Simplified
3253 constructor parsing.
3255 2008-09-26 Marek Safar <marek.safar@gmail.com>
3257 A fix for bug #325326
3258 * statement.cs: Check possible mistaken empty statement using
3259 explicit blocks only.
3261 2008-09-25 Miguel de Icaza <miguel@novell.com>
3263 * eval.cs (LoadAssembly, ReferenceAssembly): Call
3264 RootNamespace.ComputeNamespaces to update the internal list of
3265 namespaces, this is no longer done for us.
3267 (InteractiveBase): Use the Evaluator APIs instead of calling into
3270 2008-09-25 Marek Safar <marek.safar@gmail.com>
3272 A fix for bug #429264
3273 * expression.cs: Missing mutator for access to multidimensional
3276 2008-09-25 Marek Safar <marek.safar@gmail.com>
3278 * class.cs, statement: Emit DebuggerHidden attribute for iterator
3281 * driver.cs: Missing input argument check.
3283 2008-09-25 Marek Safar <marek.safar@gmail.com>
3285 * typemanager.cs, generic.cs, eval.cs, decl.cs, anonymous.cs,
3286 expression.cs, statement.cs, rootcontext.cs, class.cs,
3287 cs-parser.jay, driver.cs, generic-mcs.cs, enum.cs: Removed obsolete
3290 2008-09-24 Miguel de Icaza <miguel@novell.com>
3292 * ecore.cs (FieldExpr): Only initialize eclass when we return a
3293 fully constructed FieldExpr, fixes the regression introduced in
3296 * ecore.cs, expression.cs: Plug back the eclass initialization as
3297 otherwise it regresses `csharp'.
3299 2008-09-24 Marek Safar <marek.safar@gmail.com>
3301 * typemanager.cs, decl.cs, convert.cs, assign.cs, expression.cs,
3302 ecore.cs, attribute.cs: Moved obsolete method checks from emit
3303 phase to resolve phase. It resolves problems with expression trees
3304 and fixes bugs #323796, #325156.
3306 2008-09-23 Marek Safar <marek.safar@gmail.com>
3308 * codegen.cs: Report better error when symbol writer is missing.
3310 2008-09-23 Marek Safar <marek.safar@gmail.com>
3312 * codegen.cs: Set .NET symbol writer.
3314 * decl.cs: Guard against null generic arguments.
3316 * report.cs: Don't report exactly same additional details.
3318 2008-09-22 Marek Safar <marek.safar@gmail.com>
3320 A fix for bug #324917
3321 * cs-parser.jay: Add missing multidimensional non-expression type
3324 2008-09-22 Marek Safar <marek.safar@gmail.com>
3326 A fix for bug #428191
3327 * anonymous.cs: Create an outer generic fields also for non-storey
3330 2008-09-22 Marek Safar <marek.safar@gmail.com>
3332 A fix for bug #378294
3333 * class.cs: Make fixed size buffers gmcs feature only.
3335 2008-09-22 Marek Safar <marek.safar@gmail.com>
3337 A fix for bug #355622, #324993
3338 * assign.cs, const.cs, class.cs: Create new EmitContext for each
3341 2008-09-19 Marek Safar <marek.safar@gmail.com>
3343 * nullable.cs, expression.cs, namespace.cs, delegate.cs: Duplicate
3346 2008-09-19 Marek Safar <marek.safar@gmail.com>
3348 A fix for bug #416110
3349 * generic.cs: Struct constraint results in default ctor and
3350 ValueType base type constraint to be set.
3352 2008-09-19 Marek Safar <marek.safar@gmail.com>
3354 A fix for bug #423791
3355 * generic.cs: Fixed params output type type-inference.
3357 2008-09-19 Marek Safar <marek.safar@gmail.com>
3359 * cs-parser.jay, expression.cs: Fixed few expression crashes.
3361 2008-09-19 Marek Safar <marek.safar@gmail.com>
3363 * cs-tokenizer.cs: Don't break on extra partial modifier.
3365 2008-09-19 Marek Safar <marek.safar@gmail.com>
3367 A fix for bug #427592
3368 * generic.cs: Use common parameter resolve method.
3370 2008-09-18 Marek Safar <marek.safar@gmail.com>
3372 A fix for bug #414758
3373 * expression.cs, ecore.cs: Fixed crash when accessing non-static
3376 2008-09-18 Marek Safar <marek.safar@gmail.com>
3378 * driver.cs, namespace.cs: Read types and namespaces after all
3379 requested assemblies are loaded, fixes issues with System.Core
3380 auto-reference, and #419888.
3382 2008-09-18 Marek Safar <marek.safar@gmail.com>
3384 A fix for bug #417705
3385 * cs-parser.jay: Fixed as/is operator expression split.
3387 2008-09-18 Marek Safar <marek.safar@gmail.com>
3389 * const.cs, expression.cs, statement.cs, ecore.cs, cs-parser.jay:
3390 Fixed expression tree representation of empty new expression and
3391 new initializer expression.
3393 2008-09-18 Miguel de Icaza <miguel@novell.com>
3395 * eval.cs: Remove warning, keep reference to driver around.
3397 * Hide fields that do not need to be public.
3399 2008-09-17 Marek Safar <marek.safar@gmail.com>
3401 A fix for bug #426385
3402 * expression.cs (ImplicitlyTypedArrayCreation): Use full implicit
3403 conversion for array elements.
3405 2008-09-17 Marek Safar <marek.safar@gmail.com>
3407 * expression.cs, statement.cs, class.cs, cs-parser.jay: Fixed
3408 void parsing conflicts.
3410 2008-09-15 Marek Safar <marek.safar@gmail.com>
3412 A fix for bug #425601
3413 * driver.cs, typemanager.cs, namespace.cs: Automatically reference
3414 System.Core only when there is no custom ExtensionAttribute
3417 2008-09-15 Miguel de Icaza <miguel@novell.com>
3419 * namespace.cs: Do not report CS0246 (name
3421 2008-09-12 Marek Safar <marek.safar@gmail.com>
3423 A fix for bug #425669
3424 * generic.cs: Don't cache generic static anonymous method
3427 2008-09-12 Marek Safar <marek.safar@gmail.com>
3429 * generic.cs, class.cs, delegate.cs: Check recursive inherited
3430 conflicting constraints.
3432 2008-09-12 Raja R Harinath <harinath@hurrynot.org>
3434 * cs-tokenizer.cs (consume_identifier): Allow partial methods in
3437 2008-09-12 Marek Safar <marek.safar@gmail.com>
3439 * literal.cs, convert.cs, expression.cs, statement.cs: More null
3440 to null pointer conversion fixes.
3442 2008-09-11 Marek Safar <marek.safar@gmail.com>
3444 * cs-parser.jay, expression.cs: An implicitly typed local variable
3445 declarator cannot use an array initializer.
3447 2008-09-11 Marek Safar <marek.safar@gmail.com>
3449 * cs-parser.jay: Reduced number of printed tokens, add sorting.
3451 2008-09-11 Marek Safar <marek.safar@gmail.com>
3453 * generic.cs (InflatedConstraints): Don't crash when constraints
3456 * cs-parser.jay: const_declarator is a block.
3458 * constant.cs: Check for not allowed NaN conversions.
3460 2008-09-10 Miguel de Icaza <miguel@novell.com>
3462 * driver.cs: Drop --shell argument, the compiler is no longer a
3465 * eval.cs: Move most of the code that deals with evaluation into
3466 this file and document the public API from repl.cs
3468 * repl.cs: Remove from here.
3470 2008-09-10 Marek Safar <marek.safar@gmail.com>
3472 A fix for bug #424684
3473 * generic.cs: Generic class constraints must come first.
3475 2008-09-09 Miguel de Icaza <miguel@novell.com>
3477 * cs-parser.jay: Improve error reporting for syntax errors in
3478 statements and expressions, we now report the expected tokens
3479 instead of reporting the useless "; expected".
3481 Drop the strings from the token declaration, it turns out that
3482 they did not do what I thought they did. Instead they were adding
3483 two sets of tokens to the tables.
3485 2008-09-09 Marek Safar <marek.safar@gmail.com>
3487 * typemanager.cs, generic.cs, parameter.cs, expression.cs, class.cs,
3488 delegate.cs: Share special type check.
3490 2008-09-09 Marek Safar <marek.safar@gmail.com>
3492 A fix for bug #423981
3493 * expression.cs (EmitBranchable): Correctly emit inverted float conditions.
3495 2008-09-09 Marek Safar <marek.safar@gmail.com>
3497 * ecore.cs (ReducedConstantExpression): Implemented ConvertExplicitly and
3500 2008-09-09 Marek Safar <marek.safar@gmail.com>
3502 A fix for bugs: #324750, #335946
3503 * cs-tokenizer.cs, cs-parser.jay, expression.cs: Use a custom
3504 lookup rule to determine ?-based tokens.
3506 2008-09-08 Miguel de Icaza <miguel@novell.com>
3508 * repl.cs (OptionalAssign.EmitStatement): It is possible that some
3509 expressions (like event adding or removing) end up here, so we
3510 need to treat those as statements.
3512 Add LoadAssembly method.
3514 2008-09-04 Miguel de Icaza <miguel@novell.com>
3516 * repl.cs: Add Time method.
3518 2008-09-05 Marek Safar <marek.safar@gmail.com>
3520 * cs-tokenizer.cs: Fixed swaped UTF-16 surrogates parsing.
3522 2008-09-05 Miguel de Icaza <miguel@novell.com>
3524 * repl.cs: Add workaround for old compilers.
3526 2008-09-04 Jb Evain <jbevain@novell.com>
3528 * repl.cs (PrettyPrint): pretty print everything that
3529 implements IDictionary, as well as IEnumerables. Also,
3530 add a quit helper property.
3532 2008-09-04 Marek Safar <marek.safar@gmail.com>
3534 * constant.cs: Better error reporting for decimal literals.
3536 * class.cs, attribute.cs, typemanager.cs: Emit more fixed buffer
3539 2008-09-04 Marek Safar <marek.safar@gmail.com>
3540 Miguel de Icaza <miguel@novell.com>
3542 A fix for bug #422951
3543 * assign.cs (Assign.DoResolve): Perform the type conversions
3544 checks before we attempt to initialize `New' initializers.
3546 2008-09-04 Marek Safar <marek.safar@gmail.com>
3548 A fix for bug #422853
3549 * delegate.cs (DelegateCreation): Add special handling for
3550 EmptyExpression.Null instance expression which is just another
3551 hack for undecided member instance exression.
3553 2008-09-04 Marek Safar <marek.safar@gmail.com>
3555 * expression.cs, ecore.cs: Emit full expression tree for reduced
3558 2008-09-04 Marek Safar <marek.safar@gmail.com>
3560 * expression.cs (This): Guard against multi-resolving.
3562 * ecore.cs, statement.cs (Throw): Simplified.
3564 * flowanalysis.cs: Also verify event fields.
3566 2008-09-04 Miguel de Icaza <miguel@novell.com>
3568 * assign.cs (Assign.DoResolve): Perform the type conversions
3569 checks before we attempt to initialize `New' initializers.
3571 * repl.cs (PrettyPrint): Add Hashtable prettyprint
3573 * anonymous.cs (AnonymousTypeClass): On EvalMode make the class
3576 * repl.cs: Update help.
3578 2008-09-03 Miguel de Icaza <miguel@novell.com>
3580 * driver.cs (ProcessDefaultConfig): Now it encapsulates all the
3581 handling of the default config handling, including the special
3582 treatment of System.Core assembly.
3584 Fixes the REPL processing for LINQ.
3586 2008-09-03 Marek Safar <marek.safar@gmail.com>
3588 A fix for bug #422507
3589 * expression.cs (UnboxCast): Add missing child expression mutator.
3591 2008-09-03 Marek Safar <marek.safar@gmail.com>
3593 * driver.cs: Don't self reference System.Core assembly.
3595 2008-09-03 Marek Safar <marek.safar@gmail.com>
3597 A fix for bug #422507
3598 * expression.cs (StringConcat): Add missing type mutator.
3600 2008-09-03 Marek Safar <marek.safar@gmail.com>
3602 * generic.cs (TypeInferenceContext): Follow equality rule for
3603 constructed type lower bound type inference.
3605 2008-09-02 Miguel de Icaza <miguel@novell.com>
3607 * getline.cs (CmdRefresh): Apply patch from Douglas S. Blank
3608 <dblank@cs.brynmawr.edu> which updates the cursor position on
3611 2008-09-02 Marek Safar <marek.safar@gmail.com>
3613 A fix for bug #367145
3614 * driver.cs: Fixed import of extension methods when using -noconfig
3617 2008-09-02 Marek Safar <marek.safar@gmail.com>
3619 * iterator.cs: Don't emit GetEnumerator method twice but call a generic
3620 version from non-generic implementation instead.
3622 2008-09-01 Marek Safar <marek.safar@gmail.com>
3624 A fix for bug #418908
3625 * class.cs: Use AddScopeStatement for field initializers.
3627 2008-09-01 Marek Safar <marek.safar@gmail.com>
3629 A fix for bug #415385
3630 * ecore.cs, convert.cs: Do method group conversion for equal group types.
3632 2008-09-01 Marek Safar <marek.safar@gmail.com>
3634 A fix for bug #421736
3635 * iterators.cs: Don't crash on unreachable iterators.
3637 2008-09-01 Marek Safar <marek.safar@gmail.com>
3639 A fix for bug #421628
3640 * parameter.cs, attribute.cs: Clone also parameter attributes.
3642 2008-08-30 Miguel de Icaza <miguel@novell.com>
3644 * namespace.cs (LookupType): In EvalMode, try to replace
3645 the TypeBuilder from our cache with a Type as Reflection.Emit does
3646 not like to mix code from older assemblies emitted and new
3649 This sounds like a serious Mono bug that prevents multiple
3650 assemblies to be generated and consumed at the same time.
3652 * cs-parser.jay (push_current_class): Do not make interactive
3653 classes internal or private, make them public as we currently
3654 generate each new class in a new assembly.
3656 2008-08-29 Miguel de Icaza <miguel@novell.com>
3658 * decl.cs, roottypes.cs, class.cs:: Add an infrastructure to
3659 remove types that are entered into the global namespace during
3660 parsing so that we can remove them on failure.
3662 * cs-parser.jay: Parsing: we now keep track of types that are
3663 entered into global variables and queue those in case the parsing
3666 This happens in a few situations: during partial-input, we invoke
3667 the parser repeatedly for example with the string "class X", this
3668 would cause X to be registed, and we need to remove this
3669 registration so that another parse attempt later with say "class X {"
3670 would actually work.
3672 Additionally, if there is an error in the resolution phase, for
3673 example: "class X : NonExistant {}" th
3675 * cs-parser.jay: Be more precise with the errors being raised,
3676 instead of flagging all exceptions during parsing to be attributed
3677 to the parsing process, distinguish those from errors happening in
3678 the actions and hint that using -v would produce the actual
3681 * repl.cs: Do not load all compiler references on each reset,
3682 doing the partial reset takes care of this.
3684 2008-08-28 Miguel de Icaza <miguel@novell.com>
3686 * repl.cs: Add support for loading all the files from
3687 ~/.config/csharp/*cs as startup scripts and ~/.config/csharp/*.dll
3690 Introduce a micro-parser that is able to deambiguate on its input
3691 whether we are dealing with a compilation unit (namespace, class,
3692 interface, struct, delegate) declaration or a statement. This
3693 allows both declarations and statements to be entered.
3695 Set history size by default to 300 lines.
3697 Instead of distinguishing based on the parser.InteractiveResult,
3698 have only two cases: statements were parsed, or a compilation unit
3699 was. Always pull the Using statement additions from the
3700 compilation unit parse.
3702 * cs-tokenizer.cs: Rename tokens to better describe their intent
3703 (EvalStatementParserCharacter and EvalCompilationUnitParserCharacter).
3705 * rootcontext.cs: Split EvalMode into EvalMode and StatementMode.
3706 EvalMode is used to trigger the lookup of global variables while
3707 StatementMode is used turn variable declarations into static
3710 * getline.cs: Allow history size to be set.
3712 2008-08-29 Marek Safar <marek.safar@gmail.com>
3714 A fix for bug #360755
3715 * ecore.cs (SimpleName): Exclude indexers from simple name resolve.
3717 2008-08-29 Marek Safar <marek.safar@gmail.com>
3719 * generic.cs, iterators.cs, codegen.cs: Removed unused variable.
3721 * typemanager.cs, statement.cs, ecore.cs, enum.cs: Don't reconstruct enum
3722 member name, it is too confusing
3724 * decl.cs, class.cs: Don't report unused fields with attached attribute.
3726 * rootcontext.cs: Finally default to warning level 4.
3728 2008-08-28 Marek Safar <marek.safar@gmail.com>
3730 * class.cs (CheckBase): Ignore overloaded operators.
3732 2008-08-28 Marek Safar <marek.safar@gmail.com>
3734 A fix for bug #420830
3735 * expression.cs, cs-parser.jay: Put back InvocationOrCast expression.
3737 2008-08-28 Marek Safar <marek.safar@gmail.com>
3739 A fix for bug #420832
3740 * anonymous.cs, iterators.cs: Also clone hoisted this iterator variable.
3742 2008-08-28 Marek Safar <marek.safar@gmail.com>
3744 A fix for bug #420386
3745 * nullables.cs: Fixed logic of nullable user comparison operators involving
3748 2008-08-28 Marek Safar <marek.safar@gmail.com>
3750 * attribute (IsClsCompliant): Use FALSE value for pointer types.
3752 2008-08-27 Miguel de Icaza <miguel@novell.com>
3754 * repl.cs: Add support for aborting the running code with C-c.
3756 2008-08-27 Raja R Harinath <harinath@hurrynot.org>
3758 * cs-parser.jay (CS1002): Dump 'yyToken' with Report.ExtraInformation.
3760 2008-08-27 Miguel de Icaza <miguel@novell.com>
3762 * cs-parser.jay (interactive_statement_list): A new set of rules
3763 for hosting statements that uses the "interactive_" prefix.
3765 * repl.cs: Add support for parsing `using' as a statement or as a
3766 directive. Deambiguating before passing this to the parser.
3768 We need to distinguish statement_expressions that occur at the
3769 toplevel vs those that occur embedded into expressions.
3771 * getline.cs: Applied patch from Stuart Carnie <stuart.carnie@gmail.com>
3772 that fixes the cursor key handling, and a history bug.
3774 2008-08-26 Miguel de Icaza <miguel@novell.com>
3776 * Makefile: Drop BOOTSTRAP_COMPILER as that was masking the
3777 limitations in Console, instead the 2.0 bootstrap libraries now
3778 include the Console bits.
3780 Also, remove the use of Nullables from getline.cs
3784 Interactive support for the C# compiler. Use gmcs --shell to
3785 enter a read-eval-print loop shell.
3787 Docs: http://www.mono-project.com/CsharpRepl
3789 * sources: include repl.cs here and getline.cs for gmcs.exe,
3790 everything else is getline.cs impaired.
3792 * Makefile: when bootstrapping pass a special flag
3793 BOOTSTRAP_COMPILER which we use to prevent failures in compilation
3794 as we use NET_2_0 define to pull 2.0 APIs from System.Console.
3795 This distinguishes those two cases.
3797 * repl.cs: Support for a read-eval-print loop. Will be soon
3798 refactored into eval support and then REPL on top of it.
3800 * ecore.cs: If a simplename lookup fails, before erroring out,
3801 if we are in EvalMode to resolve the name to a declaration in the
3804 This means that variable declarations that happened in previous
3805 classes (as repl puts every statement in a separate class) are
3806 made visible in this way.
3808 * cs-parser.jay: UnexpectedEOF, a new flag that is set if we
3809 triggered an error due to the end of file being reached. This is
3810 used to do multi-line input, and notify the caller that the user
3811 needs to provide more text before a successful parse.
3813 Add new grammar rules after the INTERACTIVE_PARSER token is seen
3814 to drive the evaluation with a custom wrapper.
3816 * driver.cs: Add support for --shell, and refactor some code to be
3819 * namespace.cs: Add support for serializing the contents of the
3820 namespaces and reloading them.
3822 * getline.cs: A managed implementation of ReadLine under
3823 X11/Apache2 license terms. Easy to embed in other applications as
3826 * namespace.cs: Add some functions to save and restore the
3829 * rootcontext.cs: New public field.
3831 * cs-tokenizer.cs: Add support for one of the possible characters
3832 we introduce into the token stream.
3834 This patch does not affect the regular tokenization process, the
3835 only performance hit would happen if there is an invalid character
3836 on the input string.
3838 * support.cs: Move isatty helper routine here.
3840 * codegen.cs: Small cleanup, and add a mechanism to initialize the
3841 code generator for in-memory assemblies.
3843 2008-08-26 Marek Safar <marek.safar@gmail.com>
3845 * generic.cs, ecore.cs, delegate.cs, cs-parser.jay, expression.cs: A type
3846 parameter cannot be always used as a type.
3848 2008-08-21 Marek Safar <marek.safar@gmail.com>
3850 * convert.cs, expression.cs: Use single ExplicitReferenceConversion routine.
3852 2008-08-21 Marek Safar <marek.safar@gmail.com>
3854 * convert.cs: Implement explicit array to IList<T> conversion.
3856 2008-08-20 Marek Safar <marek.safar@gmail.com>
3858 A fix for bug #362740
3859 * cs-tokenizer.cs: Handle UTF-16 surrogates.
3861 2008-08-20 Marek Safar <marek.safar@gmail.com>
3863 * generic.cs, support.cs, typemanager.cs, lambda.cs, parameter.cs,
3864 pending.cs, ecore.cs, linq.cs, class.cs, decl.cs, delegate.cs,
3865 flowanalysis.cs, iterators.cs, cs-parser.jay, convert.cs, anonymous.cs,
3866 expression.cs, attribute.cs, statement.cs, doc.cs: Refactored parameters
3867 handling to use just one type of infrastructure and deal with generics
3870 2008-07-23 Martin Baulig <martin@ximian.com>
3872 *** Merged this from trunk revision 108527 ***
3875 (ExplicitBlock.EmitSymbolInfo): Moved to `ToplevelBlock'.
3876 (ToplevelBlock.EmitSymbolInfo): Tell the symbol writer about the
3879 2008-08-15 Marek Safar <marek.safar@gmail.com>
3881 * ecore.cs, linq.cs, const.cs, expression.cs, statement.cs: More robust
3884 2008-08-15 Marek Safar <marek.safar@gmail.com>
3886 * delegate.cs: Fixed compiler crash when creating delegate using partial
3889 * typemanager.cs: MulticastDelegate is not a delegate.
3891 2008-08-14 Marek Safar <marek.safar@gmail.com>
3893 * expression.cs, ecore.cs, anonymous.cs, class.cs: Fixed missing error
3896 2008-08-14 Raja R Harinath <harinath@hurrynot.org>
3898 * cs-parser.jay (type): Allow 'var' in mcs too.
3899 (local_variable_type): Likewise.
3901 2008-08-14 Marek Safar <marek.safar@gmail.com>
3903 * driver.cs: Removed broken -noconfig variants.
3905 2008-08-14 Marek Safar <marek.safar@gmail.com>
3907 A fix for bug #417078
3908 * expression.cs: Emit correctly left side pointer operators.
3910 2008-08-13 Marek Safar <marek.safar@gmail.com>
3912 * generic.cs, lambda.cs: Inflate method generic arguments only.
3914 2008-08-12 Marek Safar <marek.safar@gmail.com>
3916 * class.cs: Fixed struct layout check regression.
3918 2008-08-12 Marek Safar <marek.safar@gmail.com>
3920 * cs-parser.jay, enum.cs: Simplified enum parsing.
3922 * decl.cs: Check all type parameters conflicts.
3924 * expression.cs, statement.cs, attribute.cs: More expression checks.
3926 2008-08-11 Marek Safar <marek.safar@gmail.com>
3928 * generic.cs: Add type inference types restriction.
3930 * parameter.cs, class.cs, delegate.cs, iterators.cs, cs-parser.jay,
3931 anonymous.cs, expression.cs: Allocate less accessor parameters.
3933 2008-08-08 Marek Safar <marek.safar@gmail.com>
3935 * typemanager.cs, ecore.cs: Ambiguous operators can come from different
3938 2008-08-08 Marek Safar <marek.safar@gmail.com>
3940 * convert.cs, delegate.cs: Fixed delegate compatibility conversion.
3942 2008-08-07 Marek Safar <marek.safar@gmail.com>
3944 * class.cs, decl.cs, iterator.cs, ecore.cs: Refactor base type resolving.
3945 Also fixes #362146 and #381592.
3947 2008-08-07 Marek Safar <marek.safar@gmail.com>
3949 * ecore.cs: Reduced constant cannot be used as an attribute value.
3951 * cs-parser.jay: Base expression has to be a type.
3953 * expression.cs (Conditional): Uses ReducedExpression.
3955 2008-08-06 Marek Safar <marek.safar@gmail.com>
3957 A fix for bug #376826
3958 * parameter.cs, ecore.cs, anonymous.cs, expression.cs, statement.cs: An
3959 address of hoisted local variable or parameter cannot be taken.
3961 2008-08-05 Marek Safar <marek.safar@gmail.com>
3963 * ecore.cs, constant.cs, expression.cs, statement.cs: Resolve correctly
3964 anonymous method inside checked/unchecked expression.
3966 2008-08-05 Marek Safar <marek.safar@gmail.com>
3968 * typemanager.cs (IsEqual): Guard against null.
3970 * ecore.cs, class.cs, convert.cs, const.cs, constant.cs, expression.cs,
3971 attribute.cs, enum.cs, statement.cs: Pass EmitContext to constant conversion
3972 routine. Fixed few misleading conversion errors.
3974 2008-08-04 Marek Safar <marek.safar@gmail.com>
3976 * class.cs: Consider generics when checking cycles in struct layout.
3978 2008-08-04 Raja R Harinath <harinath@hurrynot.org>
3980 * cs-tokenizer.cs (get_cmd_arg): Simplify. Don't be too pedantic.
3982 2008-08-04 Marek Safar <marek.safar@gmail.com>
3984 A fix for bug #414165
3985 * anonymous.cs: Use same anonymous implementation method for all anonymous
3988 2008-08-04 Marek Safar <marek.safar@gmail.com>
3990 * generic.cs, anonymous.cs, statement.cs: Emit inherited anonymous method
3993 2008-08-04 Marek Safar <marek.safar@gmail.com>
3995 * cs-parser.jay: Typeof argument has to be a type expression.
3997 * namespace.cs: Check alias and namespace definitions collisions.
3999 * class.cs, pending.cs: Moved explicit interface accessor implementation
4002 * delegate.cs, expression.cs: Verify special name invocations.
4004 2008-08-01 Marek Safar <marek.safar@gmail.com>
4006 * cs-parser.jay: Don't choke on empty generic type arguments.
4008 * cs-tokenizer.cs: Handle escaped preprocessor directives.
4010 * expression.cs, ecore.cs: Minor expressions bugs.
4012 2008-08-01 Marek Safar <marek.safar@gmail.com>
4014 * cs-parser.jay: Removed duplicate interface declaration (fixes 2 conflicts)
4015 and added more error handling.
4017 * class.cs, iterators.cs, anonymous.cs: Removed useless interface parameter.
4019 * modifiers.cs, enum.cs: Fixed.
4021 2008-07-31 Jb Evain <jbevain@novell.com>
4023 * driver.cs: remove -pkg ability of smcs.
4025 2008-07-30 Marek Safar <marek.safar@gmail.com>
4027 * statement.cs (Switch): Correctly set empty default target for single
4030 2008-07-30 Marek Safar <marek.safar@gmail.com>
4032 * typemanager.cs, assign.cs, driver.cs, expression.cs, statement.cs: Rewrote
4033 string switch statement implementation to use string dictionary which
4034 significantly (2-8x) improves performance of generated code.
4036 2008-07-29 Marek Safar <marek.safar@gmail.com>
4038 A fix for bug #412880 by Atsushi Enomoto <atsushi@ximian.com>
4039 * modifiers.cs (GetDescription): Fixed FamANDAssem case.
4041 2008-07-29 Marek Safar <marek.safar@gmail.com>
4043 A fix for bug #412595
4044 * typemanager.cs, convert.cs, expression.cs: Some types are never
4045 convertible to each other.
4047 2008-07-29 Marek Safar <marek.safar@gmail.com>
4049 * nullable.cs (CreateNullConstant): An error messages update.
4051 2008-07-29 Marek Safar <marek.safar@gmail.com>
4053 A fix for bug #412595
4054 * cfold.cs: Don't cast undefined bool constant.
4056 2008-07-29 Martin Baulig <martin@ximian.com>
4059 (SymbolWriter.Reset): New public static method.
4062 (CompilerCallableEntryPoint.Reset): Call SymbolWriter.Reset().
4064 2008-07-28 Marek Safar <marek.safar@gmail.com>
4066 * cs-tokenizer.cs (IsLambdaOpenParens): Optimized using more stop tokens.
4068 * expression.cs (ElementAccess): Exact size allocation.
4070 2008-07-26 Marek Safar <marek.safar@gmail.com>
4072 * driver.cs: Replaced outdated UnixParseOption with CSCParseOption.
4074 2008-07-25 Marek Safar <marek.safar@gmail.com>
4076 * flowanalysis.cs (StructInfo): Fixed detection of dynamic types.
4078 * class.cs: Removed $PRIVATE$ field hack which caused problems during
4081 2008-07-25 Marek Safar <marek.safar@gmail.com>
4083 A fix for bug #412217
4084 * assign.cs: Mutate also assignment type.
4086 2008-07-25 Marek Safar <marek.safar@gmail.com>
4088 A fix for bug #323644
4089 * typemanager.cs (IsValidProperty): Verify DefaultMemberName when checking
4092 2008-07-25 Marek Safar <marek.safar@gmail.com>
4094 A fix for bug #412134
4095 * expression.cs (ResolveOperatorEnum): Do implicit conversion of
4096 non-enumerable operands when overloading equality or bitwise operators.
4098 2008-07-25 Marek Safar <marek.safar@gmail.com>
4100 * anonymous.cs: Cache closed generic anonymous method delegates.
4102 2008-07-24 Marek Safar <marek.safar@gmail.com>
4104 * lambda.cs, linq.cs, class.cs, iterators.cs, cs-parser.jay, assign.cs,
4105 anonymous.cs, statement.cs: Always emit anonymous method as static method
4106 when is instance free. Use nesting for nested anynomous methods blocks.
4108 2008-07-23 Marek Safar <marek.safar@gmail.com>
4110 * anonymous.cs (MutateGenericMethod): Added extra code path for imported
4113 2008-07-23 Marek Safar <marek.safar@gmail.com>
4115 * expression.cs: Removed MakeSimpleCall.
4117 2008-07-23 Marek Safar <marek.safar@gmail.com>
4119 A fix for bug #323012
4120 * class.cs, pending.cs: Emit proxy for indexers when they differ in name.
4121 Base method implementing interface has to be public.
4123 2008-07-23 Marek Safar <marek.safar@gmail.com>
4125 * cs-parser.jay: Don't break on missing argument.
4127 2008-07-22 Marek Safar <marek.safar@gmail.com>
4129 A fix for bug #320993
4130 * report.cs, parameter.cs, class.cs, decl.cs, delegate.cs, attribute.cs,
4131 enum.cs, codegen.cs: Report CLS compliance errors as warnings.
4133 2008-07-22 Marek Safar <marek.safar@gmail.com>
4135 A fix for bug #320748
4136 * convert.cs: Implicit user operators cannot convert to interfaces
4138 2008-07-22 Marek Safar <marek.safar@gmail.com>
4140 A fix for bug #312686
4141 * driver.cs: Ignore empty assembly references.
4143 2008-07-22 Marek Safar <marek.safar@gmail.com>
4145 A fix for bug #387040
4146 * ecore.cs: Skip constrains check for an explicit implementation.
4148 2008-07-21 Marek Safar <marek.safar@gmail.com>
4150 A fix for bug #409045
4151 * cs-tokenizer.cs, rootcontext.cs, class.cs, location.cs, delegate.cs,
4152 cs-parser.jay, driver.cs, expression.cs, attribute.cs: Conditional
4153 identifiers are file specific unless passed as input arguments.
4155 2008-07-21 Marek Safar <marek.safar@gmail.com>
4157 * typemanager.cs, parameter.cs, class.cs, attribute.cs: Use an attribute
4158 to emit UnmanagedMarshal data under 2.0 profile.
4160 2008-07-21 Marek Safar <marek.safar@gmail.com>
4162 A fix for bug #410369
4163 * parameter.cs: Clone correctly ParamsParameter.
4165 2008-07-21 Marek Safar <marek.safar@gmail.com>
4167 * expression.cs (Argument): Always report type for type based expressions
4170 2008-07-18 Marek Safar <marek.safar@gmail.com>
4172 A fix for bug #410666
4173 * anonymous.cs: Correctly initialize generic storey reference.
4175 2008-07-18 Marek Safar <marek.safar@gmail.com>
4177 * convert.cs: Don't box same type arguments.
4179 2008-07-18 Marek Safar <marek.safar@gmail.com>
4181 * ecore.cs, linq.cs, delegate.cs, constant.cs, nullable.cs, expression.cs:
4182 Finished missing generic type mutators.
4184 2008-07-18 Marek Safar <marek.safar@gmail.com>
4186 * iterators.cs, statement.cs: Finished statements CloneTo.
4188 2008-07-18 Marek Safar <marek.safar@gmail.com>
4190 * anonymous.cs: ExpressionTreeProxy is of Value type expression.
4192 * expression.cs: Emit optimized default value expressions in expression tree
4195 2008-07-18 Marek Safar <marek.safar@gmail.com>
4197 * ecore.cs, cs-parser.jay, statement.cs: Error reporting fixes.
4199 2008-07-17 Marek Safar <marek.safar@gmail.com>
4201 A fix for bug #367536
4202 * cs-parser.jay: Check static constructor of generic types for an access
4205 2008-07-17 Marek Safar <marek.safar@gmail.com>
4207 A fix for bug #353800
4208 * lambda.cs: Emit ret for contextual statements.
4210 * codegen.cs: Keep both resolved and unreachable flags, otherwise we end
4211 up emitting redundant ret for all anonymous methods with return.
4213 2008-07-17 Marek Safar <marek.safar@gmail.com>
4215 A fix for bug #365188
4216 * ecore.cs, anonymous.cs, expression.cs, codegen.cs, statement.cs: Don't
4217 create anonymous method storey in unreachable block.
4219 2008-07-17 Marek Safar <marek.safar@gmail.com>
4221 * generic.cs, typemanager.cs, cs-tokenizer.cs, parameter.cs, namespace.cs,
4222 class.cs, delegate.cs, flowanalysis.cs, iterators.cs, anonymous.cs,
4223 driver.cs, nullable.cs, expression.cs, attribute.cs, codegen.cs,
4224 statement.cs: Fixed relevant defects found by Gendarme.
4226 2008-07-17 Marek Safar <marek.safar@gmail.com>
4228 A fix for bug #325291
4229 * modifiers.cs, class.cs, cs-parser.jay, anonymous.cs, codegen.cs,
4230 statement.cs: Replaced IAnonymousHost with top level block flag.
4232 2008-07-17 Marek Safar <marek.safar@gmail.com>
4234 * cs-parser.jay: Clean up unused open_parens.
4236 2008-07-17 Marek Safar <marek.safar@gmail.com>
4238 * ecore.cs: Custom error message for a range variable assignment.
4240 2008-07-16 Marek Safar <marek.safar@gmail.com>
4242 * constant.cs, typemanager.cs: Emit empty string ("") as string.Empty field
4245 2008-07-16 Marek Safar <marek.safar@gmail.com>
4247 * literal.cs: Null literal is of object type.
4249 2008-07-16 Marek Safar <marek.safar@gmail.com>
4251 * nullable.cs (LiftedBinaryOperator): Always lift unwrapped nullable
4252 expression of nullable equality comparison.
4254 2008-07-15 Marek Safar <marek.safar@gmail.com>
4256 * expression.cs(PointerArithmetic): Removed redundant assignment.
4258 2008-07-15 Marek Safar <marek.safar@gmail.com>
4260 * decl.cs (GetSignatureForError): Report full namespace name for containers.
4262 2008-07-14 Marek Safar <marek.safar@gmail.com>
4264 A fix for bug #408361
4265 * anonymous.cs (MutateGenericMethod): Store generic type arguments before
4266 they are replaced by GetMethod.
4268 2008-07-14 Marek Safar <marek.safar@gmail.com>
4270 A fix for bug #408721 by jeremie.laval@gmail.com
4271 * expression.cs (Indirection): Implemented CloneTo.
4273 2008-07-14 Marek Safar <marek.safar@gmail.com>
4275 * statement.cs (AssignableSlots): Temporary disabled variable initialization
4278 2008-07-14 Marek Safar <marek.safar@gmail.com>
4280 * report.cs (EnableReporting): Don't reinitialize 0-based values.
4282 2008-07-11 Marek Safar <marek.safar@gmail.com>
4284 * linq.cs: Reset tranparent parameter counter in probing mode.
4286 2008-07-11 Marek Safar <marek.safar@gmail.com>
4288 * anonymous.cs: Mutate anonymous method type.
4290 2008-07-11 Marek Safar <marek.safar@gmail.com>
4292 * ecore.cs, anonymous.cs: Mutate field expressions.
4294 2008-07-10 Marek Safar <marek.safar@gmail.com>
4296 A fix for bug #369670
4297 * linq.cs, statement.cs: Use explicit block for query expressions variables.
4299 2008-07-10 Marek Safar <marek.safar@gmail.com>
4301 * report.cs, ecore.cs: Flush recorder only when silent mode is off.
4303 2008-07-10 Raja R Harinath <harinath@hurrynot.org>
4306 * cs-tokenizer.cs (is_punct): If a generic lookahead is looking
4307 only one '>', and finds a '>>', abort the generic lookahead.
4309 2008-07-10 Marek Safar <marek.safar@gmail.com>
4311 A fix for bug #319902
4312 * cs-tokenizer.cs: Always look-ahed for `>=' when tokenizing `>'.
4314 2008-07-10 Marek Safar <marek.safar@gmail.com>
4316 A fix for bug #406371
4317 * statement.cs: Moved EmitSymbolInfo to Block.
4319 2008-07-09 Marek Safar <marek.safar@gmail.com>
4321 * ecore.cs: Report better error for extension method overload failures.
4323 2008-07-09 Marek Safar <marek.safar@gmail.com>
4325 * expression.cs (Is): No need to box reference values.
4327 2008-07-09 Marek Safar <marek.safar@gmail.com>
4329 * class.cs: Use event resolve context when initializing CreateEmitContext.
4331 2008-07-09 Marek Safar <marek.safar@gmail.com>
4333 A fix for bug #394436
4334 * anonymous.cs, class.cs, expression.cs, lambda.cs: Emit correctly extension
4335 method used inside expression trees. Added more LINQ to expression tree
4338 2008-07-08 Marek Safar <marek.safar@gmail.com>
4340 A fix for bug #378189, #370577
4341 * lambda.cs, ecore.cs: Implemented 3.0 enhancement to better conversion
4344 2008-07-08 Marek Safar <marek.safar@gmail.com>
4346 * anonymous.cs, class.cs, decl.cs: Emit CompilerGenerated attribute
4349 2008-07-08 Marek Safar <marek.safar@gmail.com>
4351 A fix for bug #406702
4352 * anonymous.cs: Always park anonymous method in the nearest parent storey.
4354 2008-07-07 Marek Safar <marek.safar@gmail.com>
4356 A fix for bug #406648
4357 * cs-parser.jay: Report nullable use in mcs for some cases.
4359 2008-07-07 Marek Safar <marek.safar@gmail.com>
4361 * ecore.cs: Improved argument mismatch error messages.
4363 2008-07-07 Marek Safar <marek.safar@gmail.com>
4365 * anonymous.cs: Don't cache generic delegates when reference MVAR argument.
4367 2008-07-07 Marek Safar <marek.safar@gmail.com>
4369 * expression.cs (TypeOf): Mutate type argument.
4371 2008-07-04 Marek Safar <marek.safar@gmail.com>
4373 * class.cs: Report missing partial modifier for correct type.
4375 2008-07-04 Marek Safar <marek.safar@gmail.com>
4377 * ecore.cs, expression.cs (VariableReference): Variable property is
4380 2008-07-04 Marek Safar <marek.safar@gmail.com>
4382 * ecore.cs, convert.cs: Made OpcodeCast more memory efficient.
4384 2008-07-04 Marek Safar <marek.safar@gmail.com>
4386 * anonymous.cs, class.cs, lambda.cs, iterator.cs: Cache static anonymous
4389 2008-07-04 Marek Safar <marek.safar@gmail.com>
4391 * anonymous.cs, class.cs, expression.cs, iterator.cs, statement.cs: Reduce
4392 anonymous method storey to an instance method when only "this" is hoisted.
4394 2008-07-03 Marek Safar <marek.safar@gmail.com>
4396 A fix for bug #321615
4397 * expression.cs: Pointer comparisons use unsigned operator.
4399 2008-07-03 Marek Safar <marek.safar@gmail.com>
4401 * expression.cs: Fixed native pointer conversions. Also fixes #321615.
4403 2008-07-02 Marek Safar <marek.safar@gmail.com>
4405 A fix for bug #404905
4406 * class.cs: Always initialize local unsafe variables.
4408 2008-06-30 Marek Safar <marek.safar@gmail.com>
4410 A fix for bug #396987
4411 * expression.cs (NewInitialize): Clear local temporary variable for next run
4413 2008-06-27 Marek Safar <marek.safar@gmail.com>
4415 A fix for bug #401020
4416 * ecore.cs: Both types and modifiers have to match for ref and out arguments
4418 2008-06-27 Marek Safar <marek.safar@gmail.com>
4420 A fix for bug #398319
4421 * cs-parser.jay: Implemented undocumented base access expression inside
4424 2008-06-26 Marek Safar <marek.safar@gmail.com>
4426 A fix for bug #404227
4427 * cs-parser.jay: Parse namespace declaration using qualified identifier.
4429 2008-06-26 Marek Safar <marek.safar@gmail.com>
4431 A fix for bug #404227
4432 * convert.cs: Fixed explicit array to interface cast.
4434 2008-06-26 Marek Safar <marek.safar@gmail.com>
4436 A fix for bug #403894
4437 * delegate.cs: Mutate DelegateInvocation type.
4439 2008-06-26 Marek Safar <marek.safar@gmail.com>
4441 A fix for bug #379348
4442 * delegate.cs: Box a load of generic parameters.
4444 2008-06-26 Marek Safar <marek.safar@gmail.com>
4446 * expression.cs: Add an array creation arguments mutate.
4448 2008-06-26 Marek Safar <marek.safar@gmail.com>
4450 A fix for bug #386068
4451 * anonymous.cs, expression.cs: Emit correctly hoisted expression tree
4454 2008-06-25 Marek Safar <marek.safar@gmail.com>
4456 * ecore.cs, expression.cs: Fixed broken TypeCast clone, implemented few more
4459 2008-06-25 Marek Safar <marek.safar@gmail.com>
4461 A fix for bug #403518
4462 * delegate.cs: Type correctly anonymous method new invocation.
4464 2008-06-24 Marek Safar <marek.safar@gmail.com>
4466 A fix for bug #394826
4467 * anonymous.cs: Fully qualify members when resolving anonymous type internal
4470 2008-06-24 Marek Safar <marek.safar@gmail.com>
4472 A fix for bug #394826
4473 * anonymous.cs, iterators.cs: Construct generic storey only when is really
4476 2008-06-24 Marek Safar <marek.safar@gmail.com>
4478 * class.cs: Clone indexer parameters for localized capturing.
4480 2008-06-24 Marek Safar <marek.safar@gmail.com>
4482 A fix for bug #402379
4483 * expression.cs: Don't crash when an object initializer resolve fails.
4485 2008-06-24 Marek Safar <marek.safar@gmail.com>
4487 A fix for bug #402888
4488 * expression.cs: Mutate conditional expression.
4490 2008-06-24 Marek Safar <marek.safar@gmail.com>
4492 A fix for bug #401012
4493 * class.cs: Keep StructLayout in shared container.
4495 2008-06-24 Marek Safar <marek.safar@gmail.com>
4497 A fix for bug #400438
4498 * decl.cs, class.cs: Only properties can be automatically implemented.
4500 2008-06-24 Marek Safar <marek.safar@gmail.com>
4502 * statement.cs (ChangeToIterator): Copy also labels.
4504 2008-06-23 Marek Safar <marek.safar@gmail.com>
4506 * ecore.cs: Pass type argument details to parent extension method.
4508 2008-06-23 Marek Safar <marek.safar@gmail.com>
4510 A fix for bug #375966
4511 * delegate.cs: Fixed IsTypeCovariant generic type conversions.
4513 2008-06-23 Raja R Harinath <harinath@hurrynot.org>
4515 * Makefile (bootstrap-libs): Pass NO_DIR_CHECK to sub-make.
4517 2008-06-22 Marek Safar <marek.safar@gmail.com>
4519 A fix for bug #394347
4520 * anonymous.cs: Cache compatible delegates as compatibility check produces
4521 a new method every time.
4523 2008-06-20 Marek Safar <marek.safar@gmail.com>
4525 * anonymous.cs: Propagate storey reference for single references.
4527 2008-06-20 Marek Safar <marek.safar@gmail.com>
4529 A fix for bug #387615
4530 * assign.cs, expression.cs: Correctly clone compound assignment.
4532 2008-06-19 Marek Safar <marek.safar@gmail.com>
4534 A fix for bug #359611, #359604
4535 * anonymous.cs: Mutate all types of hoisted parameters.
4537 2008-06-19 Marek Safar <marek.safar@gmail.com>
4539 * typemanager.cs, lambda.cs, parameter.cs, ecore.cs, linq.cs, class.cs
4540 delegate.cs, iterators.cs, cs-parser.jay, assign.cs, anonymous.cs, driver.cs
4541 expression.cs, codegen.cs, statement.cs
4543 Fixes bugs: #318652, #323223, #234779, #325069, #325476, #332532, #334465,
4544 #345907, #349190, #353276, #355256, #359617, #378542, #384584, #396530
4546 ** Anonymous methods, lambda expressions rewrite **
4548 Anonymous expressions are now resolved when an explicit block is resolved
4549 and they don't require any registration procedure anymore. Further,
4550 anonymous methods are defined when explicit block is emitted which allows
4551 better control of whole process and opens possibilities for more
4552 optimizations as well as alternative to reverse whole process.
4554 A concept of `MutateHoistedGenericType' was introduced to keep the resolve
4555 process consistent and to correctly emit hoisted generic methods when they
4556 have at least 1 hoisted variable.
4558 2008-06-17 Martin Baulig <martin@ximian.com>
4560 * class.cs: Also emit the `[DebuggerHidden]' attribute on the main
4562 (AbstractPropertyEventMethod.IsDebuggerHidden): New protected
4563 virtual property; check it in Emit().
4564 (PropertyMethod.IsDebuggerHidden): Override, check whether we're
4566 (MethodOrOperator.ResolveMethods): Set `DEBUGGER_HIDDEN' if we're
4568 (Indexer.Define): Likewise.
4570 2008-06-17 Marek Safar <marek.safar@gmail.com>
4572 * convert.cs: Don't use IsInterface on type arguments.
4574 * delegate.cs: DelegateInvocation uses MethodInfo.
4576 * parameter.cs: Removed IsTypeParameter.
4578 * generic-mcs.cs: More missing stuff.
4580 2008-06-16 Martin Baulig <martin@ximian.com>
4583 (Modifiers.DEBUGGER_HIDDEN): New public const.
4586 (TypeManager.GetDebuggerHiddenAttribute): New public static method.
4589 (MethodOrOperator.Emit): Check `Modifiers.DEBUGGER_HIDDEN'.
4590 (AbstractPropertyEventMethod): Likewise.
4591 (Constructor.Emit): Likewise.
4592 (SourceMethod.SetCompilerGenerated): Removed.
4594 * iterator.cs: Set `Modifiers.DEBUGGER_HIDDEN' everywhere except
4598 (RootScopeInfo.DoDefineMembers): Set `Modifiers.DEBUGGER_HIDDEN'
4599 if we're an `IteratorHost'.
4600 (AnonymousMethodMethod..ctor): Don't set
4601 `Modifiers.COMPILER_GENERATED'; csc only sets this on the class,
4604 2008-06-16 Marek Safar <marek.safar@gmail.com>
4606 * statement.cs: Clean-up foreach statements.
4608 2008-06-12 Marek Safar <marek.safar@gmail.com>
4610 * class.cs: Stop using public method which should not exist
4611 (MethodBuilder.SetGenericMethodSignature).
4613 2008-06-11 Martin Baulig <martin@ximian.com>
4616 (Location.LookupFile): Add `CompilationUnit' argument; when given
4617 a relative file name, make it relative to the directory the .cs
4618 file is located in instead of using the current directory.
4620 2008-06-11 Martin Baulig <martin@ximian.com>
4623 (IMethodData.EmitExtraSymbolInfo): Added `SourceMethod' argument.
4624 (MethodOrOperator.EmitExtraSymbolInfo): Likewise.
4625 (SourceMethod.SetRealMethodName): Moved here from the symbol writer.
4626 (SourceMethod.SetCompilerGenerated): Likewise.
4628 2008-06-11 Marek Safar <marek.safar@gmail.com>
4630 * codegen.cs, driver: Only write symbol file when it's asked for.
4632 2008-06-11 Marek Safar <marek.safar@gmail.com>
4634 * codegen.cs: Don't use assembly writer error handling for symbol writer.
4636 2008-06-10 Martin Baulig <martin@ximian.com>
4638 * symbolwriter.cs: Reflect latest MarkSequencePoint() API changes.
4640 2008-06-09 Marek Safar <marek.safar@gmail.com>
4642 A fix for bug #316290
4643 * expression.cs: Include decimal operators in predefined table.
4645 * parameters.cs: More readonlyness.
4647 2008-06-09 Marek Safar <marek.safar@gmail.com>
4649 A fix for bug #397213
4650 * cs-parser.jay: One more missing current_local_parameters reset.
4652 2008-06-09 Marek Safar <marek.safar@gmail.com>
4654 A fix for bug #396633
4655 * class.cs: Host backing field in partial container.
4657 2008-06-09 Marek Safar <marek.safar@gmail.com>
4659 A fix for bug #397068
4660 * expression.cs: Check both operand types when predefined operator is used.
4662 2008-06-05 Martin Baulig <martin@ximian.com>
4664 Merged the `debugger-kahalo' branch.
4667 (MethodData.Emit): Call SymbolWriter.SetCompilerGenerated() if
4668 we're an iterator method.
4669 (SourceMethod): Reflect latest symbol writer changes;
4670 SymbolWriter.OpenMethod() now takes a `ICompileUnit' argument and
4671 now `start_row' and `end_row'.
4672 (Constructor.Emit): Fix the logic whether to emit symbol information.
4674 * iterator.cs: Call SymbolWriter.SetCompilerGenerated() on all the
4678 (CompilationUnit): New public class; derives from `SourceFile'.
4679 (SourceFileEntry.DefineSymbolInfo): New public method.
4680 (SourceFileEntry.SetChecksum): New public method.
4681 (Location): Encode hidden line numbers by using `column == 255';
4682 the .ctor now accepts `column == -1' to mark a hidden line number.
4683 (Location.Hidden): New public property.
4684 (Location.CheckPoint): Add `CompilationUnit'.
4685 (Location.SourceFiles): Change return type to `CompilationUnit[]'.
4686 (Location.Push): Add `CompilationUnit compile_unit' argument.
4687 (Location.CompilationUnit): New public property.
4690 (ToplevelBlock.Emit): Add `ec.Mark (EndLocation)'.
4692 * cs-parser.jay: `SourceFile' -> `CompilationUnit'.
4694 * driver.cs: `SourceFile' -> `CompilationUnit'.
4696 * cs-tokenizer.cs: `SourceFile' -> `CompilationUnit'.
4698 * namespace.cs: `SourceFile' -> `CompilationUnit'.
4700 * cs-tokenizer.cs: Add support for `#pragma checksum' and
4704 (SymbolWriter.MarkSequencePoint): Take a `Location' and use the
4705 new symbol writer API to also pass the file.
4707 2008-06-05 Marek Safar <marek.safar@gmail.com>
4709 * statement.cs: Emit catch variable assignment using variable expression.
4711 2008-06-05 Marek Safar <marek.safar@gmail.com>
4713 * ecore.cs, expression.cs, statement.cs: Make TemporaryVariable compatible
4714 with other variable types.
4716 2008-06-04 Marek Safar <marek.safar@gmail.com>
4718 * ecore.cs, expression.cs, statement.cs, typemanager.cs: Removed custom
4719 GetLength method emit, it breaks resolve rules.
4721 2008-06-02 Atsushi Enomoto <atsushi@ximian.com>
4722 Marek Safar <marek.safar@gmail.com>
4724 A fix for bug #395542
4725 * cs-parser.jay: The trailing comma is allowed in anonymous type member
4728 2008-06-02 Marek Safar <marek.safar@gmail.com>
4730 A fix for bug #395287
4731 * class.cs, modifiers.cs: Automatic properties method base modifiers checks.
4733 2008-05-31 Marek Safar <marek.safar@gmail.com>
4735 A fix for bug #395845
4736 * class.cs, nullable.cs: User unary operator is allowed to have nullable and
4737 non-nullable parameter type.
4739 2008-05-31 Marek Safar <marek.safar@gmail.com>
4741 * class.cs: Handle contructor initializer as a statement in top-level block.
4743 2008-05-30 Marek Safar <marek.safar@gmail.com>
4745 * attribute.cs: Don't mix old and new corlib types when emitting corlib
4746 security attributes.
4748 2008-05-24 Marek Safar <marek.safar@gmail.com>
4750 * ecore.cs, expression.cs: Small IVariable refactoring.
4752 2008-05-22 Marek Safar <marek.safar@gmail.com>
4754 * assign.cs (LocalTemporary): Implemented CreateExpressionTree.
4756 2008-05-21 Marek Safar <marek.safar@gmail.com>
4758 * cs-parser.jay: Removed redundant catch type check.
4760 2008-05-21 Marek Safar <marek.safar@gmail.com>
4762 A fix for bug #390372
4763 * nullable.cs: Set correct return type.
4765 2008-05-21 Marek Safar <marek.safar@gmail.com>
4767 A fix for bug #391062
4768 * typemanager.cs: Fixed crash when comparing null types.
4770 2008-05-21 Marek Safar <marek.safar@gmail.com>
4772 A fix for bug #391871
4773 * cs-parser.jay: Better error handling for invalid catch type.
4775 2008-05-20 Marek Safar <marek.safar@gmail.com>
4777 A fix for bug #392155
4778 * cs-tokenizer.cs: Fixed casting of byte and decimal expression.
4780 2008-05-15 Marek Safar <marek.safar@gmail.com>
4782 A fix for bug #390666
4783 * ecore.cs (BetterExpressionConversion): Unwrap each Expression<T>
4786 2008-05-15 Marek Safar <marek.safar@gmail.com>
4788 * class.cs, expression.cs, statement.cs: Removed a hack, setting block flag
4791 2008-05-13 Marek Safar <marek.safar@gmail.com>
4793 A fix for bug #389625
4794 * delegate.cs, generic.cs: Some progress on method group return type
4797 2008-05-13 Marek Safar <marek.safar@gmail.com>
4799 A fix for bug #378419
4800 * namespace.cs: Inspect also parent namespaces not only namespace entries.
4802 2008-05-12 Marek Safar <marek.safar@gmail.com>
4804 * class.cs (Constructor): Added IsCompilerGenerated.
4806 2008-05-12 Marek Safar <marek.safar@gmail.com>
4808 * expression.cs: Enum binary operators can accept non-enum operand only when
4809 is implicitly convertible to underlying type.
4811 2008-05-12 Marek Safar <marek.safar@gmail.com>
4813 A fix for bug #389272
4814 * support.cs: Workaround System.InvalidOperationException for enums.
4816 2008-05-12 Marek Safar <marek.safar@gmail.com>
4818 A fix for bug #389073
4819 * convert.cs: More undocumented explicit IntPtr/UIntPtr conversions.
4821 2008-05-10 Marek Safar <marek.safar@gmail.com>
4823 * driver.cs: Split Parse.
4825 * location.cs (LookupFile): Uses string.Empty.
4827 2008-05-07 Marek Safar <marek.safar@gmail.com>
4829 * expression.cs, parameter.cs: Small ParameterReference clean up.
4831 2008-05-07 Marek Safar <marek.safar@gmail.com>
4833 * anonymous.cs, codegen.cs, convert.cs, ecore.cs: Removed uber ugly TempEc
4834 hack. Fixes #387502.
4836 2008-05-06 Martin Baulig <martin@ximian.com>
4838 * class.cs (Constructor.Emit): Fix the logic whether to emit
4841 2008-05-06 Raja R Harinath <harinath@hurrynot.org>
4844 * iterators.cs (Iterator.CurrentBlock.DoEmit): Don't emit
4845 InvalidOperationException when the iterator is before the start or
4848 2008-05-06 Marek Safar <marek.safar@gmail.com>
4850 * nullable.cs (NullCoalescingOperator): Result is underlying type of left,
4851 when left is nullable type.
4853 2008-05-06 Marek Safar <marek.safar@gmail.com>
4855 A fix for bug #386628
4856 * expression.cs (LocalVariableReference): Continue in resolving when
4857 variable is not assigned.
4859 2008-05-05 Marek Safar <marek.safar@gmail.com>
4861 * nullable.cs, statement.cs (Unwrap): Store non-variable expression in all
4862 nullable operations.
4864 2008-05-04 Marek Safar <marek.safar@gmail.com>
4866 * nullable.cs, statement.cs (Unwrap): Don't duplicate variable expressions,
4867 it saves many redundant temporary variables for nullable operations.
4869 2008-05-03 Marek Safar <marek.safar@gmail.com>
4871 * assign.cs: EventAddOrRemove is a statement and cannot have a type.
4873 * cfold.cs, constant.cs, expression.cs: Share Error_OperatorCannotBeApplied
4876 * nullable.cs: Constant coalescing operator optimizations.
4878 2008-05-03 Marek Safar <marek.safar@gmail.com>
4880 * constant.cs: Use unsigned conversion for values which are unsigned only.
4882 2008-05-03 Marek Safar <marek.safar@gmail.com>
4884 * convert.cs, literal.cs, nullabel.cs, typemanager.cs: Implemeted null
4885 coalescing operator as it should be.
4887 2008-05-02 Marek Safar <marek.safar@gmail.com>
4889 A fix for bug #371016
4890 * expression.cs: All predefined delegate operators require implicit method
4893 2008-05-02 Marek Safar <marek.safar@gmail.com>
4895 * constant.cs: Emit long constant as uint when fits the range.
4897 * convert.cs, expression.cs: Fixed few unsafe conversions.
4899 2008-05-02 Marek Safar <marek.safar@gmail.com>
4901 * convert.cs, literal.cs: Don't wrap implicit reference conversion to object
4903 2008-05-02 Raja R Harinath <harinath@hurrynot.org>
4906 * convert.cs (ImplicitNumericConversion): Don't modify the type of
4908 * ecore.cs (EmptyCast.Create): Flatten nested EmptyCasts.
4910 2008-05-01 Marek Safar <marek.safar@gmail.com>
4912 * constant.cs, literal.cs: IsLiteral property for error reporting.
4914 * ecore.cs, expression.cs: Implemented Property expression.
4916 2008-05-01 Marek Safar <marek.safar@gmail.com>
4918 * class.cs, modifiers.cs, flowanalysis.cs: New BACKING_FIELD flag.
4920 * nullable.cs: Implemented nullable coalescing null operator.
4922 * ecore.cs, expression.cs: Expression trees work.
4924 2008-05-01 Marek Safar <marek.safar@gmail.com>
4926 * ecore.cs: CreateExpressionTree is finally abstract.
4928 * expression.cs, linq.cs: Updated.
4930 2008-05-01 Marek Safar <marek.safar@gmail.com>
4932 * expression.cs, ecore.cs: Block base access expression inside expression
4935 2008-05-01 Marek Safar <marek.safar@gmail.com>
4937 A fix for bug #385058
4938 * expression.cs: User-defined operator implementations always take
4939 precedence over predefined operator implementations.
4941 2008-04-30 Marek Safar <marek.safar@gmail.com>
4943 * assign.cs, anonymous.cs, lambda.cs, nullable.cs, ecore.cs, linq.cs,
4944 class.cs, iterators.cs, expression.cs, attribute.cs: Filled a few more
4945 expression tree conversions.
4947 2008-04-30 Marek Safar <marek.safar@gmail.com>
4949 * typemanager.cs, ecore.cs, class.cs, expression.cs, doc.cs: Merged all
4950 operators method details to Operator class.
4952 2008-04-30 Marek Safar <marek.safar@gmail.com>
4954 * anonymous.cs: Pass unsafe flags to anonymous container.
4956 * ecore.cs, expression.cs, statement.cs: Block unsafe pointer operations
4957 inside expression tree.
4959 2008-04-29 Martin Baulig <martin@ximian.com>
4961 * cs-tokenizer.cs (Tokenizer.Position): Added `line'.
4962 (Tokenizer.PopPosition): Also restore the `line'.
4964 2008-04-29 Marek Safar <marek.safar@gmail.com>
4966 * delegate.cs: Implemented Invoke expression.
4968 2008-04-29 Marek Safar <marek.safar@gmail.com>
4970 * expression.cs: Fixed equality reference comparison regression.
4972 2008-04-29 Marek Safar <marek.safar@gmail.com>
4974 * ecore.cs: Clean up EmptyCast hack.
4976 * expression.cs, nullable.cs: Implemented enum binary and unary operations
4977 using correct conversion rules. Also fixes #383993.
4979 2008-04-28 Martin Baulig <martin@ximian.com>
4981 * class.cs (Constructor.Emit): Don't emit debugging information
4982 for generated default .ctor's.
4984 2008-04-28 Marek Safar <marek.safar@gmail.com>
4986 * convert.cs: Empty-cast ushort to int conversion.
4988 2008-04-28 Marek Safar <marek.safar@gmail.com>
4990 A fix for bug #384191
4991 * ecore.cs, expression.cs: Fixed expression cloning.
4993 2008-04-28 Marek Safar <marek.safar@gmail.com>
4995 * ecore.cs, delegate.cs, assign.cs: Few tweaks for recent changes.
4997 2008-04-28 Raja R Harinath <harinath@hurrynot.org>
4999 Fix #381559, test-638.cs, test-639.cs
5000 * assign.cs (CompoundAssign.Helper): New wrapper.
5001 (CompoundAssign.DoResolve): Use it to wrap the nested 'target'
5003 * ecore.cs (MethodGroupExpr.VerifyArgumentsCompat) <params arguments>:
5004 Pass unconverted expressions to the params array creation expression.
5005 (FieldExpr.EmitAssign): Don't special-case StringConcat.
5006 (PropertyExpr.EmitAssign): Likewise.
5007 * expression.cs (ArrayCreation.ResolveArrayElement): Keep track of the
5008 element if it is of kind CompoundAssign.Helper.
5009 (ArrayCreation.Emit): If we saw a CompoundAssign.Helper, emit it
5010 first before anything else.
5011 (ArrayAccess.EmitAssign): Don't special-case StringConcat.
5012 (ArrayAccess.LoadArrayAndArguments): Simplify.
5014 2008-04-27 Marek Safar <marek.safar@gmail.com>
5016 * expression.cs: Fixed cloning of typeof(void).
5018 2008-04-27 Raja R Harinath <harinath@hurrynot.org>
5020 * assign.cs (Assign.DoResolve): Remove support for EventExprs.
5021 (Assign.Emit): Likewise. Move it to ...
5022 (CompoundAssign.DoResolve): ... here and ...
5023 (CompoundAssign.Emit): ... here.
5024 (EventAddOrRemove): New helper to handle += and -= on events, and
5025 avoid the use of BinaryDelegates.
5026 * ecore.cs (EventExpr.DoResolveLValue): Emit CS0070 unconditionally.
5027 (EventExpr.EmitAddOrRemove): Improve.
5028 * delegate.cs (DelegateInvocation.DoResolve): Simplify slightly.
5030 * cs-parser.jay (type) <namespace_or_type_name variant>: Don't
5031 create VarExprs for 'foo.bar.var'.
5032 * ecore.cs (VarExpr.InferType): Rename from DoResolveLValue, which
5033 is a highly inappropriate name for its functionality.
5035 2008-04-26 Raja R Harinath <harinath@hurrynot.org>
5037 Simplify handling of multiple assignments
5038 * assign.cs (Assign): Clear out all 'embedded assign' gunk. Make
5040 (SimpleAssign): New. Class to be used for normal assignments.
5041 * anonymous.cs, class.cs, cs-parser.jay: Update to changes.
5042 * expression.cs, parameter.cs, statement.cs: Likewise.
5044 2008-04-25 Marek Safar <marek.safar@gmail.com>
5046 * ecore.cs, expression.cs, nullable.cs: Implemeted enum binary add operation
5047 for incompatible underlying types, more to come, uff.
5049 2008-04-26 Raja R Harinath <harinath@hurrynot.org>
5052 * expression.cs (VariableReference.EmitAssign) <source is NewInstance>:
5053 Handle 'leave_copy'.
5055 2008-04-25 Marek Safar <marek.safar@gmail.com>
5057 * expression.cs, nullable.cs: Implemented UnaryPlus expression.
5059 2008-04-24 Raja R Harinath <harinath@hurrynot.org>
5061 Fix test-636.cs. Sprinkle a few more 'EmitSideEffect's around
5062 * expression.cs (Unary.TryReduceConstant): Unwrap SideEffectConstant.
5063 * statement.cs (While, Do, For): Allow test to have side effects.
5064 (For.DoEmit): Always emit InitStatement.
5067 * expression.cs (Binary.DoResolve) <BitwiseAnd with zero constant>:
5068 Always create SideEffectConstant.
5069 (Binary.EnumLiftUp): Don't assume that the enumeration constant is
5070 of type EnumConstant.
5072 * expression.cs (Binary.EmitBranchable) <Equality with constant>:
5073 Handle 'right' being SideEffectConstant of type 'bool'.
5075 * expression.cs (Binary.EmitBranchable) <Equality with constant>:
5076 Use left.EmitBranchable instead of open coding it, so as to
5077 improve optimization opportunities.
5079 * constant.cs (SideEffectConstant.EmitSideEffect): Simplify slightly.
5081 * ecore.cs (Expression.EmitBranchable): Document some non-obvious
5083 (Expression.EmitSideEffect): Document.
5085 2008-04-23 Marek Safar <marek.safar@gmail.com>
5087 * expression.cs: Implemented NewArrayBounds, TypeIs, and TypeAs expressions.
5089 2008-04-23 Marek Safar <marek.safar@gmail.com>
5091 * constant.cs, statement.cs: Use EmitSideEffect for constant if statement.
5093 2008-04-23 Marek Safar <marek.safar@gmail.com>
5095 * ecore.cs, expression.cs, delegate.cs: Implemeted delegate instantiation
5096 conversion to expression tree.
5098 2008-04-23 Marek Safar <marek.safar@gmail.com>
5100 * ecore.cs: Removed unused expression.
5102 2008-04-22 Marek Safar <marek.safar@gmail.com>
5104 * expression.cs: Implemented NegateChecked and New expressions.
5106 2008-04-22 Marek Safar <marek.safar@gmail.com>
5108 * convert.cs, nullable.cs, expression.cs: Implemented Negate expression.
5110 2008-04-22 Raja R Harinath <harinath@hurrynot.org>
5113 * anonymous.cs (AnonymousMethodExpression.DoResolve): Mark as
5114 needing final 'ret' instruction.
5116 2008-04-22 Marek Safar <marek.safar@gmail.com>
5118 * expression.cs: Disabled lifted binary conversion on ISO-1 profiles.
5120 2008-04-21 Marek Safar <marek.safar@gmail.com>
5122 * expression.cs: Emit ldnull and not null expression as an instance argument
5123 of static method expression calls.
5125 2008-04-21 Marek Safar <marek.safar@gmail.com>
5127 A fix for bug #378200
5128 * expression.cs: Fixed crash when creating parameterless expression tree
5131 2008-04-21 Marek Safar <marek.safar@gmail.com>
5133 A fix for bug #375297
5134 * anonymous.cs: Fixed crash when inferring from null argument anonymous
5137 2008-04-21 Marek Safar <marek.safar@gmail.com>
5139 A fix for bug #377596
5140 * decl.cs, class.cs: Emit delegate type argument attributes.
5142 2008-04-21 Marek Safar <marek.safar@gmail.com>
5144 A fix for bug #365314
5145 * generic.cs, ecore.cs: Type parameter declaration cannot be of generic type
5147 2008-04-21 Marek Safar <marek.safar@gmail.com>
5149 * cs-parser.jay, expression.cs: ComposedCast can work with type expressions
5152 2008-04-21 Marek Safar <marek.safar@gmail.com>
5154 * generic.cs (TypeParameter): Removed redundant location.
5156 2008-04-19 Marek Safar <marek.safar@gmail.com>
5158 * generic.cs, parameter.cs, namespace.cs, ecore.cs, class.cs, decl.cs,
5159 delegate.cs, iterators.cs, cs-parser.jay, const.cs, enum.cs: Use
5160 FullNamedExpression in all declaration type expression, statements will come
5163 2008-04-18 Marek Safar <marek.safar@gmail.com>
5165 * generic.cs, namespace.cs, ecore.cs, class.cs, decl.cs, generic-mcs.cs,
5166 nullable.cs, expression.cs, enum.cs, doc.cs: Cleaning up type expressions.
5168 2008-04-18 Marek Safar <marek.safar@gmail.com>
5170 * parameter.cs, delegate.cs, cs-parser.jay, expression.cs: Removed unused
5173 2008-04-17 Marek Safar <marek.safar@gmail.com>
5175 * decl.cs, class.cs, generic.cs: Verify partial parts type parameters and
5178 2008-04-17 Marek Safar <marek.safar@gmail.com>
5180 * decl.cs, class.cs, cs-parser.jay, ecore.cs, expression.cs: Unify all type
5184 2008-04-17 Raja R Harinath <harinath@hurrynot.org>
5186 Hook up 'EmitSideEffect'
5187 * constant.cs (Constant.EmitSideEffect): New.
5188 (SideEffectConstant.Emit): Simplify. Use EmitSideEffect.
5189 (SideEffectConstant.EmitSideEffect): New.
5190 * ecore.cs (BoxedCast.EmitBranchable): Remove. We can't use an
5191 unconditional branch in EmitBranchable.
5192 (FieldExpr.EmitBranchable): New.
5193 * expression.cs (Unary.EmitSideEffect): New.
5194 (Binary.EmitSideEffect): New.
5195 (VariableReference.EmitSideEffect): New. Do nothing.
5197 2008-04-16 Raja R Harinath <harinath@hurrynot.org>
5199 Introduce 'EmitSideEffect'
5200 * ecore.cs (Expression.EmitSideEffect): New.
5201 (TypeCast): Rename from EmptyCast.
5203 (EmptyCast.EmitBranchable, EmptyCast.EmitSideEffect): Implement.
5204 (BoxedCast.EmitBranchable, BoxedCast.EmitSideEffect): Implement.
5205 * convert.cs, nullable.cs: Update to changes.
5207 2008-04-16 Marek Safar <marek.safar@gmail.com>
5209 * class.cs, cs-parser.jay: Early check for base types expression.
5211 2008-04-16 Marek Safar <marek.safar@gmail.com>
5213 * decl.cs (MemberName): Declare PrettyName as obsolete.
5215 2008-04-16 Marek Safar <marek.safar@gmail.com>
5217 * namespace.cs: Use MemberName comparison.
5219 2008-04-16 Raja R Harinath <harinath@hurrynot.org>
5222 * decl.cs (MemberName.PrettyName): New. Replaces the misnamed
5224 (MemberName.MethodName, MemberName.GetSignatureForError): Improve.
5225 (MemberName.FullyQualifiedName): New. Provides the functionality
5226 that users assume FullName would have.
5227 * ecore.cs, namespace.cs: Update to changes.
5229 * statement.cs (Using.assign): Make into ExpressionStatement.
5230 (Using.EmitPreTryBody): Simplify.
5232 2008-04-16 Marek Safar <marek.safar@gmail.com>
5234 * report.cs: ColorFormat is protected.
5236 * rootcontext.cs: Unused fields clean-up.
5238 * namespace.cs: Made UsingEntry name private.
5240 2008-04-16 Marek Safar <marek.safar@gmail.com>
5242 * cs-tokenizer.cs, location.cs: Removed unused field.
5244 2008-04-16 Jan Oravec <jan.oravec@6com.sk>
5245 Raja R Harinath <harinath@hurrynot.org>
5248 * constant.cs (SideEffectConstant.value): Rename from 'left'.
5249 (SideEffectConstant.side_effect): Rename from 'right'.
5250 (SideEffectConstant..ctor): Normalize 'side_effect'.
5251 (SideEffectConstant.Emit): Emit 'value', not 'side_effect' as the
5252 value of this constant.
5253 * cfold.cs: Update to changes.
5255 2008-04-15 Marek Safar <marek.safar@gmail.com>
5257 * cs-paser.jay: Removed unused variable.
5259 * driver.cs: Made Compile instance method.
5261 2008-04-15 Raja R Harinath <harinath@hurrynot.org>
5263 * flowanalysis.cs (FlowBranching.MergeChild): Simplify.
5265 2008-04-15 Marek Safar <marek.safar@gmail.com>
5267 * cs-paser.jay, namespace.cs: Simplified handling of namespace imports.
5269 2008-04-13 Jb Evain <jbevain@novell.com>
5271 * namespace.cs: update the System.Core fullname for 2.1
5272 * driver.cs: update the list of required assemblies for 2.1.
5273 Merged from the Moonlight 2 branch.
5275 2008-04-11 Marek Safar <marek.safar@gmail.com>
5277 * assign.cs, ecore.cs, expression.cs, nullable.cs: More work on nullable
5278 types and user defined operators. User operators arguments has to be checked
5279 for null value before invocation, which also means no operator is called
5280 when any argument is not convertible to unwrapped nullable type.
5282 2008-04-09 Marek Safar <marek.safar@gmail.com>
5284 * convert.cs, ecore.cs, expression.cs, nullable.cs: Initial refactoring
5285 of Unary expressions to follow operator overloading rules precisely.
5286 Also fixes #321794, #323794
5288 2008-04-08 Marek Safar <marek.safar@gmail.com>
5290 * cs-parser.jay, expression.cs: Don't wrap Indirection expression in Unary
5293 2008-04-08 Marek Safar <marek.safar@gmail.com>
5295 * expression.cs, ecore.cs: Implemented MemberInit expression.
5297 2008-04-08 Raja R Harinath <harinath@hurrynot.org>
5299 Fix mono/tests/exception4.cs
5300 * statement.cs (ExceptionStatement, TryCatch): Revert to using
5301 ec.NeedReturnLabel () rather emitting a 'nop'.
5303 * statement.cs (ExceptionStatement.SomeCodeFollows): A hook for a
5305 (TryCatch.SomeCodeFollows): Likewise.
5306 * flowanalysis.cs (FlowBranchingException): Call 'SomeCodeFollows'
5307 for 'break', 'continue' and 'return' statements inside a try.
5308 We're fairly sure that the generated IL stream will have more
5309 instructions textually following the try.
5310 (FlowBranchingTryCatch): Likewise.
5312 * statement.cs (Throw.Resolve): Move CS0156 and CS0724 testing ...
5313 * flowanalysis.cs (FlowBranching.CheckRethrow): ... here and to its
5316 * statement.cs (CollectionForeach.DisposableWrapper): Make a true
5317 wrapper -- forward everything to CollectionForeach.
5318 (CollectionForeach.NonDisposableWrapper): New.
5319 (CollectionForeach.EmitFinallyBody): Use 'endfinally' instruction
5320 instead of a pop + branch to end.
5322 2008-04-07 Marek Safar <marek.safar@gmail.com>
5324 A fix for bug #377485
5325 * assign.cs, expression.cs, decl.cs, class.cs, ecore.cs, namespace.cs:
5326 Propagate location for extension method groups. Report conversion failure at
5329 2008-04-07 Marek Safar <marek.safar@gmail.com>
5331 * anonymous.cs, expression.cs, ecore.cs, typemanager.cs: Implemented
5332 ListInit and Field expressions.
5334 2008-04-06 Raja R Harinath <harinath@hurrynot.org>
5336 * iterators.cs (Iterator.EmitMoveNext): Remove try/fault wrapper.
5337 Since $PC is always -1 inside the body of MoveNext, the fault
5339 * flowanalysis.cs (FlowBranchingException.EmitFinally): Kill.
5340 * statement.cs (ExceptionStatement.emit_finally): Likewise.
5341 (ExceptionStatement.ResolveFinally): Drop 'branching' argument.
5343 The denouement! Fix #324708
5344 * iterators.cs (Iterator.EmitMoveNext): Reset $PC to -1 on entry.
5345 (Iterator.EmitYieldBreak): We no longer need to reset $PC.
5346 * statement.cs (ExceptionStatement.DoEmit): Actually emit the
5347 'finally' inside the finally clause.
5349 * statement.cs (ExceptionStatement.DoEmit): Emit try/finally block
5350 inside an iterator. Don't emit the body of the 'finally' inside
5351 the finally clause yet.
5353 Use the ResumableStatement infrastructure for MoveNext ()
5354 * iterators.cs (Iterator.EmitMoveNext_NoResumePoints): New.
5355 (Iterator.EmitMoveNext): Use 'resume_points'. Get rid of
5356 'old_resume_points'. Move dispatcher upfront.
5357 (Iterator.MarkYield): Mark the 'resume_point' of a Yield.
5358 * statement.cs (ExceptionStatement.DoEmit): Emit a dispatcher if
5359 in an enumerator. This encodes the main fix in this patch series
5360 -- we can only jump into the first instruction of a try from the
5361 outside, but we want to emit try/finally regions in iterators and
5362 resume in the middle of them.
5364 2008-04-05 Raja R Harinath <harinath@hurrynot.org>
5366 * statement.cs (ExceptionStatement.ResolveFinally): Move setting
5367 of NeedReturnLabel here.
5369 Introduce a common point for emitting try/finally to IL
5370 * statement.cs (ExceptionStatement.DoEmit): New. Combines all the
5371 features of the various subclasses, which are now driven by ...
5372 (ExceptionStatement.EmitPreTryBody): ... this and ...
5373 (ExceptionStatement.EmitTryBody): ... this and the original
5375 (TryFinally, Lock, Using, UsingTemporary, DisposableWrapper):
5376 Remove DoEmit and update to follow above protocol.
5378 * statement.cs (ExceptionStatement.EmitForDispose): If all labels
5379 of the dispatcher are the same, skip emitting the 'switch'.
5380 * iterator.cs (Iterator.EmitDispose): Update to changes.
5382 Clean up handling of 'using' statement
5383 * statement.cs (UsingTemporary): New. Carved out of ...
5384 (Using): ... this. Simplify drastically. Handle exactly
5386 * cs-parser.jay (using_statement): Split. Create UsingTemporary
5387 or Using as appropriate. If there are multiple variable declared,
5388 create nested Using statements.
5389 (resource_acquisition): Kill.
5391 * statement.cs (ExceptionStatement.EmitForDispose): Use
5392 EmitFinallyBody, not EmitFinally.
5394 * flowanalysis.cs (FlowBranching.StealFinallyClauses): Remove.
5395 * iterator.cs: Update to changes.
5397 Start using the ResumableStatement infrastructure
5398 * statement.cs (ResumeableStatement.PrepareForDispose): New.
5399 (ResumableStatement.EmitForDispose): New.
5400 (ExceptionStatement): Override them.
5401 * iterators.cs (Iterator.EmitDispose): Use PrepareForDispose and
5402 EmitForDispose to create the body of the Dispose method. Don't
5405 * iterator.cs (Iterator.AddResumePoint): Move here from ...
5406 * statement.cs (Toplevel.AddResumePoint): ... here.
5407 (Toplevel.MoveNextStatement.Resolve): Create FlowBranchingIterator.
5408 * flowanalysis.cs (FlowBranchingIterator): New.
5409 * codegen.cs (EmitContext): Update to changes.
5411 * iterators.cs (Iterator.OldResumePoint): Rename from ResumePoint.
5412 (Iterator.old_resume_points): Rename from 'resume_points'.
5413 (Iterator.MoveNextStatement): Remove unused class.
5415 New infrastructure for try/finally in iterators (still unused)
5416 * flowanalysis.cs (FlowBranching.AddResumePoint): New.
5417 (FlowBranchingToplevel.AddResumePoint): Hook into
5418 ToplevelBlock.AddResumePoint.
5419 (FlowBranchingTryCatch): Move CS01626 and CS01631 checks here.
5420 (FlowBranchingException): Hook into ExceptionBlock.AddResumePoint.
5421 * statement.cs (ToplevelBlock.AddResumePoint): New. Collect
5422 resume points and assign program-counter values.
5423 (ExceptionBlock.AddResumePoint): Collect resume points for
5424 de-muxer at the top of try block.
5425 * iterators.cs (Yield.CheckContext): Simplify.
5426 (Yield.Resolve): Use FlowBranching.AddResumePoint.
5428 2008-04-04 Raja R Harinath <harinath@hurrynot.org>
5430 * flowanalysis.cs (FlowBranching.AddReturnOrigin): Change Location
5431 argument to an ExitStatement.
5432 (FlowBranchingException): Refactor saved origins code.
5433 * statement.cs (ExitStatement): Update to cahges.
5434 * iterator.cs (YieldBreak): Likewise.
5436 * statement.cs (ResumableStatement): New. Common base class for
5437 YieldReturn and ExceptionStatement.
5438 (ExitStatement): New. Common base class for Return and YieldBreak.
5439 (Return): Update to changes.
5440 * iterator.cs (YieldBreak): Likewise.
5441 * lambda.cs (ContextualReturn): Likewise.
5444 * ecore.cs (Expression.ResolveAsTypeStep): If '!silent' attempt to
5445 emit a meaningful error message.
5447 Fix #324765, #319508
5448 * flowanalysis.cs (VariableInfo.IsEverAssigned): New.
5449 (VariableInfo.SetAssigned): Set it.
5450 * statement.cs (Block.UsageWarning): Use 'IsEverAssigned' to
5451 determine if CS0219 or CS0168 is appropriate. Don't use
5452 flow-analysis information.
5453 (Block.Resolve): Use ec.EndFlowBranching, not ec.DoEndFlowBranching.
5454 * codegen.cs (EmitContext.DoEndFlowBranching): Kill. Inline into ...
5455 (EmitContext.EndFlowBranching): ... this.
5457 2008-04-03 Marek Safar <marek.safar@gmail.com>
5459 * class.cs, typemanager.cs: Emit volatile field with IsVolatile modifier.
5461 2008-04-03 Marek Safar <marek.safar@gmail.com>
5463 A fix for bug #376508
5464 * convert.cs, expression.cs: Fixed difference between ImplicitConversion and
5465 ImplicitConversionExists.
5467 2008-04-03 Marek Safar <marek.safar@gmail.com>
5469 * expression.cs (Binary): Added remaining binary operators to expression
5472 * nullable.cs: Optimize shift with null argument.
5474 2008-04-03 Raja R Harinath <harinath@hurrynot.org>
5476 Fix minor IL regression
5477 * statement.cs (TryCatch..ctor): Add 'inside_try_finally' argument.
5478 (TryCatch.DoEmit): Use it to avoid creating another ExceptionBlock.
5479 * cs-parser.jay (try_statement): Update to changes.
5481 * statement.cs (TryFinally.need_exc_block): Delete.
5482 (TryFinally): Update to changes.
5484 Now all ExceptionStatements are unconditional
5485 * statement.cs (CollectionForeach.DisposableWrapper): New.
5486 Extract out the try/finally code into a new wrapper.
5487 (CollectionForeach.Resolve): Use it to simplify the code.
5489 2008-04-02 Raja R Harinath <harinath@hurrynot.org>
5491 Start at simplifying ExceptionStatement semantics a bit
5492 * statement.cs (TryCatch, TryFinally): Split 'Try' into two pieces.
5493 * cs-parser.jay (try_statement): Update to changes.
5494 (opt_catch_clauses): Remove.
5495 * flowanalysis.cs: Update to changes.
5496 (FlowBranching.BranchingType.TryCatch): New.
5497 (FlowBranchingTryCatch): New.
5499 * flowanalysis.cs (FlowBranching.BranchingType.SwitchSection): Kill.
5500 (FlowBranching.CreateBranching): Update to changes.
5501 (FlowBranchingBlock.AddSibling): Add sanity check.
5502 * codegen.cs (EmitContext.StartFlowBranching) <Block variant>:
5505 * iterators.cs (Iterator.MarkFinally): Remove.
5506 * statement.cs (ExceptionStatement): Update to changes.
5508 Add support for skipping over finally blocks at runtime. First
5509 in a series to fix #324708
5510 * iterators.cs (Iterator.SkipFinally): New LocalBuilder.
5511 (Iterator.EmitMoveNext): Initialize it.
5512 * statement.cs (ExceptionStatement.EmitFinally): Use it to emit a
5513 branch over the body of the 'finally' clause.
5515 2008-03-31 Raja R Harinath <harinath@hurrynot.org>
5517 Avoid lopsided use of Foo/DoFoo names
5518 * statement.cs (ExpressionStatement.EmitFinallyBody):
5519 Rename from EmitFinally.
5520 (ExpressionStatement.EmitFinally): Rename from DoEmitFinally.
5521 * iterator.cs: Update to changes.
5523 2008-04-02 Marek Safar <marek.safar@gmail.com>
5525 * ecore.cs, expression.cs, nullable.cs: ConditionalLogicalOperator is now
5526 based on UserOperatorCall. More binary nullable operators clean up.
5528 2008-04-02 Martin Baulig <martin@ximian.com>
5530 * symbolwriter.cs: Remove the `#if !DISABLE_TERRANIA_CHANGES' conditionals.
5532 2008-04-02 Marek Safar <marek.safar@gmail.com>
5534 * nullable.cs: Merge user and empty conversions when lifting expression
5537 * expression.cs (StringConcat): Implemented expression tree representation.
5539 2008-04-01 Marek Safar <marek.safar@gmail.com>
5541 * nullable.cs: When lifting null literal and a user operator exists, no call
5544 2008-04-01 Marek Safar <marek.safar@gmail.com>
5546 * nullable.cs, ecore.cs, expression.cs: Convert null arithmetic to lifted
5549 2008-04-01 Marek Safar <marek.safar@gmail.com>
5551 * nullable.cs, expression.cs: Use namespace instead heavily nested
5552 monster abstract class.
5554 2008-04-01 Marek Safar <marek.safar@gmail.com>
5556 * ecore.cs, convert.cs, constant.cs, nullable.cs, expression.cs: Implemented
5557 lifting of null literal and user operators. Clean up of some temporary
5560 2008-03-30 Raja R Harinath <harinath@hurrynot.org>
5562 Fix #368224, test-629.cs
5563 * flowanalysis.cs (FlowBranching.StealFinallyClauses): Return true
5564 if it crossed an unwind-protect boundary.
5565 * iterators.cs (Yield.CheckContext): Relax check for 'yield break'.
5566 (Yield.Resolve, Yield.DoEmit): Track whether the yield occurs
5567 inside an unwind-protected region.
5568 (YieldBreak.Resolve, YieldBreak.DoEmit): Likewise.
5569 (Iterator.MarkYield): Add 'unwind_protect' parameter. Emit a
5570 'leave' instead of a 'br' if unwind-protected.
5571 (Iterator.EmitYieldBreak): Likewise.
5573 2008-03-29 Gert Driesen <drieseng@users.sourceforge.net>
5575 * driver.cs: Only define versioninfo resources if no win32 resource
5578 2008-03-28 Marek Safar <marek.safar@gmail.com>
5580 A fix for bug #372375
5581 * convert.cs: Fixed boxing of nullable types.
5583 2008-03-28 Marek Safar <marek.safar@gmail.com>
5585 * typemanager.cs: Initialize InternalsVisibleTo as the very first optional
5588 2008-03-28 Marek Safar <marek.safar@gmail.com>
5590 A fix for bug #374619
5591 * nullable.cs: Fixed guarding of EmitBitwiseBoolean.
5593 2008-03-27 Marek Safar <marek.safar@gmail.com>
5595 * lambda.cs: Check return type only for invocation.
5597 2008-03-27 Marek Safar <marek.safar@gmail.com>
5599 A fix for bug #374214
5600 * ecore.cs: Correctly report argument type mismatch.
5602 2008-03-27 Marek Safar <marek.safar@gmail.com>
5604 * convert.cs (ImplicitReferenceConversionCore): Correctly compare enum type
5605 and not rely on broken IsEnum.
5607 2008-03-27 Marek Safar <marek.safar@gmail.com>
5609 * nullable.cs: New file, extracted from generic.cs.
5611 * generic.cs, generic-mcs.cs, *.csproj, *.sources: Updated.
5613 2008-03-27 Marek Safar <marek.safar@gmail.com>
5615 * generic.cs, convert.cs, generic-mcs.cs, expression.cs: Added lifting of
5616 predefined comparison operators and null literals.
5618 * report.cs: New warning ID.
5620 2008-03-25 Marek Safar <marek.safar@gmail.com>
5622 A fix for bug #370577
5623 * lambda.cs: Check return type too.
5625 2008-03-25 Marek Safar <marek.safar@gmail.com>
5627 A fix for bug #372846
5628 * class.cs: Automatic properties can be declared as unsafe.
5630 2008-03-20 Marek Safar <marek.safar@gmail.com>
5632 * location.cs: Use string based concatenation.
5634 * expression.cs: LiftedBinaryOperator is gmcs only.
5636 2008-03-20 Marek Safar <marek.safar@gmail.com>
5638 * generic.cs, literal.cs, ecore.cs, expression.cs: Ongoing work on nullable
5639 conversions rules and expression trees.
5641 2008-03-19 Marek Safar <marek.safar@gmail.com>
5643 * delegate.cs: Use extension method source as delegate target.
5645 2008-03-19 Marek Safar <marek.safar@gmail.com>
5647 * generic.cs, generic-mcs.cs, expression.cs, ecore.cs: Rewrote nullable
5648 binary operations to be purely based on binary operations and optimized
5649 emitted code (30% less in some cases). Introduced ReducedExpression for ETs
5650 and other ET refactoring.
5652 * typemanager.cs: Fixed warning.
5654 2008-03-17 Marek Safar <marek.safar@gmail.com>
5656 * class.cs, decl.cs, delegate.cs: Do protected modifier check on each member
5658 * symbolwriter.cs: Fixed.
5660 2008-03-17 Marek Safar <marek.safar@gmail.com>
5662 * anonymous.cs, driver.cs: Reset anonymous types counters.
5664 2008-03-17 Marek Safar <marek.safar@gmail.com>
5666 * ecore.cs (MethodGroupExpr): Skip first candidate, it's already the best.
5668 * class.cs: Use fullname for all type member definitions.
5670 2008-02-19 Martin Baulig <martin@ximian.com>
5673 (IMethodData.EmitExtraSymbolInfo): New interface method.
5674 (MethodData.Emit): Call method.EmitExtraSymbolInfo().
5675 (MethodOrOperator.EmitExtraSymbolInfo): Implement this new
5676 interface method here as an empty public virtual method.
5679 (AnonymousMethodMethod.ctor): Added `string real_name' argument.
5680 (AnonymousMethodMethod.EmitExtraSymbolInfo): Override and call
5681 CodeGen.SymbolWriter.SetRealMethodName().
5683 2008-02-18 Martin Baulig <martin@ximian.com>
5686 (ScopeInfo.EmitType): Override this and emit debugging
5687 information for captured variables.
5688 (RootScopeInfo.EmitType): Override this and emit symbol
5689 information for a captured `this'.
5691 2008-02-15 Martin Baulig <martin@ximian.com>
5693 * iterators.cs: Emit debugging info.
5696 (EmitContext.Flags): Add `OmitDebuggingInfo'.
5697 (EmitContext.OmitDebuggingInfo): New public property.
5700 (While): Override Emit() and don't emit symbol info there; do it
5701 inside DoEmit() instead.
5702 (Block.Emit): Omit symbol information while emitting the scope
5703 initializers; don't ec.Mark() the `EndLocation'. Fix the lexical
5705 (ExplicitBlock.IsIterator): Moved here from `ToplevelBlock'.
5706 (ToplevelBlock.MakeIterator): Pass the `flags' to `ExplicitBlock's
5707 .ctor to make `IsIterator' work.
5709 2008-03-14 Martin Baulig <martin@ximian.com>
5711 * symbolwriter.cs: Added the new symbol writer function from the
5712 debugger's `terrania' branch; temporarily enclose them inside
5713 `#if !DISABLE_TERRANIA_CHANGES' conditionals until I'm back from
5716 2008-03-14 Martin Baulig <martin@ximian.com>
5719 (SymbolWriter): Make this a public static class.
5722 (CodeGen.SymbolWriter): Removed; use the new static `SymbolWriter'
5723 class instead of using `if (CodeGen.SymbolWriter != null)' everywhere.
5725 2008-03-14 Marek Safar <marek.safar@gmail.com>
5727 A fix for bug #370577
5728 * statement.cs, lambda.cs: Added extra limitations when dealing with void
5731 2008-03-14 Marek Safar <marek.safar@gmail.com>
5733 * typemanager.cs (CSharpName): Made 250 times faster.
5735 2008-03-13 Marek Safar <marek.safar@gmail.com>
5737 * ecore.cs, expression.cs: Emit conversion for ET shift argument.
5739 2008-03-12 Marek Safar <marek.safar@gmail.com>
5741 * generic.cs, typemanager.cs, enum.cs, codegen.cs, statement.cs: Try not to
5742 crash when predefined field does not exist.
5744 2008-03-12 Marek Safar <marek.safar@gmail.com>
5746 * ecore.cs (PropertyExpr): Fixed IsSingleDimensionalArrayLength regression.
5748 2008-03-12 Marek Safar <marek.safar@gmail.com>
5750 * class.cs (FixedField): Don't crash when contructors are missing.
5752 2008-03-11 Marek Safar <marek.safar@gmail.com>
5754 * typemanager.cs, namespace.cs, literal.cs, ecore.cs, class.cs, decl.cs,
5755 convert.cs, constant.cs, expression.cs, statement.cs: Use same method to
5756 check internal types accessibility for internal and external types.
5757 Replaced EnumToUnderlying by GetEnumUnderlyingType.
5759 2008-03-11 Marek Safar <marek.safar@gmail.com>
5761 * support.cs, typemanager.cs, pending.cs, ecore.cs, class.cs, delegate.cs
5762 convert.cs, const.cs, anonymous.cs, constant.cs, expression.cs,
5763 attribute.cs, statement: Use corect instance of predefined types (work
5764 related to #364674).
5766 2008-03-07 Marek Safar <marek.safar@gmail.com>
5768 * expression.cs (TypeOfVoid): Fixed predefined method initialization.
5770 2008-03-07 Marek Safar <marek.safar@gmail.com>
5772 * generic.cs, typemanager.cs, parameter.cs, rootcontext.cs, ecore.cs,
5773 class.cs, delegate.cs, iterators.cs, const.cs, constant.cs, driver.cs,
5774 expression.cs, attribute.cs, codegen.cs, statement.cs: TypeManager optional
5775 predefined types clean up, delayed predefined types members initialization
5776 (work related to #364674).
5778 2008-03-05 Marek Safar <marek.safar@gmail.com>
5780 * typemanager.cs (IsFriendAssembly): InternalsVisibleTo is not mandatory.
5782 2008-03-05 Marek Safar <marek.safar@gmail.com>
5784 * typemanager.cs, parameter.cs, rootcontext.cs, ecore.cs, class.cs, decl.cs,
5785 delegate.cs, convert.cs, driver.cs, attribute.cs, codegen.cs: TypeManager
5786 predefined types clean up (work related to #364674).
5788 2008-03-04 Marek Safar <marek.safar@gmail.com>
5790 * ecore.cs: Print an error message instead of throwing exception.
5792 2008-03-04 Marek Safar <marek.safar@gmail.com>
5794 * generic.cs, typemanager.cs, literal.cs, convert.cs, cfold.cs, constant.cs,
5795 expression.cs, statement.cs: Unififed null literal representation.
5797 2008-03-03 Marek Safar <marek.safar@gmail.com>
5799 * anonymous.cs, cfold.cs, convert.cs, delegate.cs, doc.cs, ecore.cs,
5800 expression.cs: Refactored binary operators resolve phase and improved speed.
5801 The nullable code is still missing and won't work correctly, more fixes
5804 It also fixes #323726, #324312, #324248, and many other unreported issues.
5806 2008-02-29 Zoltan Varga <vargaz@gmail.com>
5808 * report.cs (FeatureIsNotAvailable): Use 'mcs1' instead of 'mcs', and 'mcs'
5811 2008-02-27 Marek Safar <marek.safar@gmail.com>
5813 * ecore.cs: Clean-up and split BetterConversion.
5815 2008-02-25 Raja R Harinath <harinath@hurrynot.org>
5818 * enum.cs (EnumMember.Value): Only access 'value' if
5819 ResolveValue says it's ok.
5820 (EnumMember.DoResolveValue): Don't set prev_member.value.
5821 (Enum.GetDefinition): Reverse arguments of Equals --
5822 EnumMember.Value can return 'null'.
5824 * statement.cs (Switch.Error_AlreadyOccurs): Fix typo in name.
5826 2008-02-22 Marek Safar <marek.safar@gmail.com>
5828 * generic.cs, expression.cs: More ongoing work on expression trees.
5830 2008-02-21 Marek Safar <marek.safar@gmail.com>
5832 * class.cs, typemanager.cs: Rewrote operator matching logic to correctly
5833 handle missing matches when mutiple operators exist.
5835 2008-02-20 Marek Safar <marek.safar@gmail.com>
5837 A fix for bug #363218
5838 * expression.cs (ArrayCreation.Clone): Deal with multi-dimensional
5841 2008-02-20 Marek Safar <marek.safar@gmail.com>
5843 * expression.cs, constant.cs, cfold.cs: Yet another side-effect constant
5844 update. This time to deal correctly with SideEffectConstant expression used
5845 as an argument for another constant folding.
5847 2008-02-20 Raja R Harinath <harinath@hurrynot.org>
5849 * typemanager.cs (DropGenericMethodArguments): Ensure we get an underlying
5852 2008-02-19 Marek Safar <marek.safar@gmail.com>
5854 * constant.cs, cfold.cs: SideEffectConstant results can apply for folding.
5856 2008-02-19 Marek Safar <marek.safar@gmail.com>
5858 A fix for bug #328136
5859 * expression.cs: Do not fold immediately LogicalAnd operators when the left
5860 side is a false constant, because we still need to evaluate the right-hand
5863 * statement.cs (If): Emit two types of boolean constants (simple constant,
5864 side-effect constant).
5866 2008-02-19 Marek Safar <marek.safar@gmail.com>
5868 * constant.cs (SideEffectConstant): Don't emit boolean constant.
5870 * expression.cs: Fold immediately LogicalAnd operators when both sides are
5873 2008-02-18 Marek Safar <marek.safar@gmail.com>
5875 A fix for bug #361457
5876 * ecore.cs (IsApplicable): Params methods have lower priority.
5878 * support.cs: Return correct parameter modifier for params types.
5880 2008-02-18 Marek Safar <marek.safar@gmail.com>
5882 * generic.cs (TypeParameter): Cache attribute target name.
5884 * support.cs: Removed unused variable.
5886 * typemanager.cs: Removed debugging leftover.
5888 * ecore.cs: Use local type instead of a property;
5890 * class.cs (VerifyMembers): Consider also parent to test whether type member
5893 * expression.cs (FullMethodDesc): Removed.
5895 * attribute.cs (IsValidArgumentType): Made static.
5897 2008-02-17 Raja R Harinath <harinath@hurrynot.org>
5899 Cleanup to be more readable.
5900 * Makefile (GMCS_PROFILE): Remove.
5901 (COMPILER_NAME): New helper.
5903 2008-02-15 Miguel de Icaza <miguel@novell.com>
5905 * cs-tokenizer.cs: if a conditional expression happens inside a
5906 (...) this also means that we do not need to de-ambiguate between
5907 an parenthesized expression and a cast.
5911 * constant.cs (SideEffectConstant): a constant value that happens
5912 to have a side effect.
5914 Fixes the build regressions introduced by the fix for #359789
5916 2008-02-14 Rodrigo Kumpera <rkumpera@novell.com>
5918 * expression.cs (Conditional.Emit): when emitting the ternary
5919 operator, use local variables to generate code verifiable code.
5921 The verifier cannot infer that the type on stack before the
5922 stloc.0 is executed is of type ParentB. This happens because the
5923 stack merge algorithm uses only parent types when deciding which
5924 is the common type. This is described in Part III 1.8.1.3 of ECMA
5927 This code compiled with mcs is not verifiable under MS. The MS
5928 verifier picks the first common interface of Foo and Bar, which is
5929 wrong, but doesn't use a full join type of the 2 interfaces.
5931 CSC uses a clever hack to compile such code in a verifiable
5932 way. It stores the intermediate values in a local variable with
5937 2008-02-14 Miguel de Icaza <miguel@novell.com>
5939 * expression.cs: Do not fold BitwiseAnd operators when the left
5940 side is a false constant, because we still need to evaluate the
5945 * support.cs: Instead of throwing an InternalErrorException when
5946 the position of the stream is outside the boundary of our buffer,
5947 reset the state of the reader, and restart the reading from the
5948 beginning of the file.
5950 2008-02-14 Marek Safar <marek.safar@gmail.com>
5952 * generic.cs (TypeParameter.GetMembers): Is not supported operation.
5954 2008-02-14 Marek Safar <marek.safar@gmail.com>
5956 A fix for bug #361686
5957 * decl.cs: A protected types used inside a private class which parents
5958 derives from the protected class are accessible.
5960 2008-02-13 Marek Safar <marek.safar@gmail.com>
5962 * generic.cs (ConstraintChecker): Use cached member lookup when looking for
5963 the parameterless constructor.
5965 2008-02-13 Marek Safar <marek.safar@gmail.com>
5967 * generic.cs, typemanager.cs, iterators.cs, codegen.cs: Refactored core
5968 lookup methods to use standard member cache when doing member lookup.
5970 2008-02-12 Marek Safar <marek.safar@gmail.com>
5972 * driver.cs: Don't report full path for referenced module as assembly error.
5974 2008-02-12 Marek Safar <marek.safar@gmail.com>
5976 * Makefile: Fixed `qh' target to work on all machines.
5978 * report.cs, typemanager.cs, parameter.cs, ecore.cs, class.cs, anonymous.cs,
5979 expression.cs, codegen.cs, statement.cs, doc.cs: Replaced type IsSubclassOf
5980 and HasElementType with TypeManager implementation.
5982 2008-02-08 Marek Safar <marek.safar@gmail.com>
5984 A fix for bugs #325134, #359749
5985 * expression.cs, ecore.cs: Try to resolve an extension method even if the
5986 first binds point to non-method member expression.
5988 2008-02-08 Marek Safar <marek.safar@gmail.com>
5990 * cs-parser.jay: Null coalescing operator is not part of ISO-1.
5992 2008-02-08 Marek Safar <marek.safar@gmail.com>
5994 A fix for bugs #321394, #323028
5995 * generic.cs, parameter.cs, ecore.cs, class.cs, decl.cs, delegate.cs:
5996 Reworked naive IsAccessibleAs implementation to handle nested types.
5998 2008-02-05 Jb Evain <jbevain@novell.com>
6000 * class.cs: use generic type comparison for parameters
6003 2008-02-05 Marek Safar <marek.safar@gmail.com>
6005 A fix for bug #325372
6006 * class.cs: Use generic type comparison when testing method signatures.
6008 2008-02-05 Marek Safar <marek.safar@gmail.com>
6010 A fix for bug #357047
6011 * ecore.cs: Applied C# 3.0 changes to better conversion.
6013 2008-02-05 Marek Safar <marek.safar@gmail.com>
6015 A fix for bug #358374
6016 * cs-parser.jay: Correctly set modifiers for all constructor types.
6018 2008-02-04 Marek Safar <marek.safar@gmail.com>
6020 A fix for bug #355251
6021 * generic.cs: Added base class constraint based type inference.
6023 2008-02-01 Marek Safar <marek.safar@gmail.com>
6025 A fix for bug #357255
6026 * decl.cs: One more missing visibility check.
6028 2008-02-01 Marek Safar <marek.safar@gmail.com>
6030 * support.cs: Fixed broken return.
6032 2008-01-25 Marek Safar <marek.safar@gmail.com>
6034 * report.cs: Correctly reset warnings count after probing.
6036 2008-01-25 Martin Baulig <martin@ximian.com>
6039 (NamespaceEntry.SymbolFileID): Make this work again after
6040 MemberName.ToString() is gone.
6042 2008-01-25 Marek Safar <marek.safar@gmail.com>
6044 * expression.cs: Implemented Divide, Equal, ExclusiveOr, GreaterThanOrEqual
6047 2008-01-25 Marek Safar <marek.safar@gmail.com>
6049 * generic.cs: Use full implicit conversion for type inference fixing.
6051 2008-01-24 Marek Safar <marek.safar@gmail.com>
6053 * ecore.cs, expression.cs, generic.cs: Implemented Convert, ConvertChecked.
6054 Fixed user operator conversions.
6056 2008-01-24 Marek Safar <marek.safar@gmail.com>
6058 * generic.cs: Do nullable type to null comparison optimization during
6061 2008-01-24 Marek Safar <marek.safar@gmail.com>
6063 A fix for bug #355163
6064 * generic.cs: Enabled l-value resolve on nullable expressions.
6066 2008-01-24 Marek Safar <marek.safar@gmail.com>
6068 A fix for bug #353986
6069 * class.cs: Ingore static ctors with parameters for any further checks.
6071 2008-01-24 Marek Safar <marek.safar@gmail.com>
6073 A fix for bug #354310
6074 * namespace.cs: Removed redundant check.
6076 2008-01-24 Marek Safar <marek.safar@gmail.com>
6078 A fix for bug #354928
6079 * expression.cs: ElementInitializers can be resolved only once.
6081 2008-01-24 Marek Safar <marek.safar@gmail.com>
6083 * convert.cs, ecore.cs, expression.cs, generic.cs: Implemented Coalesce and
6084 Condition expressions.
6086 2008-01-23 Marek Safar <marek.safar@gmail.com>
6088 * codegen.cs: Fixed AssemblyBuilder initialization on other platforms.
6090 2008-01-22 Marek Safar <marek.safar@gmail.com>
6092 * ecore.cs, expression.cs, generic.cs: Implicit bool? to bool conversion is
6095 * generic.cs: Implemented coalesce expression.
6097 2008-01-22 Marek Safar <marek.safar@gmail.com>
6099 A fix for bug #355145
6100 * anonymous.cs, convert.cs, ecore.cs, generic.cs, lambda.cs: Implemented
6101 expression tree type inference.
6103 2008-01-22 Raja R Harinath <harinath@hurrynot.org>
6106 * expression.cs (Binary.IsUnsignedType): Fix typo.
6108 2008-01-22 Marek Safar <marek.safar@gmail.com>
6110 * ecore.cs, expression.cs, generic.cs: Implemented NewArrayInit expression.
6112 2008-01-22 Marek Safar <marek.safar@gmail.com>
6114 A fix for bug #355161
6115 * ecore.cs, expression.cs: Wider range of extension method supported
6118 2008-01-22 Gert Driesen <drieseng@users.sourceforge.net>
6120 * codegen.cs: Use magic value for AssemblyBuilderAccess to instruct
6121 AssemblyBuilder to operate in compiler context. Fixes mcs part of
6124 2008-01-22 Marek Safar <marek.safar@gmail.com>
6126 A fix for bug #355148
6127 * ecore.cs, expression.cs: Correctly report misused ref and out modifiers.
6129 2008-01-22 Miguel de Icaza <miguel@novell.com>
6131 * expression.cs (CreateExpressionTree): Add support for or and
6132 logical or, and indent following the coding conventions.
6134 * typemanager.cs (LinqExpression): renamed from
6135 ExpressionTreeManager, for a shorter name.
6137 Use TypeManager.CoreLookupType to lookup types from our core
6138 assemblies and turn those into "Type" variables.
6140 Consumers that previously used "Namespace" and "Type" from this
6141 class should instead use the TypeExpression which is a type that
6142 is fully resolved (without involving the regular C# resolution
6145 This typically looks like this:
6147 TypeExpression texpr = new TypeExpression (LinqExpression.expression_type, loc);
6148 new MemberAccess (texpr, name, type_arguments, loc)
6150 This avoids the problem in: #355178
6152 2008-01-21 Marek Safar <marek.safar@gmail.com>
6154 * cs-parser.jay, expression.cs: Check `namespace alias qualifier' language
6155 feature in parser only as we do in other cases.
6157 2008-01-21 Marek Safar <marek.safar@gmail.com>
6159 * attribute.cs, ecore.cs, class.cs, delegate.cs, expression.cs, linq.cs,
6160 typemanager.cs: A refactoring of params arguments to reuse existing
6161 expressions (params -> array initializer) to emit params argument instead
6162 of specialized handling.
6163 It was required by expression tree implementation and it has other benefits
6164 as well, we now apply same optimization for params arguments as we do for
6167 2008-01-18 Marek Safar <marek.safar@gmail.com>
6169 A fix for bug #353526
6170 * generic.cs: A type inference of params arguments may not required any
6171 temporary array creation.
6173 2008-01-18 Marek Safar <marek.safar@gmail.com>
6175 A fix for bug #353534
6176 * generic.cs, ecore.cs, expression.cs: A method group type inference is
6177 supported for delegates only.
6179 2008-01-18 Marek Safar <marek.safar@gmail.com>
6181 * generic.cs: Fixed 3.0 type inference fixing phase to determine a unique
6182 type for more than 1 candidates.
6184 2008-01-18 Marek Safar <marek.safar@gmail.com>
6186 * typemanager.cs, ecore.cs, expression.cs: Implemented ArrayLength and Call
6189 2008-01-16 Marek Safar <marek.safar@gmail.com>
6191 * generic.cs, typemanager.cs, lambda.cs, parameter.cs, ecore.cs, constant.cs,
6192 expression.cs: Implemented Add, And, AndAlso, and ArrayIndex (without unary
6193 operator) expressions.
6195 2008-01-16 Zoltan Varga <vargaz@gmail.com>
6197 * statement.cs: Avoid declaring an IL variable for this_variable since it is
6198 not accessed from the generated IL.
6200 2008-01-14 Marek Safar <marek.safar@gmail.com>
6202 * typemanager.cs, lambda.cs, parameter.cs, ecore.cs, class.cs, delegate.cs,
6203 iterators.cs, convert.cs, assign.cs, anonymous.cs, expression.cs,
6204 statement.cs: The first expression tree implementation drop, mostly
6205 infrastructure work.
6207 2008-01-14 Marek Safar <marek.safar@gmail.com>
6209 * ecore.cs (IsNestedChild): Refactored.
6211 2008-01-11 Marek Safar <marek.safar@gmail.com>
6213 * lambda.cs: Don't use a cast on unknown expression statement.
6215 2008-01-10 Geoff Norton <gnorton@novell.com>
6217 * cs-tokenizer.cs: One more token to distinguish between method and lambda
6220 2008-01-09 Marek Safar <marek.safar@gmail.com>
6222 * doc.cs: Report better /doc crash details.
6224 2008-01-09 Marek Safar <marek.safar@gmail.com>
6226 A fix for bug #352536
6227 * ecore.cs, assign.cs, codegen.cs: Check event assignments.
6229 2008-01-08 Marek Safar <marek.safar@gmail.com>
6231 A fix for bug #352287
6232 * ecore.cs, expression.cs: Do `this' access checking in all member access
6235 2008-01-08 Marek Safar <marek.safar@gmail.com>
6237 * rootcontext.cs, driver.cs: Switch to linq mode by default.
6239 * report.cs: Reset message stacks.
6241 2008-01-08 Marek Safar <marek.safar@gmail.com>
6243 * generic.cs (InferInPhases): Correctly calculate params position.
6245 2008-01-08 Marek Safar <marek.safar@gmail.com>
6247 * cs-tokenizer.cs: No need to parse full string when parsing lambda
6250 2008-01-07 Marek Safar <marek.safar@gmail.com>
6252 * cs-tokenizer.cs: Enabled lambda arguments micro-parser for all profiles.
6254 * decl.cs (LookupNamespaceOrType): Don't cache names which caused an error.
6256 * driver.cs: Updated --help option.
6258 2008-01-07 Marek Safar <marek.safar@gmail.com>
6260 * generic.cs (InferParamsTypeArguments): Removed.
6261 (InferInPhases): Add params type inference.
6262 (LowerBoundInference): Fixed scoring mechanism.
6264 * cs-tokenizer.cs (PreProcessPragma): Use Location instead of line.
6266 2008-01-06 Gert Driesen <drieseng@users.sourceforge.net>
6268 * typemanager.cs: On 2.0 profile, GetPublicKeyToken returns an empty
6269 byte array for unsigned "baked" assemblies.
6271 2008-01-05 Gert Driesen <drieseng@users.sourceforge.net>
6273 * codegen.cs: AssemblyName.GetPublicKey returns a zero-length byte
6274 array for assemblies that are not strongnamed.
6276 2008-01-04 Marek Safar <marek.safar@gmail.com>
6278 A fix for bug #351481
6279 * expression.cs (MemberAccess.ResolveNamespaceOrType): Use correct
6280 declaring type for nested generic types.
6282 2008-01-04 Marek Safar <marek.safar@gmail.com>
6284 * namespace.cs, class.cs, decl.cs, cs-parser.jay: Use GetSignatureForError
6285 instead of ToString.
6287 2008-01-03 Marek Safar <marek.safar@gmail.com>
6289 A fix for bug #351047
6290 * expression.cs (Binary.ResolveOperator): Allow equality operators between
6291 null and structs only when equality and inequality operators are defined
6292 either as an user-operators or predefined operators.
6294 2008-01-03 Marek Safar <marek.safar@gmail.com>
6296 A fix for bug #351047
6297 * generic.cs, typemanager.cs, class.cs: New IsReferenceType helper method.
6299 2008-01-03 Marek Safar <marek.safar@gmail.com>
6301 A fix for bug #351257
6302 * cs-tokenizer.cs: Advance line number for '\r' correctly.
6304 2008-01-03 Marek Safar <marek.safar@gmail.com>
6306 A fix for bug #351157
6307 * class.cs (Using): Fixed yet another broken cloning.
6309 (Block): Put back more sensible default value for statements.
6311 2008-01-01 Gert Driesen <drieseng@users.sourceforge.net>
6313 * codegen.cs: Allow AssemblyVersion with only major version component.
6316 2007-12-29 Marek Safar <marek.safar@gmail.com>
6318 A fix for bug #324654
6319 * class.cs: Use FullName property as member name.
6321 2007-12-28 Marek Safar <marek.safar@gmail.com>
6323 A fix for bug #342117
6324 * generic.cs (ConstraintChecker): Struct constraint also satisfies default
6325 constructor constraint.
6327 2007-12-28 Marek Safar <marek.safar@gmail.com>
6329 A fix for bug #338273
6330 * class.cs (ProbertyBase): Access modifier checks are required for overrides
6333 2007-12-28 Marek Safar <marek.safar@gmail.com>
6335 A fix for bug #350839
6336 * ecore.cs (MethodroupExpr): Probing hacks are no longer required.
6338 2007-12-27 AdTsai (http://code.google.com/u/AdTsai/)
6340 Reviewed by Ben Maurer, Miguel de Icaza, patches from Google's
6343 http://code.google.com/p/google-highly-open-participation-mono/issues/detail?id=4
6345 * statement.cs: Changed some Hashtables to use HybridDictionaries
6346 instead. It was observed that some HashTables only contained a few
6347 items in the vast majority of cases. Since HybridDictionary is
6348 more efficient on small sets (<10 elements), "known_variables"
6349 from class ExplicitBlock as well as "labels" and "constants " from
6350 class Block were changed to HybridDictionaries.
6352 Atsai results: (56216kb->54987kb)
6354 Miguel results (bootstrap of mcs): 59819kb -> 59290kb
6357 2007-12-27 AdTsai (http://code.google.com/u/AdTsai/)
6359 Reviewed by Ben Maurer, Miguel de Icaza, patches from Google's
6362 http://code.google.com/p/google-highly-open-participation-mono/issues/detail?id=4
6364 * expression.cs: foreach loop to for loop, saved on allocation of
6365 enumerator (59333kb->59141kb)
6367 * statement.cs. Changed foreach loops to for loops, saved on
6368 allocation of enumerator (59141kb->59006kb)
6370 * decl.cs: ArrayLists in .NET 1.1 allocate 16 elements by default
6371 when constructed with no specified capacity. This was causing a
6372 few ArrayLists to allocate more memory than they would potentially
6373 need in the Block class and MemberCache class. Setting the
6374 ArrayLists to construct with a capacity of 1 saves some
6375 memory. (56216kb->55585kb)
6377 2007-12-27 Marek Safar <marek.safar@gmail.com>
6379 A fix for bug #347189 (2nd issue)
6380 * expression.cs (MemberAccess): Nested type can be found in base non-generic
6383 2007-12-27 Miguel de Icaza <miguel@novell.com>
6385 * report.cs: Do not use colors if stdout and stderr are not a
6388 2007-12-27 Marek Safar <marek.safar@gmail.com>
6390 A fix for bug #346998
6391 * ecore.cs (MethodGroupExpr): Implemented override filter for generic
6394 2007-12-27 Marek Safar <marek.safar@gmail.com>
6396 A fix for bug #343465
6397 * class.cs: Explicit method name for nested types uses dots only.
6399 2007-12-27 Marek Safar <marek.safar@gmail.com>
6401 A fix for bug #343707
6402 * cs-tokenizer.cs: Advance line number for mixed CR/LF files correctly.
6404 2007-12-27 Marek Safar <marek.safar@gmail.com>
6406 * ecore.cs: Report type inference errors only when arguments count matches
6409 * generic.cs (NullCoalescingOperator): Cannot be applied to null.
6411 * expression.cs, report.cs: New warning.
6413 * typemanager.cs: Catch anonymous method type too.
6415 2007-12-23 Marek Safar <marek.safar@gmail.com>
6417 A fix for bug #346379
6418 * expression.cs (UnaryMutator): Emit size of type for pointer mutator.
6420 2007-12-23 Marek Safar <marek.safar@gmail.com>
6422 A fix for bug #347359
6423 * expression.cs (Invocation): Don't resolve already resolved expression.
6425 2007-12-23 Marek Safar <marek.safar@gmail.com>
6427 A fix for bug #347189
6428 * class.cs (FixedField): Use non-dependent code only in the define phase.
6430 2007-12-23 Marek Safar <marek.safar@gmail.com>
6432 A fix for bug #348076
6433 * ecore.cs (FieldExpr.DoResolve): Allow any variable based expression.
6435 2007-12-22 Marek Safar <marek.safar@gmail.com>
6437 * ecore.cs (MethodGroupExpr.OverloadResolve): Set type arguments for
6438 discovered extension methods.
6440 2007-12-22 Marek Safar <marek.safar@gmail.com>
6442 * ecore.cs, namespace.cs, expression.cs: Removed broken ResolveGeneric
6445 2007-12-21 Miguel de Icaza <miguel@novell.com>
6447 * report.cs (ErrorMessage): Add support for using colors on
6448 terminals that support it.
6450 2007-12-21 Marek Safar <marek.safar@gmail.com>
6452 * ecore.cs: Use information about expanded params for error reporting.
6454 2007-12-21 Marek Safar <marek.safar@gmail.com>
6456 * ecore.cs, generic.cs, delegate.cs: Refactoring of method overloading code
6457 and logic for params overloads.
6459 2007-12-15 Miguel de Icaza <miguel@novell.com>
6461 * generic.cs (NullCoalescingOperator.CloneTo): implement this one,
6462 as this is also created from the parser. Fixes #349034
6464 2007-12-12 Miguel de Icaza <miguel@novell.com>
6466 * statement.cs (Throw.CloneTo): it is valid to have empty
6467 expressions for throw.
6469 2007-12-03 Marek Safar <marek.safar@gmail.com>
6471 * cs-parser.jay: Set delegate constraint parsing region correctly.
6473 2007-12-03 Marek Safar <marek.safar@gmail.com>
6475 A fix for bug #345467
6476 * typemanager.cs (IsEqual): Compare generic parameters position only.
6478 2007-11-28 Marek Safar <marek.safar@gmail.com>
6480 * expression.cs (BaseAccess): Type arguments can be null.
6482 2007-11-27 Raja R Harinath <harinath@gmail.com>
6484 * statement.cs (Block.Resolve): Ensure flow-branching tree is
6485 consistent even when an error has occured.
6486 (Switch.Resolve): Likewise.
6488 2007-11-22 Marek Safar <marek.safar@gmail.com>
6490 A fix for bug #334505
6491 * class.cs: Don't ignore InternalsVisibleTo attribute for internal
6494 2007-11-22 Marek Safar <marek.safar@gmail.com>
6496 * ecore.cs, typemanager.cs, delegate.cs, expression.cs: The first of
6497 refactorings required to resolve extension methods correctly when mixing
6498 generics and non-generics members.
6500 2007-11-20 Marek Safar <marek.safar@gmail.com>
6502 A fix for bug #342584
6503 * convert.cs: Added not documented explicit IntPtr/UIntPtr to enum
6506 2007-11-19 Marek Safar <marek.safar@gmail.com>
6508 A fix for bug #342512
6509 * delegate.cs: Use delegate argument expression when is available. Don't
6510 emit virtual call when class is sealed.
6512 2007-11-16 Marek Safar <marek.safar@gmail.com>
6514 A fix for bug #325423
6515 * assign.cs (FieldInitializer): Use resolved expression for emit.
6517 * class.cs: Print less confusing error message.
6519 2007-11-16 Marek Safar <marek.safar@gmail.com>
6521 * cs-tokenizer.cs: Removed GMCS ifdefs.
6523 * rootcontext.cs, report.cs: Report unavailable gmcs features used by
6526 * cs-parser.jay: Disabled nullable check.
6528 * generic-mcs: Copied more generic stuff.
6530 2007-11-16 Marek Safar <marek.safar@gmail.com>
6532 * gcs-parser.jay: Merged to cs-parser.jay.
6534 * generic.cs, typemanager.cs, cs-tokenizer.cs, linq.cs, Makefile
6535 * *.csproj, *.sources: Updated to use only jay parser file.
6537 2007-11-16 Marek Safar <marek.safar@gmail.com>
6539 * gcs-parser.jay: Added nullable and default expression feature checks.
6541 2007-11-16 Marek Safar <marek.safar@gmail.com>
6543 * gcs-parser.jay, cs-parser.jay, class.cs: Unified parameters parsing,
6544 it fixes many TODOs and hidden bugs.
6546 * expression: Removed duplicate error check.
6548 2007-11-15 Marek Safar <marek.safar@gmail.com>
6550 * gcs-parser.jay, statement.cs, decl.cs, ecore.cs: Try to resolve an
6551 implicitly type local variable only when it is used in a declaration.
6553 2007-11-15 Marek Safar <marek.safar@gmail.com>
6555 * attribute.cs: Use CS0612 for empty strings.
6557 2007-11-14 Marek Safar <marek.safar@gmail.com>
6559 * lambda.cs, statement.cs: Contextual return may act as a statement.
6561 2007-11-14 Marek Safar <marek.safar@gmail.com>
6563 A fix for a regression cause by #324222
6564 * class.cs: Don't report unused even when it implements an interface.
6566 2007-11-13 Marek Safar <marek.safar@gmail.com>
6568 A fix for bug #341205
6569 * ecore.cs, expression.cs: Method group expression cannot do static
6570 method access with an instance reference check before overloading takes
6573 2007-11-13 Marek Safar <marek.safar@gmail.com>
6575 A fix for bug #325359
6576 * class.cs: Use predictable name for automatically generated property.
6578 2007-11-12 Marek Safar <marek.safar@gmail.com>
6580 A fix for bug #324996
6581 * expression.cs (Is): Handle case where D is nullable and T is not
6584 * generics.cs (Nullable.HasValue): Nullable HasValue expression.
6586 2007-11-12 Marek Safar <marek.safar@gmail.com>
6588 * generic.cs, literal.cs, ecore.cs, class.cs, delegate.cs, const.cs,
6589 anonymous.cs, expression.cs, attribute.cs, codegen.cs, statement.cs:
6590 Flush small error reporting changes.
6592 2007-11-09 Marek Safar <marek.safar@gmail.com>
6594 A fix for bug #324996
6595 * expression.cs: Rewrote Is expression implementation to work with
6596 generics, nullable types, anonymous method. A const result expression
6597 uses existing infrastructure instead of custom not fully-featured one.
6599 2007-11-08 Marek Safar <marek.safar@gmail.com>
6601 A fix for bug #340202
6602 * class.cs: Consider generics for volatile field.
6604 2007-11-08 Marek Safar <marek.safar@gmail.com>
6606 A fix for bug #335594
6607 * expression.cs: Use conversion rules when handling string addition.
6609 2007-11-07 Marek Safar <marek.safar@gmail.com>
6611 A fix for bug #336651
6612 * expression.cs: Fixed a crash when probing is on.
6614 2007-11-07 Marek Safar <marek.safar@gmail.com>
6616 A fix for bug #324242
6617 * covert.cs: Added a conversion from any nullable-type with an
6618 underlying enum-type to the type System.Enum.
6620 2007-11-07 Marek Safar <marek.safar@gmail.com>
6622 A fix for bug #324222
6623 * class.cs: Report all non-used event fields.
6625 2007-11-07 Marek Safar <marek.safar@gmail.com>
6627 A fix for bug #325161
6628 * cs-parser.jay, gcs-parser.jay, decl.cs: Implemented namespace alias
6629 qualifier for generic types.
6631 2007-11-07 Marek Safar <marek.safar@gmail.com>
6633 A fix for bug #322971
6634 * expression.cs, ecore.cs: Added intermediate result value check for
6637 2007-11-07 Marek Safar <marek.safar@gmail.com>
6639 A fix for bug #324754
6640 * cs-parser.jay, gcs-parser.jay, class.cs: Try to create an interator
6641 when it was requested.
6643 2007-11-07 Marek Safar <marek.safar@gmail.com>
6645 A fix for bug #325101
6646 * expression.cs: Do type not value comparison for `is' expression.
6648 2007-11-07 Marek Safar <marek.safar@gmail.com>
6650 A fix for bug #320236
6651 * convert.cs: Don't apply user conversion on underlying target type.
6653 2007-11-06 Marek Safar <marek.safar@gmail.com>
6655 * expression.cs: Don't use unresolved expression for error reporting.
6657 2007-11-06 Marek Safar <marek.safar@gmail.com>
6659 A fix for bugs #337712, #324490
6660 * ecore.cs (MethodGroupExpr): Refactored to handle delegate method
6661 overloading resolution too.
6663 * delegate.cs: Uses MethodGroupExpr for overloading resolution. It makes
6664 the process consistent and more robust.
6666 * expression.cs, linq.cs, report.cs: Update.
6668 2007-11-02 Marek Safar <marek.safar@gmail.com>
6670 A fix for bug #332909
6671 * attribute.cs: Resolve attributes in correct context using error
6674 * rootcontext.cs: Define Obsolete attribute members as core members.
6676 2007-11-02 Marek Safar <marek.safar@gmail.com>
6678 * statement.cs: Removed unused methods.
6680 2007-10-31 Wade Berrier <wberrier@novell.com>
6682 * Makefile: reenable copy of gmcs.exe.config, but include it in EXTRA
6683 DIST (it doesn't get included because PROGRAM isn't defined to be gmcs
6686 2007-10-31 Marek Safar <marek.safar@gmail.com>
6688 A fix for bug #338102
6689 * decl.cs (CheckExistingMembersOverloads): Workaround issue with generic
6690 methods registered as non-generics.
6692 2007-10-31 Marek Safar <marek.safar@gmail.com>
6694 A fix for bugs #337712, #324490
6695 * delegate.cs: Delegate covariance and contravariance is not allowed for
6698 2007-10-31 Marek Safar <marek.safar@gmail.com>
6700 A fix for bug #337719
6701 * cs-tokenizer.cs: Restore identifier buffer when parsing contextual
6704 2007-10-30 Marek Safar <marek.safar@gmail.com>
6706 * Makefile (net_2_0_bootstrap/mcs.exe.config): Reverted copy gmcs.exe.config.
6708 2007-10-29 Marek Safar <marek.safar@gmail.com>
6710 * cs-tokenizer.cs, gcs-parser.jay, driver.cs: Fixed parsing of nested
6713 2007-10-29 Raja R Harinath <rharinath@novell.com>
6715 * Makefile (net_2_0_bootstrap/mcs.exe.config): Copy gmcs.exe.config.
6717 2007-10-29 Marek Safar <marek.safar@gmail.com>
6719 A fix for bug #334652
6720 * ecore.cs (MethodGroupExpr.OverloadResolve): Do also lookup for
6721 extension methods when we have not found the best candidate in normal
6724 2007-10-27 Marek Safar <marek.safar@gmail.com>
6726 * AssemblyInfo.cs: Keep up-to-date.
6728 2007-10-27 Marek Safar <marek.safar@gmail.com>
6730 * Makefile: Fixed generics compiler name.
6732 2007-10-27 Marek Safar <marek.safar@gmail.com>
6734 * lambda.test: removed, lambda parsing is done differently.
6736 * gen-il.cs, gen-treedump.cs, old-code.cs : Obsolete.
6738 2007-10-27 Gert Driesen <drieseng@users.sourceforge.net>
6740 * Makefile: Removed dependency on gmcs.exe.config. Fixes build.
6742 2007-10-27 Marek Safar <marek.safar@gmail.com>
6744 * Makefile, *.sources : All C# compilers are in mcs folder.
6746 * *.cs: Use existing 2_1 define for smcs.
6748 2007-10-26 Marek Safar <marek.safar@gmail.com>
6750 A fix for bug #335847
6751 * assign.cs, expression.cs: Couple of changes to avoid creating a
6752 temporary variable for each object initializer assignment statement. It
6753 simplifies struct initialization too, otherwise two temporary variables
6755 Implemented optimization of redundant default element initializers.
6757 2007-10-25 Marek Safar <marek.safar@gmail.com>
6759 A fix for bug #336766
6760 * expression.cs (Class.CheckBase): Use generic name when method is
6763 2007-10-25 Marek Safar <marek.safar@gmail.com>
6765 A fix for bug #334737
6766 * expression.cs (IndexerAccess.EmitAssign): Emit local temporary
6767 variable and not variable argument for prepared copies.
6769 2007-10-24 Marek Safar <marek.safar@gmail.com>
6771 A fix for bug #325110
6772 * class.cs, expression.cs, attribute.cs: Use open generic method when
6773 checking conditional attribute.
6775 2007-10-24 Marek Safar <marek.safar@gmail.com>
6777 * report.cs, cs-tokenizer.cs, class.cs, cs-parser.jay, anonymous.cs,
6778 expression.cs, statement.cs: Renamed method FeatureIsNotISO to
6779 FeatureIsNotAvailable.
6781 2007-10-24 Marek Safar <marek.safar@gmail.com>
6783 ** C# 3.0 Partial methods
6785 * cs-tokenizer.cs, support.cs, class.cs, decl.cs: Implemented partial
6786 methods support. Because of member cache issue with generics only
6787 non-generics partial methods are fully supported.
6789 2007-10-23 Marek Safar <marek.safar@gmail.com>
6791 * class.cs, decl.cs: Rewrote member overloads check to cope with
6792 generics and to use member cache for member checking. It also improves
6793 performance and fixes remaining overloads issues.
6795 2007-10-20 Marek Safar <marek.safar@gmail.com>
6797 * class.cs, const.cs, decl.cs, delegate.cs, enum.cs, generic.cs,
6798 roottypes.cs, typemanager.cs:
6800 A member cache creation logic changed to add members immediately and
6801 not rely on fallback. The member cache is now only prefered way
6802 how to access and find type declaration members. It saves 5 MB of memory
6803 during MWF compilation and makes code ready for more optimizations and
6804 clean-ups, it's also a pre-requirement for partial methods.
6806 2007-10-18 Raja R Harinath <harinath@gmail.com>
6808 * ecore.cs (Expression.Error_ValueCannotBeConverted): Add special
6809 handling for generic parameters.
6811 2007-10-15 Marek Safar <marek.safar@gmail.com>
6813 * class.cs (FixedField): Removed redundant volatile check.
6815 2007-10-15 Marek Safar <marek.safar@gmail.com>
6817 * class.cs, decl.cs: Fixed overload members verification to do only one
6818 check per possible collision.
6820 2007-10-13 Marek Safar <marek.safar@gmail.com>
6822 A fix for bug #325478
6823 * anonymous.cs (AnonymousContainer.Compatible): Merge are flags together
6824 and create only one disposable flags container.
6826 2007-10-12 Marek Safar <marek.safar@gmail.com>
6828 A fix for bug #332442 by Alexandre Gomes <alexmipego@gmail.com>
6829 * statement.cs (Fixed): Fixed variables cloning.
6831 2007-10-12 Marek Safar <marek.safar@gmail.com>
6833 A fix for bug #333342
6834 * class.cs (EventField): Don't mark value type event as synchronized.
6836 2007-10-12 Marek Safar <marek.safar@gmail.com>
6838 * ecore.cs, anonymous.cs (MethodGroupExpr): Use score from type
6839 inference to identify best candidate method correctly.
6840 (ProperyExpr): A range variable is read only and cannot be modified.
6842 2007-10-11 Marek Safar <marek.safar@gmail.com>
6844 * ecore.cs, delegate.cs (MethodGroupExpr): Refactored best candidate
6845 logic to identify best candidate method correctly.
6847 2007-10-11 Marek Safar <marek.safar@gmail.com>
6849 * location.cs (Equals, GetHashCode): Removed.
6851 2007-10-11 Marek Safar <marek.safar@gmail.com>
6853 * report.cs: Implemented message recorder. It is used mainly for lambda
6854 expressions to capture otherwise swallowed error messages.
6856 * anonymous.cs, lambda.cs.cs: Do full parameters check.
6858 * ecore.cs (ExtensionMethodGroup): Report binding failure at the botton
6860 (MethodGroupExpr.DoResolve): Use message recorder for error handling.
6862 * expression.cs (MemberAccess): Always report lookup failure.
6864 * location.cs: Implemented Equals, GetHashCode.
6866 * statement.cs (Return.DoResolve): Fixed hardcoded error argument.
6868 2007-10-10 Jb Evain <jbevain@novell.com>
6870 * codegen.cs: re-enable assembly version check.
6872 2007-10-09 Marek Safar <marek.safar@gmail.com>
6874 * report.cs, anonymous.cs, driver.cs, expression.cs: Added few ISO-2
6877 * namespace.cs (UsingAlias): Do correct version check.
6879 2007-10-08 Marek Safar <marek.safar@gmail.com>
6881 * expresison.cs, ecore.cs: Issue extension method error message when
6884 * rootcontext.cs: Added ISO_2 compiler mode option.
6886 2007-10-08 Marek Safar <marek.safar@gmail.com>
6888 * expresison.cs (UnaryMutator.ResolveOperator): Print more useful error
6891 2007-10-08 Marek Safar <marek.safar@gmail.com>
6893 * attribute.cs (GetString, GetBoolean): Work with both literal and
6896 * ecore.cs, expresison.cs, delegate.cs (Invocation, MethodGroupExpr):
6897 Moved method overload specific methods to MethodGroupExpr.
6899 (IndexerAccess): Re-wrote resolving mechanism, fixed many issues and
6900 it should be less memory consuming.
6902 Mon Oct 8 09:29:15 CEST 2007 Paolo Molaro <lupus@ximian.com>
6904 * codegen.cs: remove the assembly version check until the buildbot is
6907 2007-10-07 Jb Evain <jbevain@novell.com>
6909 * attribute.cs (Attribute.GetString): if the value
6910 expression is a StringConstant, return its string value.
6912 2007-10-07 Jb Evain <jbevain@novell.com>
6914 * typemanager.cs: add `assembly_version_attribute_type`.
6915 * codegen.cs: on attribute emission, check that the
6916 AssemblyVersionAttribute doesn't overflow.
6918 2007-10-05 Marek Safar <marek.safar@gmail.com>
6920 A fix for bug #324677
6921 * anonymous.cs, decl.cs: Yes another anonymous container hack. Overwrite
6922 parent container of a scope container with currently resolved one.
6924 2007-10-05 Marek Safar <marek.safar@gmail.com>
6926 A fix for bug #325534
6927 * class.cs (Invocation.DoResolve): Check invocation of object finalizer
6930 2007-10-05 Marek Safar <marek.safar@gmail.com>
6932 A fix for bug #327504
6933 * class.cs (Operator.Define): Refactored implicit and explicit user
6934 operator conversion rules.
6936 2007-10-05 Marek Safar <marek.safar@gmail.com>
6938 A fix for bug #327520
6939 * ecore.cs (ExtensionMethodGroupExpr): Emit resolved extension argument.
6941 2007-10-04 Marek Safar <marek.safar@gmail.com>
6943 A fix for bug #328022
6944 * class.cs (MethodData.Define): Use correct method to check whether
6945 a method implementents an accessor.
6947 2007-10-04 Marek Safar <marek.safar@gmail.com>
6949 A fix for bug #330069
6950 * statement.cs (Fixed.Resolve): Read the first array element only when
6951 an array is instantiated.
6953 2007-10-04 Marek Safar <marek.safar@gmail.com>
6955 * expression.cs, assign.cs, generics.cs: Print correct operator when
6956 compound assignment is used.
6958 2007-10-04 Marek Safar <marek.safar@gmail.com>
6960 A fix for bug #325841
6961 * expression.cs (ArrayAccess): Use full argument cloning only for
6962 string compound concatenation.
6964 2007-10-03 Marek Safar <marek.safar@gmail.com>
6966 A fix for bug #328774
6967 * ecore.cs (FieldExpr.EmitAssign): Fixed string concatenation compound
6969 (PropertyExpr.EmitAssign): Fixed string concatenation compound
6972 2007-10-03 Raja R Harinath <rharinath@novell.com>
6975 * ecore.cs (SimpleName.DoSimpleNameResolve): Handle Property and
6976 Event accessibility checks here. Remove some bogus code that
6977 accidently made GenericMethods work.
6978 (PropertyExpr.IsAccessibleFrom, EventExpr.IsAccessibleFrom): New.
6980 2007-09-25 Marek Safar <marek.safar@gmail.com>
6982 * expression.cs (ArrayCreation): Fixed cloning of an implicit types.
6984 * statement.cs (Block): Refactored AddVariable to allow error handling
6987 * generic.cs: New stub.
6989 2007-09-23 Marek Safar <marek.safar@gmail.com>
6991 * anonymous.cs, codegen.cs: Changed InferReturnType to be EmitContext
6994 2007-09-17 Marek Safar <marek.safar@gmail.com>
6996 * class.cs: Use partial container to record whether any partial part
6997 contains static field initializer and therefore default contructor has
7000 2007-09-14 Marek Safar <marek.safar@gmail.com>
7002 * class.cs (TypeContainer.AddPartial): Fixed an issue reported on
7003 mono-list when only one of two partial parts has defined accessibility
7006 2007-09-14 Marek Safar <marek.safar@gmail.com>
7008 A fix for bug #82845
7010 * class.cs (TypeContainer): Set correct resolve context for all field
7013 2007-09-13 Marek Safar <marek.safar@gmail.com>
7015 * assign.cs: Fixed a crash when field is resolved twice with an error.
7017 * codegen.cs: Changed InFieldInitializer to be flag.
7019 * anonymous.cs, ecore.cs, expression.cs: Update after
7020 IsInFieldInitializer rename.
7022 * const.cs: Removed unused parameter.
7024 * class.cs: Changed the way how we resolve and emit field initializers.
7025 The field initilizers have to have access to contructor block to emit
7026 compiler generated code.
7028 2007-09-13 Marek Safar <marek.safar@gmail.com>
7030 * expression.cs (MemberAccess.DoResolve): DeclSpace is broken by
7031 generics use TypeContainer instead.
7033 2007-09-12 Marek Safar <marek.safar@gmail.com>
7035 * generic.cs (TypeInferenceContext.InflateGenericArgument): Stub.
7037 * lambda.cs (ResolveParameters): Use more powerful
7038 InflateGenericArgument.
7040 * parameters.cs: Better exception message.
7042 2007-09-10 Marek Safar <marek.safar@gmail.com>
7044 * anonymous.cs (AnonymousMethodExpression.CompatibleChecks): Report
7045 correct expression block type.
7047 * ecore.cs (Expression.Error_MemberLookupFailed): Made virtual.
7049 * expression.cs (Invocation): Extracted method group resolve to
7052 2007-09-07 Marek Safar <marek.safar@gmail.com>
7054 * ecore.cs (Expression.MemberLookupFinal): Removed unused loc parameter.
7055 (MethodGroupExpr.ResolveGeneric): Use existing method group instance.
7057 * expression.cs (MemberAccess.DoResolve): Uses generic resolver for
7058 generic extension methods.
7060 2007-09-06 Marek Safar <marek.safar@gmail.com>
7062 A fix for bug #82676 (Do I get it right now?)
7063 * convert.cs (Binary.ResolveOperator): An interface is converted to the
7064 object before a standard conversion is applied.
7066 2007-09-06 Marek Safar <marek.safar@gmail.com>
7068 * convert.cs (ImplicitReferenceConversionCore): Reverted wrong fix of
7071 2007-09-05 Marek Safar <marek.safar@gmail.com>
7073 A fix for bug #82676
7074 * convert.cs (ImplicitReferenceConversionCore): Check both sides for
7075 non-generic interface types.
7077 2007-09-05 Marek Safar <marek.safar@gmail.com>
7079 A fix for bug #82690
7080 * ecore.cs (PropertyExpr.EmitAssign): Leave a copy does just that.
7082 2007-09-05 Marek Safar <marek.safar@gmail.com>
7084 A fix for bug #82571
7085 * anonymous.cs (AnonymousMethod.DoCreateMethodHost): Use internal
7086 modifier for container based methods.
7088 2007-09-05 Marek Safar <marek.safar@gmail.com>
7090 A fix for bug #82676
7091 * convert.cs (ImplicitReferenceConversionCore): From any class-type S to
7092 any interface-type T means to any of interface type T.
7094 2007-09-04 Marek Safar <marek.safar@gmail.com>
7096 * namespace.cs: We have 2 versions of System.Core assembly.
7098 2007-09-04 Marek Safar <marek.safar@gmail.com>
7100 A fix for bug #82652
7101 * class.cs (Class.GetClassBases): Compare types and not expressions.
7103 2007-09-04 Marek Safar <marek.safar@gmail.com>
7105 A fix for bug #82620
7106 * expression.cs (Invocation.EmitArguments): Duplicate params arguments
7107 actually never worked before.
7108 (IndexerAccess): Emit prepared arguments before they are modified.
7110 2007-09-04 Marek Safar <marek.safar@gmail.com>
7112 A fix for bug #82563
7113 * assign.cs: Revert wrong fix.
7115 * expression.cs (VariableReference.EmitAssign): Handle ref reference
7117 (ArrayAccess): Changed the way we emit compound (prepared) assignments.
7118 Instead of ldelema/stdind we have to use temporary variables to handle
7119 cases like String.Concat (params string[]).
7121 2007-08-31 Marek Safar <marek.safar@gmail.com>
7123 * class.cs: EmitAttributes to Emit rename.
7125 * decl.cs (MemberCore.GetClsCompliantAttributeValue): Parent can be
7127 (MemberCore.HasClsCompliantAttribute): Don't depend on
7128 GetClsCompliantAttributeValue execution.
7130 2007-08-31 Marek Safar <marek.safar@gmail.com>
7132 * anonymous.cs: Use shorter type prefix.
7134 * ecore.cs (SimpleName.DoSimpleNameResolve): Use transparent identifiers
7137 * expression.cs (LocalVariableReference.DoResolveBase): Don't capture
7138 variables when probing is on.
7140 * statement.cs (LocaLInfo.Clone): Clone correctly resolved and
7141 unresolved variables.
7142 (TopLevelBlock.GetTransparentIdentifier): Default implementation doesn't
7143 handle transparent identifiers.
7145 2007-08-26 Marek Safar <marek.safar@gmail.com>
7147 * attribute.cs (IsClsCompliant): Add nullable types test.
7149 2007-08-24 Atsushi Enomoto <atsushi@ximian.com>
7151 * doc.cs : catch other types of exception than XmlException to
7152 report CS1570. Fixed bug #82565.
7154 2007-08-23 Marek Safar <marek.safar@gmail.com>
7156 * anonymous.cs (AnonymousMethodExpressin.ExplicitTypeInference):
7157 The number of delegate parameters has to match.
7158 (AnonymousMethodExpressin.VerifyParameterCompatibility): Handles generic
7161 2007-08-21 Marek Safar <marek.safar@gmail.com>
7163 * anonymous.cs (AnonymousMethod): Generate private anonymous method
7164 to fix problem with private arguments.
7166 2007-08-20 Marek Safar <marek.safar@gmail.com>
7168 * anonymous.cs (AnonymousTypeClass): An anonymous type can be empty.
7170 * decl.cs (MemberName): Ignore generic type with no generic arguments.
7172 * expression.cs (AnonymousTypeDeclaration): An anonymous type can be
7173 empty. Add cloning suport.
7175 * roottypes.cs (GetAnonymousType): Fixed argument comparison logic.
7177 2007-08-20 Marek Safar <marek.safar@gmail.com>
7179 * convert.cs, ecore.cs, expression.cs, literal.cs: Use factory method
7180 to create EmptyCast. It handles EmptyConstantCast specialization for
7183 2007-08-18 Marek Safar <marek.safar@gmail.com>
7185 * expression.cs (Binary.is_unsigned): Handle unsafe types too.
7186 (EmitArrayArgument): One routine for array arguments.
7187 (ArrayCreation.MakeByteBlob): Fixed an array alignment.
7189 2007-08-17 Marek Safar <marek.safar@gmail.com>
7191 * cs-tokenizer.cs (GetKeyword): Handle from keyword in a different way.
7193 2007-08-17 Marek Safar <marek.safar@gmail.com>
7195 * anonymous.cs: MemberLookupFinal update.
7197 * class.cs (ConstructorInitializer): Is expression based.
7199 * delegate.cs: MethodGroupExpr update.
7201 * ecore.cs (Error_MemberLookupFailed): Improved to report better error
7203 (Error_MemberLookupFailed): Customizable error override.
7204 (MethodGroupExpr): Keep queried type for later usage.
7205 (MethodGroupExpr.OverloadResolve): Catch errors related to overload
7208 * expression.cs: Error_MemberLookupFailed refactoring.
7209 (New.DoResolve): Resolve as much as possible.
7210 (ElementInitializer.Error_MemberLookupFailed): Object initializer
7211 customization for invalid member types.
7213 * statement.cs: MethodGroupExpr update.
7215 2007-08-16 Marek Safar <marek.safar@gmail.com>
7217 * modifier.cs (Check): Check all modifiers and not only accessibility
7220 2007-08-16 Marek Safar <marek.safar@gmail.com>
7222 * ecore.cs (Expression.Error_ValueCannotBeConverted): Report always a
7223 type and not an expression.
7225 2007-08-16 Marek Safar <marek.safar@gmail.com>
7227 * statement.cs (Catch.Clone): Type and variable can be null.
7229 2007-08-16 Marek Safar <marek.safar@gmail.com>
7231 A fix for bug #81979
7232 * assign.cs (Assign.Emit): Prepare arguments for string concatenation.
7233 I am really not sure whether this is the best fix.
7235 * expression.cs (VariableReference.EmitAssign): Do prepare_load test
7238 2007-08-14 Marek Safar <marek.safar@gmail.com>
7240 ** C# 3.0 Object and collection initializers (major re-write)
7242 * assign.cs (DoResolve): Initializers are not assign related.
7244 * codegen.cs (EmitContext.CurrentInitializerVariable): Holds a varible
7245 used during collection or object initialization.
7247 * expression.cs (Error_InvalidArguments): Add initializers specific
7248 messages. More will come later because it requires some general
7250 (New.DoResolve): Better error handling for unsafe types.
7251 (EmptyExpressionStatement): New class.
7252 (ElementInitializer): An object initializer expression.
7253 (CollectionElementInitializer): A collection initializer expression.
7254 (CollectionOrObjectInitializers): A block of object or collection
7256 (NewInitialize): New expression with element/object initializers.
7258 * statement.cs: Reverted object/collection initializer hacks.
7260 * typemanager.cs (CSharpName): Filter __arglist type.
7262 2007-08-09 Marek Safar <marek.safar@gmail.com>
7264 ** C# 3.0 Anonymous Types (update to the latest standard)
7266 * expression.cs (Binary.ResolveOperator): Threat all null based types
7268 (AnonymousTypeDeclaration): Renamed from AnonymousType and simplified.
7269 (AnonymousTypeParameter): Updated.
7271 * anonymous.cs (CompilerGeneratedClass): Add custom name overload.
7272 (AnonymousTypeClass): New anonymous type container.
7274 * class.cs (AddField): Return operation result.
7276 * generic.cs: Another empty TypeArguments overload.
7278 * roottypes.cs (AddAnonymousType, GetAnonymousType): Anonymous types
7279 are stored at top of normal hierarchy.
7281 * typemanager.cs (CSharpName): Filter anonymous types.
7283 2007-08-09 Marek Safar <marek.safar@gmail.com>
7285 * expression.cs (StringConcat.Append): Handle 3 and more concatenation
7286 as single Concat call. How could we miss that :-(
7288 2007-08-08 Marek Safar <marek.safar@gmail.com>
7290 * expression.cs (ArrayCreation.CloneTo): Allocate exact size.
7292 2007-08-07 Miguel de Icaza <miguel@novell.com>
7294 * expression.cs: Fix the previous commit, the creation of the
7295 arguments array list needs also to be conditional on the arguments
7298 * class.cs: Add a little bit of help to help narrow down problems.
7300 * expression.cs (ArrayCreation.CloneTo): Argument can be null, do
7301 not try to copy in that case.
7303 * driver.cs: When building SMCS, include a new different set of
7304 default assemblies here. Do this here so we can control whether
7305 to include the default assemblies with /noconfig.
7307 2007-08-03 Marek Safar <marek.safar@gmail.com>
7309 A fix for bug #81979
7310 * expression.cs (TypeOf.GetAttributableValue): Check for type arguments
7313 2007-08-03 Marek Safar <marek.safar@gmail.com>
7315 A fix for bug #82300
7317 * anonymous.cs (AnonymousContainer.Define): Don't define anything when
7318 we are in probing scope.
7320 2007-08-03 Marek Safar <marek.safar@gmail.com>
7322 A fix for bug #82301
7324 * statement.cs (Catch.CloneTo): Clone blocks in the right order.
7325 (Statement.CloneTo): Clone and not map children blocks.
7327 2007-08-03 Marek Safar <marek.safar@gmail.com>
7329 A fix for bug #82299
7331 * expression.cs (LocalVariableReference.CloneTo): Remap local info
7334 * statement.cs (Statement.CloneTo): Clone variables before statements
7335 to allow remaping of local variables.
7337 2007-08-03 Marek Safar <marek.safar@gmail.com>
7339 A fix for bug #82296
7342 * report.cs: Log crash details for future clone problems.
7344 * statement.cs (Return.Clone): Don't clone non-existent expression.
7346 2007-08-03 Raja R Harinath <harinath@gmail.com>
7348 * class.cs (TypeContainer.AddBasesForPart): Make virtual.
7349 (Class.AddBasesForPart): Move CS0537 check here from ...
7350 * cs-parser.jay (class_declaration): ... here. Move calling of
7351 'AddBasesForPart' to ...
7352 (class_bases): ... here.
7353 (struct_declaration, interface_declaration): Update to changes.
7355 2007-08-02 Marek Safar <marek.safar@gmail.com>
7357 A fix for bug #81923
7359 * statement.cs (Using.ResolveLocalVariableDecls): Only non-user implicit
7360 conversion is allowed.
7362 2007-08-02 Marek Safar <marek.safar@gmail.com>
7364 A fix for bug #81564
7366 * ecore.cs (EventExpr): Add IsBase handling.
7368 * expression.cs (BaseAccess.CommonResolve): Events can use base accessor
7371 2007-08-02 Raja R Harinath <harinath@gmail.com>
7373 Reduce some differences between cs-parser.jay in mcs/ and gmcs/.
7374 * cs-parser.jay: Some whitespace cleanups.
7375 (current_delegate): New.
7377 (struct_declaration): Make similar to gmcs/cs-parser.jay -- add
7378 a dummy code block, and use 'type_name' instead of 'member_name'.
7379 (interface_declaration, class_declaration): Likewise.
7380 (delegate_declaration): Likewise. Rearrange slightly and use
7382 * cs-tokenizer.cs (handle_where): Rename from handle_constraints.
7383 (GetKeyword): Update to change. Use '!foo' instead of 'foo == false'.
7385 2007-08-02 Marek Safar <marek.safar@gmail.com>
7387 A fix for bug #82039
7389 * ecore.cs (TypeLookup.GetSignatureForError): Use name when type is not
7392 * typemanager.cs (CSharpName): Split to string overload.
7394 2007-08-02 Marek Safar <marek.safar@gmail.com>
7397 * report.cs: Updated warning CS0472.
7399 2007-08-01 Marek Safar <marek.safar@gmail.com>
7401 A fix for bug #82181
7403 * cs-tokenizer.cs: Ignore partial keyword inside block expression.
7405 2007-08-01 Marek Safar <marek.safar@gmail.com>
7407 A fix for bug #82277
7408 * statememnt.cs (Block.Clone): Don't clone explicit blocks twice.
7410 2007-08-01 Marek Safar <marek.safar@gmail.com>
7412 ** C# 3.0 Type Inference (major bits are working)
7414 * anonymous.cs (AnonymousMethodExpression): Removed refactored fields.
7415 (.ImplicitStandardConversionExists): Uses compatible.
7416 (.ExplicitTypeInference): Infers type arguments based on explicit arguments
7417 (.InferReturnType): New method.
7418 (.Compatible): Refactored.
7419 (.ResolveParameters): Uses factory to create resolved parameters.
7420 (.CompatibleMethod): Add probing mode support.
7421 (AnonymousContainer): Removed unused fields. Split Define and Resolve to
7422 clearly distinguish between 2 different operations.
7423 (LambdaMethod): Moved to lambda.cs.
7424 (AnonymousMethod): Removed unused fields and methods.
7425 (AnonymousDelegate): Simplified.
7427 * codegen.cs (ResolveTopBlock): Updated renamed Resolve to Define.
7429 * convert. cs (ImplicitConversionStandard): Compatible works differently.
7431 * delegate.cs (Delegate): New mehods to reduce code duplication.
7432 (.GetConstructor): New method.
7433 (.GetInvokeMethod): New method.
7434 (DelegateCreation): Updated.
7436 * ecore.cs (ResolveOverloadExtensions): Don't crash when extension method
7438 (OverloadResolve): Made probing little bit faster.
7440 * expression.cs (ParameterReference.DoResolveLValue): Reference can be null
7443 * generic.cs (TypeInferenceContext): Dummy implementation.
7445 * iterators.cs: Updated after Resolve/Define rename.
7447 * lambda.cs (LambdaExpression)
7448 (.ResolveParameters): Handles both type of arguments and type inference too.
7450 * parameter.cs (ImplicitLambdaParameter.Resolve): Sanity check.
7451 (InflateTypes): Updated.
7453 * support.cs (InflateTypes): Changed signature and updated.
7455 * typemanager.cs (LookupMemberCache): Better dynamic type check.
7456 (MemberLookup_FindMembers): More MS tricks.
7457 (GetParameterData): Ditto.
7458 (GetDelegateParameters): Uses quick path for dynamic types.
7460 2007-08-01 Marek Safar <marek.safar@gmail.com>
7462 * class.cs (MethodData.Define): EmitContext is required for generic stuff
7465 2007-07-31 Marek Safar <marek.safar@gmail.com>
7467 * statement.cs (ProcessParameters): Don't crash when parameters have wrong
7470 2007-07-26 Jb Evain <jbevain@novell.com>
7472 * typemanager.cs (TypeManager.GetConstructor): Add a method overload
7473 which takes a boolean 'report_errors', similar to the GetMethod.
7474 (InitCodeHelpers): StructLayoutAttribute.ctor(int16) is not visible
7475 in .net 2.1, do not report errors here.
7477 * typemanager.cs (TypeManager.InitCoreTypes): System.ArgIterator,
7478 System.Runtime.CompilerServices.RequiredAttributeAttribute and
7479 System.Runtime.CompilerServices.TypeForwardedToAttribute are internal
7482 * typemanager.cs (TypeManager.InitCoreTypes): Move the resolution
7483 of the type InternalsVisibleToAttribute before the first call
7484 to CoreLookupType which is allowed to fail (third boolean parameter
7485 to true). Because, during the resolution for a type that is not
7486 immediately found, we try to check if the type is not defined in
7487 a friend assembly, and to do so, we need the
7488 InternalVisibleToAttribute.
7490 2007-07-23 Miguel de Icaza <miguel@novell.com>
7492 * expression.cs (Binary): Add support for the brain-dead CSC 2.x
7493 feature that allows structs to be compared against null and inline
7494 the result as true or false.
7496 Notice that the same code is not permitted inside a generic block
7497 of code that would do:
7499 class Foo<T> where T : struct {
7506 It is only allowed if the type of T is not bound (no where
7507 clause). In my opinion, this CSC 2 behavior is broken but people
7508 seem to be using it (IronRuby does, a few bug reports on bugzilla
7509 have it and some people have complained about it).
7511 All of the users that depend on this behavior have code that is
7514 * report.cs (Warning, Error): make these take object arguments,
7515 not strings, as that allows us to take advantage of Format.
7517 2007-07-20 William Holmes <billholmes54@gmail.com>
7519 * decl.cs: Changed MemberName.CountTypeArguments to also check the
7520 Left member variable for the Count.
7521 * doc.cs: Changed DocUtil.GetMethodDocCommentName to call
7522 MemberName.CountTypeArguments to avoid a NRE.
7524 This code is contributed under the MIT X11 license
7526 2007-07-18 Marek Safar <marek.safar@gmail.com>
7528 * cs-tokenizer.cs: Improved lambda parsing and removed old code.
7530 2007-07-18 Atsushi Enomoto <atsushi@ximian.com>
7532 * doc.cs : generic method arguments are written as ``x while generic
7533 type arguments are `x. Combined with the previous change, fixed bug
7536 2007-07-18 Raja R Harinath <rharinath@novell.com>
7539 * expression.cs (Binary.ResolveOperator): When converting
7540 'a + (- b)' to 'a - b', ensure that the unary '-' is discarded.
7542 2007-07-18 Atsushi Enomoto <atsushi@ximian.com>
7544 * doc.cs : when T: or whatever x: is specified, it does not really
7545 check the doc comment's syntax correctness. Fixed bug #82006.
7547 2007-07-18 Marek Safar <marek.safar@gmail.com>
7549 * anonymous.cs (AnonymouseMethodExpression): Refactored to work with
7550 LambdaExpression better.
7552 * cs-tokenizer.cs: Changed a way how we detect lambda parameters.
7554 * driver.cs (LambdaTypeParseTest): Removed, tested method is gone.
7556 * ecore.cs (Expression.MemberLookupFailed): Don't show currect context
7557 as it can be generated.
7559 * expression.cs (Invocation.Error_InvalidArguments): Show correct
7562 * lambda.cs (LambdaExpression): Refactored to share same code with
7563 AnonymousMethodExpression.
7565 2007-07-17 Marek Safar <marek.safar@gmail.com>
7567 * anonymous.cs (MakeName): Include host name for easier debugging.
7568 (LambdaMethod): New class for lambda spcecific stuff.
7570 * attribute.cs: Set EmitContext return type.
7572 * class.cs: Set EmitContext return type.
7574 * codegen.cs (EmitContext): Return type cannot be null to stop messing
7575 with null/void meaning.
7577 * iterators.cs (ContainerType): Implemented.
7579 * rootcontext.cs: Set value of TypeManager.bool_type at early stage.
7581 * statement.cs (Return): Updated to lambda expressions.
7582 (Block.CloneTo): Parent can be null.
7584 2007-07-13 Marek Safar <marek.safar@gmail.com>
7586 A fix for bug #81917
7587 * attribute.cs (AttributeTester.GetFixedBuffer): More robust testing.
7589 * class.cs (FixedField): Check whether field is in unsafe scope.
7591 * ecore.cs (FieldExpr.DoResolve): Create fixed buffer expression here.
7592 (FieldExpr.Emit): Fixed buffers cannot be volatile.
7594 * expression.cs (ElementAccess.Resolve): Move fixed buffers resolve to
7597 * statement.cs (Fixed.Resolve): Simplified fixed buffers.
7599 2007-07-13 Marek Safar <marek.safar@gmail.com>
7601 * cs-tokenizer.cs, class.cs, decl.cs, driver.cs, namespace.cs,
7602 rootcontext.cs, expression.cs, statement.cs: Updated to use WarningLevel
7605 2007-07-13 Marek Safar <marek.safar@gmail.com>
7607 * ecore.cs (FieldExpr.AddressOf): Less confusing warning message.
7609 2007-07-13 Marek Safar <marek.safar@gmail.com>
7611 * anonymous.cs (AnonymousMethodExpression): Parameters are r/o.
7612 (AnonymousContainer.ResolveNoDefine): Another ec to aec flag conversion.
7614 * codegen.cs(EmitContext): Add ProbingMode flag.
7616 * delegate.cs (DelegateInvocation): Set few instance variables as r/o.
7618 * driver.cs: For now set both warning values.
7620 * ecore.cs (SimpleName): Name is readonly.
7621 (MethodGroup.OverloadResolve): One quick path for probing.
7623 * expression.cs (Unary): Set Oper r/o.
7624 (Binary): Set Oper r/o.
7625 (ParameterReference): Set few instance variables as r/o.
7626 (ParameterReference.DoResolveBase): Don't capture aruments when
7628 (Invocation.CloneTo): Fixed typo, looks easy, yeah.
7629 (Arglist): arguments are private.
7630 (SizeOf): type is private and r/o.
7631 (MemberAccess): arguments are private.
7633 * report.cs: Enhanced reporting on/off capabilities.
7635 * lambda.cs: Uses ec.IsInProbingMode.
7636 (ContextualReturn): Derives from return.
7638 * rootcontext.cs: For now set both warning values.
7640 * statement.cs (CloneContext.RemapBlockCopy): Remaps block to cloned
7642 (Return.Resolve): Don't die immediately.
7643 (Block.Resolve): Speed-up probing.
7644 (Block.CloneTo): Clone only child blocks.
7646 Fri Jul 13 11:19:28 CEST 2007 Paolo Molaro <lupus@ximian.com>
7648 * iterators.cs: reverted Miguel's latest change (r81925) as it
7649 breaks the build in System.
7651 2007-07-13 Miguel de Icaza <miguel@novell.com>
7653 * iterators.cs (Yield.CheckContext): Check for the iterator type
7654 also here as we can call into Yield even in codepaths that are not
7656 (MethodOrOperator is the only path that was checked).
7658 In addition to the standard check, use a more specific check for
7659 constructors to report a more verbose error.
7661 2007-07-12 Miguel de Icaza <miguel@novell.com>
7663 * ecore.cs (FieldExpr.AddressOf): Do not stop processing here,
7664 report the warning and continue
7666 * statement.cs (Using.EmitLocalVariableDecls): We were leaving
7667 values on the stack on the call to Emit. Use EmitStatement if
7668 possible, or using Emit + Pop if not possible. Fixes #82064
7670 2007-07-12 Raja R Harinath <rharinath@novell.com>
7672 * expression.cs (Invocation.IsApplicable): Reorganize slightly to
7673 avoid try...finally in some cases.
7675 2007-07-10 Marek Safar <marek.safar@gmail.com>
7677 * attribute.cs (Attribute.ResolveConstructor): Uses method group.
7679 * class.cs (ConstructorInitializer.Resolve): Use and keep method group
7680 instead of method. Re-use standard error handling.
7681 (ConstructorInitializer.Emit): Simplified.
7683 * delegate.cs: Updated after Invocation.EmitCall change.
7685 * ecore.cs (GetOperatorTrueOrFalse): Uses MethodGroupExpr only.
7686 (SimpleName.SimpleNameResolve): Set and reset in_transit flag correctly.
7687 (ExtensionMethodGroupExpr): Refactored to use same OverloadResolve
7688 method and don't permanently changing input arguments.
7689 (MethodGroupExpr): Introduced resolved best_candidate, when method group
7690 is resolved it has one of the candidates is the best one which is later
7691 used to emit. Removed a few unused method.
7692 (MethodGroupExpr.MakeUnionSet): Moved from Invocation, it belongs here.
7694 * expression.cs (StaticCallExpr.MakeSimpleCall): Uses method group.
7695 (Binary.ResolveOperator): Ditto.
7696 (ConditionalLogicalOperator.DoResolve): Ditto.
7697 (Invocation): Uses method group.
7698 (Invocation.DoResolve): Simplified.
7699 (Invocation.EmitCall): Removed useless is_static.
7700 (Invocation.Emit): Delegate to method group.
7701 (Invocation.EmitStatement): Simplified.
7702 (New): Uses method group.
7703 (MemberAccess.DoResolve): Don't destroy original expression.
7705 * statement.cs (ForEach.Resolve): Use null for no method arguments.
7707 2007-07-04 Marek Safar <marek.safar@gmail.com>
7709 * ecore.cs (VarExpr.DoResolveLValue): More restriction checks.
7712 * lambda.cs: Add custom error message type.
7714 2007-07-03 Marek Safar <marek.safar@gmail.com>
7716 * lambda.cs: Simplified little bit.
7718 * parameter.cs: Introduced ImplicitLambdaParameter.
7719 (Parameters.CreateFullyResolved): New factory instead of ctor.
7723 * delegate.cs: Updated parameter creation.
7725 2007-07-03 Marek Safar <marek.safar@gmail.com>
7727 * ecore.cs (SimpleName.GetSignatureForError): Display correctly generic
7730 * generic.cs: Synchronized with gmcs.
7732 2007-07-03 Marek Safar <marek.safar@gmail.com>
7734 * class.cs (Indexer): Check return type as soon as possible.
7736 * cs-parser.jay: Initialize implicit_value_parameter_type for interface
7739 * ecore.cs (VarExpr.DoResolveLValue): Set eclass value.
7741 * expression.cs (Invocation.Error_InvalidArguments): Show type only.
7743 * parameter.cs (Parameter): Use expression type when it is available.
7745 * support.cs (ReflectionParameters.ParameterDesc): Show an extension
7746 method modifier for the first parameter only.
7748 2007-06-24 Marek Safar <marek.safar@gmail.com>
7750 A fix for bug #81938
7751 * typemanager.cs (ChangeType): Fixed couple of char conversions.
7753 * constant.cs: Tide up an exception message.
7755 2007-06-22 Marek Safar <marek.safar@gmail.com>
7757 * ecore.cs (SimpleName.DoSimpleNameResolve): Better error reporting when
7758 an uninitialized variable is used.
7760 * expression.cs (LocalVariableReference.DoResolve): Ditto.
7762 2007-06-22 Marek Safar <marek.safar@gmail.com>
7764 * ecore.cs (SimpleName.TypeOrNamespaceNotFound): Allow to override type
7765 not found error handling.
7767 * expression.cs (ArrayCreation): Removed redundant fields and little bit
7769 (ArrayCreation.ResolveArrayElement): To be ready to customization.
7770 (ArrayCreation.DoResolve): Simplified.
7771 (ImplicitlyTypedArrayCreation.DoResolve): Implicitly typed arrays have
7772 its own resolve process.
7773 (ImplicitlyTypedArrayCreation.ResolveArrayElement): Conversion magic.
7775 2007-06-20 Marek Safar <marek.safar@gmail.com>
7777 * namespace.cs (NamespaceEntry.Error_AmbiguousTypeReference): Print
7780 2007-06-20 Marek Safar <marek.safar@gmail.com>
7782 * cs-tokenizer.cs: Removed var related stuff.
7784 * ecore.cs (Expression.ResolveAsContextualType): Introduced new method.
7785 (VarExpr): Changed to derive from SimpleName. VarExpr now behaves as
7786 a type and a keyword at same time.
7788 * decl.cs (MembeName.GetTypeExpression): Create VarExpr when type name
7791 * expression.cs (ImplicitlyTypedArrayCreation): New empty class for
7792 implicitly typed arrays, more changes will follow.
7794 * statement.cs (LocalInfo.Resolve): Resolve type as contextual type.
7796 2007-06-19 Marek Safar <marek.safar@gmail.com>
7798 * ecore.cs (VarExpr): Removed Handled field.
7800 * statement.cs (Using.ResolveLocalVariableDecls): Refactored to use
7801 build-in assign functionality.
7802 (ForEach.Resolve): Removed all implicitly typed local variable code and
7804 (ArrayForeach.Resolve): Infer implicitly typed local variable here.
7805 (CollectionForeach.Resolve): Infer implicitly typed local variable here.
7807 2007-06-18 Marek Safar <marek.safar@gmail.com>
7809 * assign.cs: Removed implicitly typed local variable check.
7811 * expression.cs (LocalVariableReference.DoResolve): Add check for self
7812 referencing implicitly typed local variable.
7813 (LocalVariableReference.DoResolveLValue): Infer implicitly typed local
7816 * statement.cs (Fixed): Removed unsupported implicitly typed local
7819 2007-06-15 Marek Safar <marek.safar@gmail.com>
7821 * decl.cs (MemberName): Moved all Unbound stuff to parser.
7823 2007-06-14 Marek Safar <marek.safar@gmail.com>
7825 A fix for bugs #81855 and #76274
7826 * attribute.cs (AttachTo): Always set owner for global attributes to
7829 * ecore.cs (Error_TypeDoesNotContainDefinition): A type location can be
7832 * cs-parser.jay: Assembly and module attributes must precede all other
7833 elements except using clauses and extern alias declarations.
7835 2007-06-13 Marek Safar <marek.safar@gmail.com>
7837 A fix for bug #81748
7839 * expression.cs: More checks for non ISO-1 features.
7841 2007-06-12 Marek Safar <marek.safar@gmail.com>
7843 A fix for bug #81807
7844 * statement.cs(Switch.TableSwitchEmit): Define null label when it's not
7845 present inside switch statement and it is required by nullable check.
7847 2007-06-12 Marek Safar <marek.safar@gmail.com>
7849 A fix for bug #81840
7850 * ecore.cs (SimpleName.ResolveAsTypeStep): Look for non-generic type
7851 when type matching fails.
7853 * namespace.cs: Tiny error message change.
7855 2007-06-12 Marek Safar <marek.safar@gmail.com>
7857 * decl.cs (CheckAbstractAndExtern): Moved to MemberCore for easier error
7858 reporting. Added automatic property check.
7860 * class.cs: Updated after CheckAbstractAndExtern relocation.
7861 (AEventPropertyAccessor.GetSignatureForError): Customized.
7863 2007-06-11 Marek Safar <marek.safar@gmail.com>
7865 * class.cs (DefineBaseTypes): Base type can be undefined.
7867 * ecore.cs (TypeLookup): Minor refactoring.
7868 (DoResolveAsTypeStep): Removed redundant check.
7870 * namespace.cs (Lookup): Removed redundant check.
7872 * rootcontext.cs (BootstrapCorlib_ResolveType): Uses normal
7873 ResolveAsTypeTerminal step.
7874 (BootstrapCorlib_*): Simplified.
7875 (PopulateCoreType): Core types can be now external.
7877 2007-06-07 Marek Safar <marek.safar@gmail.com>
7879 * anonymous.cs (VerifyExplicitParameterCompatibility): Add flag to do
7881 (InferTypeArguments): Infers anonymous expression type arguments.
7882 (Compatible): Split to Compatible and InferTypeArguments.
7884 * lambda.cs: Updated.
7886 2007-06-08 Marek Safar <marek.safar@gmail.com>
7888 * anonymous.cs (AnonymousContainer): Marked as compiler generated.
7890 2007-06-07 Raja R Harinath <harinath@gmail.com>
7892 Fix #80477, cs0135-2.cs, cs0135-3.cs
7893 * statement.cs (ToplevelBlock.ProcessParameters): Add parameter
7894 names to the "known" variables list.
7895 (Block.CheckInvariantMeaningInBlock): Handle the fact the
7896 parameter names are also "known".
7897 (Block.CheckError136): Remove.
7898 (ExplicitBlock.CloneTo): New. Set 'known_variables' in target to
7901 2007-06-07 Marek Safar <marek.safar@gmail.com>
7903 * ecore.cs (MethodGroupExpr.OverloadResolve): Print full method definition.
7905 2007-06-06 Marek Safar <marek.safar@gmail.com>
7907 * ecore.cs (SimpleName.Emit): Emitting unresolved simple name is
7908 internal error not an user error.
7910 * expression.cs (IsApplicable): Refactored to make debugging easier.
7912 * support.cs: More tricks for non-mono runtimes.
7914 * typemanager.cs (CoreLookupType): Made public.
7915 (InitSystemCore): All linq specific stuff moved to linq.cs
7917 2007-06-05 Marek Safar <marek.safar@gmail.com>
7919 * typemanager.cs (CSharpSignature): One more missing build-in types
7921 More tricks for non-mono runtime.
7923 2007-06-05 Raja R Harinath <harinath@gmail.com>
7925 * statement.cs (Block.CheckError136_InParents): Remove.
7926 (Block.AddVariable): Use GetParameterInfo instead.
7927 (ToplevelBlock.ProcessArguments): Likewise.
7929 2007-06-04 Raja R Harinath <rharinath@novell.com>
7931 * statement.cs (ToplevelBlock.CloneTo): New. Copy over parameter
7933 (ToplevelBlock.GetParameterInfo): Split out of ...
7934 (ToplevelBlock.GetParameterRefernce): ... this.
7935 (ToplevelBlock.ParameterMap): Remove.
7936 * expression.cs (ParameterReference): Update to use
7937 ToplevelParameterInfo.
7939 * statement.cs (ToplevelBlock.ProcessParameters): Workaround some
7942 * flowanalysis.cs (FlowBranching.CheckOutParameters): Move ...
7943 * statement.cs (ToplevelBlock.CheckOutParameters): ... here.
7945 * statement.cs (ToplevelBlock.ResolveMeta): Move CS0136 checks ...
7946 (ToplevelBlock.ProcessParameters) ... here.
7947 (ToplevelBlock..ctor): Invoke it.
7949 * statement.cs (ToplevelBlock.ResolveMeta): Add sanity checks for
7952 * statement.cs (IKnownVariable): New interface.
7953 (LocalInfo): Implement it.
7954 (ToplevelParameterInfo): New class.
7955 (ExplicitBlock.AddKnownVariable): Use IKnownVariable.
7956 (ExplicitBlock.GetKnownVariable): Likewise. Rename from
7957 GetKnownVariableInfo.
7959 2007-06-03 Raja R Harinath <harinath@gmail.com>
7961 Partly speed up CS0136 error checks.
7962 * statement.cs (ExplicitBlock.GetKnownVariableInfo): Remove
7963 'recurse' parameter.
7964 (Block.DoCheckError136): Only check errors in parameters. Move
7965 local variable checks ...
7966 (Block.AddVariable): ... here, and ...
7967 (ToplevelBlock.ResolveMeta): ... here.
7969 2007-06-02 Raja R Harinath <harinath@gmail.com>
7971 * statement.cs (Block.IsChildOf): Remove.
7973 * statement.cs (Statement.Clone): Move special case code ...
7974 (Block.CloneTo): ... here.
7976 2007-05-29 Raja R Harinath <rharinath@novell.com>
7978 * statement.cs (ToplevelBlock.container): Remove field. It's
7979 redundant with 'Parent'.
7980 (ToplevelBlock.ContainerBlock): Remove accessor.
7981 (ToplevelBlock..ctor): Update to changes. Register anonymous
7982 child with parent here, ...
7983 * cs-parser.jay (end_anonymous): ... not here. Don't modify
7985 (start_anonymous): Don't save current_block.
7986 (top_current_block): Remove.
7988 * statement.cs (Block.Flags): Remove IsExplicit and IsToplevel flags.
7989 (Block.Resolve): Update to changes.
7990 (Block..ctor): Move setting of "correct" 'Toplevel'
7991 and 'Explicit' fields to ...
7992 (ExplicitBlock..ctor, ToplevelBlock..ctor): ... here.
7994 2007-05-27 Raja R Harinath <harinath@gmail.com>
7997 * statement.cs (Block.Implicit): Remove.
7998 (Block): Update to changes.
7999 * flowanalysis.cs: Likewise.
8001 Mildly speed up CheckInvariantMeaningInBlock
8002 * statement.cs (ExplicitBlock.AddKnownVariable): Move here from Block.
8003 Recursively call AddKnownVariable to all enclosing blocks.
8004 (ExplicitBlock.GetKnownVariableInfo): Move here from Block.
8005 Remove recursive calls.
8006 (Block): Update to changes.
8008 New ExplicitBlock invariants
8009 * statement.cs (Block.Explicit): New field. It points to the
8010 immediately enclosing non-implicit block.
8011 (Block..ctor): Maintain the invariant.
8012 * cs-parser.jay: Take advantage of invariant.
8014 Introduce ExplicitBlock
8015 * statement.cs (ExplicitBlock): New.
8016 (ToplevelBlock): Derive from it.
8017 (Block.Flags.IsExplicit): Rename from '...Implicit' and invert
8019 (Block.Implicit): Update to changes.
8020 * cs-parser.jay: Update to changes.
8023 * codegen.cs (EmitContext.IsLastStatement): Remove.
8024 * statement.cs (Block.DoEmit): Update to changes.
8026 2007-05-25 Raja R Harinath <rharinath@novell.com>
8028 * cs-parser.jay: Use 'start_block' and 'end_block' rather than
8029 modifying current_block directly.
8031 2007-05-23 Scott Peterson <lunchtimemama@gmail.com>
8033 * class.cs: Implemented automatic properties (C# 3.0)
8034 Thanks to Marek for the help.
8036 2007-05-23 Raja R Harinath <rharinath@novell.com>
8038 * flowanalysis.cs (VariableInfo.SetAssigned): When noting a
8039 variable as assigned, note also that all its components are
8041 (MyBitVector.SetRange): New. Function to set multiple bits to true.
8043 2007-05-19 Marek Safar <marek.safar@gmail.com>
8045 * anonymous.cs, class.cs: Emit Compiler generated attribute when
8046 member is marked as compiler generated.
8048 * decl.cs (MemberCore): Refactored ModFlags into property.
8050 * modifiers.cs: Add new modifier (COMPILER_GENERATED).
8051 (Check): Check only accessibility modifiers.
8053 2007-05-18 Raja R Harinath <rharinath@novell.com>
8055 Track all assignable slots in one bit array
8056 * statement.cs (ToplevelBlock.ParameterMap): Convert into array.
8057 (ToplevelBlock.ResolveMeta): Don't create a VariableMap. Move
8058 logic from VariableMap constructor here. Use the same 'offset'
8059 variable that's later used for computing offsets of local
8061 * flowanalysis.cs (UsageVector.parameters): Remove.
8062 (UsageVector): Update to changes.
8063 (VariableMap): Remove.
8065 Avoid creating ParameterMap in every block
8066 * statement.cs (Block.ParameterMap): Move ...
8067 (ToplevelBlock.ParameterMap): ... here.
8068 (ToplevelBlock.ResolveMeta): Create VariableMap for parameters
8070 * flowanalysis.cs (FlowBranching.param_map): Remove.
8071 (FlowBranching.UsageVector): Update to changes.
8072 (FlowBranchingToplevel.CheckOutParameters): Likewise.
8074 * statement.cs (Block.CloneTo): Clone Toplevel field too.
8076 * expression.cs (ParameterReference): Distinguish between block
8077 where parameter was referenced and declared.
8079 2007-05-18 Marek Safar <marek.safar@gmail.com>
8081 * flowanalysis.cs, statement.cs: Put back improved error handling.
8083 2007-05-15 Scott Peterson <lunchtimemama@gmail.com>
8087 Imporved object and collection initialization (C# 3.0).
8089 2007-05-15 Marek Safar <marek.safar@gmail.com>
8091 A fix for bug #81380
8092 * expression.cs (Is.DoResolve): Only value types have constant `is'
8095 2007-05-15 Raja R Harinath <rharinath@novell.com>
8097 * statement.cs (ToplevelBlock.child): Remove.
8099 2007-05-15 Raja R Harinath <harinath@gmail.com>
8101 Rationalize ResolveMeta: refactoring
8102 (Block.ResolveMeta): Remove wrong or superfluous comments. Carve
8103 out constant handling code into ...
8104 (Block.DoResolveConstants): ... this.
8106 Rationalize ResolveMeta: kill local_map
8107 * statement.cs (Block.local_map, Block.LocalMap): Remove.
8108 (Block.AssignableSlots): New.
8109 (Block.ResolveMeta): Make protected. Don't create a VariableMap
8110 for locals -- move code from VariableMap here. Avoid unnecessary
8112 * flowanalysis.cs (FlowBranching.local_map): Remove.
8113 (FlowBranching..ctor): Use Block.AssignableSlots.
8114 (VariableMap): Remove unused constructors.
8116 2007-05-11 Raja R Harinath <rharinath@novell.com>
8118 * Makefile [PROFILE=net_2_0_bootstrap]: Add special-case rules.
8120 2007-05-11 Marek Safar <marek.safar@gmail.com>
8122 * typemanager.cs (IsFriendAssembly): Should not be called for building
8125 2007-05-09 Marek Safar <marek.safar@gmail.com>
8127 * literal.cs (NullConstant): Print null in all cases.
8129 * expression.cs (Binary.ResolveOperator): Implemented delegate
8130 comparison based on C# 2.0 changes.
8132 2007-04-28 Scott Peterson <lunchtimemama@gmail.com>
8134 This code is contributed under the MIT X11 license
8136 The following enables support for several C# 3.0 language features:
8138 * cs-tokenizer.cs: Added support for the "var" keyword.
8140 * ecore.cs: Refactored TypeLookupExpression.DoResolveAsTypeStep().
8141 Added VarExpr class to facilitate type inferencing.
8143 * class.cs: Added IDictionary field AnonymousTypes to TypeContainer
8144 to support anonymous types.
8146 * assign.cs: Added support for type inferencing and initialization.
8148 * anonymous.cs: Added AnonymousClass class to enable anonymous types.
8150 * expression.cs: Added implicit array support to ArrayCreation.
8151 Added 5 types and 1 interface:
8153 IInitializable Implementing classes can inject initializing
8154 statements after object instantiation.
8156 Initializer Stores data for object initialization.
8158 AnonymousType An expression for anonymous types.
8160 AnonymousTypeParameter Stores data about an anonymous type's field.
8162 NewInitialize An expression for object initialization.
8164 CollectionInitialize An expression for collection initialization.
8166 * statement.cs: Added "var" keyword support to the foreach, using, and fixed
8169 2007-05-06 Marek Safar <marek.safar@gmail.com>
8171 A fix for bug #81500
8172 * cs-tokenizer.cs: Add special handling for coalescing operator.
8174 2007-05-06 Marek Safar <marek.safar@gmail.com>
8176 A fix for bug #81529
8177 * attribute.cs (GetAttributeUsage): AttributeUsage attribute inherits
8178 its value from base class until it is redefined.
8180 2007-05-02 Raja R Harinath <rharinath@novell.com>
8182 Fix regression in cs0631-3.cs
8183 * cs-parser.jay (operator_declarator): Add opt_attributes to error
8184 fallback. Make error fallback catch more cases.
8186 2007-05-01 Miguel de Icaza <miguel@novell.com>
8188 * cs-parser.jay: Allow parameters in operator declarations to have
8191 2007-04-27 Miguel de Icaza <miguel@novell.com>
8193 * statement.cs (If.CloneTo): Only clone the FalseStatement if it
8196 * lambda.cs (ContextualReturn.Resolve): An expression is valid
8197 inside the ContextualReturn, it does not have to be an
8198 ExpressionStatement.
8200 2007-04-24 Miguel de Icaza <miguel@novell.com>
8202 * lambda.cs (ContextualReturn.Resolve): if the return type is not
8205 2007-04-23 Miguel de Icaza <miguel@novell.com>
8207 * anonymous.cs (AnonymousContainer): split the virtual Resolve
8208 method in two methods: ResolveNoDefine and Resolve.
8210 ResolveNoDefine will stop just after ResolveTopBlock has been
8213 Resolve will then continue by creating a method and issuing the
8214 call to method.Define ().
8216 (AnonymousMethod): Split and implement the new Resolve and
8217 ResolveNoDefine as well.
8219 * lambda.cs (LambdaExpression): Split the anonymous method
8220 resolution code into a separate routine (CoreCompatibilityTest)
8221 from DoCompatibleTest.
8223 (LambdaExpression.TryBuild): New method, this method tries to
8224 build the LambdaExpression with the given set of types to be used
8225 as the types for the various parameters of the lambda expression.
8227 If the compilation succeed with the given types, the infered type
8228 of the Anonymous method is returned, otherwise null is returned.
8230 2007-04-23 Marek Safar <marek.safar@gmail.com>
8232 A fix for bug #81414
8233 * delegate.cs: Better fix, moved ApplyAttributes from Define to Emit.
8235 2007-04-22 Miguel de Icaza <miguel@novell.com>
8237 * cs-tokenizer.cs: Change various identifiers here from the
8238 camelCasing to the recommended Linux-like style for instance
8239 variables from the Coding Guidelines.
8241 2007-04-19 Martin Baulig <martin@ximian.com>
8244 (Convert.ImplicitReferenceConversionCore): Allow conversions from
8245 System.Enum to System.ValueType.
8247 2007-04-13 Martin Baulig <martin@ximian.com>
8249 Rewrote implicit reference conversions. We need to distinguish
8250 between implicit reference conversions (13.1.4) and implicit
8251 boxing conversions (13.1.5).
8253 According to the spec, there's an an implicit conversion
8254 "From a one-dimensional array-type S[] to IList<T> and base
8255 interfaces of this interface, provided there is an implicit
8256 reference conversion from S to T." Note that this does not
8257 include boxing conversions.
8260 (Convert.ImplicitTypeParameterBoxingConversion): New method.
8261 (Convert.ImplicitReferenceConversion): Split into
8262 ImplicitReferenceConversionCore() and
8263 ImplicitBoxingConversionExist().
8264 (Convert.ImplicitReferenceConversionExists): Use the new
8265 ImplicitReferenceConversionCore() and ImplicitBoxingConversionExists().
8267 2007-04-12 Martin Baulig <martin@ximian.com>
8269 * convert.cs (Convert.ImplicitReferenceConversion): Move the
8270 `TypeManager.null_type' checks up to the top of the method.
8272 2007-04-11 Marek Safar <marek.safar@gmail.com>
8274 A fix for bug #81350
8275 * class.cs, decl.cs, ecore.cs, namespace.cs: The optimization for private
8278 2007-04-11 Martin Baulig <martin@ximian.com>
8280 * statement.cs (Foreach.CollectionForeach.ProbeCollectionType):
8281 Use `TypeManager.GetInterfaces(t)' rather than `t.GetInterfaces()'
8282 to make this work for generic classes; fixes #79561.
8284 2007-04-11 Martin Baulig <martin@ximian.com>
8286 * expression.cs (As): Add support for nullable types; fixes #79371.
8288 2007-04-11 Martin Baulig <martin@ximian.com>
8290 * doc.cs (DocUtil.GetSignatureForDoc): Don't crash if
8291 `type.FullName' is null; fixes #80243.
8293 2007-04-11 Martin Baulig <martin@ximian.com>
8295 * expression.cs (Invocation.IsApplicable): Don't modify the method
8296 if type inference succeeded, but the method was not applicable.
8299 2007-04-10 Marek Safar <marek.safar@gmail.com>
8301 A fix for bug #81324
8302 * namespace.cs (Namespace.LookupExtensionMethod): Always inspect both
8303 internal and external namespaces containers.
8305 2007-04-10 Martin Baulig <martin@ximian.com>
8307 * delegate.cs (DelegateCreation.ResolveMethodGroupExpr): Use
8308 TypeManager.DropGenericMethodArguments() so we also call
8309 IMethodData.SetMemberIsUsed() for generic methods. Fixes #80357.
8311 2007-04-10 Martin Baulig <martin@ximian.com>
8313 * iterators.cs (Iterator.CreateIterator): Don't crash if
8314 `method.ReturnType' is null. This happens if something went wrong
8315 while resolving that typ (we already reported an error in this case).
8317 2007-04-10 Martin Baulig <martin@ximian.com>
8319 * expression.cs (New.DoResolve): Don't call CheckComImport() on
8320 generic interfaces; report the CS0144 directly.
8322 2007-04-10 Martin Baulig <martin@ximian.com>
8324 * ecore.cs (MemberExpr.ResolveMemberExpr): If `left' is a
8325 `TypeExpr', call ResolveAsTypeTerminal() on it; fixes #81180.
8327 2007-04-10 Martin Baulig <martin@ximian.com>
8329 * expression.cs (New.DoEmitTypeParameter): Fix #81109.
8331 2007-04-09 Raja R Harinath <rharinath@novell.com>
8334 * flowanalysis.cs (UsageVector.MergeChild): Handle child.Block == null.
8335 * statement.cs: Use KillFlowBranching only in ResolveUnreachable.
8338 * statement.cs (For.Resolve): If resolution fails, use
8341 2007-04-08 Marek Safar <marek.safar@gmail.com>
8343 * anonymous.cs (MakeName): Make faster and zero-based.
8344 (VerifyExplicitParameterCompatibility): Back to mode where generic
8345 parameter is ignored.
8346 (AnonymousMethodMethod.Emit): Decorate method as compiler generated.
8348 * class.cs (EmitType): Method can emit another new method.
8350 * cs-tokenizer.cs (IsLinqEnabled): Fixes static cctor race.
8352 * driver.cs: Updated.
8354 * lambda.cs: Reuse predefined empty parameters.
8356 * parameter.cs: Updated
8358 * support.cs: Implemented InflateTypes.
8360 * typemanager.cs (GetFullName): Don't use FullName as it can be null.
8361 (InitSystemCore): Introduced to isolate 3.0 dependencies.
8363 2007-04-03 Martin Baulig <martin@ximian.com>
8367 * statement.cs (Foreach.CollectionForeach.TryType): Use a custom
8368 version of TypeManager.IsOverride() which also works with generic
8371 2007-04-03 Martin Baulig <martin@ximian.com>
8376 (Convert.ExplicitReferenceConversion): We need to cast when
8377 converting from IList<T> to S[].
8379 2007-04-01 Marek Safar <marek.safar@gmail.com>
8381 * decl.cs (FindExtensionMethods): Consider all candidates with same name
8384 * expression.cs (MemberAccess.DoResolve): Cache resolved expression.
8386 2007-03-31 Marek Safar <marek.safar@gmail.com>
8388 * anonymous.cs (AnonymousMethodExpression.Compatible): Handles both
8389 argument and return type inferring.
8391 * codegen.cs (InferReturnType): Flag whether return can be inferred.
8392 (ReturnType): Turned to property.
8394 * statement.cs (Return): Implemented return type inferring.
8396 * support.cs (ReflectionParameters): Use local types if possible.
8398 2007-03-30 Raja R Harinath <rharinath@novell.com>
8400 * flowanalysis.cs (FlowBranching.Reachability): Remove.
8401 (FlowBranching.UsageVector): Update to changes.
8403 Prepare to kill 'Reachability'
8404 * flowanalysis.cs (UsageVector): Remove 'Reachability' from
8405 argument of constructor.
8407 2007-03-29 Raja R Harinath <rharinath@novell.com>
8409 Prepare to kill 'Reachability'
8410 * flowanalysis.cs (UsageVector.is_unreachable): New.
8411 (UsageVector): Update to maintain 'is_unreachable' in parallel to
8412 'reachability', and verify they're consistent.
8415 * expression.cs (New.EmitStatement): Handle type parameters here too.
8417 2007-03-29 Martin Baulig <martin@ximian.com>
8422 (ScopeInfo.ctor): Use `Modifiers.PUBLIC' if we're a nested
8423 CompilerGeneratedClass.
8424 (ScopeInfo.EmitScopeInstance): Make this protected.
8425 (CapturedVariable.EmitInstance): Use `Ldarg_0' if
8426 `ec.CurrentAnonymousMethod.Scope == Scope'.
8428 * statement.cs (Block.ScopeInfo): Make this a property.
8430 2007-03-27 Raja R Harinath <harinath@gmail.com>
8432 Prepare to kill 'Reachability'
8433 * flowanalysis.cs (FlowBranching.Reachability): Make class private.
8434 (FlowBranching.UsageVector.Reachability): Remove property.
8435 (FlowBranching.UsageVector.IsUnreachable): New property.
8436 (FlowBranching.UsageVector.ResetBarrier): New.
8437 (FlowBranching.UsageVector, FlowBranchingLabeled): Update to changes.
8438 * codegen.cs, statement.cs: Update to changes.
8440 2007-03-27 Martin Baulig <martin@ximian.com>
8445 (DeclSpace.LookupNestedTypeInHierarchy): Correctly handle nested
8448 2007-03-26 Raja R Harinath <rharinath@novell.com>
8450 * flowanalysis.cs (FlowBranching.Reachability): Use a boolean
8451 instead of TriState. Remove all mention of TriState.
8453 * flowanalysis.cs (FlowBranching.Reachability): Prepare to be
8454 replaced by a boolean. Add boolean 'is_unreachable' field, check
8455 and maintain invariants.
8457 2007-03-25 Marek Safar <marek.safar@gmail.com>
8459 * anonymous.cs: Restored checks disabled for uninflated anonymous methods.
8461 2007-03-25 Marek Safar <marek.safar@gmail.com>
8463 * expression.cs: Stop using obsolete 2.0 opcodes.
8465 2007-03-25 Marek Safar <marek.safar@gmail.com>
8467 * enum.cs (EnumMember.Define): Fixed regression and slowdown caused by
8468 one of the latests Martin's fixes.
8470 2007-03-23 Miguel de Icaza <miguel@novell.com>
8472 * expression.cs: On BigEndian systems, swap the bytes, temporary
8473 solution until we get a new bitconverter class.
8475 2007-03-23 Martin Baulig <martin@ximian.com>
8479 * decl.cs (MemberCache.AddMembers): Add generic methods both as
8480 "Method" and "Method`1". Normally, a cache lookup is done on the
8481 "Method" form (ie. without the generic arity), but this one makes
8482 lookups on the full form work as well.
8484 2007-03-22 Raja R Harinath <rharinath@novell.com>
8486 * flowanalysis.cs (Reachability): Reorganize slightly, and remove
8489 2007-03-20 Bill Holmes <billholmes54@gmail.com>
8491 Added 2 MemberCoreArrayList objects, ordered_explicit_member_list and
8492 ordered_member_list, to TypeBuilder to store members to be defined
8493 in the order they were parsed in.
8494 - ordered_explicit_member_list contains all properties indexers
8495 and methods that are defined as explicit implementation of an
8496 interface or base class.
8497 - ordered_member_list contains all properties indexers and methods
8498 that are not defined as explicit implementation of an interface
8501 Removed MethodArrayList and IndexerArrayList from TypeBuilder. The
8502 functionality in these removed classes has been replaced with
8503 ComputeIndexerName, EmitIndexerName, HasEqualss, HasGetHashCode, and
8504 CheckEqualsAndGetHashCode members defined and called in the TypeBuilderClass.
8506 Adding CheckForDuplications to PropertyBase.PropertyMethod and calls
8507 to CheckForDuplications inside GetMethod and SetMethod Define Method
8508 to handle method property and indexer name conflicts.
8512 All code is contributed under the MIT/X11 license.
8514 2007-03-20 Martin Baulig <martin@ximian.com>
8516 * class.cs (TypeContainer.Interfaces): Removed; they're now
8517 included in `TypeContainer.Types'.
8519 2007-03-20 Martin Baulig <martin@ximian.com>
8521 Fix #77963, #80314 and #81019. Added gtest-317, ..., gtest-320.
8523 * class.cs (TypeContainer.CreateType): New public method. This is
8524 now called before DefineType() to create the TypeBuilders.
8525 (TypeContainer.DefineType): Don't create the TypeBuilder here; it
8526 has already been created by CreateType().
8527 (TypeContainer.DefineTypeBuilder): Renamed into CreateTypeBuilder();
8528 don't resolve our base classes here; this has been moved into
8529 DefineBaseTypes(). We're now called from CreateType().
8530 (TypeContainer.DefineBaseTypes): New private method; resolve our
8531 base classes here. We're now called from DefineType().
8534 (RootContext.ResolveTree): Call TypeContainer.CreateType() on all
8535 our types first to create all the TypeBuilders. After that, call
8536 TypeContainer.DefineType() on all the types which'll resolve their
8537 base classes and setup the resolve order.
8539 2007-03-20 Martin Baulig <martin@ximian.com>
8541 * class.cs (TypeContainer.Enums): Removed; they're now included in
8542 `TypeContainer.Types'.
8544 2007-03-20 Martin Baulig <martin@ximian.com>
8547 (TypeContainer.DefineType): Don't call ResolveMembers() here.
8548 (TypeContainer.DoResolveMembers): Call DefineType() on our
8549 `compiler_generated' classes; moved here from DefineNestedTypes().
8552 (RootContext.ResolveTree): Call ResolveMembers() on all
8553 TypeContainer's in the `type_container_resolve_order'.
8555 2007-03-19 Marek Safar <marek.safar@gmail.com>
8557 * class.cs: Use corlib to handle InternalMethodImplAttribute.
8559 2007-03-17 Marek Safar <marek.safar@gmail.com>
8561 * class.cs (EventFieldAccessor.EmitMethod): Don't override existing
8562 implementation flags.
8564 2007-03-17 Marek Safar <marek.safar@gmail.com>
8566 * class.cs: More optimizations for type parameters.
8568 2007-03-15 Marek Safar <marek.safar@gmail.com>
8570 * anonymous.cs (AnomymousMethod): Can be now hosted in generic container.
8572 * ecore.cs, parameter.cs: More common code for both corlibs.
8574 * typemanager.cs (IsGenericMethod): Simplified.
8576 2007-03-15 Raja R Harinath <rharinath@novell.com>
8578 * flowanalysis.cs (FlowBranching.Reachability): Remove handling of
8580 * statement.cs, iterators.cs, lambda.cs: Update to changes.
8582 * statement.cs (Lock.Resolve): Invoke 'ec.NeedReturnLabel'
8583 unconditionally. Simplify explanation.
8584 (Try.Resolve, Using.Resolve): Likewise.
8586 2007-03-15 Martin Baulig <martin@ximian.com>
8590 * decl.cs (DeclSpace): If we're a partial class, use our
8591 `PartialContainer's `TypeParameters' and `CurrentTypeParameters'.
8593 2007-03-15 Raja R Harinath <rharinath@novell.com>
8595 * flowanalysis.cs (FlowBranching.Reachability): Remove handling of
8597 (FlowBranching.UsageVector): Update to changes.
8598 (FlowBranching.MergeSiblings): Likewise.
8599 * statement.cs: Likewise.
8601 2007-03-15 Martin Baulig <martin@ximian.com>
8606 (MemberCache): Added a special .ctor for type parameters.
8609 (TypeManager.MemberLookup_FindMembers): `TypeParameter' now has a
8612 2007-03-09 Martin Baulig <martin@ximian.com>
8614 * enum.cs (Enum): Make this a TypeContainer.
8615 (EnumMember): Derive from `Const'.
8618 (Const.DoResolveValue): New protected virtual method; move most of
8619 the functionality of ResolveValue() here so we can override it in
8621 (Const.CreateConstantReference): Make this virtual.
8623 * class.cs (Kind): Add `Kind.Enum'.
8624 (TypeContainer.Emit): Don't emit the enums here; they're already
8625 in the `RootContext.typecontainer_resolve_order'.
8627 * rootcontext.cs (RootContext.EmitCode): Don't emit the enums
8628 here; they're already in the `typecontainer_resolve_order'.
8630 * ecore.cs (EnumConstant.ConvertImplicitly): Add
8631 TypeManager.DropGenericTypeArguments().
8634 (TypeManager.CSharpEnumValue): Add DropGenericTypeArguments().
8635 (TypeManager.IsEnumType): Likewise.
8636 (TypeManager.EnumToUnderlying): Likewise.
8637 (TypeManager.IsEqual): Add support for enums.
8639 2007-03-12 Raja R Harinath <rharinath@novell.com>
8641 * typemanager.cs (InitCoreTypes) [NET_2_0]: Allow
8642 DefaultParameterValueAttribute to be undefined, say if System.dll
8645 2007-03-11 Marek Safar <marek.safar@gmail.com>
8647 * ecore.cs, parameter.cs, typemanager.cs: Another gmcs fix to work with
8650 2007-03-10 Marek Safar <marek.safar@gmail.com>
8652 * class.cs, parameter.cs: Unified parameters verification.
8654 2007-03-08 Martin Baulig <martin@ximian.com>
8656 * cs-parser.jay (constructor_header): Pass the location to the
8657 newly created TopLevelBlock.
8659 2007-03-07 Martin Baulig <martin@ximian.com>
8661 * statement.cs (Block.Resolve): Don't crash on error; bug #80715.
8663 2007-03-06 Miguel de Icaza <miguel@novell.com>
8665 * convert.cs (ExplicitReferenceConversionExists): Sync this method
8666 with the changes from David, fixes the build.
8668 2007-03-05 David Mitchell <dmitchell@logos.com>
8670 * convert.cs: Implement From System.Collecitons.Generic.IList<T>
8671 and its base interfaces to a one-dimensional array type S[],
8672 provided there is an implicit or explicit reference conversion
8675 2007-03-03 Marek Safar <marek.safar@gmail.com>
8677 * cs-tokenizer.cs: Implemented basic linq grammar.
8679 * driver.cs: Set linq lang version on demand.
8681 2007-02-26 Marek Safar <marek.safar@gmail.com>
8683 * cs-parser.jay, expression.cs: Compile empty __arglist correctly.
8685 2007-02-25 Marek Safar <marek.safar@gmail.com>
8687 * attribute.cs: Replaced DefinePInvoke in favor of S.R.E implementation
8690 * class.cs (InterfaceMemberBase): Share common `extern' modifier checks
8692 Check property and event extern attributes.
8694 * codegen.cs (ModuleClass): HasDefaultCharSet when module defined global
8697 2007-02-24 Marek Safar <marek.safar@gmail.com>
8699 A fix for bug #80407
8700 * ecore.cs: Don't report ambiguity error when methods have same parent.
8702 2007-02-23 Marek Safar <marek.safar@gmail.com>
8704 A fix for bug #80878
8705 * class.cs, cs-parser.jay: Event property can host anonymous methods.
8707 2007-02-22 Marek Safar <marek.safar@gmail.com>
8709 * attribute.cs: Enable ExtensionAttribute presence test.
8711 2007-02-22 Marek Safar <marek.safar@gmail.com>
8713 * class.cs: Warn about missing GetHashCode only when Equals is override.
8715 * decl.cs: Check accessibility of type arguments.
8717 * typemanager.cs: Correctly report nullable array.
8719 2007-02-20 Marek Safar <marek.safar@gmail.com>
8721 * class.cs, report.cs: Capture more details when things go wrong.
8723 2007-02-20 Marek Safar <marek.safar@gmail.com>
8725 A fix for bug #80650
8726 * cs-parser.jay: Anonymous container starts at constructor declaration
8727 and not at block beginning because it has to be usable in constructor
8730 * statement.cs: Use context location and not block one for error reporting.
8732 2007-02-18 Marek Safar <marek.safar@gmail.com>
8734 A fix for bug #78712
8735 * class.cs.cs, decl.cs, ecore.cs: LookupAnyGeneric inspects nested types
8738 2007-02-18 Marek Safar <marek.safar@gmail.com>
8740 A fix for bug #80493 by Atsushi Enomoto
8741 * cs-parser.jay: Ignore invalid attribute target.
8743 2007-02-18 Marek Safar <marek.safar@gmail.com>
8745 * cs-tokenizer.cs: Ignore '\0' as white space character.
8747 2007-02-17 Miguel de Icaza <miguel@novell.com>
8749 * cs-parser.jay: Add support for lambda expressions to the mcs
8752 * lambda.cs: Only clone when we are probing, not on the final call
8753 (Compatible is the final call).
8755 * statement.cs (CloneContext): Introduce class to provide block
8756 remapping during clone.
8758 All statements Clone themselves now.
8760 (Clone): special handling for blocks, when we clone a block, we
8761 register the block inside this routine, as children of the block
8762 might trigger a lookup.
8764 * expression.cs: Add support for CloneContext in all expressions.
8766 2007-02-17 Marek Safar <marek.safar@gmail.com>
8768 A fix for bug #80493
8769 * statement.cs: Report ambiguous warning when interfaces are not related.
8771 2007-02-15 Marek Safar <marek.safar@gmail.com>
8773 C# 3.0 extension methods.
8775 * attribute.cs (Error_MisusedExtensionAttribute): Extension attribute
8776 cannot be used directly.
8778 * class.cs (Class.Emit): Emit extension attribute if any class method
8779 is extension method.
8780 (Method.Define): Add basic extension method validation conditions.
8781 (Method.Emit): Emit extension attribute for method.
8783 * codegen.cs (AssemblyClass): Emit extension attribute if at least one
8784 extension method exists. Currently we follow same approach as Microsoft
8785 does, emit even if a method or a class are private but this can change
8788 * cs-parser.jay: Add handling of `this' keyword in method parameters
8791 * decl.cs (DeclSpace.IsStaticClass): New property.
8792 (MemberCache.FindExtensionMethods): Looks for extension methods with
8793 defined name and extension type.
8795 * doc.cs: Updated after OverloadResolve changes.
8797 * driver.cs: Add new soft reference to System.Core.dll.
8799 * ecore.cs (MethodLookup): Can return only MethodGroupExpr.
8800 (ExtensionMethodGroupExpr): Represents group of extension methods.
8802 * expression.cs (Invocation): Moved methods BetterConversion, MoreSpecific,
8803 BetterFunction, IsOverride, IsAncestralType, OverloadResolve
8804 to MethodGroupExpr and made non-static for easier customization.
8805 (Invocation.DoResolve): Add extension method lookup when no standard
8807 (MemberAccess.DoResolve): Try extension methods if no member exists.
8809 * modifiers.cs: Add METHOD_EXTENSION modifier.
8811 * namespace.cs (RegisterExtensionMethodClass): Register class namespace
8812 as well as candidate extension type.
8813 (ComputeNamespaces): When assembly constains extension methods registers
8815 (Namespace.RegisterExternalExtensionMethodClass): Register type for later
8816 extension method lookup.
8817 (Namespace.LookupExtensionMethod): Looks for extension method in this
8819 (NamespaceEntry.LookupExtensionMethod): Does extension methods lookup to
8820 find a method which matches name and extensionType.
8822 * parameter.cs (Parameter): Add This modifer.
8823 (HasExtensionMethodModifier): New property.
8824 (Resolve): Add extension parameter check.
8825 (ModFlags): turned to property to exclude this modifier as it is not real
8827 (Parameters): Implemented ExtensionMethodType and HasExtensionMethodType.
8829 * support.cs (ParameterData): Add ExtensionMethodType.
8830 (ReflectionParameters): Implemented ExtensionMethodType interface property.
8832 * typemanager.cs: Add type and ctor extension attribute type.
8834 2007-02-15 Miguel de Icaza <miguel@novell.com>
8836 * report.cs (DisableErrors, EnableErrors): used to prevent error
8837 output when we are "trying" to compile various methods with
8840 * ecore.cs (Expression): Add Clone method that calls the virtual
8841 CloneTo method. The current CloneTo method in Expression throws
8842 an exception so we can track down all the places where this must
8843 be implemented (not using abstract, because that would be a lot of
8844 up-front-work before we can start testing the implementation
8847 Important: we only need Clone capabilities for expressions created
8848 by the parser, as the expressions we will be cloning are
8849 expressions in the pre-resolved state. This vastly simplifies
8852 (SimpleName): Add CloneTo that does nothing.
8853 (EmptyCast): Add CloneTo.
8855 * expression.cs (Binary): Implement CloneTo.
8856 (Invocation.IsApplicable): Store the current ec in
8857 EmitContext.TempEc and restore it on return. This is used so we
8858 do not have to sprinkle hundres of methods with an extra
8859 EmitContext, we know that the only user is the lambda expression
8860 ImplicitConversionExists code.
8862 (Argument): Add Cloning capabilities.
8863 (LocalVariableReference, ParenthesizedExpression, Unary, Probe,
8864 Cast, Conditional, ArrayCreation, InvocationOrCast, Invocation,
8865 ArglistAccess, ArgList, TypeOf, SizeOf, CheckedExpr,
8866 UnCheckedExpr, ElementAccess, BaseAccess, BaseIndexerAccess,
8867 IndexerAccess): Add Clone capability.
8869 (LocalVariableReference, This): TODO: needs cloned Block mapping.
8871 (Argument): Add cloning capability.
8873 * assign.cs (Assign): Implement CloneTo.
8875 * anonymous.cs (ImplicitStandardConversionExists): Make virtual.
8877 * lambda.cs (ImplicitStandardConversionExists): Implement lambda
8878 version by calling Convert with the EmitContext (that we are
8879 currently storing in ec, this is not great, but will do for now,
8880 to avoid passing EmitContext parameters to hundreds of functions
8881 that do not need them now).
8883 (SetExpression): Remove, it is not needed.
8885 (ContextualReturn): Implement CloneTo.
8887 * statement.cs (Statement): Implement cloning infrastructure,
8888 similar to expressions.
8890 (Block): Partial implementation of Clone for statements.
8892 (Return): Implement clone.
8894 * constant.cs (Constant.CloneTo): New method, does nothing.
8896 * codegen.cs (TempEc): Add a static EmitContext as a temporary
8897 solution, until we decide how to exactly do this.
8899 2007-02-14 Marek Safar <marek.safar@gmail.com>
8901 A fix for bug #80493
8902 * class.cs (FindOutBaseMethod): When the base accessor does not exist and
8903 a property is override we need to use second accessor.
8905 2007-02-13 Marek Safar <marek.safar@gmail.com>
8907 A fix for bug #80418
8908 * attribute.cs, class.cs: Use correct calling conventions for pinvoke
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 Another fix for bug #80749
8924 * pending.cs: Abstract class has priority over interfaces.
8926 2007-02-13 Marek Safar <marek.safar@gmail.com>
8928 Another fix for bug #80749
8929 * pending.cs: Abstract class has priority over interfaces.
8931 2007-02-13 Marek Safar <marek.safar@gmail.com>
8933 * class.cs Better error message.
8935 * driver.cs: Add shorter versions of -optimize option.
8937 2007-02-13 Martin Baulig <martin@ximian.com>
8939 * class.cs (Constructor.Emit): Check the return value of
8940 ec.ResolveTopBlock() and return on error.
8942 2007-02-13 Raja R Harinath <rharinath@novell.com>
8944 * ecore.cs (Error_InvalidExpressionStatement): Add a comma to error
8945 message to fix error message regression.
8947 2007-02-12 Marek Safar <marek.safar@gmail.com>
8949 * delegate.cs: Delegate creation expression cannot be of Nullable type.
8951 2007-02-12 Marek Safar <marek.safar@gmail.com>
8953 A fix for bug #80749
8954 * assign.cs (FieldInitializer): FieldInitializer has to keep track of
8955 its parent container.
8957 * class.cs (DefineFieldInitializers): Each initializer can has different
8960 * const.cs: Updated.
8962 2007-02-11 Miguel de Icaza <miguel@novell.com>
8964 * lambda.cs (LambdaExpression.Compatible): Remove some early code,
8965 now all the heavy lifting to check that embedded statements or
8966 expressions have the right form is done in the ContextualReturn.
8968 (ContextualReturn): New class.
8970 * ecore.cs (Error_InvalidExpressionStatement): Make a helper
8971 method that can be invoked to report 201, so we do not replicate
8974 * cs-parser.jay: Reuse Error_InvalidExpressionStatement.
8976 * cs-tokenizer.cs (xtoken): Correctly compute the column, it was
8977 treating tabs as spaces.
8979 2007-02-09 Marek Safar <marek.safar@gmail.com>
8981 A fix for bug #80315 by martin.voelkle@gmail.com (Martin Voelkle)
8982 * assign.cs: Use full implicit conversion for right side check.
8984 2007-02-09 Marek Safar <marek.safar@gmail.com>
8986 * statement.cs (Switch): Switch over boolean type is not standardized.
8988 2007-02-08 Marek Safar <marek.safar@gmail.com>
8990 A fix for bug #80755
8991 * decl.cs (FindBaseEvent): Don't use method cache for events.
8993 2007-02-07 Marek Safar <marek.safar@gmail.com>
8995 * cs-parser.jay: Better syntax error handling.
8997 * ecore.cs, enum.cs, statement.cs, typemanager.cs: Print enum member name
8998 instead of underlying type value.
9000 2007-02-06 Marek Safar <marek.safar@gmail.com>
9002 * driver.cs: Check define identifier before is registered.
9004 * namespace.cs: Use existing error message.
9006 * report.cs: New warning.
9008 2007-02-06 Marek Safar <marek.safar@gmail.com>
9010 A fix for bug #80742
9011 * expression.cs: Delegate Invoke method can be called directly.
9013 2007-02-06 Marek Safar <marek.safar@gmail.com>
9015 A fix for bug #80676
9016 * class.cs (IsEntryPoint): The Main method can have params modifier.
9018 2007-02-04 Miguel de Icaza <miguel@novell.com>
9020 * parameter.cs (Parameter, Parameters): Add Clone method.
9022 * anonymous.cs (Compatible): Turn method into virtual method, so
9023 LambdaExpression can implement a different behavior.
9025 (CompatibleChecks, VerifyExplicitParameterCompatibility): Factor
9026 out the basic checking here, so it can be used by
9029 * lambda.cs: Introduce "Compatible" function that will do the
9032 2007-02-02 Marek Safar <marek.safar@gmail.com>
9034 * attribute.cs: Unified one error message.
9036 * class.cs (Class): Use type attributes and not properties to test static
9038 (IsEntryPoint): Don's pass local variable.
9040 * convert.cs: Removed duplicate check.
9042 * decl.cs, doc.cs, ecore.cs (LookupType): Renamed to LookupNamespaceOrType.
9044 * driver.cs: Don't crash when soft reference does not exist.
9046 * namespace.cs (EnsureNamespace): Renamed to RegisterNamespace.
9047 (UsingEntry): Removed redundant allocation.
9049 * parameter.cs: Add fast path for type parameters.
9051 * support.cs: Don't allocate attribute when it's not used.
9053 2007-01-30 Miguel de Icaza <miguel@novell.com>
9056 (AnonymousMethodExpression.ImplicitStandardConversionExists): turn
9057 this into a virtual method, so we can override it in LambdaExpression.
9059 * driver.cs: Improve diagnostics in case of failure.
9061 * cs-tokenizer.cs: Instead of trying to parse a type and a name,
9062 write a function that is slightly more complex and that parses:
9064 type identifier [, type identifier]* )
9066 The old function would return incorrectly a OPEN_PARENS_LAMBDA for
9069 (canEmpty ? i >= 0 : i > 0)
9071 2007-01-30 Raja R Harinath <rharinath@novell.com>
9073 * cs-tokenizer.cs (parse_namespace_or_typename): Don't throw an
9074 exception on possibly valid code.
9076 2007-01-29 Raja R Harinath <rharinath@novell.com>
9078 * cs-tokenizer.cs (is_punct) ['<']: Update to changes in
9080 (parse_opt_type_arguments): Remove. It's almost the same as
9082 (parse_namespace_or_typename): Use parse_less_than.
9084 2007-01-28 Miguel de Icaza <miguel@novell.com>
9086 * cs-tokenizer.cs: Typo fix, its not GMCS_SOURCES but GMCS_SOURCE,
9087 this bug took a few hours to find, because the state saved and
9088 restored by PushPosition and PopPosition was ignoring the state of
9089 parse_generic_less_than.
9091 I can also now remove the handling of OP_LT and OP_GT, this solves
9094 * cs-tokenizer.cs: store the location for the ARROW token, we use
9097 (PushPosition, PopPosition): save/restore also `current_token',
9098 restore `parse_generic_less_than' (was missing).
9100 (parse_opt_type_arguments): use parse_type, not
9101 parse_namespace_or_typename to parse types.
9103 * lambda.cs: Empty new file, will eventually have the lambda
9104 expression implementation.
9106 * lambda.test: used to test the internal tokenizer.
9108 * report.cs (FeatureIsNotISO1): Rename from
9109 FeatureIsNotStandardized, because it was about the language level
9110 (1 vs 2) it was not about standarization.
9112 (FeatureRequiresLINQ): New.
9114 * support.cs (SeekableStreamReader): Only require that the reader
9115 is a TextReader, not a StreamReader, so we can plug StringReader.
9117 * cs-tokenizer.cs (parse_type_and_parameter): Returns true if at a
9118 given position in the input stream the following tokens can be
9119 parsed as a type followed by an identifier.
9121 (is_punct): after a '(' if parse_type_and_parameter returns true,
9122 then return a special token OPEN_PARENS_LAMBDA which is used to
9123 avoid reduce/reduce errors in the grammar for the
9124 lambda_expression rules.
9126 (parse_type): implement a type parser inside the
9127 tokenizer, the parser only returns true or false depending on
9128 whether the input at a given position can be parsed as a type.
9130 (peek_token): new method used during type parsing.
9132 2007-01-28 Raja R Harinath <rharinath@novell.com>
9135 * anonymous.cs (ScopeInfo.InflateParameters): New.
9136 (AnonymousContainer.Resolve): Use it to redirect types of
9137 delegate parameters.
9139 2007-01-27 Raja R Harinath <rharinath@novell.com>
9142 * expression.cs (Error_InvalidArguments): Don't use two different
9143 messages for CS1503. Use ExtraInformation and
9144 SymbolRelatedToPreviousError instead.
9147 * decl.cs (DeclSpace.initialize_type_params): Don't access
9148 'type_params' of a partial class directly.
9150 2007-01-26 Miguel de Icaza <miguel@novell.com>
9152 * constant.cs: Removed a handful of out-of-range checks that were
9155 2007-01-25 Marek Safar <marek.safar@gmail.com>
9157 * expression.cs (CheckUselessComparison): Add additional check for char
9160 * namespace.cs: Fixed typo.
9162 2007-01-23 Miguel de Icaza <miguel@novell.com>
9164 * constant.cs: Bloat removal, CheckRange and CheckUnsigned are
9165 gone, instead we inline the test, preventing the needless casts to
9166 longs, ulongs and doubles for the parameters, avoiding calls to
9167 methods that overchecked stuff, and instead inlined things
9170 2007-01-20 Marek Safar <marek.safar@gmail.com>
9172 * cs-parser.jay: Better parameter error handling.
9174 2007-01-17 Marek Safar <marek.safar@gmail.com>
9176 A fix for bug #80368, #80522
9177 * expression.cs (ArrayCreation.only_constant_initializers): Indicates
9178 whether array initializer contains constants only.
9179 (ArrayCreation.Emit): Use better formula to decide when
9180 are array initializers for static initialization.
9181 (ArrayCreation.EmitDynamicInitializers): When the array is small enough we
9182 have to emit even constants otherwise they are pre-initialized.
9184 2007-01-17 Bill Holmes <bill.holmes@ansys.com>
9185 Raja R Harinath <rharinath@novell.com>
9187 Fix emit order of 'get' vs. 'set'.
9188 * support.cs (Accessors): New.
9189 * cs-parser.jay (accessor_declarations): Use it instead of 'Pair'.
9190 Note the order in which accessors are declared in the source.
9191 * class.cs (PropertyBase.DefineGet, PropertyBase.DefineSet): New.
9192 Refactored from Property.Define and Indexer.Define.
9193 (PropertyBase.DefineAccessors): New helper that calls the above in
9194 appropriate order as noted by the parser.
9195 (Property.Define, Indexer.Define): Update to changes.
9196 (PropertyBase.SetMethod.PropertyInfo): Don't return a null.
9198 2007-01-17 Raja R Harinath <rharinath@novell.com>
9200 Fix cs0029-6.cs and gcs0029-2.cs (regression)
9201 * ecore.cs (EmptyConstantCast.ConvertImplicitly): Check that
9202 there's an implicit conversion from the current type to the target
9203 type before converting the underlying constant.
9205 2007-01-16 Marek Safar <marek.safar@gmail.com>
9207 * const.cs (ResolveValue): Updated after constant conversion was made more
9210 * constant.cs (GetAttributableValue): constant to object conversion is
9211 used for attributes only.
9212 (IntConstant.ConvertImplicitly): Moved from convert to be used in all
9213 constant conversions.
9214 (LongConstant.ConvertImplicitly): Ditto.
9216 * convert.cs (ImplicitNumericConversion): Extracted constant bussiness.
9217 (ImplicitConversionStandard): Handle constant conversion as extra step.
9218 It solves the issue when constant conversion was called indirectly like
9219 inside array initializer and constant folding was skipped.
9221 * literal.cs (NullLiteral.ConvertImplicitly): Fixed an issue exposed by
9224 * statement.cs(ImplicitConversionStandard): Updated after constant
9225 conversion was made more generic.
9227 2007-01-16 Sergey P. Kondratyev <se@unicom.tomica.ru>
9229 * expression.cs (As.DoResolve): Use GenericConstraints instead of
9230 Constraints, solves the problem where the compiler incorrectly
9231 reported that a type parameter was not constrained to a class (Bug
9234 2007-01-14 Marek Habersack <grendello@gmail.com>
9236 * doc-bootstrap.cs: Fix a compilation problem in the bootstrap phase.
9238 2007-01-14 Marek Safar <marek.safar@gmail.com>
9240 A fix for bug #80368
9241 * assign.cs (FieldInitializer): New class implements field
9242 initializer statement.
9244 * attribute.cs: Update after FieldMember rename.
9246 * class.cs (PropertyBasedMember): New common class for property based
9248 (InterfaceMemberBase): New base class for all members which can be used as
9249 an interface members.
9250 (MethodCore): Moved really common code to InterfaceMemberBase.
9251 (Method.Define): Equal and GetHasCode detection is relevant for methods
9253 (MethodData.Define): Don't assume that public event implements an
9254 interface automatically.
9255 (MethodData.DefineMethodBuilder): Issue an error even if only extern
9257 (MemberBase): Moved all interface speficic code to InterfaceMemberBase.
9258 (FieldMember): Merged with FieldBase.
9259 (EventProperty.AEventPropertyAccessor): New specialization to check whether
9260 event extern modifier can be used.
9261 (EventField.EventFieldAccessor): Moved event field specific code here.
9262 (Event.AllowedModifiers): Even event can be extern.
9263 (Event.FindOutBaseMethod): New override specific to events.
9264 (Indexer.parameters): Reintroduce parameters because base class holds
9265 only properties common data.
9266 (Indexer.CheckForDuplications): Indexers are threated as methods so we
9267 need do extra parameters check.
9269 * const.cs: Update after FieldMember rename.
9271 * decl.cs (MemberCache.FindBaseEvent): New method.
9273 * doc.cs (GetMethodDocCommentName): Accept parameters as extra argument
9274 to reflect that indexer is now derived from PropertyBased.
9276 * ecore.cs (GetMemberType): Made public.
9277 (EventExpr.ResolveMemberAccess): Use right event cache and checks for
9280 * flowanalysis.cs, statement.cs: Update after FieldMember rename.
9282 * typemanager.cs (CSharpSignature): Correctly print event accessors.
9283 (RegisterEvent): Removed.
9284 (RegisterPrivateFieldOfEvent): Renamed to RegisterEventField.
9285 (GetPrivateFieldOfEvent): Renamed to GetEventField.
9287 2007-01-11 Raja R Harinath <rharinath@novell.com>
9290 * statement.cs (CollectionForeach.TryType): Prefer generic
9291 GetEnumerator over non-generic variant. Fix code to follow comments.
9293 2007-01-09 Raja R Harinath <rharinath@novell.com>
9296 * support.cs (ReflectionParameter): Don't use an invalid index on
9297 the generic parameter data.
9299 2007-01-08 Miguel de Icaza <miguel@novell.com>
9301 * driver.cs: Just add a tiny bit of infrastructure.
9303 2007-01-02 Marek Safar <marek.safar@gmail.com>
9305 * class.cs (VerifyMembers): Fixed an crash reported on mono mailing list
9306 where field type is struct from current assembly.
9308 * ecore.cs (EnumConstant.AsString): Report an enum member name whenever
9311 2007-01-02 Marek Safar <marek.safar@gmail.com>
9313 A fix for bug #80381
9314 * attribute.cs (AttributeTester.RegisterNonObsoleteType): Registers
9317 * namespace.cs (GlobalRootNamespace.LookupTypeReflection): Better error
9319 (Namespace.LookupType): Always use core types from corlib when speficied.
9321 * report.cs: A new warning.
9323 * rootcontext.cs (BootstrapCorlib_ResolveInterface,
9324 BootstrapCorlib_ResolveClass): Register type as non-obsolete type.
9325 (ResolveCore): Add missing System.Runtime.InteropServices._Attribute.
9327 * typemanager.cs (CoreLookupType): Register type as non-obsolete type.
9328 (InitCoreTypes): Set expression type of object_type and value_type
9329 immediately after lookup.
9331 2007-01-01 Miguel de Icaza <miguel@novell.com>
9333 * cs-tokenizer.cs: Accept Pc class characters (Connector
9334 Punctuation) as valid identifiers. Fixes #78259
9336 * expression.cs (Invocation.DoResolve): Moved the check for the
9337 use of `this' for doing method calls to the Invocation resolution
9338 step, after overload resolution has taken place instead of doing
9339 the check at the low-level `This.DoResolve' level.
9341 The `This.DoResolve'(appens before overload resolution, so it has
9342 no way of knowing if the method that will be called will be
9343 instace or static, triggering an erroneous report for cs0188 (Bug
9346 We now do the check for instance method invocations after we know
9347 what method will be called.
9349 (This.CheckThisUsage): Move the actual use of this structure
9350 checking into its own method and expose it.
9352 * Everywhere that called Error_ValueCannotBeConverted: pass a new
9355 Exceptions: Null.ConvertImplicitly,
9356 Constant.ImplicitConversionRequired as there are too many call
9357 sites for passing the ec.
9359 * ecore.cs (Expression.Error_ValueCannotBeConverted): Take an
9360 EmitContext, if the value is null, then we do not try to provide
9361 the extra information from the error (If a userdefined conversion
9362 exists, as UserDefinedConversion requires a non null-EmitContext).
9366 2006-12-30 Raja R Harinath <rharinath@novell.com>
9368 * flowanalysis.cs (MyBitVector): Document some invariants.
9369 (MyBitVector.Or, MyBitVector.And): Reimplement the optimizations
9370 introduced below, and add a couple of others,
9372 2006-12-30 Marek Safar <marek.safar@gmail.com>
9374 * attribute.cs (GetMethodObsoleteAttribute): Uses new
9375 GetPropertyFromAccessor and GetEventFromAccessor.
9377 * class.cs (MethodCore.CheckBase): A new warning when obsolete member
9378 overrides non-obsolete one.
9379 (Indexer.Define): Error message has been moved to the parser.
9381 * cs-parser.jay: Better syntax errors handling.
9383 * delegate.cs (NewDelegate.DoResolve): Issue less confusing error message
9384 when an invocation has no arguments.
9386 * ecore.cs: Removed not used caching.
9388 * expression.cs (IsSpecialMethodInvocation): Reuses TypeManager
9391 * report.cs: Add a new warning.
9393 * support.cs (ReflectionParameters): Implements Equals, GetHashCode.
9395 * typemanager.cs (enumeration_type): Removed.
9396 (CSharpSignature): Reuses IsSpecialMethod.
9397 (IsEqual): Hack for MS BCL.
9398 (GetPropertyFromAccessor): New method.
9399 (GetEventFromAccessor): New method.
9400 (IsSpecialMethod): Fixed to handle more cases.
9402 2006-12-30 Marek Safar <marek.safar@gmail.com>
9404 * cs-tokenizer.cs (PreProcessDefinition, handle_preprocessing_directive):
9405 Made white spaces array static.
9407 * ecore.cs (RemoveGenericArity): Optimized.
9409 * flowanalysis.cs (MyBitVector.Or, MyBitVector.And): Optimized (up to
9411 (MyBitVector.initialize_vector): Simplified.
9413 2006-12-22 Miguel de Icaza <miguel@novell.com>
9415 * ecore.cs: Am not entirely happy with this hack, but it seems to
9416 address the issue in 80257 (a small test case for
9419 I set the MethodGroupExpr.Type to an internal compiler type
9420 (itself in this case) to force the resolution to take place. Why
9421 it does not take place with a null is beyond me.
9423 2006-12-20 Marek Safar <marek.safar@gmail.com>
9425 A fix for bug #80288
9426 * expression.cs (ResolveOperator): Consider user defined conversion for
9427 logical and operator too.
9428 (EmitBranchable): Optimization for logical and when full constant folding
9429 could not be applied but one operand is constant.
9431 2006-12-19 Marek Safar <marek.safar@gmail.com>
9433 * class.cs (GetClassBases): Write 5 times every day, will never use
9434 FullName for error reporting.
9436 * decl.cs (AsAccessible, CheckAccessLevel): Always unpack arrays first.
9438 2006-12-19 Martin Baulig <martin@ximian.com>
9440 * statement.cs (LocalInfo.EmitSymbolInfo): New public method; emit
9441 the symbol file info here.
9443 2006-12-18 Marek Safar <marek.safar@gmail.com>
9445 * cs-tokenizer.cs (handle_preprocessing_directive): When previous section
9446 of `elseif' is taking then following sections are not taking.
9447 Fixes an issue reported on mono mailing list.
9449 2006-12-18 Marek Safar <marek.safar@gmail.com>
9451 A fix for bug #80300
9452 * cs-tokenizer.cs (PreProcessDefinition): Do no define/undefine when
9453 a caller is not taking.
9455 2006-12-18 Raja R Harinath <rharinath@novell.com>
9457 * anonymous.cs: Change several TypeContainer declarations to DeclSpace.
9458 (CompilerGeneratedClass): Use parent.PartialContainer unconditionally.
9459 (RootScopeInfo, AnonymousMethodMethod): Update to changes.
9460 * iterator.cs: Change several TypeContainer declarations to DeclSpace.
9461 * class.cs: Update to changes.
9463 2006-12-17 Marek Safar <marek.safar@gmail.com>
9465 A fix for bug #79934
9466 * anonymous.cs (CompilerGeneratedClass): Register class in a shared
9469 * class.cs (ResolveMembers): Register an iterator in current container and
9472 2006-12-16 Raja R Harinath <rharinath@novell.com>
9475 * expression.cs (VerifyArgumentsCompat): Allow zero arguments to
9476 satisfy a params annotated parameter.
9478 2006-12-16 Marek Safar <marek.safar@gmail.com>
9480 A fix for bug #77014
9481 * expression.cs (Invocation.BetterFunction): Fixed to cope with dynamic
9482 paramters correctly and not rely on hacks in Parameters class.
9483 (Invocation.IsParamsMethodApplicable): Changed to accept params parameter
9485 (Invocation.VerifyArgumentsCompat): Ditto.
9486 (Invocation.EmitArguments): Changed to correctly emit params arguments at
9489 * parameter.cs (HasParams): Don't assume that params is the last one.
9491 * support.cs (ReflectionParameters.ctor): Look for params attribute
9493 (ReflectionParameters.ParameterType): Removed hack when we returned last
9494 parameter for out of range parameters.
9495 (ParameterName, ParameterModifier): Ditto.
9497 2006-12-14 Marek Safar <marek.safar@gmail.com>
9499 A fix for bug #79987
9500 * decl.cs (DeclSpace.VerifyClsCompliance): External names cache is null
9501 when assembly is not CLS compliant but type is. I have no idea why is this
9504 * typemanager.cs (Reset): Invalidate AllClsTopLevelTypes cache.
9506 2006-12-13 Miguel de Icaza <miguel@novell.com>
9508 * class.cs (ConstructorInitializer.Resolve): Allow for ":this()"
9509 in struct constructors, they are basically no-ops.
9511 2006-12-12 Marek Safar <marek.safar@gmail.com>
9513 * cs-tokenizer.cs (Position): Save preprocessor status too.
9515 2006-12-12 Marek Safar <marek.safar@gmail.com>
9517 A fix for bug #77794
9518 * cs-tokenizer.cs (consume_identifier): Check for correct partial context.
9520 2006-12-12 Marek Safar <marek.safar@gmail.com>
9522 * cs-tokenizer.cs (get_cmd_arg): Support CR as the line terminator.
9524 (pp_expr): Report error for an invalid expression.
9525 (handle_preprocessing_directive): Simplified; add more error checking.
9527 2006-12-11 Marek Safar <marek.safar@gmail.com>
9529 A fix for bug #74939
9530 * cs-tokenizer.cs (is_punct): We cannot simply disable preprocessor
9531 directives handling.
9533 2006-12-10 Marek Safar <marek.safar@gmail.com>
9535 A fix for bugs #80093, and #75984
9536 * cs-tokenizer.cs (handle_preprocessing_directive): Fixed #if/#else/#endif
9537 logic, it seems to me as it worked before "by coincidence".
9538 (xtoken): Simplified to use reworked handle_preprocessing_directive.
9539 (cleanup): Enabled endif check.
9541 2006-12-09 Marek Safar <marek.safar@gmail.com>
9543 A fix for bug #80162
9544 * statement.cs (CollectionForeach.TryType): Generics and non-generics
9545 enumerators are never ambiguous.
9547 2006-12-08 Raja R Harinath <rharinath@novell.com>
9550 * cs-tokenizer.cs (parse_less_than): Recognize double-colons too.
9552 2006-12-06 Marek Safar <marek.safar@gmail.com>
9554 A fix for bug #80144
9555 * class.cs (EventProperty.Define): Explicit implementation means
9556 that an even is used.
9558 2006-12-06 Marek Safar <marek.safar@gmail.com>
9560 Fixes the operators implementation (part II)
9562 * cfold.cs (DoConstantNumericPromotions): Renamed to
9563 DoBinaryNumericPromotions and simplified.
9564 (BinaryFold): Couple of conversion fixes; simplified.
9566 * constant.cs, ecore.cs, literal.cs
9567 (ToType): Renamed to ConvertImplicitly.
9568 (Reduce): Renamed to ConvertExplicitly.
9570 * class.cs, convert.cs: Updated.
9572 * expression.cs: TryReduce doesn't throw an exception.
9574 2006-12-01 Marek Safar <marek.safar@gmail.com>
9576 A fix for bug #80108
9577 * ecore.cs (EventExpr.EmitAddOrRemove): Don't crash when right side is not
9580 2006-11-30 Marek Safar <marek.safar@gmail.com>
9582 Fixes unary operators implementation (part I)
9585 * cfold.cs (Error_CompileTimeOverflow): Made internal
9587 * const.cs (IConstant): Changed to use reference to constant and
9588 not constant itself.
9589 Updated IConstant implementations.
9591 * constant.cs (CreateConstant): New factory method.
9592 Updated IConstant implementation.
9594 * convert.cs (ImplicitStandardConversionExists): Uses compiler Equals.
9596 * ecore.cs: Updated to use CreateConstantReference.
9598 * enum.cs: Reflects IConstant changes.
9600 * expression.cs (Unary): Reimplemented +,-,~ to conform C# standard.
9602 * literal.cs (NullConstant): Change to be independently usable.
9604 2006-11-29 Martin Baulig <martin@ximian.com>
9606 * class.cs (Constructor.Emit): Correctly handle anonymous methods;
9607 we need to emit the scope initializer before calling the base .ctor.
9609 * anonymous.cs: Merged back from the new anonymous methods branch.
9610 (AnonymousMethodHost): Renamed to `RootScopeInfo'.
9612 * expression.cs (ParameterReference.DoResolveBase): Create a
9613 "normal" ScopeInfo when capturing parameters rather than using the
9614 root scope; this makes things work with anonymous methods having
9618 (ToplevelBlock.AnonymousMethodHost): Renamed into `RootScope'.
9620 2006-11-22 Marek Safar <marek.safar@gmail.com>
9622 A fix for bug #79987
9623 * class.cs (VerifyClsCompliance): Move redundant CLS compliance attribute
9624 check to a base class.
9625 * decl.cs (VerifyClsCompliance): Warn that CLS compliance cannot be tested
9626 only when assembly has missing attribute.
9627 * report.cs: Update.
9629 2006-11-21 Marek Safar <marek.safar@gmail.com>
9631 * cs-tokenizer.cs: Merged with gmcs version.
9633 2006-11-20 Marek Safar <marek.safar@gmail.com>
9636 * cs-parser.jay: Better error message when partial keyword is misplaced.
9638 2006-11-19 Gert Driesen <drieseng@users.sourceforge.net>
9640 A fix for bug #79810
9641 report.cs: CS1058 only applies to 2.0 profile (gmcs).
9642 codegen.cs: on 2.0 profile, non-exception throwables are wrapped in
9643 a RuntimeWrappedException by default.
9645 2006-11-18 Marek Safar <marek.safar@gmail.com>
9647 A fix for bug #79843
9648 * delegate.cs (Delegate.VerifyMethod): Fixed covariance and contravariance
9650 (DelegateCreation.Error_NoMatchingMethodForDelegate): Ditto.
9652 2006-11-18 Marek Safar <marek.safar@gmail.com>
9654 * driver.cs, namespace.cs: Uses faster IndexOf version.
9656 2006-11-17 Marek Safar <marek.safar@gmail.com>
9658 A fix for bug #79941
9659 * class.cs (MemberCore.IsDuplicateImplementation): Add more tricks for
9661 (Operator.Define): Implicit/Explicit operator of same type is duplicate
9662 even if internal name is different.
9663 * convert.cs (GetConversionOperator): Replaced EmitContext with parentType.
9664 (UserDefinedConversion): Simplified as the operators cannot be internal.
9665 * ecore.cs (Error_ValueCannotBeConverted): Take account of user
9667 (MethodLookup): Replaced EmitContext with parentType.
9668 * expression.cs: Updated.
9670 2006-11-09 Raja R Harinath <rharinath@novell.com>
9672 * driver.cs (BadAssembly): Handle all the ugliness of
9673 DefineDynamicAssembly.
9675 2006-11-08 Raja R Harinath <rharinath@novell.com>
9677 Address parts of #58244 -- most of what's left is in the runtime
9678 * driver.cs (LoadAssembly): Simplify slightly. Add CS0009 and
9679 CS1509 error checks, and handle them for all assembly loads, not
9680 just the first invocation.
9681 (LoadModule): Likewise. Move handling of 'adder_method' ...
9682 * codegen.cs (AssemblyClass.AddModule): ... here.
9684 2006-11-02 Marek Safar <marek.safar@gmail.com>
9686 * statement.cs.cs (CollectionForeach.TryType): Issue a error when
9687 IEnumerable<T> is ambiguous.
9689 2006-10-31 Marek Safar <marek.safar@gmail.com>
9691 A fix for bug #67689
9692 * statement.cs.cs (CollectionForeach.TryType): Issue a warning when
9693 GetEnumerator is ambiguous.
9695 * report.cs: Add new warning.
9697 2006-10-29 Marek Safar <marek.safar@gmail.com>
9699 A fix for bug #78602
9700 ecore.cs (PropertyExpr.InstanceResolve): The qualifier for access
9701 to protected member can be nested type.
9703 2006-10-28 Marek Safar <marek.safar@gmail.com>
9705 A fix for bug #78965
9706 ecore.cs (PropertyExpr.InstanceResolve): The qualifier for access
9707 to protected member must derive from current type.
9709 2006-10-27 Marek Safar <marek.safar@gmail.com>
9711 assign.cs: Reuses error method.
9713 ecore.cs (Expression.Error_ValueCannotBeConverted): Report a value
9714 instead of type for constants.
9715 (Expression.Error_ValueAssignment): Common error method.
9717 * expression.cs (UnaryMutator.ResolveOperator): Value cannot be used
9720 2006-10-27 Marek Safar <marek.safar@gmail.com>
9722 A fix for bug #79081
9723 * expression.cs (MemberAccess.DoResolve): Check nested type
9726 2006-10-27 Atsushi Enomoto <atsushi@ximian.com>
9728 * doc.cs : nested delegates were not handled. Fixed bug #79754.
9730 2006-10-26 Marek Safar <marek.safar@gmail.com>
9732 A fix for bug #76591
9733 * cs-tokenizer.cs (IsCastToken): Enable a cast of anonymous method.
9735 2006-10-26 Marek Safar <marek.safar@gmail.com>
9737 * codegen.cs (AssemblyClass.ApplyAttributeBuilder): Don't allow to have
9738 type forwarder of the same type multiple times.
9740 2006-10-26 Raja R Harinath <rharinath@novell.com>
9743 * ecore.cs (PropertyExpr.InstanceResolve): Always resolve the
9744 instance as an rvalue, even when we later resolve as an lvalue.
9746 2006-10-25 Martin Baulig <martin@ximian.com>
9748 * anonymous.cs: Fix #79673.
9750 2006-10-24 Marek Safar <marek.safar@seznam.cz>
9752 A fix for bug #79666
9753 expression.cs (ArrayCreation.GetAttributableValue): An initializer can be
9754 ignored when is optimized (= default value) as its value is already set.
9756 2006-10-23 Marek Safar <marek.safar@seznam.cz>
9758 A fix for bug #79724
9759 * report.cs (SymbolRelatedToPreviousError): Uses DeclSpace instead of
9760 TypeContainer for type lookup.
9762 2006-10-23 Marek Safar <marek.safar@seznam.cz>
9764 A fix for bug #79231
9765 * ecore.cs (ResolveAsBaseTerminal): Removed redundant error test.
9766 * expression.cs (OverloadResolve): Always convert type name for
9768 (ResolveNamespaceOrType): Don't confuse a nested type with any
9771 2006-10-18 Martin Baulig <martin@ximian.com>
9773 * anonymous.cs: Propagate the IsStatic state, fixes the crasher in banshee.
9775 2006-10-17 Miguel de Icaza <miguel@novell.com>
9777 * convert.cs: Fix typo, fixes the test-535.cs, we were casting to
9778 an int32, but requesting an int64 from the conversion
9780 2006-10-12 Martin Baulig <martin@ximian.com>
9783 (AnonymousContainer.Resolve): Inflate the `ReturnType'. Fixes #79592.
9785 2006-10-12 Martin Baulig <martin@ximian.com>
9788 (Using.EmitLocalVariableDeclFinally): Small fix for iterators.
9790 2006-10-11 Miguel de Icaza <miguel@novell.com>
9792 * convert.cs: Remove broken code: I was doing the "Existance"
9793 tests for Implicit conversions.
9795 2006-10-10 Miguel de Icaza <miguel@novell.com>
9797 * convert.cs: Added one missing case in
9798 ImplicitStandardConversionExists uint64 to intptr.
9802 * typemanager.cs (uintptr_type): another core known type.
9804 * ecore.cs (OperatorCast): routine used to do cast operations that
9805 depend on op_Explicit. We could change some of the Decimal
9806 conversions to use this.
9808 This one has a probe mechanism that checks both types for an op_
9809 which it coudl be used to eliminate two classes: CastToDecimal
9810 and CastFromDecimal.
9812 * convert.cs: Implement the conversions documented in #59800
9814 2006-10-10 Martin Baulig <martin@ximian.com>
9816 * iterators.cs (Iterator.Resolve): Call RootScope.ResolveType()
9817 before RootScope.ResolveMembers().
9819 * anonymous.cs (ScopeInfo.CapturedScope.ctor): Use the child's
9820 `CurrentType' if appropriate.
9822 2006-10-09 Marek Safar <marek.safar@seznam.cz>
9824 A fix for bug #78568
9825 * cs-tokenizer.cs (Deambiguate_CloseParens): Expression cannot be cast
9826 when contains binary operators.
9827 * cs-parser.jay: Updated.
9829 2006-10-09 Martin Baulig <martin@ximian.com>
9832 (Delegate.DefineType): Don't call TypeParameter.Resolve() here;
9833 moved that into Define() and also do the other type parameter
9834 checks there. Fixes #79094. Added gtest-292.cs.
9837 (ArrayCreation.EmitDynamicInitializers): Use `etype.IsValueType'
9838 since that doesn't include type parameters; don't use `Ldelema'
9839 for type parameters. Fixes #78980. Added gtest-293.cs.
9841 2006-10-08 Marek Safar <marek.safar@seznam.cz>
9844 * convert.cs (ExplicitReferenceConversion): Only enum to enum value
9845 conversion is allowed.
9847 2006-10-06 Marek Safar <marek.safar@seznam.cz>
9849 * ecore.cs (Expression.MemberLookup): Don't register any symbol for
9850 error reporting when no error occurs.
9852 2006-10-06 Marek Safar <marek.safar@seznam.cz>
9854 * cfold.cs (ConstantFold.BinaryFold): Report an error when the conversion
9857 2006-10-06 Raja R Harinath <rharinath@novell.com>
9860 * class.cs (DefineTypeBuilder): Check circular dependencies before
9861 setting the parent of the TypeBuilder.
9862 (CheckRecursiveDefinition): Don't use 'BaseType', since
9863 it may not be valid until after DefineTypeBuilder. Use
9864 'base_type' instead.
9866 2006-10-04 Martin Baulig <martin@ximian.com>
9868 Merged the Anonymous Methods patch.
9870 * anonymous.cs, iterators.cs: The new anonymous methods code.
9872 * statement.cs (Variable): New public abstract class.
9873 (LocalInfo.Variable): New public property.
9874 (LocalInfo.ResolveVariable): New public method.
9875 (Block.Flags): Add `IsIterator'.
9876 (Block.AddVariable): Improved the CS0136 check.
9877 (Block.AnonymousChildren): New public property.
9878 (Block.AddAnonymousChild): New public method.
9879 (ToplevelBlock): Update to use the new anonymous method framework.
9880 (ToplevelBlock.ctor): `container' is now a `Block' and not a
9881 `ToplevelBlock'; this is required to correctly implement the
9883 (Fixed, Using): Use `TemporaryVariable' instead of directly
9884 creating the `LocalBuilder'.
9886 * parameter.cs (Parameter.ResolveVariable): New public method.
9887 (Parameters.ResolveVariable): Likewise.
9889 * ecore.cs (TemporaryVariable): Use the new `Variable' framework.
9891 * class.cs (TypeContainer): Replaced the `iterators' list and
9892 corresponding methods with a list of `CompilerGeneratedClass'es.
9893 (TypeContainer.ResolveMembers): New public method.
9894 (Method): `IIteratorContainer' has been replaced by
9897 * expression.cs (VariableReference): New public abstract base
9898 class for `LocalVariableReference', `ParameterReference' and
9901 * codegen.cs (EmitContext): Removed `capture_context',
9902 `HaveCaptureInfo', `EmitScopeInitFromBlock()' and `Capture*()'.
9903 (EmitContext.EmitThis): Removed.
9905 * cs-parser.jay: Replace `iterator_container' with
9908 2006-10-04 Martin Baulig <martin@ximian.com>
9910 * generic.cs (GenericMethod): Don't make this abstract.
9911 (Constraints.Clone): Added dummy implementation.
9913 2006-10-04 Raja R Harinath <harinath@gmail.com>
9916 * namespace.cs (LookForAnyGenericType): Avoid nullref on
9917 'declspaces'. Avoid allocating arrays willy-nilly.
9920 * cfold.cs (BinaryFold): Move boolean Equality and Inequality
9921 cases out of the switch.
9923 2006-09-28 Marek Safar <marek.safar@seznam.cz>
9925 * namespace.cs (Namespace.Error_NamespaceDoesNotExist): Better error
9926 message when non-generic type is used with the type arguments.
9927 * expression.cs: Updated.
9929 2006-09-28 Raja R Harinath <rharinath@novell.com>
9932 * convert.cs (Convert.ImplicitStandardConversionExists): Avoid infloop.
9933 * expression.cs (EmptyExpression.Grab, EmptyExpression.Release):
9934 Change semantics slightly. Don't insist on having only one
9935 temporary EmptyExpression -- just throttle the creation of new ones.
9938 * ecore.cs (Expression.MemberLookup): Enable CS0229 errors for
9939 non-interfaces too. If no methods are found, don't try to create
9942 2006-09-28 Marek Safar <marek.safar@seznam.cz>
9944 * ecore.cs (ResolveAsTypeStep): Print better error when type can be
9947 * namespace.cs (Namespace.LookForAnyGenericType): New method to help
9948 us produce better error message.
9950 2006-09-27 Marek Safar <marek.safar@seznam.cz>
9952 * expression.cs (Binary.ResolveOperator): Warn about a side effect
9953 of the `|' operator.
9955 * report.cs: A new warning added.
9957 2006-09-27 Martin Baulig <martin@ximian.com>
9959 * generic.cs (GenericMethod): Don't make this abstract.
9961 2006-09-27 Martin Baulig <martin@ximian.com>
9964 (InternalErrorException): Added overloaded ctor taking a params array.
9966 2006-09-26 Marek Safar <marek.safar@seznam.cz>
9968 * class.cs, codegen.cs, const.cs, cs-tokenizer.cs, driver.cs, ecore.cs:
9969 Fixed the cases when same error was reported twice.
9971 * report.cs (SymbolRelatedToPreviousError): Simplified as all our messages
9972 now report symbol information.
9974 2006-09-25 Martin Baulig <martin@ximian.com>
9976 * class.cs: Completely unified with the gmcs version.
9978 2006-09-25 Martin Baulig <martin@ximian.com>
9980 * typemanager.cs (TypeManager.IsNullableType): New public function.
9981 (TypeManager.IsNullableTypeOf): Likewise.
9982 (TypeManager.IsNullableValueType): Likewise.
9984 * class.cs (MethodCore): Added the `GenericMethod' argument from
9985 gmcs and also unified all classes derived from `MethodCore' with gmcs.
9987 2006-09-24 Raja R Harinath <harinath@gmail.com>
9989 * convert.cs: Unify with gmcs version.
9991 2006-09-24 Marek Safar <marek.safar@seznam.cz>
9993 * decl.cs (DeclSpace.VerifyClsCompliance): When type has type parameters
9994 verify them as well.
9996 * report.cs: New warning.
9998 2006-09-24 Marek Safar <marek.safar@seznam.cz>
10000 * anonymous.cs (AnonymousMethod.Compatible): Cannot generate arguments
10001 for anonymous block with out argument.
10003 2006-09-24 Marek Safar <marek.safar@seznam.cz>
10005 * class.cs (ClassOrStruct.VerifyMembers): Fixed to report correctly
10006 not used private events only.
10008 2006-09-23 Marek Safar <marek.safar@seznam.cz>
10010 * cfold.cs (BinaryFold): On the guest to unify empty constant cast.
10012 * const.cs (Const.Define): Check for constant type.
10013 (Const.IsConstantTypeValid): Looks for valid constant types.
10015 * convert.cs (ImplicitReferenceConversion): NullCast to EmptyConstantCast.
10017 * ecore.cs (EmptyConstantCast): New common class for all constant based
10020 * expression.cs (Is.DoResolve): Handle null constant especially.
10021 (New.DoResolve): Check for new void().
10022 (MemberAccess.DoResolve): Cope with all kind of nulls.
10024 * literal.cs (NullConstant): Uses EmptyConstantCast.
10025 (NullDefault): Based on EmptyConstantCast.
10026 (NullLiteral): Uses EmptyConstantCast.
10028 * statement.cs (Block.ResolveMeta): Check for constant type.
10030 2006-09-22 Martin Baulig <martin@ximian.com>
10032 * delegate.cs, attribute.cs: Merged with the gmcs versions.
10034 2006-09-22 Raja R Harinath <rharinath@novell.com>
10036 * literal.cs (NullDefault): The type of default(IFoo) is 'IFoo',
10040 * typemanager.cs (Closure.Filter): Consider PrivateScope attributes.
10041 * decl.cs (DeclSpace.FindMemberToOverride): Likewise. Reorganize
10044 2006-09-22 Martin Baulig <martin@ximian.com>
10046 * ecore.cs: Merged with the gmcs version.
10048 * generic.cs (ConstructedType): New dummy class.
10049 (TypeArguments): Don't make this abstract.
10052 (TypeManager.IsGenericTypeDefinition): New method.
10053 (TypeManager.GetGenericFieldDefinition): Moved here from gmcs.
10055 2006-09-22 Raja R Harinath <rharinath@novell.com>
10057 * expression.cs (ComposedCast): Check for arrays of TypedReference
10058 before creating the type, not after.
10060 2006-09-21 Marek Safar <marek.safar@seznam.cz>
10062 * cfold.cs, const.cs, enum.cs, statement.cs: Updated
10063 after ToType change.
10065 * constant.cs (Constant.ImplicitConversionRequired): Designed to used
10066 when constant must be implicitly convertible.
10068 * convert.cs (ImplicitReferenceConversion): Reuse ToType.
10070 * ecore.cs (NullCast): Derives from NullConstant.
10072 * expression.cs (Is.DoResolve): Removed useless variables.
10073 (Conditional.DoResolve): Quick hack for `Foo () ? null : null'.
10074 (New.Constantify): Add enum support.
10075 (MemberAccess.DoResolve): Add warning when accessing null constant or
10078 * generic.cs (GenericConstraints.IsReferenceType): Another dummy
10081 * literal.cs (NullConstant): New abstract class with common
10082 functionality for all null specializations.
10083 (NullDefault): Represents default(X) when result can be
10085 (NullLiteral): Updated.
10087 * report.cs: Add new warning.
10089 2006-09-21 Martin Baulig <martin@ximian.com>
10091 * generic.cs (GenericTypeParameterBuilder): Removed this ugly hack.
10093 2006-09-21 Martin Baulig <martin@ximian.com>
10095 * generic.cs (GenericConstraints): New dummy class.
10096 (Constraints): Likewise.
10097 (TypeParameter): Likewise.
10098 (TypeParameterName): Likewise.
10099 (GenericMethod): Likewise.
10101 * typemanager.cs (TypeManager.GetGenericArguments): New method.
10103 * decl.cs: Merged with the gmcs version.
10105 2006-09-21 Raja R Harinath <rharinath@novell.com>
10107 * generic.cs (TypeParameter): Implement IMemberContainer.
10108 (GenericTypeParameterBuilder): New. An abominable repugnant hack.
10110 * rootcontext.cs: Unify with gmcs version.
10112 * report.cs: Unify with gmcs version.
10113 * typemanager.cs (AddTypeParameter, LookupTypeParameter): Move
10114 from gmcs/generics.cs.
10115 * generics.cs (TypeParameter): New dummy class.
10117 * support.cs: Unify with gmcs version.
10119 2006-09-20 Raja R Harinath <rharinath@novell.com>
10121 * ecore.cs (MethodGroupExpr.ResolveGeneric): New dummy method.
10122 * expression.cs (MemberAccess, BaseAccess): Remove GMCS_SOURCE #ifdef.
10124 * decl.cs (MemberName): Unify with gmcs, except for GetTypeExpression.
10125 * generic.cs (TypeArguments): New dummy class to help avoid #ifdefs.
10126 * mcs.exe.sources: Add generic.cs.
10128 * codegen.cs: Unify with gmcs version.
10130 * codegen.cs (IResolveContent.GenericDeclContainer): Copy from gmcs.
10131 (EmitContext): Add GenericDeclContainer implementation.
10132 * decl.cs (MemberCore, DeclSpace): Likewise.
10133 * namespace.cs: Remove #ifdef GMCS_SOURCE.
10135 * namespace.cs (GetTypeInAssembly): Remove #ifdef GMCS_SOURCE.
10136 MCS TypeManager has a corresponding dummy method.
10138 2006-09-19 Martin Baulig <martin@ximian.com>
10140 * expression.cs: Completely merged with the gmcs version.
10142 2006-09-19 Martin Baulig <martin@ximian.com>
10144 * expression.cs (Invocation): Merged with the gmcs version.
10145 (ArrayAccess.GetStoreOpcode): Likewise.
10147 2006-09-19 Martin Baulig <martin@ximian.com>
10150 (TypeManager.IsGenericMethod): Moved here from ../gmcs/generic.cs.
10151 (TypeManager.IsGenericMethodDefinition): Likewise.
10153 2006-09-19 Martin Baulig <martin@ximian.com>
10156 (TypeManager.IsEqual): Moved the gmcs implementation here.
10157 (TypeManager.DropGenericTypeArguments): Likewise.
10158 (TypeManager.DropGenericMethodArguments): Likewise.
10159 (TypeManager.GetTypeArguments): Moved here from gmcs.
10160 (TypeManager.HasGenericArguments): Likewise.
10162 2006-09-19 Martin Baulig <martin@ximian.com>
10164 * expression.cs (Binary): Merged with the gmcs version.
10166 2006-09-19 Martin Baulig <martin@ximian.com>
10168 * expression.cs (Probe, As, Is): Merged with the gmcs version.
10170 2006-09-19 Martin Baulig <martin@ximian.com>
10172 * typemanager.cs: Merged with the gmcs version.
10174 2006-09-16 Raja R Harinath <rharinath@novell.com>
10176 * AssemblyInfo.cs [GMCS_SOURCE]: Unify with gmcs source.
10177 * driver.cs: Likewise.
10179 2006-09-16 Marek Safar <marek.safar@seznam.cz>
10182 * class.cs (MethodCore.VerifyClsCompliance): Do check for abstract members
10183 only if parent type is class.
10184 * decl.cs (MemberCore.GetClsCompliantAttributeValue): Fixed missing cache
10187 2006-09-15 Marek Safar <marek.safar@seznam.cz>
10190 * expression.cs(MemberAccess.DoResolve): Don't crash when not allowed
10192 * typemanager.cs(CSharpName): Converts NullType to null.
10194 2006-09-15 Martin Baulig <martin@ximian.com>
10197 (TypeManager.GetMethodName): Added mcs implementation.
10198 (TypeManager.IsEqual): Likewise.
10201 (SimpleName.RemoveGenericArity): Added dummy implementation.
10203 * pending.cs: Merged with the gmcs version.
10205 2006-09-15 Martin Baulig <martin@ximian.com>
10207 * statement.cs: Merge with the gmcs version.
10209 2006-09-15 Martin Baulig <martin@ximian.com>
10211 * statement.cs (Switch): Merge with the gmcs implementation
10212 (without nullables), which is newer.
10214 2006-09-15 Martin Baulig <martin@ximian.com>
10216 * statement.cs (Block.Variables): Make this public.
10217 (ToplevelBlock.Parameters): Make this a property.
10218 (Throw.Resolve): Use `TypeManager.IsSubclassOf ()'.
10220 2006-09-15 Martin Baulig <martin@ximian.com>
10222 * namespace.cs: Merge with the gmcs version.
10224 2006-09-15 Martin Baulig <martin@ximian.com>
10226 * decl.cs (MemberName): Minor code cleanups.
10228 2006-09-15 Martin Baulig <martin@ximian.com>
10230 * parameter.cs: Merge with the gmcs version.
10232 2006-09-15 Martin Baulig <martin@ximian.com>
10234 * enum.cs: Merge with the gmcs version: 3005 is a warning in gmcs
10235 and an error in mcs.
10237 2006-09-15 Martin Baulig <martin@ximian.com>
10239 * flowanalysis.cs: Merged from GMCS; added the generics code into
10240 a `GMCS_SOURCE' conditional so we can share this file.
10242 2006-09-08 Martin Baulig <martin@ximian.com>
10244 * typemanager.cs (TypeManager.interlocked_type): New public field.
10245 (TypeManager.int_interlocked_compare-exchange): New public field.
10246 (TypeManager.InitEnumUnderlyingTypes): Also initialize the
10247 enumerator types here and call InitGenericCoreTypes().
10248 (TypeManager.InitCoreTypes): Call InitEnumeratorTypes() right
10249 after calling InitEnumUnderlyingTypes().
10252 (RootContext.ResolveCore): Added `System.Threading.Interlocked' to
10253 `classes_second_stage'.
10255 2006-09-14 Marek Safar <marek.safar@seznam.cz>
10257 * assign.cs, ecore.cs, expression.cs: Share error message text.
10258 * class.cs (FieldMember.Define): Check for varible of static type.
10259 * driver.cs (LoadAssembly): Uses error output for errors.
10260 * statement.cs: Updated.
10262 2006-09-08 Marek Safar <marek.safar@seznam.cz>
10264 * expression.cs (Error_OperatorCannotBeApplied): Report type instead of
10267 2006-09-07 Martin Baulig <martin@ximian.com>
10270 (MainDriver): Revert r62663 from Marek; see #70506 for details.
10272 2006-08-29 Miguel de Icaza <miguel@novell.com>
10274 * cs-parser.jay: Turn 1522 into a warning, instead of an error #79210
10276 2006-08-17 Miguel de Icaza <miguel@novell.com>
10278 * cs-tokenizer.cs: Apply patch from Atsushi Enomoto that fixes
10279 #52019 and #79064, the use of the \uXXXX sequence in source code
10280 to represent unicode characters.
10282 2006-08-15 Marek Safar <marek.safar@seznam.cz>
10284 * expression.cs (SizeOf.DoResolve): Check for void type. Fixed enum types
10286 * class.cs, ecore.cs, statement.cs: Merged to one error message.
10288 2006-08-13 Miguel de Icaza <miguel@novell.com>
10290 * assign.cs: Catch attempts to assign to a method groups in += and
10293 2006-08-13 Marek Safar <marek.safar@seznam.cz>
10296 * cs-parser.jay: Don't destroy current array type by typeof of array's.
10298 2006-08-12 Marek Safar <marek.safar@seznam.cz>
10300 * class.cs (Method.Define): Issue a warning when generic method looks like
10302 * decl.cs (MemberCore.GetSignatureForError): Print member type arguments
10305 2006-08-09 Marek Safar <marek.safar@seznam.cz>
10307 * anonymous.cs(AnonymousDelegate.Emit): Uses Constructor filter when
10309 * decl.cs (MemberCache.FindMembers): When container is interface we need to
10310 search all base interfaces as a member can be ambiguous.
10311 * delegate.cs (Delegate.FindMembers): Fixed to return valid data for
10312 Constructor member type filter.
10313 (Delegate.ResolveConstructorMethod) Uses Constructor filter.
10314 * ecore.cs: (Expression.MemberLookup): Implemented ambiguity error/warning
10315 reporting for returned memberinfos.
10316 * report.cs: Updated.
10317 * typemanager.cs (TypeManager.LookupBaseInterfacesCache): Uses TypeManager
10318 version to work on all runtimes.
10319 (TypeManager.RealMemberLookup): Removed members filtering.
10321 2006-08-08 Raja R Harinath <rharinath@novell.com>
10323 * ecore.cs (FieldExpr.EmitAssign): Release temporary.
10324 (PropertyExpr.EmitAssign): Likewise.
10325 * expression.cs (Indirection.EmitAssign): Likewise.
10326 (LocalVariableReference.EmitAssign): Likewise.
10327 (ParameterReference.EmitAssign): Likewise.
10328 (Invocation.EmitArguments): Likewise.
10329 (ArrayAccess.EmitAssign): Likewise.
10330 (IndexerAccess.EmitAssign): Likewise.
10331 (This.EmitAssign): Likewise.
10332 (ConditionalLogicalOperator.Emit): Likewise.
10335 * codegen.cs (EmitContext.GetTemporaryLocal): Simplify. Use Stack
10336 instead of ArrayList. If the hashtable has a LocalBuilder, don't
10337 leave it in after returning it.
10338 (EmitContext.FreeTemporaryLocal): Simplify. Update to changes.
10340 2006-08-06 Marek Safar <marek.safar@seznam.cz>
10342 * expresssion.cs (IndexerAccess.DoResolve): Fixed to report correct error
10345 2006-08-03 Raja R Harinath <rharinath@novell.com>
10347 Fix cs0146-3.cs and cs0146-4.cs.
10348 * class.cs (TypeManager.CheckRecursiveDefinition): Check that
10349 enclosing types don't depend on the current type.
10351 2006-08-02 Raja R Harinath <rharinath@novell.com>
10354 * class.cs (TypeContainer.DoDefineMembers): Use
10355 FindBaseMemberWithSameName on Parent, since we're interested in
10356 whether we hide inherited members or not.
10357 (FindBaseMemberWithSameName): Make slightly more robust.
10359 Fix the non-generic testcase from #77396
10360 * decl.cs (DeclSpace.DeclContainer): Remove override.
10362 * namespace.cs (NamespaceEntry.Doppelganger): Create slave
10363 declspaces for doppelgangers too.
10364 (UsingEntry): Implement IResolveContext.
10365 (UsingEntry.Resolve): Don't set ToplevelTypes.Namespace. Use
10366 'this' as the resolve context.
10367 (LocalAliasEntry): Likewise.
10369 Implement parts of #77403
10370 * roottypes.cs (RootDeclSpace): New. Used to represent the
10371 toplevel declaration space. Each namespace declaration introduces
10372 a "partial" root declaretion space.
10373 * namespace.cs (NamespaceEntry.SlaveDeclSpace): New.
10374 (NamespaceEntry.ctor): Create a SlaveDeclSpace if necessary.
10375 * cs-parser.jay (CSharpParser.ctor): Initialize 'current_class'
10376 from 'current_namespace.SlaveDeclSpace'.
10377 (namespace_declaration): Likewise.
10378 * class.cs (TypeContainer.ctor): Remove parent==ToplevelTypes
10379 check. It can't happen now.
10380 * decl.cs (DeclSpace.LookupType): Likewise.
10381 * driver.cs (MainDriver): Sanity check.
10383 2006-08-01 Raja R Harinath <rharinath@novell.com>
10385 * decl.cs (DeclSpace.FindNestedType): Remove.
10386 (DeclSpace.LookupNestedTypeINHierarchy): Use PartialContainer and
10387 LookupTypeContainer to get the container of the nested type.
10388 * class.cs (TypeContainer.FindNestedType): Make non-override.
10390 2006-07-31 Raja R Harinath <rharinath@novell.com>
10392 * decl.cs (DeclSpace.PartialContainer): Move field from ...
10393 * class.cs (TypeContainer.PartialContainer): ... here.
10394 (TypeContainer.AddBasesForPart): New helper.
10395 (MemberBase.ParentContainer): Remove. Use Parent.PartialContainer
10397 * cs-parser.jay (current_class): Convert to DeclSpace.
10398 (struct_declaration, interface_declaration, class_declaration):
10399 Use AddBasesForPart instead of .Bases directly.
10400 * const.cs, iterators.cs: Update to changes.
10402 2006-07-28 Raja R Harinath <rharinath@novell.com>
10404 * class.cs (TypeContainer.AddMemberType): Rename from
10405 AddToTypeContainer.
10406 (TypeContainer.AddMember): Rename from AddToMemberContainer.
10407 (AddTypeContainer): New. Combine AddClassOrStruct and
10409 (AddPartial): Update. Add 'is_partial' argument.
10410 * roottypes.cs: Update to changes.
10411 * cs-parser.jay (push_current_class): New helper for handling
10412 current_container and current_class.
10413 (struct_declaration, interface_declaration, class_declaration):
10416 2006-07-26 Raja R Harinath <rharinath@novell.com>
10418 * roottypes.cs: Rename from tree.cs.
10420 Rename RootContext.Tree.Types to RootContext.ToplevelTypes.
10421 * tree.cs (Tree, ITreeDump): Remove types.
10422 * rootcontext.cs (tree, Tree): Remove fields.
10423 (root, ToplevelTypes): New.
10424 * *.cs: Update to rename.
10426 * tree.cs (Tree.RecordDecl): Remove.
10427 (RootTypes.AddToTypeContainer): Record the toplevel type in its
10429 * class.cs, cs-parser.jay: Remove mention of RecordDecl.
10431 2006-07-23 Raja R Harinath <harinath@gmail.com>
10433 * codegen.cs (EmitContext.Flags): Move InCatch, InFinally,
10434 DoFlowAnalysis and OmitStructFlowAnalysis here.
10435 (ec.With): Rename from WithUnsafe and generalize.
10436 (ec.WithCheckState): Remove. All users can be handled by 'With'.
10437 (ec.WithFlowAnalyis): New.
10438 * ecore.cs, expression.cs, statement.cs: Update.
10440 2006-07-22 Raja R Harinath <harinath@gmail.com>
10442 * statement.cs (Block.ResolveMeta): Simplify slightly.
10444 * codegen.cs (EmitContext.Flags): New enum. Used to represent the
10445 multiple boolean fields. Convert InUnsafe, constant_check_state,
10446 check_state to flags.
10447 (CheckState, ConstantCheckState): Update.
10448 (InUnsafe): New read-only property.
10449 (FlagsHandle): Rename from CheckStateHandle and convert to handle
10451 (WithUnsafe): New helper similar to WithCheckState.
10452 * statement.cs (Block.ResolveMeta): Use WithUnsafe.
10453 (Unsafe.Resolve, Unsafe.DoEmit): Likewise.
10455 2006-07-21 Raja R Harinath <rharinath@novell.com>
10457 Make comparisons use the same IL irrespective of whether they're
10458 in a 'checked' or 'unchecked' context: one of the issues in #78899
10459 * codegen.cs (EmitContext.CheckState): Make read-only property.
10460 (EmitContext.ConstantCheckState): Likewise.
10461 (EmitContext.CheckStateHandle, EmitContext.WithCheckState): New
10462 helper that implement a save/restore stack for CheckState
10463 values. This is the only way to change check-state.
10464 * ecore.cs (Expression.ExpressionToArrayArgument): Use WithCheckState.
10465 * expression.cs (CheckedExpr.DoResolve, CheckedExpr.Emit): Likewise.
10466 (CheckedExpr.EmitBranchable): New forwarding method.
10467 (UnCheckedExpr): Likewise.
10468 * statement.cs (Block.ResolveMeta): Use WithCheckState.
10469 (Unchecked.Resolve, Unchecked.DoEmit): Likewise.
10470 (Checked.Resolve, checked.DoEmit): Likewise.
10472 2006-07-20 Miguel de Icaza <miguel@novell.com>
10474 * anonymous.cs: Cache the resolved anonymous delegate, and return
10475 this so that the ResolveTopBlock is only triggered once, not
10478 Currently we trigger ResolvetopBlock twice due to a first pass of
10479 argument check compatibility, and a second pass that does the
10482 2006-07-15 Marek Safar <marek.safar@seznam.cz>
10484 * annonymous.cs (AnonymousMethod.CreateScopeType): Fixed nested type
10486 * rootcontext.cs (Reset): Add helper_classes.
10488 2006-07-15 Marek Safar <marek.safar@seznam.cz>
10491 * statement.cs (Switch.SimpleSwitchEmit): Handle case null at any position
10494 2006-07-13 Miguel de Icaza <miguel@novell.com>
10496 * statement.cs (Lock): Handle expressions of type
10497 TypeManager.null_type specially. Fixes #78770
10499 2006-07-08 Marek Safar <marek.safar@seznam.cz>
10501 * expression.cs (Binary.ResolveOperator): Don't crash when null is assigned
10504 2006-07-08 Marek Safar <marek.safar@seznam.cz>
10506 * attribute.cs (AttributeTester.GetMethodObsoleteAttribute): Fixed to look
10507 for accessors as well.
10508 * ecore.cs (EventExpr): Add AccessorTable.
10510 2006-07-01 Marek Safar <marek.safar@seznam.cz>
10513 * attribute.cs, class.cs, ecore.cs : Add missing location of related symbol
10514 for CS0122 where appropriate.
10515 * typemanager.cs (IsNestedChildOf): Type can be null in the case of top
10517 (Filter): Assembly can be null in the case of top level attributes.
10519 2006-06-25 Marek Safar <marek.safar@seznam.cz>
10523 * ecore.cs (Expression.MemberLookupFailed): Don't crash when failed lookup
10524 is done at global level.
10526 2006-06-24 Marek Safar <marek.safar@seznam.cz>
10528 A fix for #77002, Implemented TypeForwarder support.
10530 * attribute.cs (Attribute.GetArgumentType): Reads type argument.
10531 * expression.cs (TypeOf.TypeArgument): Exposes typeof type.
10532 * typemanager.cs (): Add type_forwarder_attr_type.
10534 2006-06-24 Marek Safar <marek.safar@seznam.cz>
10536 * report.cs: Add CS0469 warning.
10538 2006-06-21 Martin Baulig <martin@ximian.com>
10540 * codegen.cs (CodeGen.Save): Moved the symbol file generation into
10541 the `try'-block, so we also report CS0016 etc. there.
10543 2006-06-21 Martin Baulig <martin@ximian.com>
10546 (Delegate.VerifyMethod): Allow `params' methods; fixes #78678.
10548 2006-06-21 Martin Baulig <martin@ximian.com>
10550 * expression.cs (Unary.ResolveOperator): In `Operator.AddressOf',
10551 also report CS1686 for parameters.
10553 2006-06-21 Martin Baulig <martin@ximian.com>
10555 * statement.cs (GotoCase.Resolve): Report a warning (CS0469)
10556 instead of an error if the value is not implicitly convertible to
10557 the switch types; fixes #77964.
10559 2006-06-21 Raja R Harinath <rharinath@novell.com>
10562 * class.cs (FieldBase.ResolveInitializer): Stop resolution if
10563 FieldBuilder is null.
10566 * expression.cs (Binary.CheckShiftArguments): Don't overwrite original
10567 'left' and 'right' before error-checking.
10569 2006-06-16 Juraj Skripsky <js@hotfeet.ch>
10571 * ecore.cs (SimpleName.Error_ObjectRefRequired): Do not truncate the name.
10573 (MemberExpr.EmitInstance): Use GetSignatureForError () to get full name.
10574 (FieldExpr.DoResolve): likewise.
10575 (PropertyExpr.InstanceResolve): likewise.
10576 (EventExpr.InstanceResolve): likewise.
10578 2006-06-04 Marek Safar <marek.safar@seznam.cz>
10580 * parameter.cs (Parameter.ApplyAttributeBuilder): More DefaultValue
10581 attribute applicable tests for attribute argument.
10583 2006-06-02 Raja R Harinath <rharinath@novell.com>
10586 * expression.cs (Binary.DoNumericPromotions): Remove and rewrite.
10587 (Binary.OverloadResolve_PredefinedIntegral): New.
10588 (Binary.OverloadResolve_PredefinedFloating): New.
10589 (Binary.OverloadResolve_PredefinedString): New.
10590 (Binary.ResolveOperator): Use those instead of DoNumericPromotions.
10591 Follow the standard more closely, and treat numeric promotions in
10592 terms of overload resolution.
10593 (Binary.CheckShiftArguments): Simplify.
10595 2006-06-01 Raja R Harinath <rharinath@novell.com>
10597 * flowanalysis.cs (MyBitVector): Simplify representation.
10598 (MyBitVector.Clone): Avoid allocating BitArray.
10599 (MyBitVector.operator&): Rename from MyBitVector.And and make symmetric.
10600 (MyBitVector.operator|): Likewise, with MyBitVector.Or.
10601 (*): Update. Change all references to MyBitVector.And and
10602 MyBitVector.Or to &= and |=.
10604 2006-05-29 Raja R Harinath <rharinath@novell.com>
10606 Fix cs0231-[34].cs.
10607 * cs-parser.jay (formal_parameter_list): Extend the pattern below
10608 to param arguments too.
10610 2006-05-26 Miguel de Icaza <miguel@novell.com>
10612 * cs-parser.jay: Catch another parsing form for arglist being
10613 followed by other arguments. Fixes #78313.
10615 2006-05-24 Raja R Harinath <rharinath@novell.com>
10617 * flowanalysis.cs (FlowBranchingToplevel.AddReturnOrigin): Move
10618 checking of out parameters to ...
10619 (FlowBranchingToplevel.Merge): ... here.
10620 (FlowBranchingException.AddBreakOrigin): If 'finally_vector' is
10621 set, propagate the origin upward, and only complain if there was
10623 (FlowBranchingException.AddContinueOrigin): Likewise.
10624 (FlowBranchingException.AddReturnOrigin): Likewise.
10625 (FlowBranchingException.AddGotoOrigin): Likewise.
10627 2006-05-23 Raja R Harinath <rharinath@novell.com>
10629 * flowanalysis.cs (UsageVector.MergeOrigins): If an origin is
10630 unreachable, skip it.
10631 (FlowBranchingException.Merge): Always propagate jumps, even if
10632 the finally block renders subsequent code unreachable.
10634 2006-05-18 Raja R Harinath <rharinath@novell.com>
10637 * statement.cs (Goto.Resolve): Move responsibility for resolving
10638 'goto' to FlowBranching.AddGotoOrigin.
10639 (Goto.SetResolvedTarget): New. Callback to set the
10640 LabeledStatement that's the target of the goto.
10641 (Goto.DoEmit): Use Leave instead of Br when crossing an
10642 unwind-protect boundary.
10643 * flowanalysis.cs (FlowBranching.AddGotoOrigin): Rename from
10644 LookupLabel and adjust to new semantics.
10645 (FlowBranchingToplevel.AddGotoOrigin): Likewise.
10646 (FlowBranchingBlock.AddGotoOrigin): Likewise. Use
10647 Goto.SetResolvedTarget to update target.
10648 (FlowBranchingLabeled.AddGotoOrigin): Likewise.
10649 (FlowBranchingException.AddGotoOrigin): Rewrite to be similar to
10650 AddBreakOrigin & co. Delay propagation until ...
10651 (FlowBranchingException.Merge): ... this.
10653 * statement.cs (Block.Resolve): Always depend on flow-branching to
10654 determine unreachability. Kill workaround that originally emitted
10655 only one statement after an "unreachable" label (see infloop in
10658 Fix #77869, #76148, #77755, #75255 and a host of other bugs.
10659 This is still "wrong", but anything better would probably need a
10660 multi-pass algorithm.
10661 * flowanalysis.cs (FlowBranchingLabeled): Salt away a copy of the
10662 usage vector. Force current usage vector to be reachable, to
10663 optimistically signify backward jumps.
10664 (FlowBranchingLabeled.LookupLabel): Note if a backward jump is
10666 (FlowBranchingLabeled.Merge): New. If no backward jump was
10667 detected, return the original salted-away usage vector instead,
10668 updated with appropriate changes. Print unreachable warning if
10670 * statement.cs (Block.Resolve): Don't print unreachable warning on
10671 a labeled statement.
10673 2006-05-17 Gert Driesen <drieseng@users.sourceforge.net>
10675 * driver.cs: Pass filename without path to AssemblyBuilder's
10676 AddResourceFile. Fixes bug #78407.
10678 2006-05-17 Raja R Harinath <rharinath@novell.com>
10680 * statement.cs (LabeledStatement.Resolve): Move merging of origins ...
10681 * flowanalysis.cs (FlowBranchingLabeled): ... here.
10682 (FlowBranching.MergeChild): Overwrite
10683 reachability information from Labeled branchings too.
10685 2006-05-16 Raja R Harinath <rharinath@novell.com>
10687 * statement.cs (Goto.Resolve): Merge jump origins here ...
10688 * flowanalysis.cs (FlowBranching.Label): ... rather than here.
10690 * flowanalysis.cs (FlowBranching.LookupLabel): Move CS0159 check ...
10691 (FlowBranchingToplevel.LookupLabel): ... here. Add CS1632 check.
10692 (FlowBranchingGoto.LookupLabel): New. Handle back jumps.
10693 (FlowBranchingBlock.LookupLabel): Call LabeledStatement.AddReference
10695 * statement.cs (Goto.Resolve): ... not here.
10696 (Goto.Emit): Remove CS1632 check.
10698 2006-05-14 Marek Safar <marek.safar@seznam.cz>
10700 * ecore.cs (Expression.ResolveAsTypeTerminal): Fixed type in the obsolete
10703 2006-05-11 Raja R Harinath <rharinath@novell.com>
10705 * flowanalysis.cs (UsageVector.MergeJumpOrigins): Kill.
10706 (FlowBranchingBlock.Label): Use UsageVector.MergeOrigins.
10707 (FlowBranchingException.Label): Likewise.
10709 * flowanalysis.cs (MyBitVector.SetAll): New. Sets all bits to the
10711 (MyBitVector.Or): Use it to avoid losing information (Count).
10712 (FlowBranching.MergeOrigins): Likewise.
10714 * flowanalysis.cs (UsageVector.IsDirty): Remove.
10715 (UsageVector.Parameters, UsageVector.ParameterVector): Likewise.
10716 (UsageVector.Locals, UsageVector.LocalVector): Likewise.
10717 (UsageVector.ToString): Simplify.
10718 (UsageVector.MergeSiblings): Move here from ...
10719 (FlowBranching.Merge): ... here.
10720 (FlowBranchingToplevel.CheckOutParameters): Take an UsageVector,
10723 2006-05-10 Raja R Harinath <rharinath@novell.com>
10725 * flowanalysis.cs (UsageVector.MergeOrigins): Simplify, now that a
10726 null bitvector is treated as all-true.
10728 * flowanalysis.cs (MyBitVector.And, MyBitVector.Or): Make lazier.
10729 (MyBitVector): Rationalize invariants. 'vector != null' implies
10730 that we have our own copy of the bitvector. Otherwise,
10731 'InheritsFrom == null' implies all inherited bits are true.
10733 2006-05-09 Marek Safar <marek.safar@seznam.cz>
10735 * statement.cs (LocalInfo): Add IsConstant.
10736 (LocalInfo.DeclareLocal): Moved from EmitMeta and changed to don't emit
10737 local variable for constants.
10739 2006-05-09 Raja R Harinath <rharinath@novell.com>
10741 * flowanalysis.cs (MyBitVector.Empty): New.
10742 (MyBitVector): Don't allow InheritedFrom to be null.
10743 (MyBitVector.And, MyBitVector.Or): Treat 'null' as all-ones.
10744 (UsageVector, FlowBranching): Update to changes.
10746 * flowanalysis.cs (FlowBranching.InTryWithCatch): Don't terminate
10747 recursion. The 'Parent == null' condition isn't sufficient for
10749 (FlowBranching.AddBreakOrigin): Likewise.
10750 (FlowBranching.AddContinueOrigin): Likewise.
10751 (FlowBranching.AddReturnOrigin): Likewise.
10752 (FlowBranching.StealFinallyClauses): Likewise.
10753 (FlowBranching.MergeTopBlock): Move to FlowBranchingToplevel.
10754 (FlowBranching.CheckOutParameters): Likewise.
10755 (FlowBranchingToplevel): Terminate all the above recursions here.
10756 (FlowBranchingToplevel.End): Rename from MergeTopBlock.
10757 * codegen.cs (EmitContext.ResolveTopBlock): Update to changes.
10759 * flowanalysis.cs (BranchingType.Toplevel): New. Represents a
10761 (FlowBranchingToplevel): New. Empty for now.
10762 (FlowBranching.MergeTopBlock): Update.
10763 * codegen.cs (EmitContext.ResolveTopBlock): Create a Toplevel
10764 branching for the anonymous delegate.
10765 (EmitContext.StartFlowBranching): Add ToplevelBlock variant.
10767 * flowanalysis.cs (UsageVector.MergeOrigins): Reorganize.
10768 (UsageVector.MergeJumpOrigins): Don't ignore current reachability
10769 information at the start of the merge. Reorganize.
10771 2006-05-07 Marek Safar <marek.safar@seznam.cz>
10773 * class.cs (MethodData.Define): Method cannot implement interface accessor.
10775 2006-05-07 Marek Safar <marek.safar@seznam.cz>
10777 * expression.cs (QualifiedAliasMember.ResolveAsTypeStep): Pass location
10778 to newly introduced ctor.
10780 * namespace.cs (Namespace.Error_NamespaceDoesNotExist): Moved an error
10781 message to one place.
10782 (GlobalRootNamespace.Error_NamespaceDoesNotExist): Custom message for
10785 2006-05-07 Marek Safar <marek.safar@seznam.cz>
10787 * const.cs (Const.Error_ExpressionMustBeConstant): Better error message.
10789 * ecore.cs (Expression.ResolveAsConstant): Updated.
10791 * statement.cs (ResolveMeta): Updated.
10793 2006-05-06 Marek Safar <marek.safar@seznam.cz>
10795 * cs-parser.jay: __arglist cannot be used in initializer.
10797 2006-05-06 Marek Safar <marek.safar@seznam.cz>
10800 * namespace.cs (LocalAliasEntry.DoResolve): Don't allow to access nested
10803 2006-05-05 Raja R Harinath <rharinath@novell.com>
10805 * statement.cs (EmptyStatement.ResolveUnreachable): Override.
10806 (LabeledStatement): Add 'name' parameter.
10807 (LabeledStatement.Name, LabeledStatement.JumpOrigins): New.
10808 (Block.AddLabel): Update to changes.
10809 * cs-parser.jay (labeled_statement): Likewise.
10811 * flowanalysis.cs (BranchingType.Labeled): New.
10812 (UsageVector.MergeOrigins): Remove unused 'branching' argument.
10813 (FlowBranchingLabeled): New. Does nothing for now, but will
10814 eventually handle 'goto' flows.
10815 * codegen.cs (StartFlowBranching): Add new LabeledStatement variant.
10816 * statement.cs (LabeledStatement.Resolve): Create a FlowBranching
10817 that's terminated ...
10818 (Block.Resolve): ... here.
10820 * flowanalysis.cs (UsageVector.MergeFinally): Remove.
10821 (UsageVector.MergeFinallyOrigins): Likewise.
10822 (FlowBranching.InTryOrCatch): Likewise.
10823 (FlowBranching.AddFinallyVector): Likewise.
10824 (FlowBranchingException): Update to changes.
10827 * statement.cs (Return.Resolve): Move error checking to ...
10828 * flowbranching.cs (FlowBranching.AddReturnOrigin): ... this.
10829 (FlowBranchingException): Handle return origins like break and
10831 (FlowBranching.UsageVector.CheckOutParameters): Remove.
10833 2006-05-04 Marek Safar <marek.safar@seznam.cz>
10836 * class.cs (TypeContainer.FindMembers): Includes event method in the methods
10839 2006-05-04 Marek Safar <marek.safar@seznam.cz>
10842 * class.cs (MethodData.Define): Do public accessor check only when method
10843 implements an interface.
10845 2006-05-04 Raja R Harinath <rharinath@novell.com>
10847 Remove special handling of 'break'
10848 * flowanalysis.cs (Reachability): Remove all mention of 'breaks'.
10849 (Reachability.Meet): Simplify. Remove 'do_breaks' argument.
10850 (UsageVector.Break): Remove.
10851 (FlowBranching.Merge): Use 'Reachable.IsUnreachable' to determine
10853 (FlowBranchingBreakable.Merge): Don't ResetBreaks.
10855 * statement.cs (Break.Resolve): Call UsageVector.Goto (), not
10856 UsageVector.Breaks (). Don't set NeedsReturnLabel.
10858 2006-05-03 Marek Safar <marek.safar@seznam.cz>
10861 * pending.cs (PendingImplementation.BaseImplements): A found member cannot
10862 be the interface member.
10864 2006-05-03 Marek Safar <marek.safar@seznam.cz>
10867 * constant.cs (LongConstant.EmitLong): Fixed to catch also negative values
10868 for emitting small (int) values.
10870 2006-05-03 Raja R Harinath <rharinath@novell.com>
10873 * flowanalysis.cs (FlowBranchingException.Merge): Ensure
10874 control-flow passes through the 'finally' after merging-in all the
10875 control-flows from 'try' and the 'catch' clauses.
10877 * flowanalysis.cs (FlowBranching.IsLoop): Remove.
10878 (FlowBranching.IsTryOrCatch): Remove 'is_return' parameter. It's
10879 always true at the only non-recursive entry point.
10880 (FlowBranching.CreateBranching) [BranchingType.Loop]: Return a
10881 FlowBranchingBreakable.
10882 (FlowBranchingLoop): Remove.
10883 * statement.cs (Return.DoResolve): Update to changes.
10886 * flowanalysis.cs (FlowBranching.BranchingType.Embedded): New.
10887 (FlowBranching.CreateBranching): Handle it: create a
10888 FlowBranchingContinuable.
10889 (FlowBranching.BreakCrossesExceptionBoundary): Remove.
10890 (FlowBranching.AddContinueOrigin): Similar to AddBreakOrigin,
10891 except that it handles the 'continue' command.
10892 (FlowBranching.UsageVector.MergeOrigins): Rename from
10894 (FlowBranchingContinuable): Similar to FlowBranchingBreakable,
10895 except that it overrides AddContinueOrigin.
10896 (FlowBranchingException): Override AddContinueOrigin, similar to
10898 * statement.cs (While.Resolve, Foreach.ArrayForeach.Resolve):
10899 Create a new branching around the embedded statement.
10900 (Do.Resolve, For.Resolve): Likewise. Do reachability analysis for
10901 control flow after the embedded statement.
10902 (Continue.Resolve): Move all error checking to AddContinueOrigin.
10904 * flowanalysis.cs (FlowBranching.IsSwitch): Remove.
10905 (FlowBranching.CreateBranching) [BranchingType.Switch]: Create a
10906 FlowBranchingBreakable.
10907 (FlowBranchingSwitch): Remove.
10910 * statement.cs (Break.Resolve): Simplify. Move responsibility for
10911 error reporting to ...
10912 * flowanalysis.cs (FlowBranching.AddBreakOrigin) ... this.
10913 Rename from 'AddBreakVector'. Add new location argument. Return
10914 a bool indicating whether the 'break' crosses an unwind-protect.
10915 (FlowBranchingException.AddBreakOrigin): Add.
10916 (FlowBranchingException.Merge): Propagate 'break's to surrounding
10917 flowbranching after updating with the effects of the 'finally'
10919 (FlowBranchingBreakable): New common base class for
10920 FlowBranchingLoop and FlowBranchingSwitch.
10922 * statement.cs (Foreach.ArrayForeach.Resolve): Set barrier after
10923 embedded statement.
10924 (Foreach.CollectionForeach.Resolve): Remove extraneous flowbranching.
10926 2006-05-02 Raja R Harinath <rharinath@novell.com>
10928 * statement.cs (Do.Resolve): If the loop is infinite, set the
10930 (While.Resolve, For.Resolve): Set a barrier after the embedded
10931 statement. There's no direct control flow that goes from the end
10932 of the embedded statement to the end of the loop.
10933 * flowanalysis.cs (FlowBranching.Infinite): Remove.
10934 (FlowBranchingLoop.Merge): Don't look at 'Infinite'. The changes
10935 above ensure that the reachability is correctly computed.
10937 * flowanalysis.cs (Reachability.ResetBarrier): Remove.
10938 (UsageVector.MergeBreakOrigins): If the current path is
10939 unreachable, treat it as if all parameters/locals are initialized.
10940 (FlowBranchingLoop.Merge): Don't clear any barriers. Handle
10941 infinite loops before merging-in break origins.
10943 * flowanalysis.cs (Reachability.Meet): Simplify code handling 'returns'.
10944 (Reachability.Reachable): Split part into ...
10945 (Reachability.Unreachable): ... this. Simplify.
10946 (Reachability.IsUnreachable): Use 'Unreachable' instead.
10948 * flowanalysis.cs (Reachability.SetReturnsSometimes): Remove.
10949 (Reachability.SetThrowsSometimes): Likewise.
10950 (FlowBranchingBlock.MergeTopBlock): Don't compare against
10951 TriState.Always, use corresponding property.
10952 * statement.cs (Lock.Resolve, Try.Resolve, Using.Resolve): Likewise.
10953 (Block.Resolve): Likewise. Remove some redundant checks.
10955 2006-05-02 Raja R Harinath <harinath@gmail.com>
10957 * flowanalysis.cs (UsageVector.Throw): Set barrier too.
10958 (Reachability.Meet): Don't bother checking AlwaysThrows --
10959 barrier is always set.
10960 (FlowBranchingBlock.Merge): Likewise.
10962 2006-05-01 Raja R Harinath <harinath@gmail.com>
10964 * codegen.cs (EmitContext.ResolveTopBlock): Remove redundant
10965 checks for unreachable.
10967 2006-05-01 Marek Safar <marek.safar@seznam.cz>
10970 * flowanalysis.cs (UsageVector.IsAssigned): Add flag to ignore short path.
10972 * statement.cs (Block.UsageWarning): Uses newly introduced flag to detect
10973 whether field is really assigned.
10975 2006-04-30 Raja R Harinath <harinath@gmail.com>
10977 * flowanalysis.cs (Reachability): Make 4-argument constructor
10979 (Reachability.Meet): Rename from 'And'. Remove static variant.
10980 (Reachability.Always): Rename from the highly misleading
10981 'Reachability.Never'.
10982 (FlowBranching.Merge): Update to changes. Mark an impossible
10983 situation with a 'throw'.
10984 (*): Update to changes.
10986 2006-04-29 Raja R Harinath <harinath@gmail.com>
10988 * flowanalysis.cs (TriState): Rename from FlowBranching.FlowReturns.
10989 Remove 'Undefined'.
10990 (FlowBranching.TriState_Meet): Rename from AndFlowReturns. Simplify.
10991 (FlowBranching.TriState_Max): Rename from OrFlowReturns. Simplify.
10992 (*): Update to changes.
10993 * statement.cs: Update to changes.
10995 2006-04-28 Marek Safar <marek.safar@seznam.cz>
10998 *class.cs (Method.FindOutBaseMethod): Base method cannot be property method.
11000 2006-04-28 Raja R Harinath <harinath@gmail.com>
11002 * flowanalysis.cs (FlowBranching.MergeTopBlock): Don't create a
11005 * flowanalysis.cs (UsageVector.MergeChild): Change FlowBranching
11006 argument to two arguments: an usage-vector and a bool. Move call
11007 to FlowBranching.Merge () ...
11008 (FlowBranching.MergeChild, FlowBranching.MergeTopBlock): ... here.
11010 * flowanalysis.cs (UsageVector.MergeChild): Move special-case
11011 handling of loop and switch reachability to ...
11012 (FlowBranchingLoop.Merge, FlowBranchingSwitch.Merge): ... these.
11014 2006-04-27 Raja R Harinath <harinath@gmail.com>
11016 * flowanalysis.cs (FlowBranching.InLoop): Move special-case
11017 handling to FlowBranchingLoop.InLoop.
11018 (FlowBranching.InSwitch): Likewise, to FlowBranchingSwitch.
11020 2006-04-26 Marek Safar <marek.safar@seznam.cz>
11023 * anonymous.cs (AnonymousMethod.DoResolve): Moved the check whether
11024 anonymous method is allowed from AnonymousContainer here.
11026 * attribute.cs, codegen.cs (EmitContext): Add IsAnonymousMethodAllowed.
11028 2006-04-24 Raja R Harinath <rharinath@novell.com>
11031 * flowanalysis.cs (MyBitVector.Or): Add null check on argument.
11033 2006-04-23 Marek Safar <marek.safar@seznam.cz>
11036 * constant.cs (FloatConstant.Reduce): Add range checking for checked context.
11037 (DoubleConstant.Reduce): Ditto.
11039 2006-04-23 Raja R Harinath <rharinath@novell.com>
11041 * expression.cs (LocalVariableReference.DoResolveBase): Simplify.
11042 Remove 'lvalue_right_side' argument. Move parts to ...
11043 (LocalVariableReference.ResolveLocalInfo, LocalVariable.DoResolve)
11044 (LocalVariable.DoResolveLValue): ... these.
11046 2006-04-21 Raja R Harinath <rharinath@novell.com>
11049 * codegen.cs (EmitContext.InRefOutArgumentResolving): Remove.
11050 * expression.cs (EmptyExpression.LValueMemberOutAccess): New.
11051 (LocalVariableReference.DoResolveBase): Use it to implement new
11053 (IndexerAccess.DoResolveLValue): Handle LValueMemberOutAccess.
11054 (Argument.Resolve): Simplify. Move CS1510 check ...
11055 * ecore.cs (Expression.ResolveLValue): ... here.
11056 (UnboxCast.DoResolveLValue): Handle LValueMemberOutAccess.
11057 (PropertyExpr.DoResolveLValue): Likewise.
11058 (FieldExpr.Report_AssignToReadonly): Likewise.
11059 (FieldExpr.DoResolve): Add 'out_access' argument. Use
11060 LValueMemberAccess or LValueMemberOutAccess on instance depending
11062 (FieldExpr.DoResolveLValue): Pass 'out_access' argument to
11063 DoResolve as appropriate.
11065 2006-04-20 Raja R Harinath <rharinath@novell.com>
11068 * expression.cs (Invocation.VerifyArgumentsCompat): Don't try
11069 implicit conversions on 'out' and 'ref' arguments.
11071 * expression.cs (Invocation.VerifyArgumentsCompat): Reorganize to
11072 improve clarity. Remove dead code.
11075 * statement.cs (Block.UsageWarning): Allow VariableInfo to be null.
11076 (Catch.Resolve): Resolve VarBlock if it exists.
11078 2006-04-19 Miguel de Icaza <miguel@novell.com>
11080 * statement.cs (Foreach.EmitFinally): Do not emit the enumerator
11081 twice, this was some residual code, the enumerator was emitted
11082 properly in the two branche of if later.
11084 2006-04-19 Raja R Harinath <rharinath@novell.com>
11086 * expression.cs (Cast.ResolveLValue): Remove. The result of a
11087 cast is never an lvalue.
11088 (Cast.DoResolve, Cast.ResolveRest): Combine.
11089 (Argument.Emit): Simplify slightly. Move 'Expr is
11090 IMemoryLocation' check ...
11091 (Argument.Resolve): ... here.
11092 (Argument.Error_LValueRequired): Remove. Inline into only user.
11094 Simplifications. Fix cs0191-2.cs
11095 * ecore.cs (FieldExpr.DoResolve): Move handling of CS0192, CS0198,
11096 CS1649 and CS1651 to ...
11097 (FieldExpr.Report_AssignToReadonly): ... this. Simplify by moving
11098 the actual selection of the error code and message to a lookup
11099 table. Add a dummy return value to simplify callsites.
11100 (FieldExpr.ResolveLValue): Don't allow a constructor to write to
11101 readonly fields of other instances of the same type. Move CS0197
11103 * expression.cs (Argument.Resolve): ... here. Simplify code.
11104 Ensure that ec.InRefOutArgumentResolving is only set during LValue
11105 resolution of an out or ref argument. The code simplification
11106 above uses this invariant.
11108 2006-04-18 Raja R Harinath <rharinath@novell.com>
11110 Possibly fix #77752. Fix cs1690-[4-7].cs.
11111 * ecore.cs (Expression.CheckMarshalByRefAccess): Renamed from
11112 CheckMarshallByRefAccess. Drop parameter.
11113 (FieldExpr.CheckMarshalByRefAccess): Update. Change CS1690 to a
11115 (FieldExpr.DoResolve): Call CheckMarshalByRefAccess on
11116 InstanceExpression.
11117 * report.cs (AllWarnings): Add CS1690.
11118 * expression.cs (Argument.Resolve): Use EmptyExpression.OutAccess
11119 for ref access too.
11120 (LocalVariableReference.DoResolveBase): Update.
11122 2006-04-09 Marek Safar <marek.safar@seznam.cz>
11124 * class.cs (MethodOrOperator): Moved common parts from method class.
11125 detect obsolete attributes.
11126 (Method.Define): Simplified as it reuses code from base.
11127 (Constructor.ValidAttributeTargets): Fixed issue found during
11129 (Destructor.ValidAttributeTargets): Fixed issue found during
11131 (Operator): Finished refactoring set off by #78020. Operator class is now
11132 ordinary method class.
11134 * anonymous.cs: Updated.
11136 * decl.cs (DeclSpace): Add IsGeneric
11138 2006-04-09 Marek Safar <marek.safar@seznam.cz>
11140 * class.cs (Constructor.Emit): Don't emit the attributes twice.
11142 2006-04-09 Marek Safar <marek.safar@seznam.cz>
11144 * class.cs (Operator.Emit): Extracted code from MethodData to correctly
11145 detect obsolete attributes.
11146 (Method.CreateEmitContext): Moved to MethodOrOperator.
11148 2006-04-09 Marek Safar <marek.safar@seznam.cz>
11151 * class.cs (TypeContainer.MemberCoreArrayList.DefineContainerMembers): Throw
11152 customized exception to make crash detection easier.
11153 (MethodOrOperator): Started to work on new base class for methods and
11155 (Method): Derives from MethodOrOperator.
11156 (Constructor.Emit): Emits its own attributes.
11157 (AbstractPropertyEventMethod.Emit): Ditto.
11158 (Operator): Derives from MethodOrOperator, will refactor fully in extra
11160 (Operator.Emit): It's temporary more tricky than should be.
11162 * doc.cs (GetMethodDocCommentName): Updated after operator changes.
11164 * report.cs (InternalErrorException): Add ctor with inner exception.
11166 2006-04-08 Marek Safar <marek.safar@seznam.cz>
11169 * ecore.cs (SimpleName.ResolveAsTypeStep): Report better error when type is
11172 2006-04-07 Marek Safar <marek.safar@seznam.cz>
11175 * expression.cs (ArrayCreation.GetAttributableValue): Creates correctly typed
11178 2006-04-06 Marek Safar <marek.safar@seznam.cz>
11180 * class.cs (Class.ApplyAttributeBuilder): Report an error when ComImport
11181 attribute is present and Guid not.
11182 (Interface.ApplyAttributeBuilder): Ditto.
11184 * attribute.cs: Add error message.
11186 2006-04-06 Marek Safar <marek.safar@seznam.cz>
11190 * attribute.cs (Attribute.AttachTo): The attribute can have multiple
11191 sources (it's composite) so hold them in extra array as they are used in
11192 Emit phase only. It worked in the previous versions by mistake.
11193 (Attribute.Emit): Emit attribute for more owners when exist.
11195 * codegen.cs, class.cs: Updated to don't re-attach attribute twice as now
11196 it has now different behaviour.
11198 2006-04-04 Marek Safar <marek.safar@seznam.cz>
11200 * constant.cs (Constant.IsDefaultInitializer): New method.
11202 * class.cs: Updated.
11204 * expression.cs (ArrayCreation.CheckIndices): Add an optimization to don't
11205 re-initialize default values. It saves KBs almost for every assembly.
11206 Thanks Zoltan for the idea.
11207 (ArrayCreation.ResolveInitializers): Renamed from ValidateInitializers.
11208 (ArrayCreation.DoResolve): Resolve only once.
11209 (ArrayCreation.Emit): Emit static initializer only when it is faster.
11210 (ArrayCreation.GetAttributableValue): Cope with optimized values.
11212 2006-04-03 Zoltan Varga <vargaz@gmail.com>
11214 * report.cs (Warning, Error): Add 0-, 1-, and 2- argument specializations.
11217 2006-04-01 Marek Safar <marek.safar@seznam.cz>
11219 * assign.cs (Assign.DoResolve): Assignment to same variable can occur
11220 in an embedded statement too.
11222 2006-04-01 Raja R Harinath <rharinath@novell.com>
11225 * statement.cs (Switch.EmitObjectInteger) [ulong]: Remove bad cast.
11227 2006-04-01 Marek Safar <marek.safar@seznam.cz>
11231 * class.cs (TypeContainer.AddPartial): Don't report an error when modifier
11234 * modifiers.cs: Add DEFAULT_ACCESS_MODIFER.
11236 2006-03-31 Marek Safar <marek.safar@seznam.cz>
11238 * assign.cs (LocalTemporary): Don't require ILGenerator in the resolve
11241 * anonymous.cs, assign.cs, ecore.cs, expression.cs: Updated after
11242 LocalTemporary change.
11244 * class.cs (ClassOrStruct.DefineDefaultConstructor): Moved from
11246 (ClassOrStruct.DefineFieldInitializers): Implemented static field
11247 initializers optimization.
11248 (ClassOrStruct.TypeAttr): Moved from modifiers.
11249 (Constructor.CheckBase): Don't crash when static ctor has parameters.
11250 (FieldBase.ResolveInitializer): Resolves initializer.
11251 (FieldBase.HasDefaultInitializer): New property.
11253 * cs-parser.jay: Removed message.
11255 * expression.cs (CompilerGeneratedThis): New specialization.
11257 * modifiers.cs (TypeAttr): Moved to ClassOrStruct.TypeAttr
11259 2006-03-28 Marek Safar <marek.safar@seznam.cz>
11261 * cs-parser.jay, cs-tokenizer.cs: On demand Stack allocation.
11263 2006-03-27 Marek Safar <marek.safar@seznam.cz>
11265 * ecore.cs (Expression.ResolveAsConstant): Clean up, enum constants should
11266 be now EnumConstants only.
11268 2006-03-27 Marek Safar <marek.safar@seznam.cz>
11270 * attribute.cs, driver.cs: Reset more caches.
11272 2006-03-26 Marek Safar <marek.safar@seznam.cz>
11274 * cs-tokenizer.cs (adjust_real): Uses float.Parse for float literals.
11276 2006-03-26 Marek Safar <marek.safar@seznam.cz>
11278 * constant.cs (Constant.Reduce): Replaced EmitContext with single bool
11279 for easier reuse. Updated all overrides.
11280 (IntegralConstant): New base class for all integral constants.
11281 (IntegralConstant.Error_ValueCannotBeConverted): When assigned value if out
11282 of the constant range, report custom error.
11283 (UIntConstant.Reduce): Fixed uint conversion.
11285 * ecore.cs, literal.cs: Reduce updates.
11287 2006-03-26 Marek Safar <marek.safar@seznam.cz>
11291 * class.cs (Constructor.Define): Removed extra if for default ctors.
11292 A patch from Atsushi Enomoto.
11294 2006-03-26 Marek Safar <marek.safar@seznam.cz>
11296 * attribute.cs (Attribute.ResolveConstructor): Conversion was moved to
11297 GetAttributableValue.
11299 * constant.cs (Constant.GetAttributableValue): Does implicit conversion
11302 * convert.cs (ImplicitConversionRequired): Error message moved to
11305 * ecore.cs (Expression.GetAttributableValue): Add type parameter for
11306 automatic implicit conversion of an output value.
11307 (EnumConstant.GetAttributableValue): Don't reduce the enum constants.
11309 * expression.cs (ArrayCreation.GetAttributableValue): Add element type
11311 (TypeOf.GetAttributableValue): Add extra handling for object type.
11313 * literal.cs (DoubleLiteral.Error_ValueCannotBeConverted): Doubles can have
11314 special error message.
11316 2006-03-25 Marek Safar <marek.safar@seznam.cz>
11318 * class.cs (Constructor.Emit): Don't crash when struct ctor is
11320 (Constructor.ApplyAttributeBuilder): Transform MethodImplAttribute to be
11321 compatible with MS runtime.
11323 2006-03-23 Marek Safar <marek.safar@seznam.cz>
11325 * attribute.cs (Attribute.ResolveConstructor): Check for an invalid
11326 attribute arguments here.
11328 * class.cs (Indexer.Define): The check was moved to attribute class.
11330 2006-03-22 Marek Safar <marek.safar@seznam.cz>
11332 * assign.cs, class.cs, codegen.cs, convert.cs, decl.cs, ecore.cs,
11333 expression.cs, typemanager.cs: Minor changes from gmcs to make merging
11336 2006-03-22 Raja R Harinath <rharinath@novell.com>
11338 Support ParameterDefaultValueAttribute in gmcs. Also applied to
11339 mcs to keep code differences small.
11340 * attribute.cs (Attribute.GetParameterDefaultValue): New.
11341 * typemanager.cs (parameter_default_value_attribute_type): New.
11342 * parameter.cs (Parameter.ApplyAttributeBuilder): Use them. Add
11345 2006-03-21 Marek Safar <marek.safar@seznam.cz>
11347 * expression.cs (StringConcat.Append): Reverted back to no warning state.
11349 2006-03-21 Marek Safar <marek.safar@seznam.cz>
11351 * const.cs (Error_ConstantCanBeInitializedWithNullOnly): Share a message.
11353 * statement.cs (Block.ResolveMeta): Look for wrong object constants in
11356 2006-03-21 Atsushi Enomoto <atsushi@ximian.com>
11358 * doc-bootstrap.cs : fix build.
11360 2006-03-20 Marek Safar <marek.safar@seznam.cz>
11362 * expression.cs (StringConcat.Append): Issue a warning when empty string
11363 is going to append.
11365 2006-03-20 Marek Safar <marek.safar@seznam.cz>
11367 * assign.cs (CompoundAssign.ResolveSource): Removed.
11369 * attribute.cs (ResolvePossibleAttributeType): Updated after MemberAccess
11372 * class.cs (TypeContainer.FindMethods): Removed.
11373 (TypeContainer.CheckMemberUsage): Made static.
11375 * codegen.cs (GetAssemblyName): Uses Length for empty string test.
11377 * constant.cs (CheckRange): Removed unused type argument.
11378 (CheckUnsigned): Removed unused type argument.
11380 * cs-parser.jay: Updated after MemberAccess clean up.
11381 Uses Length for empty string test.
11383 * cs-tokenizer.cs: Uses Length for empty string test.
11384 (IsCastToken): Made static.
11385 (is_hex): Made static.
11386 (real_type_suffix): Made static.
11388 * decl.cs (SetupCache): Made static.
11389 (OnGenerateDocComment): Removed unused ds argument.
11391 * delegate.cs (VerifyDelegate): Removed unused argument.
11393 * doc.cs: Uses Length for empty string test.
11395 * driver.cs: Uses Length for empty string test.
11397 * enum.cs (IsValidEnumType): Made static
11399 * expression.cs (EnumLiftUp): Removed unused argument.
11400 (ResolveMethodGroup): Ditto.
11401 (BetterConversion): Ditto.
11402 (GetVarargsTypes): Ditto.
11403 (UpdateIndices): Ditto.
11404 (ValidateInitializers): Ditto.
11405 (MemberAccess.ctor): Ditto.
11406 (GetIndexersForType): Ditto.
11408 * flowanalysis.cs: (MergeFinally): Removed unused argument.
11410 * iterators.cs: Updated after MemberAccess clean up.
11412 * location.cs: Uses Length for empty string test.
11414 * namespace.cs: Uses Length for empty string test.
11416 * report.cs (CheckWarningCode): Made static.
11418 * statement.cs (LabeledStatement): Removed unused argument.
11420 * typemanager.cs (FilterNone): Removed.
11422 2006-03-18 Marek Safar <marek.safar@seznam.cz>
11424 * codegen.cs (EmitContext.TestObsoleteMethodUsage): Removed as it become
11427 * class.cs: Updated.
11429 2006-03-18 Marek Safar <marek.safar@seznam.cz>
11431 * cs-parser.jay.cs: __arglist is not allowed for delegates.
11433 2006-03-18 Marek Safar <marek.safar@seznam.cz>
11437 * expression.cs (VerifyArgumentsCompat): Reverted to double error
11438 reporting, it's more tricky than I thought.
11440 2006-03-18 Marek Safar <marek.safar@seznam.cz>
11444 * anonymous.cs.cs (AnonymousMethod): Add host to allow access to
11446 (AnonymousMethod.ImplicitStandardConversionExists): New method.
11447 (AnonymousMethod.Compatible): Moved parameter resolving to DoResolve.
11448 Add more error reporting; Fixed issue with params.
11450 * convert.cs (ImplicitStandardConversionExists): Returned conversion check.
11452 * cs-parser.jay: AnonymousMethod requires host container.
11454 * delegate.cs (NewDelegate.DoResolve): Updated after Compatible changes.
11456 2006-03-18 Raja R Harinath <harinath@gmail.com>
11458 * class.cs: Change 'TypeContainer ds' constructor argument to
11459 'DeclSpace parent'. Some classes were missed below due to
11460 different naming convention.
11462 * class.cs (MemberCore.Parent): Delete. This makes the
11463 ParentContainer changes below enforceable by the compiler.
11465 Treat pointers to enclosing declaration space as 'DeclSpace', not
11467 * class.cs, const.cs, delegate.cs, enum.cs, iterator.cs: Change
11468 'TypeContainer parent' constructor argument to 'DeclSpace parent'.
11470 * statement.cs (LocalInfo..ctor): Use DeclSpace argument instead
11472 (Block.AddThisVariable): Likewise.
11473 * class.cs (MethodData.Define, MethodData.Emit): Likewise.
11474 (AbstractPropertyEventMethod.Emit): Likewise.
11475 (AbstractPropertyEventMethod.EmitMethod): Likewise.
11476 (GetMethod.Define, SetMethod.Define): Likewise.
11477 (PropertyMethod.Define, DelegateMethod.Define): Likewise.
11478 (DelegateMethod.EmitMethod): Likewise.
11480 Fix regression test-partial-13.cs.
11481 Rationalize use of PartialContainer. Ensure that the partial
11482 class semantics can be tied to type-correctness, i.e., any
11483 violation will cause a compile error.
11484 * class.cs, const.cs: Access all fields that belong to class
11485 TypeContainer via ParentContainer. Arguments of EmitContexts and
11486 Resolve()-like functions still use 'Parent'.
11488 * class.cs (SourceMethod): Use DeclSpace, not TypeContainer.
11489 (*.CreateEmitContext): Change TypeContainer argument to DeclSpace.
11490 (PropertyMethod.CheckModifiers): Remove unused argument.
11491 * codegen.cs (EmitContext..ctor): Change TypeContainer argument to
11494 2006-03-17 Raja R Harinath <harinath@gmail.com>
11496 Make semantics of PartialContainer simpler.
11497 * decl.cs (DeclSpace.IsPartial): Remove.
11498 * class.cs (TypeContainer.IsPartial): Likewise.
11499 (TypeContainer..ctor): Set PartialContainer to point to self.
11500 (TypeContainer.GetClsCompliantAttributeValue): Don't use IsPartial.
11501 (TypeContainer.FindNestedType): Likewise.
11502 (MemberCore.ParentContainer): Simplify. Remove deprecation.
11504 2006-03-17 Marek Safar <marek.safar@seznam.cz>
11506 * typemanager.cs.cs (GetInterfaces): Don't recreate 0-sized arrays.
11508 2006-03-15 Marek Safar <marek.safar@seznam.cz>
11510 * class.cs (FieldMember.Emit): ParentContainer is real parent for partial
11513 2006-03-15 Marek Safar <marek.safar@seznam.cz>
11515 * class.cs (Operator.Define): An error for base conversion was not
11516 reported correctly.
11518 2006-03-14 Atsushi Enomoto <atsushi@ximian.com>
11520 * iterator.cs : yield break is allowed in try statement which has
11521 catch clauses. Fixed bug #77767.
11523 2006-03-13 Marek Safar <marek.safar@seznam.cz>
11525 A fix for #77593, #77574.
11527 * class.cs (MethodCore.CheckBase): Another if for operator.
11529 2006-03-09 Marek Safar <marek.safar@seznam.cz>
11531 * anonymous.cs (AnonymousMethod.Compatible): Don't crash when parameters
11534 * delegate.cs (Delegate.GetInvokeMethod): Use emitcontext free MemberLookup.
11535 (DelegateCreation.ImplicitStandardConversionExists): New method for just
11538 *ecore.cs (Expression.MemberLookup): Don't ask for emitcontext when it's
11541 * assign.cs, constant.cs, convert.cs, delegate.cs, expression.cs:
11542 Updated after another emitcontext usage was clean up. It should help us to
11543 synchronize with gmcs easier.
11545 2006-03-04 Marek Safar <marek.safar@seznam.cz>
11549 * class.cs (SetMethod.DefineParameters): Uses new parameters type ctor.
11550 (Event.Define): ditto
11551 (SetIndexerMethod.DefineParameters): Uses Parameters.MergeGenerated.
11553 * delegate.cs (Delegate.Define): Uses Parameters.MergeGenerated.
11554 Removed redundant code and set NewSlot for Invoke method too.
11556 * parameter.cs (Parameters.ctor): Add custom, type ctor.
11557 (Parameters.MergeGenerated): New method. Use this method when you merge
11558 compiler generated argument with user arguments.
11560 2006-03-03 Marek Safar <marek.safar@seznam.cz>
11562 * attribute.cs (ResolveAsTypeTerminal): Removed.
11564 * ecore.cs (Expression.ResolveAsTypeTerminal): Make virtual to allow
11565 specialization for predefined types; 30% speed up.
11566 Finally placed obsolete check to right place.
11567 (Expression.ResolveType): Removed.
11569 * enum.cs, expression.cs, parameter.cs, statement.cs, typemanager.cs:
11570 Updated after ResolveType was removed.
11572 * expression.cs (Cast.ctor): Check void cast.
11573 (Binary.ResolveAsTypeTerminal): Is never type.
11574 (Conditional.ResolveAsTypeTerminal): Is never type.
11576 * rootcontext.cs (ResolveCore): Set base type to simplify some code later.
11578 2006-03-01 Raja R Harinath <rharinath@novell.com>
11581 * expression.cs (ParameterReference.DoResolveBase): Change return
11583 (ParameterReference.DoResolve, ParameterReference.DoResolveLValue):
11587 * ecore.cs (PropertyExpr.InstanceResolve): Fix CS1540 check.
11590 * typemanager.cs (GetFullNameSignature): Don't nullref on
11591 protected accessors.
11593 2006-02-27 Marek Safar <marek.safar@seznam.cz>
11595 * attribute.cs (Attribute.PosArguments, Attribute.NamedArguments): Use
11596 these two separated members to simplify the code.
11597 (Attribute.Resolve): Refactored to use new fields and methods.
11598 (Attribute.ResolveConstructor): Extracted from ResolveArguments and
11599 implemented obsolete attribute checking.
11600 (Attribute.ResolveNamedArguments): Extracted from ResolveArguments and
11601 implemented obsolete checking again. It look line never ending quest ;-)
11602 (GlobalAttribute.ResolveConstructor): Need to override as the rest.
11604 * cfold.cs (BinaryFold): TryReduce throws an exception to indicate error.
11606 * constanct.cs (TryReduce): Throws OverflowException to indicate error.
11608 *class.cs (Property.Define): Add RegisterProperty call.
11610 * cs-parser.jay: Replaced ArrayList with fixed array for attribute
11611 argument groups (only 2).
11613 * ecore.cs (Expression.GetAttributableValue): New virtual method used for
11614 encoding expression to arguments.
11615 (Expression.ExprClassToResolveFlags): Just turned to property.
11617 * expression.cs (ArrayCreation.ValidateInitializers): Slightly optimized.
11618 (ArrayCreation.GetAttributableValue): Renamed from EncodeAsAttribute and
11619 optimized as well as implemented support for zero-length attributes.
11621 * typemanager.cs (TypeManager.RegisterProperty, TypeManager.GetProperty):
11622 Add caching of PropertyInfo's.
11624 2006-02-25 Marek Safar <marek.safar@seznam.cz>
11626 * delegate.cs (DelegateCreation.ResolveMethodGroupExpr): Don't report
11627 error multiple times.
11629 2006-02-25 Marek Safar <marek.safar@seznam.cz>
11631 New partial class implementation.
11632 A fix for #77027, #77029, #77403
11634 * attribute.cs (Attributable): Made attributes protected.
11636 * class.cs (TypeContainer): Add PartialContainer and partial_parts as
11637 the replacements of ClassPart and PartialContainer.
11638 (TypeContainer.AddClassOrStruct): Call RecordDecl here.
11639 (TypeContainer.AddInterface): Ditto.
11640 (TypeContainer.AddPartial): The main method for partial classes. It checks
11641 for errors and merges ModFlags and attributes. At the end class is added to
11642 partial_parts list.
11643 (TYpeContainer.DefineDefaultConstructor): Checks whether default ctor is
11645 (TypeContainer.GetClsCompliantAttributeValue): Cope with partial class too.
11646 (TypeContainer.GetNormalPartialBases): Resolves base classes and interfaces
11647 from the rest of partial classes.
11648 (TypeContainer.GetClassBases): Simplified.
11649 (TypeContainer.DefineTypeBuilder): New method, mostly extracted from
11651 (TypeContainer.DefineDefaultConstructor): Is used by derived classes.
11652 (TypeContainer.HasExplicitLayout): Uses Flags now.
11653 (PartialContainer): Removed.
11654 (ClassOrStruct.AddToContainer): Moved enclosing member name check here.
11655 (StaticClass): Was merged with Class.
11656 (Class.GetClassBases): class and static class bases are verified here.
11657 (Class.TypeAttr): Added static attributes when class is static.
11658 (Struct.RegisterFieldForInitialization): Moved from TypeContainer.
11659 (MemberBase): In some cases we need to call parent container for partial
11660 class. It should be eliminated but it's not easy now.
11662 * cs-parser.jay: Replaced all PartialContainer with AddPartial.
11664 * decls.cs (MemberCore.DocComment): Introduced new property as is used by
11665 partial classed to accumulate class comments.
11666 (MemberCore.GetClsCompliantAttributeValue): Moved from TypeContainer.
11668 * doc.cs (GenerateTypeDocComment): Partial classes clean up.
11670 * driver.cs (MainDriver): Tree.GetDecl was removed.
11672 * modifiers.cs (Modifiers): Add partial modifier.
11674 * tree.cs (Tree.decl): Removed.
11675 (RootTypes): Started to use this class more often for root types
11678 2006-02-22 Marek Safar <marek.safar@seznam.cz>
11682 * attribute.cs (AttributeTester.GetCoClassAttribute): Don't crash when
11683 external interface does not have an attribute.
11685 2006-02-22 Marek Safar <marek.safar@seznam.cz>
11687 Another prerequisites for new partial classs implementation.
11689 * attribute.cs (Attribute.Equal): Implemented.
11690 (Attribute.Emit): Changed as attributes can be applied more than twice.
11691 (Attributes.Emit): Check for duplicate attributes here.
11693 * class.cs, decl.cs, delegate.cs, doc.cs, enum.cs: Don't pass DeclSpace
11694 as a parameter, clean-up.
11696 2006-02-11 Marek Safar <marek.safar@seznam.cz>
11700 * class.cs (TypeContainer.DefineType): Cannot use ResolveType because it
11701 contains obsolete attribute check which can in some cases look for base
11702 type of current class which is not initialized yet.
11703 (TypeContainer.BaseType): Replacement of ptype.
11705 * decl.cs (MemberCore.CheckObsoleteType): Reuse existing code.
11707 2006-02-11 Marek Safar <marek.safar@seznam.cz>
11709 First of prerequisites for new partial classs implemention.
11711 * attribute.cs (Attributable): Extended by ResolveContext;
11712 Attributes finally have correct context for resolving in all cases.
11713 (AttachTo): Attribute owner is assigned here.
11715 * codegen.cs (IResolveContext): Introduce new interface to hold
11716 all information needed in resolving phase.
11717 (EmitContext): Implements IResolveContext; more clean-up needed here.
11719 * decl.cs (MemberCore): Implemented IResolveContext.
11721 * anonymous.cs, attribute.cs, class.cs, codegen.cs, const.cs,
11722 decl.cs, ecore.cs, enum.cs, expression.cs, iterators.cs, namespace.cs,
11723 parameter.cs, statement.cs, tree.cs, typemanager.cs:
11724 Refactored to use new IResolveContext instead of EmitContext; cleanup
11726 2006-02-06 Miguel de Icaza <miguel@novell.com>
11728 * codegen.cs (EmitScopeInitFromBlock): check here the
11729 capture_context, there is no need to make two calls to the
11732 * anonymous.cs: Add some debugging messages that might help me
11733 track other instances of this problem in the future (the
11734 regression of test 467).
11736 * cs-parser.jay: track the variable block, as we need to initalize
11737 any captured variables declared in this block for the "catch"
11738 portion of the "Try" statement.
11740 * statement.cs (Try.Emit): If the "Catch" has a VarBlock, emit any
11741 scope initialization for captured variables.
11743 Also, move the emit for the variables after the block location has
11746 2006-02-06 Marek Safar <marek.safar@seznam.cz>
11748 * ecore.cs (PropertyExpr.FindAccessors): Just made flags const.
11750 2006-02-02 Miguel de Icaza <miguel@novell.com>
11752 * anonymous.cs (CaptureContext.EmitInitScope): I was wrong in the
11753 commit yesterday, the initialization for the roots is necessary.
11754 What is not necessary is the scope activation.
11756 2006-02-02 Raja R Harinath <rharinath@novell.com>
11758 * ecore.cs (PropertyExpr.DoResolveLValue): Add CS0206 check.
11759 * expression.cs (IndexerAccess.DoResolveLValue): Add CS1612 and
11761 (Argument.Resolve): Remove CS0206 checks.
11763 2006-02-01 Miguel de Icaza <miguel@novell.com>
11765 * anonymous.cs (CaptureContext.EmitInitScope): Do not emit the
11766 scopes for all the roots, the scopes will now be emitted when the
11767 Blocks are entered. [This change was wrong, fixed on 2006-02-02]
11769 (CaptureContext.EmitScopeInitFromBlock): Simply emit the ScopeInfo
11770 code. This reduces a lot of existing cruft.
11772 * statement.cs (Block.Emit): Call EmitScopeInitFromBlock here, so
11773 that the ScopeInfo is generated as we enter the scope, not at the
11774 time of use, which is what we used to do before.
11776 * codegen.cs (EmitScopeInitFromBlock): New routine, this is called
11777 every time a Block is about to be emitted if we have a
11780 2006-02-01 Raja R Harinath <rharinath@novell.com>
11782 * typemanager.cs (NoTypes, NoTypeExprs): Remove.
11784 * *.cs: Use Type.EmptyTypes instead of TypeManager.NoTypes.
11786 * typemanager.cs (cons_param_array_attribute): Make private.
11787 (Reset): Set it to null.
11788 (InitCoreHelpers): Don't initialize it.
11789 (ConsParamArrayAttribute): New. Initialize it as needed.
11790 * parameter.cs (ParamsParameter.ApplyAttribute): Update to change.
11792 2006-01-31 Miguel de Icaza <miguel@novell.com>
11794 * expression.cs: There might be errors reported during the
11795 selection of applicable methods. If there are errors, do not
11796 continue execution as it will lead the compiler to crash.
11798 2006-01-30 Miguel de Icaza <miguel@novell.com>
11800 * expression.cs: Member access is not allowed on anonymous
11801 methods. Fixes #77402.
11803 2006-01-30 Raja R Harinath <rharinath@novell.com>
11806 * cs-parser.jay (VariableDeclaration): Don't set
11807 current_array_type to null.
11808 (field_declaration, event_declaration, declaration_statement):
11809 Set it to null here.
11811 2006-01-28 Raja R Harinath <harinath@gmail.com>
11813 * typemanager.cs (GenericParameterPosition): New.
11816 2006-01-28 Atsushi Enomoto <atsushi@ximian.com>
11818 * doc.cs : To process "include" elements, first we should create
11819 another list than XmlNodeList, because it could result in node
11820 removal, which could result in that the XmlNodeList gives up
11821 yielding next node.
11823 (Also made code identical to gmcs again.)
11825 2006-01-25 Miguel de Icaza <miguel@novell.com>
11827 * ecore.cs: Introduce an error report that we were not catching
11828 before, if not silent, we must report the error. Gonzalo ran into
11831 2006-01-23 Miguel de Icaza <miguel@novell.com>
11833 A fix for bug: #76957
11835 * iterators.cs (MoveNextMethod.CreateMethodHost): call
11836 ComputeMethodHost before creating the method, this is a new
11839 * anonymous.cs (AnonymousContainer): Now we track all the scopes
11840 that this method references (RegisterScope). The actual scope
11841 where the method is hosted is computed with the ComputeMethodHost
11842 before we create the method.
11844 Moved the Deepest routine here.
11846 (AnonymousContainer.ComputeMethodHost): New routine used to
11847 compute the proper ScopeInfo that will host the anonymous method.
11849 (ScopeInfo): Deal with multiple roots. The problem was that we
11850 did not have a unique root where all ScopeInfos could be hanged
11851 from. Remove `topmost' ScopeInfo, and instead keep an arraylist
11854 Remove AdjustMethodScope which is now computed at the end. Remove
11855 LinkScope which did a partial link, instead link all ScopeInfos
11856 before code generation from the new "LinkScopes" routine.
11858 Simplify all the Add* routines as they no longer need to maintain
11859 the tree, they just need to record that they are using variables
11862 (IsAncestor, GetAncestorScopes, GetParentScope, LinkScope): New
11863 routines to produce the forest of ScopeInfo trees.
11865 * class.cs (TypeContainer.AppendMethod): This is just like
11866 AddMethod, but ensures that an interface implementation method
11867 (IEnumerable.XXX) is not inserted at the beginning of the queue of
11868 methods, but at the end.
11870 We use this functionality to ensure that the generated MoveNext
11871 method in the iterator class is resolved/emitted before the
11872 enumerator methods created.
11874 This is required because the MoveNext method computes the right
11875 ScopeInfo for the method. And the other methods will eventually
11876 need to resolve and fetch information computed from the anonymous
11879 2006-01-21 Raja R Harinath <harinath@gmail.com>
11880 Carlos Alberto Cortez <calberto.cortez@gmail.com>
11882 Fix rest of #76995.
11883 * namespace.cs (NamespaceEntry.UsingExternalAliases): Don't add to
11884 the 'aliases' hash.
11885 (NamespaceEntry.LookupAlias): Lookup 'extern_aliases' hash too.
11886 (NamespaceEntry.VerifyUsing): Resolve external aliases too.
11888 2006-01-18 Raja R Harinath <rharinath@novell.com>
11890 Fix #76656, cs0231-2.cs.
11891 * cs-parser.jay (formal_parameter_list): Make error case catch
11893 (parenthesized_expression_0): Add CS1026 check.
11894 (invocation_expression): Remove unused { $$ = lexer.Location }.
11896 2006-01-17 Raja R Harinath <rharinath@novell.com>
11899 * cs-parser.jay (statement_expression): Don't list out the
11900 individual statement-expressions. Convert syntax error into
11903 2006-01-16 Raja R Harinath <rharinath@novell.com>
11906 * ecore.cs (MemberAccess.CheckIntermediateModification): Remove.
11907 (UnboxCast.DoResolveLValue): New. Move CS0445 check from
11908 CheckIntermediateModification.
11909 (FieldExpr.DoResolve): Add new two-argument version that
11910 allows us to resolve the InstanceExpression as an lvalue.
11911 The one-argument variant is now just a wrapper.
11912 (FieldExpr.DoResolveLValue): Use two-argument DoResolve.
11913 Resolve the lhs as an lvalue if the it has a value type.
11914 (FieldExpr.AssignToReadonly): Move CS1648 and CS1650 checks
11915 from Assign.DoResolve.
11916 (PropertyExpr.InstanceResolve): Allow InstanceExpression to be
11917 resolved as an lvalue.
11918 (PropertyExpr.DoResolve): Update.
11919 (PropertyExpr.DoResolveLValue): Resolve the lhs as an lvalue if it
11920 has a value type. Move CS1612 check here from
11921 CheckIntermediateModification.
11922 * assign.cs (Assign.DoResolve): Remove CS1648 and CS1650 checks.
11923 * expression.cs (EmptyExpression.OutAccess): New. Used as the
11924 'right_side' of a ResolveLValue on an 'out' argument.
11925 (EmptyExpression.LValueMemberAccess): New. Used as the
11926 'right_side' of a propagated ResolveLValue on a value type.
11927 (LocalVariableReference.DoResolveBase): Recognize
11928 EmptyExpression.OutAccess and EmptyExpression.LValueMemberAccess.
11930 (Argument.Resolve): Use EmptyExpression.OutAccess rather than
11931 EmptyExpression.Null.
11933 2006-01-16 Atsushi Enomoto <atsushi@ximian.com>
11935 * typemanager.cs : added IsGenericParameter(). In mcs it always
11937 * doc.cs : for generic parameters, use GenericParameterPosition,
11940 2006-01-12 Ben Maurer <bmaurer@andrew.cmu.edu>
11942 * expression.cs: Fix Console.WriteLine ((this = x).foo);
11944 2006-01-12 Miguel de Icaza <miguel@novell.com>
11946 This fixes the problem where we used ldfld instead of ldflda to
11947 load the "THIS" pointer on captured parameters, when THIS is a
11948 value type. See bug #77205.
11950 * iterators.cs (CapturedThisReference.Emit): Pass false to
11951 EmitThis (we do not need the address).
11953 * codegen.cs (EmitThis): it needs to know whether we need the
11954 address of `this' or not. This is used by value types.
11956 * expression.cs (This.AddressOf): Pass true to the EmitThis call,
11957 every other call passes false.
11959 2006-01-12 Raja R Harinath <rharinath@novell.com>
11962 * typemanager.cs (TryGetBaseDefinition): Rename from the mis-named
11964 * expression.cs (Invocation.OverloadResolve): Update.
11965 (Invocation.DoResolve): Avoid double resolution of invocation.
11967 2006-01-11 Raja R Harinath <rharinath@novell.com>
11970 * expression.cs (Unary.Emit): When in /checked+ mode, don't emit
11971 unary negation of floating point types as 0-expr; negation cannot
11972 overflow in floating point types.
11975 * expression.cs (MemberAccess.DoResolve): Disallow the use of '.'
11976 on operands of 'void' type.
11979 * cfold.cs (BinaryFold): Implement folding of BinaryOr, BinaryAnd
11980 and ExclusiveOr for boolean constants too.
11982 2006-01-09 Raja R Harinath <rharinath@novell.com>
11985 * expression.cs (Invocation.OverloadResolve): Replace reflected
11986 override methods with their base virtual methods, rather than
11987 skipping over them.
11988 * typemanager.cs (TypeManager.GetOverride): New.
11990 2006-01-05 Jb Evain <jbevain@gmail.com>
11992 * class.cs (Property.Define, Indexer.Define): do not tag the
11993 properties as SpecialName | RTSpecialName.
11995 2006-01-04 Miguel de Icaza <miguel@novell.com>
11997 * class.cs (MethodCore.IsDuplicateImplementation): This method was
11998 doing a low-level comparission of parameter types. It was lacking
11999 a check for __argslist.
12001 2005-12-30 Miguel de Icaza <miguel@novell.com>
12003 * expression.cs (ParameterReference.DoResolveBase): Allow
12004 reference parameters if they are local to this block.
12006 This allows the ref and out parameters of a delegate to be used in
12007 an anonymous method, for example:
12009 delegate void set (out int x);
12011 set s = delegate (out int x){
12015 This is used by functionality introduced late in the C# language.
12017 * anonymous.cs (AnonymousMethod.Compatible): Allow anonymous
12018 method that take ref and out parameters.
12020 Fixes #77119 which was a late change in the spec.
12022 2005-12-23 Miguel de Icaza <miguel@novell.com>
12024 * anonymous.cs (ScopeInfo.LinkScope): Do not link the scope to its
12025 parent if its the same scope. Fixes #77060.
12027 2005-12-21 Miguel de Icaza <miguel@novell.com>
12029 * driver.cs: Report the case of no source files and no -out:
12032 2005-12-20 Raja R Harinath <rharinath@novell.com>
12035 * expression.cs (ComposedCast.GetSignatureForError): Define.
12037 2005-12-18 Carlos Alberto Cortez <calberto.cortez@gmail.com>
12041 * namespace.cs (NamespaceEntry): Add extern_aliases as a
12042 ListDictionary, to contain the ExternAliasEntry entries (in
12043 addition to the NamespaceEntry.aliases hashtable). This field is
12044 shared between the original entry and its doppelganger (bodyless
12046 (NamespaceEntry.UsingExternalAlias): Add the extern alias entry to
12047 extern_aliases field.
12048 (NamespaceEntry.Lookup): Move the IsImplicit check after the
12049 lookup in extern_aliases.
12051 2005-12-16 Raja R Harinath <rharinath@novell.com>
12054 * class.cs (TypeContainer.Mark_HasEquals): New.
12055 (TypeContainer.Mark_HasGetHashCode): New.
12056 (ClassPart): Override them.
12057 (MethodCore.CheckBase): Use them instead of referring to Parent.Methods.
12060 * enum.cs (EnumMember.EnumMember): Pass the parent_enum as the
12061 'parent' argument to the base constructor.
12063 Remove all mention of TypeContainer from decl.cs.
12064 * decl.cs (MemberCore.Parent): Change into a DeclSpace.
12065 (MemberCore.MemberCore): Change type of 'parent' argument to DeclSpace.
12066 (DeclSpace.DeclSpace): Likewise.
12067 (DeclSpace.DefineMembers): Remove unused argument.
12068 * cs-parser.jay (pop_current_class): Update to changes. Simplify
12069 debugging check -- we don't care if the debug code throws an
12070 InvalidCastException instead of an InternalErrorException.
12071 * class.cs (TypeContainer.DefineMembers): Update to changes.
12072 (TypeContainer.DoDefineMembers): Likewise.
12073 (TypeContainer.GetMethods): Likewise.
12074 (PropertyMember.Define): Likewise.
12075 (MemberBase.Parent): New property that forwards to
12076 MemberCore.Parent, but ensures that we get a TypeContainer.
12077 * rootcontext.cs (RootContext.PopulateCoreType): Update to changes.
12078 (RootContext.PopulateTypes): Likewise. Remove special case code
12079 for !RootContext.StdLib: DefineMembers is idempotent.
12081 2005-12-14 Miguel de Icaza <miguel@novell.com>
12083 * convert.cs (ExplicitConversionCore): Check the return value from
12084 ExplicitConversionCore which can return null on failure. Fixes #76914
12086 2005-12-13 Marek Safar <marek.safar@seznam.cz>
12088 * class.cs (Method.ApplyAttributeBuilder): Test out modifier properly.
12090 2005-12-11 Atsushi Enomoto <atsushi@ximian.com>
12092 * doc.cs : The search for referenced namespace was insufficient to
12093 get global one as it used to do. Fixed bug #76965.
12095 2005-12-10 Atsushi Enomoto <atsushi@ximian.com>
12097 * doc.cs : check name in cref in the last phase that whether it is
12100 2005-12-09 Atsushi Enomoto <atsushi@ximian.com>
12102 * cs-tokenizer.cs : reverted the latest change: it somehow broke
12105 2005-12-09 Atsushi Enomoto <atsushi@ximian.com>
12107 * doc.cs : so it turned out that we cannot skip override check for
12108 interface members. Fixed bug #76954.
12110 2005-12-09 Atsushi Enomoto <atsushi@ximian.com>
12112 * cs-tokenizer.cs : fixed bug #75984:
12113 - #warning and #error should not be handled when the source line
12115 - #line is not checked strictly when the source line is disabled.
12116 - #define and #undef is on the other hand checked strictly at any
12119 2005-12-08 Atsushi Enomoto <atsushi@ximian.com>
12121 * cs-tokenizer.cs : missing Location (actually, filename) in one of
12124 2005-12-05 Marek Safar <marek.safar@seznam.cz>
12126 * attribute.cs (GlobalAttribute.ctor): Pass NamespaceEntry only.
12128 * class.cs (EmitFieldInitializers): Simplified and fixed to work with
12129 event initializers.
12130 (FieldBase.EmitInitializer): Moved from TypeContainer and simplified.
12131 (FieldBase.Initializer): Initializer is now optional.
12132 (EventField.Define): Only event field can have initializer.
12134 * codegen.cs (EmitContext): DeclSpace is not readonly (small hack).
12136 * const.cs (Const): Reuse initializer.
12138 * cs-parser.jay: Updated after FieldBase changes.
12139 Added current_array_type to simplify array initializers.
12141 * ecore.cs (NullCast.IsDefaultValue): Implemented.
12143 * expression.cs, iterators.cs: Updated.
12145 * namespace.cs (NamespaceEntry): Made UsingFound private.
12147 2005-12-05 Marek Safar <marek.safar@seznam.cz>
12149 * parameterCollection.cs: Obsolete, removed.
12150 * parser.cs: Obsolete, removed.
12152 2005-12-05 Marek Safar <marek.safar@seznam.cz>
12155 * class.cs (Constructor.Emit): Set obsolete checking for whole context.
12157 * enum.cs (Enum.Define): Set obsolete context here.
12159 2005-12-05 Atsushi Enomoto <atsushi@ximian.com>
12162 - FindDocumentedMember() now expects 1) paramList as null
12163 when "we don't have to check the number of parameters" and
12164 2) Type.EmptyTypes when "there is no arguments".
12165 - Introduced FoundMember struct to hold the exact type which was
12166 used to find the documented member (the above change broke
12167 test-xml-044; it might be better just to use DeclaringType than
12168 what MS does, like this change does, but it depends on usage.)
12170 2005-12-05 Atsushi Enomoto <atsushi@ximian.com>
12172 * doc.cs : documented member might be from DeclaringType for nested
12173 types. Fixed bug #76782.
12175 2005-12-03 Ben Maurer <bmaurer@ximian.com>
12177 * anonymous.cs: Have the param code handle leaving copies on the
12178 stack etc. Allows anonymous params to take part in the assignment
12179 code (++, +=, etc). Fixes bug #76550
12181 * expression.cs: Handle the prepare_for_load/leave_copy by passing
12182 it down to the anon code.
12184 * iterators.cs: Use dummy var here
12186 * codegen.cs: Handle new vars
12188 2005-12-01 Marek Safar <marek.safar@seznam.cz>
12191 * class.cs (MethodData.Define): Set proper Obsolete context.
12193 * ecore.cs (FieldExpr.ResolveMemberAccess): Don't check [Obsolete] in
12195 (FieldExpr.DoResolve): Ditto.
12197 2005-12-01 Marek Safar <marek.safar@seznam.cz>
12200 * class.cs (MethodCore.DoDefineParameters): Test [Obsolete] only when
12201 parent is not obsolete.
12203 2005-12-01 Atsushi Enomoto <atsushi@ximian.com>
12205 * doc.cs : (FindDocumentedMember) find parameterless members first
12206 and get CS0419 in the early stage. Fixed first case of bug #76727.
12208 2005-11-30 Marek Safar <marek.safar@seznam.cz>
12211 * ecore.cs (Expression.ResolveAsConstant): Report constant error only when
12212 no error was reported.
12214 *expression.cs (Binary.DoResolve): left can be null.
12216 2005-11-22 Marek Safar <marek.safar@seznam.cz>
12219 * class.cs (MethodData.Emit): Parameters should be labeled first.
12221 2005-11-21 Marek Safar <marek.safar@seznam.cz>
12224 * parameter.cs (Parameter.ApplyAttributeBuilder): Fixed `ref' detection.
12226 2005-11-18 Marek Safar <marek.safar@seznam.cz>
12228 * attribute.cs (AreParametersCompliant): Moved to Parameter.
12230 * class.cs (MethodCore): Parameter clean up.
12231 (IMethodData): Added ParameterInfo.
12232 (MethodData): Parameter clean up.
12233 (Indexer.Define): Parameter clean up.
12245 * typemanager.cs: Parameter clean up.
12247 * delegate.cs (Define): Get rid of duplicated code.
12249 * expression.cs (ParameterReference): Removed useless parameters
12251 (Invocation): Ditto.
12253 * parameter.cs (ParamsParameter): New class, params specialization.
12254 (ArglistParameter): Attemp to separate arglist.
12255 (Parameter): Refactored to be reusable and faster.
12256 (Parameter.Modifier): Made understandable.
12257 (Parameters): Changed to be used as a class for `this' assembly
12258 parameters. Refactored to use new specialized classes.
12260 * support.cs (ParameterData): Added Types property.
12261 (InternalParameters): Deleted.
12263 2005-08-20 Martin Baulig <martin@ximian.com>
12265 Merging this patch from GMCS to fix #75867.
12267 * anonymous.cs (CaptureContext.CaptureThis): Create the topmost
12268 scope if we don't already have it.
12270 2005-11-17 Martin Baulig <martin@ximian.com>
12273 (CaptureContext.EmitMethodHostInstance): Use `Ldarg_0' if we
12274 inherit the scope from our parent. Fixes #76653.
12276 2005-11-16 Atsushi Enomoto <atsushi@ximian.com>
12278 * doc.cs : the previous patch does not actually fix the bug.
12279 PropertyInfo override check is now implemented and really fixed it.
12280 * expression.cs : Invocation.IsAncestralType() is used from doc.cs.
12282 2005-11-16 Atsushi Enomoto <atsushi@ximian.com>
12284 * doc.cs : apply "override filter" also to properties.
12287 2005-11-16 Atsushi Enomoto <atsushi@ximian.com>
12289 * doc.cs : renamed FindMembers() to FindMethodBase(). For interfaces,
12290 no need to check overrides. For classes, omit those results from
12291 interfaces since they must exist in the class. Fixed bug #76726.
12293 2005-11-15 Atsushi Enomoto <atsushi@ximian.com>
12295 * typemanager.cs : (GetFullNameSignature) differentiate indexers
12296 with different parameters. Fixed the second problem in #76685.
12298 2005-11-15 Atsushi Enomoto <atsushi@ximian.com>
12300 * doc.cs : (FindDocumentedMember) pass invocation_type as well (to
12301 get expected 'protected' access in CheckValidFamilyAccess()).
12304 2005-11-15 Atsushi Enomoto <atsushi@ximian.com>
12306 * doc.cs : (GenerateTypeDocComment) Fields could be FixedField.
12307 Fixed bug #76705. CS1569 was incorrectly commented out.
12309 2005-11-14 Atsushi Enomoto <atsushi@ximian.com>
12311 * doc.cs : use Invocation.IsOverride() to do real override check.
12312 * expression.cs : made Invocation.IsOverride() internal.
12314 2005-11-14 Atsushi Enomoto <atsushi@ximian.com>
12316 * doc.cs : use TypeManager.FindMembers() instead of (possible)
12317 TypeBuilder.FindMembers() and filter overriden base members out.
12320 2005-11-13 Atsushi Enomoto <atsushi@ximian.com>
12322 * doc.cs : ref/out parameters are represented as '@' (instead of
12323 '&' in type FullName). Fixed bug #76630 (additionally crefs).
12325 2005-11-13 Atsushi Enomoto <atsushi@ximian.com>
12327 * doc.cs : when there was no '.' in cref to methods in doc comment,
12328 then parameters were missing in the output. Fixed bug #76691.
12330 2005-11-13 Atsushi Enomoto <atsushi@ximian.com>
12332 * driver.cs : don't output docs when there is an error.
12335 2005-11-13 Atsushi Enomoto <atsushi@ximian.com>
12338 Now it should detect indexers. Fixed primary concern in bug #76685.
12339 Fixed CS0419 message to not show the identical member signature in
12342 2005-11-13 Atsushi Enomoto <atsushi@ximian.com>
12344 * doc.cs : (FindDocumentedMember) use TypeManager.MemberLookup()
12345 instead of Type.FindMembers() since it does not handle events.
12348 2005-11-12 Gert Driesen <drieseng@users.sourceforge.net>
12350 * codegen.cs: Fixed typo (speficied -> specified).
12352 2005-11-11 Marek Safar <marek.safar@seznam.cz>
12355 * doc.cs (FindDocumentedTypeNonArray): Don't resolve again.
12357 2005-11-11 Marek Safar <marek.safar@seznam.cz>
12359 * attribute.cs: Changed error message.
12361 * cs-tokenizer.cs: One more check.
12363 2005-11-10 Marek Safar <marek.safar@seznam.cz>
12365 * statement.cs (Block.Resolve): Ignore empty statement.
12367 2005-11-10 Marek Safar <marek.safar@seznam.cz>
12369 * report.cs: Made error/warning methods more strict to avoid
12372 * anonymous.cs, attribute.cs, class.cs, codegen.cs, constant.cs,
12373 convert.cs, cs-parser.jay, cs-tokenizer.cs, decl.cs, delegate.cs,
12374 doc.cs, driver.cs, ecore.cs, expression.cs, location.cs,
12375 namespace.cs, parameter.cs, statement.cs, typemanager.cs: Updated.
12377 2005-11-08 Marek Safar <marek.safar@seznam.cz>
12379 * attribute.cs (Attribute.GetCoClassAttributeValue): New method.
12380 (AttributeTester.GetCoClassAttribute): Get CoClassAttribute.
12382 * class.cs (TypeContainer.IsComImport): New property.
12383 (Constructor.Define): Create proper ctor for ComImport types.
12385 * expression.cs (New.CheckComImport): Fixed.
12387 2005-11-07 Miguel de Icaza <miguel@novell.com>
12389 * anonymous.cs (CaptureContext.AddParameterToContext): The fact
12390 that a parameter has been captured does not mean that we do not
12391 have to do the rest of the processing. This fixes the second part
12392 of #76592. If there was another anonymous method capturing
12393 values in the past, the Scope would never be set for the second
12394 method that captured the same parameter.
12396 (CaptureContext.EmitAssignParameter): When `leave_copy' is passed,
12397 properly manipulate the stack. Second part of fix for #76592.
12399 * expression.cs (New): Add support for invoking "new" on
12400 interfaces that have been flagged with the ComImport attribute and
12401 the CoClass. Fixes #76637
12403 * statement.cs (Try.DoEmit): When a variable is captured, do not
12404 try to emit the vi.LocalBuilder variable as it has been captured.
12405 Create a temporary variable and store the results on the
12406 FieldBuilder. Fixes #76642
12408 2005-11-07 Marek Safar <marek.safar@seznam.cz>
12410 * class.cs (CheckPairedOperators): Made compilable with csc 2.0.
12412 * ecore.cs (InstanceResolve): Fixed CS1540 detection.
12414 * expression.cs (Binary.DoResolve): Added && optimalization.
12416 * typemanager.cs (AddUserType): Removed useless argument.
12418 2005-11-04 Marek Safar <marek.safar@seznam.cz>
12420 * statement.cs (Block.variables): Uses ListDictionary.
12422 2005-11-03 Marek Safar <marek.safar@seznam.cz>
12425 * class.cs (PartialContainer.EmitType): Customized to emit
12426 security attributes.
12427 (ClassPart.ApplyAttributeBuilder): Transform security attribute
12428 for partial classes.
12430 2005-11-03 Marek Safar <marek.safar@seznam.cz>
12433 * expression.cs (ElementAccess.DoResolveLValue): Fixed buffer
12434 access has to be fixed.
12436 * typemanager.cs (IsUnmanagedType): Wrong common field type.
12438 2005-11-01 Marek Safar <marek.safar@seznam.cz>
12441 * ecore.cs (NullCast.Reduce): Implemented.
12443 * expression.cs (ArrayCreation.CheckIndices): Correcly check
12446 * statement.cs (SwitchLabel.ResolveAndReduce): Catch null
12448 (Foreach.Resolve): Catch null properly.
12450 2005-10-29 Marek Safar <marek.safar@seznam.cz>
12452 * cs-tokenizer.cs: Warning text fix.
12454 * driver.cs: AllWarningNumbers exposed on public interface.
12456 * report.cs (): Reviewed warning numbers.
12457 (IsValidWarning): Use binary search.
12459 2005-10-29 Marek Safar <marek.safar@seznam.cz>
12461 * driver.cs: Implemeted resource visibility.
12462 (Resources): New class for code sharing between /res: and
12465 2005-10-28 Marek Safar <marek.safar@seznam.cz>
12468 * cfold.cs (ConstantFold.BinaryFold): Implemented null cast
12471 * convert (Convert.ImplicitReferenceConversion): NullCast holds
12474 * ecore.cs (NullCast): Child is contant only.
12476 * literal.cs (NullLiteral.Reduce): null can be converted to any
12479 2005-10-28 Kornél Pál <kornelpal@hotmail.com>
12481 * driver.cs: Use Encoding.Default as default code page instead
12484 2005-10-27 Raja R Harinath <rharinath@novell.com>
12487 * expression.cs (Invocation.Error_InvalidArguments): Handle
12488 __arglist parameters.
12489 (Invocation.VerifyArgumentsCompat): Likewise.
12490 * support.cs (ReflectionParameters.GetSignatureForError): Print
12491 __arglist parameters.
12492 (InternalParamters.GetSignatureForError): Likewise.
12493 * parameter.cs (Parameters.GetSignatureForError): Likewise.
12495 2005-10-26 Marek Safar <marek.safar@seznam.cz>
12497 * attribute.cs (GetPropertyValue): Made public.
12499 * codegen.cs (AssemblyClass): ResolveClsCompliance renamed to
12501 Add new property WrapNonExceptionThrows to handle 2.0 assembly
12503 (AssemblyClass.Emit): Emit RuntimeCompatibilityAttribute when it
12506 * driver.cs: Reflect method name change.
12508 * statement.cs (Try.Resolve): Warn when try has both general
12509 exception handlers.
12511 * typemanager.cs: runtime_compatibility_attr_type new predefined
12514 2005-10-26 Raja R Harinath <harinath@gmail.com>
12517 * pending.cs (InterfaceMethod): Allow tm.args [i] to be null --
12518 treat it as an empty parameter list.
12520 2005-10-26 Raja R Harinath <rharinath@novell.com>
12523 * ecore.cs (SimpleName.DoSimpleNameResolve): Make fall-back
12524 ResolveAsTypeStep silent.
12525 * statement.cs (Block.AddConstant): Mark block as used.
12526 (Block.ResolveMeta): Avoid piling on error messages
12527 if a constant initializer resolution fails.
12529 2005-10-25 Raja R Harinath <rharinath@novell.com>
12531 * namespace.cs (RootNamespace.VerifyUsingForAll, Namespace.VerifyUsing):
12533 (NamespaceEntry.VerifyAllUsing): New.
12534 (NamespaceEntry.AliasEntry.Resolve): New. Handles common error
12535 behaviour. Delegates actual resolution of alias to ...
12536 (NamespaceEntry.DoResolve): ... this. Renamed from Resolve.
12537 (NamespaceEntry.LocalAliasEntry, NamespaceEntry.ExternAliasEntry):
12539 * driver.cs (Driver.MainDriver): Update.
12541 * namespace.cs (NamespaceEntry.DefineNamespace): Remove.
12542 (NamespaceEntry.SymbolFileID): Make into a on-demand computed
12544 (Namespace.DefineNamespaces, RootNamespace.DefineNamespacesForAll):
12546 * symbolwriter.cs (SymbolWriter.Initialize): Don't call
12547 RootNamespace.DefineNamespacesForAll.
12549 2005-10-24 Raja R Harinath <harinath@gmail.com>
12551 * typemanager.cs (assemblies, external_aliases, modules)
12552 (AddAssembly, AddExternAlias, AddModule GetAssemblies, Modules)
12553 (ComputeNamespaces, GetRootNamespace): Remove extra staging
12554 overhead. Move resposibility ...
12555 * namespace.cs (GlobalRootNamespace): ... here. Update to changes.
12556 * driver.cs, attribute.cs, codegen.cs: Update to changes.
12558 2005-10-23 Raja R Harinath <harinath@gmail.com>
12560 * namespace.cs (RootNamespace.all_namespaces): Renamed from
12561 cached_namespaces. Improve usage.
12562 (RootNamespace.Reset, RootNamespace.RegisterNamespace)
12563 (RootNamespace.VerifyUsingForAll, RootNamespace.DefineNamespacesForAll):
12564 Move from GlobalRootNamespace and simplify.
12565 (RootNamespace.Global): Make instance variable.
12566 (RootNamespace.RootNamespace): Add "alias name" parameter.
12567 (GlobalRootNamespace): Simplify drastically.
12568 (Namespace.Lookup): Don't use GetNamespace.
12569 * typemanager.cs (GetRootNamespace): Rename from
12570 ComputeNamespaceForAlias.
12571 (NamespaceClash): Use Global.IsNamespace instead of GetNamespace.
12573 2005-10-23 Marek Safar <marek.safar@seznam.cz>
12575 * anonymous.cs (AnonymousContainer): Don't crash when container
12578 2005-10-23 Marek Safar <marek.safar@seznam.cz>
12580 * expression.cs (Binary.DoResolve): Warn when comparing same
12583 2005-10-23 Marek Safar <marek.safar@seznam.cz>
12586 * expression.cs (Binary.DoResolve): It looks like there are no
12587 convetsion rules in enum context.
12589 2005-10-19 Carlos Alberto Cortez <calberto.cortez@gmail.com>
12591 Add support for extern alias qualifiers.
12592 * typemanager.cs: Move some LookupTypeReflection code
12593 to namespace.cs, to have cleaner code. Added some methods
12594 to help us keep track of the extern aliased references.
12595 * driver.cs: Add suport for extern alias assemblies on command
12596 line and check for their warnings/errors. Also keep track of the
12597 extern aliased assemblies.
12598 * namespace.cs: Move the global functionality of Namespace
12599 to GlobalRootNamespace/RootNamespace. Now the global namespace
12600 is GlobalRootNamespace.Globa. Also the code moved from
12601 typemanager.cs lives in GlobalRootNames.cs/RootNamespace.cs.
12602 Finally added LocalAliasEntry (AliasEntry before) and
12603 ExternAliasEntry, to handle alias statements.
12604 * cs-parser.jay: Add support in the grammar for extern alias
12606 * doc.cs, delegate.cs, expression.cs ecore.cs, symbolwriter.cs:
12607 Update callings to Namespace (now in GlobalRootNamespace).
12609 2005-10-18 Raja R Harinath <rharinath@novell.com>
12612 * class.cs (TypeContainer.DefineType): Move updating of
12613 topological sort earlier in the code.
12614 * decl.cs (DeclSpace.ResolveBaseTypeExpr): Don't use TypeBuilder.
12616 2005-10-18 Marek Safar <marek.safar@seznam.cz>
12619 * cfold.cs (BinaryFold): Reduce constant in enum conversion.
12621 * constant.cs (Constant.TryReduce): Moved from Cast class.
12622 (Reduce): Made little bit more OO and fixed missing conversions.
12624 * ecore.cs (Reduce): Implemented.
12625 (Binary.EnumLiftUp): New method to upgrade values to enum values.
12627 * literal.cs (Reduce): Implemented.
12629 * class.cs: Reverted Miguel's wrong commit.
12631 2005-10-14 Miguel de Icaza <miguel@novell.com>
12633 * ecore.cs (GetMemberType): Report the correct mapping for the MemberCore
12635 2005-10-14 Atsushi Enomoto <atsushi@ximian.com>
12637 * cs-parser.jay, expression.cs : CS0214 was missing error location
12638 for constants. Fixed bug #76404.
12640 2005-10-11 Marek Safar <marek.safar@seznam.cz>
12643 * convert.cs (ExplicitConversionCore): Fixed object->enum
12646 2005-10-10 Raja R Harinath <rharinath@novell.com>
12648 * ecore.cs (PropertyExpr.Emit): Use Invocation.EmitCall to emit
12649 InstanceExpression.
12650 (PropertyExpr.EmitCall): Likewise.
12651 * expression.cs (Invocation.EmitArguments): Handle case where
12653 (Invocation.EmitCall): Avoid allocating temporary variable if
12654 there are no arguments.
12656 2005-10-07 Raja R Harinath <rharinath@novell.com>
12659 * convert.cs (ImplicitConversionStandard): Move conversion of
12660 void* to arbitrary pointer types ...
12661 (ExplicitConversionStandard): .. here.
12662 * ecore.cs (Expression.Error_ValueCannotBeConverted): Fix CS0266
12663 error to always print typenames.
12665 2005-10-07 Raja R Harinath <rharinath@novell.com>
12667 * convert.cs (GetConversionOperator): Rename from
12668 GetConversionOperators. Move operator selection code from ...
12669 (UserDefinedConversion): ... here.
12671 2005-10-06 Marek Safar <marek.safar@seznam.cz>
12673 * convert.cs (ExplicitConversionCore): Removed duplicate enum
12676 2005-10-05 Marek Safar <marek.safar@seznam.cz>
12678 * assign.cs (Assign.DoResolve): Error method changed.
12680 * cfold.cs (DoConstantNumericPromotions): Error method changed.
12682 * const.cs (ResolveValue): Reset in_transit immediately.
12684 * constant.cs: Error method changed.
12686 * convert.cs: Removed useless location parameter.
12687 (ExplicitNumericConversion): Don't do double enum check.
12688 (ExplicitConversionCore): Renamed from ExplicitConversion.
12689 (ExplicitUnsafe): Extracted from ExplicitConversion.
12690 (ExplicitConversion): Uses for error reporting.
12692 * ecore.cs (Error_ValueCannotBeConverted): More logic for more
12694 (ResolveBoolean): Uses common error method.
12695 (CastToDecimal): Get rid of ec.
12696 (CastFromDecimal): Optimized.
12697 (ConvCast): Get rid of ec.
12699 * enum.cs (ResolveValue): Reset in_transit immediately.
12700 (Emit): Return after first error.
12702 * expression.cs: Convert changes.
12704 * literal.cs: Error method changed.
12706 * statement.cs: Error method changed.
12708 2005-10-03 Raja R Harinath <rharinath@novell.com>
12710 * support.cs (SeekableStreamReader.Position): Don't error out when
12711 the requested position is just beyond the end of the current
12714 2005-09-28 Raja R Harinath <rharinath@novell.com>
12716 * support.cs (SeekableStreamReader): Simplify drastically. Don't
12717 try to keep in sync with the byte count of the underlying Stream.
12718 However, this limits us to a window size of 2048 characters: i.e.,
12719 the maximum lookahead of our lexer/parser can be 2048 characters.
12721 2005-09-28 Marek Safar <marek.safar@seznam.cz>
12724 * driver.cs: Fix compilation files with full root path.
12726 2005-09-25 Miguel de Icaza <miguel@novell.com>
12728 * report.cs (SymbolRelatedToPreviousError): Format the output so
12729 it does not use an open parenthesis that is never closed.
12731 * driver.cs: Follow coding guidelines
12733 2005-09-27 Marek Safar <marek.safar@seznam.cz>
12736 * const.cs (Const.ResolveValue): Check for assigning non-null
12737 value to reference type.
12739 2005-09-27 Marek Safar <marek.safar@seznam.cz>
12741 * anonymous.cs: Implemented ExprClassName.
12743 * assign.cs (Assign.DoResolve): Don't chrash when type is not
12746 * attribute.cs (ResolveArguments): Enabled MethodImplOptions
12749 * class.cs (StaticClass.DefineContainerMembers): Report protected
12752 * codegen.cs: if(ed) PRODUCTION.
12754 * convert.cs (Error_CannotImplicitConversion): Better error
12757 * cs-parser.jay: More error checks.
12759 * cs-tokenizer.cs (consume_identifier): Fixed Miguel's revert.
12761 * driver.cs (CSCParseOption): Enabled wrong option check.
12763 * ecore.cs (Expression.ExprClassName): Turned to property.
12764 (MemberExpr.CheckIntermediateModification): For checking boxed
12765 value types modification.
12767 * statement.cs (Fixed.Resolve): Expression type must be
12768 convertible to fixed type.
12769 (CollectionForeach.GetEnumeratorFilter,TryType):
12770 Small refactoring for easier error checking.
12772 2005-09-26 Marek Safar <marek.safar@seznam.cz>
12774 * attribute.cs (Attribute.Resolve): Check Obsolete attribute for
12777 * class.cs (GeneratedBaseInitializer): New class for customization
12778 compiler generated initializers.
12779 (MemberBase.DoDefine): Check Obsolete attribute here.
12780 (FieldMember.DoDefine): Ditto.
12782 * const.cs (ExternalConstant.CreateDecimal): Builder for decimal
12785 * decl.cs (MemberCore.EmitContext): Returns valid current ec.
12786 (MemberCore.GetObsoleteAttribute): Removed argument.
12787 (MemberCore.CheckObsoleteness): Obsolete attributes are hierarchic.
12788 (MemberCore.CheckObsoleteType): New helper.
12792 * statement.cs: Updates after MemberCore changes.
12794 * ecore.cs (TypeExpr.ResolveType): Check type obsoleteness here.
12795 (FieldExpr.ResolveMemberAccess): Fixed decimal constants checks.
12797 * expression.cs (ComposedCast.DoResolveAsTypeStep): Don't check
12798 obsolete attribute for compiler construct.
12799 (As.DoResolve): Cache result.
12801 * iterators.cs (Define_Constructor): Use GeneratedBaseInitializer.
12803 2005-09-26 Raja R Harinath <rharinath@novell.com>
12806 * expression.cs (This.VerifyFixed): In a value type T, the type of
12807 'this' is T&, iow, 'this' is either an out or ref parameter. In a
12808 value type R, 'this' is treated as a value parameter.
12810 2005-09-22 Miguel de Icaza <miguel@novell.com>
12812 * statement.cs (Lock): Use the TemporaryVariable class instead of
12813 manually using local variables as those do not work when variables
12816 * ecore.cs: Moved the TemporaryVariable class from being a nested
12817 class inside Foreach to be a public class that can be employed in
12820 2005-09-19 Marek Safar <marek.safar@seznam.cz>
12822 * cs-parser.jay: interface_accessors replaced by
12823 accessor_declarations.
12825 * ecore.cs, literal.cs, statement.cs: NullLiteral holds null
12828 * statement.cs (GotoCase.Resolve): Convert null constant to
12830 (SwitchLabel.ResolveAndReduce): Ditto.
12831 (SwitchLabel.NullStringCase): Custom null stamp.
12832 (Switch.SimpleSwitchEmit): Fix from NullLiteral to NullStringCase.
12834 typemanager.cs (CSharpSignature): Don't skip first argument
12837 2005-09-18 Miguel de Icaza <miguel@novell.com>
12839 * driver.cs: Set InEmacs based on the environment variable EMACS.
12841 * location.cs (InEmacs): in this mode, do not report column
12842 location as it confuses Emacs.
12844 2005-09-16 Marek Safar <marek.safar@seznam.cz>
12846 * cfold.cs, constant.cs, convert.cs, ecore.cs,
12847 expression.cs, iterators.cs, literal.cs: Store constants and
12850 * class.cs (MemberBase.ShortName): Pass location.
12852 * cs-parser.jay: Some location fixes.
12854 * ecore.cs (Expression.Location): Made virtual.
12856 2005-09-05 Miguel de Icaza <miguel@novell.com>
12858 * expression.cs (Cast.TryReduce): Only reduce to an EnumConstant
12859 if the underlying types are the same, otherwise we need to produce
12860 code that will do the proper cast.
12862 This was exposed by Marek's constant rewrite which produced
12863 invalid code for the call site:
12865 enum X : long { a }
12866 void Method (X v) {}
12870 This fixes test-49.cs
12872 2005-09-05 Atsushi Enomoto <atsushi@ximian.com>
12874 * attribute.cs : (Attribute.IsValidArgumentType): array of string/
12875 Type/Object should be allowed as well. Fixed bug #75968.
12877 2005-09-05 Atsushi Enomoto <atsushi@ximian.com>
12879 * expression.cs : (Binary.DoResolve): when one is enum constant and
12880 another is constant 0, then return enum one *as enum type*.
12883 2005-09-02 Raja R Harinath <rharinath@novell.com>
12885 * attribute.cs (GetMarshal): Work even if "DefineCustom" is
12889 * ecore.cs (SimpleNameResolve.DoSimpleNameResolve): Disable
12890 flow-branching for LocalVariableReferences in case we were invoked
12891 from a MemberAccess.
12892 * expression.cs (LocalVariableReference.VerifyAssigned): New.
12894 (LocalVariableReference.DoResolveBase): ... this.
12895 (MemberAccess.Resolve): Do the check that was disabled during
12898 2005-09-01 Atsushi Enomoto <atsushi@ximian.com>
12901 (PartialContainer.Create): check abstract/sealed/static strictly
12902 but abstract/sealed can exist only at one side. Fixed bug #75883.
12904 2005-09-01 Kornél Pál <kornelpal@hotmail.com>
12907 * attribute.cs (Attribute.GetMarshal): If ArraySubType is not
12908 specified, don't default to UnmanagedType.I4.
12910 2005-09-01 Atsushi Enomoto <atsushi@ximian.com>
12912 * expression.cs : conditional operator should check possibly
12913 incorrect assign expression. Fixed bug #75946.
12915 2005-08-31 Atsushi Enomoto <atsushi@ximian.com>
12917 * cs-tokenizer.cs, cs-parser.jay, driver.cs, support.cs :
12918 Reverting the change. gmcs is much complex than mcs on this matter.
12920 2005-08-31 Atsushi Enomoto <atsushi@ximian.com>
12922 * cs-tokenizer.cs : To read another token ahead of the actual
12923 consumption, use new SavedToken and cache token instead of moving
12924 back the stream with SeekableStreamReader (it seemed problematic).
12926 driver.cs : Thus use StreamReader directly.
12927 * support.cs : Thus removed SeekableStreamReader.
12929 2005-08-30 Raja R Harinath <rharinath@novell.com>
12932 * anonymous.cs (ScopeInfo.MakeFieldName): New helper.
12933 (ScopeInfo.EmitScopeType): Use it to construct field names from
12934 names of captured locals.
12937 * ecore.cs (BoxedCast.BoxedCast) [1-argument variant]: Remove.
12938 * convert.cs (ImplicitReferenceConversion, TryImplicitIntConversion):
12939 Pass 'target_type' to BoxedCast. Don't default to 'object'.
12940 (ExplicitConversion): Remove enum cases already handled by
12941 implicit conversion. Move implicit conversion check to the beginning.
12942 * delegate.cs (DelegateCreation.ResolveMethodGroupExpr): Update.
12943 * expression.cs (ArrayCreation.EmitDynamicInitializers):
12944 Don't treat System.Enum as a struct.
12946 2005-08-30 Jb Evain <jbevain@gmail.com>
12948 * attribute.cs: handles as expression in parameters.
12950 2005-08-30 Raja R Harinath <rharinath@novell.com>
12953 * class.cs (TypeContainer.VerifyClsName): Don't use a
12954 PartialContainer when verifying CLS compliance.
12955 (AbstractPropertyEventMethod): Set Parent here, ...
12956 (PropertyMethod): ... not here.
12958 2005-08-30 Atsushi Enomoto <atsushi@ximian.com>
12960 * attribute.cs : escaped attribute name should not be allowed to be
12961 resolved (e.g. @class as classAttribute). Fixed bug #75930.
12963 2005-08-29 Raja R Harinath <rharinath@novell.com>
12966 * convert.cs (ImplicitStandardConversionExists): Allow zero also
12967 when converting a long constant to unsigned long.
12968 * expression.cs (Invocation.OverloadResolve): Add sanity check to
12969 detect where IsApplicable and VerifyArgumentsCompat disagree.
12971 2005-08-29 Raja R Harinath <rharinath@novell.com>
12972 and Carlos Alberto Cortez <carlos@unixmexico.org>
12975 * class.cs (TypeContainer.CanElideInitializer): New helper.
12976 (TypeContainer.EmitFieldInitializers): Use it to determine if we
12977 can safely emitting the initializer of a field.
12979 2005-08-25 Atsushi Enomoto <atsushi@ximian.com>
12981 * statement.cs : (Continue.Resolve()) Unlike break, continue is not
12982 allowed inside a switch (without loop). Fixed bug #75433.
12984 2005-08-26 Kornél Pál <kornelpal@hotmail.com>
12986 * AssemblyInfo.cs: Using Consts.MonoVersion instead of MonoVersion.cs.
12987 * mcs.exe.sources: Using Consts.MonoVersion instead of MonoVersion.cs.
12989 2005-08-25 Atsushi Enomoto <atsushi@ximian.com>
12991 * driver.cs : kinda reverting the default encoding changes (not exact
12992 revert since I noticed that "codepage:reset" might not work fine).
12994 2005-08-25 Atsushi Enomoto <atsushi@ximian.com>
12996 * class.cs : (AbstractPropertyEventMethod) SetupName() now takes
12997 Location. Now getter and setter store location correctly.
12998 (errors/cs0111-12.cs now reports the expected location.)
13000 2005-08-25 Atsushi Enomoto <atsushi@ximian.com>
13002 * driver.cs : Use default encoding on the environment.
13003 Removed (now that) extra parameter for SeekableStreamReader.
13004 * support.cs : (SeekableStreamReader) third .ctor() argument for
13005 StreamReader is not required (always true). preamble size could
13006 be acquired in simpler and safe way.
13008 2005-08-24 Atsushi Enomoto <atsushi@ximian.com>
13010 * cs-parser.jay: report CS0642 at warning level 3
13011 and report CS0642 for an if else statement also
13012 fixes bug #74745. Patch by John Luke (and a bit
13014 Removed extra CS0642 warning check for "while",
13016 * statement.cs: In Block.Resolve(), CS0642 check
13017 is reimplemented to check a sequence of an empty
13018 statement and a block.
13020 Both fix bug #66777.
13022 2005-08-24 Marek Safar <marek.safar@seznam.cz>
13024 * attribute.cs (GetMethodObsoleteAttribute): Disabled obsolete properties
13025 detection until I fix it.
13027 * cs-tokenizer.cs: Changed error message.
13029 * cs-parser.jay: Fixed 2 error locations.
13031 * ecore.cs (Error_TypeDoesNotContainDefinition): Share error message.
13032 (PropertyExpr.Error_PropertyNotFound): First attempt to detect non C#
13035 * enum.cs (GetSignatureForError): Fixed.
13037 * expression.cs (Invocation.IsSpecialMethodInvocation): Improved special
13041 * typemanager.cs (RegisterProperty): Removed.
13043 * statement.cs (CheckInvariantMeaningInBlock): Changed error message.
13045 2005-08-24 Raja R Harinath <rharinath@novell.com>
13048 * expression.cs (ArrayAccess.EmitLoadOpcode): Emit ldelem.i for pointers.
13049 (ArrayAccess.GetStoreOpcode): Return stelem.i for pointers.
13051 2005-08-23 Atsushi Enomoto <atsushi@ximian.com>
13053 * expression.cs : tiny fix is required for not warning positive ulong.
13056 2005-08-23 Atsushi Enomoto <atsushi@ximian.com>
13058 * expression.cs : add CS0652 check for constant and integral
13059 expression. Fixed bug #53974.
13061 2005-08-23 Atsushi Enomoto <atsushi@ximian.com>
13063 * expression.cs : in DoNumericPromotions(), check if there is implicit
13064 conversion overload for string (to check CS0034). Fixed bug #52492.
13066 2005-08-23 Atsushi Enomoto <atsushi@ximian.com>
13068 * cs-tokenizer.cs : Check newline in char constant. Fixed bug #75245.
13070 2005-08-23 Atsushi Enomoto <atsushi@ximian.com>
13072 * ecore.cs : report location when it is *not* Null.
13074 2005-08-23 Atsushi Enomoto <atsushi@ximian.com>
13080 Added OmitStructFlowAnalysis to EmitContext to handle CS0165 check
13081 correctly. Fixed bug #75721.
13083 2005-08-23 Raja R Harinath <rharinath@novell.com>
13085 * support.cs (SeekableStreamReader.Position): Avoid an expensive
13086 loop that performs 'min (pos, char_count)'.
13089 * expression.cs (Unary.ResolveOperator): Don't discard implicit
13090 converted value in Operator.OnesComplement.
13092 2005-08-22 Ben Maurer <bmaurer@ximian.com>
13094 * anonymous.cs: If the anon method is pulled into a helper class,
13095 it needs to be `internal' not `private'. Fixes runtime behavior on
13098 2005-08-20 Martin Baulig <martin@ximian.com>
13100 * anonymous.cs (CaptureContext.CaptureThis): Create the topmost
13101 scope if we don't already have it.
13103 * expression.cs (Invocation.EmitCall): Use `ec.EmitThis ()' rather
13104 than `ig.Emit (OpCodes.Ldarg_0)' to make it work inside iterators;
13107 2005-08-17 Marek Safar <marek.safar@seznam.cz>
13110 * decl.cs (DeclSpace.VerifyClsCompliance): Skip when collision object
13111 is a partial class.
13113 2005-08-16 Marek Safar <marek.safar@seznam.cz>
13115 The big constants rewrite
13116 Fix #75746, #75685 and more
13117 As a side effect saved 1MB for MWF ;-)
13119 * attribute.cs (GetAttributeArgumentExpression): Use ToType, GetTypedValue.
13120 (GetMarshal, GetMethodImplOptions, GetLayoutKindValue): Values are not
13121 enum based for corlib compilation.
13123 * cfold.cs (BinaryFold): Convert operand for enum additions. Fixed enum
13126 * class.cs (FixedField.Define): Use ResolveAsConstant.
13128 * const.cs (IConstant): Interface constants and enums.
13129 (Const.ResolveValue): New method for constant resolvning.
13130 (ExternalConstant): Constants from imported assemblies.
13132 * constant.cs (Constant.GetTypedValue): Used to get constant with forced
13133 conversion; like enums.
13134 (Constant.ToType): Converts this constant to different type.
13135 (Constant.Increment): Adds 1.
13137 * convert.cs (ImplicitConversionRequired): Simplified.
13139 * cs-parser.jay: Create EnumMember directly.
13141 * decl.cs (MemberCore.CheckObsoleteness): Checks for ObsoleteAttribute presence.
13143 * doc.cs (GenerateEnumDocComment): Removed.
13145 * ecore.cs (Expression.ResolveAsConstant): New constant specific method.
13146 (ConvertIntLiteral): Removed.
13147 (FieldExpr.ResolveMemberAccess): Refactored to remove constant specific if(s).
13149 * enum.cs (EnumMember): Implement IConstant.
13150 (Enum.IsValidEnumConstant): Removed.
13151 (Enum.GetNextDefaultValue): Removed.
13152 (Enum.FindMembers): Updated.
13153 (Enum.GenerateDocComment): Iterate enum members.
13155 * expression.cs (Cast.TryReduce): Handle enums correctly.
13156 (New.Constantify): Made public.
13157 (MemberAccess.DoResolve): Removed contant specific if(s).
13159 * literal.cs (NullLiteral): Implement new abstract methods.
13161 * statement.cs (GotoCase.Resolve): Use new constant methods.
13162 (SwitchLabel.ResolveAndReduce): Use new constant methods.
13164 * typemanager.cs (LookupEnum): Removed.
13165 (IsEnumType): Fixed to work with corlib.
13166 (RegisterConstant): Removed.
13167 (LookupConstant): Removed.
13168 (GetConstant): Changed to work with IConstant.
13170 2005-08-04 Atsushi Enomoto <atsushi@ximian.com>
13172 * location.cs : Fixed overflown (>255) column number.
13174 2005-08-03 Raja R Harinath <rharinath@novell.com>
13176 First cut of the qualified-alias-member feature.
13177 * cs-tokenizer.cs (Tokenizer.is_punct): Recognize the double-colon
13179 * cs-parser.jay (DOUBLE_COLON): New token.
13180 (namespace_or_type_name): Add rule for recognizing
13181 qualified-alias-members.
13182 (primary_expression): Likewise.
13183 (element_access): Allow QualifiedAliasMember as a possible
13184 type-bearing expression.
13185 (local_variable_type, local_variable_pointer_type): Likewise.
13186 * namespace.cs (NamespaceEntry.LookupAlias): New. Looks up
13187 aliases in the current and enclosing namespace declarations.
13188 (NamespaceEntry.UsingAlias): Add CS0440 warning.
13189 * decl.cs (MemberName.is_double_colon): New.
13190 (MemberName.MemberName): Add new constructor for alias-member.
13191 (MemberName.GetTypeExpression): Generate QualifiedAliasMember too.
13192 * expression.cs (QualifiedAliasMember): New expression type.
13194 2005-08-02 Atsushi Enomoto <atsushi@ximian.com>
13196 * location.cs : it borked when no argument was specified.
13198 2005-08-02 Atsushi Enomoto <atsushi@ximian.com>
13200 * location.cs : tiny ToString() format fix.
13202 2005-08-02 Atsushi Enomoto <atsushi@ximian.com>
13204 * statement.cs : oops, it was missing.
13206 2005-08-02 Atsushi Enomoto <atsushi@ximian.com>
13208 A set of fixes for precise line/column location.
13211 "token" field now holds a file/line "delta", a line number offset
13212 from the segment, and a column number. See also:
13213 http://lists.ximian.com/pipermail/mono-devel-list/2004-
13214 December/009508.html
13215 Removed static IsNull. Use instance IsNull property instead.
13216 * cs-tokenizer.cs :
13217 For some tokens it stores Location. For Identifier it stores
13218 LocatedToken which is a pair of string name and location.
13219 Column numbers are adjusted only at getChar().
13221 Use Location.ToString() for reporting (it now contains column).
13223 Largely modified to use LocatedToken instead of
13224 string (IDENTIFIER), and to acquire Location from some tokens.
13225 * namespace.cs, decl.cs, ecore.cs, class.cs, delegate.cs,
13226 iterators.cs, const.cs, anonymous.cs, tree.cs, enum.cs,
13228 Now MemberName holds Location. DeclSpace.ctor() receives Location
13229 as a parameter. Removed extra parameters to all derived classes.
13230 Replaced Location.IsNull() with instance property.
13231 * assign.cs, expression.cs :
13232 Added .ctor() overload that omits Location.
13234 Added "nameEscaped" flag that indicates the identifier was escaped
13235 in the source file. This fixes bug #57047.
13237 2005-08-02 Marek Safar <marek.safar@seznam.cz>
13239 * attribute.cs (AttributeTester.GetImportedIgnoreCaseClsType):
13240 New method, looking for lo-case imported cls type.
13242 * decl.cs (DeclSpace.VerifyClsCompliance): Check CS3005 for types
13245 * driver.cs: Removed VerifyTopLevelNameClsCompliance usage.
13247 * enum (Enum.VerifyClsCompliance): Hardcode non-compliant types.
13249 * typemanager.cs (TypeManager.AllClsTopLevelTypes): Renamed from
13250 all_imported_types.
13251 (TypeManager.LoadAllImportedTypes): Lo-case imported types.
13253 Optimized to save 3.5 MB for SWF compilation.
13255 2005-08-01 Marek Safar <marek.safar@seznam.cz>
13257 * class.cs (AddToTypeContainer): Use inheritance insted of if(s).
13258 (PartialContainer.Create): Moved logic AddToContainer.
13259 (PartialContainer.MarkForDuplicationCheck): Shares name.
13261 * decl.cs (DeclSpace.AddToContainer): Check name collisions at one
13264 * namespace.cs (Namespace.AddDeclSpace): Lazy declspaces
13266 (Namespace.GetSignatureForError): New method.
13268 * tree.cs (Tree.RecordDecl): Moved to AddToContainer.
13269 (RootTypes.AddToTypeContainer): se inheritance insted of if(s).
13271 2005-08-01 Raja R Harinath <rharinath@novell.com>
13274 * ecore.cs (Expression.MemberLookupFailed): Use queried_type for
13275 member lookup rather than qualifier_type, since qualifier_type can
13278 2005-08-01 Marek Safar <marek.safar@seznam.cz>
13280 * enum.cs (Enum.VerifyClsName): Fixed to allow not CLSCompliant
13283 2005-07-31 Miguel de Icaza <miguel@novell.com>
13285 * statement.cs: Copy the local exception into the exception
13286 captured local. Fixes 75674
13288 2005-07-31 Raja R Harinath <harinath@gmail.com>
13291 * expression.cs (Invocation.OverloadResolve): Don't report error
13292 CS1501 if error CS1502 has been reported.
13293 (New.DoResolve): Delegate CS1501 reporting to
13294 Invocation.OverloadResolve.
13297 * statement.cs (Block.CheckInvariantMeaningInBlock): Verify
13298 invariant-meaning-in-block property in an enclosing block if
13301 2005-07-29 Marek Safar <marek.safar@seznam.cz>
13303 * statement.cs (SwitchLabel.ResolveAndReduce): Refactored.
13304 (SwitchLabel.Erorr_AlreadyOccurs): Share error message.
13305 (Switch.CheckSwitch): Just save 50kb for SWF.
13307 2005-07-27 Martin Baulig <martin@ximian.com>
13309 * anonymous.cs (CaptureContext.AddField): Added
13310 `AnonymousContainer am' argument; compute its toplevel scope if
13311 it's not already computed. Fixes #75649.
13313 2005-07-26 Raja R Harinath <rharinath@novell.com>
13316 * class.cs (Constructor.Emit): Reset block to null if the block
13319 2005-07-25 Marek Safar <marek.safar@seznam.cz>
13321 * class.cs (TypeContainer.VerifyMembers): Be compatible in warning 169.
13323 2005-07-25 Marek Safar <marek.safar@seznam.cz>
13325 * class.cs (MethodData.Define): Check whether accessor implementing
13326 interface is public.
13328 * driver.cs (Driver.parse): Try to be smart and check for `MZ' header.
13330 2005-07-22 Marek Safar <marek.safar@seznam.cz>
13333 * namespace.cs (LookupType): Moved same type check to...
13335 * typemanager.cs (LookupTypeReflection): Don't allow to import more types
13336 with the same name.
13338 2005-07-21 Raja R Harinath <rharinath@novell.com>
13340 * namespace.cs (NamespaceLookupType): Avoid a string allocation when we
13341 already found a typebuilder.
13342 * class.cs (MethodCore.IsDuplicateImplementation): Compare
13343 MemberNames, not strings.
13345 * const.cs (Error_ExpressionMustBeConst):
13346 Rename from Error_EpressionMustBeConst.
13347 * const.cs, class.cs, statement.cd: Update.
13349 2005-07-21 Marek Safar <marek.safar@seznam.cz>
13353 * const.cs (Const.LookupConstantValue): Report missing contant expression
13355 (Error_EpressionMustBeConstant): Only one error method.
13357 * class.cs, statement.c: Updated.
13359 2005-07-20 Raja R Harinath <rharinath@novell.com>
13361 * statement.cs (Block.Flags): Add back HasVarargs.
13362 (Block.flags): Make protected.
13363 (ToplevelBlock.HasVarargs): Convert to a property that updates flags.
13365 * typemanager.cs (types, typecontainers, user_types): Remove.
13366 (UserTypes, TypeContainers): Likewise.
13367 (HandleDuplicate, AddDelegateType, AddEnumType): Likewise.
13368 (CleanUp, Reset): Update.
13369 (AddUserType): Combine variants. Now, only updates builder_to_declspace.
13370 (GetNestedType): Use Type.GetNestedType.
13371 (CoreLookupType): Take two arguments, the namespace and the
13372 basename of the type. Update to use the Namespace.Lookup
13374 (InitEnumUnderlyingTypes, InitCoreTypes): Update.
13375 (RealMemberLookup): Use IsNestedChildOf instead of playing with
13376 string concatenation and substring matches.
13377 * class.cs, enum.cs, delegate.cs: Update to changes.
13379 2005-07-20 Marek Safar <marek.safar@seznam.cz>
13381 * constant.cs (Constant.Error_ConstantValueCannotBeConverted): Moved from
13382 Expression and made virtual.
13384 * convert.cs (ImplicitReferenceConversionExists): Skip for value types.
13385 (ImplicitStandardConversionExists): Fixed `byte' typo ?
13387 * ecore.cs (Expression.Error_ConstantValueCannotBeConverted): Moved.
13389 * literal.cs (NullLiteral.Error_ConstantValueCannotBeConverted): Customize
13392 * convert.cs, ecore.cs, enum.cs: Reflect Error_ConstantValueCannotBeConverted
13395 2005-07-18 Marek Safar <marek.safar@seznam.cz>
13398 * codegen.cs (AssemblyClass.ApplyAttributeBuilder): Check whether
13399 AssemblyCultureAttribute is not used on executable.
13402 * typemanager.cs: Add System.Reflection.AssemblyCultureAttribute.
13404 2005-07-16 Raja R Harinath <rharinath@novell.com>
13407 * expression.cs (Binary.Warning_UnintendeReferenceComparison):
13408 New. Reports CS0252/CS0253.
13409 Mostly taken from preliminary patch by Duncak Mak.
13410 (Binary.DoResolveOperator): Store results of operator lookup.
13411 Use them to detect if we need to warn about unintended reference
13414 2005-07-15 Raja R Harinath <rharinath@novell.com>
13417 * namespace.cs (Namespace.Lookup): Add back location parameter.
13418 (Namespace.LookupType): Add CS0436 report. Add location parameter.
13419 * delegate.cs, ecore.cs, expression.cs: Update to changes.
13421 * codegen.cs (EmitContext.DeclSpace): Make readonly.
13422 * namespace.cs (Namespace.Lookup): Carve out type lookup into ...
13423 (Namespace.LookupType): ... this.
13424 (NamespaceEntry.GetUsingTable): Allocate only one zero-sized array
13426 * typemanager.cs (LookupTypeReflection): Remove buggy code that
13427 purported to handle pointers.
13428 (char_ptr_type, void_ptr_type): Use GetPointerType rather than
13431 2005-07-15 Marek Safar <marek.safar@seznam.cz>
13433 * expression.cs (MemberAccess.ResolveNamespaceOrType): Don't report nested
13436 2005-07-15 Raja R Harinath <rharinath@novell.com>
13438 * namespace.cs (Namespace.Lookup): Drop location parameter.
13439 (NamespaceEntry.LookupAlias): Remove. Merge into ...
13440 (NamespaceEntry.Lookup): ... this.
13441 (NamespaceEntry.Error_AmbiguousTypeReference):
13442 Move here from DeclSpace.
13443 (NamespaceEntry.LookupNamespaceOrType): Move support for dotted
13445 * ecore.cs (TypeLookupExpression.DoResolveAsTypeStep): ... here.
13446 * decl.cs (DeclSpace.ErrorAmbiguousTypeReference):
13447 Move to NamespaceEntry.
13448 * delegate.cs, expression.cs: Update to changes.
13450 2005-07-14 Marek Safar <marek.safar@seznam.cz>
13452 * attribute.cs (Attribute.ResolveAttributeType): Renamed from
13453 CheckAttributeType and refactored.
13454 (Attribute.ResolvePossibleAttributeType): Changed to reuse
13455 ResolveAsTypeTerminal error handling.
13456 (ResolveAsTypeTerminal): Introduced because of global attributes extra
13458 (GetSignatureForError): Print errors in same way.
13461 * codegen.cs: Reflect attribute GetSignatureForError change.
13464 * expression.cs: Add silent parameter to ResolveAsTypeStep.
13466 * namespace.cs (UsingEntry): Refactored to make fields private.
13469 statement.cs: Error_UnexpectedKind has extra parameter.
13471 2005-07-14 Raja R Harinath <rharinath@novell.com>
13473 * ecore.cs (IAlias): Remove.
13474 * decl.cs (DeclSpace): Don't derive from IAlias. Remove members
13475 that implement the interface.
13476 * namespace.cs (Namespace): Likewise.
13477 (Namespace.declspaces): Renamed from 'defined_names'.
13478 (Namespace.AddDeclSpace): Renamed from 'DefineName'. Take a
13479 DeclSpace instead of an IAlias.
13480 * tree.cs (Tree.AddDecl): Update.
13482 2005-07-12 Raja R Harinath <rharinath@novell.com>
13484 * statement.cs (Block.Flags); Remove HasVarargs.
13485 (Block.HasVarargs): Move to ToplevelBlock.
13486 (Block.ThisVariable, Block.AddThisVariable): Likewise.
13487 (Block.Variables): Make protected. Initialize variable hashtable
13489 (Block.AddVariable): Update.
13490 (Block.Resolve): Update to changes.
13491 (ToplevelBlock.HasVarargs): New boolean.
13492 (ToplevelBlock.ThisVariable): Move here from Block.
13493 (ToplevelBlock.AddThisVariable): Likewise.
13494 (ToplevelBlock.IsThisAssigned): New. Forwards call to this_variable.
13495 * expression.cs (This.ResolveBase): Update to changes.
13496 (ArglistAccess.DoResolve): Likewise.
13498 2005-07-11 Marek Safar <marek.safar@seznam.cz>
13501 * ecore.cs, class.cs: Use SetAssigned instead of direct access.
13503 * class.cs (TypeContainer.VerifyMembers): Distinguish between
13504 not used and not used & assigned.
13505 (FieldBase.ASSIGNED): Moved to MemberCore.Flags.
13507 2005-07-11 Marek Safar <marek.safar@seznam.cz>
13510 * expression.cs (Is.DoResolve): null is never provided type.
13512 2005-07-08 Marek Safar <marek.safar@seznam.cz>
13515 * cs-parser.jay: Less strict event error rule to catch more errors.
13517 2005-07-08 Martin Baulig <martin@ximian.com>
13519 Fix test-iter-10.cs - distinguish whether we `yield' in a property
13520 gettter (allowed) or setter (not allowed).
13522 * class.cs (Accessor): Implement IIteratorContainer.
13523 (Accessor.Yields): New public field.
13524 (PropertyBase.PropertyMethod.Define): Handle iterators on a
13525 per-accessor basis.
13528 (get_accessor_declaration, set_accessor_declaration): Set the
13529 `yields' flag on the accessor, not the property.
13530 (property_declaration): Do the iterators check on a per-accessor
13531 basis and not for the whole property.
13533 2005-07-08 Martin Baulig <martin@ximian.com>
13535 * anonymous.cs (CaptureContext.EmitParameterInstance): Correctly
13536 handle parameters in nested scopes; fixes #74808; see gtest-188.cs.
13538 2005-07-07 Marek Safar <marek.safar@seznam.cz>
13541 * attribute.cs (orig_sec_assembly): Holds original version of assembly.
13542 (ExtractSecurityPermissionSet): Cope with self referencing security
13543 attributes properly.
13545 * driver.cs (SetOutputFile): Made public property OutputFile.
13547 2005-07-07 Raja R Harinath <rharinath@novell.com>
13550 * class.cs (TypeContainer.first_nonstatic_field): Rename from
13551 has_nonstatic_fields. Make into a FieldBase pointer.
13552 (TypeContainer.AddField): Add CS0282 check.
13553 (TypeContainer.EmitType): Update.
13555 2005-07-06 Miguel de Icaza <miguel@novell.com>
13557 * cs-tokenizer.cs (consume_identifier): Do not create strings to
13558 compare if they start with __.
13560 2005-07-06 Raja R Harinath <rharinath@novell.com>
13562 * statement.cs (Switch.SwitchGoverningType): Only look at
13563 UserCasts that don't need implicit standard conversions to one of
13564 the allowed switch types (Fixes test-322.cs).
13565 (LocalInfo.Resolve): Re-enable sanity-test.
13567 2005-07-06 Marek Safar <marek.safar@seznam.cz>
13569 * cs-tokenizer.cs (consume_identifier): Detect double undescores
13571 * ecore.cs (FieldExpr.AddressOf): Changed volatile error to warning.
13573 * expression.cs (Invocation.DoResolve): Report error CS0245 here.
13575 2005-07-06 Raja R Harinath <rharinath@novell.com>
13578 * ecore.cs (SimpleName.GetSignatureForError): Add.
13579 * expression.cs (MemberAccess.DoResolve): Don't clobber 'expr' field.
13580 (MemberAccess.GetSignatureForError): Add.
13582 2005-07-05 Marek Safar <marek.safar@seznam.cz>
13584 The big error and warning messages review.
13614 * typemanager.cs: Updated.
13616 * class.cs: (MethodCore.SetYields): Moved here to share.
13617 (PropertyMethod.Define): Moved iterator setup here.
13619 * iterators.cs: Add orig_method to have full access to parent
13622 2005-07-05 Raja R Harinath <rharinath@novell.com>
13624 Make 'fixed variable' handling standards compliant. Fix #70807, #72729.
13625 * ecore.cs (IVariable.VerifyFixed): Remove 'is_expression' parameter.
13626 (FieldExpr.VerifyFixed): Ensure that the field is part of a fixed
13627 variable of struct type.
13628 * expression.cs (Unary.ResolveOperator): Update to change.
13629 (Indirection.VerifyFixed): Likewise.
13630 (LocalVariableReference.VerifyFixed): A local variable is always fixed.
13631 (ParameterReference.VerifyFixed): Value parameters are fixed.
13632 (This.VerifyFixed): Treat 'this' as a value parameter.
13633 * statement.cs (LocalInfo.IsFixed): Remove.
13635 2005-07-01 Martin Baulig <martin@ximian.com>
13637 * iterators.cs (Iterator.CapturedThisReference.Emit): Use
13638 `ec.EmitThis ()' to get the correct scope.
13640 2005-07-01 Martin Baulig <martin@ximian.com>
13642 * ecore.cs (FieldExpr.DoResolve): Don't capture the field if it's
13643 instance is a ParameterReference; fixes #75299.
13645 2005-07-01 Martin Baulig <martin@ximian.com>
13647 Reverted Marek's latest patch (r46725):
13648 - it contains structural changes which are neither mentioned in
13649 the ChangeLog nor explained anywhere; for example the additional
13650 argument of EmitContext's and Iterator's .ctor's and the
13651 TypeContainer.DefineMembers() change.
13652 - structural changes like this should go in in seperate patches
13653 and not be hidden in a huge patch which just seems to affect
13654 warnings and errors.
13655 a big and hard to understand patch.
13656 - it breaks iterators and causes regressions, for instance in
13659 2005-06-30 Raja R Harinath <rharinath@novell.com>
13662 * expression.cs (Indexers.map): Remove.
13663 (Indexers.Append): Filter out inaccessible setters and getters.
13664 (IndexerAccess.DoResolve, IndexerAccess.DoResolveLValue): Update.
13667 * ecore.cs (MemberExpr.EmitInstance): New. Add CS0120 check.
13668 Refactored from ...
13669 (FieldExpr.EmitInstance, PropertyExpr.EmitInstance): ... these.
13670 (FieldExpr.Emit, PropertyExpr.Emit): Update.
13671 (FieldExpr.EmitAssign, PropertyExpr.EmitAssign): Update.
13672 * expression.cs (Invocation.EmitCall): Add CS0120 check.
13674 2005-06-30 Marek Safar <marek.safar@seznam.cz>
13677 * class.cs (FieldBase.GetInitializerExpression): One more field
13680 2005-06-28 Miguel de Icaza <miguel@novell.com>
13682 * pending.cs: Do not define a proxy if the base method is virtual,
13683 it will be picked up by the runtime (bug 75270).
13685 2005-06-08 Martin Baulig <martin@ximian.com>
13687 The big Iterators rewrite :-)
13689 * iterators.cs: Rewrite this to use the anonymous methods framework.
13691 * rootcontext.cs (RootContext.DefineTypes): Define Delegates
13692 before the TypeContainers; see 2test-21.cs.
13695 (TypeContainer.DefineType): Don't create a new EmitContext if we
13696 already have one (this only happens if we're an Iterator).
13697 (TypeContainer.Define): Also call Define() on all our iterators.
13698 (Method.CreateEmitContext): Added support for iterators.
13701 (AnonymousContainer): New abstract base class for `AnonymousMethod'.
13702 (AnonymousContainer.CreateMethodHost): Moved here from
13703 AnonymousMethod and made abstract.
13704 (AnonymousContainer.CreateScopeType): New abstract method.
13705 (AnonymousContainer.IsIterator): New public property.
13706 (ScopeInfo.EmitScopeType): Call CreateScopeType() on our Host to
13707 get the ScopeTypeBuilder rather than manually defining it here.
13708 (ScopeInfo.EmitScopeInstance): New public method; correctly handle
13711 * driver.cs (Driver.MainDriver): Call TypeManager.InitCodeHelpers()
13712 before RootContext.DefineTypes().
13714 * codegen.cs (EmitContext.RemapToProxy): Removed.
13715 (EmitContext.CurrentAnonymousMethod): Changed type from
13716 AnonymousMethod -> AnonymousContainer.
13717 (EmitContext.ResolveTopBlock): Protect from being called twice.
13718 (EmitContext.MapVariable, RemapParameter(LValue)): Removed.
13719 (EmitContext.EmitThis): Removed the iterators hacks; use the
13720 anonymous methods framework for that.
13723 (ToplevelBlock.Container): Make this a property, not a field.
13724 (ToplevelBlock.ReParent): New public method; move the
13725 ToplevelBlock into a new container.
13726 (Foreach.TemporaryVariable): Simplify.
13728 2005-06-05 Martin Baulig <martin@ximian.com>
13730 * statement.cs (LocalInfo.CompilerGenerated): New flag.
13731 (Block.AddTemporaryVariable): New public method; creates a new
13732 `LocalInfo' for a temporary variable.
13733 (Block.EmitMeta): Create the LocalBuilders for all the temporary
13735 (Foreach.TemporaryVariable): Use Block.AddTemporaryVariable() for
13736 non-iterator variables.
13738 2005-06-05 Martin Baulig <martin@ximian.com>
13740 * statement.cs (Foreach.TemporaryVariable): Create the
13741 LocalBuilder in the Emit phase and not in Resolve since in some
13742 situations, we don't have an ILGenerator during Resolve; see
13743 2test-19.cs for an example.
13745 2005-06-04 Martin Baulig <martin@ximian.com>
13747 **** Merged r45395 from GCS ****
13749 The big Foreach rewrite - Part II.
13751 * typemanager.cs (TypeManager.object_getcurrent_void): Replaced
13752 with `PropertyInfo ienumerator_getcurrent'.
13754 * codegen.cs (VariableStorage): Removed.
13757 (Foreach): Derive from Statement, not ExceptionStatement.
13758 (Foreach.CollectionForeach): New nested class. Moved all the code
13759 dealing with collection foreach here.
13760 (Foreach.ForeachHelperMethods): Removed.
13761 (Foreach.TemporaryVariable): Implement IMemoryLocation.
13763 2005-05-23 Martin Baulig <martin@ximian.com>
13765 * statement.cs (Try.DoResolve): Don't create a `finally' if we
13766 don't need to. Fix #75014.
13768 2005-05-20 Martin Baulig <martin@ximian.com>
13770 Merged r44808 from GMCS.
13772 * class.cs (TypeContainer.CircularDepException): Removed.
13773 (TypeContainer.DefineType): Removed the `InTransit' stuff.
13774 (TypeContainer.CheckRecursiveDefinition): Check for circular class
13775 (CS0146) and interface (CS0529) dependencies here.
13777 2005-06-21 Raja R Harinath <rharinath@novell.com>
13779 * expression.cs (Invocation.EmitCall): Fix initialization
13780 'this_call' to reflect current behaviour. Fix indentation.
13782 * convert.cs (FindMostEncompassedType): Add two trivial special
13783 cases (number_of_types == 0 || number_of_types == 1).
13784 (FindMostEncompasingType): Likewise.
13786 2005-06-17 Raja R Harinath <rharinath@novell.com>
13788 Some cleanups preparing for the fix of #75283.
13789 * ecore.cs (PropertyExpr.InstanceResolve): Tighten conditions for
13791 (EventExpr.InstanceResolve): Likewise.
13792 (EventExpr.DoResolve): Remove redundant checks.
13794 2005-06-10 Duncan Mak <duncan@novell.com>
13796 * cs-tokenizer.cs (process_directives): New flag for controlling
13797 the processing of preprocessor directives.
13798 (x_token): After seeing a '#', return Token.NONE instead of going
13799 to handle_preprocessing_directive() when not processing
13800 directives. This avoids unnecessary processing during the token peek in
13805 * cs-tokenizer.cs (handle_preprocessing_directive, xtoken): Use
13806 the existing error reporting methods instead of Report.Error.
13808 * convert.cs (priv_fmt_expr): Remove. It's not needed anymore
13809 after Raja's rewrite.
13811 2005-06-08 Miguel de Icaza <miguel@novell.com>
13813 * class.cs: Small fix.
13815 2005-06-08 Raja R Harinath <rharinath@novell.com>
13818 * class.cs (GetPartialBases): Fix return value check of
13819 part.GetClassBases.
13821 2005-06-07 Raja R Harinath <rharinath@novell.com>
13823 Ensure that partial classes are registered in their enclosing
13824 namespace. Initial part of fix of #75160.
13825 * tree.cs (Tree.RecordDecl): Add new namespace argument.
13826 Register declspace with namespace here, not in
13827 DeclSpace.RecordDecl.
13828 * cs-parser.jay: Pass namespace to RecordDecl.
13829 * class.cs (PartialContainer.Create): Likewise.
13830 (ClassPart.DefineType): New sanity-check. Throws an exception if
13832 * decl.cs (Declspace.RecordDecl): Remove.
13833 * namespace.cs (NamespaceEntry.DefineName): Remove.
13835 2005-06-06 Marek Safar <marek.safar@seznam.cz>
13837 * rootcontext.cs: Reset TargetExt as well.
13839 2005-06-03 Raja R Harinath <rharinath@novell.com>
13841 * ecore.cs (Expression.Resolve): Emit CS0654 error when
13842 -langversion:ISO-1.
13844 2005-06-02 Raja R Harinath <rharinath@novell.com>
13846 Fix #75080, cs0119.cs.
13847 * ecore.cs (Expression.ExprClassToResolveFlags): New. Broken out
13849 (Expression.Resolve): ... this. Use it. Remove bogus code
13850 allowing ExprClass.Type and ExprClass.Namespace for
13851 ResolveFlags.VariableOrValue.
13852 (Expression.Resolve) [1-argument variant]: Change default resolve
13853 flags based on language version.
13854 (Expression.Error_UnexpectedKind): Use a simple string array
13855 rather than an ArrayList.
13856 * expression.cs (TypeOf.DoResolve): Set eclass to ExprClass.Value,
13857 not ExprClass.Type.
13858 (TypeOfVoid.DoResolve): Likewise.
13859 (MemberAccess.DoResolve) [3-argument variant]: Make private. Drop
13860 flags argument -- it always has the same value.
13862 2005-05-31 Raja R Harinath <rharinath@novell.com>
13865 * ecore.cs (Expression.ResolveLValue): Add a Location parameter.
13866 Use it in the error message.
13867 * assign.cs, expression.cs, statement.cs: Update.
13869 2005-05-30 Raja R Harinath <rharinath@novell.com>
13872 * ecore.cs (Expression.MemberLookupFailed): Add CS0122 check in
13873 the "almostMatchedMember" case too.
13874 * typemanager.cs (Closure.CheckValidFamilyAccess): Add anything
13875 that failed the accessibility checks to 'almost_match'.
13877 2005-05-27 Vladimir Vukicevic <vladimir@pobox.com>
13879 * attribute.cs: Use internal MethodBuilder methods to set
13880 ExactSpelling and SetLastError on PInvoke methods, instead
13881 of passing them via charset. Fixes #75060.
13883 2005-05-27 Raja R Harinath <rharinath@novell.com>
13885 * parameter.cs (Parameter): Remove TODO comment.
13886 (Parameter.DefineParameter): Remove Location parameter.
13887 (Parameters.LabelParameters): Likewise.
13888 * class.cs (Constructor.Emit): Update to change.
13889 (MethodData.Emit): Likewise.
13890 * anonymous.cs (AnonymousMethod.EmitMethod): Likewise.
13891 * delegate.cs (Delegate.Define, Delegate.Emit): Likewise.
13893 2005-05-27 Atsushi Enomoto <atsushi@ximian.com>
13896 Removed Parameters.Location and added Parameter.Location instead.
13897 Removed Location parameter from Emit() and GetSignature().
13904 Modified all related calls.
13906 2005-05-26 Raja R Harinath <rharinath@novell.com>
13908 Improve user-defined conversion handling.
13909 * convert.cs (GetConversionOperators): Rewrite. Return only the
13910 applicable operators.
13911 (AddConversionOperators): New. Helper for GetConversionOperators.
13912 (FindMostEncompassedType, FindMostEncompassingType): Verify that
13913 there is only one most encompassed/encompassing type.
13914 (FindMostSpecificSource, FindMostSpecificTarget): Remove
13915 "applicable operator" handling.
13916 (UserConversion): Move cache here from GetConversionOperators.
13917 Directly cache the chosen operator, rather than the whole
13919 (ExplicitNumericConversion): Fix buggy implementation of Decimal
13920 case. Allow conversion of decimal to sbyte and byte too.
13921 * expression.cs (EmptyExpression.Grab, EmptyExpression.Release):
13922 New static methods. Used to avoid allocating EmptyExpressions in
13925 2005-05-24 Duncan Mak <duncan@novell.com>
13927 * ecore.cs (CastFromDecimal): New class for casting a decimal to
13928 another class, used in Convert.ExplicitNumericConversion.
13929 (CastToDecimal): New class, similar to above, but casts to
13930 System.Decimal, used in Convert.ImplicitNumericConversion and also
13931 in explicit convesion from double/float to decimal.
13933 * convert.cs (ImplicitNumericConversion): Handle implicit
13934 conversions to System.Decimal.
13935 (ExplicitNumericConversion): handle explicit conversions to
13940 2005-05-20 Miguel de Icaza <miguel@novell.com>
13942 * typemanager.cs (EnumToUnderlying): Do not throw if we do not
13943 know the type at this stage, just break through. Fixes #75008
13945 2005-05-19 Martin Baulig <martin@ximian.com>
13948 (ImplicitDelegateCreation.Check): Added `bool check_only' argument
13949 to disable error reporting.
13951 * convert.cs (Convert.ImplicitStandardConversionExists): Use it
13952 here since we don't want to report an error; see the new test-336.cs.
13954 2005-05-19 Raja R Harinath <rharinath@novell.com>
13956 * statement.cs (ToplevelBlock.GetParameterReference)
13957 (ToplevelBlock.IsParameterReference,ToplevelBlock.IsLocalParameter):
13958 Move here from class Block.
13959 * ecore.cs (SimpleName.SimpleNameResolve): Update to changes.
13960 * expression.cs (ParameterReference.DoResolveBase): Likewise.
13962 2005-05-18 Martin Baulig <martin@ximian.com>
13967 (FlowBranching.Reachability): Add non-static public And() and Or()
13969 (FlowBranchingSwitch): New class; do the `break_origins' thing
13970 like in FlowBranchingLoop.
13971 (FlowBranching.UsageVector.MergeBreakOrigins): Also merge the
13972 reachability, not just locals and parameters.
13973 (FlowBranching.MergeChild): Remove some of the hacks for loop and
13974 switch; MergeBreakOrigins() now takes care of that.
13976 2005-05-18 Martin Baulig <martin@ximian.com>
13978 * flowanalysis.cs (FlowBranching.UsageVector.MergeChild): If we're
13979 a loop and may leave it, reset the barrier; fixes #74974.
13981 2005-05-17 Marek Safar <marek.safar@seznam.cz>
13983 * attribute.cs (Attribute.ResolveArguments): GuidAttribute check
13986 * cs-parser.jay: Catch more lexical errors.
13988 * report.cs: Add one more Error method.
13991 * typemanager.cs: Register System.Runtime.InteropServices.GuidAttribute
13993 2005-05-17 Martin Baulig <martin@ximian.com>
13995 * expression.cs (Argument.Resolve): Turn on flow analysis; fix
13998 2005-05-16 Raja R Harinath <rharinath@novell.com>
14000 Fix test-382.cs. Emit values of decimal constants.
14001 * class.cs (TypeContainer.RegisterFieldForInitialization): New.
14003 (TypeContainer.AddField): ... this.
14004 (TypeContainer.EmitFieldInitializers): Allow the list of fields
14005 with initializers to include 'Const's.
14006 (ClassPart.RegisterFieldForInitialization): Forward to
14008 * const.cs (Const.Const): Pass initializer to base class.
14009 (Const.Define): In case of decimal constants, register them for
14010 initialization in a static constructor.
14012 2005-05-14 Martin Baulig <martin@ximian.com>
14014 * statement.cs (Block.Resolve): Correctly handle unreachable code;
14015 do not call ResolveUnreachable() on unreachable statements in
14016 here, see the comment in the source code.
14018 2005-05-13 Raja R Harinath <rharinath@novell.com>
14021 * expression.cs (BinaryResolveOperator): If one of the operands of
14022 an equality comparison is 'null' and the other is a pointer type,
14023 convert the null to a NullPointer.
14024 * convert.cs (ImplicitReferenceConversion): If the expression is a
14025 NullLiteral and the target type is a pointer type, return a
14026 NullPointer instead.
14027 (ImplicitConversionStandard): Likewise.
14029 2005-05-13 Marek Safar <marek.safar@seznam.cz>
14031 * cs-parser.jay: Set readonly context based on special constructs.
14033 * expression.cs (LocalVariableReference.DoResolveBase): Improved
14034 readonly variable error handling.
14036 * rootcontext.cs (EmitCode): Don't verify members when error
14039 * statement.cs (LocalInfo): Add reaodnly context information.
14040 (SetReadOnlyContext, GetReadOnlyContext): New methods.
14042 2005-05-13 Raja R Harinath <rharinath@novell.com>
14044 * statement.cs (Block.Resolve): Revert change below. Modify fix
14045 for #74041 to initialize 'resolved' to false only for explicit
14046 blocks. Fixes #74873.
14048 2005-05-12 Raja R Harinath <harinath@gmail.com>
14051 * typemanager.cs (unmanaged_enclosing_types): New.
14052 (IsUnmanagedType): Avoid infloops by using
14053 'unmanaged_enclosing_types' to talk with recursive invocations.
14055 2005-05-13 Martin Baulig <martin@ximian.com>
14057 * statement.cs (Block.Resolve): Make the `bool unresolved' flag an
14058 instance variable, not a local. Fix #74873.
14059 (Block.ResolveUnreachable): Set it to true here.
14061 2005-05-11 Duncan Mak <duncan@novell.com>
14063 * cs-tokenizer.cs (get_cmd_arg): Check that 'c' is not -1 before
14064 continuing to process for 'arg'.
14065 (handle_preprocessing_directive): Check the argument of the #endif
14066 directive and report error CS1025 if there are any trailing
14069 According to the C# spec, having even whitespace after the #endif
14070 directive is illegal; however, because we call arg.TrimEnd ()
14071 beforehand, we have the same behavior as csc, allowing whitespace
14072 after the directive.
14076 2005-05-11 Marek Safar <marek.safar@seznam.cz>
14080 * class.cs (ConstructorInitializer.GetOverloadedConstructor): Removed.
14081 (Constructor.GetObsoleteAttribute): Implemented correctly.
14083 2005-05-10 Martin Baulig <martin@ximian.com>
14085 * support.cs (ReflectionParameters.ParameterModifier): Use
14086 `Parameter.Modifier.REF' if we both have `ParameterAttributes.Out'
14087 and `ParameterAttributes.In'. Fixes #74884.
14089 2005-05-10 Marek Safar <marek.safar@seznam.cz>
14091 * class.cs (Method.Define): Catch attempt for Finalizer declaration.
14093 * expression.cs (Argument.GetParameterModifier): Turned to property.
14094 (Invocation.Error_InvalidArguments): Add more descriptive errors.
14096 * parameter.cs (Parameter.GetModifierSignature): Translates modifier to
14099 2005-05-09 Raja R Harinath <rharinath@novell.com>
14102 * decl.cs (MemberCache.AddMethods): Register override methods,
14103 rather than non-override methods.
14104 * typemanager.cs (RegisterOverride): New.
14105 (IsOverride): Update.
14107 2005-05-09 Marek Safar <marek.safar@seznam.cz>
14111 * ecore.cs (SimpleName.SimpleNameResolve): Add in_transit to catch
14112 recursive declaration.
14114 * statement.cs (Block.ResolveMeta): Report any error in resolving.
14116 2005-05-06 Marek Safar <marek.safar@seznam.cz>
14118 * cfold (DoConstantNumericPromotions): Don't try to convert 0 enum.
14120 * expression.cs (Binary.DoResolve): (x && 0) is always 0.
14122 2005-05-05 Raja R Harinath <rharinath@novell.com>
14125 * decl.cs (DeclSpace.FamilyAccessible):
14126 Use TypeManager.IsNestedFamilyAccessible.
14128 Fix reopened #64812.
14129 * typemanager.cs (Closure.Filter): Introduce checks for 'protected
14132 2005-05-04 Raja R Harinath <rharinath@novell.com>
14133 Abin Thomas <projectmonokochi@rediffmail.com>
14134 Anoob V E <projectmonokochi@rediffmail.com>
14135 Harilal P R <projectmonokochi@rediffmail.com>
14138 * typemanager.cs (Closure.CheckValidFamilyAccess): Don't blindly
14139 allow access to all static members.
14141 2005-05-04 Martin Baulig <martin@ximian.com>
14143 * ecore.cs (FieldExpr.DoResolveLValue): Always call fb.SetAssigned().
14145 2005-05-04 Martin Baulig <martin@ximian.com>
14149 * statement.cs (Switch.SimpleSwitchEmit): Always emit the default
14150 section at the end; make things work if `default' is not the last
14153 2005-05-04 Martin Baulig <martin@ximian.com>
14157 * statement.cs (Switch): Replaced the `got_default' field with a
14158 `default_section' one.
14159 (Switch.CheckSwitch): Set `default_section' here.
14160 (Switch.Resolve): If we're a constant switch and the constant is
14161 not found, use the default section.
14163 2005-05-03 Martin Baulig <martin@ximian.com>
14165 * expression.cs (ArrayAccess.EmitGetLength): New public method.
14167 * statement.cs (Foreach.ArrayForeach): New nested class.
14168 (Foreach.TemporaryVariable): New nested class.
14169 (Foreach.EmitArrayForeach): Removed; this is now in the new
14170 ArrayForeach class.
14172 2005-05-03 Raja R Harinath <rharinath@novell.com>
14174 * pending.cs (BaseImplements): Move the #74773 fix here. This is
14176 (VerifyPendingMethods): Revert change below.
14178 * typemanager.cs (IsOverride, RegisterNonOverride): New.
14179 * decl.cs (MemberCache.AddMethod): Register "non-override" methods
14180 that used to trigger warning -28. Remove warning -28.
14181 * expression.cs (Invocation.OverloadResolve): Use
14182 TypeManager.IsOverride to distinguish override methods.
14185 * pending.cs (VerifyPendingMethods): If a base type implements the
14186 requested interface, don't bother checking individual methods of
14187 the base type. As a side-effect, this prevents the creation of
14188 unnecessary proxies.
14190 2005-05-02 Martin Baulig <martin@ximian.com>
14194 * flowanalysis.cs (FlowBranching.UsageVector.MergeJumpOrigins):
14195 Also `And' the locals if the old vector is null.
14196 (FlowBranching.UsageVector.BitVector.And): Allow `vector' being
14197 null; in this case we basically reset all the variables.
14199 2005-05-02 Martin Baulig <martin@ximian.com>
14203 * flowanalysis.cs (FlowBranching.UsageVector.MergeBreakOrigins):
14204 Added `FlowBranching branching' argument; always `and' the
14205 variables instead of `or'ing them unless we're an infinite loop.
14207 * statement.cs (While.Resolve): Create a new sibling unless we're
14210 2005-05-02 Martin Baulig <martin@ximian.com>
14214 * class.cs (ConstructorInitializer.Resolve): Added `Block block'
14215 arguments; use it instead of creating a new TopLevelBlock.
14216 (Constructor.Emit): Call `block.ResolveMeta ()' before resolving
14217 our ConstructorInitializer.
14220 (TopLevelBlock.TopLevelBranching): New public property.
14221 (TopLevelBlock.ResolveMeta): New public method; call ResolveMeta()
14222 and create our `TopLevelBranching'.
14224 * codegen.cs (EmitContext.ResolveTopBlock): If we're not an
14225 anonymous method host, use `block.TopLevelBranching' rather than
14226 creating a new branching.
14228 2005-04-20 Miguel de Icaza <miguel@novell.com>
14230 * anonymous.cs (ScopeInfo.AddChild): when adding a new child to
14231 a ScopeInfo, if any of the current children is a child of the new
14232 entry, move those children there.
14234 2005-04-30 Martin Baulig <martin@ximian.com>
14236 * statement.cs (Switch.SimpleSwitchEmit): Reset `default_at_end'
14237 at the beginning of a SwitchSection. Fix #73335.
14239 2005-04-27 Marek Safar <marek.safar@seznam.cz>
14242 * class.cs (EmitFieldInitializers): Use FieldExpr in initializer.
14244 * ecore.cs (FieldExpr): Add a new ctor with in_initializer.
14245 (FieldExpr.DoResolve): Obsolete members are ignored for field
14248 2005-04-26 Marek Safar <marek.safar@seznam.cz>
14250 * attribute.cs (AreOverloadedMethodParamsClsCompliant): Add array
14251 of arrays detection.
14253 * class.cs (Interface.VerifyClsCompliance): Add base interfaces
14255 (Field.VerifyClsCompliance): Volatile fields are not compliant.
14257 * decl.cs (MemberCache.VerifyClsParameterConflict): Add array of
14260 2005-04-25 Ben Maurer <bmaurer@ximian.com>
14262 * cs-parser.jay: Use the prefered version of -unsafe in error
14265 2005-04-22 Marek Safar <marek.safar@seznam.cz>
14267 * driver.cs (CompilerCallableEntryPoint.Invoke): Reset under any
14270 2005-04-20 John Luke <john.luke@gmail.com>
14272 * driver.cs: fix typo in error message, --outout to --output
14274 2005-04-20 Marek Safar <marek.safar@seznam.cz>
14276 * codegen.cs (InRefOutArgumentResolving): New field.
14278 * ecore.cs (FieldExpr.DoResolve): Check for assigning to readonly
14279 fields outside contructor.
14281 * expression.cs (Argument.Resolve): Set InRefOutArgumentResolving.
14283 2005-04-19 Miguel de Icaza <miguel@novell.com>
14285 * anonymous.cs (CaptureContext.EmitParameterInstance): The
14286 parameter code was not completed ever, so it was not as up-to-date
14287 as local variables. Must finish it.
14289 The bug fix was to compare the Toplevel of the block, not the
14290 current block. Thanks for Ben for pointing this out.
14292 2005-04-19 Raja R Harinath <rharinath@novell.com>
14294 * decl.cs (AddMethods): Use the declaring type of the problem
14295 method to determine if we want to squash a warning.
14297 2005-04-19 Marek Safar <marek.safar@seznam.cz>
14299 * attribute.cs: Removed debug output.
14301 * decl.cs (MemberCache.AddMethods): Fixed Finalize ignoring.
14303 * driver.cs (Driver.parse): Synchronize parser ErrorOutput with
14306 2005-04-18 Raja R Harinath <rharinath@novell.com>
14309 * expression.cs (Binary.EqualsNullIsReferenceEquals): New.
14310 (Binary.DoResolveOperator): Use it to avoid blindly optimizing out
14311 all null comparisons against reference types.
14313 2005-04-18 Marek Safar <marek.safar@seznam.cz>
14316 * class.cs (TypeContainer.CircularDepException) New nested
14318 (GetPartialBases, GetNormalBases, GetClassBases): Removed error.
14319 (TypeContainer.DefineType): Removed error, reset InTransit before
14321 (Class.DefineType): Throw exception when is in Transit.
14322 Catch exception and report error.
14323 (Struct.DefineType): Throw exception when is in Transit.
14324 Catch exception and report error.
14325 (Interface.DefineType): Throw exception when is in Transit.
14326 Catch exception and report error.
14328 * codegen.cs: Add InCatch,InFinally to EmitContext to easily
14329 handle nested exception handlers.
14331 * flowanalysis.cs (InTryWithCatch): New method, search for try with
14334 * iterators.cs (Yield.CheckContext): Add CS1626 report. Updated
14335 InFinally and InCatch storage.
14337 * statement.cs (Throw.Resolve): Use InCatch, InFinally from ec.
14338 (Catch.Resolve): Set and Restore ec.InCatch.
14339 (Try.Resolve): Set and Restore ec.InFinally.
14340 (Try.HasCatch): True when try has catch.
14342 2005-04-17 Atsushi Enomoto <atsushi@ximian.com>
14344 * doc.cs : In some cases FilterName returns MonoEvent and MonoField
14345 for the same event member, so exclude such cases from warning 419.
14348 2005-04-16 Miguel de Icaza <miguel@novell.com>
14350 * expression.cs (Binary.ResolveOperator): Apply patch from John
14351 Luke to fix bug 59864: operators &, | and ^ on enumerations
14352 require that the same enum type on both sides.
14354 * driver.cs: Add warnings to old flag usage, this is to assist
14355 people who produce Makefiles and hope that the Makefiles will be
14358 * class.cs (TypeContainer.EmitType): Moved the definition of the
14359 special $PRIVATE$ field from the resolve phase to the Emit phase.
14360 During resolve we do not know if we are a struct with
14361 HasExplicitLayout, we know this only after the attributes for the
14364 Set the FieldOffset to zero on the dummy field that we create for
14365 the class. Fixes 74590.
14367 2005-04-16 Raja R Harinath <rharinath@novell.com>
14370 * ecore.cs (PropertyExpr.resolved): New.
14371 (DoResolve): Use it to handle a case of double resolution here.
14372 Handle a case of identical-name-and-type-name.
14373 * expression.cs (ArrayCreation.CheckIndices): Avoid double
14374 resolution by storing the results of expression resolution back
14375 into the "probes" array.
14377 2005-04-15 Raja R Harinath <rharinath@novell.com>
14379 Fix cs0208-7.cs and cs0208-8.cs.
14380 * typemanager.cs (IsUnmanagedType): Arrays are not allowed
14381 (cf. ECMA standard, behaviour of CSC 1.1 and CSC 2.0). Improve
14382 error reporting to point out the reason a struct is not unmanaged.
14384 2005-04-13 Atsushi Enomoto <atsushi@ximian.com>
14386 * doc.cs : In FindDocumentedType(), avoid TypeExpr.ResolveType() and
14387 just use TypeExpr.Type. This fixes bug #74595 when merged to gmcs.
14389 2005-04-13 Raja R Harinath <rharinath@novell.com>
14392 * ecore.cs (PropertyExpr.InstanceResolve): Handle a case of
14393 IdenticalNameAndTypeName here.
14394 (EventExpr.InstanceResolve): Likewise.
14396 2005-04-13 Marek Safar <marek.safar@seznam.cz>
14398 C# 2.0 DefaultCharSetAttribute implementation
14400 * attribute.cs (Attribute.ResolveAsTypeStep): New protected method
14401 which allows us to set GlobalNamespace for every resolve.
14402 (Attribute.ResolveArguments): Cut from Resolve.
14403 (Attribute.GetCharSetValue): Returns CharSet named argument.
14404 (Attribute.DefinePInvokeMethod): Gets default charset from
14406 (GlobalAttribute.ResolveAsTypeStep): Override.
14407 (GlobalAttribute.ResolveArguments): Override.
14409 * class.cs (TypeAttr): Is protected.
14411 * codegen.cs (ModuleClass.DefaultCharSet): New member.
14412 (ModuleClass.DefaultCharSetType): New memeber.
14413 (ModuleClass.ResolveAttributes): Resolves DefaultCharSetAttribute.
14415 * decl.cs (Decl.TypeAttr): New protected virtual. Returns default
14416 charset from module.
14418 * delegate.cs (TypeAttr): Override.
14419 (Delegate.DefineType): Use this TypeAttr.
14421 * driver.cs (Driver.MainDriver): Call Module.ResolveAttributes
14422 at very early stage (before types are defined) to resolve model
14423 module attributes. It will probably not work with corlib but it
14426 * enum.cs (Enum.TypeAttr): New protected virtual. Returns default
14427 charset from module.
14429 * typemanager.cs (default_charset_type): New type.
14431 2005-04-13 Raja R Harinath <rharinath@novell.com>
14433 * decl.cs (MemberCache.AddMethods): Don't warn if
14434 System.Object.Finalize has buggy MethodAttributes.
14436 * typemanager.cs (IsUnmanagedType): Restore !IsValueType check
14439 2005-04-13 Atsushi Enomoto <atsushi@ximian.com>
14441 * doc.cs : detect ambiguous reference to overloaded members.
14442 Fixed bug #71603. MS 1.1 csc does not detect it.
14444 2005-04-13 Atsushi Enomoto <atsushi@ximian.com>
14446 * doc.cs : delegates must not be referenced with parameters.
14449 2005-04-12 Miguel de Icaza <miguel@novell.com>
14451 * typemanager.cs (IsUnmanagedType): Arrays are allowed.
14453 2005-04-10 Miguel de Icaza <miguel@novell.com>
14455 * driver.cs (MainDriver): Stop processing if the CLS stage found
14458 (CompilerCallableEntryPoint.InvokeCompiler): Always
14459 reset after execution; Take a TextWriter argument for the
14462 * report.cs: Use the error stream instead of hardcoding stderr.
14464 2005-04-09 Miguel de Icaza <miguel@novell.com>
14466 * class.cs: Reduce code paths to test, too small of an
14467 optimization to make it worth the extra testing. Always perform
14470 2005-04-08 Raja R Harinath <rharinath@novell.com>
14473 * class.cs (OperatorArrayList.CheckPairedOperators): Skip
14474 operators that had errors reported on them.
14476 2005-04-08 Marek Safar <marek.safar@seznam.cz>
14478 * attribute.cs (Attribute.IsValidArgumentType): Test valid named
14480 (Attribute.Resolve): Add named argument type checking.
14482 * class.cs (FixedField.Define): Use IsPrimitiveType
14484 * expression.cs (Binary.ResolveOperator): Reflect IsCLRType renaming.
14486 * iterators.cs (Iterator.DefineIterator): Add check for arglist and
14487 unsafe parameter types.
14489 * statement.cs (Using.ResolveExpression): Add better error description.
14491 * typemanager.cs (IsCLRType): Renamed to IsPrimitiveType.
14493 2005-04-08 Raja R Harinath <rharinath@novell.com>
14496 * attribute.cs (Attribute.GetAttributeUsage): Resolve
14497 AttributeUsageAttribute in the emitcontext of the attribute class,
14498 not in the emitcontext of the attributable entity it was attached to.
14499 * cs-parser.jay: Use 'current_class', not 'current_container',
14500 when creating a GlobalAttribute.
14502 2005-04-08 Alp Toker <alp@atoker.com>
14504 * pending.cs: The fix to #58413 failed to compile methods implementing
14505 interfaces with/without params modifiers and vice versa, even though
14506 params modifiers aren't part of the signature. Make the modifier check
14507 less strict as in csc.
14509 2005-04-07 Abin Thomas <projectmonokochi@rediffmail.com>
14510 Anoob V E <projectmonokochi@rediffmail.com>
14511 Harilal P R <projectmonokochi@rediffmail.com>
14514 * pending.cs (TypeAndMethods.mods): New. Store the parameter
14515 modifiers of pending methods.
14516 (PendingImplementation.PendingImplementation): Initialize it.
14517 Add Parameter.Modifier [][] mods and initialize it with ParameterData.
14518 (PendingImplementation.InterFaceMethod): Repalce Type[] argument
14519 with ParameterData. Add check for modifiers.
14520 * class.cs (MethodData.Define): Update to changes.
14522 2005-04-07 Raja R Harinath <rharinath@novell.com>
14524 * ecore.cs (Expression.IsAccessorAccessible): Clarify code somewhat.
14526 2005-04-07 Marek Safar <marek.safar@seznam.cz>
14528 * class.cs (PropertyMethod.Define): Check private accessor in abstract
14531 * decl.cs (DeclSpace.ApplyAttributeBuilder): Don't allow RequiredAttribute
14534 * typemanager.cs: Registered RequiredAttributeAttribute.
14536 2005-04-06 Marek Safar <marek.safar@seznam.cz>
14538 * class.cs (VerifyMembers): Doesn't need EmitContext argument.
14539 Warning CS0169 is back at level 3.
14540 (IMethodData.SetMemberIsUsed): New method.
14542 * decl.cs (IsUsed): New value; moved from FieldBase.Status
14543 (SetMemberIsUsed, IsUsed): New methods, encapsulate IsUsed.
14545 * delegate.cs (ResolveMethodGroupExpr): Call SetMemberIsUsed.
14547 * ecore.cs (FieldExpr.ResolveMemberAccess): Call SetMemberIsUsed for
14549 (PropertyExpr.ResolveAccessors): Call SetMemberIsUsed when delegate
14552 * expression.cs (OverloadResolve): Call SetMemberIsUsed. when method
14555 * rootcontext.cs (RootContext.EmitCode): Call VerifyMembers in extra run
14556 to avoid the problems with nested types.
14558 2005-04-05 Abin Thomas <projectmonokochi@rediffmail.com>
14559 Anoob V.E <projectmonokochi@rediffmail.com>
14560 Harilal P.R <projectmonokochi@rediffmail.com>
14561 Raja R Harinath <rharinath@novell.com>
14564 * delegate.cs (Define): Emit ParamArrayAttribute for 'params'
14566 * typemanager (GetConstructor): Make public.
14568 2005-04-05 John Luke <john.luke@gmail.com>
14569 Raja R Harinath <rharinath@novell.com>
14572 * typemanager.cs (IsUnmanagedType): Check non-public fields of a
14573 struct too. Return false quicker in a few cases.
14574 (VerifyUnManaged): Use it.
14576 2005-04-05 Raja R Harinath <rharinath@novell.com>
14579 * statement.cs (Block.Resolve): Initialize 'unreachable' to false,
14580 not 'unreachable_seen'.
14582 2005-04-04 Marek Safar <marek.safar@seznam.cz>
14584 * attribute.cs (Attribute.GetValue): Removed unused.
14586 * codegen.cs (CodeGen.TrimExt): Removed unused.
14588 * cs-parser.jay (output): Removed unused.
14590 * cs-tokenizer.cs (hex_digits): Removed unused.
14592 * enum.cs (MapToInternalType, GetEnumeratorName): Removed unused.
14594 * expression.cs (Indirection.LoadExprValue): Removed unused.
14595 (ArrayCreation.ExpressionToArrayArgument): Removed unused.
14597 * iterators.cs (Iterator.param_types): Removed unused.
14599 * statement.cs (Goto.block): Removed unused.
14600 (ToplevelBlock.did): Removed unused.
14601 (Switch.ResolveConstantSwitch): Removed unused.
14603 2005-04-01 Ben Maurer <bmaurer@ximian.com>
14605 * rootcontext.cs: Allow mcs to bootstrap with the compilation
14608 2005-04-01 Raja R Harinath <rharinath@novell.com>
14610 Fix #74232 and cs0208-3.cs.
14611 * expression.cs (ComposedCast.DoResolveAsTypeStep): Add CS0208 check.
14612 * typemanager.cs (IsUnmanagedType): Don't allow 'object' as an
14613 unmanaged type. Don't use FieldBuilders when 't' is a
14614 TypeBuilder. Use ModFlags and MemberType fields.
14615 * class.cs (MemberBase.member_type): Rename from MemberType.
14616 (MemberBase.MemberType): New property. Determines member_type on
14618 (MemberBase.DoDefine): Don't initialize MemberType here.
14619 (FieldMember.Define): Likewise.
14621 2005-04-01 Marek Safar <marek.safar@seznam.cz>
14624 * class.cs (Event.Emit): Call Add/Remove emit even for interfaces.
14625 Attributes are emitted there.
14627 2005-04-01 Raja R Harinath <rharinath@novell.com>
14629 * cs-tokenizer.cs (consume_identifier): Treat 'partial' as a
14630 keyword in 'partial enum' too.
14631 * cs-parser.jay (enum_declaration): Add CS0267 check ('partial enum'
14633 Report from Kamil Skalski <nazgul@omega.pl>.
14636 * rootcontext.cs (ResolveTree): The 'root.Interfaces' list can
14637 have partial containers too.
14639 * ecore.cs (SimpleName.SimpleNameResolve): Move 'invariant meaning
14640 in block' checks to Block.CheckInvariantMeaningInBlock.
14641 * statement.cs (Block.GetKnownVariableInfo): Make private.
14642 (Block.IsVariableUsedInChildBlock): Remove.
14643 (Block.IsVariableUsedInBlock): Likewise.
14644 (Block.CheckInvariantMeaningInBlock): New. Show location of
14645 conflicting declaration.
14646 (Block.AddVariable): Make error messages less long-winded and more
14647 specific. Show location of conflicting declaration.
14648 * parameter.cs (Parameters.Location): New readonly property.
14650 2005-03-31 Raja R Harinath <rharinath@novell.com>
14652 Clean up semantics of invoking ResolveMemberAccess.
14653 * ecore.cs (SimpleName.DoSimpleNameResolve): If a MemberExpression
14654 can have an instance, ensure that we pass in a non-TypeExpression
14655 to ResolveMemberAccess. Tighten up IdenticalNameAndTypeName checks.
14656 (MemberExpr.DoSimpleNameResolve): Remove type_is_inferred
14657 argument. Update to changes and simplify.
14658 (FieldExpr.Emitinstance): Remove CS0120 check.
14659 (PropertyExpr.EmitInstance): Likewise.
14660 * expression.cs (Argument.Resolve): Likewise.
14661 (Invocation.DoResolve): Update to changes in semantics of
14662 InstanceExpression.
14664 2005-03-31 Marek Safar <marek.safar@seznam.cz>
14667 * class.cs (AbstractPropertyEventMethod.EmitMethod): Enable emit method
14670 * decl.cs (MemberCache.AddMethods): Fix infinite loop.
14672 2005-03-31 Raja R Harinath <rharinath@novell.com>
14674 Fix difference in behaviour with commandline invocation.
14675 * driver.cs (Driver.Reset): New.
14676 (CompilerCallableEntryPoint): Call it.
14678 * statement.cs (If.Resolve): Avoid spurious "uninitialized
14679 variable" warnings if the boolean expression failed to resolve.
14681 2005-03-30 Sebastien Pouliot <sebastien@ximian.com>
14683 * attribute.cs: Fix the union of several permissions when some of them
14684 are unrestricted (so the result isn't an unrestricted permission set).
14687 2005-03-30 Raja R Harinath <rharinath@novell.com>
14689 * ecore.cs (MemberExpr): New class. Convert from interface
14691 (MemberExpr.ResolveMemberAccess): Refactor and move here from
14692 MemberAccess.ResolveMemberAccess. Tighten up pre-conditions and
14694 (MethodGroupExpr, FieldExpr, PropertyExpr, EventExpr): Update.
14695 (MethodGroupExpr.IsExplicitImpl): Remove.
14696 (Expression.GetFieldFromEvent): Remove.
14697 (SimpleName.MemberStaticCheck): Remove.
14698 (SimpleName.DoSimpleNameResolve): Update to changes.
14699 * expression.cs (MemberAccess.ResolveMemberAccess): Refactor.
14700 (MemberAccess.IdenticalNameAndTypeName): Remove.
14701 (MemberAccess.error176): Move to MemberExpr.
14702 (MemberAccess.DoResolve): Update to changes.
14703 (BaseAccess.DoResolve): Likewise.
14705 2005-03-30 Marek Safar <marek.safar@seznam.cz>
14707 C# 2.0 Conditional attribute class implementation
14709 * attribute.cs (AttributeTester.IsAttributeExcluded): New method.
14710 Analyzes class whether it has attribute which has ConditionalAttribute
14711 and its condition is not defined.
14713 * class.cs (Class.ApplyAttributeBuilder): Add IsAttributeExcluded check.
14714 (Class.IsExcluded): New method. Search for at least one defined
14715 condition in ConditionalAttribute of attribute class.
14717 2005-03-30 Raja R Harinath <rharinath@novell.com>
14719 * ecore.cs (PropertyExpr): Derive from Expression, not
14720 ExpressionStatement.
14721 (PropertyExpr.EmitStatement): Remove.
14723 2005-03-29 Raja R Harinath <rharinath@novell.com>
14726 * expression.cs (MemberAccess.ResolveMemberAccess): Allow the
14727 internal field "value__" of an enum be private. The examples for
14728 "value__" that I found on MSDN all used FieldAttributes.Private.
14730 * decl.cs (MemberCache.AddMethods): Use C# terminology in warning.
14731 Don't mention IL method attribute names.
14733 Fix #47991. Remove a TODO.
14734 * statement.cs (Block.Toplevel): Make into a field.
14735 (Block.Parameters): Move into ToplevelBlock.
14736 (Block.known_variables): Rename from child_variable_names.
14737 (Block.Block): Remove variants that take Parameters. Initialize
14738 'Toplevel' with the immediately surrounding toplevel block.
14739 (Block.AddKnownVariable): Rename from AddChildVariableName. Add a
14740 LocalInfo parameter.
14741 (Block.GetKnownVariableInfo): New.
14742 (Block.IsVariableNameUsedInChildBlock): Update.
14743 (Block.IsVariableNameUsedInBlock): New. Checks if a name is used in
14744 the block, even though it may not be in scope.
14745 (Block.AddVariable): Remove Parameters parameter. Use
14746 Toplevel.Parameters instead.
14747 (Block.AddConstant): Remove Parameters parameter.
14748 (Block.GetParameterReference): Update to use Toplevel.Parameters.
14749 (Block.IsParamaterReference): Likewise.
14750 (Block.IsLocalParameter): Likewise. Simplify a lot.
14751 (ToplevelBlock.Parameters): New. Moved from Block.
14752 (ToplevelBlock.ToplevelBlock): Update to changes. Always
14753 initialize Parameters to a non-null value.
14754 * cs-parser.jay: Update to changes.
14755 * ecore.cs (SimpleName.SimpleNameResolve): Emit cs0136 error for
14756 simple names that mean different things in the same block. Use
14757 Block.IsVariableNameUsedInBlock.
14759 2005-03-28 Raja R Harinath <rharinath@novell.com>
14761 * typemanager.cs (TypeHandle.BaseType): Make into an IMemberContainer.
14762 (TypeHandle.TypeHandle): Use LookupMemberCache rather than
14763 GetTypeHandle. It is possible for a reflected type to derive from
14764 a TypeBuilder (e.g., int[] derives from the TypeBuilder
14765 System.Array during mscorlib compilation).
14766 * decl.cs (MemberCache.MemberCache): If the base cache doesn't
14767 contain a method_hash, don't create one either. Don't create a
14768 deep copy of the base cache's method_hash.
14769 (MemberCache.SetupCache): Rename back from DeepCopy.
14770 (MemberCache.AddMethods): Rewrite, now that method_hash isn't
14771 already initialized. If we see an override function, add its
14772 underlying base virtual function to the member_hash too.
14774 * enum.cs (Enum.LookupEnumValue): Remove debugging code.
14776 2005-03-26 Raja R Harinath <harinath@acm.org>
14779 * assign.cs (Assign.DoResolve): When the RHS of an assignment
14780 fails to resolve, ensure that the LHS is still resolved as an
14783 2005-03-25 Raja R Harinath <harinath@acm.org>
14785 * enum.cs (Enum.DefineType): Set ec.InEnumContext and
14787 (Enum.current_ec): Remove.
14788 (Enum.LookupEnumValue): Remove EmitContext argument.
14789 Just uses the one created during DefineType.
14790 (Enum.FindMembers): Update.
14791 * expression.cs (MemberAccess.DoResolve): Update.
14793 2005-03-22 Marek Safar <marek.safar@seznam.cz>
14795 * assign.cs (Assign.DoResolve): Check for CS1717 when
14796 source and target are same (uses Equals).
14798 * expression.cs (LocalVariableReference, ParameterReference,
14799 This): Implemented Equals, GetHashCode.
14801 * statement.cs (Block.GetParameterReference): Removed useless
14804 2005-03-22 Raja R Harinath <rharinath@novell.com>
14807 * statement.cs (Block.AddVariable): Ensure that we skip implicit
14808 blocks before deciding whether the error is cs0136 or cs0128.
14810 * cs-parser.jay: Pass MemberName to RootContext.Tree.RecordDecl.
14811 (using_alias_directive, using_namespace_directive): Pass
14812 MemberName, not an expression to Namespace.UsingAlias and
14814 (MakeName): Use the MemberName of the namespace.
14815 * namespace.cs (Namespace.MemberName): New.
14816 (UsingEntry.UsingEntry): Take a MemberName, not an expression.
14817 (AliasEntry.AliasEntry, Namespace.Using, Namespace.UsingAlias):
14819 * decl.cs (MemberName.Name): Make readonly.
14820 (MemberName.FromDotted): New "constructor".
14821 (MemberName.Equals, MemberName.GetHashCode): Implement overrides.
14822 (MemberCore.Name): Compute from MemberName on demand.
14823 (MemberCore.SetMemberName): Provide a way to change the
14825 (MemberCore.AddToContainer): Don't take a fullname parameter.
14826 * class.cs (TypeContainer.AddToMemberContainer): Don't add the
14827 fully qualified name of the container to the member name.
14828 (TypeContainer.AddToTypeContainer): Use a fully qualified name
14829 only if the type is a member of the root container.
14830 (TypeContainer.AddMethod, TypeContainer.AddProperty): Use
14831 MemberName.Left rather than searching for an embedded ".".
14832 (PartialContainer.CreatePart): Update to changes in RootContext.
14833 (MemberBase.ShortName): Turn into a property. Use
14834 MemberCore.SetMemberName.
14835 (MemberBase.ExplicitInterfaceName): Remove.
14836 (MemberBase.UpdateMemberName): Remove.
14837 (AbstractPropertyEventMethod.UpdateName): Use SetMemberName.
14838 (PropertyBase.SetMemberName): New override.
14839 * tree.cs (Tree.RecordDecl): Take a MemberName and use it as hash key.
14840 (Tree.GetDecl): New.
14841 (Tree.AllDecls): Rename from Decls.
14842 * attribute.cs, enum.cs, report.cs: Update to changes.
14843 * driver.cs (MainDriver): Use MemberName.FromDotted on
14844 RootContext.MainClass.
14846 2005-03-21 Marek Safar <marek.safar@seznam.cz>
14848 * class.cs (FixedField.Define): Check for CS1664 and more sanity
14851 * expression.cs (ElementAccess.DoResolveLValue): Check for CS1708.
14853 2005-03-18 Marek Safar <marek.safar@seznam.cz>
14855 * modifiers.cs (Modifiers.PROPERTY_CUSTOM): New constant for
14856 property accessor modifiers.
14858 * class.cs (FieldMember.ApplyAttributeBuilder): Don't allow apply
14859 fixed buffer attribute (CS1716).
14860 (PropertyMethod.HasCustomAccessModifier): When property accessor
14861 has custom modifier.
14863 * ecore (PropertyExpr.DoResolve): Add CS0271 for custom accessor
14865 (PropertyExpr.DoResolveLValue): Add CS0272.
14867 2005-03-17 Miguel de Icaza <miguel@novell.com>
14869 * convert.cs: When converting to a pointer, use the proper Conv.U
14870 or Conv.I depending on the source data type.
14872 * cs-tokenizer.cs: Make the size for large decimal constants,
14875 2005-03-17 Martin Baulig <martin@ximian.com>
14877 * anonymous.cs (AnonymousMethod.method_modifiers): Change default
14878 from `Modifiers.INTERNAL' to `Modifiers.PRIVATE'. Fixes #73260.
14880 2005-03-17 Martin Baulig <martin@ximian.com>
14882 * anonymous.cs (AnonymousMethod.EmitMethod): Changed return type
14883 to bool so we can return an error condition.
14884 (AnonymousDelegate.Emit): Check whether AnonymousMethod.EmitMethod()
14887 2005-03-16 Zoltan Varga <vargaz@freemail.hu>
14889 * attribute.cs: Encode ThrowOnUnmappableChar and BestFitMapping
14892 2005-03-16 Raja R Harinath <rharinath@novell.com>
14894 Remove TypeManager.LookupType and TypeManager.LookupTypeDirect.
14895 Refactor to avoid traversing the list of assemblies, and to avoid
14896 string concatenation.
14897 * typemanager.cs (guid_attr_type): Remove.
14898 (negative_hits, pointers, references): Remove hashes.
14900 (GetConstructedType): New. Uses type_hash to handle constructed
14901 types (arrays, references, pointers).
14902 (GetReferenceType, GetPointerType): Use it.
14903 (GetNestedType): New. Uses type_hash to handle nested types of
14905 (LookupType, LookupTypeDirect): Remove.
14906 (CoreLookupType): Inline parts of old LookupTypeDirect code. Use
14907 'types' hash and LookupTypeReflection directly.
14908 (params_string, params_object): Use GetConstructedType.
14909 * namespace.cs (Namespace.cached_types): New. Cache of reflected
14911 (Namespace.Lookup): Use cached_types.
14912 (NamespaceEntry.LookupNamespaceOrType): Inline the functionality
14913 provided by old TypeManager.LookupType.
14914 * rootcontext.cs (MakeFQN): Remove.
14915 * decl.cs (DeclSpace.MakeFQN): Likewise.
14916 (DeclSpace.LookupType): Use TypeManager.GetNestedType.
14917 * expression.cs (ComposedCast.DoResolveAsTypeStep): Use
14918 TypeManager.GetConstructedType.
14919 * tree.cs (decl_ns_hash, LookupByNamespace): Remove.
14921 2005-03-15 Marek Safar <marek.safar@seznam.cz>
14923 * class.cs (MethodCore.CheckBase): Report CS1715 for properties and
14926 * cs-parser.jay: Reports CS1527 for any namespace element.
14928 * delegate.cs (DelegateCreation.Error_NoMatchingMethodForDelegate):
14931 * expression.cs (ParameterReference.IsAssigned): Changed error to
14933 (Error_WrongNumArguments): Moved CS0245 detection here.
14935 * statement.cs (Return.Resolve): Add CS1622 report.
14937 2005-03-11 Marek Safar <marek.safar@seznam.cz>
14939 * class.cs (StaticClass.DefineContainerMembers): Added CS0720.
14941 2005-03-11 Zoltan Varga <vargaz@freemail.hu>
14943 * attribute.cs expression.cs: Get rid of some allocations.
14945 2004-03-11 Atsushi Enomoto <atsushi@ximian.com>
14947 * doc.cs : just eliminate the latest change.
14949 2004-03-10 Atsushi Enomoto <atsushi@ximian.com>
14951 * doc.cs : commented out the latest change. It breaks xml-030.cs
14953 2004-03-10 Atsushi Enomoto <atsushi@ximian.com>
14955 * doc.cs : When TypeBuilder did not create Type yet, GetEvents() will
14956 fail. So invoke CreateType() in FindDocumentedType().
14958 2004-03-10 Atsushi Enomoto <atsushi@ximian.com>
14960 * cs-tokenizer.cs : added IsKeyword().
14961 * doc.cs : Detect keyword incorrectly used as identifier.
14962 Allow identifiers prefixed by @.
14964 2005-03-10 Marek Safar <marek.safar@seznam.cz>
14966 * attributes.cs (Attributes.Emit): Continue after CheckTargets.
14967 It caused exception in namespace resolving (again!).
14969 * class.cs (Class.ctor): Removed exit.
14970 (PropertyMethod.ctor): ditto.
14972 * codegen.cs (Codegen.Reset): Reset static data.
14973 (Codegen.ResolveTopBlock): Forward error status from ResolveMeta.
14975 * cs-tokenizer.cs (Cleanup): Removed.
14977 * driver.cs (GetSystemDir): Rewrote to one line command.
14978 It caused problem with unloaded dynamic modules.
14979 (UnixParseOption): Removed Exit.
14980 (CompilerCallableEntryPoint.InvokeCompiler): Make static.
14981 (CompilerCallableEntryPoint.Reset): Reset suitable static data.
14982 Now can be mcs used as library.
14984 * ecore.cs (Expression.ResolveBoolean): Use Location.Null for
14987 * location.cs (Reset): Reset static data.
14989 * namespace.cs (Reset): Reset static data.
14991 * report.cs (Report.Reset): Reset static data.
14993 * rootcontext.cs (RootContext.Reset): Reset static data.
14995 * tree.cs (RootTypes.ctor): Use Location.Null
14997 * typemanager.cs (TypeManager.Reset): Reset static data.
14998 (CoreLookupType): Removed Exit.
14999 (TypeHandle.Reset): Reset static data.
15001 2005-03-10 Raja R Harinath <rharinath@novell.com>
15004 * typemanager.cs (ComputeNamespaces): Import namespaces from
15005 referenced modules too.
15007 2005-03-09 Raja R Harinath <rharinath@novell.com>
15009 * class.cs (TypeContainer.AddToMemberContainer): Use "." rather
15012 2005-03-09 Raja R Harinath <rharinath@novell.com>
15014 * decl.cs (DeclSpace.LookupType): Don't loop but recurse into
15015 enclosing DeclSpace. This ensures that a name-lookup populates
15016 more caches and there are fewer 'TypeExpression's. Carve out
15017 nested type lookup into ...
15018 (LookupNestedTypeInHierarchy): ... this.
15020 2005-03-09 Raja R Harinath <rharinath@novell.com>
15022 Clean up a few partial-class semantics.
15023 Fixes test-357.cs and cs1618-2.cs.
15024 * cs-parser.jay (struct_declaration): Use 'current_class' as
15025 parent of newly-created struct. Remove call to Register ().
15026 Use 'pop_current_class' to complete handing the current struct.
15027 (interface_declaration): Likewise.
15028 (class_declaration): Likewise.
15029 (enum_declaration): Use 'current_class' as parent of newly created
15031 (delegate_declaration): Likewise.
15032 (pop_current_class): New function. This is used to handle closing
15033 up the 'current_class' and 'current_container', and pointing them
15034 to the enclosing class/container.
15035 (CSharpParser): Initialize 'current_class' too.
15036 * decl.cs (MemberCore): Add check for invariant: a partial
15037 container is not a parsed entity, and thus does not enclose any
15039 (DeclSpace.TypeResolveEmitContext): Expose 'type_resolve_ec'.
15040 (DeclSpace.BaseTypeExpr): Use it.
15041 (DeclSpace.LookupType): Add check for invariant.
15042 * class.cs (TypeContainer): Add check for invariant: a nested
15043 class should have the same NamespaceEntry as its enclosing class.
15044 (TypeContainer.EmitFieldInitializers): Make virtual.
15045 (TypeContainer.DefineDefaultConstructor): Adhere to invariant in
15047 (TypeContainer.Register): Remove.
15048 (TypeContainer.DefineType): Set the 'ec' of a PartialContainer to
15049 null. Use TypeResolveEmitContext for resolving base types and
15050 interfaces. Move initialization of Parts.TypeBuilder here from
15052 (TypeContainer.DefineNestedTypes): ... here.
15053 (PartialContainer): Take a Namespace not a NamespaceEntry.
15054 (PartialContainer.Create): Don't use Register. Call the
15055 appropriate Add... function directly.
15056 (ClassPart): Take both the PartialContainer and the enclosing
15057 class as constructor arguments.
15058 (ClassPart.EmitFieldInitializers): Override.
15059 (ClassPart.PartFindNestedTypes): Remove.
15060 (FieldBase.GetInitializerExpression): Resolve the initializer
15061 expression in the emit context of the enclosing class.
15062 * tree.cs (RootTypes): Remove Register ().
15064 2005-03-08 Marek Safar <marek.safar@seznam.cz>
15066 * cs-parser.jay: Removed CS0134.
15068 * driver.cs: Removed CS1901.
15070 * expression.cs (SizeOf.DoResolve): Don't report CS0233
15071 for predefined types.
15073 2005-03-07 Duncan Mak <duncan@novell.com>
15075 * codegen.cs (Save): Catch UnauthorizedAccessException as
15076 well. Fixes bug #73454.
15078 2005-03-07 Marek Safar <marek.safar@seznam.cz>
15080 * cs-tokenizer.cs (xtoken): Add CS1035.
15082 * class.cs (MethodData.Define): Add CS0683.
15083 (FieldMember.ctor): Add CS0681.
15085 2005-03-07 Raja R Harinath <rharinath@novell.com>
15087 * ecore.cs (SimpleName.DoResolve): Rename from
15088 SimpleName.DoResolveAllowStatic.
15089 (SimpleName.DoSimpleNameResolve): Remove 'allow_static' argument.
15090 Pass 'intermediate' flag to MemberStaticCheck.
15091 (SimpleName.MemberStaticCheck): Skip "static check" only in case
15092 of "intermediate" lookups via MemberAccess.
15093 (SimpleName.IdenticalNameAndTypeName): New. Carved out of ...
15094 * expression.cs (MemberAccess.IdenticalNameAndTypeName): ... this.
15096 2005-03-07 Raja R Harinath <rharinath@novell.com>
15099 * ecore.cs (FieldExpr.EmitInstance): Catch cases of CS0120 that
15100 slipped in because of variable names that are identical to a
15101 builtin type's BCL equivalent ('string String;', 'int Int32;').
15102 (PropertyExpr.EmitInstance): Likewise.
15104 2005-03-04 Marek Safar <marek.safar@seznam.cz>
15106 * cs-tokenizer.cs (PreProcessPragma): Add warning 1633, 1635.
15108 * report.cs (warning_ignore_table): Made public.
15110 2005-03-04 Raja R Harinath <rharinath@novell.com>
15113 * class.cs (MethodData.Emit): Pass 'container' to
15114 container.GetObsoleteAttribute instead of 'container.Parent'.
15116 2005-03-03 Marek Safar <marek.safar@seznam.cz>
15118 * cs-parser.jay: Add 1534 error test.
15120 * iterators.cs (Yield.CheckContext): Add error 1629.
15121 (Iterator.ctor): Save unsafe modifier.
15122 (MoveNextMethod.DoEmit): Restore unsafe context.
15124 * namespace.cs (UsingAlias): Better error message.
15126 2005-03-03 Dan Winship <danw@novell.com>
15128 * convert.cs (Error_CannotImplicitConversion): fix two bugs in
15129 the warning message [#73219]
15131 2005-03-03 Raja R Harinath <rharinath@novell.com>
15133 Fix compile with MCS 1.0.0.0.
15134 * cs-tokenizer.cs (PreProcessPragma): Simplify w_disable and
15135 w_restore to not depend on string constant folding.
15137 2005-03-03 Raja R Harinath <rharinath@novell.com>
15139 * decl.cs (DeclSpace.LookupType): Remove 'silent' argument. Move
15140 CS0246 check to users who passed 'silent = false'.
15141 * ecore.cs (TypeLookupExpression.DoResolveAsTypeStep): Add CS0246
15143 (SimpleName.SimpleNameResolve): Update.
15144 * expression.cs (ComposedCast.DoResolveAsTypeStep): Add CS0246 check.
15145 (MemberAccess.IdenticalNameAndTypeName): Update.
15146 * doc.cs (FindDocumentedTypeNonArray): Update.
15148 2005-03-03 Raja R Harinath <rharinath@novell.com>
15150 * codegen.cs (EmitContext): Remove ResolvingTypeTree.
15151 * parameters.cs (ComputeAndDefineParameters): Remove.
15152 * decl.cs (ResolveBaseTypeExpr): Don't set ResolvingTypeTree.
15153 * delegate.cs (Define): Don't invoke ComputeAndDefineParameters.
15154 Use GetParameterInfo.
15156 2005-03-02 Marek Safar <marek.safar@seznam.cz>
15158 * report.cs (StaticClass.DefineContainerMembers): Add warning 628.
15160 2005-03-02 Raja R Harinath <rharinath@novell.com>
15162 Unify DeclSpace.LookupType and DeclSpace.FindType.
15163 * decl.cs (DeclSpace.FindNestedType): New virtual function. This
15164 is in charge of defining nested types on demand.
15165 (DeclSpace.LookupType): Use it when the current_type is a
15166 TypeBuilder. Use LookupTypeDirect for reflected types.
15167 (DeclSpace.FindType): Remove.
15168 (DeclSpace.LookupInterfaceOrClass): Likewise.
15169 (DeclSpace.DefineTypeAndParents): Likewise.
15170 * ecore.cs (SimpleName.ResolveAsTypeStep): Just call
15171 DeclSpace.LookupType.
15172 * doc.cs (FindDocumentedTypeNonArray): Use DeclSpace.LookupType.
15173 * typemanager.cs (LookupType): Simplify.
15174 (AddUserType): Remove type from negative_hits.
15175 * namespace.cs (Namespace.Lookup): Use TypeManager.LookupTypeDirect.
15176 * class.cs (TypeContainer.FindMembers): Move handling of nested
15178 (TypeContainer.FindMembers_NestedTypes): ... here.
15179 (TypeContainer.FindNestedType): Implement override.
15180 (ClassPart.FindNestedType): Delegate to PartialContainer.
15181 (ClassPart.PartFindNestedType): Looks up the nested types of the
15184 2005-03-02 Martin Baulig <martin@ximian.com>
15186 * class.cs (TypeContainer.DoDefineMembers): We also need a default
15187 static constructor in static classes.
15189 2005-03-01 Zoltan Varga <vargaz@freemail.hu>
15191 * attribute.cs: Pass -1 to DefineLPArrayInternal if sizeConst or
15192 sizeParamIndex is not specified.
15194 2005-03-01 Marek Safar <marek.safar@seznam.cz>
15197 * report.cs (WarningMessage.IsEnabled): Missing null check.
15199 2005-02-28 Marek Safar <marek.safar@seznam.cz>
15201 * attribute.cs (DefinePInvokeMethod): Fix, all data are stored
15202 in the fields and not in the properties.
15204 2005-02-28 Zoltan Varga <vargaz@freemail.hu>
15206 * attribute.cs (GetMarshal): Marshal SizeConst and SizeParamIndex
15209 2005-02-28 Marek Safar <marek.safar@seznam.cz>
15211 * attribute.cs: Small refactoring (improved robustness).
15212 (ImplOptions, UnmanagedType, UsageAttribute): Removed members.
15213 (ValidateGuid): Removed.
15214 (Resolve): Removed referenced to above mentioned.
15215 (GetAttributeUsage): Made private and changed to work without
15217 (GetIndexerAttributeValue): Don't crash.
15218 (GetConditionalAttributeValue): Ditto.
15219 (GetClsCompliantAttributeValue): Ditto.
15220 (ExtractSecurityPermissionSet): All attributes exceptions are
15222 (GetPropertyValue): New helper.
15223 (GetMethodImplOptions): New method.
15224 (DefinePInvokeMethod): Reuse common code. Implemented handling of
15225 some missing properties.
15227 * class.cs (ClassOrStruct.ApplyAttributeBuilder): Updated.
15228 (Method.ApplyAttributeBuilder): Updated.
15230 * decl.cs (DeclSpace.ApplyAttributeBuilder): Don't catch shared
15233 2005-02-28 Raja R Harinath <rharinath@novell.com>
15236 * report.cs (Report.SymbolRelatedToPreviousError): Handle
15237 non-simple types (array, pointer, reference).
15239 2005-02-28 Marek Safar <marek.safar@seznam.cz>
15241 * cs-parser.jay: Add errors 1617, 650, 1007, 531, 547, 548
15243 * class.cs (MethodCore.IsDuplicateImplementation): Special error
15245 (Method.CheckBase): Catch wrong destructor here.
15246 (MethodData.Define): Add errors 550, 668.
15248 * cs-tokenizer.cs (PreProcessPragma): Add warning 1634.
15250 * ecore.cs (PropertyExpr.DoResolveLValue): Fixed wrong error code.
15252 * pending.cs (VerifyPendingMethods): Add error 551.
15254 * typemanager.cs (CSharpName): Next error report helper.
15256 2005-02-25 Marek Safar <marek.safar@seznam.cz>
15258 * attribute.cs (Atttribute.Resolve): Add cache for parameter-less
15259 attributes. Removed useless attribute double check.
15260 It saves almost 2MBs for corlib.
15262 2005-02-25 Raja R Harinath <rharinath@novell.com>
15265 * statement.cs (ExpressionStatement.Resolve): Make robust to being
15266 called twice in case of error.
15268 2005-02-23 Chris Toshok <toshok@ximian.com>
15270 Fix compiler portions of #72827.
15271 * statement.cs (Block.Emit): call Begin/EndScope on the
15272 EmitContext instead of the ILGenerator.
15274 * codegen.cs (EmitContext.BeginScope): new method, call
15275 ILGenerator.BeginScope as well as the SymbolWriter's OpenScope (if
15277 (EmitContext.BeginScope): same, but EndScope and CloseScope
15279 * symbolwriter.cs (SymbolWriter.OpenScope): get the current il
15280 offset and call the superclass's OpenScope(int) with it.
15281 (SymbolWriter.CloseScope): get the current il
15282 offset and call superclass's CloseScope(int) with it.
15284 2005-02-23 Marek Safar <marek.safar@seznam.cz>
15286 * anonymous.cs (AnonymousMethod.Compatible): Fixed to report
15287 CS1677 for out and ref as well.
15289 * class.cs (Method.Define): Add error CS1599 detection.
15291 * cs-parser.jay: Add CS1609, CS1670, CS1627 detection.
15293 * cs-tokenizer.cs (xtoken): Add error CS1646 detection.
15295 * delegate.cs (Delegate.Define): Add error CS1599 detection.
15297 * support.cs.cs (ModifierDesc): New helper method.
15299 2005-02-23 Raja R Harinath <rharinath@novell.com>
15300 Abin Thomas <projectmonokochi@rediffmail.com>
15301 Anoob V E <projectmonokochi@rediffmail.com>
15302 Harilal P R <projectmonokochi@rediffmail.com>
15304 Fix #57851, #72718.
15305 * class.cs (ConstructorBuilder.Resolve): Make sure that the second
15306 MemberLookup (used for error reporting) actually returns a result.
15307 Fix error report number (122, not 112).
15309 2005-02-22 Abin Thomas <projectmonokochi@rediffmail.com>
15310 Anoob V E <projectmonokochi@rediffmail.com>
15311 Harilal P R <projectmonokochi@rediffmail.com>
15314 * pending.cs (PendingImplementation.GetAbstractMethods):
15315 Find NonPublic members too.
15317 2005-02-22 Marek Safar <marek.safar@seznam.cz>
15319 * expression.cs.cs (ConditionalLogicalOperator.DoResolve):
15322 * class.cs (MethodCore.CheckMethodAgainstBase):
15323 Add error 239 report.
15325 2005-02-21 Raja R Harinath <rharinath@novell.com>
15328 * expression.cs (Invocation.IsApplicable): Make public.
15329 (Invocation.IsParamsMethodApplicable): Likewise.
15330 * delegate.cs (Delegate.VerifyApplicability): Don't use
15331 Invocation.VerifyArgumentCompat for parameter applicability
15332 testing. Use Invocation.IsApplicable and
15333 Invocation.IsParamsMethodApplicable.
15335 2005-02-21 Marek Safar <marek.safar@seznam.cz>
15337 * ecore.cs (PropertyExpr.DoResolve): Add error 214 report.
15339 * class.cs (Operator.Define): Add error 217 report.
15341 2005-02-21 Raja R Harinath <rharinath@novell.com>
15343 * namespace.cs (UsingEntry.Resolve): Undo change below.
15345 2005-02-21 Raja R Harinath <rharinath@novell.com>
15348 * ecore.cs (Expression.MemberLookupFailed): Add argument to
15349 disable the error message when the extended MemberLookup also
15351 (Expression.MemberLookupFinal): Update.
15352 (SimpleName.DoSimpleNameResolve): Update.
15353 * expression.cs (MemberAccess.ResolveNamespaceOrType):
15354 Don't use MemberLookupFinal.
15355 (New.DoResolve): Update.
15356 (BaseAccess.CommonResolve): Update.
15358 2005-02-21 Raja R Harinath <rharinath@novell.com>
15361 * attribute.cs (Attribute.ResolveType): If a 'resolve_error' had
15362 occured previously, don't resolve again.
15364 2005-02-21 Marek Safar <marek.safar@seznam.cz>
15367 * attribute.cs (Attribute.GetAttributeUsage): Add EmitContext
15368 argument. Call ResolveAttributeUsage for unresolved.
15369 when types doesn't match ctor arguments.
15371 * class.cs (DoDefineMembers.TypeContainer): Removed safety check
15372 for nested attribute classes.
15373 (Class.attribute_usage): Removed.
15374 (Class.ResolveAttributeUsage): Resolves AttributeUsageAttribute
15375 for attribute class.
15377 * ecore.cs (IsAttribute): Removed.
15379 * namespace.cs (UsingEntry.Resolve): Don't destroy NamespaceEntry.
15381 * rootcontext.cs (RegisterAttribute): Removed, attributes are
15383 (attribute_types): Removed.
15384 (EmitCode): Global attributes are emited as the latest.
15386 2005-02-18 Marek Safar <marek.safar@seznam.cz>
15388 * class.cs (EmitFieldInitializers): Don't emit field initializer
15389 for default values when optimilization is on.
15391 * constant.cs (Constant.IsDefaultValue): New property.
15393 * driver.cs: Add /optimize handling.
15397 * literal.cs: Implement new IsDefaultValue property.
15399 * rootcontext.cs (Optimize): New field, holds /optimize option.
15401 2005-02-18 Raja R Harinath <rharinath@novell.com>
15403 Fix crasher in re-opened #72347.
15404 * namespace.cs (Namespace.Lookup): Return null if
15405 DeclSpace.DefineType returns null.
15408 * expression.cs (Argument.Resolve): Handle a case of CS0120 here.
15410 2005-02-18 Raja R Harinath <rharinath@novell.com>
15412 Fix remainder of #63202. Change semantics of DoResolveLValue: it
15413 now returns null if it cannot resolve to an lvalue.
15414 * ecore.cs (Expression.DoResolveLValue): Return 'null' by default.
15415 (Expression.ResolveLValue): Emit CS0131 error if DoResolveLValue
15416 returned null. Remove check for SimpleName.
15417 (EventExpr.DoResolveLValue): New.
15418 * iterators.cs (Iterator.FieldExpression.DoResolveLValue): New.
15419 * expression.cs (Argument.Error_LValueRequired): New. Move CS1510
15421 (Argument.Resolve): ... here. Use it. Use DoResolveLValue to
15422 avoid CS0131 error.
15423 (Unary.ResolveOperator): Move CS0211 check ...
15424 (Unary.DoResolve): ... here. Use DoResolveLValue to avoid
15426 (Unary.DoResolveLValue): Simplify.
15427 (AddressOf.DoResolveLValue): New.
15428 (ArrayAccess.DoResolveLValue): New.
15430 2005-02-16 Marek Safar <marek.safar@seznam.cz>
15432 * attribute.cs (Attribute.Resolve): Add arguments casting for
15433 when types doesn't match ctor arguments.
15435 2005-02-16 Raja R Harinath <rharinath@novell.com>
15437 Fix parts of #63202.
15438 * expression.cs (UnaryMutator.ResolveOperator): Remove redundant
15439 lookup of operator in base type. Ensure that all checks happen
15440 when the operator resolves to an "op_..." method.
15442 2005-02-15 Raja R Harinath <rharinath@novell.com>
15445 * namespace.cs (NamespaceEntry.LookupNamespaceOrType): Add
15446 'ignore_cs0104' parameter. Pass it to ...
15447 (NamespaceEntry.Lookup): ... this.
15448 * decl.cs (DeclSpace.LookupType): Add 'ignore_cs0104' parameter.
15449 * ecore.cs (SimpleName.ResolveAsTypeStep): Update.
15450 (TypeLookupExpression.DoResolveAsTypeStep): Update.
15451 * expression.cs (MemberAccess.IdenticalNameAndTypeName):
15452 Update. Request that cs0104 errors be ignored.
15453 (ComposedCast.ResolveAsTypeStep): Update.
15455 2005-02-14 Raja R Harinath <rharinath@novell.com>
15458 * expression.cs (Invocation.BetterFunction): Remove support for
15459 comparing virtual functions and their overrides.
15460 (Invocation.IsOverride): New.
15461 (Invocation.OverloadResolve): Don't consider 'override' functions
15462 during candidate selection. Store them in a lookaside list.
15463 If the selected method is a 'virtual' function, use the list to
15464 find any overrides that are closer to the LHS type.
15466 2005-02-14 Marek Safar <marek.safar@seznam.cz>
15468 * expression.cs (New.DoResolve): Add complex core type reduction.
15469 (New.Constantify): Converts complex core type syntax like 'new int ()'
15470 to simple constant.
15472 2005-02-14 Raja R Harinath <rharinath@novell.com>
15474 * decl.cs (EntryType.EntryType): New constructor to create an
15475 updated copy of a cache entry.
15476 (MemberCache.AddMethods): Use it.
15477 (MemberCache.ClearDeclaredOnly): Remove.
15478 (MemberCache.MemberCache): Update.
15480 2005-02-11 Miguel de Icaza <miguel@novell.com>
15482 * codegen.cs (EmitContext): Introduce the `MethodIsStatic'
15483 variable. This one is represents the actual low-level declaration
15484 of the method, as opposed to the semantic level `IsStatic'.
15486 An anonymous method which is hosted into a static method might be
15487 actually an instance method. IsStatic would reflect the
15488 container, while MethodIsStatic represents the actual code
15491 * expression.cs (ParameterReference): Use the new MethodIsStatic
15492 instead of IsStatic.
15494 * anonymous.cs (AnonymousMethod.Compatible): Pass the
15495 Modifiers.STATIC to the Anonymous' Method EmitContext if static is
15496 set on the current EmitContext.
15498 * expression.cs (Cast): Overload DoResolveLValue so we can pass
15499 resolve our casted expression as an LValue. This triggers the
15500 proper LValue processing that is later required by Assign.
15504 * cs-tokenizer.cs (pp_and): recurse on pp_and, fixes #61903.
15506 2005-02-11 Marek Safar <marek.safar@seznam.cz>
15508 C# 2.0 Fixed buffer implementation
15510 * anonymous.cs: Update after RegisterHelperClass renaming.
15512 * attribute.cs (AttributeTester.fixed_buffer_cache):
15513 Cache of external fixed buffers.
15514 (AttributeTester.GetFixedBuffer): Returns IFixedBuffer
15515 implementation if field is fixed buffer else null.
15518 (TypeContainer.AddField): Accept FieldMember instead of Field.
15519 (FieldBase.IsFieldClsCompliant): Extracted code from
15520 VerifyClsCompliance descendant customization.
15521 (FixedField): New class handles fixed buffer fields.
15522 (FixedFieldExternal): Keeps information about imported fixed
15524 (IFixedField): Make access to internal or external fixed buffer
15527 * cs-parser.jay: Add fixed buffer parsing.
15529 * ecore.cs (FieldExpr.Emit): Add special emit case for fixed
15532 * expression.cs (Indirection): Extended implementation to accept
15533 fixed buffer field.
15534 (PointerArithmetic.Emit): Get element from fixed buffer as well.
15535 (ElementAccess.MakePointerAccess): Get type as parameter.
15536 (DoResolve): Add fixed buffer field expression conversion.
15537 (DoResolveLValue): Ditto.
15538 (FixedBufferPtr): New class. Moved most of original ArrayPtr.
15539 (ArrayPtr): Derives from FixedBufferPtr.
15540 (ArrayPtr.Emit): Add extra emit for array elements.
15542 * flowanalysis.cs.cs (StructInfo): Use FieldMember.
15544 * rootcontext.cs (CloseTypes): Emit CompilerGenerated attribute
15545 for compiler generated types.
15546 (RegisterCompilerGeneratedType): Renamed from RegisterHelperClass.
15548 * statement.cs (Fixed): Refactored to be easier add fixed buffer
15549 and consume less memory.
15550 (Fixed.Resolve): Add fixed buffer case.
15552 * typemanager.cs (compiler_generated_attr_ctor,
15553 fixed_buffer_attr_ctor): Add new 2.0 compiler attributes.
15554 (HasElementType): Add our own implementation to work on every
15557 2005-02-11 Miguel de Icaza <miguel@novell.com>
15559 * anonymous.cs (CaptureContext): Track whether `this' has been
15562 * expression.cs (This.ResolveBase): Call CaptureThis. Before we
15563 only captured `this' if it was implicitly done (instance
15564 methods/variables were used).
15566 * codegen.cs (EmitContext.CaptureThis): New method to flag that
15567 `this' must be captured.
15569 2005-01-30 Miguel de Icaza <miguel@novell.com>
15571 * anonymous.cs (CreateMethodHost): If there Scope.ScopeTypeBuilder
15572 is null it means that there has been no need to capture anything,
15573 so we just create a sibling.
15575 Renamed `EmitHelperClasses' to `EmitAnonymousHelperClasses'
15577 Just a partial fix. The other half is fairly elusive.
15579 2005-02-10 Raja R Harinath <rharinath@novell.com>
15581 Fix #52586, cs0121-4.cs.
15582 * decl.cs (MemberCache.DeepCopy): Rename from SetupCache. Take
15583 and return a hashtable.
15584 (MemberCache.ClearDeclaredOnly): New.
15585 (MemberCache.MemberCache): Update to change. Make a deep copy of
15586 the method_hash of a base type too.
15587 (MemberCache.AddMethods): Adapt to having a deep copy of the base
15588 type methods. Overwrite entries with the same MethodHandle so
15589 that the ReflectedType is correct. The process leaves in base
15590 virtual functions and their overrides as distinct entries.
15591 (CacheEntry): Now a class instead of a struct. It shouldn't alter
15592 matters since it was boxed in a ArrayList before.
15593 (CacheEntry.Member, CacheEntry.EntryType): Remove 'readonly'
15595 * expression.cs (Invocation.BetterFunction): Simplify. Handle the
15596 case of a virtual function and its override (choose the overload
15598 (Invocation.OverloadResolve): Avoid 'override' members during
15599 'applicable_type' calculation.
15601 2005-02-09 Raja R Harinath <rharinath@novell.com>
15603 Combine two near-redundant caches.
15604 * typemanager.cs (method_params): Rename from method_internal_params.
15605 (TypeManager.GetParameterData): New. Replace
15606 Invocation.GetParameterData.
15607 (TypeManager.LookupParametersByBuilder): Remove.
15608 * expression.cs (Invocation.method_parameter_cache): Remove.
15609 (Invocation.GetParameterData): Remove.
15611 * anonymous.cs, attribute.cs, convert.cs, delegate.cs:
15614 2005-02-08 Raja R Harinath <rharinath@novell.com>
15617 * delegate.cs (Delegate.DefineType): When bootstrapping corlib, if
15618 TypeManager.multicast_delegate_type is null, resolve it by looking
15619 up "System.MulticastDelegate".
15620 * rootcontext.cs (RootContext.ResolveCore): Simplify.
15622 2005-02-07 Abin Thomas (NOSIP) <projectmonokochi@rediffmail.com>
15623 Anoob V.E (NOSIP) <projectmonokochi@rediffmail.com>
15624 Harilal P.R (NOSIP) <projectmonokochi@rediffmail.com>
15627 * statement.cs (LabeledStatement.Resolve): Don't set 'referenced'.
15628 (LabeledStatement.AddReference): New. Set 'referenced'.
15629 (Goto.Resolve): Use it.
15631 2005-02-05 John Luke <john.luke@gmail.com>
15633 * driver.cs: remove duplicate -doc line in Usage ()
15635 2005-02-04 Raja R Harinath <rharinath@novell.com>
15637 * location.cs (Location.AddFile): Fix CS2002 error report.
15639 2005-02-02 Martin Baulig <martin@ximian.com>
15641 * delegate.cs (Delegate.DefineType): Report an internal error if
15642 TypeManager.multicast_delegate_type is null. See bug #72015 for
15645 2005-02-02 Raja R Harinath <rharinath@novell.com>
15647 Fix a crasher in a variant of #31984.
15648 * const.cs (Constant.CheckBase): New override that defers the
15649 new-or-override check in case the base type hasn't been populated
15651 (Constant.Define): Ensure the new-or-override check is performed.
15653 2005-02-01 Duncan Mak <duncan@ximian.com>
15655 * const.cs (LookupConstantValue): Check that `ce' is not null
15656 before calling GetValue ().
15658 2005-02-01 Raja R Harinath <rharinath@novell.com>
15660 Fix test-334.cs (#69519).
15661 * cs-parser.jay (using_alias_directive): Pass in an expression to
15662 NamespaceEntry.UsingAlias.
15663 (using_namespace_directive): Pass in an expression to
15664 NamespaceEntry.Using.
15665 (namespace_name): Don't flatten to a string.
15666 * namespace.cs (NamespaceEntry.AliasEntry): Store an expression.
15667 (NamespaceEntry.AliasEntry.Resolve): Lookup using
15669 (NamespaceEntry.UsingEntry): Likewise.
15670 (NamespaceEntry.Using,NamespaceEntry.UsingAlias): Update to
15672 (NamespaceEntry.LookupForUsing): Remove.
15673 (NamespaceEntry.LookupNamespaceOrType): Add support for dotted
15675 (NamespaceEntry.Lookup): Remove support for dotted names.
15677 2005-02-01 Raja R Harinath <rharinath@novell.com>
15679 * namespace.cs (NamespaceEntry.NamespaceEntry): Simplify, and
15681 (NamespaceEntry.ImplicitParent): Compute on demand.
15682 (NamespaceEntry.Doppelganger): New implicit namespace-entry that
15683 parallels the current.
15684 (NamespaceEntry.LookupForUsing): Use it.
15685 (NamespaceEntry.Lookup): If the current namespace-entry is
15686 implicit, don't search aliases and using tables.
15688 2005-02-01 Raja R Harinath <rharinath@novell.com>
15691 * class.cs (TypeContainer.DoDefineMembers): Don't initialize
15693 (TypeContainer.BaseCache): Compute on demand.
15694 (TypeContainer.FindMembers): Define constants and types if they're
15695 not already created.
15696 (FieldMember.Define): Move resetting of ec.InUnsafe before error
15698 * const.cs (Constant.Define): Make idempotent.
15700 2005-01-29 Miguel de Icaza <miguel@novell.com>
15702 * pending.cs: Produce better code (no nops produced by using Ldarg
15705 * pending.cs (PendingImplementation.DefineProxy): It was not `arg
15706 i - 1' it should be arg + 1.
15710 2005-01-28 Raja R Harinath <rharinath@novell.com>
15712 * attribute.cs (Attribute.CheckAttributeType): Make private
15714 (Attribute.ResolveType): Make virtual.
15715 (GlobalAttribute.ResolveType,GlobalAttribute.Resolve): Simplify
15716 handling of RootContext.Tree.Types.
15718 2005-01-27 Raja R Harinath <rharinath@novell.com>
15720 Update attribute-handling to use the SimpleName/MemberAccess
15722 * cs-parser.jay (attribute): Pass in an expression to the
15723 constructors of Attribute and GlobalAttribute.
15724 * attribute.cs (Attribute): Take an expression for the name.
15725 (Attribute.ResolvePossibleAttributeTypes): New. Resolves the
15726 passed in attribute name expression.
15727 (Attribute.CheckAttributeType): Use it.
15728 * ecore.cs (FullNamedExpression.ResolveAsTypeStep): New.
15729 * expression.cs (MemberAccess.ResolveAsTypeStep): Move body to ...
15730 (MemberAccess.ResolveNamespaceOrType): ... here. Add 'silent'
15731 argument to prevent error messages if the lookup fails.
15733 2005-01-27 Marek Safar <marek.safar@seznam.cz>
15735 * expression.cs (Indirection): Implemented IVariable interface
15736 to support indirection in AddressOf operator.
15737 (PointerArithmetic.Emit): Add optimalization for case where
15738 result can be precomputed.
15740 2005-01-26 Martin Baulig <martin@ximian.com>
15742 * class.cs (TypeContainer.AttributeTargets): Return the correct
15743 AttributeTargets depending on our `Kind' instead of throwing an
15744 exception; fixes #71632.
15746 2005-01-26 Marek Safar <marek.safar@seznam.cz>
15749 * expression.cs (MemberAccess.ResolveMemberAccess): Add CS0176 test for
15752 2005-01-25 Raja R Harinath <rharinath@novell.com>
15755 * expression.cs (MemberAccess.DoResolve): Don't complain with
15756 cs0572 when the LHS of a member access has identical name and type
15759 2005-01-25 Marek Safar <marek.safar@seznam.cz>
15762 * attribute.cs (ExtractSecurityPermissionSet): Catch exceptions from
15764 Create custom PermissionSet only for PermissionSetAttribute.
15766 2005-01-24 Marek Safar <marek.safar@seznam.cz>
15769 * class.cs (StaticClass.DefineContainerMembers): Enable enums and
15770 delegates in static class.
15772 2005-01-24 Martin Baulig <martin@ximian.com>
15774 * flowanalysis.cs (FlowBranching.UsageVector.MergeChild): If we're
15775 merging an implicit block, just use its reachability.
15777 * statement.cs (Block.Resolve): Make the unreachable code check
15778 work wrt. implicit blocks; see test-337 from #63842.
15780 2005-01-21 Alp Toker <alp@atoker.com>
15782 * cs-parser.jay: destructor_declaration's container is PartialContainer
15783 not Class when partial types are used, so use Kind prop instead of
15786 2005-01-22 Miguel de Icaza <miguel@ximian.com>
15788 * cs-parser.jay: Improve error reporting when an interface
15789 declares new types.
15791 2005-01-20 Dick Porter <dick@ximian.com>
15793 * support.cs: SeekableStreamReader fix from Sandor Dobos
15794 (dobos_s@ibcnet.hu) to cope with Position setting when multibyte
15795 chars are read. Fixes bug 70369.
15797 2005-01-20 Raja R Harinath <rharinath@novell.com>
15799 * cs-parser.jay (catch_clause): Simplify current_block handling
15802 2005-01-17 Miguel de Icaza <miguel@ximian.com>
15804 * convert.cs (ImplicitStandardConversionExists): Synchronize the
15805 code with ImplicitStandardConversion to handle the implicit
15806 conversion of method groups into valid delegate invocations.
15808 The problem is that in parameter handling we were using this code
15809 path. Fixes bug #64698
15811 2005-01-19 Raja R Harinath <rharinath@novell.com>
15813 * cs-parser.jay: Fix several infelicities.
15814 - Avoid assigning to the parser value stack. Code like
15815 '$3 = null' is unclean. Synthesize a value for the code block
15817 - Avoid using oob_stack for storing location information. Use ...
15818 (_mark_): ... this. New (empty) rule. Saves the current location
15820 (foreach_statement): Avoid using oob_stack for current_block
15821 handling. Use technique used in for_statement and
15822 using_statement. Synthesize a value for the code block to store
15823 additional intermediate information.
15825 2005-01-13 Miguel de Icaza <miguel@ximian.com>
15827 * ecore.cs (IsAccessorAccessible): Accessibility to private fields
15828 of a different type is only allowed to private fields of a
15829 containing type, not on fields of a base class.
15831 See test-174.cs and error cs0122-9.cs
15833 2005-01-13 Raja R Harinath <rharinath@novell.com>
15835 Fix test-335.cs (bug #58126).
15836 * cs-parser.jay (argument): Split out non-expression parts of the
15837 rule into 'non_simple_argument'.
15838 (invocation_expression): Support parenthesized invocations with
15839 multiple arguments, and with single non-simple arguments.
15841 2005-01-13 Raja R Harinath <rharinath@novell.com>
15843 * cs-tokenizer.cs (xtoken): Reset 'comments_seen' in a couple more
15846 2005-01-12 Raja R Harinath <rharinath@novell.com>
15848 Fix cs0038-1.cs, cs1640-6.cs.
15849 * ecore.cs (Expression.Resolve): Remove special-case for
15850 SimpleName in error-handling.
15851 (Expression.almostMatchedMembers): Relax access permission to
15853 (Expression.MemberLookupFailed): Handle duplicates in
15854 almostMatchedMembers list.
15855 (SimpleName.DoSimpleNameResolve): Catch CS0038 errors earlier.
15856 * expression.cs (New.DoResolve): Report CS1540 for more cases.
15857 * typemanager.cs (GetFullNameSignature): Use the MethodBase
15858 overload if the passed in MemberInfo is a MethodBase.
15860 2005-01-12 Marek Safar <marek.safar@seznam.cz>
15863 * attribute.cs (ExtractSecurityPermissionSet): Don't report error
15864 for non-CAS & merge permission sets properly.
15866 2005-01-11 Raja R Harinath <rharinath@novell.com>
15868 Improve standard-compliance of simple name and member access
15869 resolution. Fixes bugs #52697, #57200, #67520, #69519.
15870 * ecore.cs (FullNamedExpression): New abstract base class
15871 for Namespaces and TypeExpressions.
15872 (ResolveFlags.SimpleName): Remove.
15873 (SimpleName): Remove support for dotted names.
15874 (SimpleName.ResolveAsTypeStep): Simplify. Now just a wrapper to
15875 DeclSpace.FindType and DeclSpace.LookupType.
15876 (SimpleName.DoSimpleNameResolve): Remove support for dotted names.
15877 (Expression.ExprClassName): Make member function.
15878 * expression.cs (MemberAccess.ResolveAsTypeStep): Support LHS being
15879 a namespace. Remove creation of dotted "SimpleName"s.
15880 (MemberAccess.DoResolve): Likewise.
15881 * decl.cs (DeclSpace.Cache): Make private.
15882 (DeclSpace.LookupInterfaceOrClass): Return a FullNamedExpression.
15883 (DeclSpace.FindType): Update.
15884 (DeclSpace.LookupType): Move here from RootContext. Return a
15885 FullNamedExpression.
15886 * namespace.cs (Namespace): Derive from FullNamedExpression
15887 so that it can be part of expression resolution.
15888 (Namespace.Lookup): Return an FullNamedExpression.
15889 (NamespaceEntry.LookupAlias): Lookup aliases only in current
15891 * rootcontext.cs (NamespaceLookup): Remove.
15892 (LookupType): Move to DeclSpace.
15893 * attribute.cs (CheckAttributeType): Update.
15894 * doc.cs (FindDocumentedType): Remove allowAlias argument.
15895 (FindDocumentedTypeNonArray): Likewise.
15897 2005-01-11 Raja R Harinath <rharinath@novell.com>
15899 Fix cs0509.cs, cs1632.cs.
15900 * class.cs (TypeContainer.GetNormalBases): Don't assume !IsClass
15901 is the same as IsInterface.
15902 (TypeContainer.GetClassBases): Likewise.
15903 * statement.cs (LabeledStatement.ig): New field.
15904 (LabeledStatement.LabelTarget): Save ILGenerator which created the
15906 (LabeledStatement.DoEmit): Check that the label was created with
15907 the same ILGenerator.
15909 2005-01-10 Marek Safar <marek.safar@seznam.cz>
15912 * attribute.cs (GetMethodObsoleteAttribute): Need to transform
15913 accessors to its properties.
15915 * ecore.cs (PropertyExpr): Add AccessorTable to help track back
15916 from accessors to property.
15918 2005-01-10 Marek Safar <marek.safar@seznam.cz>
15921 * class.cs (MethodCore.CheckBase): Test base method obsoleteness
15922 only for overrides.
15924 2005-01-08 Miguel de Icaza <miguel@ximian.com>
15926 * attribute.cs: Check for null and empty strings.
15928 I have lost another battle to Paolo.
15930 2005-01-07 Marek Safar <marek.safar@seznam.cz>
15933 * class.cs (PropertyMethod): Set Parent field in ctors.
15934 (SetMethod.InternalParameters): Add unsafe switch hack.
15935 Override MarkForDuplicationCheck where it is appropriate.
15937 * decl.cs (MemberCore.MarkForDuplicationCheck): New method.
15938 It says whether container allows members with the same name.
15939 Base default is no.
15940 (DeclSpace.AddToContainer): Use MarkForDuplicationCheck.
15941 Removed is_method parameter.
15943 2005-01-06 Duncan Mak <duncan@ximian.com>
15945 * cs-tokenizer.cs (xtoken): Redo the work for signaling CS1040
15946 because the previous change led to incorrect reporting of CS1032
15947 ("Cannot define/undefine preprocessor symbols after first token in
15948 file"). Instead of using `tokens_seen' as the only flag that
15949 triggers CS1040, introduce `comments_seen'. This new flag is used
15950 to signify having seen comments on the current line, so it is
15951 unset after a newline.
15953 2005-01-06 Atsushi Enomoto <atsushi@ximian.com>
15955 * doc.cs : When searching for a type, find nested type too.
15956 This fixes bug #71040.
15958 2005-01-06 Atsushi Enomoto <atsushi@ximian.com>
15961 - Warn missing member comment on those classes which also does not
15962 have doc comments. Fixed bug #71041.
15963 - Don't warn missing doc comment on default constructor.
15966 2005-01-06 Duncan Mak <duncan@ximian.com>
15968 * cs-tokenizer.cs (xtoken): After handling traditional C-style
15969 comments, set `tokens_seen' to true. This allows us to detect
15970 misplaced preprocessor directives (i.e. not at the beginning of
15971 the a line, nor after whitespaces). In that case, report error
15972 CS1040. This fixes bug #56460.
15974 * cs-parser.jay (interface_member_declaration): Add checks for
15975 IsExplicitImpl, and report CS0541 error if an interface member is
15976 defined as an explicit interface declaration.
15978 2005-01-06 Marek Safar <marek.safar@seznam.cz>
15981 * class.cs (PropertyMethod): Set Parent field in ctors.
15982 (SetMethod.InternalParameters): Add unsafe switch hack.
15984 * decl.cs (MemberCore.Parent): Cannot be readonly.
15986 2005-01-06 Raja R Harinath <rharinath@novell.com>
15988 * decl.cs (DeclSpace.ResolveType): Remove.
15989 (DeclSpace.ResolveBaseTypeExpr): Rename from ResolveTypeExpr.
15990 Merge in code from ...
15991 (DeclSpace.GetTypeResolvingEmitContext): ... here. Remove.
15992 * class.cs, enum.cs: Update to changes.
15994 2005-01-06 Miguel de Icaza <miguel@ximian.com>
15996 * anonymous.cs: Ensure that we init the scope of our parent if it
15997 has not been initialized yet.
15999 2004-12-30 Duncan Mak <duncan@ximian.com>
16001 * typemanager.cs (TypeManager.CheckStructCycles): Don't crash here
16002 if field.FieldBuilder is null. Fixes #70758.
16004 * convert.cs: Fixed some typos and updated some of the comments.
16005 (ImplicitStandardConversionExists):
16006 (TryImplicitIntConversion): If `target_type' is an interface and
16007 the type of `ic' implements this interface, return true or a new
16008 BoxedCast instead of null. This fixes #70468.
16010 2004-12-29 Duncan Mak <duncan@ximian.com>
16012 * expression.cs (Argument.Emit): Check that Expr is
16013 IMemoryLocation before casting to it, and report CS1510 otherwise.
16017 2004-12-21 Ben Maurer <bmaurer@ximian.com>
16019 * statement.cs (Block.ThisVariable): remove the recursion here, to
16020 make the --profile more sane.
16022 2004-12-17 Carlos Cortez <calberto.cortez@gmail.com>
16024 * driver.cs: Patch to handle a xsp bug that prevents to reference an .exe
16025 assembly, by JB Evain.
16027 2004-12-17 Raja R Harinath <rharinath@novell.com>
16029 * class.cs, decl.cs, ecore.cs, iterators.cs, pending.cs,
16030 rootcontext.cs, typemanager.cs: Make nomenclature consistent.
16031 "parent" refers to enclosing type/class. "base" refers to superclass.
16033 2004-12-17 Raja R Harinath <rharinath@novell.com>
16035 * codegen.cs (CommonAssemblyModulClass.GetClsCompliantAttribute):
16036 Ensure that we only have GlobalAttributes.
16037 * attribute.cs (Attribute.Emit): Make non-virtual.
16038 (GlobalAttribute.Emit): Remove.
16039 (Attribute.Resolve): Make virtual.
16040 (GlobalAttribute.Resolve): New. Set Rootcontext.Tree.Types.NamespaceEntry.
16041 (Attribute.GetConditionalAttributeValue): Take an EmitContext as
16042 the argument. Don't create one.
16043 (Attribute.GetObsoleteAttribute): Likewise.
16044 (Attribute.GetClsCompliantAttributeValue): Likewise.
16045 * class.cs, decl.cs: Update to changes.
16047 2004-12-17 Marek Safar <marek.safar@seznam.cz>
16049 * delegate.cs (NewDelegate.DoResolve): Add error 149 report.
16051 * ecore.cs (Expression.MemberLookupFailed): Fixed error 143.
16053 * statement.cs (Foreach.Resolve): Add error 186 report.
16055 2004-12-16 Marek Safar <marek.safar@seznam.cz>
16057 * expression.cs (Conditional.DoResolve): Add warning 429.
16059 * statement.cs (If.Resolve): Add warning 665.
16061 2004-12-16 Raja R Harinath <rharinath@novell.com>
16063 New invariant: RootContext.Tree.Types.NamespaceEntry == null
16064 except when in the parser, and in GlobalAttribute.
16065 * driver.cs (MainDriver): Reset RootContext.Tree.Types.NamespaceEntry.
16066 * attribute.cs (GlobalAttribute.CheckAttributeType): Reset
16067 RootContext.Tree.Types.NamespaceEntry once work is done.
16068 (GlobalAttribute.Emit): New. Wrapper for Attribute.Emit, but sets
16069 and resets RootContext.Tree.Types.NamespaceEntry.
16071 2004-12-15 Marek Safar <marek.safar@seznam.cz>
16073 * cs-parser.jay: Don't create a block for every variable.
16075 2004-12-14 Miguel de Icaza <miguel@ximian.com>
16077 * location.cs: Provide extra information.
16079 * statement.cs: The instance is not `ldarg_0.THIS' when accessing
16080 variables from the captured environment, it is the ldarg_0.
16082 2004-12-14 Marek Safar <marek.safar@seznam.cz>
16084 * cs-parser.jay: Changed warning level for 642 to 4 until Miguel
16087 * class.cs: Changed warning level for 169 to avoid developer
16088 displeasure from warning flooding. It will be changed back when they
16089 fix most of current BCL warnings.
16091 * RootContext.cs: Pushed default WarningLevel to 3.
16093 * statement.cs: Removed unused variable.
16095 2004-12-14 Marek Safar <marek.safar@seznam.cz>
16097 * class.cs (TypeContainer.GetClassBases): Add error 1521 report.
16098 (TypeContainer.MethodModifiersValid): Refactored to use MemberCore.
16099 Add error 502 report.
16100 (StaticClass.DefineType): Add error 441 report.
16101 (Class.AllowedModifiersProp): New virtual property as temporary
16102 extension to AllowedModifiers.
16103 (Class.DefineType): Add error 418 report. Moved ModFlags check here
16104 to share implementation with StaticClass and don't call virtual
16107 * driver.cs (MainDriver): Add error 1558 test.
16109 * parameter.cs (Parameter.ApplyAttributeBuilder): Add error 662
16110 report. Moved error 36 test here.
16112 * statement.cs (Throw.Resolve): Add error 724 report.
16114 * typemanager.cs: Add out_attribute_type core type.
16116 2004-12-13 Marek Safar <marek.safar@seznam.cz>
16118 * class.cs (TypeContainer.VerifyClsCompliance): Add error
16120 (PropertyBase.VerifyClsCompliance): Add errror 3025 report.
16122 * codegen.cs (ModuleClass.ApplyAttributeBuilder): Add error
16125 * decl.cs (MemberCore.VerifyClsCompliance): Add warning 3021.
16127 * parameter.cs (ReturnParameter.ApplyAttributeBuilder):
16128 Add error 3023 report.
16129 (Parameter.ApplyAttributeBuilder): Add error 3022 report.
16131 * tree.cs (RootTypes.IsClsCompliaceRequired): Add fake
16134 2004-12-12 John Luke <john.luke@gmail.com>
16136 * driver.cs (AddArgs): take -- into account when
16137 adding arguments, fixes bug 65710
16139 2004-12-12 Martin Baulig <martin@ximian.com>
16141 * expression.cs (Unary.TryReduceNegative): Added support for
16142 SByteConstant and ByteConstant.
16143 (Unary.Reduce): Check error values from TryReduceNegative().
16145 2004-12-10 Marek Safar <marek.safar@seznam.cz>
16147 * attributes.cs (Attribute.Resolve): Avoid multiple error report
16148 and report exception as error 182.
16150 2004-12-10 Raja R Harinath <rharinath@novell.com>
16152 * driver.cs (Main): Fix message when there are warnings.
16154 2004-12-09 Miguel de Icaza <miguel@ximian.com>
16156 * delegate.cs: Fixed my fix from yesterday, sorry about that.
16158 2004-12-09 Marek Safar <marek.safar@seznam.cz>
16160 * anonymous.cs, class.cs, convert.cs, doc.cs, support.cs:
16161 Reduced number of warnings.
16163 * class.cs (TypeContainer.VerifyClsCompliance): One if is enough.
16165 2004-12-08 Miguel de Icaza <miguel@ximian.com>
16167 * driver.cs: Removed message.
16169 * delegate.cs: Fix bug introduced in 1.1.x: 70219.
16171 2004-12-08 <vargaz@freemail.hu>
16173 * cs-tokenizer.cs: Add workaround for NET 2.0 beta 1 csc bug.
16175 2004-12-08 Martin Baulig <martin@ximian.com>
16177 * class.cs (TypeContainer.VerifyClsCompliance): Report a CS3003
16178 instead of a CS3002 for properties and indexer.
16180 2004-12-08 Martin Baulig <martin@ximian.com>
16182 * decl.cs (MemberName.ToString): Make this work again.
16184 2004-12-08 Marek Safar <marek.safar@seznam.cz>
16186 * attribute.cs (Resolve): Add error 591 detection.
16188 * class.cs (FieldMember.Define): Add error 1547 detection.
16189 (Indexer.Define): Add error 620 detection.
16190 (Operator.Define): Add error 590 detection.
16192 * ecore.cs: Missing argument for error 79.
16194 * expression.cs (ComposedCast.DoResolveAsTypeStep): Add error 611
16197 2004-12-07 Marek Safar <marek.safar@seznam.cz>
16200 * assign.cs.cs (Assign.DoResolve): Reports error 1648 for value types
16203 2004-12-07 Atsushi Enomoto <atsushi@ximian.com>
16205 * cs-parser.jay : handle doc comments on implicit/explicit operators.
16206 Some operator comments were suppressed.
16207 * doc.cs : Implicit/explicit operator name in doc comments are like
16208 "op_Explicit(type)~returnType", so added suffix handling.
16210 2004-12-07 Martin Baulig <martin@ximian.com>
16213 (MemberCore.GetObsoleteAttribute): Don't create a new EmitContext.
16214 (MemberCore.GetClsCompliantAttributeValue): Likewise.
16215 (DeclSpace.ec): New protected field; store the EmitContext here.
16216 (DeclSpace.EmitContext): New public property; moved here from
16218 (DeclSpace.GetClsCompliantAttributeValue): Don't create a new
16221 * enum.cs (Enum.Define): Store the EmitContext in the `ec' field.
16222 (Enum.Emit): Don't create a new EmitContext.
16224 * delegate.cs (Delegate.DefineType): Always create the
16227 * iterators.cs (Iterators.DefineIterator): Create a new
16228 EmitContext and store it in `ec'.
16230 2004-08-24 Martin Baulig <martin@ximian.com>
16233 (TypeManager.IsSubclassOf): Renamed to IsFamilyAccessible; use
16234 this for accessibility checks.
16235 (TypeManager.IsSubclassOrNestedChildOf): Renamed to
16236 IsNestedFamilyAccessible.
16237 (TypeManager.IsSubclassOf): New method, do what the name actually
16240 2004-12-06 Raja R Harinath <rharinath@novell.com>
16242 Fix crash on cs0657-17.cs.
16243 * codegen.cs (CommonAssemblyModulClass.GetClsCompliantAttribute):
16244 Use RootContext.Tree.Types, not 'new RootTypes ()'.
16245 * attribute.cs (GlobalAttribute.CheckAttributeType): Narrow down
16246 the case where the NamespaceEntry gets overwritten.
16248 2004-12-06 Marek Safar <marek.safar@seznam.cz>
16250 Fixed #69195, #56821
16251 * ecore.cs (ResolveBoolean): Tiny refactoring.
16253 * expression.cs (Binary.DoResolve): Add warning 429 and skipping
16254 of right expression resolving when left is false constant and
16255 operator is LogicalAnd OR true constant and operator is LogicalOr.
16257 * statement.cs (ResolveUnreachable): Always reports warning.
16259 2004-12-05 Miguel de Icaza <miguel@ximian.com>
16261 * class.cs: Distinguish between 1721 and 1722 (just a little help
16262 for the programmer).
16264 2004-12-03 Miguel de Icaza <miguel@ximian.com>
16266 * delegate.cs: Only allow this on new versions of the language.
16268 2004-12-02 Duncan Mak <duncan@ximian.com>
16270 * ecore.cs (PropertyExpr.IsAccessorAccessible): Moved to
16272 (Expression.IsAccessorAccessible): Moved from the PropertyExpr to
16273 here as a static method. Take an additional bool out parameter
16274 `must_do_cs1540_check' for signaling to InstanceResolve.
16275 (PropertyExpr.InstanceResolve): Removed the `must_do_cs1540_check'
16276 member field from PropertyExpr class and made it an argument of
16277 the method instead.
16278 (EventExpr.InstanceResolve): Copied from PropertyExpr, removed the
16279 check for MarshalByRefObject, and report CS0122 instead of CS1540.
16280 (EventExpr.DoResolve): Call IsAccessorAccessible on `add_accessor'
16281 and `remove_accessor' as well as InstanceResolve: report CS0122
16286 2004-12-03 Raja R Harinath <rharinath@novell.com>
16288 Fix test-327.cs, test-328.cs, and put in early infrastructure
16289 for eventually fixing #52697.
16290 * namespace.cs (NamespaceEntry.LookupForUsing): New method.
16291 (NamespaceEntry.LookupNamespaceOrType): New method, refactored
16292 from other methods.
16293 (NamespaceEntry.Lookup): Remove 'ignore_using' flag.
16294 (AliasEntry.Resolve, UsingEntry.Resolve): Use 'LookupForUsing'.
16295 (VerifyUsing, error246): Update.
16296 * rootcontext.cs (RootContext.NamespaceLookup): Just use
16297 'NamespaceEntry.LookupNamespaceOrType'.
16299 2004-12-03 Martin Baulig <martin@ximian.com>
16301 * delegate.cs (NewDelegate.DoResolve): If we have an anonymous
16302 method as our child, call AnonymousMethod.Compatible() on it.
16304 2004-12-03 Raja R Harinath <rharinath@novell.com>
16306 Disable XML documentation support in 'basic' profile.
16307 * decl.cs, class.cs [BOOTSTRAP_WITH_OLDLIB]: Don't import System.Xml.
16308 Redirect XmlElement to System.Object.
16309 * driver.cs, enum.cs, rootcontext.cs: Don't reference System.Xml.
16310 * doc.cs [BOOTSTRAP_WITH_OLDLIB]: Disable compile.
16311 * mcs.exe.sources: Add doc-bootstrap.cs.
16312 * doc-bootstrap.cs: New file. Contains empty stub implementation
16315 2004-12-03 Atsushi Enomoto <atsushi@ximian.com>
16317 * cs-tokenizer.cs : Only '////' is rejected. Other non-whitespace
16318 comments are allowed.
16320 2004-12-03 Carlos Alberto Cortez <calberto.cortez@gmail.com>
16322 * delegate.cs: Add checks for subtypes in paramaters and return values
16323 in VerifyMethod () to add support for Covariance/Contravariance
16326 2004-12-02 Miguel de Icaza <miguel@ximian.com>
16328 * report.cs: Remove extra closing parenthesis.
16330 * convert.cs (Error_CannotImplicitConversion): If the name of the
16331 types are the same, provide some extra information.
16333 * class.cs (FieldBase): Use an unused bit field from the field to
16334 encode the `has_offset' property from the FieldMember. This saves
16335 a couple of Ks on bootstrap compilation.
16337 * delegate.cs (NewDelegate.DoResolve): If we have an anonymous
16338 method as our child, return the AnonymousMethod resolved
16341 * expression.cs (New.DoResolve): Allow return values from
16342 NewDelegate to also include AnonymousMethods.
16346 2004-12-02 Marek Safar <marek.safar@seznam.cz>
16349 * attribute.cs (Resolve): Improved implementation of params
16350 attribute arguments.
16352 * support.cs (ParameterData): Add HasParams to be faster.
16354 2004-12-02 Atsushi Enomoto <atsushi@ximian.com>
16356 all things are for /doc support:
16358 * doc.cs: new file that supports XML documentation generation.
16359 * mcs.exe.sources: added doc.cs.
16361 Handle /doc command line option.
16362 Report error 2006 instead of 5 for missing file name for /doc.
16363 Generate XML documentation when required, after type resolution.
16365 Added support for picking up documentation (/// and /** ... */),
16366 including a new XmlCommentState enumeration.
16368 Added lines to fill Documentation element for field, constant,
16369 property, indexer, method, constructor, destructor, operator, event
16370 and class, struct, interface, delegate, enum.
16371 Added lines to warn incorrect comment.
16373 Added Documentation field (passed only when /doc was specified).
16375 Added DocComment, DocCommentHeader, GenerateDocComment() and
16376 OnGenerateDocComment() and some supporting private members for
16377 /doc feature to MemberCore.
16379 Added GenerateDocComment() on TypeContainer, MethodCore and Operator.
16381 Added overriden DocCommentHeader.
16383 Added overriden DocCommentHeader and GenerateDocComment().
16385 2004-12-01 Miguel de Icaza <miguel@ximian.com>
16387 * cfold.cs (ConstantFold.DoConstantNumericPromotions): After
16388 unwrapping the enumeration values, chain to
16389 DoConstantNumericPromotions again, so we can promote things to the
16390 fundamental types (takes care of enums that are bytes, sbytes).
16394 2004-12-01 Raja R Harinath <rharinath@novell.com>
16396 * attribute.cs (Attribute.CheckAttributeType): Remove complain flag.
16397 Fix long-standing bug in type-lookup. Use FindType instead of
16398 LookupType when ec.ResolvingTypeTree.
16399 (Attribute.ResolveType, Attribute.Resolve)
16400 (Attribute.DefinePInvokeMethod,GlobalAttribute.CheckAttributeType):
16402 (Attributes.Search): Remove internal version. Update.
16403 (Attributes.SearchMulti): Update.
16404 (Attributes.GetClsCompliantAttribute): Remove.
16405 (Attributes.GetIndexerNameAttribute): Remove.
16406 * decl.cs (MemberCore.GetClsCompliantAttributeValue): Update to changes.
16407 (DeclSpace.GetClsCompliantAttributeValue): Likewise.
16408 * class.cs (Indexer.Define): Likewise.
16410 2004-12-01 Marek Safar <marek.safar@seznam.cz>
16413 * ecore.cs: CheckMarshallByRefAccess new virtual method for testing
16414 MarshallByReference members access.
16416 * expression.cs: Use CheckMarshallByRefAccess;
16417 Better error CS0197 message.
16419 * report.cs: Print whole related error message.
16421 2004-11-30 Raja R Harinath <rharinath@novell.com>
16423 * Makefile (mcs.exe) [PROFILE=default]: Keep a copy of mcs.exe in
16424 the current directory to help debugging.
16426 2004-11-29 Marek Safar <marek.safar@seznam.cz>
16428 * class (GetClassBases): Better error 60 report.
16429 (EventProperty): Disabled warning 67 detection.
16431 2004-11-29 Marek Safar <marek.safar@seznam.cz>
16434 * cfold.cs (Assign.DoResolve): Add subtraction for DecimalConstant.
16436 * constant.cs (DecimalConstant.Emit): Don't use int ctor for
16439 2004-11-29 Marek Safar <marek.safar@seznam.cz>
16442 * assign.cs (Assign.DoResolve): Add error 1648, 1650 report.
16444 * decl.cs (MemberCore.MemberName): Error 1648 in compiler.
16446 2004-11-26 Miguel de Icaza <miguel@ximian.com>
16448 * attribute.cs (Attribute.Resolve): Refine error reporting and
16449 report a cs0117 if the identifier does not exist, to distinguish
16450 from 0617 which is a miss-use of the actual identifier.
16452 * ecore.cs (EventExpr.Emit): Refine error report and distinguish
16453 between cs0070 and cs0079.
16455 * class.cs (MemberBase.DoDefine): When reporting a wrong
16456 accessibility level, we use MethodCore to compare instead of
16457 Method (this was a regression in some refactoring effort).
16459 So now we correctly report cs0056 again.
16461 * convert.cs (ImplicitReferenceConversion): Corrected typo, I was
16462 testing the target_type (which was known to be object_type) and
16463 not the source type (which is anonymous_method).
16465 Fixed reporting of error cs1660.
16467 * expression.cs (UserCast.Source): Expose the underlying cast.
16469 * statement.cs (Switch.SwitchGoverningType): Sort the list of
16470 allowed types to find a match to int32 first (most common).
16472 In addition, it ignores any ImplicitUserConversions that did an
16473 internal implicit conversion (as the switch statement allows only
16474 one integral conversion to exist).
16476 * class.cs (PartialContainer.Create): rename `name' to
16477 `member_name' for clarity. Then replace the string calls with a
16478 call to MemberName.GetPartialName, as now using
16479 MemberName.ToString is an error (this is due to the side effects
16480 it had, that were fixed in the past).
16482 This will restore the error reporting on a number of partial class
16483 errors that were missusing this (and getting an exception as a
16484 results, which is now just a plain textual warning, because
16485 yyparse debug output would crash otherwise).
16487 2004-11-26 Raja R Harinath <rharinath@novell.com>
16489 * Makefile (PROGRAM_INSTALL_DIR): Remove.
16491 2004-11-25 Ben Maurer <bmaurer@ximian.com>
16493 * rootcontext.cs (LookupType): Make sure to cache lookups that
16494 don't give us a negative result. This saves about 5% of corlib
16497 2004-11-25 Miguel de Icaza <miguel@ximian.com>
16499 * report.cs (AbstractMessage.Print): messages are sent to stderr
16501 * class.cs (TypeContainer.GetClassBases): It is an error to have a
16502 non-interface in the list of interfaces (at this point, either
16503 parent was properly set, or a base class is being listed in the
16504 interfaces section).
16506 This flags error 1722, and resolves the crash from bug 69259.
16508 2004-11-25 Ben Maurer <bmaurer@ximian.com>
16510 * statement.cs (Using.EmitExpressionFinally): make this work right
16511 for valuetypes. Fixes 69926.
16513 2004-11-25 Miguel de Icaza <miguel@ximian.com>
16515 * const.cs (Const.ChangeType): Cope with the "0 literal can be
16516 converted to an enum" here, before we try to change the underlying
16517 type. This code exists, but it is a different code path than the
16518 one used while encoding constants.
16520 * convert.cs (ImplicitReferenceConversionExists): A surprisingly
16521 old bug: when converting from the null literal to a pointer,
16522 return an EmptyCast, not the NullLiteral.
16524 This fixes #69921, the recent null_type changes probably made this
16525 bug more prominent.
16527 (ImplicitReferenceConversionExists): In addition, resynchronized
16528 the code here, so it matches the same code in
16529 ImplicitReferenceConversionExists for the `from any class-type S
16530 to any interface-type T'.
16533 2004-11-25 Marek Safar <marek.safar@seznam.cz>
16535 * cfold.cs (BinaryFold): Add addition for DecimalConstant.
16537 2004-11-24 Miguel de Icaza <miguel@ximian.com>
16539 * cs-parser.jay: Use verbosity accordingly.
16541 2004-11-24 Marek Safar <marek.safar@seznam.cz>
16543 * expression.cs (Unary.ResolveOperator): Do not report warning;
16544 AddressOf reads from variable.
16546 (LocalVariableReferences.DoResolveBase): Improved my previous fix.
16548 2004-11-24 Marek Safar <marek.safar@seznam.cz>
16552 * attribute.cs (Attributable): Removed CheckTargets.
16553 (Attributes.Emit): Explicit attribute targets are tested here.
16555 * class.cs (EventField.ValidAttributeTargets): Explicit target "field" is
16556 not enabled for interfaces.
16558 * codegen.cs (CommonAssemblyModulClass.AddAttributes): Removed CheckTargets.
16559 (GetAssemblyName): Ouch next bug there.
16561 2004-11-23 Carlos Alberto Cortez <calberto.cortez@gmail.com>
16563 * expression.cs: Error 275 added.
16565 2004-11-23 Marek Safar <marek.safar@seznam.cz>
16567 Fix bug #69177 (Implemented decimal constant support)
16569 * cfold.cs (DoConstantNumericPromotions: Add DecimalConstant.
16570 (BinaryFold): Add DecimalConstant.
16572 * const.cs (Define): Decimal constant
16574 (ChangeType): Add decimal type handling.
16575 (LookupConstantValue): Don't set value for decimal type but
16576 emit DecimalConstantAttribute. Needed for constant optimization.
16578 * constant.cs (ToDecimal): New method.
16579 (ConvertToDecimal): New method.
16580 (IntConstant): Implemented ConvertToDecimal.
16581 (DecimalConstant.Emit): Emit optimized version for decimals in
16584 * expression.cs (ResolveOperator): Changed order of constant
16585 reduction to work correctly with native types which have
16586 overloaded operators.
16587 (ResolveMemberAccess): Extract constant value from attribute
16590 * rootcontext.cs (ResolveCore): Add DecimalConstantAttribute.
16592 * typemanager.cs (TypeManager): Add decimal_constant_attribute_type,
16593 void_decimal_ctor_int_arg, decimal_constant_attribute_ctor.
16594 (ChangeType): Decimal is special.
16595 (TypeToCoreType): Add decimal type.
16597 2004-11-22 Marek Safar <marek.safar@seznam.cz>
16599 * convert.cs (ImplicitConversionRequired): Add error cs0642 for
16602 2004-11-22 Marek Safar <marek.safar@seznam.cz>
16604 * class.cs (EventField.ApplyAttributeBuilder): Fix error
16607 2004-11-19 Marek Safar <marek.safar@seznam.cz>
16609 * class.cs (MemberBase.DoDefine): Fix error cs0508 report.
16611 * pending.cs (PendingImplementation): Grab only interfaces.
16613 2004-11-19 Marek Safar <marek.safar@seznam.cz>
16615 * statement.cs (ForeachHelperMethods): Add location member and
16616 error 202 detection.
16618 2004-11-19 Raja R Harinath <rharinath@novell.com>
16620 * Makefile (EXTRA_DISTFILES): Remove mcs.exe.config. It's
16621 automatically handled by executable.make.
16622 (PROGRAM): Make profile-specific.
16624 2004-11-18 Marek Safar <marek.safar@seznam.cz>
16626 * expression.cs (DoResolveBase): Fixed wrong warning for out
16629 2004-11-18 Martin Baulig <martin@ximian.com>
16631 Merged latest changes into gmcs. Please keep this comment in
16632 here, it makes it easier for me to see what changed in MCS since
16633 the last time I merged.
16635 2004-11-17 Raja R Harinath <rharinath@novell.com>
16637 * typemanager.cs (TypeHandle.GetTypeHandle): Make private.
16638 (TypeHandle.GetMemberCache): New.
16639 (TypeHandle.TypeHandle): Update.
16640 (TypeManager.LookupMemberCache): Rewritten from LookupMemberContainer.
16641 (TypeManager.LookupParentInterfacesCache):
16642 Rename from LookupInterfaceCache. Optimize slightly.
16643 (TypeManager.MemberLookup_FindMembers): Update.
16644 * decl.cs (MemberCache.MemberCache): Set Container to null in the
16645 multi-type variant.
16646 (AddCacheContents): Rename from AddHashtable.
16647 * class.cs (TypeContainer.parent_container): Remove.
16648 (TypeContainer.VerifyClsCompliance): Don't use parent_container.
16649 (TypeContainer.DoDefineMembers): Don't initialize it.
16650 Update to name changes.
16652 2004-11-17 Miguel de Icaza <miguel@ximian.com>
16654 * class.cs (MethodCore.CheckAccessModifiers): New helper routine
16655 that factors the code to check access modifiers on override.
16657 (PropertyBase): Use the code here.
16659 Patch from Lluis S'anchez, fixes bug #69361.
16661 2004-11-15 Miguel de Icaza <miguel@ximian.com>
16663 * anonymous.cs (AnonymousMethod.Error_AddressOfCapturedVar): New
16664 routine that is used to report the use of a captured variable
16665 whose address has been taken.
16667 There are two checks: one when variables are being captured and
16668 the other check is when the address of a variable is taken.
16670 (because an anonymous methods might be resolved before *or* after
16671 the address has been taken) and
16673 * expression.cs (Conditional.DoResolve): Remove the special
16674 casing that Martin added to trueExpr and falseExpr being both
16675 NullLiteral. We get the right behavior now just by introducing
16676 the null_type into the compiler.
16678 * convert.cs (ExplicitConversion): Change the code to use
16679 null_type instead of testing `expr is NullLiteral'.
16680 (ImplicitConversionStandard): use null_type too.
16681 (ImplicitReferenceConversionExists): use null_type too.
16682 (ImplicitReferenceConversion): use null_type too.
16684 * literal.cs: The type of `NullLiteral' is now null_type instead
16686 (Resolve): Set the type here.
16688 * typemanager.cs: Introduce null_type.
16690 2004-11-17 Martin Baulig <martin@ximian.com>
16692 * decl.cs (MemberCache.AddHashtable): Add entries in the opposite
16693 direction, like FindMembers() does. Fixes #69546, testcase is in
16696 2004-11-16 Martin Baulig <martin@ximian.com>
16698 This is based on a patch from Marek Safar, see bug #69082.
16699 Fixes bugs #63705 and #67130.
16701 * typemanager.cs (TypeManager.LookupInterfaceCache): New public
16702 method; create a MemberCache for an interface type and cache the
16705 * decl.cs (IMemberContainer.ParentContainer): Removed.
16706 (IMemberContainer.ParentCache): New property.
16707 (MemberCache.SetupCacheForInterface): Removed.
16708 (MemberCache..ctor): Added .ctor which takes a `Type[]'; use this
16709 to create a cache for an interface's "parent".
16711 * class.cs (TypeContainer.DoDefineMembers): Setup cache for
16714 2004-11-16 Martin Baulig <martin@ximian.com>
16716 Merged back from gmcs; these changes already went into gmcs a
16717 couple of weeks ago.
16720 (TypeManager.AddUserType): Removed the `ifaces' argument.
16721 (TypeManager.RegisterBuilder): Take a `Type []' instead of a
16723 (TypeManager.AddUserInterface): Removed.
16724 (TypeManager.ExpandInterfaces): Return a `Type []' instead of a
16726 (TypeManager.GetInterfaces): Likewise.
16727 (TypeManager.GetExplicitInterfaces): Likewise.
16729 * ecore.cs (TypeExpr.GetInterfaces): Removed.
16731 * class.cs (TypeContainer.base_class_type): Replaced with `ptype'.
16732 (TypeContainer.base_inteface_types): Replaced with `ifaces'.
16734 2004-11-14 Ben Maurer <bmaurer@ximian.com>
16736 * statement.cs: Avoid adding bools to a hashtable.
16738 2004-11-07 Miguel de Icaza <miguel@ximian.com>
16740 * expression.cs (Invocation.OverloadResolve): Flag error if we are
16741 calling an unsafe method from a safe location.
16743 2004-11-06 Marek Safar <marek.safar@seznam.cz>
16746 * codegen.cs (ApplyAttributeBuilder): Do not return; it is only warning.
16748 2004-11-06 Miguel de Icaza <miguel@ximian.com>
16750 * namespace.cs (VerifyUsing): use GetPartialName instead of
16753 2004-11-05 Miguel de Icaza <miguel@ximian.com>
16755 * statement.cs (Return.Resolve): Fix regression in typo: if
16756 `in_exc', we have to request a NeedReturnLabel, this was a typo
16757 introduced in the anonymous method check-in. Fixes #69131.
16759 * Indexers were using the ShortName when defining themselves,
16760 causing a regression in the compiler bootstrap when applying the
16761 patch from 2004-11-02 (first part), now they use their full name
16762 and the bug is gone.
16764 2004-11-04 Zoltan Varga <vargaz@freemail.hu>
16766 * driver.cs: Strip the path from the names of embedded resources. Fixes
16769 2004-11-04 Raja R Harinath <rharinath@novell.com>
16771 Fix error message regression: cs0104-2.cs.
16772 * namespace.cs (NamespaceEntry.Lookup): Remove 'silent' flag.
16773 (AliasEntry.Resolve): Update.
16774 * rootcontext.cs (RootContext.NamespaceLookup): Update. Remove
16776 (RootContext.LookupType): Update.
16778 2004-11-03 Carlos Alberto Cortez <carlos@unixmexico.org>
16780 * cs-parser.jay: Add support for handling accessor modifiers
16781 * class: Add support port accessor modifiers and error checking,
16782 define PropertyMethod.Define as virtual (not abstract anymore)
16783 * ecore.cs: Add checking for proeprties access with access modifiers
16784 * iterators.cs: Modify Accessor constructor call based in the modified
16786 2004-11-02 Ben Maurer <bmaurer@ximian.com>
16788 * expression.cs (StringConcat): Handle being called twice,
16789 as when we have a concat in a field init with more than two
16792 2004-11-02 Miguel de Icaza <miguel@ximian.com>
16794 * class.cs (Event.Define, Indexer.Define, Property.Define): Do not
16795 special case explicit implementations, we should always produce
16796 the .property or .event declaration.
16798 * decl.cs (MemberName): Renamed GetFullName to GetPartialName
16799 since it will not return correct data if people use this
16800 unresolved in the presence of using statements (see test-313).
16802 * class.cs (MethodData.Define): If we are an explicit interface
16803 implementation, set the method name to the full name of the
16804 interface plus the name of the method.
16806 Notice that using the method.MethodName.GetFullName() does not
16807 work, as it will only contain the name as declared on the source
16808 file (it can be a shorthand in the presence of using statements)
16809 and not the fully qualifed type name, for example:
16813 class D : ICloneable {
16814 object ICloneable.Clone () {
16818 Would produce a method called `ICloneable.Clone' instead of
16819 `System.ICloneable.Clone'.
16821 * namespace.cs (Alias.Resolve): Use GetPartialName.
16823 2004-11-01 Marek Safar <marek.safar@seznam.cz>
16825 * cs-parser.jay: Add error 1055 report.
16827 2004-11-01 Miguel de Icaza <miguel@ximian.com>
16829 * assign.cs (Assign.DoResolve): Only do the transform of
16830 assignment into a New if the types are compatible, if not, fall
16831 through and let the implicit code deal with the errors and with
16832 the necessary conversions.
16834 2004-11-01 Marek Safar <marek.safar@seznam.cz>
16836 * cs-parser.jay: Add error 1031 report.
16838 * cs-tokenizer.cs: Add location for error 1038.
16840 2004-10-31 Marek Safar <marek.safar@seznam.cz>
16842 * cs-parser.jay: Add error 1016 report.
16844 2004-10-31 Marek Safar <marek.safar@seznam.cz>
16846 * cs-parser.jay: Add errors 1575,1611 report.
16848 2004-10-31 Marek Safar <marek.safar@seznam.cz>
16850 * cs-parser.jay: Add error 1001 report.
16852 2004-10-31 Marek Safar <marek.safar@seznam.cz>
16855 * attribute.cs (GetMarshal): Add method argument for
16856 caller identification.
16858 * class.cs, codegen.cs, enum.cs, parameter.cs: Added
16859 agument for GetMarshal and RuntimeMissingSupport.
16861 2004-10-31 Marek Safar <marek.safar@seznam.cz>
16863 * attribute.cs (ExtractSecurityPermissionSet): Removed
16864 TypeManager.code_access_permission_type.
16866 * typemanager.cs: Removed TypeManager.code_access_permission_type.
16868 2004-10-27 Miguel de Icaza <miguel@ximian.com>
16870 * expression.cs (LocalVariableReference.DoResolveLValue): Check
16871 for obsolete use of a variable here. Fixes regression on errors
16872 cs0619-25 and cs0619-26.
16874 2004-10-27 Marek Safar <marek.safar@seznam.cz>
16876 Fix #62358, implemented security attribute encoding.
16878 * attribute.cs (Attribute.CheckSecurityActionValididy): New method.
16879 Tests permitted SecurityAction for assembly or other types.
16880 (Assembly.ExtractSecurityPermissionSet): New method. Transforms
16881 data from SecurityPermissionAttribute to PermisionSet class.
16883 * class.cs (ApplyAttributeBuilder): Added special handling
16884 for System.Security.Permissions.SecurityAttribute based types.
16886 * codegen.cs (AssemblyClass.ApplyAttributeBuilder): Added
16887 special handling for System.Security.Permissions.SecurityAttribute
16890 * enum.cs (ApplyAttributeBuilder): Added special handling
16891 for System.Security.Permissions.SecurityAttribute based types.
16893 * parameter.cs (ApplyAttributeBuilder): Added special handling
16894 for System.Security.Permissions.SecurityAttribute based types.
16896 * rootcontext.cs: Next 2 core types.
16898 * typemanager.cs (TypeManager.security_permission_attr_type):
16899 Built in type for the SecurityPermission Attribute.
16900 (code_access_permission_type): Build in type.
16902 2004-10-17 Miguel de Icaza <miguel@ximian.com>
16904 * expression.cs (LocalVariableReference.DoResolveBase, Emit):
16905 Remove the tests for `ec.RemapToProxy' from here, and encapsulate
16906 all of this information into
16907 EmitContext.EmitCapturedVariableInstance.
16909 * codegen.cs (EmitCapturedVariableInstance): move here the
16910 funcionality of emitting an ldarg.0 in the presence of a
16911 remapping. This centralizes the instance emit code.
16913 (EmitContext.EmitThis): If the ScopeInfo contains a THIS field,
16914 then emit a load of this: it means that we have reached the
16915 topmost ScopeInfo: the one that contains the pointer to the
16916 instance of the class hosting the anonymous method.
16918 * anonymous.cs (AddField, HaveCapturedFields): Propagate field
16919 captures to the topmost CaptureContext.
16921 2004-10-12 Miguel de Icaza <miguel@ximian.com>
16923 * expression.cs (LocalVariableReference): Move the knowledge about
16924 the iterators into codegen's EmitCapturedVariableInstance.
16926 2004-10-11 Miguel de Icaza <miguel@ximian.com>
16928 * codegen.cs (EmitContext.ResolveTopBlock): Emit a 1643 when not
16929 all code paths return a value from an anonymous method (it is the
16930 same as the 161 error, but for anonymous methods).
16932 2004-10-08 Miguel de Icaza <miguel@ximian.com>
16934 The introduction of anonymous methods in the compiler changed
16935 various ways of doing things in the compiler. The most
16936 significant one is the hard split between the resolution phase
16937 and the emission phases of the compiler.
16939 For instance, routines that referenced local variables no
16940 longer can safely create temporary variables during the
16941 resolution phase: they must do so from the emission phase,
16942 since the variable might have been "captured", hence access to
16943 it can not be done with the local-variable operations from the runtime.
16947 (Block.Flags): New flag `IsTopLevel' to indicate that this block
16948 is a toplevel block.
16950 (ToplevelBlock): A new kind of Block, these are the blocks that
16951 are created by the parser for all toplevel method bodies. These
16952 include methods, accessors and anonymous methods.
16954 These contain some extra information not found in regular blocks:
16955 A pointer to an optional CaptureContext (for tracking captured
16956 local variables and parameters). A pointer to the parent
16959 (Return.Resolve): Catch missmatches when returning a value from an
16960 anonymous method (error 1662).
16961 Invoke NeedReturnLabel from the Resolve phase instead of the emit
16964 (Break.Resolve): ditto.
16966 (SwitchLabel): instead of defining the labels during the
16967 resolution phase, we now turned the public ILLabel and ILLabelCode
16968 labels into methods called GetILLabelCode() and GetILLabel() that
16969 only define the label during the Emit phase.
16971 (GotoCase): Track the SwitchLabel instead of the computed label
16972 (its contained therein). Emit the code by using
16973 SwitchLabel.GetILLabelCode ().
16975 (LocalInfo.Flags.Captured): A new flag has been introduce to track
16976 whether the Local has been captured or not.
16978 (LocalInfo.IsCaptured): New property, used to tell whether the
16979 local has been captured.
16981 * anonymous.cs: Vastly updated to contain the anonymous method
16984 The main classes here are: CaptureContext which tracks any
16985 captured information for a toplevel block and ScopeInfo used to
16986 track the activation frames for various local variables.
16988 Each toplevel block has an optional capture context associated
16989 with it. When a method contains an anonymous method both the
16990 toplevel method and the anonymous method will create a capture
16991 context. When variables or parameters are captured, they are
16992 recorded on the CaptureContext that owns them, for example:
16996 MyDelegate d = delegate {
17001 Here `a' will be recorded as captured on the toplevel
17002 CapturedContext, the inner captured context will not have anything
17003 (it will only have data if local variables or parameters from it
17004 are captured in a nested anonymous method.
17006 The ScopeInfo is used to track the activation frames for local
17007 variables, for example:
17009 for (int i = 0; i < 10; i++)
17010 for (int j = 0; j < 10; j++){
17011 MyDelegate d = delegate {
17016 At runtime this captures a single captured variable `i', but it
17017 captures 10 different versions of the variable `j'. The variable
17018 `i' will be recorded on the toplevel ScopeInfo, while `j' will be
17019 recorded on a child.
17021 The toplevel ScopeInfo will also track information like the `this'
17022 pointer if instance variables were referenced (this is necessary
17023 as the anonymous method lives inside a nested class in the host
17024 type of the method).
17026 (AnonymousMethod): Expanded to track the Toplevel, implement
17027 `AnonymousMethod.Compatible' to tell whether an anonymous method
17028 can be converted to a target delegate type.
17030 The routine now also produces the anonymous method content
17032 (AnonymousDelegate): A helper class that derives from
17033 DelegateCreation, this is used to generate the code necessary to
17034 produce the delegate for the anonymous method that was created.
17036 * assign.cs: API adjustments for new changes in
17037 Convert.ImplicitStandardConversionExists.
17039 * class.cs: Adjustments to cope with the fact that now toplevel
17040 blocks are of type `ToplevelBlock'.
17042 * cs-parser.jay: Now we produce ToplevelBlocks for toplevel blocks
17043 insteda of standard blocks.
17045 Flag errors if params arguments are passed to anonymous methods.
17047 * codegen.cs (EmitContext): Replace `InAnonymousMethod' with
17048 `CurrentAnonymousMethod' which points to the current Anonymous
17049 Method. The variable points to the AnonymousMethod class that
17050 holds the code being compiled. It is set in the new EmitContext
17051 created for the anonymous method.
17053 (EmitContext.Phase): Introduce a variable and an enumeration to
17054 assist in enforcing some rules about when and where we are allowed
17055 to invoke certain methods (EmitContext.NeedsReturnLabel is the
17056 only one that enfonces this right now).
17058 (EmitContext.HaveCaptureInfo): new helper method that returns
17059 whether we have a CapturedContext initialized.
17061 (EmitContext.CaptureVariable): New method used to register that a
17062 LocalInfo must be flagged for capturing.
17064 (EmitContext.CapturedParameter): New method used to register that a
17065 parameters must be flagged for capturing.
17067 (EmitContext.CapturedField): New method used to register that a
17068 field must be flagged for capturing.
17070 (EmitContext.HaveCapturedVariables,
17071 EmitContext.HaveCapturedFields): Return whether there are captured
17072 variables or fields.
17074 (EmitContext.EmitMethodHostInstance): This is used to emit the
17075 instance for the anonymous method. The instance might be null
17076 (static methods), this (for anonymous methods that capture nothing
17077 and happen to live side-by-side with the current method body) or a
17078 more complicated expression if the method has a CaptureContext.
17080 (EmitContext.EmitTopBlock): Routine that drives the emission of
17081 code: it will first resolve the top block, then emit any metadata
17082 and then emit the code. The split is done so that we can extract
17083 any anonymous methods and flag any captured variables/parameters.
17085 (EmitContext.ResolveTopBlock): Triggers the resolution phase,
17086 during this phase, the ILGenerator should not be used as labels
17087 and local variables declared here might not be accessible to any
17088 code that is part of an anonymous method.
17090 Exceptions to this include the temporary variables that are
17091 created by some statements internally for holding temporary
17094 (EmitContext.EmitMeta): New routine, in charge of emitting all the
17097 (EmitContext.TemporaryReturn): This method is typically called
17098 from the Emit phase, and its the only place where we allow the
17099 ReturnLabel to be defined other than the EmitMeta. The reason is
17100 that otherwise we would have to duplicate a lot of logic in the
17101 Resolve phases of various methods that today is on the Emit
17104 (EmitContext.NeedReturnLabel): This no longer creates the label,
17105 as the ILGenerator is not valid during the resolve phase.
17107 (EmitContext.EmitThis): Extended the knowledge in this class to
17108 work in anonymous methods in addition to iterators.
17110 (EmitContext.EmitCapturedVariableInstance): This emits whatever
17111 code is necessary on the stack to access the instance to a local
17112 variable (the variable will be accessed as a field).
17114 (EmitContext.EmitParameter, EmitContext.EmitAssignParameter,
17115 EmitContext.EmitAddressOfParameter): Routines to support
17116 parameters (not completed at this point).
17118 Removals: Removed RemapLocal and RemapLocalLValue. We probably
17119 will also remove the parameters.
17121 * convert.cs (Convert): Define a `ConstantEC' which points to a
17122 null. This is just to prefity some code that uses
17123 ImplicitStandardConversion code and do not have an EmitContext
17126 The idea is to flag explicitly that at that point in time, it is
17127 known that the conversion will not trigger the delegate checking
17128 code in implicit conversions (which requires a valid
17131 Everywhere: pass new EmitContext parameter since
17132 ImplicitStandardConversionExists now requires it to check for
17133 anonymous method conversions.
17135 (Convert.ImplicitStandardConversionExists): If the type of an
17136 expression is the anonymous_method_type, and the type is a
17137 delegate, we invoke the AnonymousMethod.Compatible method to check
17138 whether an implicit conversion is possible.
17140 (Convert.ImplicitConversionStandard): Only do implicit method
17141 group conversions if the language level is not ISO_1.
17143 * delegate.cs (Delegate.GetInvokeMethod): Common method to get the
17144 MethodInfo for the Invoke method. used by Delegate and
17147 * expression.cs (Binary.DoNumericPromotions): only allow anonymous
17148 method conversions if the target type is a delegate.
17150 Removed extra debugging nops.
17152 (LocalVariableReference): Turn the `local_info' into a public
17155 Add `prepared' field, the same hack used for FieldExprs to cope
17156 with composed assignments, as Local variables do not necessarily
17157 operate purely on the stack as they used to: they can be captured
17160 Add `temp' for a temporary result, like fields.
17162 Refactor DoResolve and DoResolveLValue into DoResolveBase.
17164 It now copes with Local variables that are captured and emits the
17165 proper instance variable to load it from a field in the captured
17168 (ParameterReference.DoResolveBase): During the resolve phase,
17169 capture parameters if we are in an anonymous method.
17171 (ParameterReference.Emit, ParameterReference.AddressOf): If in an
17172 anonymous method, use the EmitContext helper routines to emit the
17173 parameter reference.
17175 * iterators.cs: Set RemapToProxy to true/false during the
17178 * parameters.cs (GetParameterByName): New helper method.
17180 * typemanager.cs (anonymous_method_type) a new type that
17181 represents an anonyous method. This is always an internal type,
17182 used as a fencepost to test against the anonymous-methodness of an
17185 2004-10-20 Marek Safar <marek.safar@seznam.cz>
17187 * class.cs (MethodCore.CheckBase): Add errors 505, 533, 544,
17189 (PropertyBase.FindOutParentMethod): Add errors 545, 546 report.
17191 2004-10-18 Martin Baulig <martin@ximian.com>
17193 * statement.cs (Fixed.Resolve): Don't access the TypeExpr's
17194 `Type' directly, but call ResolveType() on it.
17195 (Catch.Resolve): Likewise.
17196 (Foreach.Resolve): Likewise.
17198 2004-10-18 Martin Baulig <martin@ximian.com>
17200 * expression.cs (Cast.DoResolve): Don't access the TypeExpr's
17201 `Type' directly, but call ResolveType() on it.
17202 (Probe.DoResolve): Likewise.
17203 (ArrayCreation.LookupType): Likewise.
17204 (TypeOf.DoResolve): Likewise.
17205 (SizeOf.DoResolve): Likewise.
17207 2004-10-18 Martin Baulig <martin@ximian.com>
17209 * expression.cs (Invocation.BetterFunction): Put back
17210 TypeManager.TypeToCoreType().
17212 2004-10-18 Raja R Harinath <rharinath@novell.com>
17214 * class.cs (FieldMember.DoDefine): Reset ec.InUnsafe after doing
17217 2004-10-18 Martin Baulig <martin@ximian.com>
17219 * parameter.cs (Parameter.Resolve): Don't access the TypeExpr's
17220 `Type' directly, but call ResolveType() on it.
17222 2004-10-18 Martin Baulig <martin@ximian.com>
17224 * class.cs (FieldMember.Define): Don't access the TypeExpr's
17225 `Type' directly, but call ResolveType() on it.
17226 (MemberBase.DoDefine): Likewise.
17228 * expression.cs (New.DoResolve): Don't access the TypeExpr's
17229 `Type' directly, but call ResolveType() on it.
17230 (ComposedCast.DoResolveAsTypeStep): Likewise.
17232 * statement.cs (LocalInfo.Resolve): Don't access the TypeExpr's
17233 `Type' directly, but call ResolveType() on it.
17235 2004-10-17 John Luke <john.luke@gmail.com>
17237 * class.cs (Operator.GetSignatureForError): use CSharpName
17239 * parameter.cs (Parameter.GetSignatureForError): Returns
17240 correct name even if was not defined.
17242 2004-10-13 Raja R Harinath <rharinath@novell.com>
17245 * class.cs (TypeContainer.EmitContext): New property.
17246 (DefineNestedTypes): Create an emitcontext for each part.
17247 (MethodCore.DoDefineParameters): Use container's emitcontext.
17248 Pass type array to InternalParameters.
17249 (MemberBase.DoDefine): Use container's emitcontext.
17250 (FieldMember.Define): Likewise.
17251 (Event.Define): Likewise.
17252 (SetMethod.GetParameterInfo): Change argument to EmitContext.
17253 Pass type array to InternalParameters.
17254 (SetIndexerMethod.GetParameterInfo): Likewise.
17255 (SetMethod.Define): Pass emitcontext to GetParameterInfo.
17256 * delegate.cs (Define): Pass emitcontext to
17257 ComputeAndDefineParameterTypes and GetParameterInfo. Pass type
17258 array to InternalParameters.
17259 * expression.cs (ParameterReference.DoResolveBase): Pass
17260 emitcontext to GetParameterInfo.
17261 (ComposedCast.DoResolveAsTypeStep): Remove check on
17262 ec.ResolvingTypeTree.
17263 * parameter.cs (Parameter.Resolve): Change argument to
17264 EmitContext. Use ResolveAsTypeTerminal.
17265 (Parameter.GetSignature): Change argument to EmitContext.
17266 (Parameters.ComputeSignature): Likewise.
17267 (Parameters.ComputeParameterTypes): Likewise.
17268 (Parameters.GetParameterInfo): Likewise.
17269 (Parameters.ComputeAndDefineParameterTypes): Likewise.
17270 Re-use ComputeParameterTypes. Set ec.ResolvingTypeTree.
17271 * support.cs (InternalParameters..ctor): Remove variant that takes
17273 * typemanager.cs (system_intptr_expr): New.
17274 (InitExpressionTypes): Initialize it.
17276 2004-10-12 Chris Toshok <toshok@ximian.com>
17278 * cs-parser.jay: fix location for try_statement and catch_clause.
17280 2004-10-11 Martin Baulig <martin@ximian.com>
17282 * report.cs: Don't make --fatal abort on warnings, we have
17283 -warnaserror for that.
17285 2004-10-07 Raja R Harinath <rharinath@novell.com>
17287 More DeclSpace.ResolveType avoidance.
17288 * decl.cs (MemberCore.InUnsafe): New property.
17289 * class.cs (MemberBase.DoDefine): Use ResolveAsTypeTerminal
17290 with newly created EmitContext.
17291 (FieldMember.Define): Likewise.
17292 * delegate.cs (Delegate.Define): Likewise.
17293 * ecore.cs (SimpleName.ResolveAsTypeStep): Lookup with alias
17294 only if normal name-lookup fails.
17295 (TypeExpr.DoResolve): Enable error-checking.
17296 * expression.cs (ArrayCreation.DoResolve): Use ResolveAsTypeTerminal.
17297 (SizeOf.DoResolve): Likewise.
17298 (ComposedCast.DoResolveAsTypeStep): Likewise.
17299 (StackAlloc.DoResolve): Likewise.
17300 * statement.cs (Block.Flags): Add new flag 'Unsafe'.
17301 (Block.Unsafe): New property.
17302 (Block.EmitMeta): Set ec.InUnsafe as appropriate.
17303 (Unsafe): Set 'unsafe' flag of contained block.
17304 (LocalInfo.Resolve): Use ResolveAsTypeTerminal.
17305 (Fixed.Resolve): Likewise.
17306 (Catch.Resolve): Likewise.
17307 (Using.ResolveLocalVariableDecls): Likewise.
17308 (Foreach.Resolve): Likewise.
17310 2004-10-05 John Luke <john.luke@gmail.com>
17312 * cs-parser.jay: add location to error CS0175
17314 2004-10-04 Miguel de Icaza <miguel@ximian.com>
17316 * ecore.cs (Expression.Constantity): Add support for turning null
17319 * const.cs (Const.Define): Allow constants to be reference types
17320 as long as the value is Null.
17322 2004-10-04 Juraj Skripsky <js@hotfeet.ch>
17324 * namespace.cs (NamespaceEntry.Using): No matter which warning
17325 level is set, check if this namespace name has already been added.
17327 2004-10-03 Ben Maurer <bmaurer@ximian.com>
17329 * expression.cs: reftype [!=]= null should always use br[true,false].
17332 2004-10-03 Marek Safar <marek.safar@seznam.cz>
17335 * attribute.cs: Enum conversion moved to
17336 GetAttributeArgumentExpression to be applied to the all
17339 2004-10-01 Raja R Harinath <rharinath@novell.com>
17341 Fix #65833, test-300.cs, cs0122-5.cs, cs0122-6.cs.
17342 * class.c (TypeContainer.DefineType): Flag error if
17343 base types aren't accessible due to access permissions.
17344 * decl.cs (DeclSpace.ResolveType): Move logic to
17345 Expression.ResolveAsTypeTerminal.
17346 (DeclSpace.ResolveTypeExpr): Thin layer over
17347 Expression.ResolveAsTypeTerminal.
17348 (DeclSpace.CheckAccessLevel, DeclSpace.FamilyAccess):
17349 Refactor code into NestedAccess. Use it.
17350 (DeclSpace.NestedAccess): New.
17351 * ecore.cs (Expression.ResolveAsTypeTerminal): Add new
17352 argument to silence errors. Check access permissions.
17353 (TypeExpr.DoResolve, TypeExpr.ResolveType): Update.
17354 * expression.cs (ProbeExpr.DoResolve): Use ResolveAsTypeTerminal.
17355 (Cast.DoResolve): Likewise.
17356 (New.DoResolve): Likewise.
17357 (InvocationOrCast.DoResolve,ResolveStatement): Likewise.
17358 (TypeOf.DoResolve): Likewise.
17360 * expression.cs (Invocation.BetterConversion): Return the Type of
17361 the better conversion. Implement section 14.4.2.3 more faithfully.
17362 (Invocation.BetterFunction): Make boolean. Make correspondence to
17363 section 14.4.2.2 explicit.
17364 (Invocation.OverloadResolve): Update.
17365 (Invocation): Remove is_base field.
17366 (Invocation.DoResolve): Don't use is_base. Use mg.IsBase.
17367 (Invocation.Emit): Likewise.
17369 2004-09-27 Raja R Harinath <rharinath@novell.com>
17371 * README: Update to changes.
17373 2004-09-24 Marek Safar <marek.safar@seznam.cz>
17375 * cs-parser.jay: Reverted 642 warning fix.
17377 2004-09-23 Marek Safar <marek.safar@seznam.cz>
17380 * decl.cs (FindMemberWithSameName): Indexer can have more than
17383 2004-09-23 Marek Safar <marek.safar@seznam.cz>
17385 * expression.cs (LocalVariableReference.DoResolveLValue):
17386 Do not report warning 219 for out values.
17387 (EmptyExpression.Null): New member to avoid extra allocations.
17389 2004-09-23 Marek Safar <marek.safar@seznam.cz>
17391 * cs-parser.jay: Fix wrong warning 642 report.
17393 * cs-tokenizer.cs (CheckNextToken): New helper;
17394 Inspect next character if is same as expected.
17396 2004-09-23 Martin Baulig <martin@ximian.com>
17398 * convert.cs (Convert.ImplicitReferenceConversion): Some code cleanup.
17399 (Convert.ImplicitReferenceConversionExists): Likewise.
17401 2004-09-23 Marek Safar <marek.safar@seznam.cz>
17403 * class.cs (Operator.Define): Add error 448 and 559 report.
17405 2004-09-22 Marek Safar <marek.safar@seznam.cz>
17407 * class.cs (MemberBase.IsTypePermitted): New protected
17408 method for checking error CS0610.
17410 2004-09-22 Marek Safar <marek.safar@seznam.cz>
17412 * class.cs (TypeContainer.HasExplicitLayout): New property
17413 Returns whether container has StructLayout attribute set Explicit.
17414 (FieldMember): New abstract class for consts and fields.
17415 (FieldMember.ApplyAttributeBuilder): Add error 636 and 637 report.
17416 (Field): Reuse FieldMember.
17418 * const.cs (Const): Reuse FieldMember.
17420 * rootcontext.cs: EmitConstants call moved to class.
17422 2004-09-22 Martin Baulig <martin@ximian.com>
17424 Thanks to Peter Sestoft for this bug report.
17426 * expression.cs (Conditional): If both the `trueExpr' and the
17427 `falseExpr' is a NullLiteral, return a NullLiteral.
17429 2004-09-22 Martin Baulig <martin@ximian.com>
17431 * statement.cs (Foreach.EmitCollectionForeach): If we're in an
17432 iterator, use `enumerator.EmitThis()' instead of `ec.EmitThis()'
17433 for the "get_Current" call.
17435 2004-09-22 Martin Baulig <martin@ximian.com>
17437 Marek and me just fixed one of our oldest bugs: #28562 :-)
17439 * ecore.cs (EnumConstant.GetValueAsEnumType): New public method.
17441 * attribute.cs (Attribute.GetAttributeArgumentExpression): If
17442 we're an EnumConstant, just return that.
17443 (Attribute.Resolve): GetAttributeArgumentExpression() may give us
17444 an EnumConstant. In this case, we need to use GetValueAsEnumType()
17445 to get the value which'll actually be written into the attribute.
17446 However, we have to use GetValue() to access the attribute's value
17449 2004-09-22 Marek Safar <marek.safar@seznam.cz>
17451 * constant.cs (Constant.IsNegative): New abstract property
17454 * expression.cs (ArrayAccess.DoResolve): Add warning 251.
17455 (StackAlloc.DoResolve): Reused IsNegative.
17457 2004-09-21 Martin Baulig <martin@ximian.com>
17459 * codegen.cs (VariableStorage): Don't store the ILGenerator here;
17460 if we're used in an iterator, we may be called from different
17463 * statement.cs (Foreach.EmitFinally): Only emit an `Endfinally' if
17464 we actually have an exception block.
17466 2004-09-20 John Luke <jluke@cfl.rr.com>
17468 * class.cs, cs-parser.jay: Improve the error report for 1520:
17469 report the actual line where the error happens, not where the
17470 class was declared.
17472 * assign.cs, delegate.cs, ecore.cs, expression.cs, statement.cs:
17473 Pass location information that was available elsewhere.
17475 2004-09-19 Sebastien Pouliot <sebastien@ximian.com>
17477 * codegen.cs: Fix bug #56621. It is now possible to use MCS on the MS
17478 runtime to delay sign assemblies.
17480 2004-09-19 Miguel de Icaza <miguel@ximian.com>
17482 * cs-parser.jay: Do not report the stack trace, this is barely
17485 2004-08-22 John Luke <john.luke@gmail.com>
17487 * driver.cs : check that a resource id is not already used
17488 before adding it, report CS1508 if it is, bug #63637
17490 2004-09-19 Miguel de Icaza <miguel@ximian.com>
17492 * ecore.cs: Removed dead code.
17494 2004-09-18 Marek Safar <marek.safar@seznam.cz>
17496 * class.cs: Do not report warning CS0067 on the interfaces.
17498 2004-09-16 Marek Safar <marek.safar@seznam.cz>
17500 * cs-parser.jay: Add error 504 report.
17502 2004-09-16 Marek Safar <marek.safar@seznam.cz>
17504 * rootcontext.cs: WarningLevel is 4 by default now.
17506 * statement.cs (Fixed.Resolve): Do not null
17509 2004-09-16 Marek Safar <marek.safar@seznam.cz>
17512 * ecore.cs (PropertyExpr.FindAccessors): Do not perform
17513 deep search when property is not virtual.
17514 (PropertyExpr.ResolveAccessors): Make one call for both
17517 2004-09-15 Marek Safar <marek.safar@seznam.cz>
17520 * statement.cs: Error 152 report constains also location.
17522 2004-09-15 Marek Safar <marek.safar@seznam.cz>
17525 * const.cs: Explicitly set constant as static.
17527 2004-09-15 Marek Safar <marek.safar@seznam.cz>
17530 * cs-parser.jay: Add error 1017 report.
17532 2004-09-15 Marek Safar <marek.safar@seznam.cz>
17534 Fixed bug #59980, #64224
17535 * expression.cs (Invocation.DoResolve): Fixed error CS0571 test.
17537 * typemanager.cs (IsSpecialMethod): Simplified
17539 2004-09-14 Marek Safar <marek.safar@seznam.cz>
17541 * decl.cs (MemberCore.Emit): Resuscitated VerifyObsoleteAttribute
17542 condition with better params.
17544 2004-09-14 Marek Safar <marek.safar@seznam.cz>
17547 * attribute.cs (Resolve): Property has to have both
17550 2004-09-14 Martin Baulig <martin@ximian.com>
17552 * decl.cs (MemberCore.Emit): Always call VerifyObsoleteAttribute().
17554 2004-09-14 Marek Safar <marek.safar@seznam.cz>
17557 * codegen.cs (TestObsoleteMethodUsage): Trace when method is
17558 called and is obsolete then this member suppress message
17559 when call is inside next [Obsolete] method or type.
17561 * expression.cs: Use TestObsoleteMethodUsage member.
17563 2004-09-14 Martin Baulig <martin@ximian.com>
17565 * cs-parser.jay: Sync a bit with the GMCS version.
17567 2004-09-14 Martin Baulig <martin@ximian.com>
17569 * cs-parser.jay (CSharpParser): Don't derive from GenericsParser.
17570 (CSharpParser.yacc_verbose_flag): New public field.
17572 * genericparser.cs: Removed.
17574 2004-09-14 Raja R Harinath <rharinath@novell.com>
17576 * cs-parser.jay (event_declaration): Re-enable cs0071 error.
17578 2004-09-13 Marek Safar <marek.safar@seznam.cz>
17580 * class.cs (MethodCore.CheckBase): Fix bug #65757.
17582 2004-09-10 Martin Baulig <martin@ximian.com>
17584 Backported my MemberName changes from GMCS into MCS.
17586 - we are now using a special `MemberName' class instead of using
17587 strings; in GMCS, the `MemberName' also contains the type
17590 - changed the grammar rules a bit:
17591 * the old `member_name' is now a `namespace_or_type_name':
17592 The rule is that we use `namespace_or_type_name' everywhere
17593 where we expect either a "member name" (GetEnumerator) or a
17594 "member name" with an explicit interface name
17595 (IEnumerable.GetEnumerator).
17596 In GMCS, the explicit interface name may include type arguments
17597 (IEnumerable<T>.GetEnumerator).
17598 * we use `member_name' instead of just `IDENTIFIER' for
17600 The rule is that we use `member_name' wherever a member may
17601 have type parameters in GMCS.
17603 * decl.cs (MemberName): New public class.
17604 (MemberCore.MemberName): New public readonly field.
17605 (MemberCore.ctor): Take a `MemberName' argument, not a string.
17606 (DeclSpace): Likewise.
17608 * delegate.cs (Delegate.ctor): Take a MemberName, not a string.
17609 * enum.cs (Enum.ctor): Likewise.
17611 * namespace.cs (AliasEntry.Alias): Changed type from Expression to
17613 (AliasEntry.ctor): Take a MemberName, not an Expression.
17614 (AliasEntry.UsingAlias): Likewise.
17616 * class.cs (TypeContainer.ctor): Take a MemberName, not a string.
17617 (IMethodData.MemberName): Changed type from string to MemberName.
17618 (MemberBase.ExplicitInterfaceName): Likewise.
17619 (AbstractPropertyEventMethod.SetupName): Make this private.
17620 (AbstractPropertyEventMethod.ctor): Added `string prefix'
17621 argument; compute the member name here.
17622 (AbstractPropertyEventMethod.UpdateName): Recompute the name based
17623 on the `member.MemberName' and the `prefix'.
17625 * cs-parser.jay (attribute_name): Use `namespace_or_type_name',
17627 (struct_declaration): Use `member_name' instead of `IDENTIFIER';
17628 thus, we get a `MemberName' instead of a `string'. These
17629 declarations may have type parameters in GMCS.
17630 (interface_method_declaration, delegate_declaration): Likewise.
17631 (class_declaration, interface_declaration): Likewise.
17632 (method_header): Use `namespace_or_type_name' instead of
17633 `member_name'. We may be an explicit interface implementation.
17634 (property_declaration, event_declaration): Likewise.
17635 (member_name): This is now just an `IDENTIFIER', not a
17636 `namespace_or_type_name'.
17637 (type_name, interface_type): Removed.
17638 (namespace_or_type_name): Return a MemberName, not an Expression.
17639 (primary_expression): Use `member_name' instead of `IDENTIFIER';
17640 call GetTypeExpression() on the MemberName to get an expression.
17641 (IndexerDeclaration.interface_type): Changed type from string to
17643 (MakeName): Operate on MemberName's instead of string's.
17645 2004-09-13 Raja R Harinath <rharinath@novell.com>
17648 * namespace.cs (AliasEntry.Resolve): Implement section 16.3.1.
17649 (NamespaceEntry.Lookup): Add new argument to flag if we want the
17650 lookup to avoid symbols introduced by 'using'.
17651 * rootcontext.cs (NamespaceLookup): Update.
17653 2004-09-12 Marek Safar <marek.safar@seznam.cz>
17655 * class.cs (TypeContainer.DoDefineMembers): Do not call
17656 DefineDefaultConstructor for static classes.
17658 2004-09-12 Marek Safar <marek.safar@seznam.cz>
17660 * attribute.cs (Attribute.Resolve): Add error 653 report.
17662 * class.cs (Class.ApplyAttributeBuilder): Add error 641
17664 (Method.ApplyAttributeBuilder): Add error 685 report.
17665 (Operator.Define): Add error 564 report.
17667 * cs-tokenizer.cs (handle_hex): Add error 1013 report.
17669 * expression.cs (Invocation.DoResolve): Add error
17670 245 and 250 report.
17672 * parameter.cs (Parameter.ApplyAttributeBuilder): Add
17675 2004-09-11 Marek Safar <marek.safar@seznam.cz>
17677 * class.cs (ConstructorInitializer.Resolve):
17678 Wrong error number (515->516).
17680 2004-09-11 Marek Safar <marek.safar@seznam.cz>
17682 * class.cs (Indexer.Define): Add error 631 report.
17684 2004-09-11 Marek Safar <marek.safar@seznam.cz>
17686 * ecore.cs (Error_NegativeArrayIndex): Fix 248 error.
17688 2004-09-11 Marek Safar <marek.safar@seznam.cz>
17690 * expression.cs (Probe.DoResolve): Add error CS0241 report.
17692 2004-09-10 Marek Safar <marek.safar@seznam.cz>
17694 * cs-parser.jay: Added error CS0241 report.
17696 2004-09-10 Raja R Harinath <rharinath@novell.com>
17698 * cs-parser.jay (fixed_statement): Introduce a scope for the
17699 declaration in the 'fixed' statement.
17701 2004-09-09 Marek Safar <marek.safar@seznam.cz>
17703 * cs-parser.jay: Added CS0230 error report.
17705 2004-09-09 Marek Safar <marek.safar@seznam.cz>
17707 * cs-parser.jay: Added errors CS0231 and CS0257 report.
17709 2004-09-09 Marek Safar <marek.safar@seznam.cz>
17711 * expression.cs (Argument.Resolve): Added error CS0192 and
17714 2004-09-09 Marek Safar <marek.safar@seznam.cz>
17716 C# 2.0 #pragma warning feature
17718 * cs-tokenizer.cs (PreProcessPragma): New method;
17719 Handles #pragma directive.
17721 * report.cs (WarningRegions): New class; Support
17722 class for #pragma warning directive. It tests whether
17723 warning is enabled for a given line.
17725 2004-09-08 Miguel de Icaza <miguel@ximian.com>
17727 * const.cs: Add more descriptive error report, tahnks to
17730 2004-09-08 Marek Safar <marek.safar@seznam.cz>
17732 * ecore.cs (FieldExpr.DoResolveLValue): Fixed CS0198 report.
17734 2004-09-07 Miguel de Icaza <miguel@ximian.com>
17736 * expression.cs: Apply patch from Ben: Remove dead code from
17737 ArrayCreation, and remove the TurnintoConstant call in const.cs,
17738 as that code just threw an exception anwyays.
17740 * const.cs: Remove the call to the turnintoconstant, for details
17743 * literal.cs: The type of the null-literal is the null type; So
17744 we use a placeholder type (literal.cs:System.Null, defined here)
17747 * expression.cs (Conditional.DoResolve): Remove some old code that
17748 is no longer needed, conversions have been fixed.
17750 (ArrayCreationExpression.DoResolve): Return false if we fail to
17751 resolve the inner expression.
17753 2004-09-07 Raja R Harinath <rharinath@novell.com>
17756 * cs-parser.jay (delegate_declaration): Record a delegate
17757 declaration as a type declaration.
17758 Reported by Jo Vermeulen <jo@lumumba.luc.ac.be>.
17760 2004-09-06 Miguel de Icaza <miguel@ximian.com>
17762 * parameter.cs: Do not crash if the type can not be resolved.
17764 * expression.cs: Report errors with unsafe pointers, fixes #64896
17766 2004-09-06 Ben Maurer <bmaurer@users.sourceforge.net>
17768 * expression.cs: Pointer arith always needs to do a conv.i
17769 if the operand is a long. fix 65320
17771 2004-09-04 Marek Safar <marek.safar@seznam.cz>
17773 Fixed cs0619-37.cs, cs0619-38.cs
17775 * enum.cs (GetObsoleteAttribute): Removed.
17777 * expression.cs (MemberAccess.DoResolve): Test for [Obsolete]
17778 on Enum member is double staged. The first is tested member
17781 2004-09-04 Marek Safar <marek.safar@seznam.cz>
17783 Fixed #56986, #63631, #65231
17785 * class.cs: (TypeContainer.AddToMemberContainer): New method,
17786 adds member to name container.
17787 (TypeContainer.AddToTypeContainer): New method, adds type to
17789 (AddConstant, AddEnum, AddClassOrStruct, AddDelegate, AddMethod,
17790 AddConstructor, AddInterface, AddField, AddProperty, AddEvent,
17791 AddOperator): Simplified by reusing AddToMemberContainer.
17792 (TypeContainer.UserDefinedStaticConstructor): Changed to property
17794 (Method.CheckForDuplications): Fixed implementation to test all
17796 (MemberBase): Detection whether member is explicit interface
17797 implementation is now in constructor.
17798 (MemberBase.UpdateMemberName): Handles IndexerName.
17799 (Accessor): Changed to keep also location information.
17800 (AbstractPropertyEventMethod): Is derived from MemberCore.
17801 (AbstractPropertyEventMethod.IsDummy): Says whether accessor
17802 will be emited or not.
17803 (PropertyBase.AreAccessorsDuplicateImplementation):
17804 Tests whether accessors are not in collision with some method.
17805 (Operator): Is derived from MethodCore to simplify common
17808 * decl.cs (Flags.TestMethodDuplication): Test for duplication
17810 (DeclSpace.AddToContainer): Adds the member to defined_names
17811 table. It tests for duplications and enclosing name conflicts.
17813 * enum.cs (EnumMember): Clean up to reuse the base structures
17815 2004-09-03 Martin Baulig <martin@ximian.com>
17817 * class.cs (TypeContainer.DefineDefaultConstructor): Put this back
17818 into TypeContainer, to make partial classes work again.
17820 2004-09-03 Martin Baulig <martin@ximian.com>
17822 * rootcontext.cs (RootContext.V2): Removed.
17824 2004-03-23 Martin Baulig <martin@ximian.com>
17826 * expression.cs (Invocation.OverloadResolve): Added `bool
17827 may_fail' argument and use it instead of the Location.IsNull() hack.
17829 2004-09-03 Martin Baulig <martin@ximian.com>
17831 Merged latest changes into gmcs. Please keep this comment in
17832 here, it makes it easier for me to see what changed in MCS since
17833 the last time I merged.
17835 2004-09-03 Raja R Harinath <rharinath@novell.com>
17838 * expression.cs (BetterConversion): Don't allow either conversion
17839 to be null. Remove redundant implicit conversion test when 'q ==
17840 null' -- when this function is invoked, we already know that the
17841 implicit conversion exists.
17842 (BetterFunction): Assume that 'best' is non-null. Remove
17843 redundant reimplementation of IsApplicable when 'best' is null.
17844 (IsParamsMethodApplicable, IsApplicable): Add new parameter for
17845 number of arguments.
17846 (IsAncestralType): Extract from OverloadResolve.
17847 (OverloadResolve): Make robust to the MethodGroupExpr being
17848 unsorted. Implement all the logic of Section 14.5.5.1, and
17849 support overloading of methods from multiple applicable types.
17850 Clean up logic somewhat. Don't pass null methods to BetterFunction.
17852 * report.cs (SymbolRelatedToPreviousError): Cleanup output.
17853 (RealError, Warning): Append type of report to related symbol.
17855 2004-09-03 Marek Safar <marek.safar@seznam.cz>
17857 * enum.cs: Fixed CLS-Compliance checks for enum members.
17858 Error tests cs3008-8.cs, cs3014-8.cs
17860 2004-09-02 Marek Safar <marek.safar@seznam.cz>
17862 Fixed bug #62342, #63102
17863 * class.cs: ImplementIndexer uses member.IsExplicitImpl
17864 like ImplementMethod.
17866 2004-09-02 Marek Safar <marek.safar@seznam.cz>
17868 * attribute.cs (Attribute.GetAttributeArgumentExpression):
17871 2004-09-02 Martin Baulig <martin@ximian.com>
17873 * statement.cs (Using.EmitLocalVariableDeclFinally): Use
17874 TypeManager.GetArgumentTypes() rather than calling GetParameters()
17877 2004-09-01 Marek Safar <marek.safar@seznam.cz>
17879 C# 2.0 Static classes implemented
17881 * class.cs (TypeContainer): instance_constructors,
17882 initialized_fields, initialized_static_fields,
17883 default_constructor, base_inteface_types are protected to be
17884 accessible from StaticClass.
17885 (TypeContainer.DefineDefaultConstructor): New virtual method
17886 for custom default constructor generating
17887 (StaticClass): New class to handle "Static classes" feature.
17889 * cs-parser.jay: Handle static keyword on class like instance
17892 * driver.cs: Added "/langversion" command line switch with two
17893 options (iso-1, default).
17895 2004-08-31 Marek Safar <marek.safar@seznam.cz>
17897 * ecore.cs (FieldExpr.Resolve): Fixed bug #64689.
17899 2004-08-31 Miguel de Icaza <miguel@ximian.com>
17901 * delegate.cs: Style.
17903 2004-08-31 Ben Maurer <bmaurer@users.sourceforge.net>
17905 * delegate.cs: Add seperate instance expr field for miguel.
17907 2004-08-29 Ben Maurer <bmaurer@users.sourceforge.net>
17909 * PointerArithmetic (Resolve): make sure we are not doing
17910 pointer arith on void*. Also, make sure we are resolved
17911 by not setting eclass until resolve.
17913 All callers: Make sure that PointerArithmetic gets resolved.
17915 2004-08-29 Ben Maurer <bmaurer@users.sourceforge.net>
17917 * ArrayCreation (LookupType): If the type does not resolve
17918 to an array, give an error.
17920 2004-08-27 Marek Safar <marek.safar@seznam.cz>
17922 * statement.cs (Try.Resolve): Fixed bug #64222
17924 2004-08-27 Martin Baulig <martin@ximian.com>
17927 (TC.OperatorArrayList.OperatorEntry.CheckPairedOperators): Don't
17930 2004-08-26 Marek Safar <marek.safar@seznam.cz>
17932 * ecore.cs (Constantify): Get underlying type via
17933 System.Enum.GetUnderlyingType to avoid StackOverflow on the
17934 Windows in special cases.
17936 2004-08-26 Marek Safar <marek.safar@seznam.cz>
17938 * typemanager.cs (GetAddMethod): Used GetAddMethod (true)
17939 for obtaining also private methods.
17940 (GetRemoveMethod): Used GetRemoveMethod (true)
17941 for obtaining also private methods.
17943 2004-08-24 Martin Baulig <martin@ximian.com>
17945 * class.cs (Method.Define): Set MethodAttributes.SpecialName and
17946 MethodAttributes.HideBySig for operators.
17948 2004-08-23 Martin Baulig <martin@ximian.com>
17950 Back to the old error reporting system :-)
17952 * report.cs (Message): Removed.
17953 (Report.MessageData, ErrorData, WarningData): Removed.
17954 (Report.Error, Warning): Back to the old system.
17956 2004-08-23 Martin Baulig <martin@ximian.com>
17958 * decl.cs (IMemberContainer.Parent): Renamed to ParentContainer.
17960 * class.cs (TypeContainer.ParentContainer): New public virtual
17961 method; replaces the explicit interface implementation.
17962 (ClassPart.ParentContainer): Override.
17964 2004-08-23 Martin Baulig <martin@ximian.com>
17966 * statement.cs (Switch): Added support for constant switches; see
17967 #59428 or test-285.cs.
17969 2004-08-22 Marek Safar <marek.safar@seznam.cz>
17972 * statement.cs (GetEnumeratorFilter): Removed useless
17973 logic because C# specs is strict. GetEnumerator must be
17976 2004-08-22 Martin Baulig <martin@ximian.com>
17978 * flowanalysis.cs (FlowBranching.UsageVector.MergeChild): If we're
17979 a switch and may break, reset the barrier. Fixes #59867.
17981 2004-08-22 Marek Safar <marek.safar@seznam.cz>
17983 CLS-Compliance speed up (~5% for corlib)
17985 * attribute.cs (AttributeTester.VerifyTopLevelNameClsCompliance):
17986 New method. Tests container for CLS-Compliant names
17988 * class.cs (TypeContainer.VerifyClsName): New method.
17989 Checks whether container name is CLS Compliant.
17990 (Constructor): Implements IMethodData.
17992 * decl.cs (MemberCache.GetPublicMembers ): New method. Builds
17993 low-case table for CLS Compliance test.
17994 (MemberCache.VerifyClsParameterConflict): New method.
17995 Checks method parameters for CS3006 error.
17997 * enum.cs (EnumMember): Is derived from MemberCore.
17998 (Enum.VerifyClsName): Optimized for better performance.
18000 2004-08-06 Marek Safar <marek.safar@seznam.cz>
18002 * report.cs: Renamed Error_T to Error and changed all
18005 2004-08-06 Marek Safar <marek.safar@seznam.cz>
18007 * class.cs (TypeContainer.IndexerArrayList): New inner class
18008 container for indexers.
18009 (TypeContainer.DefaultIndexerName): New constant for default
18010 indexer name. Replaced all "Item" with this constant.
18011 (TypeContainer.DefineIndexers): Moved to IndexerArrayList class.
18013 * typemanager.cs (TypeManager.default_member_ctor): Cache here
18014 DefaultMemberAttribute constructor.
18016 2004-08-05 Martin Baulig <martin@ximian.com>
18018 * flowanalysis.cs (FlowBranching.UsageVector.MergeJumpOrigins):
18021 2004-08-05 Marek Safar <marek.safar@seznam.cz>
18023 * mcs.exe.sources: $(EXTRA_SOURCES) are now here to avoid
18024 multi platforms problem.
18026 * compiler.csproj: Included shared files.
18028 2004-08-04 Marek Safar <marek.safar@seznam.cz>
18030 Fix bug 60333, 55971 in the more general way
18031 * attribute.cs (Attribute.GetAttributeArgumentExpression):
18032 Added arg_type argument for constant conversion.
18033 (Attribute.Resolve): Reuse GetAttributeArgumentExpression.
18035 2004-08-04 Marek Safar <marek.safar@seznam.cz>
18038 * class.cs (TypeContainer ): New inner classes MethodArrayList,
18039 OperatorArrayList, MethodCoreArrayList for typecontainer
18040 containers. Changed class member types to these new types.
18041 (MethodArrayList.DefineMembers): Added test for CS0659.
18043 2004-08-04 Miguel de Icaza <miguel@ximian.com>
18045 * cfold.cs: Synchronize the folding with the code in expression.cs
18046 Binary.DoNumericPromotions for uint operands.
18048 * attribute.cs: Revert patch from Raja, it introduced a regression
18049 while building Blam-1.2.1 (hard to isolate a test case).
18051 2004-08-04 Marek Safar <marek.safar@seznam.cz>
18055 (TypeContainer.Define): Renamed to DefineContainerMembers because of
18057 (MethodCore.parent_method): New member. The method we're overriding
18058 if this is an override method.
18059 (MethodCore.CheckBase): Moved from Method class and made common.
18060 (MethodCore.CheckMethodAgainstBase): Moved from MemberBase and made
18062 (MethodCore.CheckForDuplications): New abstract method. For custom
18063 member duplication search in a container
18064 (MethodCore.FindOutParentMethod): New abstract method. Gets parent
18065 method and its return type.
18066 (Event.conflict_symbol): New member. Symbol with same name in the
18070 (MemberCache.FindMemberWithSameName): New method. The method
18071 is looking for conflict with inherited symbols.
18073 2004-08-04 Martin Baulig <martin@ximian.com>
18075 * codegen.cs (VariableStorage.EmitLoadAddress): New public method.
18077 * statement.cs (Foreach.EmitFinally): Make this work for valuetypes.
18079 2004-08-03 Marek Safar <marek.safar@seznam.cz>
18081 * report.cs (Message): New enum for better error, warning reference in
18083 (MessageData): New inner abstract class. It generally handles printing of
18084 error and warning messages.
18085 Removed unused Error, Warning, Message methods.
18087 2004-08-03 Marek Safar <marek.safar@seznam.cz>
18089 Fix for cs0592-8.cs test
18091 (Attributable.ValidAttributeTargets): Made public.
18092 (Attribute.ExplicitTarget): New member for explicit target value.
18093 (Attribute.CheckTargets): Now we translate explicit attribute
18094 target to Target here.
18096 2004-08-03 Ben Maurer <bmaurer@ximian.com>
18098 * ecore.cs (MethodGroupExpr): new IsBase property.
18100 * expression.cs (BaseAccess): Set IsBase on MethodGroupExpr.
18102 * delegate.cs (DelegateCreation): store a MethodGroupExpr
18103 rather than an instance expr.
18105 (DelegateCreation.Emit): Use the method group rather than
18106 the instance expression. Also, if you have base.Foo as the
18107 method for a delegate, make sure to emit ldftn, not ldftnvirt.
18109 (ResolveMethodGroupExpr): Use the MethodGroupExpr.
18111 (NewDelegate.DoResolve): Only check for the existance of Invoke
18112 if the method is going to be needed. Use MethodGroupExpr.
18114 (NewDelegate.Emit): Remove, DelegateCreation implements this.
18116 * expression.cs: For pointer arith., make sure to use
18117 the size of the type, not the size of the pointer to
18120 2004-08-03 Marek Safar <marek.safar@seznam.cz>
18123 * class.cs (Class): Added error CS0502 test.
18125 2004-08-03 John Luke <jluke@cfl.rr.com>
18126 Raja R Harinath <rharinath@novell.com>
18129 * attribute.cs (Attribute.complained_before): New flag.
18130 (Attribute.ResolveType, Attribute.Resolve),
18131 (Attribute.DefinePInvokeMethod): Set it.
18132 (Attributes.Search): Pass 'complain' to Attribute.ResolveType.
18134 2004-08-03 Martin Baulig <martin@ximian.com>
18136 * expression.cs (Binary.ResolveOperator): Don't abort if we can't
18137 use a user-defined operator; we still need to do numeric
18138 promotions in case one argument is a builtin type and the other
18139 one has an implicit conversion to that type. Fixes #62322.
18141 2004-08-02 Martin Baulig <martin@ximian.com>
18143 * statement.cs (LocalInfo.Flags): Added `IsThis'.
18144 (LocalInfo.IsThis): New public property.
18145 (Block.EmitMeta): Don't create a LocalBuilder for `this'.
18147 2004-08-01 Martin Baulig <martin@ximian.com>
18149 * class.cs (TypeContainer.GetClassBases): Don't set the default
18150 here since we may get called from GetPartialBases().
18151 (TypeContainer.DefineType): If GetClassBases() didn't return a
18152 parent, use the default one.
18154 2004-07-30 Duncan Mak <duncan@ximian.com>
18156 * Makefile (mcs2.exe, mcs3.exe): add $(EXTRA_SOURCES).
18158 2004-07-30 Martin Baulig <martin@ximian.com>
18160 * Makefile (EXTRA_SOURCES): List the symbol writer's sources here.
18162 * class.cs (SourceMethod): New public class, derive from the
18163 symbol writer's ISourceMethod.
18164 (Method): Use the new symbol writer API.
18166 * codegen.cs (CodeGen.InitializeSymbolWriter): Take the filename
18167 as argument and use the new symbol writer.
18170 (SourceFile): Implement the symbol writer's ISourceFile.
18171 (Location.SymbolDocument): Removed.
18172 (Location.SourceFile): New public property.
18174 * symbolwriter.cs: Use the new symbol writer API.
18176 2004-07-30 Raja R Harinath <rharinath@novell.com>
18178 * Makefile (install-local): Remove. Functionality moved to
18181 2004-07-28 Lluis Sanchez Gual <lluis@novell.com>
18183 * Makefile: Install mcs.exe.config file together with mcs.exe.
18184 * mcs.exe.config: Added supportedRuntime entry to make sure it runs in the
18185 correct runtime version.
18187 2004-07-25 Martin Baulig <martin@ximian.com>
18190 (TypeContainer.RegisterOrder): Removed, this was unused.
18191 (TypeContainer, interface_order): Removed.
18192 (TypeContainer.AddClass, AddStruct, AddInterface): Take a
18193 TypeContainer as argument since we can also be called with a
18194 `PartialContainer' for a partial class/struct/interface.
18195 (TypeContainer.IsInterface): Use `Kind == Kind.Interface' instead
18196 of checking whether we're an `Interface' - we could be a
18197 `PartialContainer'.
18198 (PartialContainer.Register): Override; call
18199 AddClass()/AddStruct()/AddInterface() on our parent.
18201 * cs-parser.jay (interface_member_declaration): Add things to the
18202 `current_container', not the `current_class'.
18204 * rootcontext.cs (RegisterOrder): The overloaded version which
18205 takes an `Interface' was unused, removed.
18207 * typemanager.cs (TypeManager.LookupInterface): Return a
18208 `TypeContainer', not an `Interface'.
18209 (TypeManager.IsInterfaceType): The `builder_to_declspace' may
18210 contain a `PartialContainer' for an interface, so check it's
18211 `Kind' to figure out what it is.
18213 2004-07-25 Martin Baulig <martin@ximian.com>
18215 * class.cs (Class.DefaultTypeAttributes): New public constant.
18216 (Struct.DefaultTypeAttributes): Likewise.
18217 (Interface.DefaultTypeAttributes): Likewise.
18218 (PartialContainer.TypeAttr): Override this and add the
18219 DefaultTypeAttributes.
18221 2004-07-25 Martin Baulig <martin@ximian.com>
18223 * decl.cs (DeclSpace.Emit): Removed the `TypeContainer' argument,
18224 we can just use the `Parent' field instead.
18226 2004-07-25 Martin Baulig <martin@ximian.com>
18228 * class.cs (TypeContainer.Emit): Renamed to EmitType().
18230 2004-07-25 Martin Baulig <martin@ximian.com>
18232 * class.cs (TypeContainer.DefineMembers): Call DefineMembers() on
18233 our parts before defining any methods.
18234 (TypeContainer.VerifyImplements): Make this virtual.
18235 (ClassPart.VerifyImplements): Override and call VerifyImplements()
18236 on our PartialContainer.
18238 2004-07-25 Martin Baulig <martin@ximian.com>
18240 * iterators.cs (Iterator.Define): Renamed to DefineIterator().
18242 * decl.cs (DeclSpace.Define): Removed the `TypeContainer'
18243 argument, we can just use the `Parent' field instead.
18246 (MemberBase.CheckBase): Removed the `TypeContainer' argument.
18247 (MemberBase.DoDefine): Likewise.
18249 2004-07-24 Martin Baulig <martin@ximian.com>
18251 * decl.cs (MemberCore.Parent): New public field.
18252 (DeclSpace.Parent): Moved to MemberCore.
18254 * class.cs (MethodCore.ds): Removed; use `Parent' instead.
18255 (MemberBase.ctor): Added TypeContainer argument, pass it to our
18257 (FieldBase, Field, Operator): Likewise.
18258 (EventProperty.ctor): Take a TypeContainer instead of a DeclSpace.
18259 (EventField, Event): Likewise.
18261 2004-07-23 Martin Baulig <martin@ximian.com>
18263 * class.cs (PartialContainer): New public class.
18264 (ClassPart): New public class.
18265 (TypeContainer): Added support for partial classes.
18266 (TypeContainer.GetClassBases): Splitted some of the functionality
18267 out into GetNormalBases() and GetPartialBases().
18269 * cs-tokenizer.cs (Token.PARTIAL): New token.
18270 (Tokenizer.consume_identifier): Added some hacks to recognize
18271 `partial', but only if it's immediately followed by `class',
18272 `struct' or `interface'.
18274 * cs-parser.jay: Added support for partial clases.
18276 2004-07-23 Martin Baulig <martin@ximian.com>
18278 * class.cs (MethodCore.ds): Made this a `TypeContainer' instead of
18279 a `DeclSpace' and also made it readonly.
18280 (MethodCore.ctor): Take a TypeContainer instead of a DeclSpace.
18281 (Method.ctor, Constructor.ctor, Destruktor.ctor): Likewise.
18282 (PropertyBase.ctor, Property.ctor, Indexer.ctor): Likewise.
18284 * cs-parser.jay: Pass the `current_class', not the
18285 `current_container' (at the moment, this is still the same thing)
18286 to a new Method, Property, Event, Indexer or Constructor.
18288 2004-07-23 Martin Baulig <martin@ximian.com>
18290 * cs-parser.jay (CSharpParser): Added a new `current_class' field
18291 and removed the `current_interface' one.
18292 (struct_declaration, class_declaration, interface_declaration):
18293 Set `current_class' to the newly created class/struct/interface;
18294 set their `Bases' and call Register() before parsing their body.
18296 2004-07-23 Martin Baulig <martin@ximian.com>
18298 * class.cs (Kind): New public enum.
18299 (TypeContainer): Made this class abstract.
18300 (TypeContainer.Kind): New public readonly field.
18301 (TypeContainer.CheckDef): New public method; moved here from
18303 (TypeContainer.Register): New public abstract method.
18304 (TypeContainer.GetPendingImplementations): New public abstract
18306 (TypeContainer.GetClassBases): Removed the `is_class' and
18307 `is_iface' parameters.
18308 (TypeContainer.DefineNestedTypes): Formerly known as
18310 (ClassOrStruct): Made this class abstract.
18312 * tree.cs (RootTypes): New public type.
18314 2004-07-20 Martin Baulig <martin@ximian.com>
18316 * tree.cs (Tree.RecordNamespace): Removed.
18317 (Tree.Namespaces): Removed.
18319 * rootcontext.cs (RootContext.IsNamespace): Removed.
18321 * cs-parser.jay (namespace_declaration): Just create a new
18322 NamespaceEntry here.
18324 2004-07-20 Martin Baulig <martin@ximian.com>
18326 * statement.cs (ExceptionStatement): New abstract class. This is
18327 now used as a base class for everyone who's using `finally'.
18328 (Using.ResolveLocalVariableDecls): Actually ResolveLValue() all
18329 our local variables before using them.
18331 * flowanalysis.cs (FlowBranching.StealFinallyClauses): New public
18332 virtual method. This is used by Yield.Resolve() to "steal" an
18333 outer block's `finally' clauses.
18334 (FlowBranchingException): The .ctor now takes an ExceptionStatement
18337 * codegen.cs (EmitContext.StartFlowBranching): Added overloaded
18338 version which takes an ExceptionStatement. This version must be
18339 used to create exception branchings.
18342 (Yield.Resolve): "Steal" all `finally' clauses from containing blocks.
18343 (Iterator.EmitMoveNext): Added exception support; protect the
18344 block with a `fault' clause, properly handle 'finally' clauses.
18345 (Iterator.EmitDispose): Run all the `finally' clauses here.
18347 2004-07-20 Martin Baulig <martin@ximian.com>
18349 * iterator.cs: This is the first of a set of changes in the
18350 iterator code. Match the spec more closely: if we're an
18351 IEnumerable, then GetEnumerator() must be called. The first time
18352 GetEnumerator() is called, it returns the current instance; all
18353 subsequent invocations (if any) must create a copy.
18355 2004-07-19 Miguel de Icaza <miguel@ximian.com>
18357 * expression.cs: Resolve the constant expression before returning
18360 2004-07-19 Martin Baulig <martin@ximian.com>
18362 * iterators.cs (Iterator.MapVariable): Don't define fields twice.
18363 (Iterator.MoveNextMethod.DoEmit): Use `TypeManager.int32_type' as
18364 the return type of the new EmitContext.
18366 2004-07-18 Martin Baulig <martin@ximian.com>
18368 * class.cs (Property.Define): Fix iterators.
18370 * iterators.cs (Iterator.Define): Moved the
18371 `container.AddInterator (this)' call here from the .ctor; only do
18372 it if we resolved successfully.
18374 2004-07-17 Miguel de Icaza <miguel@ximian.com>
18376 * cs-tokenizer.cs (handle_preprocessing_directive): Do not return
18377 `true' for preprocessing directives that we parse. The return
18378 value indicates whether we should return to regular tokenizing or
18379 not, not whether it was parsed successfully.
18381 In the past if we were in: #if false ... #line #endif, we would
18382 resume parsing after `#line'. See bug 61604.
18384 * typemanager.cs: Removed an old hack from Gonzalo to get corlib
18385 building: IsEnumType should return true only for enums, not for
18386 enums or System.Enum itself. This fixes #61593.
18388 Likely what happened is that corlib was wrong: mcs depended on
18389 this bug in some places. The bug got fixed, we had to add the
18390 hack, which caused bug 61593.
18392 * expression.cs (ArrayAccess.GetStoreOpCode): Remove an old hack
18393 that was a workaround for the older conditions.
18395 2004-07-16 Ben Maurer <bmaurer@ximian.com>
18397 * assign.cs: IAssignMethod has a new interface, as documented
18398 inline. All assignment code now uses this new api.
18400 * ecore.cs, expression.cs: All classes which implement
18401 IAssignMethod now use the new interface.
18403 * expression.cs (Invocation): add a hack to EmitCall so that
18404 IndexerAccess can be the target of a compound assignment without
18405 evaluating its arguments twice.
18407 * statement.cs: Handle changes in Invocation api.
18409 2004-07-16 Martin Baulig <martin@ximian.com>
18411 * iterators.cs: Rewrote this. We're now using one single Proxy
18412 class for both the IEnumerable and the IEnumerator interface and
18413 `Iterator' derives from Class so we can use the high-level API.
18415 * class.cs (TypeContainer.AddIterator): New method.
18416 (TypeContainer.DoDefineType): New protected virtual method, which
18417 is called from DefineType().
18418 (TypeContainer.DoDefineMembers): Call DefineType() and
18419 DefineMembers() on all our iterators.
18420 (TypeContainer.Emit): Call Emit() on all our iterators.
18421 (TypeContainer.CloseType): Call CloseType() on all our iterators.
18423 * codegen.cs (EmitContext.CurrentIterator): New public field.
18425 2004-07-15 Martin Baulig <martin@ximian.com>
18428 (TypeManager.not_supported_exception_type): New type.
18430 2004-07-14 Martin Baulig <martin@ximian.com>
18432 * iterators.cs: Use real error numbers.
18434 2004-07-14 Martin Baulig <martin@ximian.com>
18436 * iterator.cs (IteratorHandle.IsIEnumerable): The spec explicitly
18437 requires this to be a System.Collection.IEnumerable and not a
18438 class implementing that interface.
18439 (IteratorHandle.IsIEnumerator): Likewise, for IEnumerator.
18441 2004-07-13 Marek Safar <marek.safar@seznam.cz>
18443 * class.cs: Fixed previous fix, it broke some error tests.
18445 2004-07-12 Martin Baulig <martin@ximian.com>
18447 * enum.cs (Enum.Define): Call Emit() to emit the attributes.
18450 2004-07-09 Miguel de Icaza <miguel@ximian.com>
18452 * assign.cs (LocalTemporary): Add new argument: is_address,If
18453 `is_address' is true, then the value that we store is the address
18454 to the real value, and not the value itself.
18456 * ecore.cs (PropertyExpr): use the new local temporary
18457 stuff to allow us to handle X.Y += z (where X is a struct)
18459 2004-07-08 Martin Baulig <martin@ximian.com>
18461 * statement.cs (Lock.Resolve): Set ec.NeedReturnLabel() if we do
18462 not always return, just like we're doing in Using.Resolve().
18464 2004-07-07 Miguel de Icaza <miguel@ximian.com>
18466 * cs-parser.jay (fixed_statement): flag this as Pinned.
18468 2004-07-06 Miguel de Icaza <miguel@ximian.com>
18470 * typemanager.cs (TypeManager): Removed MakePinned method, this
18471 mechanism is replaced with the .NET 2.x compatible mechanism of
18472 calling `ILGenerator.DeclareLocal (Type t, bool pinned)'.
18474 * statement.cs (LocalInfo): Remove MakePinned, add Pinned property
18475 Rename `Fixed' to `Pinned' as a flag, to distinguish from the
18476 `IsFixed' property which has a different meaning.
18478 2004-07-02 Raja R Harinath <rharinath@novell.com>
18480 * ecore.cs (DoSimpleNameResolve): Expand CS0038 check to all names
18481 visible from inside a nested class, not just the names of the
18482 immediately enclosing class.
18483 Fix for bug #60730.
18485 2004-06-24 Raja R Harinath <rharinath@novell.com>
18487 * expression.cs (BetterConversion): Remove buggy special-case
18488 handling of "implicit constant expression conversions". At this
18489 point, we already know that the conversion is possible -- we're
18490 only checking to see which is better.
18492 2004-06-24 Marek Safar <marek.safar@seznam.cz>
18494 * cs-parser.jay: Added error CS0210 test.
18496 2004-06-24 Marek Safar <marek.safar@seznam.cz>
18498 * cs-parser.jay: Added error CS0134 test.
18500 2004-06-24 Marek Safar <marek.safar@seznam.cz>
18503 * cs-parser.jay: Added error CS0145 test.
18505 2004-06-24 Marek Safar <marek.safar@seznam.cz>
18507 * class.cs (Operator.Define): Added test for errors CS0553, CS0554.
18509 2004-06-23 Ben Maurer <bmaurer@ximian.com>
18511 * expression.cs (StackAlloc.Resolve): The argument may not
18512 be a constant; deal with this case.
18514 2004-06-23 Marek Safar <marek.safar@seznam.cz>
18516 * attribute.cs (IndexerName_GetIndexerName): Renamed to
18517 GetIndexerAttributeValue.
18518 (ScanForIndexerName): Renamed to GetIndexerNameAttribute.
18520 * class.cs (Indexer.Define): Added error tests for CS0415,
18523 2004-06-23 Miguel de Icaza <miguel@ximian.com>
18525 * attribute.cs (Attribute.Resolve): Keep field code in sync with
18528 2004-06-23 Martin Baulig <martin@ximian.com>
18530 * flowanalysis.cs (UsageVector.MergeChild): If we're a loop and we
18531 neither return nor throw, reset the barrier as well. Fixes #60457.
18533 2004-06-22 Atsushi Enomoto <atsushi@ximian.com>
18535 * class.cs : EventAttributes is now set to None by default.
18536 This fixes bug #60459.
18538 2004-06-18 Marek Safar <marek.safar@seznam.cz>
18541 * class.cs (ConstructorInitializer.GetOverloadedConstructor):
18542 Don't throw exception but return null (it's sufficient now).
18544 2004-06-18 Marek Safar <marek.safar@seznam.cz>
18546 * typemanager.cs (GetArgumentTypes): Faster implementation.
18548 2004-06-18 Martin Baulig <martin@ximian.com>
18550 * attribute.cs (Attribute.Resolve): Check whether we're an
18551 EmptyCast which a Constant child. Fixes #60333.
18553 2004-06-17 Ben Maurer <bmaurer@ximian.com>
18555 * statement.cs (EmitCollectionForeach): Account for the fact that
18556 not all valuetypes are in areas which we can take the address of.
18557 For these variables, we store to a temporary variable. Also, make
18558 sure that we dont emit a `callvirt' on a valuetype method.
18560 2004-06-15 Marek Safar <marek.safar@seznam.cz>
18562 * expression.cs (StackAlloc.DoReSolve): Added test for
18563 negative parameter (CS0247).
18565 2004-06-15 Marek Safar <marek.safar@seznam.cz>
18568 * class.cs: (Event.DelegateMethod.Emit): Added synchronization flag.
18570 2004-06-15 Marek Safar <marek.safar@seznam.cz>
18573 * expression.cs: (Binary.DoNumericPromotions): Added conversion for
18576 2004-06-14 Marek Safar <marek.safar@seznam.cz>
18578 Fix bug #58254 & cs1555.cs, cs1556.cs
18579 * driver.cs (MainDriver): Added tests for errors CS1555, CS1556.
18581 2004-06-14 Marek Safar <marek.safar@seznam.cz>
18583 * cs-parser.jay: Added error CS1669 test for indexers.
18585 2004-06-11 Martin Baulig <martin@ximian.com>
18587 * expression.cs (Invocation.IsParamsMethodApplicable): We need to
18588 call this twice: for params and varargs methods.
18590 2004-06-11 Marek Safar <marek.safar@seznam.cz>
18593 (FieldBase.DoDefine, PropertyBase.DoDefine): Added error test CS0610.
18595 2004-06-11 Marek Safar <marek.safar@seznam.cz>
18597 * attribute.cs (Attribute.GetValidTargets): Made public.
18600 (AbstractPropertyEventMethod): New class for better code sharing.
18601 (AbstractPropertyEventMethod.ApplyAttributeBuilder): Add error
18603 (PropertyMethod, DelegateMethod): Derived from AbstractPropertyEventMethod
18605 2004-06-11 Raja R Harinath <rharinath@novell.com>
18608 * ecore.cs (ResolveFlags): Add new 'Intermediate' flag to tell
18609 that the call to Resolve is part of a MemberAccess.
18610 (Expression.Resolve): Use it for SimpleName resolution.
18611 (SimpleName.SimpleNameResolve, SimpleName.DoResolveAllowStatic):
18612 Add 'intermediate' boolean argument.
18613 (SimpleName.DoSimpleNameResolve): Likewise. Use it to disable an
18614 error message when the SimpleName can be resolved ambiguously
18615 between an expression and a type.
18616 * expression.cs (MemberAccess.IdenticalNameAndTypeName): Make
18618 (MemberAccess.Resolve): Pass 'Intermediate' flag to the Resolve()
18619 call on the left-side.
18621 2004-06-11 Marek Safar <marek.safar@seznam.cz>
18624 (MethodCore.VerifyClsCompliance): Added test for error CS3000.
18626 2004-06-11 Marek Safar <marek.safar@seznam.cz>
18628 * attribute.cs (Attribute.Emit): Fixed error CS0579 reporting.
18630 2004-06-11 Martin Baulig <martin@ximian.com>
18632 * expression.cs (Invocation.EmitCall): Use OpCodes.Callvirt for
18633 varargs methods if applicable.
18635 2004-06-11 Martin Baulig <martin@ximian.com>
18637 * expression.cs (Invocation.EmitCall): Don't use
18638 `method.CallingConvention == CallingConventions.VarArgs' since the
18639 method could also have `CallingConventions.HasThis'.
18641 2004-06-11 Marek Safar <marek.safar@seznam.cz>
18643 * class.cs (Event.GetSignatureForError): Implemented.
18644 Fixed crash in error test cs3010.cs
18646 2004-06-10 Miguel de Icaza <miguel@ximian.com>
18648 * cs-tokenizer.cs: Change the way we track __arglist to be
18649 consistent with the other keywords.
18651 2004-06-09 Miguel de Icaza <miguel@ximian.com>
18653 * codegen.cs: FAQ avoider: turn 1577 into a warning for now until
18656 2004-06-09 Sebastien Pouliot <sebastien@ximian.com>
18658 * codegen.cs: Check that all referenced assemblies have a strongname
18659 before strongnaming the compiled assembly. If not report error CS1577.
18660 Fix bug #56563. Patch by Jackson Harper.
18661 * typemanager.cs: Added a method to return all referenced assemblies.
18662 Fix bug #56563. Patch by Jackson Harper.
18664 2004-06-08 Marek Safar <marek.safar@seznam.cz>
18667 (Method.ApplyAttributeBuilder): Moved and added conditional
18668 attribute error tests (CS0577, CS0578, CS0243, CS0582, CS0629).
18671 (DelegateCreation.ResolveMethodGroupExpr): Added error CS1618 test.
18673 2004-06-08 Marek Safar <marek.safar@seznam.cz>
18676 * class.cs: (EventField.attribute_targets): Changed default target.
18678 2004-06-08 Martin Baulig <martin@ximian.com>
18680 * expression.cs (Invocation.EmitCall): Enable varargs methods.
18682 2004-06-08 Martin Baulig <martin@ximian.com>
18684 * rootcontext.cs (ResolveCore): Added "System.RuntimeArgumentHandle".
18686 2004-06-07 Martin Baulig <martin@ximian.com>
18688 Added support for varargs methods.
18690 * cs-tokenizer.cs (Token.ARGLIST): New token for the `__arglist'
18693 * cs-parser.jay: Added support for `__arglist'.
18695 * decl.cs (MemberCache.AddMethods): Don't ignore varargs methods.
18697 * expression.cs (Argument.AType): Added `ArgList'.
18698 (Invocation): Added support for varargs methods.
18699 (ArglistAccess): New public class.
18700 (Arglist): New public class.
18702 * parameter.cs (Parameter.Modifier): Added `ARGLIST'.
18704 * statement.cs (Block.Flags): Added `HasVarargs'. We set this on
18705 a method's top-level block if the method has varargs.
18707 * support.cs (ReflectionParameters, InternalParameters): Added
18708 support for varargs methods.
18710 2004-06-07 Miguel de Icaza <miguel@ximian.com>
18712 * class.cs: Provide location in indexer error report.
18714 * driver.cs: Use standard names.
18716 * namespace.cs: Catch the use of using after a namespace has been
18717 declared also on using aliases.
18719 2004-06-03 Raja R Harinath <rharinath@novell.com>
18722 * typemanager.cs (closure_private_ok, closure_invocation_type)
18723 (closure_qualifier_type, closure_invocation_assembly)
18724 (FilterWithClosure): Move to ...
18725 (Closure): New internal nested class.
18726 (Closure.CheckValidFamilyAccess): Split out from Closure.Filter.
18727 (MemberLookup, RealMemberLookup): Add new almost_match parameter.
18728 * ecore.cs (almostMatchedMembers): New variable to help report CS1540.
18729 (MemberLookup, MemberLookupFailed): Use it.
18730 * expression.cs (New.DoResolve): Treat the lookup for the
18731 constructor as being qualified by the 'new'ed type.
18732 (Indexers.GetIndexersForTypeOrInterface): Update.
18734 2004-06-03 Marek Safar <marek.safar@seznam.cz>
18737 (GetConditionalAttributeValue): New method. Returns
18738 condition of ConditionalAttribute.
18739 (SearchMulti): New method. Returns all attributes of type 't'.
18740 Use it when attribute is AllowMultiple = true.
18741 (IsConditionalMethodExcluded): New method.
18744 (Method.IsExcluded): Implemented. Returns true if method has conditional
18745 attribute and the conditions is not defined (method is excluded).
18746 (IMethodData): Extended interface for ConditionalAttribute support.
18747 (PropertyMethod.IsExcluded): Implemented.
18750 (MemberCore.Flags): Excluded_Undetected, Excluded new caching flags.
18753 (Invocation.IsMethodExcluded): Checks the ConditionalAttribute
18756 2004-06-02 Ben Maurer <bmaurer@users.sourceforge.net>
18758 * expression.cs (ArrayCreationExpression): Make this just an
18759 `expression'. It can't be a statement, so the code here was
18762 2004-06-02 Marek Safar <marek.safar@seznam.cz>
18765 * typemanager.cs (GetFullNameSignature): New method for
18768 2004-06-02 Marek Safar <marek.safar@seznam.cz>
18771 * class.cs (MemberBase.GetSignatureForError): New virtual method.
18772 Use this method when MethodBuilder is null.
18773 (MethodData.DefineMethodBuilder): Encapsulated code to the new method.
18774 Added test for error CS0626 (MONO reports error for this situation).
18775 (IMethodData.GetSignatureForError): Extended interface.
18777 2004-06-01 Marek Safar <marek.safar@seznam.cz>
18780 (AttributeTester.GetObsoleteAttribute): Returns instance of
18781 ObsoleteAttribute when type is obsolete.
18784 (TypeContainer.VerifyObsoleteAttribute): Override.
18785 (Method.GetSignatureForError): New method for usage when MethodBuilder is null.
18786 (MethodCode.VerifyObsoleteAttribute): Override.
18787 (MemberBase.VerifyObsoleteAttribute): Override.
18790 (MemberCore.CheckUsageOfObsoleteAttribute): Tests presence of ObsoleteAttribute
18791 and report proper error.
18794 Delegate.VerifyObsoleteAttribute): Override.
18797 (Expression.CheckObsoleteAttribute): Tests presence of ObsoleteAttribute
18798 and report proper error.
18799 (FieldExpr.DoResolve): Added tests for ObsoleteAttribute.
18802 (Enum.GetObsoleteAttribute): Returns ObsoleteAttribute for both enum type
18806 (Probe.DoResolve, Cast.DoResolve, LocalVariableReference.DoResolve,
18807 New.DoResolve, SizeOf.DoResolve, TypeOf.DoResolce, MemberAccess.DoResolve):
18808 Added test for ObsoleteAttribute.
18811 (Catch): Derived from Statement.
18813 2004-06-01 Marek Safar <marek.safar@seznam.cz>
18815 Fixed bug #59071 & cs0160.cs
18817 * statement.cs (Try.Resolve): Check here whether order of catch
18818 clauses matches their dependencies.
18820 2004-05-31 Miguel de Icaza <miguel@ximian.com>
18822 * Reverted patch to namespace.cs (Use lookuptypedirect). This
18823 caused a regression: #59343. Referencing nested classes from an
18824 assembly stopped working.
18826 2004-05-31 Martin Baulig <martin@ximian.com>
18828 MCS is now frozen for beta 2.
18830 2004-05-30 Ben Maurer <bmaurer@users.sourceforge.net>
18832 * convert.cs: add a trivial cache for overload operator resolution.
18834 2004-05-30 Ben Maurer <bmaurer@users.sourceforge.net>
18836 * decl.cs: If possible, use lookuptypedirect here. We can only do
18837 this if there is no `.' after the namespace. Avoids using
18838 LookupType, which does lots of slow processing.
18839 (FindNestedType) New method, does what it says :-).
18840 * namespace.cs: use LookupTypeDirect.
18841 * rootcontext.cs: use membercache, if possible.
18842 * typemanager.cs (LookupTypeDirect): Cache negative hits too.
18844 2004-05-30 Ben Maurer <bmaurer@users.sourceforge.net>
18847 According to the spec,
18849 In a member access of the form E.I, if E is a single identifier,
18850 and if the meaning of E as a simple-name (§7.5.2) is a constant,
18851 field, property, localvariable, or parameter with the same type as
18852 the meaning of E as a type-name (§3.8), then both possible
18853 meanings of E are permitted.
18855 We did not check that E as a simple-name had the same type as E as
18858 This trivial check gives us 5-7% on bootstrap time.
18860 2004-05-30 Ben Maurer <bmaurer@users.sourceforge.net>
18862 * expression.cs (Invocation.OverloadResolve): Avoid the
18863 use of hashtables and boxing here by allocating on demand.
18865 2004-05-30 Martin Baulig <martin@ximian.com>
18867 * rootcontext.cs (RootContext.LookupType): Don't cache things if
18868 we're doing a silent lookup. Don't try to lookup nested types in
18869 TypeManager.object_type (thanks to Ben Maurer).
18871 2004-05-30 Martin Baulig <martin@ximian.com>
18873 Committing a patch from Ben Maurer.
18875 * rootcontext.cs (RootContext.LookupType): Cache negative results.
18877 2004-05-29 Martin Baulig <martin@ximian.com>
18879 * class.cs (IMethodData.ShouldIgnore): New method.
18881 * typemanager.cs (TypeManager.MethodFlags): Don't take a
18882 `Location' argument, we don't need it anywhere. Use
18883 `IMethodData.ShouldIgnore ()' instead of
18884 `MethodData.GetMethodFlags ()'.
18885 (TypeManager.AddMethod): Removed.
18886 (TypeManager.AddMethod2): Renamed to AddMethod.
18888 2004-05-29 Martin Baulig <martin@ximian.com>
18890 Committing a patch from Benjamin Jemlich <pcgod@gmx.net>.
18892 * convert.cs (Convert.ImplicitReferenceConversion): If we're
18893 converting from a class type S to an interface type and we already
18894 have an object on the stack, don't box it again. Fixes #52578.
18896 2004-05-29 Martin Baulig <martin@ximian.com>
18898 * class.cs (ConstructorInitializer.GetOverloadedConstructor):
18899 Added support for `params' parameters. Fixes #59267.
18901 2004-05-29 Martin Baulig <martin@ximian.com>
18903 * literal.cs (NullPointer): Provide a private .ctor which sets
18904 `type' to TypeManager.object_type. Fixes #59048.
18906 2004-05-29 Martin Baulig <martin@ximian.com>
18908 * expression.cs (MemberAccess.ResolveMemberAccess): If we're an
18909 EventExpr, set `ee.InstanceExpression = left'. Fixes #59188.
18911 * ecore.cs (EventExpr.instance_expr): Make the field private.
18913 2004-05-26 Marek Safar <marek.safar@seznam.cz>
18915 Fixed bug #50080 & cs0214-2.cs
18916 * expression.cs (Cast.DoResolve): Check unsafe context here.
18918 * statement.cs (Resolve.DoResolve): Likewise.
18920 2004-05-26 Martin Baulig <martin@ximian.com>
18922 * namespace.cs (NamespaceEntry.Lookup): Added `bool silent'.
18924 * rootcontext.cs (RootContext.NamespaceLookup): Added `bool silent'.
18925 (RootContext.LookupType): Pass down the `silent' flag.
18927 2004-05-25 Martin Baulig <martin@ximian.com>
18930 (MethodGroupExpr.IdenticalTypeName): New public property.
18931 (Invocation.DoResolve): Don't report a CS0176 if the "instance"
18932 expression actually refers to a type.
18934 2004-05-25 Martin Baulig <martin@ximian.com>
18936 * expression.cs (Invocation.DoResolve): Applied Ben Maurer's patch
18937 for #56176 and made it actually work.
18939 2004-05-25 Martin Baulig <martin@ximian.com>
18941 * ecore.cs (Expression.CacheTemporaries): Make this virtual.
18942 (FieldExpr, PropertyExpr): Override and implement
18943 CacheTemporaries. Fixes #52279.
18945 2004-05-25 Miguel de Icaza <miguel@ximian.com>
18947 * location.cs: In the new compiler listing a file twice is a
18948 warning, not an error.
18950 2004-05-24 Martin Baulig <martin@ximian.com>
18952 * enum.cs (Enum.DefineType): For the `BaseType' to be a
18953 TypeLookupExpression; otherwise, report a CS1008. Fixes #58571.
18955 2004-05-24 Martin Baulig <martin@ximian.com>
18957 * decl.cs (DeclSpace.FindType): Try doing an alias lookup before
18958 walking the `using' list. Fixes #53921.
18960 2004-05-24 Martin Baulig <martin@ximian.com>
18962 * const.cs (Const.LookupConstantValue): Added support for
18963 EmptyCast's; fixes #55251.
18965 2004-05-24 Martin Baulig <martin@ximian.com>
18967 * ecore.cs (SimpleName.SimpleNameResolve): Renamed to
18968 DoSimpleNameResolve() and provide a SimpleNameResolve() wrapper
18969 which does the CS0135 check. The reason is that we first need to
18970 check whether the variable actually exists.
18972 2004-05-24 Martin Baulig <martin@ximian.com>
18974 * class.cs (MemberBase.DoDefine): Use DeclSpace.FindType() rather
18975 than RootContext.LookupType() to find the explicit interface
18976 type. Fixes #58584.
18978 2004-05-24 Raja R Harinath <rharinath@novell.com>
18980 * Makefile: Simplify. Use executable.make.
18981 * mcs.exe.sources: New file. List of sources of mcs.exe.
18983 2004-05-24 Anders Carlsson <andersca@gnome.org>
18987 Use the invariant culture when doing String.Compare for CLS case
18990 2004-05-23 Martin Baulig <martin@ximian.com>
18992 * decl.cs (DeclSpace.FindType): Only check the `using' list if we
18993 don't have any dots. Fixes #52622, added cs0246-8.cs.
18995 * namespace.cs (NamespaceEntry.Lookup): Likewise.
18997 2004-05-23 Marek Safar <marek.safar@seznam.cz>
18999 * class.cs (MemberBase.Define): Reuse MemberType member for
19000 resolved type. Other methods can use it too.
19002 2004-05-23 Martin Baulig <martin@ximian.com>
19004 * ecore.cs (SimpleName.SimpleNameResolve): Only report a CS0135 if
19005 the variable also exists in the current block (otherwise, we need
19006 to report a CS0103). Fixes #58670.
19008 2004-05-23 Martin Baulig <martin@ximian.com>
19010 * flowanalysis.cs (Reachability.Reachable): Compute this
19011 on-the-fly rather than storing it as a field.
19013 2004-05-23 Martin Baulig <martin@ximian.com>
19015 * flowanalysis.cs (Reachability.And): Manually compute the
19016 resulting `barrier' from the reachability.
19018 2004-05-23 Marek Safar <marek.safar@seznam.cz>
19021 * attribute.cs (AttributeTester.GetMethodObsoleteAttribute): Returns
19022 instance of ObsoleteAttribute when symbol is obsolete.
19025 (IMethodData): Extended interface for ObsoleteAttribute support.
19027 2004-05-22 Marek Safar <marek.safar@seznam.cz>
19029 * attribute.cs: Fix bug #55970
19031 2004-05-22 Marek Safar <marek.safar@seznam.cz>
19035 (GetObsoleteAttribute): New method. Creates the instance of
19037 (AttributeTester.GetMemberObsoleteAttribute): Returns instance of
19038 ObsoleteAttribute when member is obsolete.
19039 (AttributeTester.Report_ObsoleteMessage): Common method for
19040 Obsolete error/warning reporting.
19043 (TypeContainer.base_classs_type): New member for storing parent type.
19046 (MemberCore.GetObsoleteAttribute): Returns instance of ObsoleteAttribute
19047 for this MemberCore.
19049 2004-05-21 Marek Safar <marek.safar@seznam.cz>
19051 * attribute.cs, const.cs: Fix bug #58590
19053 2004-05-21 Martin Baulig <martin@ximian.com>
19055 * flowanalysis.cs (FlowBranching.MergeTopBlock): Don't check for
19056 out parameters if the end of the method is unreachable. Fixes
19059 2004-05-21 Marek Safar <marek.safar@seznam.cz>
19061 * codegen.cs, cs-parser.jay: Removed SetAttributes method.
19062 Hari was right, why extra method.
19064 2004-05-21 Marek Safar <marek.safar@seznam.cz>
19066 * attribute.cs, cs-parser.jay: Fix errors/cs0579-7.cs.
19068 2004-05-20 Martin Baulig <martin@ximian.com>
19070 Merged this back from gmcs to keep the differences to a minumum.
19072 * attribute.cs (Attribute.CheckAttributeType): Take an EmitContext
19073 instead of a Declspace.
19074 (Attribute.ResolveType): Likewise.
19075 (Attributes.Search): Likewise.
19076 (Attributes.Contains): Likewise.
19077 (Attributes.GetClsCompliantAttribute): Likewise.
19079 * class.cs (TypeContainer.VerifyMembers): Added EmitContext
19081 (MethodData.ApplyAttributes): Take an EmitContext instead of a
19084 2004-05-19 Marek Safar <marek.safar@seznam.cz>
19086 Fix bug #58688 (MCS does not report error when the same attribute
19089 * attribute.cs (Attribute.Emit): Distinction between null and default.
19091 2004-05-19 Raja R Harinath <rharinath@novell.com>
19093 * cs-parser.jay (attribute): Create a GlobalAttribute for the case
19094 of a top-level attribute without an attribute target.
19095 * attribute.cs (Attribute.Error_AttributeConstructorMismatch):
19097 (Attribute.Conditional_GetConditionName),
19098 (Attribute.Obsolete_GetObsoleteMessage): Update.
19099 (Attribute.IndexerName_GetIndexerName): New. Attribute-specific
19100 part of ScanForIndexerName.
19101 (Attribute.CanIgnoreInvalidAttribute): New function.
19102 (Attribute.ScanForIndexerName): Move to ...
19103 (Attributes.ScanForIndexerName): ... here.
19104 (Attributes.Attrs): Rename from now-misnamed AttributeSections.
19105 (Attributes.Search): New internal variant that can choose not to
19106 complain if types aren't resolved. The original signature now
19108 (Attributes.GetClsCompliantAttribute): Use internal variant, with
19109 complaints suppressed.
19110 (GlobalAttribute.CheckAttributeType): Overwrite ds.NamespaceEntry
19111 only if it not useful.
19112 (CanIgnoreInvalidAttribute): Ignore assembly attribute errors at
19113 top-level for attributes that are shared between the assembly
19114 and a top-level class.
19115 * parameter.cs (ImplicitParameter): Rename from ParameterAtribute.
19116 * class.cs: Update to reflect changes.
19117 (DefineIndexers): Fuse loops.
19118 * codegen.cs (GetAssemblyName): Update to reflect changes. Accept
19119 a couple more variants of attribute names.
19121 2004-05-18 Marek Safar <marek.safar@seznam.cz>
19123 Fix bug #52585 (Implemented explicit attribute declaration)
19126 (Attributable.ValidAttributeTargets): New abstract method. It gets
19127 list of valid attribute targets for explicit target declaration.
19128 (Attribute.Target): It holds target itself.
19129 (AttributeSection): Removed.
19130 (Attribute.CheckTargets): New method. It checks whether attribute
19131 target is valid for the current element.
19134 (EventProperty): New class. For events that are declared like
19135 property (with add and remove accessors).
19136 (EventField): New class. For events that are declared like field.
19139 * cs-parser.jay: Implemented explicit attribute target declaration.
19141 * class.cs, decl.cs, delegate.cs, enum.cs, parameter.cs:
19142 Override ValidAttributeTargets.
19145 (ReturnParameter): Class for applying custom attributes on
19147 (ParameterAtribute): New class. Class for applying custom
19148 attributes on the parameter type.
19150 2004-05-17 Miguel de Icaza <miguel@ximian.com>
19152 * class.cs (MemberBase.DoDefine): Pass UNSAFE on interface
19155 (Method): Allow UNSAFE here.
19157 * modifiers.cs: Support unsafe reporting.
19159 2004-05-17 Marek Safar <marek.safar@seznam.cz>
19161 * decl.cs: Fix bug #58478.
19163 2004-05-17 Gonzalo Paniagua Javier <gonzalo@ximian.com>
19165 * statement.cs: When checking for unreachable code on an EmptyStatement,
19166 set the location. Fixes bug #58488.
19168 2004-05-13 Miguel de Icaza <miguel@ximian.com>
19170 * driver.cs: Add -pkg handling.
19172 From Gonzalo: UseShelLExecute=false
19174 2004-05-12 Marek Safar <marek.safar@seznam.cz>
19177 (Attribute.GetAttributeTargets): New method. Gets AttributeTargets
19179 (Attribute.IsClsCompliaceRequired): Moved to base for better
19181 (Attribute.UsageAttribute): New property for AttributeUsageAttribute
19182 when attribute is AttributeUsageAttribute.
19183 (Attribute.GetValidTargets): Simplified.
19184 (Attribute.GetAttributeUsage): New method returns AttributeUsage
19185 attribute for this type.
19186 (Attribute.ApplyAttributes): Method renamed to Emit and make
19188 (GlobalAttributeSection): New class for special handling of global
19189 attributes (assembly, module).
19190 (AttributeSection.Emit): New method.
19192 * class.cs: Implemented Attributable abstract methods.
19193 (MethodCore.LabelParameters): Moved to Parameter class.
19194 (Accessor): Is back simple class.
19195 (PropertyMethod): Implemented Attributable abstract class.
19196 (DelegateMethod): Implemented Attributable abstract class.
19197 (Event): New constructor for disctintion between normal Event
19198 and Event with accessors.
19200 * cs-parser.jay: Used new Event ctor and GlobalAttributeSection.
19202 * codegen.cs, const.cs, decl.cs, delegate.cs:
19203 (CommonAssemblyModulClass): Implemented Attributable abstract class
19206 * enum.cs: Implement IAttributeSupport interface.
19207 (EnumMember): New class for emum members. Implemented Attributable
19211 (ParameterBase): Is abstract.
19212 (ReturnParameter): New class for easier [return:] attribute handling.
19214 * typemanager.cs: Removed builder_to_attr.
19216 2004-05-11 Raja R Harinath <rharinath@novell.com>
19219 * attribute.cs (Attribute.GetPositionalValue): New function.
19220 * class.cs (TypeContainer.VerifyMembers): New function.
19221 (TypeContainer.Emit): Use it.
19222 (ClassOrStruct): New base class for Class and Struct.
19223 (ClassOrStruct.ApplyAttributeBuilder): New function. Note if
19224 StructLayout(LayoutKind.Explicit) was ascribed to the struct or
19226 (ClassOrStruct.VerifyMembers): If the struct is explicitly laid out,
19227 then each non-static field should have a FieldOffset attribute.
19228 Otherwise, none of the fields should have a FieldOffset attribute.
19229 * rootcontext.cs (RootContext.ResolveCore): Resolve StructLayout
19230 and FieldOffset attributes.
19231 * typemanager.cs (TypeManager.struct_layout_attribute_type)
19232 (TypeManager.field_offset_attribute_type): New core types.
19233 (TypeManager.InitCoreTypes): Initialize them.
19235 2004-05-11 Michal Moskal <malekith@pld-linux.org>
19237 * class.cs (Event.RemoveDelegateMethod.DelegateMethodInfo):
19238 Return correct type.
19241 2004-05-09 Miguel de Icaza <miguel@ximian.com>
19243 * expression.cs (Binary.DoNumericPromotions): 0 long constant can
19244 be implicitly converted to ulong.
19246 * expression.cs: The logic for allowing operator &, | and ^ worked
19247 was wrong, it worked before because we did not report an error in
19248 an else branch. Fixes 57895.
19250 * class.cs: Applied patch from iain@mccoy.id.au Iain McCoy to
19251 allow volatile fields to be reference types.
19253 2004-05-07 Miguel de Icaza <miguel@ximian.com>
19255 * driver.cs: Add support for /debug-
19257 2004-05-07 Raja R Harinath <rharinath@novell.com>
19259 * attribute.cs (Attribute.CheckAttributeType, Attribute.ResolveType):
19260 Add a 'complain' parameter to silence errors.
19261 (Attribute.Resolve): Update to changes. Put in sanity check to catch
19262 silently overlooked type-resolutions.
19263 (Attribute.ScanForIndexerName, Attribute.DefinePInvokeMethod): Update
19264 to reflect changes.
19265 (Attributes.Search): New function.
19266 (Attributes.Contains, Attributes.GetClsCompliantAttribute): Use Search.
19267 (Attributes.GetAttributeFullName): Remove hack.
19268 * class.cs (MethodCore.LabelParameters, MethodData.ApplyAttributes):
19269 Update to reflect changes.
19270 * codegen.cs (CommonAssemblyModulClass.GetClsCompliantAttribute):
19271 Use Attributes.Search instead of nested loops.
19273 2004-05-07 Marek Safar <marek.safar@seznam.cz>
19276 (MemberCore.Flags): Extended for caching presence of CLSCompliantAttribute.
19277 (MemberCore.VerifyClsCompliance): Implemented CS3019 error report.
19278 (DeclSpace.GetClsCompliantAttributeValue): Returns simple bool.
19280 * report.cs: (Report.Warning): Renamed to Warning_T because of
19281 parameter collision.
19283 2004-05-05 Raja R Harinath <rharinath@novell.com>
19285 * expression.cs (MemberAccess.ResolveMemberAccess):
19286 Exit with non-zero status after Report.Error.
19287 * rootcontext.cs (RootContext.BootstrapCorlib_ResolveDelegate):
19289 * typemanager.cs (TypeManager.CoreLookupType): Likewise.
19291 2004-05-04 Lluis Sanchez Gual <lluis@ximian.com>
19293 * support.cs: Don't hang when the file is empty.
19295 2004-05-04 Lluis Sanchez Gual <lluis@ximian.com>
19297 * support.cs: In SeekableStreamReader, compute the preamble size of the
19298 underlying stream. Position changes should take into account that initial
19301 2004-05-03 Todd Berman <tberman@sevenl.net>
19303 * driver.cs: remove unused GetSysVersion function.
19305 2004-05-03 Todd Berman <tberman@sevenl.net>
19307 * driver.cs: Remove the hack from saturday, as well as the hack
19308 from jackson (LoadAssemblyFromGac), also adds the CWD to the
19309 link_paths to get that bit proper.
19311 2004-05-01 Todd Berman <tberman@sevenl.net>
19313 * driver.cs: Try a LoadFrom before a Load, this checks the current
19314 path. This is currently a bug in mono that is be fixed, however, this
19315 provides a workaround for now. This will be removed when the bug
19318 2004-05-01 Sebastien Pouliot <sebastien@ximian.com>
19320 * CryptoConvert.cs: Updated to latest version. Fix issue with
19321 incomplete key pairs (#57941).
19323 2004-05-01 Todd Berman <tberman@sevenl.net>
19325 * driver.cs: Remove '.' from path_chars, now System.* loads properly
19328 2004-04-30 Jackson Harper <jackson@ximian.com>
19330 * codegen.cs: Open keys readonly.
19332 2004-04-30 Gonzalo Paniagua Javier <gonzalo@ximian.com>
19334 * typemanager.cs: don't report cyclic struct layout when a struct
19335 contains 2 or more fields of the same type. Failed for Pango.AttrShape
19336 which has 2 Pango.Rectangle fields.
19338 2004-04-29 Ben Maurer <bmaurer@users.sourceforge.net>
19340 * expression.cs: Handle IntPtr comparisons with IL code
19341 rather than a method call.
19343 2004-04-29 Martin Baulig <martin@ximian.com>
19345 * ecore.cs (PropertyExpr.FindAccessor): New private method. Walk
19346 the list of PropertyInfo's in class hierarchy and find the
19347 accessor. Fixes #56013.
19349 2004-04-29 Martin Baulig <martin@ximian.com>
19351 * typemanager.cs (TypeManager.CheckStructCycles): Fixed.
19353 2004-04-29 Martin Baulig <martin@ximian.com>
19355 Applying a patch from Benjamin Jemlich <pcgod@gmx.net>.
19357 * ecore.cs (FieldExpr.AddressOf): Make this work for valuetypes.
19359 2004-04-29 Martin Baulig <martin@ximian.com>
19361 * class.cs (ConstructorInitializer.Resolve): Check whether the
19362 parent .ctor is accessible. Fixes #52146.
19364 2004-04-29 Martin Baulig <martin@ximian.com>
19366 Applying a patch from Benjamin Jemlich <pcgod@gmx.net>.
19368 * statement.cs (Using.EmitLocalVariableDecls): Use
19369 TypeManager.idisposable_type, not typeof (IDisposable).
19370 (Foreach.EmitCollectionForeach): Added support for valuetypes.
19372 2004-04-29 Martin Baulig <martin@ximian.com>
19374 * class.cs (Event.Define): Don't emit the field and don't set
19375 RTSpecialName and SpecialName for events on interfaces. Fixes
19378 2004-04-29 Raja R Harinath <rharinath@novell.com>
19380 Refactor Attribute.ApplyAttributes.
19381 * attribute.cs (Attributable): New base class for objects that can
19382 have Attributes applied on them.
19383 (Attribute): Make AttributeUsage fields public.
19384 (Attribute.GetFieldValue, Attribute.GetMarshal): Make non-static.
19385 (Attribute.IsInternalCall): New property.
19386 (Attribute.UsageAttr): Convert to a public read-only property.
19387 (Attribute.CheckAttributeType): Use a DeclSpace, not an EmitContext.
19388 (Attribute.ResolveType, Attribute.Resolve)
19389 (Attribute.ScanForIndexerName): Update to reflect changes.
19390 (Attribute.CheckAttributeTarget): Re-format.
19391 (Attribute.ApplyAttributes): Refactor, to various
19392 Attributable.ApplyAttributeBuilder methods.
19393 * decl.cs (MemberCore): Make Attributable.
19394 * class.cs (Accessor): Make Attributable.
19395 (MethodData.ApplyAttributes): Use proper attribute types, not
19397 (TypeContainer.LabelParameters): Pass Parameter to ApplyAttributes.
19398 (TypeContainer.ApplyAttributeBuilder)
19399 (Method.ApplyAttributeBuilder, Constructor.ApplyAttributeBuilder)
19400 (Field.ApplyAttributeBuilder, Accessor.ApplyAttributeBuilder)
19401 (PropertyBase.ApplyAttributeBuilder, Event.ApplyAttributeBuilder)
19402 (Operator.ApplyAttributeBuilder): New factored-out methods.
19403 * const.cs (Const.ApplyAttributeBuilder): Likewise.
19404 * delegate.cs (Delegate.ApplyAttributeBuilder): Likewise.
19405 * enum.cs (Enum.ApplyAttributeBuilder): Likewise.
19406 * parameter.cs (ParameterBase): New Attributable base class
19407 that can also represent Return types.
19408 (Parameter): Update to the changes.
19410 2004-04-29 Jackson Harper <jackson@ximian.com>
19412 * driver.cs: Prefer the corlib system version when looking for
19413 assemblies in the GAC. This is still a hack, but its a better hack
19416 2004-04-29 Marek Safar <marek.safar@seznam.cz>
19418 * decl.cs, enum.cs: Improved error 3005 reporting.
19420 * report.cs (SymbolRelatedToPreviousError): New method for error reporting.
19421 (related_symbols): New private member for list of symbols
19422 related to reported error/warning.
19424 * tree.cs: Do not use now obsolete Report.LocationOfPreviousError.
19426 2004-04-29 Martin Baulig <martin@ximian.com>
19428 * ecore.cs (Expression.Constantify): If we're an enum and
19429 TypeManager.TypeToCoreType() doesn't give us another type, use
19430 t.UnderlyingSystemType. Fixes #56178.
19432 2004-04-29 Martin Baulig <martin@ximian.com>
19434 * decl.cs (MemberCache.SetupCacheForInterface): Look over all our
19435 interfaces and for each interface, only add members directly
19436 declared in that interface. Fixes #53255.
19438 2004-04-28 Martin Baulig <martin@ximian.com>
19440 * expression.cs (ConditionalLogicalOperator): Use a temporary
19441 variable for `left' to avoid that we evaluate it more than once;
19444 2004-04-28 Martin Baulig <martin@ximian.com>
19446 * expression.cs (ComposedCast.DoResolveAsTypeStep): Don't allow
19449 2004-04-28 Martin Baulig <martin@ximian.com>
19451 * statement.cs (LocalInfo.Resolve): Check whether the type is not
19454 * class.cs (MemberBase.CheckParameters, FieldBase.DoDefine): Check
19455 whether the type is not void (CS1547).
19457 2004-04-28 Martin Baulig <martin@ximian.com>
19459 * expression.cs (Unary.DoResolveLValue): Override this and report
19460 CS0131 for anything but Operator.Indirection.
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 Committing a patch from Ben Maurer; see bug #50820.
19476 * typemanager.cs (TypeManager.FilterWithClosure): Added CS1540
19479 * ecore.cs (Expression.MemberLookupFailed): Added CS1540 check for
19482 2004-04-28 Martin Baulig <martin@ximian.com>
19484 * statement.cs (Block.LookupLabel): Also lookup in implicit child blocks.
19485 (Block.AddLabel): Call DoLookupLabel() to only search in the
19488 2004-04-28 Martin Baulig <martin@ximian.com>
19490 * cfold.cs (ConstantFold.BinaryFold): Added special support for
19491 comparing StringConstants and NullLiterals in Equality and Inequality.
19493 2004-04-28 Jackson Harper <jackson@ximian.com>
19495 * driver.cs: Attempt to load referenced assemblies from the
19496 GAC. This is the quick and dirty version of this method that
19497 doesnt take into account versions and just takes the first
19498 canidate found. Will be good enough for now as we will not have more
19499 then one version installed into the GAC until I update this method.
19501 2004-04-28 Martin Baulig <martin@ximian.com>
19503 * typemanager.cs (TypeManager.CheckStructCycles): New public
19504 static method to check for cycles in the struct layout.
19506 * rootcontext.cs (RootContext.PopulateTypes): Call
19507 TypeManager.CheckStructCycles() for each TypeContainer.
19508 [Note: We only need to visit each type once.]
19510 2004-04-28 Martin Baulig <martin@ximian.com>
19512 * constant.cs (StringConstant.Emit): Emit Ldnull if we're null.
19514 * const.cs (Const.LookupConstantValue): Return a `bool' signalling
19515 success and added `out object value'. Use a `bool resolved' field
19516 to check whether we've already been called rather than
19517 `ConstantValue != null' since this breaks for NullLiterals.
19519 2004-04-28 Raja R Harinath <rharinath@novell.com>
19521 * driver.cs (Driver.MainDriver) [IsModuleOnly]: Open code the
19522 setting of this flag, since the 'set' method may be non-public.
19524 2004-04-28 Raja R Harinath <rharinath@novell.com>
19526 * flowanalysis.cs (FlowBranchingException.LookupLabel): Add a null
19527 check on current_vector.Block.
19529 2004-04-27 Martin Baulig <martin@ximian.com>
19531 * expression.cs (BaseAccess.CommonResolve): Don't allow `base' in
19532 a field initializer. Fixes #56459.
19534 2004-04-27 Martin Baulig <martin@ximian.com>
19536 * ecore.cs (PropertyExpr.DoResolve/DoResolveLValue): Check whether
19537 we're not attempting to use an indexer. Fixes #52154.
19539 2004-04-27 Martin Baulig <martin@ximian.com>
19541 * statement.cs (Return): Don't create a return label if we don't
19542 need it; reverts my change from January 20th. Thanks to Ben
19545 2004-04-27 Martin Baulig <martin@ximian.com>
19547 According to the spec, `goto' can only leave a nested scope, but
19550 * statement.cs (Block.LookupLabel): Only lookup in the current
19551 block, don't recurse into parent or child blocks.
19552 (Block.AddLabel): Check in parent and child blocks, report
19553 CS0140/CS0158 if we find a duplicate.
19554 (Block): Removed this indexer for label lookups.
19555 (Goto.Resolve): Call LookupLabel() on our current FlowBranching;
19556 this already does the error reporting for us.
19559 (FlowBranching.UsageVector.Block): New public variable; may be null.
19560 (FlowBranching.CreateSibling): Added `Block' argument.
19561 (FlowBranching.LookupLabel): New public virtual method. Lookup a
19562 label for the target of a `goto' and check whether we're not
19563 leaving a `finally'.
19565 2004-04-27 Martin Baulig <martin@ximian.com>
19567 * flowanalysis.cs (FlowBranching.UsageVector.MergeChild): If we're
19568 a finite loop block, also do the ALWAYS->SOMETIMES for throws (not
19571 2004-04-27 Martin Baulig <martin@ximian.com>
19573 * statement.cs (Block.AddLabel): Also check for implicit blocks
19574 and added a CS0158 check.
19576 2004-04-27 Martin Baulig <martin@ximian.com>
19578 * flowanalysis.cs (FlowBranchingLoop): New class.
19579 (FlowBranching.UsageVector.MergeJumpOrigins): Take a list of
19580 UsageVector's instead of an ArrayList.
19581 (FlowBranching.Label): Likewise.
19582 (FlowBranching.UsageVector.MergeBreakOrigins): New method.
19583 (FlowBranching.AddBreakVector): New method.
19585 2004-04-27 Miguel de Icaza <miguel@ximian.com>
19587 * attribute.cs: Small regression fix: only convert the type if we
19588 the type is different, fixes System.Drawing build.
19590 2004-04-27 Martin Baulig <martin@ximian.com>
19592 * attribute.cs (Attribute.Resolve): If we have a constant value
19593 for a named field or property, implicity convert it to the correct
19596 2004-04-27 Raja R Harinath <rharinath@novell.com>
19598 * statement.cs (Block.Block): Implicit blocks share
19599 'child_variable_names' fields with parent blocks.
19600 (Block.AddChildVariableNames): Remove.
19601 (Block.AddVariable): Mark variable as "used by a child block" in
19602 every surrounding block.
19603 * ecore.cs (SimpleName.SimpleNameResolve): If the name has already
19604 been used in a child block, complain about violation of "Invariant
19605 meaning in blocks" rule.
19606 * cs-parser.jay (declare_local_variables): Don't use
19607 AddChildVariableNames.
19608 (foreach_statement): Don't create an implicit block: 'foreach'
19609 introduces a scope.
19611 2004-04-23 Miguel de Icaza <miguel@ximian.com>
19613 * convert.cs (ImplicitNumericConversion): 0 is also positive when
19614 converting from 0L to ulong. Fixes 57522.
19616 2004-04-22 Marek Safar <marek.safar@seznam.cz>
19618 * decl.cs (FindMemberToOverride): Fix wrong warning for case when
19619 derived class hides via 'new' keyword field from base class (test-242.cs).
19620 TODO: Handle this in the more general way.
19622 * class.cs (CheckBase): Ditto.
19624 2004-04-22 Marek Safar <marek.safar@seznam.cz>
19626 * decl.cs (caching_flags): New member for storing cached values
19628 (MemberCore.Flags): New enum where bit flags for caching_flags
19630 (MemberCore.cls_compliance): Moved to caching_flags.
19631 (DeclSpace.Created): Moved to caching_flags.
19633 * class.cs: Use caching_flags instead of DeclSpace.Created
19635 2004-04-21 Miguel de Icaza <miguel@ximian.com>
19637 * ecore.cs (PropertyExpr.GetAccesor): Only perform the 1540 check
19638 if we are only a derived class, not a nested class.
19640 * typemanager.cs: Same as above, but do this at the MemberLookup
19641 level (used by field and methods, properties are handled in
19642 PropertyExpr). Allow for the qualified access if we are a nested
19645 2004-04-21 Marek Safar <marek.safar@seznam.cz>
19647 * class.cs: Refactoring.
19648 (IMethodData): New inteface; Holds links to parent members
19649 to avoid member duplication (reduced memory allocation).
19650 (Method): Implemented IMethodData interface.
19651 (PropertyBase): New inner classes for get/set methods.
19652 (PropertyBase.PropertyMethod): Implemented IMethodData interface
19653 (Event): New inner classes for add/remove methods.
19654 (Event.DelegateMethod): Implemented IMethodData interface.
19656 * cs-parser.jay: Pass DeclSpace to Event class for creation of valid
19657 EmitContext (related to class.cs refactoring).
19659 2004-04-21 Raja R Harinath <rharinath@novell.com>
19661 * delegate.cs (Delegate.VerifyApplicability): If the number of
19662 arguments are the same as the number of parameters, first try to
19663 verify applicability ignoring any 'params' modifier on the last
19667 2004-04-16 Raja R Harinath <rharinath@novell.com>
19669 * class.cs (TypeContainer.AddIndexer): Use
19670 'ExplicitInterfaceName' to determine if interface name was
19671 explicitly specified. 'InterfaceType' is not initialized at this time.
19672 (TypeContainer.DefineIndexers): Remove use of temporary list. The
19673 Indexers array is already in the required order. Initialize
19674 'IndexerName' only if there are normal indexers.
19675 (TypeContainer.DoDefineMembers): Don't initialize IndexerName.
19676 (TypeContainer.Emit): Emit DefaultMember attribute only if
19677 IndexerName is initialized.
19680 2004-04-15 Benjamin Jemlich <pcgod@gmx.net>
19682 * enum.cs (Enum.DefineType): Don't allow char as type for enum.
19685 2004-04-15 Raja R Harinath <rharinath@novell.com>
19687 * attribute.cs (Attribute.CheckAttributeType): Check for ambiguous
19691 * attribute.cs (Attribute.Resolve): Check for duplicate named
19695 2004-04-15 Miguel de Icaza <miguel@ximian.com>
19697 * iterators.cs (MarkYield): track whether we are in an exception,
19698 and generate code accordingly. Use a temporary value to store the
19699 result for our state.
19701 I had ignored a bit the interaction of try/catch with iterators
19702 since their behavior was not entirely obvious, but now it is
19703 possible to verify that our behavior is the same as MS .NET 2.0
19707 2004-04-14 Miguel de Icaza <miguel@ximian.com>
19709 * iterators.cs: Avoid creating temporaries if there is no work to
19712 * expression.cs (ArrayAccess.EmitLoadOpcode): If dealing with
19713 Enumerations, use TypeManager.EnumToUnderlying and call
19716 Based on the patch from Benjamin Jemlich (pcgod@gmx.net), fixes
19719 (This.Emit): Use EmitContext.EmitThis to emit our
19722 (This.EmitAssign): Ditto.
19724 * ecore.cs (FieldExpr.Emit): Remove RemapToProxy special
19725 codepaths, we will move all the functionality into
19728 (FieldExpr.EmitAssign): Ditto.
19730 This fixes several hidden bugs that I uncovered while doing a code
19731 review of this today.
19733 * codegen.cs (EmitThis): reworked so the semantics are more clear
19734 and also support value types "this" instances.
19736 * iterators.cs: Changed so that for iterators in value types, we
19737 do not pass the value type as a parameter.
19739 Initialization of the enumerator helpers is now done in the caller
19740 instead of passing the parameters to the constructors and having
19741 the constructor set the fields.
19743 The fields have now `assembly' visibility instead of private.
19745 2004-04-11 Miguel de Icaza <miguel@ximian.com>
19747 * expression.cs (Argument.Resolve): Check if fields passed as ref
19748 or out are contained in a MarshalByRefObject.
19750 * typemanager.cs, rootcontext.cs: Add System.Marshalbyrefobject as
19751 another compiler type.
19753 2004-04-06 Ben Maurer <bmaurer@users.sourceforge.net>
19755 * class.cs (Indexer.Define): use the new name checking method.
19756 Also, return false on an error.
19757 * cs-tokenizer.cs (IsValidIdentifier): Checks for a valid identifier.
19758 (is_identifier_[start/part]_character): make static.
19760 2004-04-10 Miguel de Icaza <miguel@ximian.com>
19762 * expression.cs (Binary.ResolveOperator): Do no append strings
19763 twice: since we can be invoked more than once (array evaluation)
19764 on the same concatenation, take care of this here. Based on a fix
19765 from Ben (bug #56454)
19767 2004-04-08 Sebastien Pouliot <sebastien@ximian.com>
19769 * codegen.cs: Fix another case where CS1548 must be reported (when
19770 delay-sign isn't specified and no private is available #56564). Fix
19771 loading the ECMA "key" to delay-sign an assembly. Report a CS1548
19772 error when MCS is used on the MS runtime and we need to delay-sign
19773 (which seems unsupported by AssemblyBuilder - see #56621).
19775 2004-04-08 Marek Safar <marek.safar@seznam.cz>
19777 * typemanager.cs (TypeManager.TypeToCoreType): Handle IntPtr too.
19778 (TypeManager.ComputeNamespaces): Faster implementation for
19781 * compiler.csproj: Updated AssemblyName to mcs.
19783 2004-04-07 Miguel de Icaza <miguel@ximian.com>
19785 * rootcontext.cs: Add new types to the boot resolution.
19787 * ecore.cs (TypeExpr.CanInheritFrom): Inheriting from
19788 MulticastDelegate is not allowed.
19790 * typemanager.cs: Add new types to lookup: System.TypedReference
19793 * paramter.cs (Parameter.Resolve): if we are an out/ref parameter,
19794 check for TypedReference or ArgIterator, they are not allowed.
19796 * ecore.cs (BoxedCast): Set the eclass to ExprClass.Value, this
19797 makes us properly catch 1510 in some conditions (see bug 56016 for
19800 2004-04-06 Bernie Solomon <bernard@ugsolutions.com>
19802 * CryptoConvert.cs: update from corlib version
19805 2004-04-05 Miguel de Icaza <miguel@ximian.com>
19807 * class.cs (Indexer.Define): Check indexername declaration
19809 2004-04-05 Marek Safar <marek.safar@seznam.cz>
19811 * attribute.cs (IsClsCompliant): Fixed problem with handling
19812 all three states (compliant, not-compliant, undetected).
19814 2004-03-30 Marek Safar <marek.safar@seznam.cz>
19816 * attribute.cs (Attribute): Location is now public.
19817 (Resolve): Store resolved arguments (pos_values) in attribute class.
19818 Attribute extractors (now GetClsCompliantAttributeValue) can reuse them.
19819 (GetClsCompliantAttributeValue): New method that gets
19820 CLSCompliantAttribute value.
19821 (GetClsCompliantAttribute): Returns CLSCompliantAttribute for DeclSpace
19822 if exists else null.
19823 (AttributeTester): New class for CLS-Compliant verification routines.
19825 * class.cs (Emit): Add CLS-Compliant verification.
19826 (Method.GetSignatureForError): Implemented.
19827 (Constructor.GetSignatureForError): Implemented
19828 (Constructor.HasCompliantArgs): Returns if constructor has
19829 CLS-Compliant arguments.
19830 (Constructor.Emit): Override.
19831 (Construcor.IsIdentifierClsCompliant): New method; For constructors
19832 is needed to test only parameters.
19833 (FieldBase.GetSignatureForError): Implemented.
19834 (TypeContainer): New member for storing base interfaces.
19835 (TypeContainer.FindMembers): Search in base interfaces too.
19837 * codegen.cs (GetClsComplianceAttribute): New method that gets
19838 assembly or module CLSCompliantAttribute value.
19839 (ResolveClsCompliance): New method that resolve CLSCompliantAttribute
19841 (ModuleClass.Emit): Add error 3012 test.
19843 * const.cs (Emit): Override and call base for CLS-Compliant tests.
19845 * decl.cs (ClsComplianceValue): New enum that holds CLS-Compliant
19846 state for all decl types.
19847 (MemberCore.Emit): Emit is now virtual and call VerifyClsCompliance
19848 if CLS-Compliant tests are required.
19849 (IsClsCompliaceRequired): New method. Analyze whether code
19850 must be CLS-Compliant.
19851 (IsExposedFromAssembly): New method. Returns true when MemberCore
19852 is exposed from assembly.
19853 (GetClsCompliantAttributeValue): New method. Resolve CLSCompliantAttribute
19854 value or gets cached value.
19855 (HasClsCompliantAttribute): New method. Returns true if MemberCore
19856 is explicitly marked with CLSCompliantAttribute.
19857 (IsIdentifierClsCompliant): New abstract method. This method is
19858 used to testing error 3005.
19859 (IsIdentifierAndParamClsCompliant): New method. Common helper method
19860 for identifier and parameters CLS-Compliant testing.
19861 (VerifyClsCompliance): New method. The main virtual method for
19862 CLS-Compliant verifications.
19863 (CheckAccessLevel): In one special case (System.Drawing) was TypeBuilder
19864 null. I don't know why is null (too many public members !).
19865 (GetClsCompliantAttributeValue). New method. Goes through class hierarchy
19866 and get value of first CLSCompliantAttribute that found.
19868 * delegate.cs (Emit): Override and call base for CLS-Compliant tests.
19869 (VerifyClsCompliance): Override and add extra tests.
19871 * driver.cs (CSCParseOption): New command line options (clscheck[+|-]).
19872 clscheck- disable CLS-Compliant verification event if assembly is has
19873 CLSCompliantAttribute(true).
19875 * enum.cs (Emit): Override and call base for CLS-Compliant tests.
19876 ApllyAttribute is now called in emit section as in the other cases.
19877 Possible future Emit integration.
19878 (IsIdentifierClsCompliant): New override.
19879 (VerifyClsCompliance): New override.
19880 (GetEnumeratorName): Returns full enum name.
19882 * parameter.cs (GetSignatureForError): Implemented.
19884 * report.cs (WarningData): New struct for Warning message information.
19885 (LocationOfPreviousError): New method.
19886 (Warning): New method. Reports warning based on the warning table.
19887 (Error_T): New method. Reports error based on the error table.
19889 * rootcontext.cs (EmitCode): Added new Emit(s) because CLS-Compliant
19890 verifications are done here.
19892 * tree.cs (RecordDecl): Used new LocationOfPreviousError method.
19894 * typemanager.cs (cls_compliant_attribute_type): New member thath holds
19895 CLSCompliantAttribute.
19896 (all_imported_types): New member holds all imported types from other
19898 (LoadAllImportedTypes): New method fills static table with exported types
19899 from all referenced assemblies.
19900 (Modules): New property returns all assembly modules.
19902 2004-03-30 Miguel de Icaza <miguel@ximian.com>
19904 * cs-parser.jay: Add a rule to catch wrong event syntax instead of
19905 throwing a parser error.
19907 * ecore.cs (PropertyExpr.GetAccessor): Apply patch from Patrik Reali
19908 which removes the hardcoded get_/set_ prefixes for properties, as
19909 IL allows for the properties to be named something else.
19913 * expression.cs: Do not override operand before we know if it is
19914 non-null. Fix 56207
19916 2004-03-29 Ben Maurer <bmaurer@users.sourceforge.net>
19918 * typemanager.cs: support for pinned variables.
19920 2004-03-29 Ben Maurer <bmaurer@users.sourceforge.net>
19922 * decl.cs, typemanager.cs: Avoid using an arraylist
19923 as a buffer if there is only one result set.
19925 2004-03-29 Ben Maurer <bmaurer@users.sourceforge.net>
19927 * expression.cs: Make sure you cant call a static method
19928 with an instance expression, bug #56174.
19930 2004-03-29 Miguel de Icaza <miguel@ximian.com>
19932 * class.cs (IsDuplicateImplementation): Improve error reporting to
19933 flag 663 (method only differs in parameter modifier).
19935 * cs-tokenizer.cs: Do not require whitespace when a ( or " will do
19936 in preprocessor directives.
19938 * location.cs (LookupFile): Allow for the empty path.
19940 * attribute.cs (DefinePInvokeMethod): Fix 56148; I would like a
19941 better approach for some of that patch, but its failing with the
19942 CharSet enumeration. For now try/catch will do.
19944 * typemanager.cs: Do not crash if a struct does not have fields.
19947 2004-03-28 Ben Maurer <bmaurer@users.sourceforge.net>
19949 * expression.cs: cs0213, cant fix a fixed expression.
19952 2004-03-28 Ben Maurer <bmaurer@users.sourceforge.net>
19954 * cs-parser.jay: detect invalid embeded statements gracefully.
19957 2004-03-28 Ben Maurer <bmaurer@users.sourceforge.net>
19959 * ecore.cs, typemanager.cs: Correct impl of cs1540 check.
19962 the invocation type may not be a subclass of the tye of the item/
19963 The type of the item must be a subclass of the invocation item.
19968 2004-03-25 Sebastien Pouliot <sebastien@ximian.com>
19970 * attribute.cs: Added methods to get a string and a bool from an
19971 attribute. Required to information from AssemblyKeyFileAttribute,
19972 AttributeKeyNameAttribute (string) and AssemblyDelaySign (bool).
19973 * codegen.cs: Modified AssemblyName creation to include support for
19974 strongnames. Catch additional exceptions to report them as CS1548.
19975 * compiler.csproj: Updated include CryptoConvert.cs.
19976 * compiler.csproj.user: Removed file - user specific configuration.
19977 * CryptoConvert.cs: New. A COPY of the class CryptoConvert from
19978 Mono.Security assembly. The original class is maintained and tested in
19979 /mcs/class/Mono.Security/Mono.Security.Cryptography/CryptoConvert.cs.
19980 * drivers.cs: Added support for /keyfile, /keycontainer and /delaysign
19981 like CSC 8.0 (C# v2) supports.
19982 * Makefile: Added CryptoConvert.cs to mcs sources.
19983 * rootcontext.cs: Added new options for strongnames.
19985 2004-03-24 Ben Maurer <bmaurer@users.sourceforge.net>
19987 * driver.cs: For --expect-error, report error code `2'
19988 if the program compiled with no errors, error code `1' if
19989 it compiled with an error other than the one expected.
19991 2004-03-24 Sebastien Pouliot <sebastien@ximian.com>
19993 * compiler.csproj: Updated for Visual Studio .NET 2003.
19994 * compiler.csproj.user: Updated for Visual Studio .NET 2003.
19995 * compiler.sln: Updated for Visual Studio .NET 2003.
19997 2004-03-24 Ravi Pratap M <ravi@ximian.com>
19999 * expression.cs: Fix bug #47234. We basically need to apply the
20000 rule that we prefer the conversion of null to a reference type
20001 when faced with a conversion to 'object' (csc behaviour).
20003 2004-03-23 Ben Maurer <bmaurer@users.sourceforge.net>
20005 * statement.cs: Shorter form for foreach, eliminates
20006 a local variable. r=Martin.
20008 2004-03-23 Ben Maurer <bmaurer@users.sourceforge.net>
20010 * constant.cs, ecore.cs, literal.cs: New prop IsZeroInteger that
20011 checks if we can use brtrue/brfalse to test for 0.
20012 * expression.cs: use the above in the test for using brtrue/brfalse.
20013 cleanup code a bit.
20015 2004-03-23 Ben Maurer <bmaurer@users.sourceforge.net>
20017 * expression.cs: Rewrite string concat stuff. Benefits:
20019 - "a" + foo + "b" + "c" becomes "a" + foo + "bc"
20020 - "a" + foo + "b" + bar + "c" + baz ... uses concat (string []).
20021 rather than a concat chain.
20023 * typemanager.cs: Add lookups for more concat overloads.
20025 2004-03-23 Ben Maurer <bmaurer@users.sourceforge.net>
20027 * expression.cs: Emit shorter il code for array init.
20044 2004-03-22 Ben Maurer <bmaurer@users.sourceforge.net>
20046 * statement.cs: Before, two switch blocks would be merged if the
20047 total size of the blocks (end_item - begin_item + 1) was less than
20048 two times the combined sizes of the blocks.
20050 Now, it will only merge if after the merge at least half of the
20055 2004-03-20 Atsushi Enomoto <atsushi@ximian.com>
20057 * class.cs : csc build fix for GetMethods(). See bug #52503.
20059 2004-03-20 Ben Maurer <bmaurer@users.sourceforge.net>
20061 * expression.cs: Make sure fp comparisons work with NaN.
20062 This fixes bug #54303. Mig approved this patch a long
20063 time ago, but we were not able to test b/c the runtime
20066 2004-03-19 Miguel de Icaza <miguel@ximian.com>
20068 * ecore.cs (TypExpr.GetHashCode): implement this overload.
20070 2004-03-19 Martin Baulig <martin@ximian.com>
20072 * class.cs (MemberCore.IsDuplicateImplementation): Report the
20073 error here and not in our caller.
20075 2004-03-19 Martin Baulig <martin@ximian.com>
20077 * interface.cs: Completely killed this file.
20078 (Interface): We're now a TypeContainer and live in class.cs.
20080 * class.cs (TypeContainer.GetClassBases): Added `bool is_iface'
20081 argument; we're now also called for interfaces.
20082 (TypeContainer.DefineMembers): Allow this method being called
20084 (TypeContainer.GetMethods): New public method; formerly known as
20085 Interface.GetMethod(). This is used by PendingImplementation.
20086 (TypeContainer.EmitDefaultMemberAttr): Moved here from Interface;
20087 it's now private and non-static.
20088 (Interface): Moved this here; it's now implemented similar to
20090 (Method, Property, Event, Indexer): Added `bool is_interface'
20091 argument to their .ctor's.
20092 (MemberBase.IsInterface): New public field.
20094 * cs-parser.jay: Create normal Method, Property, Event, Indexer
20095 instances instead of InterfaceMethod, InterfaceProperty, etc.
20096 (opt_interface_base): Removed; we now use `opt_class_base' instead.
20097 (InterfaceAccessorInfo): Create `Get' and `Set' Accessor's.
20099 2004-03-19 Martin Baulig <martin@ximian.com>
20101 * class.cs (MethodCore.IsDuplicateImplementation): New private
20102 method which does the CS0111 checking.
20103 (Method.CheckBase, Constructor.CheckBase, PropertyBase.CheckBase):
20104 Use IsDuplicateImplementation().
20106 2004-03-17 Ben Maurer <bmaurer@users.sourceforge.net>
20108 * decl.cs (FindMemberToOverride): New method to find the correct
20109 method or property to override in the base class.
20111 - Make Method/Property use the above method to find the
20112 version in the base class.
20113 - Remove the InheritableMemberSignatureCompare as it is now
20116 This patch makes large code bases much faster to compile, as it is
20117 O(n) rather than O(n^2) to do this validation.
20119 Also, it fixes bug 52458 which is that nested classes are not
20120 taken into account when finding the base class member.
20122 Reviewed/Approved by Martin.
20124 2004-03-17 Marek Safar <marek.safar@seznam.cz>
20126 * interface.cs: In all interface classes removed redundant
20127 member initialization.
20129 2004-03-16 Martin Baulig <martin@ximian.com>
20131 * class.cs (TypeContainer.GetClassBases): Fix the CS0528 check.
20133 2004-03-15 Miguel de Icaza <miguel@ximian.com>
20135 * decl.cs (DefineTypeAndParents): New helper method to define a
20136 type's containers before the type itself is defined; This is a
20137 bug exposed by the recent changes to Windows.Forms when an
20138 implemented interface was defined inside a class that had not been
20141 * modifiers.cs (MethodAttr): All methods in C# are HideBySig.
20143 (Check): Loop correctly to report errors modifiers
20144 (UNSAFE was not in the loop, since it was the same as TOP).
20146 * interface.cs: Every interface member now takes a ModFlags,
20147 instead of a "is_new" bool, which we set on the base MemberCore.
20149 Every place where we called "UnsafeOk" in the interface, now we
20150 call the proper member (InterfaceMethod.UnsafeOK) instead to get
20151 the unsafe settings from the member declaration instead of the
20152 container interface.
20154 * cs-parser.jay (opt_new): Allow unsafe here per the spec.
20156 * pending.cs (TypeAndMethods): Add `get_indexer_name' and
20157 `set_indexer_name' to the pending bits (one per type).
20159 We fixed a bug today that was picking the wrong method to
20160 override, since for properties the existing InterfaceMethod code
20161 basically ignored the method name. Now we make sure that the
20162 method name is one of the valid indexer names.
20164 2004-03-14 Gustavo Giráldez <gustavo.giraldez@gmx.net>
20166 * support.cs (SeekableStreamReader): Keep track of stream byte
20167 positions and don't mix them with character offsets to the buffer.
20169 Patch from Gustavo Giráldez
20171 2004-03-15 Marek Safar <marek.safar@seznam.cz>
20173 * interface.cs (InterfaceSetGetBase): Removed double member
20174 initialization, base class does it as well.
20176 2004-03-13 Martin Baulig <martin@ximian.com>
20178 * class.cs: Reverted Miguel's latest commit; it makes mcs crash
20179 when compiling corlib.
20181 2004-03-13 Miguel de Icaza <miguel@ximian.com>
20183 * convert.cs (ExplicitConversion): We were reporting an error on
20184 certain conversions (object_type source to a value type, when the
20185 expression was `null') before we had a chance to pass it through
20186 the user defined conversions.
20188 * driver.cs: Replace / and \ in resource specifications to dots.
20191 * class.cs: Add check for duplicate operators. Fixes 52477
20193 2004-03-11 Miguel de Icaza <miguel@ximian.com>
20195 * statement.cs (Switch.SimpleSwitchEmit): Deal with default labels
20196 that are in the middle of the statements, not only at the end.
20199 * class.cs (TypeContainer.AddField): No longer set the
20200 `HaveStaticConstructor' flag, now we call it
20201 `UserDefineStaticConstructor' to diferentiate the slightly
20202 semantic difference.
20204 The situation is that we were not adding BeforeFieldInit (from
20205 Modifiers.TypeAttr) to classes that could have it.
20206 BeforeFieldInit should be set to classes that have no static
20211 http://www.yoda.arachsys.com/csharp/beforefieldinit.html
20213 And most importantly Zoltan's comment:
20215 http://bugzilla.ximian.com/show_bug.cgi?id=44229
20217 "I think beforefieldinit means 'it's ok to initialize the type sometime
20218 before its static fields are used', i.e. initialization does not need
20219 to be triggered by the first access to the type. Setting this flag
20220 helps the JIT to compile better code, since it can run the static
20221 constructor at JIT time, and does not need to generate code to call it
20222 (possibly lots of times) at runtime. Unfortunately, mcs does not set
20223 this flag for lots of classes like String.
20225 csc sets this flag if the type does not have an explicit static
20226 constructor. The reasoning seems to be that if there are only static
20227 initalizers for a type, and no static constructor, then the programmer
20228 does not care when this initialization happens, so beforefieldinit
20231 This bug prevents the AOT compiler from being usable, since it
20232 generates so many calls to mono_runtime_class_init that the AOT code
20233 is much slower than the JITted code. The JITted code is faster,
20234 because it does not generate these calls if the vtable is type is
20235 already initialized, which is true in the majority of cases. But the
20236 AOT compiler can't do this."
20238 2004-03-10 Miguel de Icaza <miguel@ximian.com>
20240 * class.cs (MethodData.Emit): Refactor the code so symbolic
20241 information is generated for destructors; For some reasons we
20242 were taking a code path that did not generate symbolic information
20245 2004-03-11 Ben Maurer <bmaurer@users.sourceforge.net>
20247 * class.cs: Create a Constructor.CheckBase method that
20248 takes care of all validation type code. The method
20249 contains some code that was moved from Define.
20251 It also includes new code that checks for duplicate ctors.
20252 This fixes bug #55148.
20254 2004-03-09 Joshua Tauberer <tauberer@for.net>
20256 * expression.cs (ArrayCreation): Fix: More than 6 nulls in
20257 a { ... }-style array creation invokes EmitStaticInitializers
20258 which is not good for reference-type arrays. String, decimal
20259 and now null constants (NullCast) are not counted toward
20260 static initializers.
20262 2004-03-05 Martin Baulig <martin@ximian.com>
20264 * location.cs (SourceFile.HasLineDirective): New public field;
20265 specifies whether the file contains or is referenced by a "#line"
20267 (Location.DefineSymbolDocuments): Ignore source files which
20268 either contain or are referenced by a "#line" directive.
20270 2004-02-29 Ben Maurer <bmaurer@users.sourceforge.net>
20272 * class.cs (Method.CheckBase): Avoid using FindMembers, we have
20273 direct access to our parent, so check the method inline there.
20275 2004-02-27 Ben Maurer <bmaurer@users.sourceforge.net>
20277 * expression.cs (Invocation.EmitCall): Miguel's last commit
20278 caused a regression. If you had:
20283 In Foo the implict this would be null.
20285 2004-02-27 Miguel de Icaza <miguel@ximian.com>
20287 * expression.cs (Invocation.EmitCall): If the method is not
20288 virtual, do not emit a CallVirt to it, use Call.
20290 * typemanager.cs (GetFullNameSignature): Improve the method to
20291 cope with ".ctor" and replace it with the type name.
20293 * class.cs (ConstructorInitializer.Resolve): Now the method takes
20294 as an argument the ConstructorBuilder where it is being defined,
20295 to catch the recursive constructor invocations.
20297 2004-02-26 Miguel de Icaza <miguel@ximian.com>
20299 * iterators.cs (IteratorHandler.IsIEnumerator, IsIEnumerable): New
20300 routines to check if a type is an enumerable/enumerator allow
20301 classes that implement the IEnumerable or IEnumerator interfaces.
20303 * class.cs (Property, Operator): Implement IIteratorContainer, and
20304 implement SetYields.
20306 (Property.Define): Do the block swapping for get_methods in the
20307 context of iterators. We need to check if Properties also
20308 include indexers or not.
20310 (Operator): Assign the Block before invoking the
20311 OperatorMethod.Define, so we can trigger the Iterator code
20314 * cs-parser.jay (SimpleIteratorContainer): new helper class. Both
20315 Property and Operator classes are not created when we parse the
20316 declarator but until we have the block completed, so we use a
20317 singleton SimpleIteratorContainer.Simple to flag whether the
20318 SetYields has been invoked.
20320 We propagate this setting then to the Property or the Operator to
20321 allow the `yield' to function.
20323 2004-02-25 Marek Safar <marek.safar@seznam.cz>
20325 * codegen.cs: Implemented attribute support for modules.
20326 New AssemblyClass, ModuleClass and CommonAssemblyModulClass for
20327 Assembly/Module functionality.
20329 * attribute.cs, class.cs, cs-parser.jay, delegate.cs, driver.cs, enum.cs
20330 interface.cs, rootcontext.cs, statement.cs, typemanager.cs:
20331 Updated dependencies on CodeGen.ModuleBuilder and CodeGen.AssemblyBuilder.
20333 2004-02-16 Marek Safar <marek.safar@seznam.cz>
20335 * interface.cs (FindMembers): The operation is performed on all base
20336 interfaces and not only on the first. It is required for future CLS Compliance patch.
20338 2004-02-12 Ben Maurer <bmaurer@users.sourceforge.net>
20340 * statement.cs, codegen.cs:
20341 This patch deals with patterns such as:
20343 public class List : IEnumerable {
20345 public MyEnumerator GetEnumerator () {
20346 return new MyEnumerator(this);
20349 IEnumerator IEnumerable.GetEnumerator () {
20353 public struct MyEnumerator : IEnumerator {
20358 Before, there were a few things we did wrong:
20359 1) we would emit callvirt on a struct, which is illegal
20360 2) we emited ldarg when we needed to emit ldarga
20361 3) we would mistakenly call the interface methods on an enumerator
20362 type that derived from IEnumerator and was in another assembly. For example:
20364 public class MyEnumerator : IEnumerator
20366 Would have the interface methods called, even if there were public impls of the
20367 method. In a struct, this lead to invalid IL code.
20369 2004-02-11 Marek Safar <marek.safar@seznam.cz>
20371 * const.cs: Const is now derived from FieldBase. Method EmitConstant name
20374 * delegate.cs (Define): Fixed crash when delegate type is undefined.
20376 2004-02-11 Miguel de Icaza <miguel@ximian.com>
20378 * cs-parser.jay: Fix small regression: we were not testing V2
20379 compiler features correctly.
20381 * interface.cs: If the emit context is null, then create one
20383 2004-02-09 Marek Safar <marek.safar@seznam.cz>
20385 * decl.cs (GetSignatureForError): New virtual method to get full name
20386 for error messages.
20388 * attribute.cs (IAttributeSupport): New interface for attribute setting.
20389 Now it is possible to rewrite ApplyAttributes method to be less if/else.
20391 * interface.cs : All InterfaceXXX classes are now derived from MemberCore.
20392 Duplicated members and code in these classes has been removed.
20393 Better encapsulation in these classes.
20395 2004-02-07 Miguel de Icaza <miguel@ximian.com>
20397 * assign.cs (Assign.DoResolve): When dealing with compound
20398 assignments, there is a new rule in ECMA C# 2.4 (might have been
20399 there before, but it is documented here) that states that in:
20403 If b is of type int, and the `op' is a shift-operator, then the
20404 above is evaluated as:
20408 * expression.cs (Binary.ResolveOperator): Instead of testing for
20409 int/uint/long/ulong, try to implicitly convert to any of those
20410 types and use that in pointer arithmetic.
20412 * delegate.cs (Error_NoMatchingMethodForDelegate): Compute the
20413 method to print information for from the type, not from the
20414 null-method we were given.
20416 2004-02-01 Duncan Mak <duncan@ximian.com>
20418 * cs-tokenizer.cs (get_cmd_arg): Skip over whitespace before
20419 parsing for cmd, fixes bug #53694.
20421 2004-02-04 Marek Safar <marek.safar@seznam.cz>
20423 * class.cs, decl.cs: Fixed problem where IndexerName attribute was ignored
20424 in the member name duplication tests. Property and operator name duplication
20425 was missing too (error tests cs0102-{2,3,4,5}.cs, cs0111-{3,4}.cs).
20427 2004-02-03 Marek Safar <marek.safar@seznam.cz>
20429 * interface.cs (PopulateMethod): Fixed crash when interface method
20430 returns not existing type (error test cs0246-3.cs).
20432 2004-02-02 Ravi Pratap M <ravi@ximian.com>
20434 * cs-parser.jay (interface_accessors): Re-write actions to also
20435 store attributes attached to get and set methods. Fix spelling
20438 (inteface_property_declaration): Modify accordingly.
20440 (InterfaceAccessorInfo): New helper class to store information to pass
20441 around between rules that use interface_accessors.
20443 * interface.cs (Emit): Apply attributes on the get and set
20444 accessors of properties and indexers too.
20446 * attribute.cs (ApplyAttributes): Modify accordingly to use the
20447 right MethodBuilder when applying attributes to the get and set accessors.
20449 2004-01-31 Miguel de Icaza <miguel@ximian.com>
20451 * cs-tokenizer.cs: Applied patch from Marek Safar to fix bug 53386
20453 2004-01-26 Miguel de Icaza <miguel@ximian.com>
20455 * cs-tokenizer.cs: Handle #line hidden from PDC bits.
20457 2004-01-25 Miguel de Icaza <miguel@ximian.com>
20459 * cs-parser.jay: Remove YIELD token, instead use the new grammar
20460 changes that treat `yield' specially when present before `break'
20461 or `return' tokens.
20463 * cs-tokenizer.cs: yield is no longer a keyword.
20465 2004-01-23 Marek Safar <marek.safar@seznam.cz>
20467 * cs-parser.jay, class.cs (DefineDefaultConstructor): Fixed ModFlags
20468 setting for default constructors.
20469 For default constructors are almost every time set wrong Modifier. The
20470 generated IL code has been alright. But inside mcs this values was
20471 wrong and this was reason why several of my CLS Compliance tests
20474 2004-01-22 Martin Baulig <martin@ximian.com>
20476 * cs-parser.jay (namespace_or_type_name): Return an Expression,
20477 not a QualifiedIdentifier. This is what `type_name_expression'
20478 was previously doing.
20479 (type_name_expression): Removed; the code is now in
20480 `namespace_or_type_name'.
20481 (qualified_identifier): Removed, use `namespace_or_type_name'
20483 (QualifiedIdentifier): Removed this class.
20485 2004-01-22 Martin Baulig <martin@ximian.com>
20487 * namespace.cs (NamespaceEntry.UsingAlias): Take an Expression,
20488 not a string as alias name.
20490 2004-01-21 Miguel de Icaza <miguel@ximian.com>
20492 * ecore.cs (FieldInfo.AddressOf): Revert patch from previous
20493 #52730 bug, and instead compute correctly the need to use a
20494 temporary variable when requesting an address based on the
20495 static/instace modified of the field and the constructor.
20497 2004-01-21 Martin Baulig <martin@ximian.com>
20499 * ecore.cs (SimpleName.ResolveAsTypeStep): Lookup in the current
20500 class and namespace before looking up aliases. Fixes #52517.
20502 2004-01-21 Martin Baulig <martin@ximian.com>
20504 * flowanalysis.cs (UsageVector.Merge): Allow variables being
20505 assinged in a 'try'; fixes exception4.cs.
20507 2004-01-21 Marek Safar <marek.safar@seznam.cz>
20508 * class.cs : Implemented parameter-less constructor for TypeContainer
20510 * decl.cs: Attributes are now stored here. New property OptAttributes
20512 * delegate.cs, enum.cs, interface.cs: Removed attribute member.
20514 * rootcontext.cs, tree.cs: Now use parameter-less constructor of TypeContainer
20516 2004-01-21 Marek Safar <marek.safar@seznam.cz>
20518 * typemanager.cs (CSharpSignature): Now reports also inner class name.
20519 (CSharpSignature): New method for indexer and property signature.
20521 2004-01-21 Marek Safar <marek.safar@seznam.cz>
20523 * pending.cs (IsVirtualFilter): Faster implementation.
20525 2004-01-21 Marek Safar <marek.safar@seznam.cz>
20527 * typemanager.cs: Avoid inclusion of same assembly more than once.
20529 2004-01-21 Marek Safar <marek.safar@seznam.cz>
20531 * cs-parser.jay: Fixed problem where the last assembly attribute
20532 has been applied also to following declaration (class, struct, etc.)
20534 2004-01-21 Marek Safar <marek.safar@seznam.cz>
20536 * class.cs: Added error CS0538, CS0539 reporting.
20537 Fixed crash on Microsoft runtime when field type is void.
20539 * cs-parser.jay: Added error CS0537 reporting.
20541 * pending.cs: Added error CS0535 reporting.
20542 Improved error report for errors CS0536, CS0534.
20544 2004-01-20 Miguel de Icaza <miguel@ximian.com>
20546 Merge a few bits from the Anonymous Method MCS tree.
20548 * statement.cs (ToplevelBlock): New class for toplevel methods,
20549 will hold anonymous methods, lifted variables.
20551 * cs-parser.jay: Create toplevel blocks for delegates and for
20552 regular blocks of code.
20554 2004-01-20 Martin Baulig <martin@ximian.com>
20556 * codegen.cs (EmitContext): Removed `InTry', `InCatch',
20557 `InFinally', `InLoop', `TryCatchLevel', `LoopBeginTryCatchLevel'
20558 and `NeedExplicitReturn'; added `IsLastStatement'.
20559 (EmitContext.EmitTopBlock): Emit the explicit "ret" if we either
20560 have a `ReturnLabel' or we're not unreachable.
20562 * flowanalysis.cs (FlowBranching.MergeChild): Actually merge the
20563 child's reachability; don't just override ours with it. Fixes
20564 #58058 (lluis's example).
20565 (FlowBranching): Added public InTryOrCatch(), InCatch(),
20566 InFinally(), InLoop(), InSwitch() and
20567 BreakCrossesTryCatchBoundary() methods.
20569 * statement.cs (Return): Do all error checking in Resolve().
20570 Unless we are the last statement in a top-level block, always
20571 create a return label and jump to it.
20572 (Break, Continue): Do all error checking in Resolve(); also make
20573 sure we aren't leaving a `finally'.
20574 (Block.DoEmit): Set `ec.IsLastStatement' when emitting the last
20575 statement in a top-level block.
20576 (Block.Flags): Added `IsDestructor'.
20577 (Block.IsDestructor): New public property.
20579 2004-01-20 Martin Baulig <martin@ximian.com>
20581 * statement.cs (Break.DoEmit): Set ec.NeedExplicitReturn; fixes #52427.
20583 2004-01-20 Martin Baulig <martin@ximian.com>
20585 * statement.cs (Statement.ResolveUnreachable): New public method.
20586 (If, While): Do the dead-code elimination in Resolve(), not in Emit().
20587 (Block.Resolve): Resolve unreachable statements.
20589 2004-01-19 Ben Maurer <bmaurer@users.sourceforge.net>
20591 * expression.cs: We need to fix the case where we do
20592 not have a temp variable here.
20594 * assign.cs: Only expression compound assignments need
20595 temporary variables.
20597 2004-01-19 Ben Maurer <bmaurer@users.sourceforge.net>
20599 * flowanalysis.cs: Reduce memory allocation in a few ways:
20600 - A block with no variables should not allocate a bit
20602 - A method with no out parameters does not need any tracking
20603 for assignment of the parameters, so we need not allocate
20606 public readonly Type[] VariableTypes;
20607 public readonly string[] VariableNames;
20608 Are redundant. The data is already stored in the variable
20609 map, so we need not allocate another array for it.
20610 - We need to add alot of checks for if (params | locals) == null
20611 due to the first two changes.
20613 2004-01-18 Miguel de Icaza <miguel@ximian.com>
20615 * ecore.cs (FieldExpr.AddressOf): For ValueTypes that do not
20616 implement IMemoryLocation, we store a copy on a local variable and
20617 take the address of it. Patch from Benjamin Jemlich
20619 * cs-parser.jay: Applied patch from Ben Maurer to the "type" rule
20620 to use a special "type_name_expression" rule which reduces the
20621 number of "QualifiedIdentifier" classes created, and instead
20622 directly creates MemberAccess expressions.
20624 2004-01-17 Miguel de Icaza <miguel@ximian.com>
20626 * convert.cs: Applied patch from Benjamin Jemlich (pcgod@gmx.net)
20627 that fixes #52853. Null literal assignment to ValueType
20629 * class.cs (MethodData.Emit): Instead of checking the name of the
20630 method to determine if its a destructor, create a new derived
20631 class from Method called Destructor, and test for that.
20633 * cs-parser.jay: Create a Destructor object instead of a Method.
20635 Based on a fix from Benjamin Jemlich (pcgod@gmx.net)
20639 2004-01-16 Miguel de Icaza <miguel@ximian.com>
20641 * expression.cs (Binary.ResolveOperator): Perform an implicit
20642 conversion from MethodGroups to their delegate types on the
20643 Addition operation.
20645 * delegate.cs: Introduce a new class DelegateCreation that is the
20646 base class for `NewDelegate' and `ImplicitDelegateCreation',
20647 factor some code in here.
20649 * convert.cs (Convert.ImplicitConversionStandard): Add an implicit
20650 conversion from MethodGroups to compatible delegate types.
20652 * ecore.cs (Expression.Resolve): Do not flag error 654
20653 (Methodgroupd needs parenthesis) if running on the V2 compiler, as
20654 we allow conversions from MethodGroups to delegate types now.
20656 * assign.cs (Assign.DoResolve): Do not flag errors on methodgroup
20657 assignments in v2 either.
20659 2004-01-10 Miguel de Icaza <miguel@ximian.com>
20661 * ecore.cs (FieldExpr.AddressOf): Fix generated IL for accessing
20662 static read-only fields in ctors.
20664 Applied patch from Benjamin Jemlich
20666 * expression.cs (UnaryMutator): Avoid leaking local variables.
20668 2004-01-09 Miguel de Icaza <miguel@ximian.com>
20670 * cs-tokenizer.cs (IsCastToken): Allow the various native types
20671 here to return true, as they can be used like this:
20673 (XXX) int.MEMBER ()
20675 Fixed 49836 and all the other dups
20677 2004-01-09 Zoltan Varga <vargaz@freemail.hu>
20679 * driver.cs: Implement /win32res and /win32icon.
20681 2004-01-08 Miguel de Icaza <miguel@ximian.com>
20683 * cs-parser.jay: Add a rule to improve error handling for the
20684 common mistake of placing modifiers after the type.
20686 2004-01-07 Miguel de Icaza <miguel@ximian.com>
20688 * cs-parser.jay (interface_event_declaration): Catch
20689 initialization of events on interfaces, and report cs0068
20691 * cs-parser.jay (interface_event_declaration): Catch
20692 initialization of events.
20694 * ecore.cs: Better report missing constructors.
20696 * expression.cs (Binary.ResolveOperator): My previous bug fix had
20697 the error reporting done in the wrong place. Fix.
20699 * expression.cs (Binary.ResolveOperator): Catch the
20700 operator + (E x, E y) error earlier, and later allow for implicit
20701 conversions in operator +/- (E e, U x) from U to the underlying
20704 * class.cs (TypeContainer.DefineDefaultConstructor): Fix bug
20705 52596, if the container class is abstract, the default constructor
20706 is protected otherwise its public (before, we were always public).
20708 * statement.cs (Fixed.Resolve): Catch a couple more errors in the
20711 (Using.EmitLocalVariableDecls): Applied patch from Benjamin
20712 Jemlich that fixes bug #52597, MCS was generating invalid code for
20713 idisposable structs. Thanks to Ben for following up with this
20716 2004-01-06 Miguel de Icaza <miguel@ximian.com>
20718 * driver.cs: Allow assemblies without code to be generated, fixes
20721 2004-01-07 Nick Drochak <ndrochak@gol.com>
20723 * attribute.cs: Remove unneeded catch variables. Eliminates a warning.
20725 2004-01-05 Miguel de Icaza <miguel@ximian.com>
20727 * cs-parser.jay: Add rules to improve error reporting if fields or
20728 methods are declared at the namespace level (error 116)
20730 * Add rules to catch event add/remove
20732 2004-01-04 David Sheldon <dave-mono@earth.li>
20734 * expression.cs: Added matching ")" to error message for
20737 2004-01-03 Todd Berman <tberman@gentoo.org>
20739 * ecore.cs, attribute.cs:
20740 Applying fix from #52429.
20742 2004-01-03 Ben Maurer <bmaurer@users.sourceforge.net>
20744 * ecore.cs, expression.cs, statement.cs:
20745 Total rewrite of how we handle branching. We
20746 now handle complex boolean expressions with fewer
20747 jumps. As well if (x == 0) no longer emits a ceq.
20749 if (x is Foo) is much faster now, because we generate
20752 Overall, we get a pretty big improvement on our benchmark
20753 tests. The code we generate is smaller and more readable.
20755 I did a full two-stage bootstrap. The patch was reviewed
20756 by Martin and Miguel.
20758 2004-01-03 Ben Maurer <bmaurer@users.sourceforge.net>
20760 * cs-parser.jay: Make primary_expression not take a QI.
20761 we dont need this because the member_access rule covers
20762 us here. So we replace the rule with just IDENTIFIER.
20764 This has two good effects. First, we remove a s/r conflict.
20765 Second, we allocate many fewer QualifiedIdentifier objects.
20767 2004-01-03 Ben Maurer <bmaurer@users.sourceforge.net>
20769 * attribute.cs: Handle MarshalAs attributes as pseudo, and
20770 set the correct information via SRE. This prevents
20771 hanging on the MS runtime. Fixes #29374.
20773 2004-01-03 Ben Maurer <bmaurer@users.sourceforge.net>
20775 * convert.cs: correctly handle conversions to value types
20776 from Enum and ValueType as unboxing conversions.
20778 Fixes bug #52569. Patch by Benjamin Jemlich.
20780 2004-01-02 Ravi Pratap <ravi@ximian.com>
20782 * expression.cs (BetterConversion): Prefer int -> uint
20783 over int -> ulong (csc's behaviour). This fixed bug #52046.
20785 2004-01-02 Ben Maurer <bmaurer@users.sourceforge.net>
20787 * decl.cs (MemberCache.FindMembers): now returns a
20790 * typemanager.cs: In general, go with with ^^.
20791 (CopyNewMethods): take an IList.
20792 (RealMemberLookup): Only allocate an arraylist
20793 if we copy from two sets of methods.
20795 This change basically does two things:
20796 1) Fewer array lists allocated due to CopyNewMethods.
20797 2) the explicit cast in MemberList costed ALOT.
20799 2004-01-02 Zoltan Varga <vargaz@freemail.hu>
20801 * cs-tokenizer.cs (consume_identifier) driver.cs: Cache identifiers in
20802 a hashtable to avoid needless string allocations when an identifier is
20803 used more than once (the common case).
20805 2004-01-01 Ben Maurer <bmaurer@users.sourceforge.net>
20807 * pending.cs: MS's TypeBuilder.GetInterfaces ()
20808 is broken, it will not return anything. So, we
20809 have to use the information we have in mcs to
20812 * typemanager.cs: Add a cache for GetInterfaces,
20813 since this will now be used more often (due to ^^)
20815 (GetExplicitInterfaces) New method that gets the
20816 declared, not effective, interfaces on a type
20817 builder (eg, if you have interface IFoo, interface
20818 IBar, Foo : IFoo, Bar : Foo, IBar, GetExplInt (Bar) ==
20821 This patch makes MCS able to bootstrap itself on
20824 2004-01-01 Ben Maurer <bmaurer@users.sourceforge.net>
20826 * expression.cs: Remove the Nop's that Miguel put
20829 2003-12-31 Ben Maurer <bmaurer@users.sourceforge.net>
20831 * report.cs, codegen.cs: Give the real stack trace to
20832 the error when an exception is thrown.
20834 2003-12-31 Ben Maurer <bmaurer@users.sourceforge.net>
20836 * decl.cs: only allocate hashtables for ifaces if
20839 2003-12-31 Ben Maurer <bmaurer@users.sourceforge.net>
20841 * expression.cs: fix the error from cs0121-2.cs
20842 (a parent interface has two child interfaces that
20843 have a function with the same name and 0 params
20844 and the function is called through the parent).
20846 2003-12-30 Ben Maurer <bmaurer@users.sourceforge.net>
20848 * class.cs, rootcontext.cs, typmanager.cs: do not
20851 2003-12-28 Ben Maurer <bmaurer@users.sourceforge.net>
20853 * codegen.cs: remove stack for the ec flow branching.
20854 It is already a linked list, so no need.
20856 2003-12-27 Ben Maurer <bmaurer@users.sourceforge.net>
20858 * Makefile: Allow custom profiler here.
20860 2003-12-26 Ben Maurer <bmaurer@users.sourceforge.net>
20862 * typemanager.cs (LookupType):
20863 - Use a static char [], because split takes
20864 a param array for args, so it was allocating
20866 - Do not store true in a hashtable, it boxes.
20868 2003-12-26 Ben Maurer <bmaurer@users.sourceforge.net>
20870 * flowanalysis.cs: bytify common enums.
20872 2003-12-25 Ben Maurer <bmaurer@users.sourceforge.net>
20874 * modifiers.cs: Add a new set of flags for the
20875 flags allowed on explicit interface impls.
20876 * cs-parser.jay: catch the use of modifiers in
20877 interfaces correctly.
20878 * class.cs: catch private void IFoo.Blah ().
20880 All related to bug #50572.
20882 2003-12-25 Ben Maurer <bmaurer@users.sourceforge.net>
20884 * decl.cs: Rewrite the consistant accessability checking.
20885 Accessability is not linear, it must be implemented in
20886 a tableish way. Fixes #49704.
20888 2003-12-25 Ben Maurer <bmaurer@users.sourceforge.net>
20890 * expression.cs: Handle negation in a checked context.
20891 We must use subtraction from zero. Fixes #38674.
20893 2003-12-23 Ben Maurer <bmaurer@users.sourceforge.net>
20895 * class.cs: Ignore static void main in DLLs.
20896 * rootcontext.cs: Handle the target type here,
20897 since we are have to access it from class.cs
20898 * driver.cs: account for the above.
20900 2003-12-23 Ben Maurer <bmaurer@users.sourceforge.net>
20902 * report.cs: Give line numbers and files if available.
20904 2003-12-20 Zoltan Varga <vargaz@freemail.hu>
20906 * driver.cs: Implement /addmodule.
20908 * typemanager.cs: Change 'modules' field so it now contains Modules not
20911 2003-12-20 Martin Baulig <martin@ximian.com>
20913 * class.cs (TypeContainer.DefineMembers): Don't do the CS0649 check here.
20914 (FieldBase.IsAssigned): Removed this field.
20915 (FieldBase.SetAssigned): New public method.
20916 (TypeContainer.Emit): Make the CS0169/CS0649 checks actually work.
20918 2003-12-20 Martin Baulig <martin@ximian.com>
20920 * expression.cs (LocalVariableReference.DoResolve): Don't set
20921 `vi.Used' if we're called from DoResolveLValue().
20923 * statement.cs (Block.DoResolve): `ec.DoEndFlowBranching()' now
20924 returns the usage vector it just merged into the current one -
20925 pass this one to UsageWarning().
20926 (Block.UsageWarning): Take the `FlowBranching.UsageVector' instead
20927 of the `EmitContext', don't call this recursively on our children.
20929 2003-12-19 Zoltan Varga <vargaz@freemail.hu>
20931 * driver.cs: Implement /target:module.
20933 2003-12-18 Zoltan Varga <vargaz@freemail.hu>
20935 * support.cs (CharArrayHashtable): New helper class.
20937 * cs-tokenizer.cs: Store keywords in a hashtable indexed by
20938 char arrays, not strings, so we can avoid creating a string in
20939 consume_identifier if the identifier is a keyword.
20941 2003-12-16 Martin Baulig <martin@ximian.com>
20943 * statement.cs (LocalInfo.Assigned): Removed this property.
20944 (LocalInfo.Flags): Removed `Assigned'.
20945 (LocalInfo.IsAssigned): New public method; takes the EmitContext
20946 and uses flow analysis.
20947 (Block.UsageWarning): Made this method private.
20948 (Block.Resolve): Call UsageWarning() if appropriate.
20950 * expression.cs (LocalVariableReference.DoResolve): Always set
20951 LocalInfo.Used here.
20953 2003-12-13 Martin Baulig <martin@ximian.com>
20955 * statement.cs (Statement.DoEmit, Statement.Emit): Don't return
20956 any value here; we're now using flow analysis to figure out
20957 whether a statement/block returns a value.
20959 2003-12-13 Martin Baulig <martin@ximian.com>
20961 * flowanalysis.cs (UsageVector.MergeFinallyOrigins): Made this
20963 (FlowBranching.MergeFinally): Don't call
20964 `branching.CheckOutParameters()' here, this is called in
20966 (FlowBranchingException.AddSibling): Call MergeFinallyOrigins()
20967 when adding the `finally' vector.
20969 2003-12-13 Martin Baulig <martin@ximian.com>
20972 (UsageVector.MergeJumpOrigins, FlowBranching.Label): Make this
20973 actually work and also fix #48962.
20975 2003-12-12 Ben Maurer <bmaurer@users.sourceforge.net>
20977 * decl.cs: Do not check System.Object for nested types,
20978 since we know it does not have any. Big bang for buck:
20981 Run 1: 8.35 seconds
20982 Run 2: 8.32 seconds
20983 corlib: 17.99 seconds
20985 Run 1: 8.17 seconds
20986 Run 2: 8.17 seconds
20987 corlib: 17.39 seconds
20989 2003-12-11 Ben Maurer <bmaurer@users.sourceforge.net>
20991 * class.cs (FindMembers): Allocate arraylists on demand. Most of the
20992 time we are returning 0 members, so we save alot here.
20994 2003-12-11 Martin Baulig <martin@ximian.com>
20996 * flowanalysis.cs (UsageVector.MergeResult): Renamed this back to
20997 `MergeChild()', also just take the `FlowBranching' as argument;
20998 call Merge() on it and return the result.
20999 (FlowBranching.Merge): We don't need to do anything if we just
21002 2003-12-11 Martin Baulig <martin@ximian.com>
21004 * flowanalysis.cs: Use a list of `UsageVector's instead of storing
21005 them in an `ArrayList' to reduce memory usage. Thanks to Ben
21006 Maurer for this idea.
21008 2003-12-11 Martin Baulig <martin@ximian.com>
21010 * flowanalysis.cs (MergeResult): This class is now gone; we now
21011 use the `UsageVector' for this. The reason for this is that if a
21012 branching just has one sibling, we don't need to "merge" them at
21013 all - that's the next step to do.
21014 (FlowBranching.Merge): We now return a `UsageVector' instead of a
21017 2003-12-11 Martin Baulig <martin@ximian.com>
21019 Reworked flow analyis and made it more precise and bug-free. The
21020 most important change is that we're now using a special `Reachability'
21021 class instead of having "magic" meanings of `FlowReturns'. I'll
21022 do some more cleanups and optimizations and also add some more
21023 documentation this week.
21025 * flowanalysis.cs (Reachability): Added `Throws' and `Barrier';
21026 largely reworked this class.
21027 (FlowReturns): Removed `Unreachable' and `Exception'; we now use
21028 the new `Reachability' class instead of having "magic" values here.
21029 (FlowBranching): We're now using an instance of `Reachability'
21030 instead of having separate `Returns', `Breaks' etc. fields.
21032 * codegen.cs (EmitContext.EmitTopBlock): Set `has_ret' solely
21033 based on flow analysis; ignore the return value of block.Emit ().
21035 2003-12-10 Zoltan Varga <vargaz@freemail.hu>
21037 * driver.cs typemanager.cs: Find the mono extensions to corlib even
21038 if they are private.
21040 2003-12-09 Martin Baulig <martin@ximian.com>
21042 * flowanalyis.cs (FlowBranching.Return, Goto, Throw): Removed;
21043 call them directly on the UsageVector.
21045 2003-12-09 Martin Baulig <martin@ximian.com>
21047 * flowanalysis.cs (FlowBranching.MergeChild, MergeTopBlock):
21048 Changed return type from `FlowReturns' to `Reachability'.
21050 2003-12-09 Martin Baulig <martin@ximian.com>
21052 * flowanalysis.cs (FlowBranching.Reachability): New sealed class.
21053 (FlowBranching.MergeResult): Replaced the `Returns', `Breaks' and
21054 `Reachable' fields with a single `Reachability' one.
21056 2003-12-08 Ben Maurer <bmaurer@users.sourceforge.net>
21058 * class.cs (FindMembers): Remove foreach's.
21063 Run 1: 8.74 seconds
21064 Run 2: 8.71 seconds
21067 Run 1: 8.64 seconds
21068 Run 2: 8.58 seconds
21071 2003-12-08 Ben Maurer <bmaurer@users.sourceforge.net>
21076 This patch does a few things:
21077 1. EmptyStatement is now a singleton, so it is never reallocated.
21078 2. All blah is EmptyStatement constructs have been changed to
21079 blah == EmptyStatement.Value, which is much faster and valid
21080 now that EmptyStatement is a singleton.
21081 3. When resolving a block, rather than allocating a new array for
21082 the non-empty statements, empty statements are replaced with
21083 EmptyStatement.Value
21084 4. Some recursive functions have been made non-recursive.
21085 Mainly the performance impact is from (3), however (1) and (2) are needed for
21086 this to work. (4) does not make a big difference in normal situations, however
21087 it makes the profile look saner.
21092 9.25user 0.23system 0:10.28elapsed 92%CPU (0avgtext+0avgdata 0maxresident)k
21093 9.34user 0.13system 0:10.23elapsed 92%CPU (0avgtext+0avgdata 0maxresident)k
21094 Total memory allocated: 56397 KB
21097 9.13user 0.09system 0:09.64elapsed 95%CPU (0avgtext+0avgdata 0maxresident)k
21098 8.96user 0.24system 0:10.13elapsed 90%CPU (0avgtext+0avgdata 0maxresident)k
21099 Total memory allocated: 55666 KB
21101 2003-12-08 Ben Maurer <bmaurer@users.sourceforge.net>
21103 * support.cs: Rewrite DoubleHash to use its own impl. Is faster
21104 than the hashtable in a hashtable version
21106 * decl.cs: Right now, whenever we try to lookup a type inside a namespace,
21107 we always end up concating a string. This results in a huge perf
21108 loss, because many strings have to be tracked by the GC. In this
21109 patch, we first use a hashtable that works with two keys, so that
21110 the strings do not need to be concat'ed.
21114 Run 1: 8.74 seconds
21115 Run 2: 8.71 seconds
21118 Run 1: 8.65 seconds
21119 Run 2: 8.56 seconds
21121 2003-12-08 Ben Maurer <bmaurer@users.sourceforge.net>
21123 * Makefile: Add a new target `do-time' that does a quick and simple
21124 profile, leaving easy to parse output.
21126 2003-12-08 Zoltan Varga <vargaz@freemail.hu>
21128 * codegen.cs (Init): Create the dynamic assembly with
21129 AssemblyBuilderAccess.Save, to enable some optimizations in the runtime.
21131 2003-12-02 Ben Maurer <bmaurer@users.sourceforge.net>
21133 * support.cs: Make the PtrHashtable use only one
21134 instance of its comparer.
21136 2003-11-30 Zoltan Varga <vargaz@freemail.hu>
21138 * typemanager.cs: Fix lookup of GetNamespaces.
21140 2003-11-29 Miguel de Icaza <miguel@ximian.com>
21142 * expression.cs: Removed redundant line.
21144 * statement.cs (Block.Resolve, Block.Emit): Avoid foreach on
21145 ArrayLists, use for loops with bounds.
21147 * flowanalysis.cs (FlowBranching.Merge): Avoid foreach on
21150 * expression.cs (Invocation.OverloadResolve): Avoid foreach on
21151 arraylists, use for loop with bounds.
21153 The above three changes give us a 0.071 second performance
21154 improvement out of 3.294 seconds down to 3.223. On my machine
21155 the above changes reduced the memory usage by 1,387 KB during
21156 compiler bootstrap.
21158 * cs-parser.jay (QualifiedIdentifier): New class used to represent
21159 QualifiedIdentifiers. Before we created a new string through
21160 concatenation, and mostly later on, the result would be
21161 manipulated by DecomposeQI through string manipulation.
21163 This reduced the compiler memory usage for bootstrapping from
21164 59380 KB to 59007 KB on my machine, 373 KB, and also reduced the
21165 compile times in 0.05 seconds.
21167 2003-11-28 Dick Porter <dick@ximian.com>
21169 * support.cs: Do string compares with the Invariant culture.
21177 * class.cs: Use the char forms of IndexOf and LastIndexOf, so that
21178 the comparison is done with the Invariant culture.
21180 2003-11-27 Miguel de Icaza <miguel@ximian.com>
21182 * statement.cs (Foreach.TryType): Use DeclaredOnly to find the
21183 GetEnumerator method.
21185 (ProbeCollectionType): Iterate starting at the most specific type
21186 upwards looking for a GetEnumerator
21188 * expression.cs: Shift count can be up to 31 for int/uint and 63
21191 2003-11-26 Miguel de Icaza <miguel@ximian.com>
21193 * statement.cs (Block.LookupLabel): Also look for the label on the
21194 children blocks. Use a hash table to keep track of visited
21197 * cfold.cs (IntConstant to UIntConstant mapping): Only return if
21198 we actually did transform the other operand, otherwise fall back
21199 to the common codepath that casts to long.
21201 * cs-tokenizer.cs: Use the same code pattern as the int case.
21202 Maybe I should do the parsing myself, and avoid depending on the
21203 Parse routines to get this done.
21205 2003-11-25 Miguel de Icaza <miguel@ximian.com>
21207 * expression.cs: Apply fix from l_m@pacbell.net (Laurent Morichetti),
21208 which fixes bug 51347. This time test it.
21210 * expression.cs: Make TypeOfVoid derive from TypeOf, so code in
21211 attributes for example can not tell the difference between these.
21212 The difference was only a syntax feature of the language.
21214 * attribute.cs: Apply attributes to delegates.
21216 * delegate.cs: Call the apply attributes method.
21218 2003-11-24 Miguel de Icaza <miguel@ximian.com>
21220 * convert.cs (TryImplicitIntConversion): One line bug fix: we were
21221 comparing 0 vs Byte.MinValue, not the value
21223 (ImplicitConversionRequired): When reporting a conversion error,
21224 use error 31 to print out the constant error instead of the
21227 * expression.cs: Apply fix from l_m@pacbell.net (Laurent Morichetti),
21228 which fixes bug 51347.
21230 2003-11-22 Miguel de Icaza <miguel@ximian.com>
21232 * driver.cs: Applied patch from gert.driesen@pandora.be (Gert Driesen)
21233 which fixes the -warnaserror command line option.
21235 2003-11-21 Miguel de Icaza <miguel@ximian.com>
21237 * cfold.cs (DoNumericPromotions): During constant folding of
21238 additions on UIntConstant, special case intconstants with
21239 IntConstants like we do on the expression binary operator.
21241 2003-11-12 Miguel de Icaza <miguel@ximian.com>
21243 * convert.cs (ImplicitReferenceConversion): We were missing a case
21244 (System.Enum are not value types or class types, so we need to
21245 classify them separatedly).
21247 * driver.cs: We do not support error 2007.
21249 2003-11-12 Jackson Harper <jackson@ximian.com>
21251 * driver.cs: Use corlib.dll or mscorlib.dll when looking up the
21252 system directory. Also use the full file name so users can
21253 libraries names mscorlib-o-tron.dll in a non system dir.
21255 2003-11-10 Martin Baulig <martin@ximian.com>
21257 * typemanager.cs (TypeManager.ResolveExpressionTypes): Removed.
21258 (TypeManager.InitCoreTypes): Initialize them here, but instead of
21259 calling `ResolveType()' on them, directly assign their `Type'.
21261 2003-11-08 Martin Baulig <martin@ximian.com>
21263 * class.cs (TypeContainer.GetClassBases): Use TypeExpr's for the
21264 return value and the `out parent' parameter.
21265 (TypeContainer.DefineType): Moved the CS0644 check into
21266 GetClassBases(). Don't pass the interface types to the
21267 `builder.DefineType()'/`builder.DefineNestedType()', but resolve
21268 them later and then call `TypeBuilder.AddInterfaceImplementation()'.
21270 * ecore.cs (TypeExpr.IsAttribute): New property.
21271 (TypeExpr.GetInterfaces): New method.
21273 * interface.cs (Interface.GetInterfaceTypeByName): Return a
21274 TypeExpr instead of a Type.
21275 (Interface.GetInterfaceBases): Return TypeExpr's instead of Type's.
21276 (Interface.DefineType): Don't pass the interface types to the
21277 `builder.Definetype()'/`builder.DefineNestedType()', but resolve
21278 them later and then call `TypeBulider.AddInterfaceImplementation()'.
21280 * typemanager.cs (TypeManager.AddUserType): Take a `TypeExpr[]'
21281 instead of a `Type[]'.
21282 (TypeManager.RegisterBuilder): Likewise.
21283 (TypeManager.AddUserInterface): Likewise.
21284 (TypeManager.ExpandInterfaces): Take a `Type[]' instead of a
21285 `Type[]' and also return a `TypeExpr[]'.
21286 (TypeManager.GetInterfaces): Return a `TypeExpr[]'.
21288 2003-11-08 Martin Baulig <martin@ximian.com>
21290 * decl.cs (DeclSpace.ResolveTypeExpr): Return a TypeExpr, not an
21293 2003-11-08 Martin Baulig <martin@ximian.com>
21295 * decl.cs (DeclSpace.GetTypeResolveEmitContext): Call
21296 TypeManager.ResolveExpressionTypes().
21298 * ecore.cs (Expression.ResolveAsTypeTerminal): Return a TypeExpr
21299 instead of an Expression.
21300 (TypeExpr): This is now an abstract base class for `TypeExpression'.
21301 (TypeExpression): New public class; formerly known as `TypeExpr'.
21303 * expression.cs (ComposedCast): Derive from TypeExpr.
21305 * typemanager.cs (TypeManager.system_*_expr): These are now
21306 TypExpr's instead of Expression's.
21307 (TypeManager.ResolveExpressionTypes): New public static function;
21308 called from DeclSpace.GetTypeResolveEmitContext() to resolve all
21311 2003-11-06 Miguel de Icaza <miguel@ximian.com>
21313 * expression.cs (New.DoResolve): Do not dereference value that
21314 might be a null return.
21316 * statement.cs (Block.EmitMeta): Use the Const.ChangeType to make
21317 sure that the constant value has the right type. Fixes an
21318 unreported bug, similar to 50425.
21320 * const.cs (Const.LookupConstantValue): Call
21321 ImplicitStandardConversionExists before doing a conversion to
21322 avoid havng the TypeManager.ChangeType do conversions.
21324 Reduced the number of casts used
21326 (Const.ChangeType): New routine to enable reuse of the constant
21327 type changing code from statement.
21329 * typemanager.cs (ChangeType): Move common initialization to
21330 static global variables.
21334 * convert.cs (ImplicitReferenceConversion): Somehow we allowed
21335 every value type to go through, even if it was void. Fix that.
21337 * cs-tokenizer.cs: Use is_identifier_start_character on the start
21338 character of the define, and the is_identifier_part_character for
21339 the rest of the string.
21341 2003-11-05 Miguel de Icaza <miguel@ximian.com>
21343 * expression.cs (UnaryMutator.EmitCode): When I updated
21344 LocalVariableReference.DoResolve, I overdid it, and dropped an
21345 optimization done on local variable references.
21347 2003-11-04 Miguel de Icaza <miguel@ximian.com>
21349 * ecore.cs: Convert the return from Ldlen into an int.
21351 2003-10-20 Miguel de Icaza <miguel@ximian.com>
21353 * decl.cs (DeclSpace.GetAccessLevel): Handle NotPublic case for
21354 the accessibility, this is a special case for toplevel non-public
21355 classes (internal for instance).
21357 2003-10-20 Nick Drochak <ndrochak@gol.com>
21359 * ecore.cs: Fix typo and build. Needed another right paren.
21361 2003-10-19 Miguel de Icaza <miguel@ximian.com>
21363 * ecore.cs: Applied fix from Ben Maurer. We were handling in the
21364 `internal' case regular and protected, but not allowing protected
21365 to be evaluated later. Bug 49840
21367 2003-10-15 Miguel de Icaza <miguel@ximian.com>
21369 * statement.cs (Switch.TableSwitchEmit): Compare the upper bound
21370 to kb.Nlast, and not the kb.nFirst to isolate the switch
21373 Extract the underlying type, so enumerations of long/ulong are
21374 treated like long/ulong.
21376 2003-10-14 Miguel de Icaza <miguel@ximian.com>
21378 * expression.cs (New): Overload the meaning of RequestedType to
21379 track the possible creation of the NewDelegate type, since
21380 DoResolve is invoked more than once for new constructors on field
21383 See bugs: #48800 and #37014
21385 * cs-parser.jay (declare_local_constants): Take an arraylist
21386 instead of a single constant.
21388 (local_constant_declaration): It should take a
21389 constant_declarators, not a constant_declarator. Fixes 49487
21391 * convert.cs: Fix error report.
21393 2003-10-13 Jackson Harper <jackson@ximian.com>
21395 * typemanager.cs (TypeToCoreType): Add float and double this fixes
21398 2003-10-09 Martin Baulig <martin@ximian.com>
21400 * class.cs (MethodCore): Added additional `DeclSpace ds' argument
21402 (MethodCore.DoDefineParameters): Removed the TypeContainer
21403 argument; use the DeclSpace which was passed to the .ctor instead.
21404 (MethodCore.CheckParameter): Take a DeclSpace instead of a
21405 TypeContainer; we only need a DeclSpace here.
21407 2003-10-09 Martin Baulig <martin@ximian.com>
21409 * class.cs (MethodData): Added additional `DeclSpace ds' argument
21411 (MethodData.Define, MethodData.Emit): Pass the `ds' to the
21412 EmitContext's .ctor.
21414 2003-10-09 Martin Baulig <martin@ximian.com>
21416 * decl.cs (DeclSpace.AsAccessible): Moved here from TypeContainer.
21417 (AccessLevel, CheckAccessLevel, GetAccessLevel): They're used by
21418 AsAccessible(), moved them as well.
21420 * class.cs (TypeContainer.AsAccessible): Moved to DeclSpace.
21422 2003-10-08 Atsushi Enomoto <ginga@kit.hi-ho.ne.jp>
21424 * cs-parser.jay : Renamed yyName to yyNames related to jay.
21426 2003-10-07 Miguel de Icaza <miguel@ximian.com>
21428 * expression.cs (Binary.Emit.GreatherThanOrEqual): Fix the code
21429 generation for >=, as spotted by Paolo, bug 48679.
21430 Patch from David Waite.
21432 * cs-tokenizer.cs: Add handling for #pragma.
21434 * cs-parser.jay: Allow for both yield and yield return in the
21435 syntax. The anti-cobolization of C# fight will go on!
21437 * class.cs (TypeBuilder.DefineType): Catch error condition here
21438 (Parent.DefineType erroring out and returning null).
21440 * expression.cs (ArrayCreation.EmitDynamicInitializers): When
21441 coping with enumerations variables, we were mistakenly processing
21442 them as a regular value type instead of built-in types. Fixes the
21445 * typemanager.cs (IsBuiltinOrEnum): New method.
21447 2003-09-30 Miguel de Icaza <miguel@ximian.com>
21449 * cs-parser.jay: Upgrade: yield now needs the return clause.
21451 2003-09-19 Martin Baulig <martin@ximian.com>
21453 * decl.cs (MemberCache.SetupCacheForInterface): Take a
21454 `MemberCache parent' argument. Normally, an interface doesn't
21455 have a parent type except System.Object, but we use this in gmcs
21456 for generic type parameters.
21458 2003-09-18 Martin Baulig <martin@ximian.com>
21460 * typemanager.cs (TypeHandle.ctor): Set `IsInterface' solely based
21461 on `type.IsInterface'; don't check whether the type has a parent
21462 to determine whether it's an interface.
21464 2003-09-15 Martin Baulig <martin@ximian.com>
21466 * class.cs (TypeContainer.DefineType): Added an error flag to
21467 avoid reporting duplicate CS0146's ("class definition is
21470 * driver.cs (Driver.MainDriver): Abort if
21471 RootContext.ResolveTree() reported any errors.
21473 2003-09-07 Martin Baulig <martin@ximian.com>
21475 * report.cs (Error, Warning): Added overloaded versions which take
21476 a `params object[] args' and call String.Format().
21478 2003-09-07 Martin Baulig <martin@ximian.com>
21480 * decl.cs (DeclSpace..ctor): Don't call
21481 NamespaceEntry.DefineName() here; do it in RecordDecl() which is
21482 called from Tree.RecordDecl(). Fixes the CS0101 reporting.
21483 (DeclSpace.RecordDecl): New method.
21485 * tree.cs (Tree.RecordDecl): Call ds.RecordDecl().
21487 2003-09-02 Ravi Pratap <ravi@ximian.com>
21489 * attribute.cs (CheckAttributeTarget): Ensure that we allow return
21490 value attributes to be applied to ParameterBuilders.
21492 * class.cs (MethodCore.LabelParameters): Make static and more
21493 generic so that it can be used from other places - like interface
21494 methods, for instance.
21496 * interface.cs (Interface.Emit): Call LabelParameters before
21497 emitting attributes on the InterfaceMethod.
21499 2003-08-26 Martin Baulig <martin@ximian.com>
21501 * ecore.cs (SimpleName.SimpleNameResolve): Look for members before
21502 resolving aliases; fixes #47927.
21504 2003-08-26 Martin Baulig <martin@ximian.com>
21506 * statement.cs (Using.DoResolve): This is internally emitting a
21507 try/finally clause, so we need to set ec.NeedExplicitReturn if we
21508 do not always return. Fixes #47681.
21510 2003-08-26 Martin Baulig <martin@ximian.com>
21512 * decl.cs (MemberCore): Moved WarningNotHiding(),
21513 Error_CannotChangeAccessModifiers() and CheckMethodAgainstBase()
21515 (AdditionResult): Make this nested in DeclSpace.
21516 (DeclSpace.ctor): The .ctor now takes an additional NamespaceEntry
21517 argument; call NamespaceEntry.Define() unless we're nested in a
21520 * namespace.cs (Namespace.DefineName): New public function. This
21521 is called from DeclSpace's .ctor to add
21522 (Namespace.Lookup): Include DeclSpaces in the lookup.
21524 * class.cs (Operator): Derive from MemberBase, not MemberCore.
21526 * const.cs (Const): Derive from MemberBase, not MemberCore.
21528 2003-08-25 Martin Baulig <martin@ximian.com>
21530 * convert.cs (Convert.ExplicitReferenceConversion): When
21531 converting from an interface type to a class, unbox if the target
21532 type is a struct type. Fixes #47822.
21534 2003-08-24 Gonzalo Paniagua Javier <gonzalo@ximian.com>
21536 * typemanager.cs: fixed the values of MethodFlags. Closes #47855 and
21539 2003-08-22 Martin Baulig <martin@ximian.com>
21541 * class.cs (TypeManager.DefineType): When defining a nested type,
21542 call DefineType() on our parent; fixes #47801.
21544 2003-08-22 Martin Baulig <martin@ximian.com>
21546 * class.cs (MethodData.Define): While checking if a method is an
21547 interface implementation, improve the test a bit more to fix #47654.
21549 2003-08-22 Martin Baulig <martin@ximian.com>
21551 * expression.cs (Probe.DoResolve): Check whether `expr' resolved
21552 correctly; fixes #47722.
21554 2003-08-22 Martin Baulig <martin@ximian.com>
21556 * expression.cs (UnaryMutator.ResolveVariable): If the target is a
21557 LocalVariableReference, ensure it's not read-only. Fixes #47536.
21559 * statement.cs (Fixed.DoResolve): Make all variables read-only.
21561 2003-08-22 Martin Baulig <martin@ximian.com>
21563 * ecore.cs (FieldExpr.DoResolveLValue): Static read-only fields
21564 can only be assigned in static constructors. Fixes #47161.
21566 2003-08-22 Martin Baulig <martin@ximian.com>
21568 Rewrote and improved the flow analysis code.
21570 * flowbranching.cs (FlowBranching): Make this class abstract.
21571 (FlowBranching.CreateBranching): New static function to create a
21572 new flow branching.
21573 (FlowBranchingBlock, FlowBranchingException): New classes.
21574 (FlowBranching.UsageVector.Type): New public readonly field.
21575 (FlowBranching.UsageVector.Breaks): Removed the setter.
21576 (FlowBranching.UsageVector.Returns): Removed the setter.
21577 (FlowBranching.UsageVector): Added Break(), Return(),
21578 NeverReachable() and Throw() methods to modify the reachability.
21579 (FlowBranching.UsageVector.MergeChildren): Removed, this is now
21580 done by FlowBranching.Merge().
21581 (FlowBranching.UsageVector.MergeChild): New method; merges the
21582 merge result into the current vector.
21583 (FlowBranching.Merge): New abstract method to merge a branching.
21585 2003-08-12 Martin Baulig <martin@ximian.com>
21587 * expression.cs (Indirection.CacheTemporaries): Create the
21588 LocalTemporary with the pointer type, not its element type.
21590 2003-08-10 Miguel de Icaza <miguel@ximian.com>
21592 * cs-parser.jay: FIRST_KEYWORD, LAST_KEYWORD: used to know if a
21593 token was a keyword or not.
21595 Add `error' options where an IDENTIFIER was expected; Provide
21596 CheckToken and CheckIdentifierToken convenience error reporting
21599 Do not use `DeclSpace.Namespace', use `DeclSpace.NamespaceEntry'.
21601 * decl.cs: Rename `NamespaceEntry Namespace' public field into
21602 NameSpaceEntry NameSpaceEntry.
21604 (LookupInterfaceOrClass): Avoid creating a full qualified name
21605 from namespace and name: avoid doing lookups when we know the
21606 namespace is non-existant. Use new Tree.LookupByNamespace which
21607 looks up DeclSpaces based on their namespace, name pair.
21609 * driver.cs: Provide a new `parser verbose' to display the
21610 exception thrown during parsing. This is turned off by default
21611 now, so the output of a failure from mcs is more graceful.
21613 * namespace.cs: Track all the namespaces defined in a hashtable
21616 (IsNamespace): New method
21618 2003-08-09 Miguel de Icaza <miguel@ximian.com>
21620 * namespace.cs: Remove redundant call; Avoid using MakeFQN when
21621 we know that we need to concatenate (full typename can never be
21626 * statement.cs: Use a bitfield; Do not initialize to null things
21627 which are done by the constructor by default.
21629 * cs-parser.jay: bug fix, parameter was 4, not 3.
21631 * expression.cs: Just use the property;
21633 * statement.cs: No need for GetVariableInfo method.
21635 2003-08-08 Martin Baulig <martin@ximian.com>
21637 * flowanalysis.cs (FlowReturns): This is now nested in the
21638 `FlowBranching' class.
21639 (MyBitVector): Moved this here from statement.cs.
21640 (FlowBranching.SiblingType): New enum type.
21641 (FlowBranching.CreateSibling): Added `SiblingType' argument.
21643 2003-08-07 Martin Baulig <martin@ximian.com>
21645 * flowanalysis.cs (FlowBranchingType): This is now nested in the
21646 `FlowBranching' class and called `BranchingType'.
21648 2003-08-07 Martin Baulig <martin@ximian.com>
21650 * flowanalysis.cs: Moved all the control flow analysis code into
21653 2003-08-07 Martin Baulig <martin@ximian.com>
21655 * assign.cs (Assign.DoResolve): `target' must either be an
21656 IAssignMethod or an EventAccess; report a CS0131 otherwise. Fixes
21659 2003-08-07 Miguel de Icaza <miguel@ximian.com>
21661 * expression.cs (BinaryMethod): This kind of expression is created by the
21662 Binary class if it determines that the operator has to be handled
21665 (BinaryDelegate): This kind of expression is created if we are
21666 dealing with a + or - operator on delegates.
21668 (Binary): remove method, argumetns, and DelegateOperator: when
21669 dealing with methods,
21671 * ecore.cs (EventExpr.EmitAddOrRemove): Update to new layout.
21673 * statement.cs (Block): use bitfields for the three extra booleans
21674 we had in use. Remove unused topblock parameter.
21676 * codegen.cs: Remove unecessary argument to Block.EmitTopBlock
21678 * assign.cs: Drop extra unneeded tests.
21680 2003-08-06 Miguel de Icaza <miguel@ximian.com>
21682 * iterators.cs (Mapvariable): provide a mechanism to use prefixes.
21684 * statement.cs (Foreach): Use VariableStorage instead of
21687 * codegen.cs (VariableStorage): New class used by clients that
21688 require a variable stored: locals or fields for variables that
21689 need to live across yield.
21691 Maybe provide a convenience api for EmitThis+EmitLoad?
21693 (GetTemporaryLocal, FreeTemporaryLocal): Recycle
21696 2003-08-05 Miguel de Icaza <miguel@ximian.com>
21698 * codegen.cs (RemapLocal, RemapLocalLValue, RemapParameter,
21699 RemapParameterLValue): New methods that are used to turn a
21700 precomputed FieldInfo into an expression like this:
21704 The idea is to use this instead of making LocalVariableReference
21705 have more than one meaning.
21707 * cs-parser.jay: Add error production to BASE.
21709 * ecore.cs: Deal with TypeManager.GetField returning null, which
21710 is now a valid return value.
21712 (FieldExprNoAddress): New expression for Fields whose address can
21715 * expression.cs (LocalVariableReference): During the resolve
21716 phases, create new expressions if we are in a remapping context.
21717 Remove code that dealt with remapping here.
21719 (ParameterReference): same.
21721 (ProxyInstance): New expression, like the `This' expression, but
21722 it is born fully resolved. We know what we are doing, so remove
21723 the errors that are targeted to user-provided uses of `this'.
21725 * statement.cs (Foreach): our variable is now stored as an
21726 Expression; During resolution, follow the protocol, dont just
21727 assume it will return this.
21729 2003-08-06 Martin Baulig <martin@ximian.com>
21731 * support.cs (SeekableStreamReader.cs): New public class.
21733 * cs-tokenizer.cs, cs-parser.jay, driver.cs: Use the new
21734 SeekableStreamReader instead of the normal StreamReader.
21736 2003-08-04 Martin Baulig <martin@ximian.com>
21738 * cs-parser.jay (CLOSE_PARENS_CAST, CLOSE_PARENS_NO_CAST,
21739 CLOSE_PARENS_OPEN_PARENS, CLOSE_PARENS_MINUS): New tokens to
21740 deambiguate casts and delegate invocations.
21741 (parenthesized_expression): Use the new tokens to ensure this is
21742 not a cast of method invocation.
21744 * cs-tokenizer.cs (is_punct): Return one of the new special tokens
21745 when reading a `)' and Deambiguate_CloseParens () was previously
21748 * expression.cs (ParenthesizedExpression): New class. This is
21749 just used for the CS0075 test.
21750 (Binary.DoResolve): Check for CS0075.
21752 2003-07-29 Ravi Pratap <ravi@ximian.com>
21754 * expression.cs (Invocation.MakeUnionSet): Patch from Lluis
21755 Sanchez : use TypeManager.ArrayContainsMethod instead of a direct
21756 reference comparison.
21758 (TypeManager.ArrayContainsMethod): When we have a MethodInfo, also
21759 examine the ReturnType for equality - this is necessary in the
21760 cases of implicit and explicit operators whose signature also
21761 includes the return type.
21763 2003-07-26 Miguel de Icaza <miguel@ximian.com>
21765 * namespace.cs: Cache the result of the namespace computation,
21766 instead of computing it every time.
21768 2003-07-24 Miguel de Icaza <miguel@ximian.com>
21770 * decl.cs: Use a global arraylist that we reuse over invocations
21771 to avoid excesive memory consumption. Reduces memory usage on an
21772 mcs compile by one meg (45 average).
21774 * typemanager.cs (LookupTypeReflection): In .NET pointers are
21775 private, work around that.
21777 2003-07-23 Miguel de Icaza <miguel@ximian.com>
21779 * literal.cs (IntLiteral): Define Zero and One static literals.
21781 * cs-parser.jay (integer_literal): use static literals to reduce
21782 memory usage for the most used literals (0, 1 and -1). 211kb
21783 reduced in memory usage.
21785 Replace all calls to `new ArrayList' with `new
21786 ArrayList(4)' which is a good average number for most allocations,
21787 and also requires only 16 bytes of memory for its buffer by
21790 This reduced MCS memory usage in seven megabytes for the RSS after
21793 2003-07-28 Ravi Pratap <ravi@ximian.com>
21795 * expression.cs (Invocation.OverloadResolve): Fix the algorithm to
21796 handle params methods the correct way by forming only one
21797 applicable set with params and normal methods in them. Earlier we
21798 were looking at params methods only if we found no normal methods
21799 which was not the correct thing to do.
21801 (Invocation.BetterFunction): Take separate arguments indicating
21802 when candidate and the best method are params methods in their
21805 This fixes bugs #43367 and #46199.
21807 * attribute.cs: Documentation updates.
21809 (CheckAttribute): Rename to CheckAttributeTarget.
21810 (GetValidPlaces): Rename to GetValidTargets.
21812 * expression.cs (Invocation.IsParamsMethodApplicable): Fix trivial
21813 bug - use Convert.ImplicitConversion, not ImplicitUserConversion!
21817 2003-07-28 Martin Baulig <martin@ximian.com>
21819 * class.cs (TypeContainer.DefineMembers): Use the base type's full
21820 name when looking up the base class of a nested class. Fixes #46977.
21822 2003-07-26 Martin Baulig <martin@ximian.com>
21824 * expression.cs (Indexers.Indexer): New nested struct; contains
21825 getter, setter and the indexer's type.
21826 (Indexers.Properties): This is now an ArrayList of
21827 Indexers.Indexer's.
21828 (IndexerAccess.DoResolveLValue): Correctly set the type if the
21829 indexer doesn't have any getters.
21831 * assign.cs (Assign.DoResolve): Also do the implicit conversions
21832 for embedded property and indexer assignments.
21834 2003-07-26 Martin Baulig <martin@ximian.com>
21836 * cs-tokenizer.cs (Tokenizer.xtoken): Report a CS1040 if a
21837 preprocessor directive is not the first non-whitespace character
21840 2003-07-26 Martin Baulig <martin@ximian.com>
21842 * namespace.cs (NamespaceEntry.Lookup): New method; rewrote the
21843 namespace parsing, follow the spec more closely.
21845 * rootcontext.cs (RootContext.NamespaceLookup): Use the new
21846 NamespaceEntry.Lookup().
21848 2003-07-25 Martin Baulig <martin@ximian.com>
21850 * MethodCore.cs (OverridesSomething): New public field; it's set
21851 from TypeContainer.DefineMembers if this method overrides
21852 something (which doesn't need to be a method). Fix #39462.
21854 2003-07-25 Ravi Pratap <ravi@ximian.com>
21856 * typemanager.cs (GetMembers): Ensure that the list of members is
21857 reversed. This keeps things in sync.
21859 * attribute.cs (Attribute.CheckAttribute): Break as soon as we
21860 find an AttributeUsage attribute.
21862 * expression.cs (Invocation.OverloadResolve): Perform the check
21863 which disallows Invoke to be directly called on a Delegate.
21865 (Error_InvokeOnDelegate): Report error cs1533.
21867 2003-07-25 Martin Baulig <martin@ximian.com>
21869 * expression.cs (Indexers.GetIndexersForType): Only look in the
21870 interface hierarchy if the requested type is already an
21871 interface. Fixes #46788 while keeping #46502 fixed.
21873 2003-07-25 Martin Baulig <martin@ximian.com>
21875 * class.cs (TypeContainer.DefineMembers): Check whether all
21876 readonly fields have been assigned and report warning CS0649 if
21879 * statement.cs (LocalInfo.IsFixed): Always return true if this is
21882 2003-07-24 Ravi Pratap <ravi@ximian.com>
21884 * decl.cs (MemberCache.AddMethods): Reverse the order of the array
21885 returned from GetMethods to make things consistent with the
21886 assumptions MCS makes about ordering of methods.
21888 This should comprehensively fix bug #45127 and it does :-)
21890 * ecore.cs (MethodGroupExpr.DeclaringType): Correct bug - the
21891 ordering is actually reverse.
21893 * Clean up some debug messages I left lying around.
21895 * interface.cs (Populate*): Get rid of code which emits attributes
21896 since the stage in which we emit attributes is the 'Emit' stage,
21897 not the define stage.
21899 (Emit): Move attribute emission for interface members here.
21901 2003-07-22 Ravi Pratap <ravi@ximian.com>
21903 * expression.cs (Invocation.OverloadResolve): Follow the spec more
21904 closely: we eliminate methods in base types when we have an
21905 applicable method in a top-level type.
21907 Please see section 14.5.5.1 for an exact description of what goes
21910 This fixes bug #45127 and a host of other related to corlib compilation.
21912 * ecore.cs (MethodGroupExpr.DeclaringType): The element in the
21913 array is the method corresponding to the top-level type (this is
21914 because of the changes made to icall.c) so we change this
21917 (MethodGroupExpr.Name): This too.
21919 * typemanager.cs (GetElementType): New method which does the right
21920 thing when compiling corlib.
21922 * everywhere: Make use of the above in the relevant places.
21924 2003-07-22 Martin Baulig <martin@ximian.com>
21926 * cs-parser.jay (invocation_expression): Moved
21927 `OPEN_PARENS expression CLOSE_PARENS unary_expression' here from
21928 `cast_expression', but create a InvocationOrCast which later
21929 resolves to either an Invocation or a Cast.
21931 * ecore.cs (ExpressionStatement.ResolveStatement): New virtual
21932 method; call this before EmitStatement() to make sure that this
21933 expression can be used as a statement.
21935 * expression.cs (InvocationOrCast): New class; resolves to either
21936 an Invocation or a Cast.
21938 * statement.cs (StatementExpression): Call ResolveStatement() on
21939 the ExpressionStatement before emitting it.
21941 2003-07-21 Martin Baulig <martin@ximian.com>
21943 * expression.cs (Invocation.VerifyArgumentsCompat): Check whether
21944 `ref' and `out' attributes match; fixes #46220.
21945 (MemberAccess.ResolveMemberAccess): You can't reference a type
21946 through an expression; fixes #33180.
21947 (Indexers.GetIndexersForType): Don't return the indexers from
21948 interfaces the class implements; fixes #46502.
21950 2003-07-21 Martin Baulig <martin@ximian.com>
21952 * class.cs (TypeContainer.CheckPairedOperators): Added CS0660 and
21953 CS0661 checks; fixes bug #30442.
21955 2003-07-21 Martin Baulig <martin@ximian.com>
21957 * decl.cs (AdditionResult): Added `Error'.
21959 * enum.cs (AddEnumMember): Report a CS0076 if name is `value__'.
21961 * typemanager.cs (TypeManager.ChangeType): Catch exceptions;
21962 makes cs0031.cs actually work.
21964 2003-07-20 Martin Baulig <martin@ximian.com>
21966 * namespace.cs: Fixed that bug which caused a crash when compiling
21967 the debugger's GUI.
21969 2003-07-20 Miguel de Icaza <miguel@ximian.com>
21971 * typemanager.cs (LookupTypeReflection): Never expose types which
21972 are NotPublic, NestedPrivate, NestedAssembly, or
21973 NestedFamANDAssem. We used to return these, and later do a check
21974 that would report a meaningful error, but the problem is that we
21975 would not get the real match, if there was a name override.
21977 2003-07-18 Miguel de Icaza <miguel@ximian.com>
21979 * namespace.cs (Namespace, Name): Do not compute the namespace
21980 name dynamically, compute it in the constructor. This reduced
21981 memory usage by 1697 KB.
21983 * driver.cs: Use --pause to pause at the end.
21985 2003-07-17 Peter Williams <peter@newton.cx>
21987 * Makefile: Change the name of the test target so that it doesn't
21988 conflict with the recursive test target.
21990 2003-07-17 Miguel de Icaza <miguel@ximian.com>
21992 * expression.cs (LocalVariableReference.Emit, EmitAssign,
21993 AddressOf): Do not use EmitThis, that was wrong, use the actual
21996 2003-07-15 Miguel de Icaza <miguel@ximian.com>
21998 * class.cs (MethodData.Define): While checking if a method is an
21999 interface implementation, improve the test: If we are not public
22000 (use new test here: use the computed MethodAttributes directly,
22001 instead of the parsed modifier flags) check if the `implementing'
22002 method comes from an interface or not.
22004 * pending.cs (VerifyPendingMethods): Slightly better error
22007 * makefile: add test target that does the mcs bootstrap.
22009 2003-07-16 Ravi Pratap <ravi@ximian.com>
22011 * interface.cs (Define): Do nothing here since there are no
22012 members to populate etc. Move the attribute emission out of here
22013 since this was just totally the wrong place to put it. Attribute
22014 application happens during the 'Emit' phase, not in the 'Define'
22017 (Emit): Add this method and move the attribute emission here
22019 * rootcontext.cs (EmitCode): Call the Emit method on interface
22022 2003-07-14 Ravi Pratap M <ravi@ximian.com>
22024 * expression.cs (OverloadResolve): Report error only if Location
22025 is not 'Null' which means that there was a probe going on.
22027 2003-07-14 Martin Baulig <martin@ximian.com>
22029 * expression.cs (ConditionalLogicalOperator): New public class to
22030 implement user defined conditional logical operators.
22031 This is section 14.11.2 in the spec and bug #40505.
22033 2003-07-14 Martin Baulig <martin@ximian.com>
22035 * ecore.cs (FieldExpr.DoResolveLValue): Fixed bug #46198.
22037 2003-07-14 Martin Baulig <martin@ximian.com>
22039 * codegen.cs (EmitContext.InFixedInitializer): New public field.
22041 * ecore.cs (IVariable.VerifyFixed): New interface method.
22043 * expression.cs (Unary.ResolveOperator): When resolving the `&'
22044 operator, check whether the variable is actually fixed. Fixes bug
22045 #36055. Set a variable definitely assigned when taking its
22046 address as required by the spec.
22048 * statement.cs (LocalInfo.IsFixed): New field.
22049 (LocalInfo.MakePinned): Set `IsFixed' to true.
22051 2003-07-14 Ravi Pratap M <ravi@ximian.com>
22053 * attribute.cs (Attribute.Resolve): While doing a Member lookup
22054 for .ctors, ensure that we only ask for members declared in the
22055 attribute type (BindingFlags.DeclaredOnly).
22059 * expression.cs (Error_WrongNumArguments): Report error 1501
22060 correctly the way CSC does.
22062 2003-07-13 Martin Baulig <martin@ximian.com>
22064 * expression.cs (MemberAccess.ResolveAsTypeStep): Try to do a type
22065 lookup on the fully qualified name, to make things like "X.X" work
22066 where "X.X" is a fully qualified type name, but we also have a
22067 namespace "X" in the using list. Fixes #41975.
22069 2003-07-13 Martin Baulig <martin@ximian.com>
22071 * assign.cs (Assign.GetEmbeddedAssign): New protected virtual
22072 function. If we're a CompoundAssign, we need to create an embedded
22073 CompoundAssign, not an embedded Assign.
22074 (Assign.DoResolve): Make this work for embedded CompoundAssign's.
22077 2003-07-13 Martin Baulig <martin@ximian.com>
22079 * typemanager.cs (TypeManager.IsNestedChildOf): Make this actually
22080 work to fix bug #46088.
22082 2003-07-13 Ravi Pratap <ravi@ximian.com>
22084 * class.cs (Operator.Emit): Do not emit attributes here - it is
22085 taken care of by the Method class that we delegate too. This takes
22086 care of bug #45876.
22088 2003-07-10 Martin Baulig <martin@ximian.com>
22090 * expression.cs (TypeOfVoid): New class.
22091 (TypeOf): Report a CS0673 if it's System.Void. Fixes #42264.
22093 2003-07-10 Martin Baulig <martin@ximian.com>
22095 * class.cs (MethodCore.DoDefineParameters): Added CS0225 check;
22098 2003-07-10 Martin Baulig <martin@ximian.com>
22100 * rootcontext.cs (RootContext.NamespaceLookup): Take a DeclSpace,
22101 not a NamespaceEntry, so we can use DeclSpace.CheckAccessLevel().
22103 * decl.cs (DeclSpace.FindType): Use DeclSpace.CheckAccessLevel().
22105 * typemanager.cs (TypeManager.IsAccessibleFrom): Removed.
22107 2003-07-10 Martin Baulig <martin@ximian.com>
22109 * expression.cs (ArrayCreation): Don't use a byte blob for arrays
22110 of decimal. Fixes #42850.
22112 NOTE: I also fixed the created byte blob, but this doesn't work on
22113 the MS runtime and csc never produces any byte blobs for decimal
22116 2003-07-10 Martin Baulig <martin@ximian.com>
22118 * statement.cs (StructInfo.GetStructInfo): Catch deep cycles in
22119 structs; fixes #32068.
22120 (Block.AddChildVariableNames): Fixed #44302.
22122 2003-07-07 Gonzalo Paniagua Javier <gonzalo@ximian.com>
22124 * namespace.cs: fixed compilation with csc. It's bugzilla #44302.
22126 2003-07-07 Miguel de Icaza <miguel@ximian.com>
22128 * attribute.cs: And this test is onger needed.
22130 2003-07-08 Martin Baulig <martin@ximian.com>
22132 * rootcontext.cs (RootContext.NamespaceLookup): Ignore
22133 inaccessible types. Fixes #36313.
22135 * decl.cs (DeclSpace.FindType): Ignore inaccessible types.
22137 * namespace.cs (NamespaceEntry): Create implicit entries for all
22138 namespaces; ie. if we have `namespace N1.N2.N3 { ... }', we create
22139 implicit entries for N1.N2 and N1.
22141 2003-07-08 Martin Baulig <martin@ximian.com>
22143 Rewrote the handling of namespaces to fix a lot of the issues
22144 wrt. `using' aliases etc.
22146 * namespace.cs (Namespace): Splitted this class into a
22147 per-assembly `Namespace' and a per-file `NamespaceEntry'.
22149 * typemanager.cs (TypeManager.IsNamespace): Removed.
22150 (TypeManager.ComputeNamespaces): Only compute namespaces from
22151 loaded assemblies here, not the namespaces from the assembly we're
22152 currently compiling.
22154 2003-07-08 Martin Baulig <martin@ximian.com>
22156 * rootcontext.cs, class.cs: Fixed the CS1530 reporting.
22158 2003-07-07 Miguel de Icaza <miguel@ximian.com>
22160 * typemanager.cs: Reverted patch from Gonzalo, my previous patch
22163 I thought about the memory savings here, but LookupTypeReflection
22164 is used under already very constrained scenarios. Compiling
22165 corlib or mcs only exposes one hit, so it would not really reduce
22166 any memory consumption.
22168 2003-07-07 Gonzalo Paniagua Javier <gonzalo@ximian.com>
22170 * typemanager.cs: fixes bug #45889 by only adding public types from
22171 other assemblies to the list of known types.
22173 2003-07-07 Miguel de Icaza <miguel@ximian.com>
22175 * attribute.cs (Attribute.Resolve): Add call to CheckAccessLevel
22176 on the type we resolved.
22178 2003-07-05 Martin Baulig <martin@ximian.com>
22180 * pending.cs (PendingImplementation.ParentImplements): Don't
22181 create the proxy if the parent is abstract.
22183 * class.cs (TypeContainer.DefineIndexers): Process explicit
22184 interface implementations first. Fixes #37714.
22186 2003-07-04 Miguel de Icaza <miguel@ximian.com>
22188 * expression.cs (MemberAccess.ResolveMemberAccess): Events are
22189 defined recursively; but since we modify the input parameters
22190 (left is set to `this' temporarily), we reset this value if the
22191 left_is_explicit is false, which gives the original semantics to
22194 * literal.cs (NullPointer): new class used to represent a null
22195 literal in a pointer context.
22197 * convert.cs (Convert.ImplicitReferenceConversion): Is the target
22198 type is a pointer, use a NullPointer object instead of a
22199 NullLiteral. Closes 43687
22201 (ExplicitConversion): Convert pointer values using
22202 the conv opcode to the proper type.
22204 * ecore.cs (New): change ValueTypeVariable property into a method,
22205 that returns whether the valuetype is suitable for being used.
22207 * expression.cs (Binary.DoNumericPromotions): Only return if we
22208 the int constant was a valid uint, and we can return both left and
22209 right as uints. If not, we continue processing, to trigger the
22210 type conversion. This fixes 39018.
22212 * statement.cs (Block.EmitMeta): During constant resolution, set
22213 the CurrentBlock property on the emitcontext, so that we resolve
22214 constants propertly.
22216 2003-07-02 Martin Baulig <martin@ximian.com>
22218 * codegen.cs (EmitContext.NeedExplicitReturn): New public variable.
22219 (EmitContext.EmitTopBlock): Emit an explicit return if it's set.
22221 * statement.cs (Try.Resolve): Set ec.NeedExplicitReturn rather
22222 than emitting it here.
22224 * statement.cs: Fixed some more flow analysis bugs.
22226 2003-07-02 Martin Baulig <martin@ximian.com>
22228 * class.cs (MethodData.Define): When implementing interface
22229 methods, set Final unless we're Virtual.
22231 * decl.cs (MemberCore.CheckMethodAgainstBase): Make the CS0506
22232 check work for interface methods.
22234 2003-07-01 Martin Baulig <martin@ximian.com>
22236 * ecore.cs (EmitContext.This): Replaced this property with a
22237 GetThis() method which takes a Location argument. This ensures
22238 that we get the correct error location for a CS0188.
22240 2003-07-01 Miguel de Icaza <miguel@ximian.com>
22242 * ecore.cs: (Convert.ConvertIntLiteral): Add test for
22243 ImplicitStandardConversion.
22245 * class.cs (TypeContainer.GetClassBases): Small bug fix for 45649.
22247 2003-07-01 Zoltan Varga <vargaz@freemail.hu>
22249 * expression.cs (ResolveOperator): Fix Concat (string, string, string)
22252 2003-06-30 Miguel de Icaza <miguel@ximian.com>
22254 * class.cs (Constructor.Define): Turn off initlocals for unsafe
22257 (MethodData.Define): Turn off initlocals for unsafe methods.
22259 2003-06-29 Miguel de Icaza <miguel@ximian.com>
22261 * decl.cs (DeclSpace.CheckAccessLevel): Make this routine
22262 complete; Fixes #37521.
22264 * delegate.cs: Use Modifiers.TypeAttr to compute the
22265 TypeAttributes, instead of rolling our own. This makes the flags
22266 correct for the delegates.
22268 2003-06-28 Miguel de Icaza <miguel@ximian.com>
22270 * class.cs (Constructor.Define): Set the private flag for static
22271 constructors as well.
22273 * cs-parser.jay (statement_expression): Set the return value to
22274 null, to avoid a crash when we catch an error.
22276 2003-06-24 Miguel de Icaza <miguel@ximian.com>
22278 * cs-parser.jay: Applied patch from Jackson that adds support for
22279 extern and unsafe modifiers to destructor declarations.
22281 * expression.cs: Report error 21 if the user is trying to index a
22284 * driver.cs: Add an error message, suggested by the bug report.
22286 * class.cs (TypeContainer.Emit): Only call EmitFieldInitializers
22287 if we do not have a ": this ()" constructor initializer. Fixes 45149
22289 2003-06-14 Miguel de Icaza <miguel@ximian.com>
22291 * namespace.cs: Add some information to reduce FAQs.
22293 2003-06-13 Miguel de Icaza <miguel@ximian.com>
22295 * cfold.cs (BinaryFold): BitwiseAnd, BitwiseOr: handle other
22296 underlying enumeration types. Fixes #43915.
22298 * expression.cs: Treat ushort/short as legal values to be used in
22299 bitwise operations.
22301 Wed Jun 4 13:19:04 CEST 2003 Paolo Molaro <lupus@ximian.com>
22303 * delegate.cs: transfer custom attributes for paramenters from
22304 the delegate declaration to Invoke and BeginInvoke.
22306 Tue Jun 3 11:11:08 CEST 2003 Paolo Molaro <lupus@ximian.com>
22308 * attribute.cs: handle custom marshalers and emit marshal info
22311 2003-05-28 Hector E. Gomez Morales <hgomez_36@flashmail.com>
22313 * makefile.gnu: Added anonymous.cs to the compiler sources.
22315 2003-05-28 Miguel de Icaza <miguel@ximian.com>
22317 * iterators.cs: Change the name of the proxy class to include two
22320 * cs-parser.jay: Update grammar to include anonymous methods.
22322 * anonymous.cs: new file.
22324 2003-05-27 Miguel de Icaza <miguel@ximian.com>
22326 * class.cs (Field.Define): Add missing test for pointers and
22329 2003-05-27 Ravi Pratap <ravi@ximian.com>
22331 * expression.cs (ArrayAccess.GetStoreOpCode): For System.IntPtr,
22332 we use the stobj opcode.
22334 (ArrayCreation.EmitDynamicInitializers): Revert Miguel's patch
22335 since it wasn't the correct fix.
22337 It still is puzzling that we are required to use stobj for IntPtr
22338 which seems to be a ValueType.
22340 2003-05-26 Miguel de Icaza <miguel@ximian.com>
22342 * ecore.cs (SimpleName.SimpleNameResolve): Consider using aliases
22343 during regular simple name resolution. Now, the trick is that
22344 instead of returning for processing the simplename, we do a
22345 TypeManager.LookupType (ie, a rooted lookup as opposed to a
22346 contextual lookup type). If a match is found, return that, if
22347 not, return for further composition.
22349 This fixes long-standing 30485.
22351 * expression.cs (ArrayCreation.EmitDynamicInitializers): When
22352 using the address to initialize an object, do an Stobj instead of
22353 using the regular Stelem.
22355 (IndexerAccess.Emit, IndexerAccess.EmitAssign):
22356 Pass `is_base_indexer' to Invocation.EmitCall instead of false.
22357 Because if we are a BaseIndexerAccess that value will be true.
22360 * statement.cs (GotoCase.Resolve): Return after reporting an
22361 error, do not attempt to continue.
22363 * expression.cs (PointerArithmetic.Emit): If our operand is a
22364 long, convert our constants to match the operand before
22365 multiplying. Convert to I type before adding. Fixes 43670.
22367 2003-05-14 Ravi Pratap <ravi@ximian.com>
22369 * enum.cs (ImplicitConversionExists) : Rename to
22370 ImplicitEnumConversionExists to remove ambiguity.
22372 * ecore.cs (NullCast): New type of cast expression class which
22373 basically is very similar to EmptyCast with the difference being
22374 it still is a constant since it is used only to cast a null to
22376 (eg. (string) null)
22378 * convert.cs (ImplicitReferenceConversion): When casting a null
22379 literal, we return a NullCast.
22381 * literal.cs (NullLiteralTyped): Remove - I don't see why this
22382 should be around anymore.
22384 The renaming (reported was slightly wrong). Corrections:
22386 ConvertImplicitStandard -> ImplicitConversionStandard
22387 ConvertExplicitStandard -> ExplicitConversionStandard
22389 * expression.cs (StaticCallExpr.MakeSimpleCall): Resolve arguments
22390 before passing them in !
22392 * convert.cs (ImplicitConversionStandard): When comparing for
22393 equal expr and target types, ensure that expr is not a
22396 In general, we must not be checking (expr_type ==
22397 target_type) in the top level conversion methods
22398 (ImplicitConversion, ExplicitConversion etc). This checking is
22399 done in the methods that they delegate to.
22401 2003-05-20 Miguel de Icaza <miguel@ximian.com>
22403 * convert.cs: Move Error_CannotConvertType,
22404 ImplicitReferenceConversion, ImplicitReferenceConversionExists,
22405 ImplicitNumericConversion, ImplicitConversionExists,
22406 ImplicitUserConversionExists, StandardConversionExists,
22407 FindMostEncompassedType, FindMostSpecificSource,
22408 FindMostSpecificTarget, ImplicitUserConversion,
22409 ExplicitUserConversion, GetConversionOperators,
22410 UserDefinedConversion, ConvertImplicit, ConvertImplicitStandard,
22411 TryImplicitIntConversion, Error_CannotConvertImplicit,
22412 ConvertImplicitRequired, ConvertNumericExplicit,
22413 ExplicitReferenceConversionExists, ConvertReferenceExplicit,
22414 ConvertExplicit, ConvertExplicitStandard from the ecore.cs into
22417 Perform the following renames:
22419 StandardConversionExists -> ImplicitStandardConversionExists
22420 ConvertImplicit -> ImplicitConversion
22421 ConvertImplicitStandard -> ImplicitStandardConversion
22422 TryImplicitIntConversion -> ImplicitIntConversion
22423 ConvertImplicitRequired -> ImplicitConversionRequired
22424 ConvertNumericExplicit -> ExplicitNumericConversion
22425 ConvertReferenceExplicit -> ExplicitReferenceConversion
22426 ConvertExplicit -> ExplicitConversion
22427 ConvertExplicitStandard -> ExplicitStandardConversion
22429 2003-05-19 Martin Baulig <martin@ximian.com>
22431 * statement.cs (TypeInfo.StructInfo): Made this type protected.
22432 (TypeInfo): Added support for structs having structs as fields.
22434 * ecore.cs (FieldExpr): Implement IVariable.
22435 (FieldExpr.DoResolve): Call VariableInfo.GetSubStruct() to get the
22436 VariableInfo for the field.
22438 2003-05-18 Martin Baulig <martin@ximian.com>
22440 * expression.cs (This.DoResolve): Report a CS0027 if we're
22441 emitting a field initializer.
22443 2003-05-18 Martin Baulig <martin@ximian.com>
22445 * expression.cs (This.ResolveBase): New public function.
22446 (This.DoResolve): Check for CS0188.
22448 * codegen.cs (EmitContext.This): Just call This.ResolveBase(), not
22451 * ecore.cs (MethodGroupExpr.DoResolve): Set the
22452 `instance_expression' to null if we don't have any non-static
22455 2003-05-18 Martin Baulig <martin@ximian.com>
22457 Reworked the way how local variables and parameters are handled by
22458 the flow analysis code.
22460 * statement.cs (TypeInfo, VariableMap): New public classes.
22461 (VariableInfo): New public class. This is now responsible for
22462 checking whether a variable has been assigned. It is used for
22463 parameters and local variables.
22464 (Block.EmitMeta): Take the InternalParameters as argument; compute
22465 the layout of the flow vectors here.
22466 (Block.LocalMap, Block.ParameterMap): New public properties.
22467 (FlowBranching): The .ctor doesn't get the InternalParameters
22468 anymore since Block.EmitMeta() now computes the layout of the flow
22470 (MyStructInfo): This class is now known as `StructInfo' and nested
22471 in `TypeInfo'; we don't access this directly anymore.
22473 * ecore.cs (IVariable): Added `VariableInfo VariableInfo'
22474 property and removed IsAssigned(), IsFieldAssigned(),
22475 SetAssigned() and SetFieldAssigned(); we now call them on the
22476 VariableInfo so we don't need to duplicate this code everywhere.
22478 * expression.cs (ParameterReference): Added `Block block' argument
22480 (LocalVariableReference, ParameterReference, This): The new
22481 VariableInfo class is now responsible for all the definite
22484 * codegen.cs (EmitContext.IsVariableAssigned, SetVariableAssigned,
22485 IsParameterAssigned, SetParameterAssigned): Removed.
22487 2003-05-18 Martin Baulig <martin@ximian.com>
22489 * typemanager.cs (InitCoreTypes): Try calling
22490 SetCorlibTypeBuilders() with 4 args; if that fails, fall back to
22491 the 3-args-version. Corlib now also needs our `void_type'.
22492 (GetMethod): Added overloaded version which takes an optional
22493 `bool report_errors' to allow lookups of optional methods.
22495 2003-05-12 Martin Baulig <martin@ximian.com>
22497 * statement.cs (VariableInfo): Renamed to LocalInfo since it's
22498 only used for locals and not for parameters.
22500 2003-05-12 Miguel de Icaza <miguel@ximian.com>
22502 * support.cs (InternalParameters.ParameterType): Return the
22503 ExternalType of the parameter.
22505 * parameter.cs (Parameter.ExternalType): drop the two arguments,
22508 2003-05-11 Miguel de Icaza <miguel@ximian.com>
22510 * class.cs (MethodData.Define): Do not set the `newslot' on
22511 interface members, if they are also flagged as "override".
22513 * expression.cs (UnaryMutator.EmitCode): Simple workaround to emit
22514 better code for ++i and i++. This only works for static fields
22515 and local variables.
22517 * typemanager.cs (LookupDeclSpace): Add new method, sometimes we
22518 want to pull the DeclSpace out of the builder_to_declspace instead
22519 of the TypeBuilder (like in TypeContainer.FindMembers).
22521 * class.cs (TypeContainer.FindMembers): Use LookupDeclSpace
22522 instead of LookupTypeContainer. Fixes the crash on .NET for
22523 looking up interface members.
22525 * const.cs: Create our own emit context during the Definition
22526 stage, so that constants are evaluated in the proper context, when
22527 a recursive definition happens.
22529 2003-05-11 Martin Baulig <martin@ximian.com>
22531 * statement.cs (Block.CreateSwitchBlock): New method. Creates a
22532 new block for a switch section.
22533 (Block.AddLabel, Block.LookupLabel): If we're a switch section, do
22534 the adding/lookup in the switch block. Fixes #39828.
22536 2003-05-09 Miguel de Icaza <miguel@ximian.com>
22538 * expression.cs (UnaryMutator.LoadOneAndEmitOp): Missing
22539 functionality: I needed to convert the data after I had performed
22540 the add/sub operation into the operands type size.
22542 * ecore.cs (ImplicitReferenceConversion): When boxing an interface
22543 pass the type for the box operation, otherwise the resulting
22544 object would have been of type object.
22546 (BoxedCast): Add constructor to specify the type to box as.
22548 2003-05-07 Miguel de Icaza <miguel@ximian.com>
22550 * iterators.cs: I was reusing the `count' variable inadvertently,
22551 take steps to not allow this to happen.
22553 2003-05-06 Miguel de Icaza <miguel@ximian.com>
22555 * attribute.cs (Attribute.Resolve): Params attributes are encoded
22556 by creating an array at the point where the params starts and
22557 putting all those arguments there, then adjusting the size of the
22560 2003-05-05 Miguel de Icaza <miguel@ximian.com>
22562 * expression.cs (New.AddressOf): Implement interface
22563 IMemoryLocation. This is used when the `new' operator is used in
22564 the context of an invocation to a method on a value type.
22566 See http://bugzilla.ximian.com/show_bug.cgi?id=#42390 for an
22569 * namespace.cs: Also check the using aliases here.
22571 * driver.cs: Move the test for using validity after the types have
22572 been entered, so we do a single pass that also includes the using
22575 * statement.cs (Try.Resolve): Avoid crashing if there is a failure
22576 in the regular case. CreateSiblingForFinally is doing extra
22579 * attribute.cs (GetAttributeArgumentExpression): Store the result
22580 on an out value, and use the return value to indicate failure
22581 instead of using null (which is a valid return for Constant.GetValue).
22583 * statement.cs: Perform the analysis flow for the increment
22584 portion after the statement, because this will be the real flow of
22585 execution. Fixes #42385
22587 * codegen.cs (EmitContext.EmitArgument,
22588 EmitContext.EmitStoreArgument): New helper functions when the
22589 RemapToProxy flag is set.
22591 * expression.cs (ParameterReference.EmitLdarg): Expose this useful
22594 Add support for remapping parameters.
22596 * iterators.cs: Propagate parameter values; Store parameter
22597 values in the proxy classes.
22599 2003-05-04 Miguel de Icaza <miguel@ximian.com>
22601 * ecore.cs (FieldExpr): Fix an obvious bug. static fields do not
22602 need a proxy reference; I do not know what I was thinking
22604 * cs-parser.jay (constructor_initializer): catch another error,
22605 and display nice message.
22607 (field_declaration): catch void field declaration
22608 to flag a better error.
22610 * class.cs (MemberBase.CheckBase): Report an error instead of a
22611 warning if a new protected member is declared in a struct.
22612 (Field.Define): catch the error of readonly/volatile.
22614 * ecore.cs (FieldExpr.EmitAssign): reuse the field lookup.
22616 (FieldExpr.AddressOf): ditto. Catch error where the address of a
22617 volatile variable is taken
22619 2003-05-02 Miguel de Icaza <miguel@ximian.com>
22621 * statement.cs (Fixed.Resolve): Report an error if we are not in
22624 2003-05-01 Miguel de Icaza <miguel@ximian.com>
22626 * typemanager.cs: reuse the code that handles type clashes for
22627 delegates and enumerations.
22629 * class.cs (Report28): Always report.
22631 * expression.cs (EncodeAsAttribute): Allow nulls here.
22633 2003-04-28 Miguel de Icaza <miguel@ximian.com>
22635 * attribute.cs (Attribute.GetAttributeArgumentExpression): Moved
22636 the functionality for testing whether an expression is valid for
22637 an attribute here. Also handle the case of arrays of elements
22640 * expression.cs (ArrayCreation.EncodeAsAttribute): Add support for
22641 encoding a linear array into an array of objects that are suitable
22642 to be passed to an CustomAttributeBuilder.
22644 * delegate.cs: Check unsafe types being used outside of an Unsafe context.
22646 * ecore.cs: (FieldExpr): Handle field remapping here.
22648 * iteratators.cs: Pass the instance variable (if the method is an
22649 instance method) to the constructors, so we can access the field
22650 variables on the class.
22652 TODO: Test this with structs. I think the THIS variable on
22653 structs might have to be a pointer, and not a refenrece
22655 2003-04-27 Miguel de Icaza <miguel@ximian.com>
22657 * codegen.cs (EmitContext.Mapvariable): Adds a mechanism to map
22658 local variables to fields in a proxy class.
22660 * iterators.cs (PopulateProxy): Rename our internal fields to
22662 Create a <THIS> field if we are an instance method, so we can
22663 reference our parent container variables.
22664 (MapVariable): Called back from the EmitContext code to enter a
22665 new variable to field mapping into the proxy class (we just create
22669 (LocalVariableReference.{Emit,EmitAssign,AddressOf}): Add support
22670 for using the remapped locals to fields.
22672 I placed the code here, because that gives the same semantics to
22673 local variables, and only changes the Emit code.
22675 * statement.cs (Fixed.Resolve): it is not allowed to have fixed
22676 statements inside iterators.
22677 (VariableInfo): Add a FieldBuilder for the cases when we are
22678 remapping local variables to fields in a proxy class
22680 * ecore.cs (SimpleNameResolve): Avoid testing two times for
22681 current_block != null.
22683 * statement.cs (Swithc.SimpleSwitchEmit): Removed code that did
22684 not cope with strings, as it has been moved to the
22685 TableSwitchEmit. Fixed bug in switch generation.
22687 * expression.cs (New.DoResolve): Provide more context for the user
22688 when reporting an error.
22690 * ecore.cs (Expression.LoadFromPtr): Use ldind_i when loading
22693 * expression.cs (MemberAccess.DoResolve): When we get a type back,
22694 check the permissions for it. Note than in a type-resolution
22695 context the check was already present in DeclSpace.ResolveType,
22696 but was missing from the MemberAccess.
22698 (ArrayCreation.CheckIndices): warn if the user has
22699 more nested levels of expressions, but there are no more
22700 dimensions specified. Avoids crash on bug 41906.
22702 2003-04-26 Miguel de Icaza <miguel@ximian.com>
22704 * statement.cs (Block): replace Implicit bool, for a generic
22706 New flag: `Unchecked'. This is used during the EmitMeta phase
22707 (which is out-of-line with the regular Resolve/Emit process for a
22708 statement, as this is done ahead of time, but still gets a chance
22709 to call constant resolve).
22711 (Block.Flags): new enum for adding a new flag.
22713 (Block.EmitMeta): track the state of unchecked.
22715 (Unchecked): Set the "UnChecked" flags on any blocks we enclose,
22716 to enable constant resolution to work there as well.
22718 2003-04-22 Miguel de Icaza <miguel@ximian.com>
22720 * typemanager.cs (ienumerable_type): Also look up
22721 System.Collections.IEnumerable.
22723 2003-04-21 Miguel de Icaza <miguel@ximian.com>
22725 TODO: Test more than one conditional per method.
22727 * class.cs (Indexer.Define): Report the location where the user is
22728 referencing the unsupported feature.
22730 (MethodData): Overload the use of `conditionals' to
22731 minimize the creation of needless ArrayLists. This saves roughly
22732 212kb on my machine.
22734 (Method): Implement the new IIteratorContainer interface.
22735 (Method.SetYields): Implement the method by setting the ModFlags
22736 to contain METHOD_YIELDS.
22738 * expression.cs (Unary.ResolveOperator): Use expr_type, not Expr,
22739 which just got set to null.
22741 * iterators.cs: New file.
22743 (Yield, YieldBreak): New statements.
22745 * statement.cs (Return.Resolve): Flag an error if we are used in
22746 an iterator method.
22748 * codegen.cs (InIterator): New flag set if the code is being
22749 compiled in an iterator method.
22751 * modifiers.cs: New flag METHOD_YIELDS. This modifier is an
22752 internal modifier, and we just use it to avoid adding extra
22753 fields, as this is seldom used.
22755 * cs-parser.jay: Add yield_statement (yield and yield break).
22757 * driver.cs: New flag -v2 to turn on version 2 features.
22759 * cs-tokenizer.cs (Tokenizer): Add yield and __yield to the
22760 hashtable when v2 is enabled.
22762 2003-04-20 Miguel de Icaza <miguel@ximian.com>
22764 * typemanager.cs (TypeManager.NamespaceClash): Use to check if
22765 there is already a namespace defined with this name.
22767 (TypeManager.InitCoreTypes): Remove the temporary workaround, as
22768 people upgraded their corlibs.
22770 (TypeManager.CoreLookupType): Use LookupTypeDirect, as we
22771 always use fully qualified types, no need to use the compiler
22774 (TypeManager.IsNamespace): Use binarysearch.
22776 * class.cs (AddClass, AddStruct, AddInterface, AddEvent,
22777 AddDelegate): I did not quite use the new IsValid API properly: I
22778 have to pass the short-name and the fullname. I was passing only
22779 the basename instead of the fullname sometimes.
22781 (TypeContainer.DefineType): call NamespaceClash.
22783 * interface.cs (Interface.DefineType): use NamespaceClash before
22786 * delegate.cs (Delegate.DefineType): use NamespaceClash before
22789 * enum.cs: (Enum.DefineType): use NamespaceClash before
22792 * typemanager.cs (: 3-line patch that gives us some tasty 11%
22793 speed increase. First, use the negative_hits cache when we get a
22794 negative. Second, add the type with its full original name
22795 instead of the new . and + encoded name (reflection uses + to
22796 separate type from a nested type). Use LookupTypeReflection
22797 directly which bypasses the type->name hashtable (that we already
22798 know does not contain the type.
22800 * decl.cs (DeclSpace.ResolveTypeExpr): track the
22801 location/container type.
22803 * driver.cs: When passing utf8, use directly the UTF8Encoding.
22805 2003-04-19 Miguel de Icaza <miguel@ximian.com>
22807 * decl.cs (ResolveTypeExpr): Mirror check acess here too.
22809 * delegate.cs (NewDelegate.Resolve): Test whether an instance
22810 method is being referenced in the method group from a static
22811 context, and report error 120 if so.
22813 * expression.cs, ecore.cs (Error_UnexpectedKind): New name for
22816 * typemanager.cs: Add intermediate namespaces (if a namespace A.B
22817 is created, we create the A namespace).
22819 * cs-parser.jay: A namespace also introduces a DeclarationFound.
22822 2003-04-18 Miguel de Icaza <miguel@ximian.com>
22824 * typemanager.cs (GetReferenceType, GetPointerType): In .NET each
22825 invocation to ModuleBuilder.GetType with the same values will
22826 return a new type instance, so we need to cache its return
22829 * expression.cs (Binary.ResolveOperator): Only allow the compare
22830 operators on enums if they are of the same type.
22832 * ecore.cs (Expression.ImplicitReferenceConversion): handle target
22833 types of ValueType on their own case. Before we were giving them
22834 the same treatment as objects.
22836 * decl.cs (DeclSpace.IsValid): IsValid takes the short name and
22837 fullname. Short name is used to compare against container name.
22838 Fullname is used to check against defined namespace names.
22840 * class.cs (AddProperty, AddField, AddClass, AddStruct, AddEnum,
22841 AddDelegate, AddEvent): Pass new parameter to DeclSpace.IsValid
22843 (Method.CheckBase): Call parent.
22844 (MemberBase.CheckBase): Check for protected members on sealed
22846 (PropertyBase.CheckBase): Call parent.
22847 (Field.Define): Call parent.
22849 * report.cs: Negative error codes are now mapped to 8000 - code,
22850 so that the display is render more nicely.
22852 * typemanager.cs: Do not use try/catch, instead report a regular
22855 (GetPointerType, GetReferenceType): These methods provide
22856 mechanisms to obtain the T* and T& from a T. We had the code
22857 previously scattered around the code base, and it also used
22858 TypeManager.LookupType that would go through plenty of caches.
22859 This one goes directly to the type source.
22861 In some places we did the Type.GetType followed by
22862 ModuleBuilder.GetType, but not in others, so this unifies the
22863 processing as well.
22865 * namespace.cs (VerifyUsing): Perform a non-lazy approach to using
22866 statements now that we have namespace information.
22868 * typemanager.cs (IsNamespace): New method, returns whether the
22869 string presented is a namespace or not.
22871 (ComputeNamespaces): New public entry point, computes the list of
22872 available namespaces, using the GetNamespaces API call in Mono, or
22873 the slower version in MS.NET.
22875 Now before we start the semantic analysis phase, we have a
22876 complete list of namespaces including everything that the user has
22879 Deleted old code to cache namespaces in .nsc files.
22881 2003-04-17 Miguel de Icaza <miguel@ximian.com>
22883 * class.cs: (TypeContainer.DefineDefaultConstructor): Use the
22884 class/struct location definition Location for the implicit
22885 constructor location.
22887 (Operator.Define): Use the location of the operator for the
22888 implicit Method definition.
22890 (Constructor.Emit): use the constructor location for the implicit
22891 base initializer constructor.
22893 * ecore.cs: Remove ITypeExpression. This interface is now gone,
22894 and the Expression class now contains two new methods:
22896 ResolveAsTypeStep and ResolveAsTypeTerminal. This is used to
22897 isolate type lookup from the rest of the resolution process.
22899 Since we use Expressions to hold type definitions due to the way
22900 we parse the input we have historically overloaded Resolve to
22901 perform the Type lookups if a special flag is passed. Now this is
22902 eliminated and two methods take their place.
22904 The differences in the two methods between xStep and xTerminal is
22905 that xStep is involved in our current lookup system that uses
22906 SimpleNames to compose a name, while xTerminal is used just to
22907 catch the case where the simplename lookup failed.
22909 2003-04-16 Miguel de Icaza <miguel@ximian.com>
22911 * expression.cs (ResolveMemberAccess): Remove redundant code.
22912 TypeExpr expressions are always born fully resolved.
22914 * interface.cs (PopulateMethod): Do not lookup the types twice.
22915 We were doing it once during SemanticAnalysis and once during
22918 * cs-parser.jay: Due to our hack in the grammar, things like A.B[]
22919 in local variable type definitions, were being returned as a
22920 SimpleName (we decomposed everything into a string), that is
22921 because primary_expression was being used instead of a type in the
22922 grammar (reduce/reduce conflicts).
22924 The part that was wrong is that we converted the expression into a
22925 string (an oversimplification in one hand, compounded with primary
22926 expressions doing string concatenation).
22932 Would return "A.B.C[]" as a SimpleName. This stopped things like
22933 using clauses from working on this particular context. And a type
22934 was being matched directly against "A.B.C[]".
22936 We now use the correct approach, and allow for ComposedCast to be
22937 part of the unary expression. So the "A.B.C []" become a composed
22938 cast of "A.B.C" (as a nested group of MemberAccess with a
22939 SimpleName at the end) plus the rank composition "[]".
22943 2003-04-10 Miguel de Icaza <miguel@ximian.com>
22945 * decl.cs (CheckAccessLevel): Implement the NestedPrivate rules
22946 for the access level checking.
22948 * class.cs: Cosmetic changes. Renamed `TypeContainer parent' to
22949 `TypeContainer container', because I kept getting confused when I
22950 was debugging this code.
22952 * expression.cs (Indexers): Instead of tracking getters/setters,
22953 we now track them in parallel. We create one arraylist less, but
22954 most importantly it is possible now for the LValue code to find a
22955 matching get for a set.
22957 (IndexerAccess.DoResolveLValue): Update the code.
22958 GetIndexersForType has been modified already to extract all the
22959 indexers from a type. The code assumed it did not.
22961 Also make the code set the correct return type for the indexer.
22962 This was fixed a long time ago for properties, but was missing for
22963 indexers. It used to be void_type.
22965 (Binary.Emit): Test first for doubles instead of
22966 floats, as they are more common.
22968 (Binary.EmitBranchable): Use the .un version of the branch opcodes
22969 when dealing with floats and the <=, >= operators. This fixes bug
22972 * statement.cs (Foreach.EmitArrayForeach): bug fix: The code used
22973 to load the array value by emitting a load on the foreach variable
22974 type. This was incorrect.
22976 We now emit the code to load an element using the the array
22977 variable type, and then we emit the conversion operator.
22981 2003-04-10 Zoltan Varga <vargaz@freemail.hu>
22983 * attribute.cs: Avoid allocation of ArrayLists in the common case.
22985 2003-04-09 Miguel de Icaza <miguel@ximian.com>
22987 * class.cs (MethodSignature.InheritableMemberSignatureCompare):
22988 test for protection before we test for signatures.
22990 (MethodSignature.ToString): implement.
22992 * expression.cs (Unary.TryReduceNegative): Add missing minus sign
22993 to the case where we reduced into a LongConstant.
22995 * decl.cs (CheckAccessLevel): If the type is an array, we can not
22996 depend on whether the information is acurrate, because the
22997 Microsoft runtime will always claim that the array type is public,
22998 regardless of the real state.
23000 If the type is a pointer, another problem happens: the type is
23001 reported as non-public in Microsoft.
23003 In both cases we have to call CheckAccessLevel recursively with
23004 the underlying type as the argument to be tested.
23006 2003-04-08 Miguel de Icaza <miguel@ximian.com>
23008 * assign.cs (Assign.Emit): If we are dealing with a compound
23009 assignment expression, we should use the code path that stores the
23010 intermediate result in a temporary value. This fixes #40903.
23012 *expression.cs (Indirection.ToString): Provide ToString method for
23015 2003-04-08 Zoltan Varga <vargaz@freemail.hu>
23017 * class.cs: Null out fields holding references to Block objects so
23018 they can be garbage collected.
23020 * expression.cs (OverloadResolve): Remove unused local.
23022 2003-04-07 Martin Baulig <martin@ximian.com>
23024 * codegen.cs (EmitContext.CurrentFile): New public field.
23025 (EmitContext.Mark): Use the CurrentFile to check whether the
23026 location is in the correct file.
23027 (EmitContext.EmitTopBlock): Initialize CurrentFile here.
23029 2003-04-07 Martin Baulig <martin@ximian.com>
23031 * ecore.cs (Expression.ResolveBoolean): Don't call ec.Mark().
23033 * codegen.cs (EmitContext.EmitTopBlock): Don't call Mark() on the
23034 location. [FIXME: The location argument which gets passed to this
23035 method is sometimes wrong!]
23037 2003-04-07 Nick Drochak <ndrochak@gol.com>
23039 * codegen.cs: Be more verbose when we can't find the symbol writer dll.
23041 2003-04-07 Miguel de Icaza <miguel@ximian.com>
23043 * expression.cs (Indirection.EmitAssign): We were using the
23044 temporary, but returning immediately instead of continuing the
23047 2003-04-06 Martin Baulig <martin@ximian.com>
23049 * ecore.cs (SimpleName.SimpleNameResolve): Don't report an error
23050 if it's a nested child, but also deriving from the outer class.
23053 * typemanager.cs (IsNestedChildOf): Make this work if it's a
23054 nested child, but also deriving from the outer class. See
23056 (FilterWithClosure): We may access private members of the outer
23057 class if we're a nested child and deriving from the outer class.
23058 (RealMemberLookup): Only set `closure_private_ok' if the
23059 `original_bf' contained BindingFlags.NonPublic.
23061 2003-04-05 Martin Baulig <martin@ximian.com>
23063 * statement.cs (FlowBranching.UsageVector.MergeChildren): Fix bug #40670.
23065 2003-04-02 Miguel de Icaza <miguel@ximian.com>
23067 * class.cs (Event.Define): Do not allow abstract events to have
23070 2003-04-01 Miguel de Icaza <miguel@ximian.com>
23072 * cs-parser.jay: Add error productions for ADD/REMOVE missing a
23073 block in event declarations.
23075 * ecore.cs (FieldExpr.AddressOf): If our instance expression is a
23076 value type, get its address.
23078 * expression.cs (Is.Emit): For action `LeaveOnStack' we were
23079 leaving a class on the stack instead of a boolean value (int
23080 0/1). Change the code so we compare against null, and then the
23081 result against zero.
23083 * class.cs (TypeContainer.GetClassBases): We were checking for the
23084 parent class being sealed too late.
23086 * expression.cs (Binary.Emit): For <= and >= when dealing with
23087 floating point values, use cgt.un and clt.un instead of cgt and
23090 2003-04-01 Zoltan Varga <vargaz@freemail.hu>
23092 * statement.cs: Apply the same optimization as MS: skip the
23093 GetEnumerator returning an IEnumerator, and use the one returning a
23094 CharEnumerator instead. This allows us to avoid the try-finally block
23097 2003-03-31 Gaurav Vaish <gvaish_mono@lycos.com>
23099 * cs-parser.jay: Attributes cannot be applied to
23100 namespaces. Fixes #40473
23102 2003-03-31 Gonzalo Paniagua Javier <gonzalo@ximian.com>
23105 (Add*): check if the name is valid using the full name for constants,
23106 fields, properties and events.
23108 2003-03-28 Miguel de Icaza <miguel@ximian.com>
23110 * enum.cs (Enum.DefineType, Enum.IsValidEnumConstant): Also allow
23111 char constants to be part of the enumeration.
23113 * expression.cs (Conditional.DoResolve): Add support for operator
23114 true. Implements the missing functionality from 14.12
23116 * class.cs (TypeContainer.CheckPairedOperators): Report error for missmatch on
23117 operator true/false as required by the spec.
23119 * expression.cs (Unary.ResolveOperator): In LogicalNot, do an
23120 implicit conversion to boolean.
23122 * statement.cs (Statement.ResolveBoolean): A boolean expression is
23123 also one where the type implements `operator true'.
23125 * ecore.cs (Expression.GetOperatorTrue): New helper routine to
23126 get an expression that will invoke operator true based on an
23129 (GetConversionOperators): Removed the hack that called op_True
23132 (Expression.ResolveBoolean): Move this from Statement.
23134 2003-03-17 Miguel de Icaza <miguel@ximian.com>
23136 * ecore.cs (FieldExpr): do not allow initialization of initonly
23137 fields on derived classes
23139 2003-03-13 Martin Baulig <martin@ximian.com>
23141 * statement.cs (Block.Emit): Call ig.BeginScope() and
23142 ig.EndScope() when compiling with debugging info; call
23143 LocalBuilder.SetLocalSymInfo _after_ opening the scope.
23145 2003-03-08 Miguel de Icaza <miguel@ximian.com>
23147 * expression.cs (Indexers): Do not construct immediately, allow
23148 for new members to be appended as we go. Fixes 38143
23150 2003-03-07 Gonzalo Paniagua Javier <gonzalo@ximian.com>
23152 * expression.cs: save/restore context when resolving an unchecked
23155 2003-03-05 Miguel de Icaza <miguel@ximian.com>
23157 * cfold.cs: Catch division by zero in modulus operator during
23160 2003-03-03 Miguel de Icaza <miguel@ximian.com>
23162 * interface.cs (Interface.DefineMembers): Avoid defining members
23165 2003-02-27 Miguel de Icaza <miguel@ximian.com>
23167 * driver.cs: handle the +/- options for -noconfig
23169 * statement.cs (Unckeched.Resolve): Also track the state of
23170 unchecked in the Resolve phase.
23172 2003-02-27 Martin Baulig <martin@ximian.com>
23174 * ecore.cs (Expression.MemberLookup): Don't create a
23175 MethodGroupExpr for something which is not a method. Fixes #38291.
23177 2003-02-25 Miguel de Icaza <miguel@ximian.com>
23179 * class.cs (MemberBase.CheckParameters): Also check that the type
23180 is unmanaged if it is a pointer.
23182 * expression.cs (SizeOf.Resolve): Add location information.
23184 * statement.cs (Block.EmitMeta): Flag error (208) if a pointer to
23185 a managed type is declared.
23187 * expression.cs (Invocation.VerifyArgumentsCompat): Check for the
23188 parameter modifiers as well. Fixes bug 38606
23190 * class.cs: Very sad. Am backing out the speed up changes
23191 introduced by the ArrayList -> Array in the TypeContainer, as they
23192 were not actually that much faster, and introduced a bug (no error
23193 reports on duplicated methods).
23195 * assign.cs (CompoundAssign.DoLResolve): Resolve the original
23196 source first, this will guarantee that we have a valid expression
23197 before calling in lower levels functions that will require a
23198 resolved object. Then use this original_source in the
23199 target.ResolveLValue instead of the original source that was
23202 Another change. Use target.Resolve instead of LValueResolve.
23203 Although we are resolving for LValues, we will let the Assign code
23204 take care of that (it will be called again from Resolve). This
23205 basically allows code like this:
23207 class X { X operator + (X x, object o) {} X this [int idx] { get; set; } }
23208 class Y { void A (X x) { x [0] += o; }
23210 The problem was that the indexer was trying to resolve for
23211 set_Item (idx, object o) and never finding one. The real set_Item
23212 was set_Item (idx, X). By delaying the process we get the right
23217 2003-02-23 Martin Baulig <martin@ximian.com>
23219 * statement.cs (Block.Emit): Override this and set ec.CurrentBlock
23220 while calling DoEmit ().
23222 * codegen.cs (EmitContext.Mark): Don't mark locations in other
23223 source files; if you use the #line directive inside a method, the
23224 compiler stops emitting line numbers for the debugger until it
23225 reaches the end of the method or another #line directive which
23226 restores the original file.
23228 2003-02-23 Martin Baulig <martin@ximian.com>
23230 * statement.cs (FlowBranching.UsageVector.MergeChildren): Fix bug #37708.
23232 2003-02-23 Martin Baulig <martin@ximian.com>
23234 * statement.cs (Block.AddChildVariableNames): We need to call this
23235 recursively, not just for our immediate children.
23237 2003-02-23 Martin Baulig <martin@ximian.com>
23239 * class.cs (Event.Define): Always make the field private, like csc does.
23241 * typemanager.cs (TypeManager.RealMemberLookup): Make events
23242 actually work, fixes bug #37521.
23244 2003-02-23 Miguel de Icaza <miguel@ximian.com>
23246 * delegate.cs: When creating the various temporary "Parameters"
23247 classes, make sure that we call the ComputeAndDefineParameterTypes
23248 on those new parameters (just like we do with the formal ones), to
23249 allow them to be resolved in the context of the DeclSpace.
23251 This fixes the bug that Dick observed in Bugzilla #38530.
23253 2003-02-22 Miguel de Icaza <miguel@ximian.com>
23255 * expression.cs (ResolveMemberAccess): When resolving a constant,
23256 do not attempt to pull a constant if the value was not able to
23257 generate a valid constant.
23259 * const.cs (LookupConstantValue): Do not report more errors than required.
23261 2003-02-19 Gonzalo Paniagua Javier <gonzalo@ximian.com>
23263 * expression.cs: fixes bug #38328.
23265 2003-02-18 Miguel de Icaza <miguel@ximian.com>
23267 * class.cs: Changed all the various members that can be part of a
23268 class from being an ArrayList to be an Array of the right type.
23269 During the DefineType type_list, interface_list, delegate_list and
23270 enum_list are turned into types, interfaces, delegates and enums
23273 And during the member population, indexer_list, event_list,
23274 constant_list, field_list, instance_constructor_list, method_list,
23275 operator_list and property_list are turned into their real arrays.
23277 Although we could probably perform this operation earlier, for
23278 good error reporting we need to keep the lists and remove the
23279 lists for longer than required.
23281 This optimization was triggered by Paolo profiling the compiler
23282 speed on the output of `gen-sample-program.pl' perl script.
23284 * decl.cs (DeclSpace.ResolveType): Set the ContainerType, so we do
23285 not crash in methods like MemberLookupFailed that use this field.
23287 This problem arises when the compiler fails to resolve a type
23288 during interface type definition for example.
23290 2003-02-18 Miguel de Icaza <miguel@ximian.com>
23292 * expression.cs (Indexers.GetIndexersForType): Interfaces do not
23293 inherit from System.Object, so we have to stop at null, not only
23294 when reaching System.Object.
23296 2003-02-17 Miguel de Icaza <miguel@ximian.com>
23298 * expression.cs: (Indexers.GetIndexersForType): Martin's fix used
23299 DeclaredOnly because the parent indexer might have had a different
23300 name, but did not loop until the top of the hierarchy was reached.
23302 The problem this one fixes is 35492: when a class implemented an
23303 indexer from an interface, we were getting the interface method
23304 (which was abstract) and we were flagging an error (can not invoke
23307 This also keeps bug 33089 functioning, and test-148 functioning.
23309 * typemanager.cs (IsSpecialMethod): The correct way of figuring
23310 out if a method is special is to see if it is declared in a
23311 property or event, or whether it is one of the predefined operator
23312 names. This should fix correctly #36804.
23314 2003-02-15 Miguel de Icaza <miguel@ximian.com>
23316 The goal here is to remove the dependency on EmptyCast.Peel ().
23317 Killing it completely.
23319 The problem is that currently in a number of places where
23320 constants are expected, we have to "probe" for an EmptyCast, and
23321 Peel, which is not the correct thing to do, as this will be
23322 repetitive and will likely lead to errors.
23324 The idea is to remove any EmptyCasts that are used in casts that
23325 can be reduced to constants, so we only have to cope with
23328 This bug hunt was triggered by Bug 37363 and the desire to remove
23329 the duplicate pattern where we were "peeling" emptycasts to check
23330 whether they were constants. Now constants will always be
23333 * ecore.cs: Use an enumconstant here instead of wrapping with
23336 * expression.cs (Cast.TryReduce): Ah, the tricky EnumConstant was
23337 throwing me off. By handling this we can get rid of a few hacks.
23339 * statement.cs (Switch): Removed Peel() code.
23341 2003-02-14 Miguel de Icaza <miguel@ximian.com>
23343 * class.cs: Location information for error 508
23345 * expression.cs (New.DoResolve): Add a guard against double
23346 resolution of an expression.
23348 The New DoResolve might be called twice when initializing field
23349 expressions (see EmitFieldInitializers, the call to
23350 GetInitializerExpression will perform a resolve on the expression,
23351 and later the assign will trigger another resolution
23353 This leads to bugs (#37014)
23355 * delegate.cs: The signature for EndInvoke should contain any ref
23356 or out parameters as well. We were not doing this in the past.
23358 * class.cs (Field.Define): Do not overwrite the type definition
23359 inside the `volatile' group. Turns out that volatile enumerations
23360 were changing the type here to perform a validity test, which
23363 2003-02-12 Miguel de Icaza <miguel@ximian.com>
23365 * ecore.cs (FieldExpr.AddressOf): In the particular case of This
23366 and structs, we do not want to load the instance variable
23368 (ImplicitReferenceConversion, ImplicitReferenceConversionExists):
23369 enum_type has to be handled like an object reference (implicit
23370 conversions exists from this to object), but the regular IsClass
23371 and IsValueType tests will never return true for this one.
23373 Also we use TypeManager.IsValueType instead of type.IsValueType,
23374 just for consistency with the rest of the code (this is only
23375 needed if we ever use the construct exposed by test-180.cs inside
23376 corlib, which we dont today).
23378 2003-02-12 Zoltan Varga <vargaz@freemail.hu>
23380 * attribute.cs (ApplyAttributes): apply all MethodImplAttributes, not
23383 2003-02-09 Martin Baulig <martin@ximian.com>
23385 * namespace.cs (Namespace..ctor): Added SourceFile argument.
23386 (Namespace.DefineNamespaces): New static public method; this is
23387 called when we're compiling with debugging to add all namespaces
23388 to the symbol file.
23390 * tree.cs (Tree.RecordNamespace): Added SourceFile argument and
23391 pass it to the Namespace's .ctor.
23393 * symbolwriter.cs (SymbolWriter.OpenMethod): Added TypeContainer
23394 and MethodBase arguments; pass the namespace ID to the symwriter;
23395 pass the MethodBase instead of the token to the symwriter.
23396 (SymbolWriter.DefineNamespace): New method to add a namespace to
23399 2003-02-09 Martin Baulig <martin@ximian.com>
23401 * symbolwriter.cs: New file. This is a wrapper around
23402 ISymbolWriter with a cleaner API. We'll dynamically Invoke()
23403 methods here in near future.
23405 2003-02-09 Martin Baulig <martin@ximian.com>
23407 * codegen.cs (EmitContext.Mark): Just pass the arguments to
23408 ILGenerator.MarkSequencePoint() which are actually used by the
23411 2003-02-09 Martin Baulig <martin@ximian.com>
23413 * location.cs (SourceFile): New public sealed class. This
23414 contains the name and an index which is used in the location's token.
23415 (Location): Reserve an appropriate number of bits in the token for
23416 the source file instead of walking over that list, this gives us a
23417 really huge performance improvement when compiling with debugging.
23419 * driver.cs (Driver.parse, Driver.tokenize_file): Take a
23420 `SourceFile' argument instead of a string.
23421 (Driver.ProcessFile): Add all the files via Location.AddFile(),
23422 but don't parse/tokenize here, we need to generate the list of all
23423 source files before we do that.
23424 (Driver.ProcessFiles): New static function. Parses/tokenizes all
23427 * cs-parser.jay (CSharpParser): Take a `SourceFile' argument
23428 instead of a string.
23430 * cs-tokenizer.cs (Tokenizer): Take `SourceFile' argument instead
23433 2003-02-09 Martin Baulig <martin@ximian.com>
23435 * cs-tokenizer.cs (Tokenizer.PreProcessLine): Also reset the
23436 filename on `#line default'.
23438 Sat Feb 8 17:03:16 CET 2003 Paolo Molaro <lupus@ximian.com>
23440 * statement.cs: don't clear the pinned var when the fixed statement
23441 returns from the method (fixes bug#37752).
23443 Sat Feb 8 12:58:06 CET 2003 Paolo Molaro <lupus@ximian.com>
23445 * typemanager.cs: fix from mathpup@mylinuxisp.com (Marcus Urban)
23448 2003-02-07 Martin Baulig <martin@ximian.com>
23450 * driver.cs: Removed the `--debug-args' command line argument.
23452 * codegen.cs (CodeGen.SaveSymbols): Removed, this is now done
23453 automatically by the AsssemblyBuilder.
23454 (CodeGen.InitializeSymbolWriter): We don't need to call any
23455 initialization function on the symbol writer anymore. This method
23456 doesn't take any arguments.
23458 2003-02-03 Miguel de Icaza <miguel@ximian.com>
23460 * driver.cs: (AddAssemblyAndDeps, LoadAssembly): Enter the types
23461 from referenced assemblies as well.
23463 2003-02-02 Martin Baulig <martin@ximian.com>
23465 * class.cs (MethodData.Emit): Generate debugging info for external methods.
23467 2003-02-02 Martin Baulig <martin@ximian.com>
23469 * class.cs (Constructor.Emit): Open the symbol writer before
23470 emitting the constructor initializer.
23471 (ConstructorInitializer.Emit): Call ec.Mark() to allow
23472 single-stepping through constructor initializers.
23474 2003-01-30 Miguel de Icaza <miguel@ximian.com>
23476 * class.cs: Handle error 549: do not allow virtual methods in
23479 2003-02-01 Jackson Harper <jackson@latitudegeo.com>
23481 * decl.cs: Check access levels when resolving types
23483 2003-01-31 Jackson Harper <jackson@latitudegeo.com>
23485 * statement.cs: Add parameters and locals set in catch blocks that might
23486 return to set vector
23488 2003-01-29 Miguel de Icaza <miguel@ximian.com>
23490 * class.cs (Operator): Set the SpecialName flags for operators.
23492 * expression.cs (Invocation.DoResolve): Only block calls to
23493 accessors and operators on SpecialName methods.
23495 (Cast.TryReduce): Handle conversions from char constants.
23498 Tue Jan 28 17:30:57 CET 2003 Paolo Molaro <lupus@ximian.com>
23500 * statement.cs: small memory and time optimization in FlowBranching.
23502 2003-01-28 Pedro Mart <yoros@wanadoo.es>
23504 * expression.cs (IndexerAccess.DoResolveLValue): Resolve the same
23505 problem that the last fix but in the other sid (Set).
23507 * expression.cs (IndexerAccess.DoResolve): Fix a problem with a null
23508 access when there is no indexer in the hierarchy.
23510 2003-01-27 Jackson Harper <jackson@latitudegeo.com>
23512 * class.cs: Combine some if statements.
23514 2003-01-27 Gonzalo Paniagua Javier <gonzalo@ximian.com>
23516 * driver.cs: fixed bug #37187.
23518 2003-01-27 Pedro Martinez Juliá <yoros@wanadoo.es>
23520 * expression.cs (IndexerAccess.DoResolve): Before trying to resolve
23521 any indexer, it's needed to build a list with all the indexers in the
23522 hierarchy (AllGetters), else we have problems. Fixes #35653.
23524 2003-01-23 Miguel de Icaza <miguel@ximian.com>
23526 * class.cs (MethodData.Define): It is wrong for an interface
23527 implementation to be static in both cases: explicit and implicit.
23528 We were only handling this in one case.
23530 Improve the if situation there to not have negations.
23532 * class.cs (Field.Define): Turns out that we do not need to check
23533 the unsafe bit on field definition, only on usage. Remove the test.
23535 2003-01-22 Gonzalo Paniagua Javier <gonzalo@ximian.com>
23537 * driver.cs: use assembly.Location instead of Codebase (the latest
23538 patch made mcs fail when using MS assemblies).
23540 2003-01-21 Tim Haynes <thaynes@openlinksw.com>
23542 * driver.cs: use DirectorySeparatorChar instead of a hardcoded "/" to
23543 get the path to *corlib.dll.
23545 2003-01-21 Nick Drochak <ndrochak@gol.com>
23549 * typemanager.cs: Remove compiler warnings
23551 2003-01-20 Duncan Mak <duncan@ximian.com>
23553 * AssemblyInfo.cs: Bump the version number to 0.19.
23555 2003-01-20 Gonzalo Paniagua Javier <gonzalo@ximian.com>
23557 * cs-tokenizer.cs: little fixes to line numbering when #line is used.
23559 2003-01-18 Zoltan Varga <vargaz@freemail.hu>
23561 * class.cs (Constructor::Emit): Emit debugging info for constructors.
23563 2003-01-17 Miguel de Icaza <miguel@ximian.com>
23565 * cs-parser.jay: Small fix: we were not comparing the constructor
23566 name correctly. Thanks to Zoltan for the initial pointer.
23568 2003-01-16 Jackson Harper <jackson@latitudegeo.com>
23570 * cs-tokenizer.cs: Set file name when specified with #line
23572 2003-01-15 Miguel de Icaza <miguel@ximian.com>
23574 * cs-parser.jay: Only perform the constructor checks here if we
23575 are named like the class; This will help provider a better
23576 error. The constructor path is taken when a type definition is
23577 not found, but most likely the user forgot to add the type, so
23578 report that rather than the constructor error.
23580 Tue Jan 14 10:36:49 CET 2003 Paolo Molaro <lupus@ximian.com>
23582 * class.cs, rootcontext.cs: small changes to avoid unnecessary memory
23585 2003-01-13 Jackson Harper <jackson@latitudegeo.com>
23587 * cs-parser.jay: Add cleanup call.
23589 2003-01-13 Duncan Mak <duncan@ximian.com>
23591 * cs-tokenizer.cs (Cleanup): Rename to 'cleanup' to make it more
23592 consistent with other methods.
23594 2003-01-13 Jackson Harper <jackson@latitudegeo.com>
23596 * cs-tokenizer.cs: Add Cleanup method, also fix #region error messages.
23598 Sun Jan 12 19:58:42 CET 2003 Paolo Molaro <lupus@ximian.com>
23600 * attribute.cs: only set GuidAttr to true when we have a
23603 2003-01-09 Gonzalo Paniagua Javier <gonzalo@ximian.com>
23607 * typemanager.cs: fixes to allow mcs compile corlib with the new
23608 Type.IsSubclassOf fix.
23610 2003-01-08 Miguel de Icaza <miguel@ximian.com>
23612 * expression.cs (LocalVariableReference.DoResolve): Classify a
23613 constant as a value, not as a variable. Also, set the type for
23616 * cs-parser.jay (fixed_statement): take a type instead of a
23617 pointer_type, so we can produce a better error message later.
23619 * statement.cs (Fixed.Resolve): Flag types that are not pointers
23622 (For.DoEmit): Make inifinite loops have a
23623 non-conditional branch back.
23625 (Fixed.DoEmit): First populate the pinned variables, then emit the
23626 statement, then clear the variables. Before I was emitting the
23627 code once for each fixed piece.
23630 2003-01-08 Martin Baulig <martin@ximian.com>
23632 * statement.cs (FlowBranching.MergeChild): A break in a
23633 SWITCH_SECTION does not leave a loop. Fixes #36155.
23635 2003-01-08 Martin Baulig <martin@ximian.com>
23637 * statement.cs (FlowBranching.CheckOutParameters): `struct_params'
23638 lives in the same number space than `param_map'. Fixes #36154.
23640 2003-01-07 Miguel de Icaza <miguel@ximian.com>
23642 * cs-parser.jay (constructor_declaration): Set the
23643 Constructor.ModFlags before probing for it. This makes the
23644 compiler report 514, 515 and 132 (the code was there, but got
23647 * statement.cs (Goto.Resolve): Set `Returns' to ALWAYS.
23648 (GotoDefault.Resolve): Set `Returns' to ALWAYS.
23649 (GotoCase.Resolve): Set `Returns' to ALWAYS.
23651 Tue Jan 7 18:32:24 CET 2003 Paolo Molaro <lupus@ximian.com>
23653 * enum.cs: create the enum static fields using the enum type.
23655 Tue Jan 7 18:23:44 CET 2003 Paolo Molaro <lupus@ximian.com>
23657 * class.cs: don't try to create the ParamBuilder for the return
23658 type if it's not needed (and handle it breaking for the ms runtime
23661 2003-01-06 Jackson Harper <jackson@latitudegeo.com>
23663 * cs-tokenizer.cs: Add REGION flag to #region directives, and add checks to make sure that regions are being poped correctly
23665 2002-12-29 Miguel de Icaza <miguel@ximian.com>
23667 * cs-tokenizer.cs (get_cmd_arg): Fixups to allow \r to terminate
23668 the command. This showed up while compiling the JANET source
23669 code, which used \r as its only newline separator.
23671 2002-12-28 Miguel de Icaza <miguel@ximian.com>
23673 * class.cs (Method.Define): If we are an operator (because it
23674 reuses our code), then set the SpecialName and HideBySig. #36128
23676 2002-12-22 Miguel de Icaza <miguel@ximian.com>
23678 * ecore.cs (FieldExpr.DoResolve): Instead of throwing an
23679 exception, report error 120 `object reference required'.
23681 * driver.cs: Add --pause option, used during to measure the size
23682 of the process as it goes with --timestamp.
23684 * expression.cs (Invocation.DoResolve): Do not allow methods with
23685 SpecialName to be invoked.
23687 2002-12-21 Miguel de Icaza <miguel@ximian.com>
23689 * cs-tokenizer.cs: Small fix to the parser: compute the ascii
23690 number before adding it.
23692 2002-12-21 Ravi Pratap <ravi@ximian.com>
23694 * ecore.cs (StandardImplicitConversion): When in an unsafe
23695 context, we allow conversion between void * to any other pointer
23696 type. This fixes bug #35973.
23698 2002-12-20 Jackson Harper <jackson@latitudegeo.com>
23700 * codegen.cs: Use Path.GetFileNameWithoutExtension so an exception
23701 is not thrown when extensionless outputs are used
23703 2002-12-20 Gonzalo Paniagua Javier <gonzalo@ximian.com>
23705 * rootcontext.cs: fixed compilation of corlib.
23707 2002-12-19 Miguel de Icaza <miguel@ximian.com>
23709 * attribute.cs (Attributes.Contains): Add new method.
23711 * class.cs (MethodCore.LabelParameters): if the parameter is an
23712 `out' parameter, check that no attribute `[In]' has been passed.
23714 * enum.cs: Handle the `value__' name in an enumeration.
23716 2002-12-14 Jaroslaw Kowalski <jarek@atm.com.pl>
23718 * decl.cs: Added special case to allow overrides on "protected
23721 2002-12-18 Ravi Pratap <ravi@ximian.com>
23723 * attribute.cs (Attributes.AddAttributeSection): Rename to this
23724 since it makes much more sense.
23726 (Attributes.ctor): Don't require a Location parameter.
23728 * rootcontext.cs (AddGlobalAttributeSection): Rename again.
23730 * attribute.cs (ApplyAttributes): Remove extra Location parameters
23731 since we already have that information per attribute.
23733 * everywhere : make appropriate changes.
23735 * class.cs (LabelParameters): Write the code which actually
23736 applies attributes to the return type. We can't do this on the MS
23737 .NET runtime so we flag a warning in the case an exception is
23740 2002-12-18 Miguel de Icaza <miguel@ximian.com>
23742 * const.cs: Handle implicit null conversions here too.
23744 2002-12-17 Ravi Pratap <ravi@ximian.com>
23746 * class.cs (MethodCore.LabelParameters): Remove the extra
23747 Type [] parameter since it is completely unnecessary. Instead
23748 pass in the method's attributes so that we can extract
23749 the "return" attribute.
23751 2002-12-17 Miguel de Icaza <miguel@ximian.com>
23753 * cs-parser.jay (parse): Use Report.Error to flag errors instead
23754 of ignoring it and letting the compile continue.
23756 * typemanager.cs (ChangeType): use an extra argument to return an
23757 error condition instead of throwing an exception.
23759 2002-12-15 Miguel de Icaza <miguel@ximian.com>
23761 * expression.cs (Unary.TryReduce): mimic the code for the regular
23762 code path. Perform an implicit cast in the cases where we can
23763 implicitly convert to one of the integral types, and then reduce
23764 based on that constant. This fixes bug #35483.
23766 2002-12-14 Gonzalo Paniagua Javier <gonzalo@ximian.com>
23768 * typemanager.cs: fixed cut & paste error in GetRemoveMethod.
23770 2002-12-13 Gonzalo Paniagua Javier <gonzalo@ximian.com>
23772 * namespace.cs: fixed bug #35489.
23774 2002-12-12 Miguel de Icaza <miguel@ximian.com>
23776 * class.cs: Remove some dead code.
23778 * cs-parser.jay: Estimate the number of methods needed
23779 (RootContext.MethodCount);
23781 * cs-tokenizer.cs: Use char arrays for parsing identifiers and
23782 numbers instead of StringBuilders.
23784 * support.cs (PtrHashtable): Add constructor with initial size;
23785 We can now reduce reallocations of the method table.
23787 2002-12-10 Ravi Pratap <ravi@ximian.com>
23789 * attribute.cs (ApplyAttributes): Keep track of the emitted
23790 attributes on a per-target basis. This fixes bug #35413.
23792 2002-12-10 Miguel de Icaza <miguel@ximian.com>
23794 * driver.cs (MainDriver): On rotor encoding 28591 does not exist,
23795 default to the Windows 1252 encoding.
23797 (UnixParseOption): Support version, thanks to Alp for the missing
23800 * AssemblyInfo.cs: Add nice assembly information.
23802 * cs-tokenizer.cs: Add fix from Felix to the #if/#else handler
23805 * cs-parser.jay: Allow a trailing comma before the close bracked
23806 in the attribute_section production.
23808 * ecore.cs (FieldExpr.AddressOf): Until I figure out why the
23809 address of the instance was being taken, I will take this out,
23810 because we take the address of the object immediately here.
23812 2002-12-09 Ravi Pratap <ravi@ximian.com>
23814 * typemanager.cs (AreMultipleAllowed): Take care of the most
23815 obvious case where attribute type is not in the current assembly -
23818 2002-12-08 Miguel de Icaza <miguel@ximian.com>
23820 * ecore.cs (SimpleName.DoResolve): First perform lookups on using
23821 definitions, instead of doing that afterwards.
23823 Also we use a nice little hack, depending on the constructor, we
23824 know if we are a "composed" name or a simple name. Hence, we
23825 avoid the IndexOf test, and we avoid
23827 * codegen.cs: Add code to assist in a bug reporter to track down
23828 the source of a compiler crash.
23830 2002-12-07 Ravi Pratap <ravi@ximian.com>
23832 * attribute.cs (Attribute.ApplyAttributes) : Keep track of which attribute
23833 types have been emitted for a given element and flag an error
23834 if something which does not have AllowMultiple set is used more
23837 * typemanager.cs (RegisterAttributeAllowMultiple): Keep track of
23838 attribute types and their corresponding AllowMultiple properties
23840 (AreMultipleAllowed): Check the property for a given type.
23842 * attribute.cs (Attribute.ApplyAttributes): Register the AllowMultiple
23843 property in the case we have a TypeContainer.
23845 (Attributes.AddAttribute): Detect duplicates and just skip on
23846 adding them. This trivial fix catches a pretty gross error in our
23847 attribute emission - global attributes were being emitted twice!
23849 Bugzilla bug #33187 is now fixed.
23851 2002-12-06 Miguel de Icaza <miguel@ximian.com>
23853 * cs-tokenizer.cs (pp_expr): Properly recurse here (use pp_expr
23854 instead of pp_and).
23856 * expression.cs (Binary.ResolveOperator): I can only use the
23857 Concat (string, string, string) and Concat (string, string,
23858 string, string) if the child is actually a concatenation of
23861 2002-12-04 Miguel de Icaza <miguel@ximian.com>
23863 * cs-tokenizer.cs: Small fix, because decimal_digits is used in a
23864 context where we need a 2-character lookahead.
23866 * pending.cs (PendingImplementation): Rework so we can keep track
23867 of interface types all the time, and flag those which were
23868 implemented by parents as optional.
23870 2002-12-03 Miguel de Icaza <miguel@ximian.com>
23872 * expression.cs (Binary.ResolveOperator): Use
23873 String.Concat(string,string,string) or
23874 String.Concat(string,string,string,string) when possible.
23876 * typemanager: More helper methods.
23879 Tue Dec 3 19:32:04 CET 2002 Paolo Molaro <lupus@ximian.com>
23881 * pending.cs: remove the bogus return from GetMissingInterfaces()
23882 (see the 2002-11-06 entry: the mono runtime is now fixed in cvs).
23884 2002-12-02 Gonzalo Paniagua Javier <gonzalo@ximian.com>
23886 * namespace.cs: avoid duplicated 'using xxx' being added to
23887 using_clauses. This prevents mcs from issuing and 'ambiguous type' error
23888 when we get more than one 'using' statement for the same namespace.
23889 Report a CS0105 warning for it.
23891 2002-11-30 Miguel de Icaza <miguel@ximian.com>
23893 * cs-tokenizer.cs (consume_identifier): use read directly, instead
23894 of calling getChar/putback, uses internal knowledge of it.
23896 (xtoken): Reorder tokenizer so most common patterns are checked
23897 first. This reduces the compilation time in another 5% (from 8.11s
23898 average to 7.73s for bootstrapping mcs on my Mobile p4/1.8ghz).
23900 The parsing time is 22% of the compilation in mcs, and from that
23901 64% is spent on the tokenization process.
23903 I tried using a binary search for keywords, but this is slower
23904 than the hashtable. Another option would be to do a couple of
23907 * Not use a StringBuilder, instead use an array of chars,
23908 with a set value. Notice that this way we could catch
23909 the 645 error without having to do it *afterwards*.
23911 * We could write a hand-parser to avoid the hashtable
23912 compares altogether.
23914 The identifier consumption process takes 37% of the tokenization
23915 time. Another 15% is spent on is_number. 56% of the time spent
23916 on is_number is spent on Int64.Parse:
23918 * We could probably choose based on the string length to
23919 use Int32.Parse or Int64.Parse and avoid all the 64-bit
23922 Another 3% is spend on wrapping `xtoken' in the `token' function.
23924 Handle 0xa0 as whitespace (#34752)
23926 2002-11-26 Miguel de Icaza <miguel@ximian.com>
23928 * typemanager.cs (IsCLRType): New routine to tell whether a type
23929 is one of the builtin types.
23931 Maybe it needs to use TypeCodes to be faster. Maybe we could use
23932 typecode in more places instead of doing pointer comparissions.
23933 We could leverage some knowledge about the way the typecodes are
23936 New code to cache namespaces in assemblies, it is currently not
23937 invoked, to be used soon.
23939 * decl.cs (DeclSpace.MakeFQN): Simple optimization.
23941 * expression.cs (Binary.ResolveOperator): specially handle
23942 strings, and do not perform user-defined operator overloading for
23945 2002-11-24 Miguel de Icaza <miguel@ximian.com>
23947 * cs-tokenizer.cs: Avoid calling Char.IsDigit which is an
23948 internalcall as it is a pretty simple operation; Avoid whenever
23949 possible to call Char.IsLetter.
23951 (consume_identifier): Cut by half the number of
23952 hashtable calls by merging the is_keyword and GetKeyword behavior.
23954 Do not short-circuit, because if we do, we
23955 report errors (ie, #if false && true would produce an invalid
23959 2002-11-24 Martin Baulig <martin@ximian.com>
23961 * expression.cs (Cast.TryReduce): If we're in checked syntax,
23962 check constant ranges and report a CS0221. Fixes #33186.
23964 2002-11-24 Martin Baulig <martin@ximian.com>
23966 * cs-parser.jay: Make this work for uninitialized variable
23967 declarations in the `for' initializer. Fixes #32416.
23969 2002-11-24 Martin Baulig <martin@ximian.com>
23971 * ecore.cs (Expression.ConvertExplicit): Make casting from/to
23972 System.Enum actually work. Fixes bug #32269, added verify-6.cs.
23974 2002-11-24 Martin Baulig <martin@ximian.com>
23976 * expression.cs (Binary.DoNumericPromotions): Added `check_user_conv'
23977 argument; if true, we also check for user-defined conversions.
23978 This is only needed if both arguments are of a user-defined type.
23979 Fixes #30443, added test-175.cs.
23980 (Binary.ForceConversion): Pass the location argument to ConvertImplicit.
23982 * ecore.cs (Expression.ImplicitUserConversionExists): New method.
23984 2002-11-24 Martin Baulig <martin@ximian.com>
23986 * expression.cs (ArrayAccess.GetStoreOpcode): New public static
23987 function to get the store opcode.
23988 (Invocation.EmitParams): Call ArrayAccess.GetStoreOpcode() and
23989 only emit the Ldelema if the store opcode is Stobj. You must run
23990 both test-34 and test-167 to test this. Fixes #34529.
23992 2002-11-23 Martin Baulig <martin@ximian.com>
23994 * ecore.cs (Expression.MemberLookup): Added additional
23995 `qualifier_type' argument which is used when we're being called
23996 from MemberAccess.DoResolve() and null if we're called from a
23998 (Expression.MemberLookupFailed): New method to report errors; this
23999 does the CS1540 check and reports the correct error message.
24001 * typemanager.cs (MemberLookup): Added additional `qualifier_type'
24002 argument for the CS1540 check and redone the way how we're dealing
24003 with private members. See the comment in the source code for details.
24004 (FilterWithClosure): Reverted this back to revision 1.197; renamed
24005 `closure_start_type' to `closure_qualifier_type' and check whether
24006 it's not null. It was not this filter being broken, it was just
24007 being called with the wrong arguments.
24009 * expression.cs (MemberAccess.DoResolve): use MemberLookupFinal()
24010 and pass it the correct `qualifier_type'; this also does the error
24013 2002-11-22 Miguel de Icaza <miguel@ximian.com>
24015 * expression.cs (Invocation.EmitParams): If the we are dealing
24016 with a non-built-in value type, load its address as well.
24018 (ArrayCreation): Use a a pretty constant instead
24019 of the hardcoded value 2. Use 6 instead of 2 for the number of
24020 static initializers.
24022 (ArrayCreation.EmitDynamicInitializers): Peel enumerations,
24023 because they are not really value types, just glorified integers.
24025 * driver.cs: Do not append .exe, the CSC compiler does not do it.
24027 * ecore.cs: Remove redundant code for enumerations, make them use
24028 the same code path as everything else, fixes the casting issue
24029 with enumerations in Windows.Forms.
24031 * attribute.cs: Do only cast to string if it is a string, the
24032 validation happens later.
24034 * typemanager.cs: Temproary hack to avoid a bootstrap issue until
24035 people upgrade their corlibs.
24037 * ecore.cs: Oops, enumerations were not following the entire code path
24039 2002-11-21 Miguel de Icaza <miguel@ximian.com>
24041 * typemanager.cs (FilterWithClosure): Commented out the test for
24042 1540 in typemanager.cs, as it has problems when accessing
24043 protected methods from a parent class (see test-174.cs).
24045 * attribute.cs (Attribute.ValidateGuid): new method.
24046 (Attribute.Resolve): Use above.
24048 2002-11-19 Miguel de Icaza <miguel@ximian.com>
24050 * enum.cs: In FindMembers, perform a recursive lookup for values. (34308)
24052 * ecore.cs (SimpleName.SimpleNameResolve): Remove the special
24053 handling for enumerations, as we only needed the TypeContainer
24054 functionality to begin with (this is required for the fix below to
24055 work for enums that reference constants in a container class for
24058 * codegen.cs (EmitContext): Make TypeContainer a DeclSpace.
24060 * enum.cs (Enum.Define): Use `this' instead of parent, so we have
24061 a valid TypeBuilder to perform lookups on.o
24063 * class.cs (InheritableMemberSignatureCompare): Use true in the
24064 call to GetGetMethod and GetSetMethod, because we are comparing
24065 the signature, and we need to get the methods *even* if they are
24068 (PropertyBase.CheckBase): ditto.
24070 * statement.cs (Switch.ResolveAndReduce, Block.EmitMeta,
24071 GotoCase.Resolve): Use Peel on EmpytCasts.
24073 * ecore.cs (EmptyCast): drop child, add Peel method.
24075 2002-11-17 Martin Baulig <martin@ximian.com>
24077 * ecore.cs (EmptyCast.Child): New public property.
24079 * statement.cs (SwitchLabel.ResolveAndReduce): Check whether the
24080 label resolved to an EmptyCast. Fixes #34162.
24081 (GotoCase.Resolve): Likewise.
24082 (Block.EmitMeta): Likewise.
24084 2002-11-17 Martin Baulig <martin@ximian.com>
24086 * expression.cs (Invocation.BetterConversion): Prefer int over
24087 uint; short over ushort; long over ulong for integer literals.
24088 Use ImplicitConversionExists instead of StandardConversionExists
24089 since we also need to check for user-defined implicit conversions.
24090 Fixes #34165. Added test-173.cs.
24092 2002-11-16 Martin Baulig <martin@ximian.com>
24094 * expression.cs (Binary.EmitBranchable): Eliminate comparisions
24095 with the `true' and `false' literals. Fixes #33151.
24097 2002-11-16 Martin Baulig <martin@ximian.com>
24099 * typemanager.cs (RealMemberLookup): Reverted Miguel's patch from
24100 October 22nd; don't do the cs1540 check for static members.
24102 * ecore.cs (PropertyExpr.ResolveAccessors): Rewrote this; we're
24103 now using our own filter here and doing the cs1540 check again.
24105 2002-11-16 Martin Baulig <martin@ximian.com>
24107 * support.cs (InternalParameters): Don't crash if we don't have
24108 any fixed parameters. Fixes #33532.
24110 2002-11-16 Martin Baulig <martin@ximian.com>
24112 * decl.cs (MemberCache.AddMethods): Use BindingFlags.FlattenHierarchy
24113 when looking up static methods to make this work on Windows.
24116 2002-11-16 Martin Baulig <martin@ximian.com>
24118 * ecore.cs (PropertyExpr.VerifyAssignable): Check whether we have
24119 a setter rather than using PropertyInfo.CanWrite.
24121 2002-11-15 Nick Drochak <ndrochak@gol.com>
24123 * class.cs: Allow acces to block member by subclasses. Fixes build
24126 2002-11-14 Martin Baulig <martin@ximian.com>
24128 * class.cs (Constructor.Emit): Added the extern/block check.
24131 2002-11-14 Martin Baulig <martin@ximian.com>
24133 * expression.cs (IndexerAccess.DoResolve): Do a DeclaredOnly
24134 iteration while looking for indexers, this is needed because the
24135 indexer may have a different name in our base classes. Fixed the
24136 error reporting (no indexers at all, not get accessor, no
24137 overloaded match). Fixes bug #33089.
24138 (IndexerAccess.DoResolveLValue): Likewise.
24140 2002-11-14 Martin Baulig <martin@ximian.com>
24142 * class.cs (PropertyBase.CheckBase): Make this work for multiple
24143 indexers. Fixes the first part of bug #33089.
24144 (MethodSignature.InheritableMemberSignatureCompare): Added support
24147 2002-11-13 Ravi Pratap <ravi@ximian.com>
24149 * attribute.cs (Attribute.Resolve): Catch the
24150 NullReferenceException and report it since it isn't supposed to
24153 2002-11-12 Miguel de Icaza <miguel@ximian.com>
24155 * expression.cs (Binary.EmitBranchable): Also handle the cases for
24156 LogicalOr and LogicalAnd that can benefit from recursively
24157 handling EmitBranchable. The code now should be nice for Paolo.
24159 2002-11-08 Miguel de Icaza <miguel@ximian.com>
24161 * typemanager.cs (LookupType): Added a negative-hit hashtable for
24162 the Type lookups, as we perform quite a number of lookups on
24163 non-Types. This can be removed once we can deterministically tell
24164 whether we have a type or a namespace in advance.
24166 But this might require special hacks from our corlib.
24170 * ecore.cs (TryImplicitIntConversion): Handle conversions to float
24171 and double which avoids a conversion from an integer to a double.
24173 * expression.cs: tiny optimization, avoid calling IsConstant,
24174 because it effectively performs the lookup twice.
24176 2002-11-06 Miguel de Icaza <miguel@ximian.com>
24178 But a bogus return here to keep the semantics of the old code
24179 until the Mono runtime is fixed.
24181 * pending.cs (GetMissingInterfaces): New method used to remove all
24182 the interfaces that are already implemented by our parent
24183 classes from the list of pending methods.
24185 * interface.cs: Add checks for calls after ResolveTypeExpr.
24187 2002-11-05 Miguel de Icaza <miguel@ximian.com>
24189 * class.cs (Class.Emit): Report warning 67: event not used if the
24190 warning level is beyond 3.
24192 * ecore.cs (Expression.ConvertExplicit): Missed a check for expr
24193 being a NullLiteral.
24195 * cs-parser.jay: Fix, Gonzalo reverted the order of the rank
24198 * class.cs (TypeContainer.GetClassBases): Cover a missing code
24199 path that might fail if a type can not be resolved.
24201 * expression.cs (Binary.Emit): Emit unsigned versions of the
24204 * driver.cs: use error 5.
24206 2002-11-02 Gonzalo Paniagua Javier <gonzalo@gnome-db.org>
24208 * cs-parser.jay: simplified a rule and 5 SR conflicts dissapeared.
24210 2002-11-01 Miguel de Icaza <miguel@ximian.com>
24212 * cs-parser.jay (switch_section): A beautiful patch from Martin
24213 Baulig that fixed 33094.
24215 2002-10-31 Miguel de Icaza <miguel@ximian.com>
24217 * ecore.cs (PropertyExpr.DoResolveLValue, PropertyExpr.DoResolve):
24218 Check whether the base is abstract and report an error if so.
24220 * expression.cs (IndexerAccess.DoResolveLValue,
24221 IndexerAccess.DoResolve): ditto.
24223 (Invocation.DoResolve): ditto.
24225 (Invocation.FullMethodDesc): Improve the report string.
24227 * statement.cs (Block): Eliminate IsVariableDefined as it is
24228 basically just a wrapper for GetVariableInfo.
24230 * ecore.cs (SimpleName): Use new
24232 * support.cs (ReflectionParamter.ParameterType): We unwrap the
24233 type, as we return the actual parameter ref/unref state on a
24236 2002-10-30 Miguel de Icaza <miguel@ximian.com>
24238 * support.cs: Return proper flags REF/OUT fixing the previous
24241 * expression.cs: Reverted last patch, that was wrong. Is_ref is
24242 not used to mean `ref' but `ref or out' in ParameterReference
24244 * delegate.cs (FullDelegateDesc): use ParameterDesc to get the
24245 full type signature instead of calling TypeManger.CSharpName
24248 * support.cs (InternalParameters.ParameterDesc): Do not compare
24249 directly to the modflags, because REF/OUT will actually be bitsets
24252 * delegate.cs (VerifyMethod): Check also the modifiers.
24254 * cs-tokenizer.cs: Fix bug where floating point values with an
24255 exponent where a sign was missing was ignored.
24257 * driver.cs: Allow multiple assemblies to be specified in a single
24260 2002-10-28 Miguel de Icaza <miguel@ximian.com>
24262 * cs-parser.jay: Ugly. We had to add a multiplicative_expression,
24263 because identifiers after a parenthesis would end up in this kind
24264 of production, and we needed to desamiguate it for having casts
24267 (UserDefinedType *) xxx
24269 2002-10-24 Miguel de Icaza <miguel@ximian.com>
24271 * typemanager.cs (RealMemberLookup): when we deal with a subclass,
24272 we should set on the Bindingflags.NonPublic, but not turn on
24273 private_ok. private_ok controls whether a Private member is
24274 returned (this is chekced on the filter routine), while the
24275 BindingFlags.NonPublic just controls whether private/protected
24276 will be allowed. This fixes the problem part of the problem of
24277 private properties being allowed to be used in derived classes.
24279 * expression.cs (BaseAccess): Provide an DoResolveLValue method,
24280 so we can call the children DoResolveLValue method (this will
24281 properly signal errors on lvalue assignments to base properties)
24283 * ecore.cs (PropertyExpr.ResolveAccessors): If both setter and
24284 getter are null, and we have a property info, we know that this
24285 happened because the lookup failed, so we report an error 122 for
24286 protection level violation.
24288 We also silently return if setter and getter are null in the
24289 resolve functions, this condition only happens if we have flagged
24290 the error before. This is the other half of the problem.
24292 (PropertyExpr.ResolveAccessors): Turns out that PropertyInfo does
24293 not have accessibility information, that is why we were returning
24294 true in the filter function in typemanager.cs.
24296 To properly report 122 (property is inaccessible because of its
24297 protection level) correctly, we report this error in ResolveAccess
24298 by failing if both the setter and the getter are lacking (ie, the
24301 DoResolve and DoLResolve have been modified to check for both
24302 setter/getter being null and returning silently, the reason being
24303 that I did not want to put the knowledge about this error in upper
24306 int old = Report.Errors;
24307 x = new PropertyExpr (...);
24308 if (old != Report.Errors)
24313 So the property expr is returned, but it is invalid, so the error
24314 will be flagged during the resolve process.
24316 * class.cs: Remove InheritablePropertySignatureCompare from the
24317 class, as we no longer depend on the property signature to compute
24318 whether it is possible to implement a method or not.
24320 The reason is that calling PropertyInfo.GetGetMethod will return
24321 null (in .NET, in Mono it works, and we should change this), in
24322 cases where the Get Method does not exist in that particular
24327 class X { public virtual int A { get { return 1; } } }
24329 class Z : Y { public override int A { get { return 2; } } }
24331 Would fail in Z because the parent (Y) would not have the property
24332 defined. So we avoid this completely now (because the alternative
24333 fix was ugly and slow), and we now depend exclusively on the
24336 (PropertyBase.CheckBase): Use a method-base mechanism to find our
24337 reference method, instead of using the property.
24339 * typemanager.cs (GetPropertyGetter, GetPropertySetter): These
24340 routines are gone now.
24342 * typemanager.cs (GetPropertyGetter, GetPropertySetter): swap the
24343 names, they were incorrectly named.
24345 * cs-tokenizer.cs: Return are more gentle token on failure.
24347 * pending.cs (PendingImplementation.InterfaceMethod): This routine
24348 had an out-of-sync index variable, which caused it to remove from
24349 the list of pending methods the wrong method sometimes.
24351 2002-10-22 Miguel de Icaza <miguel@ximian.com>
24353 * ecore.cs (PropertyExpr): Do not use PropertyInfo.CanRead,
24354 CanWrite, because those refer to this particular instance of the
24355 property, and do not take into account the fact that we can
24356 override single members of a property.
24358 Constructor requires an EmitContext. The resolution process does
24359 not happen here, but we need to compute the accessors before,
24360 because the resolution does not always happen for properties.
24362 * typemanager.cs (RealMemberLookup): Set private_ok if we are a
24363 subclass, before we did not update this flag, but we did update
24366 (GetAccessors): Drop this routine, as it did not work in the
24367 presence of partially overwritten set/get methods.
24369 Notice that this broke the cs1540 detection, but that will require
24372 2002-10-22 Gonzalo Paniagua Javier <gonzalo@ximian.com>
24376 * driver.cs: issue a warning instead of an error if we don't support
24377 debugging for the platform. Also ignore a couple of errors that may
24378 arise when trying to write the symbols. Undo my previous patch.
24380 2002-10-22 Gonzalo Paniagua Javier <gonzalo@ximian.com>
24382 * driver.cs: ignore /debug switch except for Unix platforms.
24384 2002-10-23 Nick Drochak <ndrochak@gol.com>
24386 * makefile: Remove mcs2.exe and mcs3.exe on 'make clean'
24388 2002-10-21 Miguel de Icaza <miguel@ximian.com>
24390 * driver.cs: Do not make mcs-debug conditional, so we do not break
24391 builds that use it.
24393 * statement.cs (UsageVector.MergeChildren): I would like Martin to
24394 review this patch. But basically after all the children variables
24395 have been merged, the value of "Breaks" was not being set to
24396 new_breaks for Switch blocks. I think that it should be set after
24397 it has executed. Currently I set this to the value of new_breaks,
24398 but only if new_breaks is FlowReturn.ALWAYS, which is a bit
24399 conservative, but I do not understand this code very well.
24401 I did not break anything in the build, so that is good ;-)
24403 * cs-tokenizer.cs: Also allow \r in comments as a line separator.
24405 2002-10-20 Mark Crichton <crichton@gimp.org>
24407 * cfold.cs: Fixed compile blocker. Really fixed it this time.
24409 2002-10-20 Nick Drochak <ndrochak@gol.com>
24411 * cfold.cs: Fixed compile blocker.
24413 2002-10-20 Miguel de Icaza <miguel@ximian.com>
24415 * driver.cs: I was chekcing the key, not the file.
24417 2002-10-19 Ravi Pratap <ravi@ximian.com>
24419 * ecore.cs (UserDefinedConversion): Get rid of the bogus error
24420 message that we were generating - we just need to silently return
24423 2002-10-19 Miguel de Icaza <miguel@ximian.com>
24425 * class.cs (Event.Define): Change my previous commit, as this
24426 breaks the debugger. This is a temporary hack, as it seems like
24427 the compiler is generating events incorrectly to begin with.
24429 * expression.cs (Binary.ResolveOperator): Added support for
24430 "U operator - (E x, E y)"
24432 * cfold.cs (BinaryFold): Added support for "U operator - (E x, E
24435 * ecore.cs (FieldExpr.AddressOf): We had a special code path for
24436 init-only variables, but this path did not take into account that
24437 there might be also instance readonly variables. Correct this
24440 This fixes bug 32253
24442 * delegate.cs (NewDelegate.DoResolve): Catch creation of unsafe
24445 * driver.cs: Change the extension for modules to `netmodule'
24447 * cs-parser.jay: Improved slightly the location tracking for
24448 the debugger symbols.
24450 * class.cs (Event.Define): Use Modifiers.FieldAttr on the
24451 modifiers that were specified instead of the hardcoded value
24452 (FamAndAssem). This was basically ignoring the static modifier,
24453 and others. Fixes 32429.
24455 * statement.cs (Switch.SimpleSwitchEmit): Simplified the code, and
24456 fixed a bug in the process (32476)
24458 * expression.cs (ArrayAccess.EmitAssign): Patch from
24459 hwang_rob@yahoo.ca that fixes bug 31834.3
24461 2002-10-18 Miguel de Icaza <miguel@ximian.com>
24463 * driver.cs: Make the module extension .netmodule.
24465 2002-10-16 Miguel de Icaza <miguel@ximian.com>
24467 * driver.cs: Report an error if the resource file is not found
24468 instead of crashing.
24470 * ecore.cs (PropertyExpr.EmitAssign): Pass IsBase instead of
24471 false, like Emit does.
24473 2002-10-16 Nick Drochak <ndrochak@gol.com>
24475 * typemanager.cs: Remove unused private member. Also reported mcs
24476 bug to report this as a warning like csc.
24478 2002-10-15 Martin Baulig <martin@gnome.org>
24480 * statement.cs (Statement.Emit): Made this a virtual method; emits
24481 the line number info and calls DoEmit().
24482 (Statement.DoEmit): New protected abstract method, formerly knows
24483 as Statement.Emit().
24485 * codegen.cs (EmitContext.Mark): Check whether we have a symbol writer.
24487 2002-10-11 Miguel de Icaza <miguel@ximian.com>
24489 * class.cs: Following the comment from 2002-09-26 to AddMethod, I
24490 have fixed a remaining problem: not every AddXXXX was adding a
24491 fully qualified name.
24493 Now everyone registers a fully qualified name in the DeclSpace as
24494 being defined instead of the partial name.
24496 Downsides: we are slower than we need to be due to the excess
24497 copies and the names being registered this way.
24499 The reason for this is that we currently depend (on the corlib
24500 bootstrap for instance) that types are fully qualified, because
24501 we dump all the types in the namespace, and we should really have
24502 types inserted into the proper namespace, so we can only store the
24503 basenames in the defined_names array.
24505 2002-10-10 Martin Baulig <martin@gnome.org>
24507 * expression.cs (ArrayAccess.EmitStoreOpcode): Reverted the patch
24508 from bug #31834, see the bug report for a testcase which is
24511 2002-10-10 Martin Baulig <martin@gnome.org>
24513 * codegen.cs (EmitContext.Breaks): Removed, we're now using the
24514 flow analysis code for this.
24516 * statement.cs (Do, While, For): Tell the flow analysis code about
24518 (FlowBranching.UsageVector): Added support for infinite loops.
24519 (Block.Resolve): Moved the dead code elimination here and use flow
24522 2002-10-09 Miguel de Icaza <miguel@ximian.com>
24524 * class.cs (Field.Define): Catch cycles on struct type
24527 * typemanager.cs (IsUnmanagedtype): Do not recursively check
24528 fields if the fields are static. We only need to check instance
24531 * expression.cs (As.DoResolve): Test for reference type.
24533 * statement.cs (Using.ResolveExpression): Use
24534 ConvertImplicitRequired, not ConvertImplicit which reports an
24536 (Using.ResolveLocalVariableDecls): ditto.
24538 * expression.cs (Binary.ResolveOperator): Report errors in a few
24539 places where we had to.
24541 * typemanager.cs (IsUnmanagedtype): Finish implementation.
24543 2002-10-08 Miguel de Icaza <miguel@ximian.com>
24545 * expression.cs: Use StoreFromPtr instead of extracting the type
24546 and then trying to use Stelem. Patch is from hwang_rob@yahoo.ca
24548 * ecore.cs (ImplicitReferenceConversion): It is possible to assign
24549 an enumeration value to a System.Enum, but System.Enum is not a
24550 value type, but an class type, so we need to box.
24552 (Expression.ConvertExplicit): One codepath could return
24553 errors but not flag them. Fix this. Fixes #31853
24555 * parameter.cs (Resolve): Do not allow void as a parameter type.
24557 2002-10-06 Martin Baulig <martin@gnome.org>
24559 * statemenc.cs (FlowBranching.SetParameterAssigned): Don't crash
24560 if it's a class type and not a struct. Fixes #31815.
24562 2002-10-06 Martin Baulig <martin@gnome.org>
24564 * statement.cs: Reworked the flow analysis code a bit to make it
24565 usable for dead code elimination.
24567 2002-10-06 Gonzalo Paniagua Javier <gonzalo@ximian.com>
24569 * cs-parser.jay: allow empty source files. Fixes bug #31781.
24571 2002-10-04 Miguel de Icaza <miguel@ximian.com>
24573 * expression.cs (ComposedCast.DoResolveType): A quick workaround
24574 to fix the test 165, will investigate deeper.
24576 2002-10-04 Martin Baulig <martin@gnome.org>
24578 * statement.cs (FlowBranching.UsageVector.MergeChildren): Make
24579 finally blocks actually work.
24580 (Try.Resolve): We don't need to create a sibling for `finally' if
24581 there is no finally block.
24583 2002-10-04 Martin Baulig <martin@gnome.org>
24585 * class.cs (Constructor.Define): The default accessibility for a
24586 non-default constructor is private, not public.
24588 2002-10-04 Miguel de Icaza <miguel@ximian.com>
24590 * class.cs (Constructor): Make AllowedModifiers public, add
24593 * cs-parser.jay: Perform the modifiers test here, as the
24594 constructor for the Constructor class usually receives a zero
24595 because of the way we create it (first we create, later we
24596 customize, and we were never checking the modifiers).
24598 * typemanager.cs (Typemanager.LookupTypeDirect): This new function
24599 is a version of LookupTypeReflection that includes the type-name
24600 cache. This can be used as a fast path for functions that know
24601 the fully qualified name and are only calling into *.GetType() to
24602 obtain a composed type.
24604 This is also used by TypeManager.LookupType during its type
24607 (LookupType): We now also track the real type name, as sometimes
24608 we can get a quey for the real type name from things like
24609 ComposedCast. This fixes bug 31422.
24611 * expression.cs (ComposedCast.Resolve): Since we are obtaining a
24612 complete type fullname, it does not have to go through the type
24613 resolution system to obtain the composed version of the type (for
24614 obtaining arrays or pointers).
24616 (Conditional.Emit): Use the EmitBoolExpression to
24617 generate nicer code, as requested by Paolo.
24619 (ArrayCreation.CheckIndices): Use the patch from
24620 hwang_rob@yahoo.ca to validate the array initializers.
24622 2002-10-03 Miguel de Icaza <miguel@ximian.com>
24624 * class.cs (ConstructorInitializer.Emit): simplify code by using
24625 Invocation.EmitCall, and at the same time, fix the bugs in calling
24626 parent constructors that took variable arguments.
24628 * ecore.cs (Expression.ConvertNumericExplicit,
24629 Expression.ImplicitNumericConversion): Remove the code that
24630 manually wrapped decimal (InternalTypeConstructor call is now gone
24633 * expression.cs (Cast.TryReduce): Also handle decimal types when
24634 trying to perform a constant fold on the type.
24636 * typemanager.cs (IsUnmanagedtype): Partially implemented.
24638 * parameter.cs: Removed ResolveAndDefine, as it was not needed, as
24639 that only turned off an error report, and did nothing else.
24641 2002-10-02 Miguel de Icaza <miguel@ximian.com>
24643 * driver.cs: Handle and ignore /fullpaths
24645 2002-10-01 Miguel de Icaza <miguel@ximian.com>
24647 * expression.cs (Binary.ResolveOperator): Catch the case where
24648 DoNumericPromotions returns true,
24650 (Binary.DoNumericPromotions): Simplify the code, and the tests.
24652 2002-09-27 Miguel de Icaza <miguel@ximian.com>
24654 * ecore.cs (EventExpr.Emit): Instead of emitting an exception,
24657 2002-09-26 Miguel de Icaza <miguel@ximian.com>
24659 * ecore.cs (ConvertNumericExplicit): It is not enough that the
24660 conversion exists, but it is also required that the conversion be
24661 performed. This manifested in "(Type64Enum) 2".
24663 * class.cs (TypeManager.AddMethod): The fix is not to change
24664 AddEnum, because that one was using a fully qualified name (every
24665 DeclSpace derivative does), but to change the AddMethod routine
24666 that was using an un-namespaced name. This now correctly reports
24667 the duplicated name.
24669 Revert patch until I can properly fix it. The issue
24670 is that we have a shared Type space across all namespaces
24671 currently, which is wrong.
24673 Options include making the Namespace a DeclSpace, and merge
24674 current_namespace/current_container in the parser.
24676 2002-09-25 Miguel de Icaza <miguel@ximian.com>
24678 * cs-parser.jay: Improve error reporting when we get a different
24679 kind of expression in local_variable_type and
24680 local_variable_pointer_type.
24682 Propagate this to avoid missleading errors being reported.
24684 * ecore.cs (ImplicitReferenceConversion): treat
24685 TypeManager.value_type as a target just like object_type. As
24690 Is valid, and needs to result in the int 1 being boxed before it
24691 is assigned to the value type v.
24693 * class.cs (TypeContainer.AddEnum): Use the basename, not the name
24694 to validate the enumeration name.
24696 * expression.cs (ArrayAccess.EmitAssign): Mimic the same test from
24697 EmitDynamicInitializers for the criteria to use Ldelema. Thanks
24698 to hwang_rob@yahoo.ca for finding the bug and providing a patch.
24700 * ecore.cs (TryImplicitIntConversion): When doing an
24701 implicit-enumeration-conversion, check if the type is 64-bits and
24702 perform a conversion before passing to EnumConstant.
24704 2002-09-23 Miguel de Icaza <miguel@ximian.com>
24706 * decl.cs (Error_AmbiguousTypeReference); New routine used to
24707 report ambiguous type references. Unlike the MS version, we
24708 report what the ambiguity is. Innovation at work ;-)
24710 (DeclSpace.FindType): Require a location argument to
24711 display when we display an ambiguous error.
24713 * ecore.cs: (SimpleName.DoResolveType): Pass location to FindType.
24715 * interface.cs (GetInterfaceTypeByName): Pass location to FindType.
24717 * expression.cs (EmitDynamicInitializers): Apply patch from
24718 hwang_rob@yahoo.ca that fixes the order in which we emit our
24721 2002-09-21 Martin Baulig <martin@gnome.org>
24723 * delegate.cs (Delegate.VerifyApplicability): Make this work if the
24724 delegate takes no arguments.
24726 2002-09-20 Miguel de Icaza <miguel@ximian.com>
24728 * constant.cs: Use Conv_U8 instead of Conv_I8 when loading longs
24731 * expression.cs: Extract the underlying type.
24733 * ecore.cs (StoreFromPtr): Use TypeManager.IsEnumType instad of IsEnum
24735 * decl.cs (FindType): Sorry about this, fixed the type lookup bug.
24737 2002-09-19 Miguel de Icaza <miguel@ximian.com>
24739 * class.cs (TypeContainer.DefineType): We can not use the nice
24740 PackingSize with the size set to 1 DefineType method, because it
24741 will not allow us to define the interfaces that the struct
24744 This completes the fixing of bug 27287
24746 * ecore.cs (Expresion.ImplicitReferenceConversion): `class-type S'
24747 means also structs. This fixes part of the problem.
24748 (Expresion.ImplicitReferenceConversionExists): ditto.
24750 * decl.cs (DeclSparce.ResolveType): Only report the type-not-found
24751 error if there were no errors reported during the type lookup
24752 process, to avoid duplicates or redundant errors. Without this
24753 you would get an ambiguous errors plus a type not found. We have
24754 beaten the user enough with the first error.
24756 (DeclSparce.FindType): Emit a warning if we have an ambiguous
24759 * ecore.cs (SimpleName.DoResolveType): If an error is emitted
24760 during the resolution process, stop the lookup, this avoids
24761 repeated error reports (same error twice).
24763 * rootcontext.cs: Emit a warning if we have an ambiguous reference.
24765 * typemanager.cs (LookupType): Redo the type lookup code to match
24766 the needs of System.Reflection.
24768 The issue is that System.Reflection requires references to nested
24769 types to begin with a "+" sign instead of a dot. So toplevel
24770 types look like: "NameSpace.TopLevelClass", and nested ones look
24771 like "Namespace.TopLevelClass+Nested", with arbitrary nesting
24774 2002-09-19 Martin Baulig <martin@gnome.org>
24776 * codegen.cs (EmitContext.EmitTopBlock): If control flow analysis
24777 says that a method always returns or always throws an exception,
24778 don't report the CS0161.
24780 * statement.cs (FlowBranching.UsageVector.MergeChildren): Always
24781 set `Returns = new_returns'.
24783 2002-09-19 Martin Baulig <martin@gnome.org>
24785 * expression.cs (MemberAccess.ResolveMemberAccess): When resolving
24786 to an enum constant, check for a CS0176.
24788 2002-09-18 Miguel de Icaza <miguel@ximian.com>
24790 * class.cs (TypeContainer.CheckPairedOperators): Now we check
24791 for operators that must be in pairs and report errors.
24793 * ecore.cs (SimpleName.DoResolveType): During the initial type
24794 resolution process, when we define types recursively, we must
24795 check first for types in our current scope before we perform
24796 lookups in the enclosing scopes.
24798 * expression.cs (MakeByteBlob): Handle Decimal blobs.
24800 (Invocation.VerifyArgumentsCompat): Call
24801 TypeManager.TypeToCoreType on the parameter_type.GetElementType.
24802 I thought we were supposed to always call this, but there are a
24803 few places in the code where we dont do it.
24805 2002-09-17 Miguel de Icaza <miguel@ximian.com>
24807 * driver.cs: Add support in -linkres and -resource to specify the
24808 name of the identifier.
24810 2002-09-16 Miguel de Icaza <miguel@ximian.com>
24812 * ecore.cs (StandardConversionExists): Sync with the conversion
24813 code: allow anything-* to void* conversions.
24815 (FindMostSpecificSource): Use an Expression argument
24816 instead of a Type, because we might be handed over a Literal which
24817 gets a few more implicit conversions that plain types do not. So
24818 this information was being lost.
24820 Also, we drop the temporary type-holder expression when not
24823 2002-09-17 Martin Baulig <martin@gnome.org>
24825 * class.cs (PropertyBase.CheckBase): Don't check the base class if
24826 this is an explicit interface implementation.
24828 2002-09-17 Martin Baulig <martin@gnome.org>
24830 * class.cs (PropertyBase.CheckBase): Make this work for indexers with
24831 different `IndexerName' attributes.
24833 * expression.cs (BaseIndexerAccess): Rewrote this class to use IndexerAccess.
24834 (IndexerAccess): Added special protected ctor for BaseIndexerAccess and
24835 virtual CommonResolve().
24837 2002-09-16 Miguel de Icaza <miguel@ximian.com>
24839 * enum.cs (LookupEnumValue): Use the EnumConstant declared type,
24840 and convert that to the UnderlyingType.
24842 * statement.cs (Foreach.Resolve): Indexers are just like variables
24843 or PropertyAccesses.
24845 * cs-tokenizer.cs (consume_string): Track line numbers and columns
24846 inside quoted strings, we were not doing this before.
24848 2002-09-16 Martin Baulig <martin@gnome.org>
24850 * ecore.cs (MethodGroupExpr.DoResolve): If we have an instance expression,
24851 resolve it. This is needed for the definite assignment check of the
24852 instance expression, fixes bug #29846.
24853 (PropertyExpr.DoResolve, EventExpr.DoResolve): Likewise.
24855 2002-09-16 Nick Drochak <ndrochak@gol.com>
24857 * parameter.cs: Fix compile error. Cannot reference static member
24858 from an instance object. Is this an mcs bug?
24860 2002-09-14 Martin Baulig <martin@gnome.org>
24862 * decl.cs (MemberCache.SetupCacheForInterface): Don't add an interface
24863 multiple times. Fixes bug #30295, added test-166.cs.
24865 2002-09-14 Martin Baulig <martin@gnome.org>
24867 * statement.cs (Block.Emit): Don't emit unreachable code.
24868 (Switch.SimpleSwitchEmit, Switch.TableSwitchEmit): Check for missing
24869 `break' statements.
24870 (Goto.Emit, Continue.Emit): Set ec.Breaks = true.
24872 2002-09-14 Martin Baulig <martin@gnome.org>
24874 * parameter.cs (Parameter.Attributes): Make this work if Modifier.ISBYREF
24877 2002-09-14 Martin Baulig <martin@gnome.org>
24879 * typemanager.cs (TypeManager.IsNestedChildOf): This must return false
24880 if `type == parent' since in this case `type.IsSubclassOf (parent)' will
24881 be false on the ms runtime.
24883 2002-09-13 Martin Baulig <martin@gnome.org>
24885 * ecore.cs (SimpleName.SimpleNameResolve): Include the member name in
24886 the CS0038 error message.
24888 2002-09-12 Miguel de Icaza <miguel@ximian.com>
24890 * expression.cs (CheckedExpr, UnCheckedExpr): If we have a
24891 constant inside, return it.
24893 2002-09-12 Martin Baulig <martin@gnome.org>
24895 * cfold.cs (ConstantFold.DoConstantNumericPromotions): Check whether an
24896 implicit conversion can be done between enum types.
24898 * enum.cs (Enum.LookupEnumValue): If the value is an EnumConstant,
24899 check whether an implicit conversion to the current enum's UnderlyingType
24900 exists and report an error if not.
24902 * codegen.cs (CodeGen.Init): Delete the symbol file when compiling
24903 without debugging support.
24905 * delegate.cs (Delegate.CloseDelegate): Removed, use CloseType instead.
24906 Fixes bug #30235. Thanks to Ricardo Fernández Pascual.
24908 2002-09-12 Martin Baulig <martin@gnome.org>
24910 * typemanager.cs (TypeManager.IsNestedChildOf): New method.
24912 * ecore.cs (IMemberExpr.DeclaringType): New property.
24913 (SimpleName.SimpleNameResolve): Check whether we're accessing a
24914 nonstatic member of an outer type (CS0038).
24916 2002-09-11 Miguel de Icaza <miguel@ximian.com>
24918 * driver.cs: Activate the using-error detector at warning level
24919 4 (at least for MS-compatible APIs).
24921 * namespace.cs (VerifyUsing): Small buglett fix.
24923 * pending.cs (PendingImplementation): pass the container pointer.
24925 * interface.cs (GetMethods): Allow for recursive definition. Long
24926 term, I would like to move every type to support recursive
24927 definitions, not the current ordering mechanism that we have right
24930 The situation is this: Attributes are handled before interfaces,
24931 so we can apply attributes to interfaces. But some attributes
24932 implement interfaces, we will now handle the simple cases
24933 (recursive definitions will just get an error).
24935 * parameter.cs: Only invalidate types at the end if we fail to
24938 2002-09-09 Martin Baulig <martin@gnome.org>
24940 * ecore.cs (PropertyExpr.Emit): Also check for
24941 TypeManager.system_int_array_get_length so this'll also work when
24942 compiling corlib. Fixes #30003.
24944 2002-09-09 Martin Baulig <martin@gnome.org>
24946 * expression.cs (ArrayCreation.MakeByteBlob): Added support for enums
24947 and throw an exception if we can't get the type's size. Fixed #30040,
24950 2002-09-09 Martin Baulig <martin@gnome.org>
24952 * ecore.cs (PropertyExpr.DoResolve): Added check for static properies.
24954 * expression.cs (SizeOf.DoResolve): Sizeof is only allowed in unsafe
24955 context. Fixes bug #30027.
24957 * delegate.cs (NewDelegate.Emit): Use OpCodes.Ldvirtftn for
24958 virtual functions. Fixes bug #30043, added test-164.cs.
24960 2002-09-08 Ravi Pratap <ravi@ximian.com>
24962 * attribute.cs : Fix a small NullRef crash thanks to my stupidity.
24964 2002-09-08 Nick Drochak <ndrochak@gol.com>
24966 * driver.cs: Use an object to get the windows codepage since it's not a
24969 2002-09-08 Miguel de Icaza <miguel@ximian.com>
24971 * statement.cs (For.Emit): for infinite loops (test == null)
24972 return whether there is a break inside, not always "true".
24974 * namespace.cs (UsingEntry): New struct to hold the name of the
24975 using definition, the location where it is defined, and whether it
24976 has been used in a successful type lookup.
24978 * rootcontext.cs (NamespaceLookup): Use UsingEntries instead of
24983 2002-09-06 Ravi Pratap <ravi@ximian.com>
24985 * attribute.cs : Fix incorrect code which relied on catching
24986 a NullReferenceException to detect a null being passed in
24987 where an object was expected.
24989 2002-09-06 Miguel de Icaza <miguel@ximian.com>
24991 * statement.cs (Try): flag the catch variable as assigned
24993 * expression.cs (Cast): Simplified by using ResolveType instead of
24994 manually resolving.
24996 * statement.cs (Catch): Fix bug by using ResolveType.
24998 2002-09-06 Ravi Pratap <ravi@ximian.com>
25000 * expression.cs (BetterConversion): Special case for when we have
25001 a NullLiteral as the argument and we have to choose between string
25002 and object types - we choose string the way csc does.
25004 * attribute.cs (Attribute.Resolve): Catch the
25005 NullReferenceException and report error #182 since the Mono
25006 runtime no more has the bug and having this exception raised means
25007 we tried to select a constructor which takes an object and is
25010 2002-09-05 Ravi Pratap <ravi@ximian.com>
25012 * expression.cs (Invocation.OverloadResolve): Flag a nicer error
25013 message (1502, 1503) when we can't locate a method after overload
25014 resolution. This is much more informative and closes the bug
25017 * interface.cs (PopulateMethod): Return if there are no argument
25018 types. Fixes a NullReferenceException bug.
25020 * attribute.cs (Attribute.Resolve): Ensure we allow TypeOf
25021 expressions too. Previously we were checking only in one place for
25022 positional arguments leaving out named arguments.
25024 * ecore.cs (ImplicitNumericConversion): Conversion from underlying
25025 type to the enum type is not allowed. Remove code corresponding to
25028 (ConvertNumericExplicit): Allow explicit conversions from
25029 the underlying type to enum type. This precisely follows the spec
25030 and closes a bug filed by Gonzalo.
25032 2002-09-04 Gonzalo Paniagua Javier <gonzalo@ximian.com>
25035 * compiler.csproj.user: patch from Adam Chester (achester@bigpond.com).
25037 2002-09-03 Miguel de Icaza <miguel@ximian.com>
25039 * statement.cs (SwitchLabel.ResolveAndReduce): In the string case,
25040 it was important that we stored the right value after the
25041 reduction in `converted'.
25043 2002-09-04 Martin Baulig <martin@gnome.org>
25045 * location.cs (Location.SymbolDocument): Use full pathnames for the
25048 2002-08-30 Miguel de Icaza <miguel@ximian.com>
25050 * expression.cs (ComposedCast): Use DeclSparce.ResolveType instead
25051 of the expression resolve mechanism, because that will catch the
25052 SimpleName error failures.
25054 (Conditional): If we can not resolve the
25055 expression, return, do not crash.
25057 2002-08-29 Gonzalo Paniagua Javier <gonzalo@ximian.com>
25060 (location): display token name instead of its number.
25062 2002-08-28 Martin Baulig <martin@gnome.org>
25064 * expression.cs (Binary.ResolveOperator): Don't silently return
25065 but return an error if an operator cannot be applied between two
25068 2002-08-28 Martin Baulig <martin@gnome.org>
25070 * class.cs (Constructor.Define): Set the permission attributes
25071 correctly instead of making all constructors public.
25073 2002-08-28 Martin Baulig <martin@gnome.org>
25075 * ecore.cs (Expression.DoResolve): Do a TypeManager.MemberLook
25076 for private members before reporting a CS0103; if we find anything,
25079 2002-08-28 Martin Baulig <martin@gnome.org>
25081 * typemanager.cs (TypeManager.FilterWithClosure): It's not enough
25082 to check whether `closure_start_type == closure_invocation_type',
25083 we also need to check whether `m.DeclaringType == closure_invocation_type'
25084 before bypassing the permission checks. We might be accessing
25085 protected/private members from the base class.
25086 (TypeManager.RealMemberLookup): Only set private_ok if private
25087 members were requested via BindingFlags.NonPublic.
25089 * ecore.cs (MethodGroupExpr.IsExplicitImpl): New property.
25091 * expression.cs (MemberAccess.ResolveMemberAccess): Set
25092 MethodGroupExpr.IsExplicitImpl if appropriate.
25093 (Invocation.DoResolve): Don't report the CS0120 for explicit
25094 interface implementations.
25096 2002-08-27 Martin Baulig <martin@gnome.org>
25098 * expression.cs (Invocation.DoResolve): If this is a static
25099 method and we don't have an InstanceExpression, we must report
25102 2002-08-25 Martin Baulig <martin@gnome.org>
25104 * expression.cs (Binary.ResolveOperator): Don't allow `!=' and
25105 `==' between a valuetype and an object.
25107 2002-08-25 Miguel de Icaza <miguel@ximian.com>
25109 * ecore.cs (TypeExpr): Provide a ToString method.
25111 2002-08-24 Martin Baulig <martin@gnome.org>
25113 * codegen.cs (CodeGen.InitMonoSymbolWriter): The symbol file is
25114 now called proggie.dbg and it's a binary file.
25116 2002-08-23 Martin Baulig <martin@gnome.org>
25118 * decl.cs (MemberCache.AddMethods): Ignore varargs methods.
25120 2002-08-23 Martin Baulig <martin@gnome.org>
25122 * struct.cs (MyStructInfo.ctor): Make this work with empty
25123 structs; it's not allowed to use foreach() on null.
25125 2002-08-23 Martin Baulig <martin@gnome.org>
25127 * codegen.cs (CodeGen.InitMonoSymbolWriter): Tell the symbol
25128 writer the full pathname of the generated assembly.
25130 2002-08-23 Martin Baulig <martin@gnome.org>
25132 * statements.cs (FlowBranching.UsageVector.MergeChildren):
25133 A `finally' block never returns or breaks; improved handling of
25136 2002-08-23 Martin Baulig <martin@gnome.org>
25138 * statement.cs (Throw.Resolve): Allow `throw null'.
25140 2002-08-23 Martin Baulig <martin@gnome.org>
25142 * expression.cs (MemberAccess.ResolveMemberAccess): If this is an
25143 EventExpr, don't do a DeclaredOnly MemberLookup, but check whether
25144 `ee.EventInfo.DeclaringType == ec.ContainerType'. The
25145 MemberLookup would return a wrong event if this is an explicit
25146 interface implementation and the class has an event with the same
25149 2002-08-23 Martin Baulig <martin@gnome.org>
25151 * statement.cs (Block.AddChildVariableNames): New public method.
25152 (Block.AddChildVariableName): Likewise.
25153 (Block.IsVariableNameUsedInChildBlock): Likewise.
25154 (Block.AddVariable): Check whether a variable name has already
25155 been used in a child block.
25157 * cs-parser.jay (declare_local_variables): Mark all variable names
25158 from the current block as being used in a child block in the
25161 2002-08-23 Martin Baulig <martin@gnome.org>
25163 * codegen.cs (CodeGen.InitializeSymbolWriter): Abort if we can't
25164 find the symbol writer.
25166 * driver.cs: csc also allows the arguments to /define being
25167 separated by commas, not only by semicolons.
25169 2002-08-23 Martin Baulig <martin@gnome.org>
25171 * interface.cs (Interface.GetMembers): Added static check for events.
25173 2002-08-15 Martin Baulig <martin@gnome.org>
25175 * class.cs (MethodData.EmitDestructor): In the Expression.MemberLookup
25176 call, use ec.ContainerType.BaseType as queried_type and invocation_type.
25178 * ecore.cs (Expression.MemberLookup): Added documentation and explained
25179 why the MethodData.EmitDestructor() change was necessary.
25181 2002-08-20 Martin Baulig <martin@gnome.org>
25183 * class.cs (TypeContainer.FindMembers): Added static check for events.
25185 * decl.cs (MemberCache.AddMembers): Handle events like normal members.
25187 * typemanager.cs (TypeHandle.GetMembers): When queried for events only,
25188 use Type.GetEvents(), not Type.FindMembers().
25190 2002-08-20 Martin Baulig <martin@gnome.org>
25192 * decl.cs (MemberCache): Added a special method cache which will
25193 be used for method-only searched. This ensures that a method
25194 search will return a MethodInfo with the correct ReflectedType for
25197 2002-08-20 Martin Baulig <martin@gnome.org>
25199 * decl.cs (DeclSpace.FindMembers): Made this public.
25201 2002-08-20 Gonzalo Paniagua Javier <gonzalo@ximian.com>
25203 * delegate.cs: fixed build on windows.
25204 [FIXME: Filed as bug #29150: MCS must report these errors.]
25206 2002-08-19 Ravi Pratap <ravi@ximian.com>
25208 * ecore.cs (StandardConversionExists): Return a false
25209 if we are trying to convert the void type to anything else
25210 since that is not allowed.
25212 * delegate.cs (DelegateInvocation.DoResolve): Ensure that
25213 we flag error 70 in the event an event is trying to be accessed
25214 directly from outside the declaring type.
25216 2002-08-20 Martin Baulig <martin@gnome.org>
25218 * typemanager.cs, decl.cs: Moved MemberList, IMemberContainer and
25219 MemberCache from typemanager.cs to decl.cs.
25221 2002-08-19 Martin Baulig <martin@gnome.org>
25223 * class.cs (TypeContainer): Implement IMemberContainer.
25224 (TypeContainer.DefineMembers): Create the MemberCache.
25225 (TypeContainer.FindMembers): Do better BindingFlags checking; only
25226 return public members if BindingFlags.Public was given, check
25227 whether members are static.
25229 2002-08-16 Martin Baulig <martin@gnome.org>
25231 * decl.cs (DeclSpace.Define): Splitted this in Define and
25232 DefineMembers. DefineMembers is called first and initializes the
25235 * rootcontext.cs (RootContext.DefineMembers): New function. Calls
25236 DefineMembers() on all our DeclSpaces.
25238 * class.cs (TypeContainer.Define): Moved all code to DefineMembers(),
25239 but call DefineMembers() on all nested interfaces. We call their
25240 Define() in our new Define() function.
25242 * interface.cs (Interface): Implement IMemberContainer.
25243 (Interface.Define): Moved all code except the attribute stuf to
25245 (Interface.DefineMembers): Initialize the member cache.
25247 * typemanager.cs (IMemberFinder): Removed this interface, we don't
25248 need this anymore since we can use MemberCache.FindMembers directly.
25250 2002-08-19 Martin Baulig <martin@gnome.org>
25252 * typemanager.cs (MemberCache): When creating the cache for an
25253 interface type, add all inherited members.
25254 (TypeManager.MemberLookup_FindMembers): Changed `ref bool searching'
25255 to `out bool used_cache' and documented it.
25256 (TypeManager.MemberLookup): If we already used the cache in the first
25257 iteration, we don't need to do the interfaces check.
25259 2002-08-19 Martin Baulig <martin@gnome.org>
25261 * decl.cs (DeclSpace.FindMembers): New abstract method. Moved this
25262 here from IMemberFinder and don't implement this interface anymore.
25263 (DeclSpace.MemberCache): Moved here from IMemberFinder.
25265 * typemanager.cs (IMemberFinder): This interface is now only used by
25266 classes which actually support the member cache.
25267 (TypeManager.builder_to_member_finder): Renamed to builder_to_declspace
25268 since we only put DeclSpaces into this Hashtable.
25269 (MemberLookup_FindMembers): Use `builder_to_declspace' if the type is
25270 a dynamic type and TypeHandle.GetTypeHandle() otherwise.
25272 2002-08-16 Martin Baulig <martin@gnome.org>
25274 * typemanager.cs (ICachingMemberFinder): Removed.
25275 (IMemberFinder.MemberCache): New property.
25276 (TypeManager.FindMembers): Merged this with RealFindMembers().
25277 This function will never be called from TypeManager.MemberLookup()
25278 so we can't use the cache here, just the IMemberFinder.
25279 (TypeManager.MemberLookup_FindMembers): Check whether the
25280 IMemberFinder has a MemberCache and call the cache's FindMembers
25282 (MemberCache): Rewrote larger parts of this yet another time and
25283 cleaned it up a bit.
25285 2002-08-15 Miguel de Icaza <miguel@ximian.com>
25287 * driver.cs (LoadArgs): Support quoting.
25289 (Usage): Show the CSC-like command line arguments.
25291 Improved a few error messages.
25293 2002-08-15 Martin Baulig <martin@gnome.org>
25295 * typemanager.cs (IMemberContainer.Type): New property.
25296 (IMemberContainer.IsInterface): New property.
25298 The following changes are conditional to BROKEN_RUNTIME, which is
25299 defined at the top of the file.
25301 * typemanager.cs (MemberCache.MemberCache): Don't add the base
25302 class'es members, but add all members from TypeHandle.ObjectType
25303 if we're an interface.
25304 (MemberCache.AddMembers): Set the Declared flag if member.DeclaringType
25305 is the current type.
25306 (MemberCache.CacheEntry.Container): Removed this field.
25307 (TypeHandle.GetMembers): Include inherited members.
25309 2002-08-14 Gonzalo Paniagua Javier <gonzalo@ximian.com>
25311 * typemanager.cs: fixed compilation and added a comment on a field that
25314 2002-08-15 Martin Baulig <martin@gnome.org>
25316 * class.cs (ConstructorInitializer.Resolve): In the
25317 Expression.MemberLookup call, use the queried_type as
25320 * typemanager.cs (IMemberContainer.GetMembers): Removed the `bool
25321 declared' attribute, it's always true.
25322 (IMemberContainer.Parent, IMemberContainer.Name): New properties.
25323 (TypeManager.MemberLookup_FindMembers): [FIXME FIXME FIXME] Added
25324 temporary wrapper for FindMembers which tells MemberLookup whether
25325 members from the base classes are included in the return value.
25326 This will go away soon.
25327 (TypeManager.MemberLookup): Use this temporary hack here; once the
25328 new MemberCache is completed, we don't need to do the DeclaredOnly
25329 looping here anymore since the MemberCache will take care of this.
25330 (TypeManager.IsSubclassOrNestedChildOf): Allow `type == parent'.
25331 (MemberCache): When creating the MemberCache for a class, get
25332 members from the current class and all its base classes.
25333 (MemberCache.CacheEntry.Container): New field. This is a
25334 temporary hack until the Mono runtime is fixed to distinguish
25335 between ReflectedType and DeclaringType. It allows us to use MCS
25336 with both the MS runtime and the unfixed Mono runtime without
25337 problems and without accecting performance.
25338 (MemberCache.SearchMembers): The DeclaredOnly looping from
25339 TypeManager.MemberLookup is now done here.
25341 2002-08-14 Martin Baulig <martin@gnome.org>
25343 * statement.cs (MyStructInfo.MyStructInfo): Don't call
25344 Type.GetFields on dynamic types but get the fields from the
25345 corresponding TypeContainer.
25346 (MyStructInfo.GetStructInfo): Added check for enum types.
25348 * typemanager.cs (MemberList.IsSynchronized): Implemented.
25349 (MemberList.SyncRoot): Implemented.
25350 (TypeManager.FilterWithClosure): No need to check permissions if
25351 closure_start_type == closure_invocation_type, don't crash if
25352 closure_invocation_type is null.
25354 2002-08-13 Martin Baulig <martin@gnome.org>
25356 Rewrote TypeContainer.FindMembers to use a member cache. This
25357 gives us a speed increase of about 35% for the self-hosting MCS
25358 build and of about 15-20% for the class libs (both on GNU/Linux).
25360 * report.cs (Timer): New class to get enhanced profiling. This
25361 whole class is "TIMER" conditional since it remarkably slows down
25364 * class.cs (MemberList): New class. This is an IList wrapper
25365 which we're now using instead of passing MemberInfo[]'s around to
25366 avoid copying this array unnecessarily.
25367 (IMemberFinder.FindMember): Return a MemberList, not a MemberInfo [].
25368 (ICachingMemberFinder, IMemberContainer): New interface.
25369 (TypeManager.FilterWithClosure): If `criteria' is null, the name
25370 has already been checked, otherwise use it for the name comparision.
25371 (TypeManager.FindMembers): Renamed to RealMemberFinder and
25372 provided wrapper which tries to use ICachingMemberFinder.FindMembers
25373 if possible. Returns a MemberList, not a MemberInfo [].
25374 (TypeHandle): New class, implements IMemberContainer. We create
25375 one instance of this class per type, it contains a MemberCache
25376 which is used to do the member lookups.
25377 (MemberCache): New class. Each instance of this class contains
25378 all members of a type and a name-based hash table.
25379 (MemberCache.FindMembers): This is our new member lookup
25380 function. First, it looks up all members of the requested name in
25381 the hash table. Then, it walks this list and sorts out all
25382 applicable members and returns them.
25384 2002-08-13 Martin Baulig <martin@gnome.org>
25386 In addition to a nice code cleanup, this gives us a performance
25387 increase of about 1.4% on GNU/Linux - not much, but it's already
25388 half a second for the self-hosting MCS compilation.
25390 * typemanager.cs (IMemberFinder): New interface. It is used by
25391 TypeManager.FindMembers to call FindMembers on a TypeContainer,
25392 Enum, Delegate or Interface.
25393 (TypeManager.finder_to_member_finder): New PtrHashtable.
25394 (TypeManager.finder_to_container): Removed.
25395 (TypeManager.finder_to_delegate): Removed.
25396 (TypeManager.finder_to_interface): Removed.
25397 (TypeManager.finder_to_enum): Removed.
25399 * interface.cs (Interface): Implement IMemberFinder.
25401 * delegate.cs (Delegate): Implement IMemberFinder.
25403 * enum.cs (Enum): Implement IMemberFinder.
25405 * class.cs (TypeContainer): Implement IMemberFinder.
25407 2002-08-12 Martin Baulig <martin@gnome.org>
25409 * ecore.cs (TypeExpr.DoResolveType): Mark this as virtual.
25411 2002-08-12 Martin Baulig <martin@gnome.org>
25413 * ecore.cs (ITypeExpression): New interface for expressions which
25415 (TypeExpression): Renamed to TypeLookupExpression.
25416 (Expression.DoResolve): If we're doing a types-only lookup, the
25417 expression must implement the ITypeExpression interface and we
25418 call DoResolveType() on it.
25419 (SimpleName): Implement the new ITypeExpression interface.
25420 (SimpleName.SimpleNameResolve): Removed the ec.OnlyLookupTypes
25421 hack, the situation that we're only looking up types can't happen
25422 anymore when this method is called. Moved the type lookup code to
25423 DoResolveType() and call it.
25424 (SimpleName.DoResolveType): This ITypeExpression interface method
25425 is now doing the types-only lookup.
25426 (TypeExpr, TypeLookupExpression): Implement ITypeExpression.
25427 (ResolveFlags): Added MaskExprClass.
25429 * expression.cs (MemberAccess): Implement the ITypeExpression
25431 (MemberAccess.DoResolve): Added support for a types-only lookup
25432 when we're called via ITypeExpression.DoResolveType().
25433 (ComposedCast): Implement the ITypeExpression interface.
25435 * codegen.cs (EmitContext.OnlyLookupTypes): Removed. Call
25436 Expression.Resolve() with ResolveFlags.Type instead.
25438 2002-08-12 Martin Baulig <martin@gnome.org>
25440 * interface.cs (Interface.Define): Apply attributes.
25442 * attribute.cs (Attribute.ApplyAttributes): Added support for
25443 interface attributes.
25445 2002-08-11 Martin Baulig <martin@gnome.org>
25447 * statement.cs (Block.Emit): Only check the "this" variable if we
25448 do not always throw an exception.
25450 * ecore.cs (PropertyExpr.DoResolveLValue): Implemented, check
25451 whether the property has a set accessor.
25453 2002-08-11 Martin Baulig <martin@gnome.org>
25455 Added control flow analysis support for structs.
25457 * ecore.cs (ResolveFlags): Added `DisableFlowAnalysis' to resolve
25458 with control flow analysis turned off.
25459 (IVariable): New interface.
25460 (SimpleName.SimpleNameResolve): If MemberAccess.ResolveMemberAccess
25461 returns an IMemberExpr, call DoResolve/DoResolveLValue on it.
25462 (FieldExpr.DoResolve): Resolve the instance expression with flow
25463 analysis turned off and do the definite assignment check after the
25464 resolving when we know what the expression will resolve to.
25466 * expression.cs (LocalVariableReference, ParameterReference):
25467 Implement the new IVariable interface, only call the flow analysis
25468 code if ec.DoFlowAnalysis is true.
25469 (This): Added constructor which takes a Block argument. Implement
25470 the new IVariable interface.
25471 (MemberAccess.DoResolve, MemberAccess.DoResolveLValue): Call
25472 DoResolve/DoResolveLValue on the result of ResolveMemberLookup().
25473 This does the definite assignment checks for struct members.
25475 * class.cs (Constructor.Emit): If this is a non-static `struct'
25476 constructor which doesn't have any initializer, call
25477 Block.AddThisVariable() to tell the flow analysis code that all
25478 struct elements must be initialized before control returns from
25481 * statement.cs (MyStructInfo): New public class.
25482 (UsageVector.this [VariableInfo vi]): Added `int field_idx'
25483 argument to this indexer. If non-zero, check an individual struct
25484 member, not the whole struct.
25485 (FlowBranching.CheckOutParameters): Check struct members.
25486 (FlowBranching.IsVariableAssigned, SetVariableAssigned): Added
25487 overloaded versions of these methods which take an additional
25488 `int field_idx' argument to check struct members.
25489 (FlowBranching.IsParameterAssigned, SetParameterAssigned): Added
25490 overloaded versions of these methods which take an additional
25491 `string field_name' argument to check struct member.s
25492 (VariableInfo): Implement the IVariable interface.
25493 (VariableInfo.StructInfo): New public property. Returns the
25494 MyStructInfo instance of the variable if it's a struct or null.
25495 (Block.AddThisVariable): New public method. This is called from
25496 Constructor.Emit() for non-static `struct' constructor which do
25497 not have any initializer. It creates a special variable for the
25498 "this" instance variable which will be checked by the flow
25499 analysis code to ensure that all of the struct's fields are
25500 initialized before control returns from the constructor.
25501 (UsageVector): Added support for struct members. If a
25502 variable/parameter is a struct with N members, we reserve a slot
25503 in the usage vector for each member. A struct is considered fully
25504 initialized if either the struct itself (slot 0) or all its
25505 members are initialized.
25507 2002-08-08 Martin Baulig <martin@gnome.org>
25509 * driver.cs (Driver.MainDriver): Only report an error CS5001
25510 if there were no compilation errors.
25512 * codegen.cs (EmitContext.EmitContext): Use the DeclSpace's
25513 `UnsafeContext' property to determine whether the parent is in
25514 unsafe context rather than checking the parent's ModFlags:
25515 classes nested in an unsafe class are unsafe as well.
25517 2002-08-08 Martin Baulig <martin@gnome.org>
25519 * statement.cs (UsageVector.MergeChildren): Distinguish between
25520 `Breaks' and `Returns' everywhere, don't set `Breaks' anymore if
25521 we return. Added test17() and test18() to test-154.cs.
25523 2002-08-08 Martin Baulig <martin@gnome.org>
25525 * typemanager.cs (TypeManager.FilterWithClosure): If we have
25526 Family access, make sure the invoking type isn't a subclass of the
25527 queried type (that'd be a CS1540).
25529 * ecore.cs (Expression.MemberLookup): Added overloaded version of
25530 this method which takes an additional `Type invocation_type'.
25532 * expression.cs (BaseAccess.DoResolve): Use the base type as
25533 invocation and query type.
25534 (MemberAccess.DoResolve): If the lookup failed and we're about to
25535 report a CS0122, try a lookup with the ec.ContainerType - if this
25536 succeeds, we must report a CS1540.
25538 2002-08-08 Martin Baulig <martin@gnome.org>
25540 * ecore.cs (IMemberExpr): Added `bool IsInstance' property.
25541 (MethodGroupExpr): Implement the IMemberExpr interface.
25543 * expression (MemberAccess.ResolveMemberAccess): No need to have
25544 any special code for MethodGroupExprs anymore, they're now
25547 2002-08-08 Martin Baulig <martin@gnome.org>
25549 * typemanager.cs (TypeManager.FilterWithClosure): Check Assembly,
25550 Family, FamANDAssem and FamORAssem permissions.
25551 (TypeManager.IsSubclassOrNestedChildOf): New public method.
25553 2002-08-08 Martin Baulig <martin@gnome.org>
25555 * statement.cs (FlowBranchingType): Added LOOP_BLOCK.
25556 (UsageVector.MergeChildren): `break' breaks unless we're in a switch
25559 Thu Aug 8 10:28:07 CEST 2002 Paolo Molaro <lupus@ximian.com>
25561 * driver.cs: implemented /resource option to embed managed resources.
25563 2002-08-07 Martin Baulig <martin@gnome.org>
25565 * class.cs (FieldBase.Initializer): Renamed to `init' and made private.
25566 (FieldBase.HasFieldInitializer): New public property.
25567 (FieldBase.GetInitializerExpression): New public method. Resolves and
25568 returns the field initializer and makes sure it is only resolved once.
25569 (TypeContainer.EmitFieldInitializers): Call
25570 FieldBase.GetInitializerExpression to get the initializer, this ensures
25571 that it isn't resolved multiple times.
25573 * codegen.cs (EmitContext): Added `bool IsFieldInitialier'. This tells
25574 the resolving process (SimpleName/MemberLookup) that we're currently
25575 emitting a field initializer (which must not access any instance members,
25576 this is an error CS0236).
25578 * ecore.cs (SimpleName.Error_ObjectRefRequired): Added EmitContext
25579 argument, if the `IsFieldInitializer' flag is set, we must report and
25580 error CS0236 and not an error CS0120.
25582 2002-08-07 Martin Baulig <martin@gnome.org>
25584 * ecore.cs (IMemberExpr): New public interface.
25585 (FieldExpr, PropertyExpr, EventExpr): Implement IMemberExpr.
25586 (SimpleName.SimpleNameResolve): Call MemberAccess.ResolveMemberAccess
25587 if the expression is an IMemberExpr.
25589 * expression.cs (MemberAccess.ResolveMemberAccess): Allow `left'
25590 to be null, implicitly default to `this' if we're non-static in
25591 this case. Simplified the code a lot by using the new IMemberExpr
25592 interface. Also fixed bug #28176 here.
25594 2002-08-06 Martin Baulig <martin@gnome.org>
25596 * cs-parser.jay (SimpleLookup): Removed. We need to create
25597 ParameterReferences during semantic analysis so that we can do a
25598 type-only search when resolving Cast, TypeOf and SizeOf.
25599 (block): Pass the `current_local_parameters' to the Block's
25602 * class.cs (ConstructorInitializer): Added `Parameters parameters'
25603 argument to the constructor.
25604 (ConstructorInitializer.Resolve): Create a temporary implicit
25605 block with the parameters.
25607 * ecore.cs (SimpleName.SimpleNameResolve): Resolve parameter
25608 references here if we aren't doing a type-only search.
25610 * statement.cs (Block): Added constructor which takes a
25611 `Parameters parameters' argument.
25612 (Block.Parameters): New public property.
25614 * support.cs (InternalParameters.Parameters): Renamed `parameters'
25615 to `Parameters' and made it public readonly.
25617 2002-08-06 Martin Baulig <martin@gnome.org>
25619 * ecore.cs (Expression.Warning): Made this public as well.
25621 * report.cs (Report.Debug): Print the contents of collections.
25623 2002-08-06 Martin Baulig <martin@gnome.org>
25625 * ecore.cs (Expression.ResolveFlags): New [Flags] enum. This is
25626 used to tell Resolve() which kinds of expressions it may return.
25627 (Expression.Resolve): Added overloaded version of this method which
25628 takes a `ResolveFlags flags' argument. This can be used to tell
25629 Resolve() which kinds of expressions it may return. Reports a
25631 (Expression.ResolveWithSimpleName): Removed, use Resolve() with
25632 ResolveFlags.SimpleName.
25633 (Expression.Error118): Added overloaded version of this method which
25634 takes a `ResolveFlags flags' argument. It uses the flags to determine
25635 which kinds of expressions are allowed.
25637 * expression.cs (Argument.ResolveMethodGroup): New public method.
25638 Resolves an argument, but allows a MethodGroup to be returned.
25639 This is used when invoking a delegate.
25641 * TODO: Updated a bit.
25643 2002-08-06 Gonzalo Paniagua Javier <gonzalo@ximian.com>
25645 Fixed compilation with csc.
25647 * ecore.cs: Expression.Error made public. Is this correct? Should
25648 Warning be made public too?
25650 * expression.cs: use ea.Location instead of ea.loc.
25651 [FIXME: Filed as bug #28607: MCS must report these errors.]
25653 2002-08-06 Martin Baulig <martin@gnome.org>
25655 * ecore.cs (Expression.loc): Moved the location here instead of
25656 duplicating it in all derived classes.
25657 (Expression.Location): New public property.
25658 (Expression.Error, Expression.Warning): Made them non-static and
25659 removed the location argument.
25660 (Expression.Warning): Added overloaded version which takes an
25661 `int level' argument.
25662 (Expression.Error118): Make this non-static and removed the
25663 expression and location arguments.
25664 (TypeExpr): Added location argument to the constructor.
25666 * expression.cs (StaticCallExpr): Added location argument to
25668 (Indirection, PointerArithmetic): Likewise.
25669 (CheckedExpr, UnCheckedExpr): Likewise.
25670 (ArrayAccess, IndexerAccess, UserCast, ArrayPtr): Likewise.
25671 (StringPtr): Likewise.
25674 2002-08-05 Martin Baulig <martin@gnome.org>
25676 * expression.cs (BaseAccess.DoResolve): Actually report errors.
25678 * assign.cs (Assign.DoResolve): Check whether the source
25679 expression is a value or variable.
25681 * statement.cs (Try.Resolve): Set ec.InTry/InCatch/InFinally
25682 while resolving the corresponding blocks.
25684 * interface.cs (Interface.GetInterfaceTypeByName): Actually report
25685 an error, don't silently return null.
25687 * statement.cs (Block.AddVariable): Do the error reporting here
25688 and distinguish between CS0128 and CS0136.
25689 (Block.DoResolve): Report all unused labels (warning CS0164).
25690 (LabeledStatement): Pass the location to the constructor.
25691 (LabeledStatement.HasBeenReferenced): New property.
25692 (LabeledStatement.Resolve): Set it to true here.
25694 * statement.cs (Return.Emit): Return success even after reporting
25695 a type mismatch error (CS0126 or CS0127), this is what csc does and
25696 it avoids confusing the users with any consecutive errors.
25698 2002-08-05 Martin Baulig <martin@gnome.org>
25700 * enum.cs (Enum.LookupEnumValue): Catch circular definitions.
25702 * const.cs (Const.LookupConstantValue): Catch circular definitions.
25704 * expression.cs (MemberAccess.DoResolve): Silently return if an
25705 error has already been reported.
25707 * ecore.cs (Expression.MemberLookupFinal): Silently return if an
25708 error has already been reported.
25710 2002-08-05 Martin Baulig <martin@gnome.org>
25712 * statement.cs (UsageVector): Only initialize the `parameters'
25713 vector if we actually have any "out" parameters.
25715 2002-08-05 Martin Baulig <martin@gnome.org>
25717 * expression.cs (Binary.ResolveOperator): When combining delegates,
25718 they must have the same type.
25720 2002-08-05 Martin Baulig <martin@gnome.org>
25722 * typemanager.cs (TypeManager.GetArgumentTypes): Don't call
25723 PropertyInfo.GetIndexParameters() on dynamic types, this doesn't
25724 work with the ms runtime and we also don't need it: if we're a
25725 PropertyBuilder and not in the `indexer_arguments' hash, then we
25726 are a property and not an indexer.
25728 * class.cs (TypeContainer.AsAccessible): Use Type.IsArray,
25729 Type.IsPointer and Type.IsByRef instead of Type.HasElementType
25730 since the latter one doesn't work with the ms runtime.
25732 2002-08-03 Martin Baulig <martin@gnome.org>
25734 Fixed bugs #27998 and #22735.
25736 * class.cs (Method.IsOperator): New public field.
25737 (Method.CheckBase): Report CS0111 if there's already a method
25738 with the same parameters in the current class. Report CS0508 when
25739 attempting to change the return type of an inherited method.
25740 (MethodData.Emit): Report CS0179 if a method doesn't have a body
25741 and it's not marked abstract or extern.
25742 (PropertyBase): New abstract base class for Property and Indexer.
25743 (PropertyBase.CheckBase): Moved here from Property and made it work
25745 (PropertyBase.Emit): Moved here from Property.Emit, Indexer.Emit is
25746 the same so we can reuse it there.
25747 (Property, Indexer): Derive from PropertyBase.
25748 (MethodSignature.inheritable_property_signature_filter): New delegate
25749 to find properties and indexers.
25751 * decl.cs (MemberCore.CheckMethodAgainstBase): Added `string name'
25752 argument and improved error reporting.
25754 * parameter.cs (Parameters.GetEmptyReadOnlyParameters): Renamed to
25755 EmptyReadOnlyParameters and made it a property.
25757 * typemanager.cs (TypeManager.GetArgumentTypes): Added overloaded
25758 version of this method which takes a `PropertyInfo indexer'.
25759 (TypeManager.RegisterIndexer): New method.
25761 * class.cs: Added myself as author of this file :-)
25763 2002-08-03 Gonzalo Paniagua Javier <gonzalo@ximian.com>
25765 * class.cs: fixed compilation on windoze.
25767 2002-08-03 Martin Baulig <martin@gnome.org>
25769 * interface.cs (Interface.GetInterfaceBases): Check whether all
25770 base interfaces are at least as accessible than the current one.
25772 * class.cs (TypeContainer.GetClassBases): Check whether base types
25773 are at least as accessible than the current type.
25774 (TypeContainer.AsAccessible): Implemented and made non-static.
25775 (MemberBase.CheckParameters): Report errors if the accessibility
25778 * delegate.cs (Delegate.Delegate): The default visibility is
25779 internal for top-level types and private for nested types.
25780 (Delegate.Define): Report errors if the accessibility checks fail.
25782 * enum.cs (Enum.Enum): The default visibility is internal for
25783 top-level types and private for nested types.
25784 (Enum.DefineType): Compute the correct visibility.
25786 * modifiers.cs (Modifiers.TypeAttr): Added a version of this
25787 function which takes a `bool is_toplevel' instead of a TypeContainer.
25789 * typemanager.cs (TypeManager.IsBuiltinType): `void' is also a
25792 2002-08-02 Martin Baulig <martin@gnome.org>
25794 * expression.cs (LocalVariableReferenc): Added constructor which
25795 takes additional `VariableInfo vi' and `bool is_readonly' arguments.
25796 (LocalVariableReference.IsReadOnly): New property.
25797 (LocalVariableReference.DoResolveLValue): Report a CS1604 if the
25798 variable is readonly, use our own readonly flag to do this; you can
25799 use the new constructor to get a writable reference to a read-only
25802 * cs-parser.jay (foreach_statement, using_statement): Get a writable
25803 reference to the local variable.
25805 2002-08-01 Miguel de Icaza <miguel@ximian.com>
25807 * rootcontext.cs (ResolveCore): Also include System.Exception
25809 * statement.cs (Block.Emit): Do not emit the dead-code warnings if
25810 we reach an EmptyStatement.
25812 (Catch.DoResolve, Throw.DoResolve): Throwing the System.Exception
25815 * expression.cs (Binary.ResolveOperator): Check error result in
25818 use brtrue/brfalse directly and avoid compares to null.
25820 2002-08-02 Martin Baulig <martin@gnome.org>
25822 * class.cs (TypeContainer.Define): Define all nested interfaces here.
25823 Fixes bug #28407, added test-155.cs.
25825 2002-08-01 Martin Baulig <martin@gnome.org>
25827 * class.cs (Event.EmitDefaultMethod): Make this work with static
25828 events. Fixes #28311, added verify-3.cs.
25830 2002-08-01 Martin Baulig <martin@gnome.org>
25832 * statement.cs (ForeachHelperMethods): Added `enumerator_type' and
25833 `is_disposable' fields.
25834 (Foreach.GetEnumeratorFilter): Set `hm.enumerator_type' and
25835 `hm.is_disposable' if we're using the collection pattern.
25836 (Foreach.EmitCollectionForeach): Use the correct type for the
25837 enumerator's local variable, only emit the try/finally block if
25838 necessary (fixes #27713).
25840 2002-08-01 Martin Baulig <martin@gnome.org>
25842 * ecore.cs (Expression.report118): Renamed to Error118 and made
25845 * statement.cs (Throw.Resolve): Check whether the expression is of
25846 the correct type (CS0118) and whether the type derives from
25847 System.Exception (CS0155).
25848 (Catch.Resolve): New method. Do the type lookup here and check
25849 whether it derives from System.Exception (CS0155).
25850 (Catch.CatchType, Catch.IsGeneral): New public properties.
25852 * typemanager.cs (TypeManager.exception_type): Added.
25854 2002-07-31 Miguel de Icaza <miguel@ximian.com>
25856 * driver.cs: Updated About function.
25858 2002-07-31 Martin Baulig <martin@gnome.org>
25860 Implemented Control Flow Analysis.
25862 * codegen.cs (EmitContext.DoFlowAnalysis): New public variable.
25863 (EmitContext.CurrentBranching): Added.
25864 (EmitContext.StartFlowBranching): Added.
25865 (EmitContext.EndFlowBranching): Added.
25866 (EmitContext.KillFlowBranching): Added.
25867 (EmitContext.IsVariableAssigned): Added.
25868 (EmitContext.SetVariableAssigned): Added.
25869 (EmitContext.IsParameterAssigned): Added.
25870 (EmitContext.SetParameterAssigned): Added.
25871 (EmitContext.EmitTopBlock): Added `InternalParameters ip' argument.
25872 Added control flow analysis stuff here.
25874 * expression.cs (Unary.DoResolve): If the operator is Oper.AddressOf,
25875 resolve the expression as lvalue.
25876 (LocalVariableReference.DoResolve): Check whether the variable has
25877 already been assigned.
25878 (ParameterReference.DoResolveLValue): Override lvalue resolve to mark
25879 the parameter as assigned here.
25880 (ParameterReference.DoResolve): Check whether the parameter has already
25882 (Argument.Resolve): If it's a `ref' or `out' argument, resolve the
25883 expression as lvalue.
25885 * statement.cs (FlowBranching): New class for the flow analysis code.
25886 (Goto): Resolve the label in Resolve, not in Emit; added flow analysis.
25887 (LabeledStatement.IsDefined): New public property.
25888 (LabeledStatement.AddUsageVector): New public method to tell flow
25889 analyis that the label may be reached via a forward jump.
25890 (GotoCase): Lookup and resolve the label in Resolve, not in Emit; added
25892 (VariableInfo.Number): New public field. This is used by flow analysis
25893 to number all locals of a block.
25894 (Block.CountVariables): New public property. This is the number of
25895 local variables in this block (including the locals from all parent
25897 (Block.EmitMeta): Number all the variables.
25899 * statement.cs: Added flow analysis support to all classes.
25901 2002-07-31 Martin Baulig <martin@gnome.org>
25903 * driver.cs: Added "--mcs-debug" argument if MCS_DEBUG is defined.
25904 To get debugging messages, compile mcs with /define:MCS_DEBUG and
25905 then use this argument.
25907 * report.cs (Report.Debug): Renamed to conditional to "MCS_DEBUG".
25909 * makefile.gnu (MCS_FLAGS): Include $(MCS_DEFINES), the user may
25910 use this to specify /define options.
25912 2002-07-29 Martin Baulig <martin@gnome.org>
25914 * statement.cs (Fixed): Moved all code that does variable lookups
25915 and resolvings from Emit to Resolve.
25917 * statement.cs (For): Moved all code that does variable lookups
25918 and resolvings from Emit to Resolve.
25920 * statement.cs (Using): Moved all code that does variable lookups
25921 and resolvings from Emit to Resolve.
25923 2002-07-29 Martin Baulig <martin@gnome.org>
25925 * attribute.cs (Attribute.Resolve): Explicitly catch a
25926 System.NullReferenceException when creating the
25927 CustromAttributeBuilder and report a different warning message.
25929 2002-07-29 Martin Baulig <martin@gnome.org>
25931 * support.cs (ParameterData.ParameterName): Added method to
25932 get the name of a parameter.
25934 * typemanager.cs (TypeManager.IsValueType): New public method.
25936 2002-07-29 Martin Baulig <martin@gnome.org>
25938 * parameter.cs (Parameter.Modifier): Added `ISBYREF = 8'. This
25939 is a flag which specifies that it's either ref or out.
25940 (Parameter.GetParameterInfo (DeclSpace, int, out bool)): Changed
25941 the out parameter to `out Parameter.Modifier mod', also set the
25942 Parameter.Modifier.ISBYREF flag on it if it's either ref or out.
25944 * support.cs (InternalParameters.ParameterModifier): Distinguish
25945 between Parameter.Modifier.OUT and Parameter.Modifier.REF, set the
25946 Parameter.Modifier.ISBYREF flag if it's either ref or out.
25948 * expression.cs (Argument.GetParameterModifier): Distinguish
25949 between Parameter.Modifier.OUT and Parameter.Modifier.REF, set the
25950 Parameter.Modifier.ISBYREF flag if it's either ref or out.
25952 2002-07-29 Martin Baulig <martin@gnome.org>
25954 * expression.cs (ParameterReference.ParameterReference): Added
25955 `Location loc' argument to the constructor.
25957 * cs-parser.jay: Pass location to ParameterReference.
25959 2002-07-28 Miguel de Icaza <miguel@ximian.com>
25961 * statement.cs (Try): Initialize the location.
25963 * cs-parser.jay: pass location to Try.
25965 * expression.cs (Unary.Reduce): Change the prototype to return
25966 whether a constant fold could be performed or not. The result is
25967 returned in an out parameters. In the case of Indirection and
25968 AddressOf, we want to perform the full tests.
25970 2002-07-26 Miguel de Icaza <miguel@ximian.com>
25972 * statement.cs (Statement.Emit): Flag dead code.
25974 2002-07-27 Andrew Birkett <andy@nobugs.org>
25976 * expression.cs (Unary.Reduce): Handle AddressOf and Indirection.
25978 2002-07-27 Martin Baulig <martin@gnome.org>
25980 * class.cs (MethodData.Define): Put back call to
25981 TypeManager.AddMethod(), accidentally commented this out.
25983 * report.cs (Debug): New public method to print debugging information,
25984 this is `[Conditional ("DEBUG")]'.
25986 2002-07-26 Martin Baulig <martin@gnome.org>
25988 * cs-parser.jay (CSharpParser): Added `Stack switch_stack'.
25989 (switch_statement): Push the current_block to the switch_stack and
25990 pop it again when we're done with the switch.
25991 (switch_section): The new block is a child of the current_block.
25992 Fixes bug #24007, added test-152.cs.
25994 2002-07-27 Martin Baulig <martin@gnome.org>
25996 * expression.cs (Invocation.EmitArguments): When calling a varargs
25997 function with only its fixed arguments, we need to pass an empty
26000 2002-07-27 Martin Baulig <martin@gnome.org>
26002 Mono 0.13 has been released.
26004 2002-07-25 Miguel de Icaza <miguel@ximian.com>
26006 * driver.cs: Rename --resource to --linkres, because that is what
26007 we do currently, we dont support --resource yet.
26009 * cs-tokenizer.cs: Fix test for reporting endif mismatches.
26011 2002-07-25 Martin Baulig <martin@gnome.org>
26013 * class.cs (MethodData): New public class. This is a `method builder'
26014 class for a method or one accessor of a Property/Indexer/Event.
26015 (MethodData.GetMethodFlags): Moved here from MemberBase.
26016 (MethodData.ApplyAttributes): Likewise.
26017 (MethodData.ApplyObsoleteAttribute): Likewise.
26018 (MethodData.ApplyConditionalAttribute): Likewise.
26019 (MethodData.ApplyDllImportAttribute): Likewise.
26020 (MethodData.CheckAbstractAndExternal): Likewise.
26021 (MethodData.Define): Formerly knows as MemberBase.DefineMethod().
26022 (MethodData.Emit): Formerly known as Method.Emit().
26023 (MemberBase): Moved everything which was specific to a single
26024 accessor/method to MethodData.
26025 (Method): Create a new MethodData and call Define() and Emit() on it.
26026 (Property, Indexer, Event): Create a new MethodData objects for each
26027 accessor and call Define() and Emit() on them.
26029 2002-07-25 Martin Baulig <martin@gnome.org>
26031 Made MethodCore derive from MemberBase to reuse the code from there.
26032 MemberBase now also checks for attributes.
26034 * class.cs (MethodCore): Derive from MemberBase, not MemberCore.
26035 (MemberBase.GetMethodFlags): Moved here from class Method and marked
26037 (MemberBase.DefineAccessor): Renamed to DefineMethod(), added
26038 `CallingConventions cc' and `Attributes opt_attrs' arguments.
26039 (MemberBase.ApplyAttributes): New virtual method; applies the
26040 attributes to a method or accessor.
26041 (MemberBase.ApplyObsoleteAttribute): New protected virtual method.
26042 (MemberBase.ApplyConditionalAttribute): Likewise.
26043 (MemberBase.ApplyDllImportAttribute): Likewise.
26044 (MemberBase.CheckAbstractAndExternal): Likewise.
26045 (MethodCore.ParameterTypes): This is now a property instead of a
26046 method, it's initialized from DoDefineParameters().
26047 (MethodCore.ParameterInfo): Removed the set accessor.
26048 (MethodCore.DoDefineParameters): New protected virtual method to
26049 initialize ParameterTypes and ParameterInfo.
26050 (Method.GetReturnType): We can now simply return the MemberType.
26051 (Method.GetMethodFlags): Override the MemberBase version and add
26052 the conditional flags.
26053 (Method.CheckBase): Moved some code from Define() here, call
26054 DoDefineParameters() here.
26055 (Method.Define): Use DoDefine() and DefineMethod() from MemberBase
26056 here to avoid some larger code duplication.
26057 (Property.Emit, Indexer.Emit): Call CheckAbstractAndExternal() to
26058 ensure that abstract and external accessors don't declare a body.
26060 * attribute.cs (Attribute.GetValidPieces): Make this actually work:
26061 `System.Attribute.GetCustomAttributes (attr.Type)' does a recursive
26062 lookup in the attribute's parent classes, so we need to abort as soon
26063 as we found the first match.
26064 (Attribute.Obsolete_GetObsoleteMessage): Return the empty string if
26065 the attribute has no arguments.
26067 * typemanager.cs (TypeManager.AddMethod): Now takes a MemberBase instead
26070 2002-07-24 Gonzalo Paniagua Javier <gonzalo@ximian.com>
26072 * cs-parser.jay: reverted previous patch.
26074 2002-07-24 Gonzalo Paniagua Javier <gonzalo@ximian.com>
26076 * cs-parser.jay: fixed bug #22119.
26078 2002-07-24 Gonzalo Paniagua Javier <gonzalo@ximian.com>
26080 * attribute.cs: fixed compilation. The error was:
26081 "attribute.cs(571,17): error CS0177: The out parameter 'is_error' must
26082 be assigned to before control leaves the current method."
26083 [FIXME: Filed as bug #28186: MCS must report this error.]
26085 2002-07-25 Martin Baulig <martin@gnome.org>
26087 * attribute.cs (Attribute.Conditional_GetConditionName): New static
26088 method to pull the condition name ouf of a Conditional attribute.
26089 (Attribute.Obsolete_GetObsoleteMessage): New static method to pull
26090 the obsolete message and error flag out of an Obsolete attribute.
26092 * class.cs (Method.GetMethodFlags): New public method to get the
26093 TypeManager.MethodFlags for this method.
26094 (Method.ApplyConditionalAttribute, Method.ApplyObsoleteAttribute): New
26096 (Method.Define): Get and apply the Obsolete and Conditional attributes;
26097 if we're overriding a virtual function, set the new private variable
26098 `parent_method'; call the new TypeManager.AddMethod().
26100 * typemanager.cs (TypeManager.AddMethod): New static method. Stores
26101 the MethodBuilder and the Method in a PtrHashtable.
26102 (TypeManager.builder_to_method): Added for this purpose.
26103 (TypeManager.MethodFlags): Added IsObsoleteError.
26104 (TypeManager.GetMethodFlags): Added `Location loc' argument. Lookup
26105 Obsolete and Conditional arguments in MethodBuilders. If we discover
26106 an Obsolete attribute, emit an appropriate warning 618 / error 619 with
26107 the message from the attribute.
26109 2002-07-24 Martin Baulig <martin@gnome.org>
26111 * cs-tokenizer.cs: Eat up trailing whitespaces and one-line comments in
26112 preprocessor directives, ensure that the argument to #define/#undef is
26113 exactly one identifier and that it's actually an identifier.
26115 Some weeks ago I did a `#define DEBUG 1' myself and wondered why this
26118 2002-07-24 Martin Baulig <martin@gnome.org>
26120 * statement.cs (Foreach.ForeachHelperMethods): Added `Type element_type',
26121 initialize it to TypeManager.object_type in the constructor.
26122 (Foreach.GetEnumeratorFilter): Set `hm.element_type' to the return type
26123 of the `hm.get_current' method if we're using the collection pattern.
26124 (Foreach.EmitCollectionForeach): Use `hm.element_type' as the source type
26125 for the explicit conversion to make it work when we're using the collection
26126 pattern and the `Current' property has a different return type than `object'.
26129 2002-07-24 Martin Baulig <martin@gnome.org>
26131 * delegate.cs (Delegate.VerifyMethod): Simply return null if the method
26132 does not match, but don't report any errors. This method is called in
26133 order for all methods in a MethodGroupExpr until a matching method is
26134 found, so we don't want to bail out if the first method doesn't match.
26135 (NewDelegate.DoResolve): If none of the methods in the MethodGroupExpr
26136 matches, report the 123. Fixes #28070.
26138 2002-07-24 Martin Baulig <martin@gnome.org>
26140 * expression.cs (ArrayAccess.EmitStoreOpcode): Moved the
26141 TypeManager.TypeToCoreType() to the top of the method so the
26142 following equality checks will work. Fixes #28107.
26144 2002-07-24 Martin Baulig <martin@gnome.org>
26146 * cfold.cs (ConstantFold.DoConstantNumericPromotions): "If either
26147 operand is of type uint, and the other operand is of type sbyte,
26148 short or int, the operands are converted to type long." -
26149 Actually do what this comment already told us. Fixes bug #28106,
26152 2002-07-24 Martin Baulig <martin@gnome.org>
26154 * class.cs (MethodBase): New abstract class. This is now a base
26155 class for Property, Indexer and Event to avoid some code duplication
26156 in their Define() and DefineMethods() methods.
26157 (MethodBase.DoDefine, MethodBase.DefineAccessor): Provide virtual
26158 generic methods for Define() and DefineMethods().
26159 (FieldBase): Derive from MemberBase, not MemberCore.
26160 (Property): Derive from MemberBase, not MemberCore.
26161 (Property.DefineMethod): Moved all the code from this method to the
26162 new MethodBase.DefineAccessor(), just call it with appropriate
26164 (Property.Define): Call the new Property.DoDefine(), this does some
26165 sanity checks and we don't need to duplicate the code everywhere.
26166 (Event): Derive from MemberBase, not MemberCore.
26167 (Event.Define): Use the new MethodBase.DefineAccessor() to define the
26168 accessors, this will also make them work with interface events.
26169 (Indexer): Derive from MemberBase, not MemberCore.
26170 (Indexer.DefineMethod): Removed, call MethodBase.DefineAccessor() insstead.
26171 (Indexer.Define): Use the new MethodBase functions.
26173 * interface.cs (InterfaceEvent.InterfaceEvent): Added `Location loc'
26174 argument to the constructor.
26175 (Interface.FindMembers): Added support for interface events.
26176 (Interface.PopluateEvent): Implemented.
26178 Added test-149.cs for this. This also fixes bugs #26067 and #24256.
26180 2002-07-22 Miguel de Icaza <miguel@ximian.com>
26182 * class.cs (TypeContainer.AddMethod): Adding methods do not use IsValid,
26183 but this is required to check for a method name being the same as
26184 the containing class.
26188 2002-07-22 Gonzalo Paniagua Javier <gonzalo@ximian.com>
26190 * interface.cs: initialize variable.
26192 2002-07-23 Martin Baulig <martin@gnome.org>
26194 Implemented the IndexerName attribute in interfaces.
26196 * class.cs (TypeContainer.DefineIndexers): Don't set the indexer
26197 name if this is an explicit interface implementation.
26198 (Indexer.InterfaceIndexerName): New public variable. If we're
26199 implementing an interface indexer, this is the IndexerName in that
26200 interface. Otherwise, it's the IndexerName.
26201 (Indexer.DefineMethod): If we're implementing interface indexer,
26202 set InterfaceIndexerName. Use the new Pending.IsInterfaceIndexer
26203 and Pending.ImplementIndexer methods.
26204 (Indexer.Define): Also define the PropertyBuilder if we're
26205 implementing an interface indexer and this is neither an explicit
26206 interface implementation nor do the IndexerName match the one in
26209 * pending.cs (TypeAndMethods): Added `MethodInfo [] need_proxy'.
26210 If a method is defined here, then we always need to create a proxy
26211 for it. This is used when implementing interface indexers.
26212 (Pending.IsInterfaceIndexer): New public method.
26213 (Pending.ImplementIndexer): New public method.
26214 (Pending.InterfaceMethod): Added `MethodInfo need_proxy' argument.
26215 This is used when implementing interface indexers to define a proxy
26217 (Pending.VerifyPendingMethods): Look in the `need_proxy' array and
26218 define a proxy if necessary.
26220 * interface.cs (Interface.IndexerName): New public variable.
26221 (Interface.PopulateIndexer): Set the IndexerName.
26222 (Interface.DefineIndexers): New private method. Populate all the
26223 indexers and make sure their IndexerNames match.
26225 * typemanager.cs (IndexerPropertyName): Added support for interface
26228 2002-07-22 Martin Baulig <martin@gnome.org>
26230 * codegen.cs (EmitContext.HasReturnLabel): New public variable.
26231 (EmitContext.EmitTopBlock): Always mark the ReturnLabel and emit a
26232 ret if HasReturnLabel.
26233 (EmitContext.TryCatchLevel, LoopBeginTryCatchLevel): New public
26236 * statement.cs (Do.Emit, While.Emit, For.Emit, Foreach.Emit): Save
26237 and set the ec.LoopBeginTryCatchLevel.
26238 (Try.Emit): Increment the ec.TryCatchLevel while emitting the block.
26239 (Continue.Emit): If the ec.LoopBeginTryCatchLevel is smaller than
26240 the current ec.TryCatchLevel, the branch goes out of an exception
26241 block. In this case, we need to use Leave and not Br.
26243 2002-07-22 Martin Baulig <martin@gnome.org>
26245 * statement.cs (Try.Emit): Emit an explicit ret after the end of the
26246 block unless the block does not always return or it is contained in
26247 another try { ... } catch { ... } block. Fixes bug #26506.
26248 Added verify-1.cs to the test suite.
26250 2002-07-22 Martin Baulig <martin@gnome.org>
26252 * statement.cs (Switch.TableSwitchEmit): If we don't have a default,
26253 then we do not always return. Fixes bug #24985.
26255 2002-07-22 Martin Baulig <martin@gnome.org>
26257 * expression.cs (Invocation.OverloadedResolve): Do the BetterFunction()
26258 lookup on a per-class level; ie. walk up the class hierarchy until we
26259 found at least one applicable method, then choose the best among them.
26260 Fixes bug #24463 and test-29.cs.
26262 2002-07-22 Martin Baulig <martin@gnome.org>
26264 * typemanager.cs (TypeManager.ArrayContainsMethod): Don't check the
26265 return types of the methods. The return type is not part of the
26266 signature and we must not check it to make the `new' modifier work.
26267 Fixes bug #27999, also added test-147.cs.
26268 (TypeManager.TypeToCoreType): Added TypeManager.type_type.
26270 * expression.cs (Invocation.DoResolve): Call TypeManager.TypeToCoreType()
26271 on the method's return type.
26273 2002-07-21 Martin Baulig <martin@gnome.org>
26275 * assign.cs: Make this work if the rightmost source is a constant and
26276 we need to do an implicit type conversion. Also adding a few more tests
26277 to test-38.cs which should have caught this.
26279 * makefile.gnu: Disable debugging, there's already the mcs-mono2.exe
26280 target in the makefile for this. The makefile.gnu is primarily intended
26281 for end-users who don't want to debug the compiler.
26283 2002-07-21 Martin Baulig <martin@gnome.org>
26285 * assign.cs: Improved the Assign class so it can now handle embedded
26286 assignments (X = Y = Z = something). As a side-effect this'll now also
26287 consume less local variables. test-38.cs now passes with MCS, added
26288 a few new test cases to that test.
26290 2002-07-20 Martin Baulig <martin@gnome.org>
26292 * expression.cs (Binary.EmitBranchable): Emit correct unsigned branch
26293 instructions. Fixes bug #27977, also added test-146.cs.
26295 2002-07-19 Gonzalo Paniagua Javier <gonzalo@ximian.com>
26297 * cs-tokenizer.cs: fixed getHex ().
26299 2002-07-19 Martin Baulig <martin@gnome.org>
26301 * expression.cs (Invocation.EmitParams): Use TypeManager.LookupType(),
26302 not Type.GetType() to lookup the array type. This is needed when
26303 we're constructing an array of a user-defined type.
26304 (ArrayAccess.EmitDynamicInitializers): Only emit the Ldelema for
26305 single-dimensional arrays, but also for single-dimensial arrays of
26308 2002-07-19 Martin Baulig <martin@gnome.org>
26310 * expression.cs (New.DoEmit): Create a new LocalTemporary each time
26311 this function is called, it's not allowed to share LocalBuilders
26312 among ILGenerators.
26314 2002-07-19 Martin Baulig <martin@gnome.org>
26316 * expression.cs (Argument.Resolve): Report an error 118 when trying
26317 to pass a type as argument.
26319 2002-07-18 Martin Baulig <martin@gnome.org>
26321 * ecore.cs (Expression.ImplicitNumericConversion): Don't emit a
26322 Conv_R_Un for the signed `long' type.
26324 2002-07-15 Miguel de Icaza <miguel@ximian.com>
26326 * expression.cs (MemberAccess.DoResolve): Do not reuse the field
26327 `expr' for the temporary result, as that will fail if we do
26328 multiple resolves on the same expression.
26330 2002-07-05 Miguel de Icaza <miguel@ximian.com>
26332 * ecore.cs (SimpleNameResolve): Use ec.DeclSpace instead of
26333 ec.TypeContainer for looking up aliases.
26335 * class.cs (TypeContainer): Remove LookupAlias from here.
26337 * decl.cs (DeclSpace); Move here.
26339 2002-07-01 Miguel de Icaza <miguel@ximian.com>
26341 * class.cs (FindMembers): Only call filter if the constructor
26342 bulider is not null.
26344 Also handle delegates in `NestedTypes' now. Now we will perform
26345 type lookups using the standard resolution process. This also
26348 * decl.cs (DeclSpace.ResolveType): New type resolution routine.
26349 This uses Expressions (the limited kind that can be parsed by the
26350 tree) instead of strings.
26352 * expression.cs (ComposedCast.ToString): Implement, used to flag
26353 errors since now we have to render expressions.
26355 (ArrayCreation): Kill FormElementType. Use ComposedCasts in
26358 * ecore.cs (SimpleName.ToString): ditto.
26360 * cs-parser.jay: Instead of using strings to assemble types, use
26361 Expressions to assemble the type (using SimpleName, ComposedCast,
26362 MemberAccess). This should fix the type lookups in declarations,
26363 because we were using a different code path for this.
26365 * statement.cs (Block.Resolve): Continue processing statements
26366 even when there is an error.
26368 2002-07-17 Miguel de Icaza <miguel@ximian.com>
26370 * class.cs (Event.Define): Also remove the `remove' method from
26371 the list of pending items.
26373 * expression.cs (ParameterReference): Use ldarg.N (0..3) to
26374 generate more compact code.
26376 2002-07-17 Martin Baulig <martin@gnome.org>
26378 * const.cs (Const.LookupConstantValue): Add support for constant
26379 `unchecked' and `checked' expressions.
26380 Also adding test case test-140.cs for this.
26382 2002-07-17 Martin Baulig <martin@gnome.org>
26384 * statement.cs (Foreach.GetEnumeratorFilter): When compiling corlib,
26385 check whether mi.ReturnType implements the IEnumerator interface; the
26386 `==' and the IsAssignableFrom() will fail in this situation.
26388 2002-07-16 Ravi Pratap <ravi@ximian.com>
26390 * ecore.cs (SimpleName.SimpleNameResolve) : Apply Gonzalo's fix
26393 2002-07-16 Gonzalo Paniagua Javier <gonzalo@ximian.com>
26395 * expression.cs: fixed bug #27811.
26397 2002-07-14 Miguel de Icaza <miguel@ximian.com>
26399 * expression.cs (ParameterReference.AddressOf): Patch from Paolo
26400 Molaro: when we are a ref, the value already contains a pointer
26401 value, do not take the address of it.
26403 2002-07-14 Rafael Teixeira <rafaelteixeirabr@hotmail.com>
26404 * removed mb-parser.jay and mb-tokenizer.cs
26406 Sat Jul 13 19:38:03 CEST 2002 Paolo Molaro <lupus@ximian.com>
26408 * expression.cs: check against the building corlib void type.
26410 Sat Jul 13 19:35:58 CEST 2002 Paolo Molaro <lupus@ximian.com>
26412 * ecore.cs: fix for valuetype static readonly fields: when
26413 initializing them, we need their address, not the address of a copy.
26415 Sat Jul 13 17:32:53 CEST 2002 Paolo Molaro <lupus@ximian.com>
26417 * typemanager.cs: register also enum_type in corlib.
26419 Sat Jul 13 15:59:47 CEST 2002 Paolo Molaro <lupus@ximian.com>
26421 * class.cs: allow calling this (but not base) initializers in structs.
26423 Sat Jul 13 15:12:06 CEST 2002 Paolo Molaro <lupus@ximian.com>
26425 * ecore.cs: make sure we compare against the building base types
26428 Sat Jul 13 15:10:32 CEST 2002 Paolo Molaro <lupus@ximian.com>
26430 * typemanager.cs: fix TypeToCoreType() to handle void and object
26431 (corlib gets no more typerefs after this change).
26433 2002-07-12 Miguel de Icaza <miguel@ximian.com>
26435 * expression.cs (ArrayCreation.EmitArrayArguments): use
26436 Conv.Ovf.U4 for unsigned and Conv.Ovf.I4 for signed.
26438 (ArrayAccess.LoadArrayAndArguments): Use Conv_Ovf_I and
26439 Conv_Ovf_I_Un for the array arguments. Even if C# allows longs as
26440 array indexes, the runtime actually forbids them.
26442 * ecore.cs (ExpressionToArrayArgument): Move the conversion code
26443 for array arguments here.
26445 * expression.cs (EmitLoadOpcode): System.Char is a U2, use that
26446 instead of the default for ValueTypes.
26448 (New.DoEmit): Use IsValueType instead of
26449 IsSubclassOf (value_type)
26450 (New.DoResolve): ditto.
26451 (Invocation.EmitCall): ditto.
26453 * assign.cs (Assign): ditto.
26455 * statement.cs (Unsafe): Ok, so I got the semantics wrong.
26456 Statements *are* currently doing part of their resolution during
26459 Expressions do always resolve during resolve, but statements are
26460 only required to propagate resolution to their children.
26462 2002-07-11 Miguel de Icaza <miguel@ximian.com>
26464 * driver.cs (CSCParseOption): Finish the /r: and /lib: support.
26466 (LoadAssembly): Do not add the dll if it is already specified
26468 (MainDriver): Add the System directory to the link path at the end,
26469 after all the other -L arguments.
26471 * expression.cs (ArrayAccess.EmitLoadOpcode): I was using the
26472 wrong opcode for loading bytes and bools (ldelem.i1 instead of
26473 ldelem.u1) and using the opposite for sbytes.
26475 This fixes Digger, and we can finally run it.
26477 * driver.cs (UnixParseOption): Move the option parsing here.
26478 (CSCParseOption): Implement CSC-like parsing of options.
26480 We now support both modes of operation, the old Unix way, and the
26481 new CSC-like way. This should help those who wanted to make cross
26482 platform makefiles.
26484 The only thing broken is that /r:, /reference: and /lib: are not
26485 implemented, because I want to make those have the same semantics
26486 as the CSC compiler has, and kill once and for all the confussion
26487 around this. Will be doing this tomorrow.
26489 * statement.cs (Unsafe.Resolve): The state is checked during
26490 resolve, not emit, so we have to set the flags for IsUnsfe here.
26492 2002-07-10 Miguel de Icaza <miguel@ximian.com>
26494 * expression.cs (MemberAccess.ResolveMemberAccess): Since we can
26495 not catch the Error_ObjectRefRequired in SimpleName (as it is
26496 possible to have a class/instance variable name that later gets
26497 deambiguated), we have to check this here.
26499 2002-07-10 Ravi Pratap <ravi@ximian.com>
26501 * class.cs (TypeContainer.GetFieldFromEvent): Move away from here,
26502 make static and put into Expression.
26504 (Event.Define): Register the private field of the event with the
26505 TypeManager so that GetFieldFromEvent can get at it.
26507 (TypeManager.RegisterPrivateFieldOfEvent): Implement to
26508 keep track of the private field associated with an event which
26511 (TypeManager.GetPrivateFieldOfEvent): Implement to get at the
26514 * ecore.cs (GetFieldFromEvent): RE-write to use the above methods.
26516 2002-07-10 Miguel de Icaza <miguel@ximian.com>
26518 * expression.cs (Binary.EmitBranchable): this routine emits the
26519 Binary expression in a branchable context. This basically means:
26520 we need to branch somewhere, not just get the value on the stack.
26522 This works together with Statement.EmitBoolExpression.
26524 * statement.cs (Statement.EmitBoolExpression): Use
26527 2002-07-09 Miguel de Icaza <miguel@ximian.com>
26529 * statement.cs (For): Reduce the number of jumps in loops.
26531 (For): Implement loop inversion for the For statement.
26533 (Break): We can be breaking out of a Try/Catch controlled section
26534 (foreach might have an implicit try/catch clause), so we need to
26535 use Leave instead of Br.
26537 * ecore.cs (FieldExpr.AddressOf): Fix for test-139 (augmented
26538 now). If the instace expression supports IMemoryLocation, we use
26539 the AddressOf method from the IMemoryLocation to extract the
26540 address instead of emitting the instance.
26542 This showed up with `This', as we were emitting the instance
26543 always (Emit) instead of the Address of This. Particularly
26544 interesting when This is a value type, as we dont want the Emit
26545 effect (which was to load the object).
26547 2002-07-08 Miguel de Icaza <miguel@ximian.com>
26549 * attribute.cs: Pass the entry point to the DefinePInvokeMethod
26551 * statement.cs (Checked): Set the CheckedState during the resolve
26552 process too, as the ConvCast operations track the checked state on
26553 the resolve process, and not emit.
26555 * cs-parser.jay (namespace_member_declaration): Flag that we have
26556 found a declaration when we do. This is used to flag error 1529
26558 * driver.cs: Report ok when we display the help only.
26560 2002-07-06 Andrew Birkett <adb@tardis.ed.ac.uk>
26562 * cs-tokenizer.cs (xtoken): Improve handling of string literals.
26564 2002-07-04 Miguel de Icaza <miguel@ximian.com>
26566 * cs-tokenizer.cs (define): We also have to track locally the
26567 defines. AllDefines is just used for the Conditional Attribute,
26568 but we also need the local defines for the current source code.
26570 2002-07-03 Miguel de Icaza <miguel@ximian.com>
26572 * statement.cs (While, For, Do): These loops can exit through a
26573 Break statement, use this information to tell whether the
26574 statement is the last piece of code.
26576 (Break): Flag that we break.
26578 * codegen.cs (EmitContexts): New `Breaks' state variable.
26580 2002-07-03 Martin Baulig <martin@gnome.org>
26582 * class.cs (TypeContainer.MethodModifiersValid): Allow override
26583 modifiers in method declarations in structs. Otherwise, you won't
26584 be able to override things like Object.Equals().
26586 2002-07-02 Miguel de Icaza <miguel@ximian.com>
26588 * class.cs (Method, Property, Indexer): Do not allow the public
26589 modifier to be used in explicit interface implementations.
26591 (TypeContainer.MethodModifiersValid): Catch virtual, abstract and
26592 override modifiers in method declarations in structs
26594 2002-07-02 Andrew Birkett <adb@tardis.ed.ac.uk>
26596 * cs-tokenizer.cs (adjust_int, adjust_real): Do not abort on
26597 integer or real overflow, report an error
26599 2002-07-02 Martin Baulig <martin@gnome.org>
26601 * typemanager.cs (TypeManager.InitCoreTypes): When compiling
26602 corlib, dynamically call AssemblyBuilder.SetCorlibTypeBuilders()
26603 to tell the runtime about our newly created System.Object and
26604 System.ValueType types.
26606 2002-07-02 Miguel de Icaza <miguel@ximian.com>
26608 * expression.cs (This): Use Stobj/Ldobj when we are a member of a
26609 struct instead of Ldarg/Starg.
26611 2002-07-02 Martin Baulig <martin@gnome.org>
26613 * expression.cs (Indirection.Indirection): Call
26614 TypeManager.TypeToCoreType() on `expr.Type.GetElementType ()'.
26616 2002-07-02 Martin Baulig <martin@gnome.org>
26618 * expression.cs (ArrayAccess.EmitStoreOpcode): If the type is a
26619 ValueType, call TypeManager.TypeToCoreType() on it.
26620 (Invocations.EmitParams): Call TypeManager.TypeToCoreType() on
26621 the OpCodes.Newarr argument.
26623 2002-07-02 Martin Baulig <martin@gnome.org>
26625 * expression.cs (Invocation.EmitCall): When compiling corlib,
26626 replace all calls to the system's System.Array type to calls to
26627 the newly created one.
26629 * typemanager.cs (TypeManager.InitCodeHelpers): Added a few more
26630 System.Array methods.
26631 (TypeManager.InitCoreTypes): When compiling corlib, get the methods
26632 from the system's System.Array type which must be replaced.
26634 Tue Jul 2 19:05:05 CEST 2002 Paolo Molaro <lupus@ximian.com>
26636 * typemanager.cs: load unverifiable_code_ctor so we can build
26637 corlib using the correct type. Avoid using GetTypeCode() with
26639 * rootcontext.cs: uses TypeManager.unverifiable_code_ctor and
26640 TypeManager.object_type to allow building corlib.
26642 Tue Jul 2 19:03:19 CEST 2002 Paolo Molaro <lupus@ximian.com>
26644 * ecore.cs: handle System.Enum separately in LoadFromPtr().
26646 2002-07-01 Martin Baulig <martin@gnome.org>
26648 * class.cs: Make the last change actually work, we need to check
26649 whether `ifaces != null' to avoid a crash.
26651 Mon Jul 1 16:15:03 CEST 2002 Paolo Molaro <lupus@ximian.com>
26653 * class.cs: when we build structs without fields that implement
26654 interfaces, we need to add the interfaces separately, since there is
26655 no API to both set the size and add the interfaces at type creation
26658 Mon Jul 1 14:50:47 CEST 2002 Paolo Molaro <lupus@ximian.com>
26660 * expression.cs: the dimension arguments to the array constructors
26661 need to be converted if they are a long.
26663 Mon Jul 1 12:26:12 CEST 2002 Paolo Molaro <lupus@ximian.com>
26665 * class.cs: don't emit ldarg.0 if there is no parent constructor
26666 (fixes showstopper for corlib).
26668 2002-06-29 Martin Baulig <martin@gnome.org>
26670 MCS now compiles corlib on GNU/Linux :-)
26672 * attribute.cs (Attribute.ApplyAttributes): Treat Accessors like Method,
26673 ie. check for MethodImplOptions.InternalCall.
26675 * class.cs (TypeContainer.DefineType): When compiling corlib, both parent
26676 and TypeManager.attribute_type are null, so we must explicitly check
26677 whether parent is not null to find out whether it's an attribute type.
26678 (Property.Emit): Always call Attribute.ApplyAttributes() on the GetBuilder
26679 and SetBuilder, not only if the property is neither abstract nor external.
26680 This is necessary to set the MethodImplOptions on the accessor methods.
26681 (Indexer.Emit): Call Attribute.ApplyAttributes() on the GetBuilder and
26682 SetBuilder, see Property.Emit().
26684 * rootcontext.cs (RootContext.PopulateTypes): When compiling corlib, don't
26685 populate "System.Object", "System.ValueType" and "System.Attribute" since
26686 they've already been populated from BootCorlib_PopulateCoreTypes().
26688 2002-06-29 Martin Baulig <martin@gnome.org>
26690 * ecore.cs (Expression.ImplicitReferenceConversionExists): If expr
26691 is the NullLiteral, we also need to make sure that target_type is not
26694 2002-06-29 Martin Baulig <martin@gnome.org>
26696 * rootcontext.cs (RootContext.ResolveCore): We must initialize
26697 `TypeManager.multicast_delegate_type' and `TypeManager.delegate_type'
26698 before calling BootstrapCorlib_ResolveDelegate ().
26700 2002-06-27 Gonzalo Paniagua Javier <gonzalo@ximian.com>
26702 * statement.cs: fixed build-breaker. All tests passed ok.
26704 2002-06-27 Martin Baulig <martin@gnome.org>
26706 * typemanager.cs (TypeManager.VerifyUnManaged): Added explicit check
26707 for System.Decimal when compiling corlib.
26709 2002-06-27 Martin Baulig <martin@gnome.org>
26711 * statement.cs (Switch.TableSwitchEmit): Make this work with empty
26712 switch blocks which contain nothing but a default clause.
26714 2002-06-26 Andrew <adb@tardis.ed.ac.uk>
26716 * ../errors/cs1501-3.cs: Added new test for struct ctr typechecks.
26718 2002-06-27 Martin Baulig <martin@gnome.org>
26720 * ecore.cs (PropertyExpr.PropertyExpr): Call
26721 TypeManager.TypeToCoreType() on the `pi.PropertyType'.
26723 * typemanager.cs (TypeManager.TypeToCoreType): Return if the type
26724 is already a TypeBuilder.
26726 2002-06-27 Martin Baulig <martin@gnome.org>
26728 * ecore.cs (Expression.ImplicitReferenceConversionExists): Use
26729 `target_type == TypeManager.array_type', not IsAssignableFrom() in
26730 the "from an array-type to System.Array" case. This makes it work
26731 when compiling corlib.
26733 2002-06-27 Martin Baulig <martin@gnome.org>
26735 * ecore.cs (Expression.SimpleNameResolve): If the expression is a
26736 non-static PropertyExpr, set its InstanceExpression. This makes
26737 the `ICollection.Count' property work in System/Array.cs.
26739 2002-06-25 Andrew Birkett <adb@tardis.ed.ac.uk>
26741 * driver.cs: Made error handling more consistent. Errors now
26742 tracked by Report class, so many methods which used to return int
26743 now return void. Main() now prints success/failure and
26744 errors/warnings message.
26746 Renamed '--probe' compiler argument to '--expect-error'. Removed
26747 the magic number return values (123 and 124). Now, if the
26748 expected error occurs, the compiler exits with success (exit value
26749 0). If the compilation completes without seeing that particular
26750 error, the compiler exits with failure (exit value 1). The
26751 makefile in mcs/errors has been changed to handle the new behaviour.
26753 * report.cs: Made 'expected error' number a property and renamed
26754 it from 'Probe' to 'ExpectedError'.
26756 * genericparser.cs: Removed error handling support, since it is
26757 now all done by Report class.
26759 * cs-parser.jay, mb-parser.jay: Errors are tracked by Report
26760 class, so parse() no longer returns an int.
26762 * namespace.cs: Use Report.Error instead of GenericParser.error
26764 2002-06-22 Miguel de Icaza <miguel@ximian.com>
26766 * class.cs (TypeContainer.AddMethod, TypeContainer.AddIndexer,
26767 TypeContainer.AddOperator): At the front of the list put the
26768 explicit implementations, so they get resolved/defined first.
26770 2002-06-21 Miguel de Icaza <miguel@ximian.com>
26772 * class.cs (TypeContainer.VerifyImplements): Verifies that a given
26773 interface type is implemented by this TypeContainer. Used during
26774 explicit interface implementation.
26776 (Property.Define, Indexer.Define, Method.Define): Validate that
26777 the given interface in the explicit implementation is one of the
26778 base classes for the containing type.
26780 Also if we are explicitly implementing an interface, but there is
26781 no match in the pending implementation table, report an error.
26783 (Property.Define): Only define the property if we are
26784 not explicitly implementing a property from an interface. Use the
26785 correct name also for those properties (the same CSC uses,
26786 although that is really not needed).
26788 (Property.Emit): Do not emit attributes for explicitly implemented
26789 properties, as there is no TypeBuilder.
26791 (Indexer.Emit): ditto.
26793 Hiding then means that we do not really *implement* a pending
26794 implementation, which makes code fail.
26796 2002-06-22 Martin Baulig <martin@gnome.org>
26798 * ecore.cs (Expression.Constantify): Call TypeManager.TypeToCoreType() on
26799 the return value of Object.GetType(). [FIXME: we need to do this whenever
26800 we get a type back from the reflection library].
26802 Fri Jun 21 13:37:57 CEST 2002 Paolo Molaro <lupus@ximian.com>
26804 * typemanager.cs: make ExpandInterfaces() slip duplicated interfaces.
26806 2002-06-20 Miguel de Icaza <miguel@ximian.com>
26808 * attribute.cs: Return null if we can not look up the type.
26810 * class.cs (TypeContainer.GetClassBases): Use ExpandInterfaces on
26811 the interface types found.
26813 * interface.cs (Interface.GetInterfaceBases): Use ExpandInterfaces on the
26814 interface types found.
26816 * typemanager.cs (GetInterfaces): Make this routine returns alll
26817 the interfaces and work around the lame differences between
26818 System.Type and System.Reflection.Emit.TypeBuilder in the results
26819 result for GetInterfaces.
26821 (ExpandInterfaces): Given an array of interface types, expand and
26822 eliminate repeated ocurrences of an interface. This expands in
26823 context like: IA; IB : IA; IC : IA, IB; the interface "IC" to
26826 2002-06-21 Martin Baulig <martin@gnome.org>
26828 * typemanager.cs (TypeManager.EnumToUnderlying): It's now safe to call this function
26831 2002-06-21 Martin Baulig <martin@gnome.org>
26833 * typemanager.cs (TypeManager.TypeToCoreType): New function. When compiling corlib
26834 and called with one of the core types, return the corresponding typebuilder for
26837 * expression.cs (ArrayAccess.DoResolve): Call TypeManager.TypeToCoreType() on the
26840 2002-06-21 Martin Baulig <martin@gnome.org>
26842 * ecore.cs (Expression.ExplicitReferenceConversionExists): Use
26843 `target_type.IsArray' instead of `target_type.IsSubclassOf (TypeManager.array_type)'.
26844 (Expression.ConvertReferenceExplicit): Likewise.
26846 * expression.cs (ElementAccess.DoResolve): Likewise.
26847 (ElementAccess.DoResolveLValue): Likewise.
26849 2002-06-10 Martin Baulig <martin@gnome.org>
26851 * interface.cs (Interface.PopulateIndexer): When creating the setter, we need to
26852 add the "value" parameter to the parameter list.
26854 * statement.cs (Fixed.Emit): Pass the return value of the child block's Emit()
26857 2002-06-19 Miguel de Icaza <miguel@ximian.com>
26859 * expression.cs (ArrayCreation.ExpressionToArrayArgument): Convert
26860 the argument to an int, uint, long or ulong, per the spec. Also
26861 catch negative constants in array creation.
26863 Thu Jun 20 17:56:48 CEST 2002 Paolo Molaro <lupus@ximian.com>
26865 * class.cs: do not allow the same interface to appear twice in
26866 the definition list.
26868 Wed Jun 19 22:33:37 CEST 2002 Paolo Molaro <lupus@ximian.com>
26870 * ecore.cs: don't use ldlen with System.Array.
26872 Wed Jun 19 20:57:40 CEST 2002 Paolo Molaro <lupus@ximian.com>
26874 * ecore.cs: stobj requires a type argument. Handle indirect stores on enums.
26876 Wed Jun 19 20:17:59 CEST 2002 Paolo Molaro <lupus@ximian.com>
26878 * modifiers.cs: produce correct field attributes for protected
26879 internal. Easy fix so miguel can work on ther harder stuff:-)
26881 2002-06-18 Miguel de Icaza <miguel@ximian.com>
26883 * pending.cs: New file. Move the code from class.cs here.
26884 Support clearning the pending flag for all methods (when not doing
26885 explicit interface implementation).
26887 Tue Jun 18 10:36:22 CEST 2002 Paolo Molaro <lupus@ximian.com>
26889 * rootcontext.cs: added a couple more types needed to bootstrap.
26891 2002-06-17 Miguel de Icaza <miguel@ximian.com>
26893 * typemanager.cs (GetConstructor): Use DeclaredOnly to look the
26894 constructor in the type, instead of any constructor in the type
26895 hierarchy. Thanks to Paolo for finding this bug (it showed up as
26896 a bug in the Mono runtime when applying the params attribute).
26898 2002-06-16 Rafael Teixeira <rafaelteixeirabr@hotmail.com>
26899 * changed namespace.cs to use "GenericParser.error(...)" instead of "CSharpParser.error(...)"
26901 2002-06-14 Rachel Hestilow <hestilow@ximian.com>
26903 * expression.cs (Unary.ResolveOperator): Use TypeManager
26904 to resolve the type.
26906 2002-06-13 Ravi Pratap <ravi@ximian.com>
26908 * cs-parser.jay (enum_member_declaration): Pass in the attributes
26911 * enum.cs (AddEnumMember): Add support to store the attributes associated
26912 with each member too.
26914 * attribute.cs (CheckAttribute, ApplyAttributes): Update to handle
26915 field builders too - this takes care of the enum member case.
26917 2002-06-10 Rachel Hestilow <hestilow@ximian.com>
26919 * typemanager.cs (TypeManager.VerifyUnManaged): Allow
26920 address-of operator on both value types and pointers.
26922 2002-06-10 Martin Baulig <martin@gnome.org>
26924 * interface.cs (Interface.PopulateIndexer): Add the indexer's
26925 PropertyBuilder to the `property_builders' list.
26927 * expression.cs (Indexers.GetIndexersForTypeOrInterface): New private method.
26928 (Indexers.GetIndexersForType): Call GetIndexersForTypeOrInterface() on the
26929 `lookup_type' and all its interfaces. Unfortunately, Type.FindMembers() won't
26930 find any indexers which are inherited from an interface.
26932 2002-06-09 Martin Baulig <martin@gnome.org>
26934 * const.cs (Const.LookupConstantValue): Convert `Expr' to a literal of
26935 the same type as the constant if necessary. There's also a test-130.cs
26938 * enum.cs (Enum.ChangeEnumType): Moved to typemanager.cs and made public.
26940 * typemanager.cs (TypeManager.ChangeType): Previously known as
26941 Enum.ChangeEnumType().
26943 2002-06-09 Martin Baulig <martin@gnome.org>
26945 * expression.cs (Cast.TryReduce): Added support for consts.
26947 2002-06-08 Ravi Pratap <ravi@ximian.com>
26949 * class.cs (Accessor): Hold attributes information so we can pass
26952 * cs-parser.jay (get_accessor_declaration, set_accessor_declaration):
26953 Modify to pass in attributes attached to the methods.
26955 (add_accessor_declaration, remove_accessor_declaration): Ditto.
26957 * attribute.cs (ApplyAttributes, CheckAttribute): Update accordingly
26958 to handle the Accessor kind :-)
26960 * class.cs (Property.Emit, Event.Emit): Apply attributes to the accessors
26962 2002-06-08 Martin Baulig <martin@gnome.org>
26964 * expression.cs (Unary.TryReduceNegative): Added support for
26967 2002-06-08 Martin Baulig <martin@gnome.org>
26969 * enum.cs (Enum.LookupEnumValue): Don't report an error if the
26970 name can't be found in the `defined_names' - the caller will do a
26971 MemberLookup in this case and thus find methods in System.Enum
26972 such as Enum.IsDefined().
26974 2002-06-08 Martin Baulig <martin@gnome.org>
26976 * enum.cs (Enum.ChangeEnumType): This is a custom version of
26977 Convert.ChangeType() which works with TypeBuilder created types.
26978 (Enum.LookupEnumValue, Enum.Define): Use it here.
26980 * class.cs (TypeContainer.RegisterRequiredImplementations): Added
26981 `TypeBuilder.BaseType != null' check.
26982 (TypeContainer.FindMembers): Only lookup parent members if we
26983 actually have a parent.
26984 (Method.EmitDestructor): Added `ec.ContainerType.BaseType != null' check.
26985 (ConstructorInitializer.Resolve): Likewise.
26987 * interface.cs (Interface.FindMembers): Added
26988 `TypeBuilder.BaseType != null' check.
26990 * rootcontext.cs (RootContext.ResolveCore): Added
26991 "System.Runtime.CompilerServices.IndexerNameAttribute" to
26992 classes_second_stage.
26994 * typemanager.cs (TypeManager.InitCoreTypes): Don't initialize
26995 debug_type and trace_type when compiling with --nostdlib.
26997 2002-06-07 Martin Baulig <martin@gnome.org>
26999 * class.cs (TypeContainer): Added `have_nonstatic_fields' field.
27000 (AddField): Set it to true when adding a non-static field.
27001 (DefineType): Use `have_nonstatic_fields' to find out whether we
27002 have non-static fields, not `Fields != null'.
27004 2002-06-02 Miguel de Icaza <miguel@ximian.com>
27006 * ecore.cs (SimpleNameResolve): Removed simple bug (we were
27007 dereferencing a null on the static-field code path)
27009 2002-05-30 Martin Baulig <martin@gnome.org>
27011 * codegen.cs (InitMonoSymbolWriter): Added `string[] args' argument
27012 to take command line arguments. Use reflection to call the new
27013 custom `Initialize' function on the symbol writer and pass it the
27014 command line arguments.
27016 * driver.cs (--debug-args): New command line argument to pass command
27017 line arguments to the symbol writer.
27019 2002-05-28 Miguel de Icaza <miguel@ximian.com>
27021 * assign.cs (DoResolve): Forgot to do the implicit conversion to
27022 the target type for indexers and properties. Thanks to Joe for
27025 2002-05-27 Miguel de Icaza <miguel@ximian.com>
27027 * typemanager.cs (MethodFlags): returns the method flags
27028 (Obsolete/ShouldIgnore) that control warning emission and whether
27029 the invocation should be made, or ignored.
27031 * expression.cs (Invocation.Emit): Remove previous hack, we should
27032 not do this on matching a base type, we should do this based on an attribute
27034 Only emit calls to System.Diagnostics.Debug and
27035 System.Diagnostics.Trace if the TRACE and DEBUG defines are passed
27036 on the command line.
27038 * rootcontext.cs: Global settings for tracing and debugging.
27040 * cs-tokenizer.cs (define): New utility function to track
27041 defines. Set the global settings for TRACE and DEBUG if found.
27043 2002-05-25 Ravi Pratap <ravi@ximian.com>
27045 * interface.cs (Populate*): Pass in the TypeContainer as well as
27046 the DeclSpace as parameters so that we can create EmitContexts and
27047 then use that to apply attributes etc.
27049 (PopulateMethod, PopulateEvent, PopulateProperty)
27050 (PopulateIndexer): Apply attributes everywhere.
27052 * attribute.cs (CheckAttribute): Include InterfaceMethod, InterfaceEvent
27055 (ApplyAttributes): Update accordingly.
27057 We now apply interface attributes for all members too.
27059 2002-05-26 Miguel de Icaza <miguel@ximian.com>
27061 * class.cs (Indexer.Define); Correctly check if we are explicit
27062 implementation (instead of checking the Name for a ".", we
27063 directly look up if the InterfaceType was specified).
27065 Delay the creation of the PropertyBuilder.
27067 Only create the PropertyBuilder if we are not an explicit
27068 interface implementation. This means that explicit interface
27069 implementation members do not participate in regular function
27070 lookups, and hence fixes another major ambiguity problem in
27071 overload resolution (that was the visible effect).
27073 (DefineMethod): Return whether we are doing an interface
27076 * typemanager.cs: Temporary hack until we get attributes in
27077 interfaces (Ravi is working on that) and we get IndexerName
27078 support in interfaces.
27080 * interface.cs: Register the indexers as properties.
27082 * attribute.cs (Attribute.Resolve): Catch the error, and emit a
27083 warning, I have verified that this is a bug in the .NET runtime
27084 (JavaScript suffers of the same problem).
27086 * typemanager.cs (MemberLookup): When looking up members for
27087 interfaces, the parent of an interface is the implicit
27088 System.Object (so we succeed in searches of Object methods in an
27089 interface method invocation. Example: IEnumerable x; x.ToString
27092 2002-05-25 Miguel de Icaza <miguel@ximian.com>
27094 * class.cs (Event): Events should also register if they do
27095 implement the methods that an interface requires.
27097 * typemanager.cs (MemberLookup); use the new GetInterfaces
27100 (GetInterfaces): The code used to lookup interfaces for a type is
27101 used in more than one place, factor it here.
27103 * driver.cs: Track the errors at the bottom of the file, we kept
27106 * delegate.cs (NewDelegate.Emit): We have to emit a null as the
27107 instance if the method we are calling is static!
27109 2002-05-24 Miguel de Icaza <miguel@ximian.com>
27111 * attribute.cs (ApplyAttributes): Make this function filter out
27112 the IndexerName attribute (as that attribute in reality is never
27113 applied) and return the string constant for the IndexerName
27116 * class.cs (TypeContainer.Emit): Validate that all the indexers
27117 have the same IndexerName attribute, and if so, set the
27118 DefaultName attribute on the class.
27120 * typemanager.cs: The return value might contain other stuff (not
27121 only methods). For instance, consider a method with an "Item"
27122 property and an Item method.
27124 * class.cs: If there is a problem with the parameter types,
27127 2002-05-24 Ravi Pratap <ravi@ximian.com>
27129 * ecore.cs (ImplicitConversionExists): Wrapper function which also
27130 looks at user defined conversion after making a call to
27131 StandardConversionExists - we need this for overload resolution.
27133 * expression.cs : Update accordingly the various method calls.
27135 This fixes 2 bugs filed against implicit user defined conversions
27137 2002-05-22 Miguel de Icaza <miguel@ximian.com>
27139 * statement.cs: Track the result of the assignment.
27141 2002-05-21 Miguel de Icaza <miguel@ximian.com>
27143 * expression.cs (MemberAccess): Improved error reporting for
27144 inaccessible members.
27146 2002-05-22 Martin Baulig <martin@gnome.org>
27148 * makefile (mcs-mono2.exe): New target. This is mcs compiled with
27149 itself with debugging support.
27151 2002-05-22 Martin Baulig <martin@gnome.org>
27153 * typemanager.cs ("System.Runtime.InteropServices.StructLayoutAttribute"):
27154 Removed, this isn't needed anymore.
27156 2002-05-20 Martin Baulig <martin@gnome.org>
27158 * typemanager.cs (InitEnumUnderlyingTypes): "System.Char" can't
27159 be underlying type for an enum.
27161 2002-05-20 Miguel de Icaza <miguel@ximian.com>
27163 * typemanager.cs (InitEnumUnderlyingTypes): New helper function
27164 that splits out the loading of just the core types.
27166 * rootcontext.cs (ResolveCore): Split the struct resolution in
27167 two, so we can load the enumeration underlying types before any
27170 * expression.cs (Is): Bandaid until we fix properly Switch (see
27171 bug #24985 for details).
27173 * typemanager.cs (ImplementsInterface): The hashtable will contain
27174 a null if there are no interfaces implemented.
27176 2002-05-18 Miguel de Icaza <miguel@ximian.com>
27178 * cs-parser.jay (indexer_declarator): It is fine to have array
27181 2002-05-17 Miguel de Icaza <miguel@ximian.com>
27183 * typemanager.cs: (RegisterBuilder): New function used to register
27184 TypeBuilders that implement interfaces. Since
27185 TypeBuilder.GetInterfaces (as usual) does not work with lame
27187 (AddUserType): register interfaces.
27189 (ImplementsInterface): Use the builder_to_ifaces hash if we are
27190 dealing with TypeBuilder. Also, arrays are showing up as
27191 SymbolTypes, which are not TypeBuilders, but whose GetInterfaces
27192 methods can not be invoked on them!
27194 * ecore.cs (ExplicitReferenceConversionExists): Made public.
27195 (ImplicitReferenceConversionExists): Split out from
27196 StandardConversionExists.
27198 * expression.cs (As): We were only implementing one of the three
27199 cases for the as operator. We now implement them all.
27200 (Is): Implement the various other cases for Is as well.
27202 * typemanager.cs (CACHE): New define used to control if we want or
27203 not the FindMembers cache. Seems to have a negative impact on
27204 performance currently
27206 (MemberLookup): Nested types have full acess to
27207 enclosing type members
27209 Remove code that coped with instance/static returns for events, we
27210 now catch this in RealFindMembers.
27212 (RealFindMembers): only perform static lookup if the instance
27213 lookup did not return a type or an event.
27215 2002-05-17 Miguel de Icaza <miguel@ximian.com>
27217 * assign.cs (CompoundAssign): We pass more semantic information
27218 now to Compound Assignments than we did before: now we have all
27219 the information at hand, and now we resolve the target *before* we
27220 do the expression expansion, which allows the "CacheValue" method
27221 to have the effect we intended (before, a [x] += 1 would generate
27222 two differen ArrayAccess expressions from the ElementAccess,
27223 during the resolution process).
27225 (CompoundAssign.DoResolve): Resolve target and original_source here.
27227 2002-05-16 Miguel de Icaza <miguel@ximian.com>
27229 * expression.cs (ArrayAccess): dropped debugging information.
27231 * typemanager.cs: Small bug fix: I was always returning i_members,
27232 instead of one of i_members or s_members (depending on which had
27235 * assign.cs (IAssignMethod.CacheTemporaries): New method. This
27236 method is invoked before any code generation takes place, and it
27237 is a mechanism to inform that the expression will be invoked more
27238 than once, and that the method should use temporary values to
27239 avoid having side effects
27241 (Assign.Emit): Call CacheTemporaries in the IAssignMethod.
27243 * ecore.cs (Expression.CacheTemporaries): Provide empty default
27246 * expression.cs (Indirection, ArrayAccess): Add support for
27247 CacheTemporaries in these two bad boys.
27249 * ecore.cs (LoadFromPtr): figure out on our own if we need to use
27250 ldobj or ldind_ref.
27251 (StoreFromPtr): Handle stobj as well.
27253 * expression.cs (UnaryMutator): Share more code.
27255 * typemanager.cs (FindMembers): Thanks to Paolo for tracking this
27256 down: I was not tracking the Filter function as well, which
27257 was affecting the results of the cache.
27259 2002-05-15 Miguel de Icaza <miguel@ximian.com>
27261 * attribute.cs: Remove the hack to handle the CharSet property on
27264 2002-05-14 Miguel de Icaza <miguel@ximian.com>
27266 * attribute.cs (DoResolve): More uglyness, we now only try to
27267 resolve the attribute partially, to extract the CharSet
27268 information (only if we are a StructLayout attribute). Otherwise
27270 (GetExtraTypeInfo): Add some code to conditionally kill in the
27271 future this. I am more and more convinced that the .NET
27272 framework has special code to handle the attribute setting on
27275 * expression.cs (IsParamsMethodApplicable): Revert my previous
27276 foreach change here, it was wrong.
27278 2002-05-13 Miguel de Icaza <miguel@ximian.com>
27280 * cs-tokenizer.cs: (pp_primary): Eat the ')' at the end.
27281 (pp_expr): do not abort on unknown input, just return.
27282 (eval): abort if there are pending chars.
27284 * attribute.cs (Attribute.Resolve): Positional parameters are
27285 optional. Deal with that case.
27287 * class.cs (DefineType): Call Attribute.GetExtraTypeInfo to fetch
27288 the Ansi/Unicode/Auto information for the type.
27290 (TypeContainer.DefineType): instantiate the EmitContext here, as
27291 we will be using it during the type definition (to resolve
27292 attributes) and during the emit phase.
27294 * attribute.cs (Attribute.GetExtraTypeInfo): This routine is used
27295 to pull type information out of the attributes
27297 (Attribute.Resolve): track the constructor builder, and allow for
27298 multiple invocations (structs and classes will use this).
27300 * ecore.cs (MemberLookupFinal): new version with all the
27301 parameters customizable.
27303 * expression.cs (New.DoResolve): Use MemberLookupFinal to locate
27304 constructors. Return if the result value is null (as the error
27305 would have been flagged already by MemberLookupFinal)
27307 Do not allow instances of abstract classes or interfaces to be
27310 * class.cs: (MethodSignature.InheritableMemberSignatureCompare):
27311 We have to compare the assembly property here when dealing with
27312 FamANDAssem and Assembly access modifiers, because we might be
27313 creating an assembly from *modules* (that means that we are not
27314 getting TypeBuilders for types defined in other modules that are
27315 part of this assembly).
27317 (Method.Emit): If the method is marked abstract and has a body,
27320 (TypeContainer.DefineMembers): If both the defined member and the
27321 parent name match are methods, then do not emit any warnings: let
27322 the Method.Define routine take care of flagging warnings. But if
27323 there is a mismatch (method overrides something else, or method is
27324 overriwritten by something, then emit warning).
27326 (MethodSignature.MemberSignatureCompare): If the sig.ret_type is
27327 set to null, this means `do not check for the return type on the
27330 (Method.Define): set the return type for the method signature to
27331 null, so that we get methods with the same name and parameters and
27332 different return types. This is used to flag warning 114 (you are
27333 hiding a method, and you probably want to use the new/override
27336 * typemanager.cs (MemberLookup): Implemented proper access
27337 control, closing a long standing set of bug reports. The problem
27338 was that the Framework only has two bits: Public and NonPublic,
27339 and NonPublic includes private and protected methods, but we need
27340 to enforce the FamANDAssem, FamOrAssem and Family.
27342 2002-05-11 Miguel de Icaza <miguel@ximian.com>
27344 * statement.cs (GotoCase): Return true: Ammounts to giving up
27345 knowledge on whether we return or not, and letting the other case
27346 be responsible for it.
27348 2002-05-10 Miguel de Icaza <miguel@ximian.com>
27350 * driver.cs: Do not load directories for each file processed, only
27351 do it if there is a pattern.
27353 * ecore.cs: Report readonly assigns here as well, as we might have
27354 been resolved only by MemberAccess.
27356 (SimpleName.SimpleNameResolve): Also be useful for LValue
27357 resolution. We need this to propagate assign to local readonly variables
27359 * typemanager.cs: Use a ptrhashtable for the criteria, because we
27360 do not want to reuse potential criteria memory.
27362 * class.cs (MyEventBuilder): Set reflected_type;
27364 * ecore.cs (Constantify): Added support for constifying bools.
27366 (RootContext.LookupType): Added a cache for values looked up in
27367 the declaration space.
27369 * typemanager.cs (FindMembers): Now is a front-end to
27370 RealFindMembers, and provides a two-level hashtable-based cache to
27373 15% performance improvement: from 22.5 to 19.2 seconds.
27375 * expression.cs (IsParamsMethodApplicable): use foreach.
27376 (Invocation.DoResolve): ditto.
27377 (New.DoResolve): ditto.
27378 (ArrayCreation.DoResolve): ditto.
27380 * ecore.cs (FindMostEncompassingType): use foreach.
27382 * delegate.cs (NewDelegate.DoResolve): Use foreach
27384 * ecore.cs (Expression.FindMostSpecificSource): Use foreach.
27385 (RemoveMethods): use foreach.
27387 * expression.cs (Invocation.MakeUnionSet): Optimization: Use two
27388 nested foreach statements instead of for, and also break out of
27389 the inner loop once a match is found.
27391 (Invocation.OverloadResolve): Use foreach, simplify the code.
27393 2002-05-08 Miguel de Icaza <miguel@ximian.com>
27395 * cfold.cs (BinaryFold): During an enumeration evaluation context,
27396 we actually unwrap the expression to allow for extra information
27399 * expression.cs: Use Shr_Un on unsigned operations.
27401 2002-05-08 Ravi Pratap <ravi@ximian.com>
27403 * ecore.cs (FindMostEncompass*): Fix trivial bug where the set of
27404 applicable operators was not being considered correctly. This closes
27405 the bug Miguel reported.
27407 Wed May 8 16:40:50 CEST 2002 Paolo Molaro <lupus@ximian.com>
27409 * attribute.cs: check that the type derives from System.Attribute
27410 and report the correct error in that case (moved the duplicate code to
27411 its own method, too).
27413 Wed May 8 11:50:31 CEST 2002 Paolo Molaro <lupus@ximian.com>
27415 * attribute.cs: lookup attribute type name as the spec says: first the
27416 bare attribute name and then name + "Attribute" (nant compiles with
27417 mcs after this fix).
27419 2002-05-07 Miguel de Icaza <miguel@ximian.com>
27421 * expression.cs (Unary.TryReduceNegative): Ah! Tricky! Tricky!
27422 Because of the way we parse things, we should try to see if a
27423 UIntConstant can fit in an integer.
27425 2002-05-07 Ravi Pratap <ravi@ximian.com>
27427 * ecore.cs (GetConversionOperators): Do not pick up op_True operators
27428 when we are in an explicit context.
27430 (ConvertReferenceExplicit): When converting from Iface type S to Class
27431 T make sure the rules are implemented as an OR.
27433 * parameter.cs (ParameterType): Make it a property for now although the
27434 purpose really isn't anything immediate.
27436 * expression.cs (Is*Applicable): Do better checking on the parameter type
27437 of a ref/out parameter. The ones from the system assemblies are already
27438 marked with the correct type so we don't need to do any correction.
27440 * ecore.cs (StandardConversionExists): Conversion from Interface types to
27441 the object type is standard too so include that.
27443 2002-05-06 Miguel de Icaza <miguel@ximian.com>
27445 * ecore.cs (StandardConversionExists): Augment with missing code:
27446 deal with IntConstant, LongConstants and Enumerations.
27448 * assign.cs: Report the error, instead of failing silently
27450 * rootcontext.cs (AddGlobalAttributes): Track attributes on the
27451 typecontainer that they are declared, because the
27452 typecontainer/namespace will have the list of using clauses that
27453 need to be applied.
27455 Assembly Attributes were escaping the normal registration
27458 (EmitCode): Apply attributes within an EmitContext that represents
27459 the container they were declared on.
27461 * cs-parser.jay: Track bases for structs. How did I get this wrong?
27463 2002-05-06 Ravi Pratap <ravi@ximian.com>
27465 * ecore.cs (FindMostEncompassingType, FindMostEncompassedType):
27466 Revamp completely - make much cleaner as we now operate only
27469 (FindMostSpecificSource, FindMostSpecificTarget): New methods
27470 to implement the logic detailed in the spec more correctly.
27472 (UserDefinedConversion): Update accordingly.
27474 2002-05-06 Miguel de Icaza <miguel@ximian.com>
27476 * statement.cs: Return flow analysis information up.
27478 * cs-tokenizer.cs (adjust_real): Share code between LITERAL_DOUBLE
27481 (token): Do not consume an extra character before calling
27484 2002-05-06 Piers Haken <piersh@friskit.com>
27486 * cs-parser.jay: add 'override' attribute to System.Object.Finalize
27488 2002-05-06 Miguel de Icaza <miguel@ximian.com>
27490 * class.cs (Constructor.Emit): Set the IsStatic flag in the
27491 EmitContext during the instance constructor initializer
27492 resolution, to stop access to instance variables.
27494 This is mandated by the spec, last paragraph of the `constructor
27495 initializers' section.
27497 2002-05-05 Miguel de Icaza <miguel@ximian.com>
27499 * cs-parser.jay, class.cs (Accessor): new class used to represent
27500 an accessor (get or set). In the past we used `null' to represent
27501 a missing accessor. But this is ambiguous because there was no
27502 way to tell in abstract indexers/properties if one of them was
27505 Now there is a way of addressing that.
27507 * expression.cs (Indexers.GetIndexersForType): Use TypeManager.MemberLookup
27508 instead of FindMembers.
27510 * class.cs (TypeContainer.EmitFieldInitializer): Do not typecast
27511 the result of Assign.Resolve as Assign, but rather as ExpressionStatement.
27513 * attribute.cs: Treat indexers and properties as the same in terms
27514 of applying attributes
27516 * ecore.cs (FindMostEncompassedType): Use statically initialized
27517 EmptyExpressions()s like we do elsewhere to avoid creating useless
27518 objects (and we take this out of the tight loop).
27520 (GetConversionOperators): Move the code to extract the actual
27521 operators to a separate routine to clean things up.
27523 2002-05-04 Miguel de Icaza <miguel@ximian.com>
27525 * ecore.cs (FieldExpr): Remove un-needed tests for null, since now
27526 events are always registered FieldBuilders.
27528 * class.cs (FieldBase): New class shared by Fields
27530 * delegate.cs: If we are a toplevel delegate, use our full name.
27531 If we are a nested delegate, then only use our tail name.
27533 2002-05-02 Ravi Pratap <ravi@ximian.com>
27535 * expression.cs (IsApplicable): Ensure that we add the "&" to
27536 ref/out types before comparing it with the type of the argument.
27538 (IsParamsMethodApplicable): Ditto.
27540 (Argument.Type): Use TypeManager.LookupType instead of Type.GetType -
27543 * delegate.cs : Handle the case when we have more than one applicable
27544 method. Flag an error only when we finish checking all.
27546 2002-05-02 Miguel de Icaza <miguel@ximian.com>
27548 * expression.cs: Add support for boolean static initializers.
27550 2002-05-01 Miguel de Icaza <miguel@ximian.com>
27552 * attribute.cs: Use proper cast for Events, since we use a MyEventBuilder.
27554 * parameter.cs (ComputeParameterTypes,
27555 ComputeAndDefineParameterTypes): Better error handling: now we
27556 clear the `types' cache if we fail during any of the type lookups.
27557 We also return the status code correctly to our caller
27559 * delegate.cs: If we fail to define a delegate, abort the extra
27562 * expression.cs (Binary.ResolveOperator): for
27563 operator==(object,object) and operator !=(object, object) we also
27564 have to verify that there is an implicit conversion from one to
27567 (ArrayAccess.DoResolve): Array Access can operate on
27570 2002-04-30 Miguel de Icaza <miguel@ximian.com>
27572 * assign.cs (CompoundAssign): A new class used as a "flag" that
27573 the assignment actually is happening as part of a compound
27574 assignment operator.
27576 During compound assignment, a few new rules exist to enable things
27583 x op= y can be evaluated as x = (T) (x op y) (ie, an explicit cast
27584 to the type of x) if y is implicitly convertible to the type of x,
27585 and the operator is a builtin operator and the return type of the
27586 operator is explicitly convertible to the type of x.
27588 * rootcontext.cs: Reset warning level to 2. 4 catches various
27589 "interesting" features in mcs, we must clean this up at some
27590 point, but currently am trying to kill other bugs ;-)
27592 * ecore.cs (SimpleName.SimpleNameResolve): Perform member lookups
27593 in container classes as well.
27595 * expression.cs (Binary.ResolveOperator): Handle string case
27596 before anything else (as operator overloading does emit an error
27597 before doing anything else).
27599 This code could go away when we move to a table driven model, but
27600 i could not come up with a good plan last night.
27602 2002-04-30 Lawrence Pit <loz@cable.a2000.nl>
27604 * typemanager.cs (CSharpName): reimplementation using regex.
27605 * class.cs: added null check for fields in Emit
27606 * rootcontext.cs: set warninglevel to 4
27608 2002-04-29 Miguel de Icaza <miguel@ximian.com>
27610 * typemanager.cs (CSharpName): reimplemented with Lupus
27613 2002-04-28 Miguel de Icaza <miguel@ximian.com>
27615 * statement.cs (If): correclty implement Resolve, because we were
27616 not catching sem errors in there. The same process is needed
27618 (Return, StatementExpression, For, While, Do, Throw, Lock): Implement Resolve
27621 (Statement.Warning_DeadCodeFound): Factorize code.
27622 (While): Report dead code here too.
27624 (Statement): Added Resolve virtual method to allow
27625 for resolution split from the emit code.
27627 2002-04-26 Miguel de Icaza <miguel@ximian.com>
27629 * statement.cs (EmitBoolExpression): No longer try to resolve the
27631 (MakeBoolean): New utility function that resolve, implicitly
27632 converts to boolean and tags the expression.
27635 (If, Do): Implement dead code elimination.
27636 (While): Implement loop inversion
27638 (Do, While, For, If): Resolve the expression prior to calling our
27641 2002-04-22 Lawrence Pit <loz@cable.a2000.nl>
27644 - added method Report28 (warning: program has more than one entry point)
27645 - added method IsEntryPoint, implements paragraph 10.1 of the spec
27646 - modified method Method.Define, the part at the end of the method
27648 * rootcontext.cs: added static public Location EntryPointLocation;
27650 * ../errors/cs0028.cs : Add test case for the above warning.
27653 - modified method CSharpName to allow arrays of primitive type to
27654 be printed nicely (e.g. instead of System.Int32[][] it now prints
27656 - added method CSharpSignature: returns the signature of a method
27657 in string format to be used in reporting errors, warnings, etc.
27659 * support.cs: InternalParameters.ParameterDesc variable tmp initialized
27662 2002-04-26 Ravi Pratap <ravi@ximian.com>
27664 * delegate.cs (Define): Fix extremely silly bug where I was
27665 setting the type of the 'object' parameter of the BeginInvoke
27666 method to System.IAsyncResult instead of System.Object ;-)
27668 2002-04-26 Miguel de Icaza <miguel@ximian.com>
27670 * class.cs (ConstructorInitializer.Resolve): Also use DeclaredOnly
27673 (Constructor.Emit): return if we fail to initialize the
27674 constructor. Another door closed!
27676 * expression.cs (New.DoResolve): Improve error message (from -6 to
27677 1501). Use DeclaredOnly lookup to find the exact constructor.
27679 * typemanager.cs (MemberLookup): If DeclaredOnly is set, do not
27680 loop. This is useful.
27682 * cs-parser.jay: Adjust the default parameters so that destructors
27683 have the proper signature.
27685 2002-04-26 Martin Baulig <martin@gnome.org>
27687 * driver.cs (LoadAssembly): If `assembly' contains any characters
27688 which are only valid in path names and not in assembly names
27689 (currently slash, backslash and point), use Assembly.LoadFrom ()
27690 instead of Assembly.Load () on the `assembly' (before iteration
27691 over the link_paths).
27693 2002-04-26 Martin Baulig <martin@gnome.org>
27695 * cs-tokenizer.cs (is_hex): Correctly handle lowercase chars.
27697 2002-04-25 Miguel de Icaza <miguel@ximian.com>
27699 * class.cs (Property): use the new typemanager.MemberLookup
27701 (TypeContainer.MemberLookup): Implement using the
27702 TypeManager.MemberLookup now.
27704 * typemanager.cs: Make MemberLookup a function of the TypeManager,
27705 and return MemberInfos, so that these can be used without an
27706 EmitContext (what we had before).
27708 2002-04-24 Miguel de Icaza <miguel@ximian.com>
27710 * expression.cs: Fix the case where the argument to params if the
27711 type of the params. I omitted handling this before. Fixed
27713 2002-04-22 Miguel de Icaza <miguel@ximian.com>
27715 * driver.cs: Call BootCorlib_PopulateCoreType
27717 * class.cs (Property.CheckBase): Check for properties only, not
27720 * interface.cs: Temporary hack: try/catch around the
27721 CustomAttributeBuilder, because I am getting an exception that I
27724 * rootcontext.cs (BootCorlib_PopulateCoreType): Populate some
27725 types whose definitions are required to be there (attributes are
27726 defined before standard types).
27728 Compute definitions as we boot the various types, as they are used
27729 immediately (value_type class will need object_type, but if we do
27730 not initialize object_type, we will pass a null, which will let
27731 the runtime pick the System.Object from the existing corlib, which
27732 is not what we want).
27734 2002-04-22 Patrik Torstensson <totte@labs2.com>
27736 * cs-tokenizer.cs: fixed a number of trim() issues.
27738 2002-04-22 Ravi Pratap <ravi@ximian.com>
27740 * expression.cs (Argument.Type): Ensure that we return the correct
27741 type when we have out or ref parameters [in which case we
27744 2002-04-22 Miguel de Icaza <miguel@ximian.com>
27746 * class.cs (Property, Indexer): Allow extern modifier in there.
27748 * typemanager.cs (InitBaseTypes): Initializes object_type and
27749 value_type, since those will be used early on during the bootstrap
27750 process to compile corlib.
27752 (InitCoreTypes): Move code from here to InitBaseTypes.
27754 2002-04-21 Miguel de Icaza <miguel@ximian.com>
27756 * ecore.cs (PropertyExpr): Optimize calls to Array::get_Length on
27757 single-dimension arrays as using the ldlen opcode.
27759 Daniel Lewis discovered this optimization.
27761 * typemanager.cs: Add signature for System.Array::get_Length
27763 2002-04-20 Gonzalo Paniagua Javier <gonzalo@ximian.com>
27765 * statement.cs: report the error when the foreach does not apply to an
27766 array nor a collection.
27768 2002-04-19 Miguel de Icaza <miguel@ximian.com>
27770 * expression.cs: Add implicit conversions to the operator ~.
27772 * constant.cs (DecimalConstant.Emit): Emit decimal value.
27774 * typemanager.cs: Locate the decimal constructor.
27776 2002-04-17 Gonzalo Paniagua Javier <gonzalo@ximian.com>
27778 * attribute.cs: use the new property of TypeOf.
27779 * expression.cs: added 'get' property around typearg.
27781 These changes fix a build breaker reported by NickD. Is this the
27782 correct way to fix? If not, please, revert my changes and make it
27785 2002-04-17 Miguel de Icaza <miguel@ximian.com>
27787 * attribute.cs: Add support for typeof in attribute invocations.
27788 I am not sure that this is right though.
27790 2002-04-14 Duncan Mak <duncan@ximian.com>
27792 * cfold.cs (BinaryFold): Catch DivideByZeroException in the
27793 Binary.Operator.Division case.
27795 2002-04-13 Ravi Pratap <ravi@ximian.com>
27797 * class.cs (DefineType): Ensure that we do a proper check on
27798 attribute types and also register it with the TypeManager.
27800 (TypeContainer.Targets): The default for attribute types is
27801 AttributeTargets.All.
27803 * attribute.cs (ApplyAttributes): Registering the attribute type
27804 is done elsewhere, not when we discover we have a Usage attribute.
27806 2002-04-12 Ravi Pratap <ravi@ximian.com>
27808 * expression.cs (VerifyArgumentsCompat): Implement Miguel's suggestion
27809 and get rid of is_delegate parameter.
27811 * everywhere : update.
27813 2002-04-12 Ravi Pratap <ravi@ximian.com>
27815 * cs-parser.jay (compilation_unit): Revamp completely to use
27816 some new ideas that I got from Rhys' grammar to solve the problems
27817 with assembly level attributes.
27819 (outer_declaration): New grammar production.
27821 (attribute_sections): Add.
27823 (opt_attributes): Base on attribute_sections
27825 (namespace_declaration): Allow opt_attributes to tackle the case
27826 when we have assembly level attributes - we are clever in this
27829 * attribute.cs (ApplyAttributes): Do not worry about assembly
27830 attributes in the non-global context.
27832 * rootcontext.cs (AddGlobalAttributes): Go back to using this
27833 instead of SetGlobalAttributes.
27835 * class.cs, rootcontext.cs : Ensure we define and generate
27836 attribute types before anything else.
27838 * attribute.cs (CheckAttribute and GetValidPlaces): Handle the exception
27839 and flag the new error -20 for the case when the attribute type
27840 does not have valid targets specified. csc does not catch this.
27842 * ../errors/errors.txt : update for error # -20
27844 2002-04-11 Ravi Pratap <ravi@ximian.com>
27846 * support.cs (InternalParameters.ParameterModifier): Do some null
27847 checking and return sane values.
27849 * class.cs (Method.Define): If we are a PInvoke method, ensure
27850 that we are static and extern. Report error # 601
27852 * ../errors/cs0601.cs : Add test case for the above error.
27854 2002-04-07 Ravi Pratap <ravi@ximian.com>
27856 * rootcontext.cs (attribute_types): We need to keep type of
27857 all attribute types separately and emit code for them first.
27859 (RegisterAttribute) : Implement.
27861 * class.cs (DefineType): Check if the current Type is a custom
27862 attribute type and register it accordingly.
27864 * rootcontext.cs (AddGlobalAttributes): Fix silly bug where we were
27865 adding the first attribute twice and rename to
27867 (SetGlobalAttributes): this.
27869 * rootcontext.cs (NamespaceLookup): Run through the aliases too and perform
27872 * attribute.cs (ApplyAttributes): Take an additional argument telling us
27873 if we are processing global arguments. Hmm, I am unsure of this.
27875 2002-04-12 Gonzalo Paniagua Javier <gonzalo@ximian.com>
27877 * expression.cs: added static array of strings to avoid calling
27878 Enum.ToString () for Operator in Binary. Significant recover of
27881 2002-04-10 Miguel de Icaza <miguel@ximian.com>
27883 * class.cs (FindMembers): Allow the Builders of the various
27884 members to be null. If they are skip them. This only happens
27885 during the PInvoke declaration.
27887 2002-04-09 Miguel de Icaza <miguel@ximian.com>
27889 * parameter.cs (Parameters.ComputeParameterTypes): Flag the
27890 failure, so we do not keep going afterwards.
27892 * expression.cs: (Invocation.OverloadResolve): I believe Ravi
27893 wanted to pass `false' as the `is_delegate' argument. If this is
27894 the case, why not use delegate_type == null to mean `is_delegate =
27895 false' and anything else as is_delegate = true.
27897 Tue Apr 9 05:40:12 2002 Piers Haken <piersh@friskit.com>
27899 * statement.cs: fixed SimpleSwitchEmit to make 'goto case' goto the
27900 code for the section, not the beginning of the tests.
27902 2002-04-08 Miguel de Icaza <miguel@ximian.com>
27904 * cfold.cs: Handle operator + (Enum x, Underlying x)
27906 * expression.cs (Binary): same. Warn about errors where we have
27907 Enum/Enum in operator + as well.
27909 Mon Apr 8 06:29:03 2002 Piers Haken <piersh@friskit.com>
27912 - added support for switch(bool)
27913 - optimize loading of I8/U8 constants (ldc.i4, iconv_i8)
27914 - add TableSwitchEmit() to handle table-based switch statements
27916 2002-04-05 Ravi Pratap <ravi@ximian.com>
27918 * expression.cs (Invocation.OverloadResolve): Factor out code which
27919 does parameter compatibility checking with arguments so that we can
27920 re-use the code even from Delegate.VerifyApplicability
27922 (VerifyArgumentsCompat): Move above code here.
27924 * delegate.cs (VerifyApplicability): Get rid of duplicate code
27925 and instead make a call to the above method.
27927 2002-03-31 Ravi Pratap <ravi@ximian.com>
27929 * typemanager.cs (attribute_type): Corresponds to System.Attribute.
27930 We use it to keep track of classes which are attribute types.
27932 2002-04-02 Miguel de Icaza <miguel@ximian.com>
27934 * delegate.cs (Delegate.Define): Correctly define the types in the
27935 presence of fixed and array parameters.
27937 * class.cs (TypeContainers.FindMembers): Use NonPublic flag while
27940 * ecore.cs (Expression.MemberLookup): Reset binding flags to not
27941 include NonPublic after the first iteration.
27943 * class.cs (Indexer.CheckBase): Only check if both parents are
27946 * cs-parser.jay (accessor_body): If empty, set to null.
27948 * ecore.cs (SimpleName.SimpleNameResolve): We did not have the
27949 same code path here to resolve constants names that we did have in
27950 MemberAccess.DoResolve. There is too much code duplicated here.
27952 2002-04-01 Miguel de Icaza <miguel@ximian.com>
27954 * statement.cs, makefile: Drop Statementcollection and just use ArrayLists
27956 * ecore.cs: Optimize UserDefinedConversion by minimizing the calls
27959 * cs-tokenizer.cs: Reuse a single StringBuilder for assembling
27960 tokens, numbers and strings.
27962 * ecore.cs (MethodGroupExpr): Make Emit warn about missing
27965 * delegate.cs: Use ComputeAndDefineParameterTypes for both the
27966 asyncronous parameters and the regular parameters.
27968 * codegen.cs (CodeGen.Init): Use the constructor that allows us to
27969 specify the target directory.
27971 * expression.cs: (This.DoResolve): Simplify
27972 (As.Emit): Optimize, do not generate IsInst if the expression is
27973 always of the given type.
27975 (Is.DoResolve): Bug fix, we were reporting both always/never for
27978 * (Invocation.MakeUnionSet): Simplify vastly and optimize, we were
27979 creating too many unnecessary arrays.
27981 2002-03-31 Miguel de Icaza <miguel@ximian.com>
27983 * class.cs (EmitFieldInitializer): Use Assign expression to assign
27984 fields instead of rolling our own initializer. Takes care of all
27985 implicit conversions, and drops unnecessary static checks/argument.
27987 2002-03-31 Dick Porter <dick@ximian.com>
27989 * driver.cs: use the GetDirectories() return values properly, and
27990 use "/" as path separator.
27992 2002-03-30 Miguel de Icaza <miguel@ximian.com>
27994 * expression.cs (Unary): Optimize - - expr into expr.
27995 (Binary): Optimize a + (-b) into a -b.
27997 * codegen.cs (CodeGen): Made all methods static.
27999 2002-03-29 Miguel de Icaza <miguel@ximian.com>
28003 * decl.cs: Rename `definition' into `TypeBuilder' and drop the
28004 TypeBuilder property.
28006 * cs-parser.jay: Drop the use of RecordXXX and use RecordDecl
28009 * tree.cs: Removed the various RecordXXXX, and replaced with a
28010 single RecordDecl. Removed all the accessor methods, and just
28011 left a single access point Type
28013 * enum.cs: Rename DefineEnum to DefineType.
28015 * decl.cs: New abstract method `DefineType' used to unify the
28016 Defines for Enumerations, Interfaces, TypeContainers and
28019 (FindType): Moved LookupInterfaceOrClass here. Moved the
28020 LookupBaseClasses method that used to live in class.cs and
28021 interface.cs here, and renamed to FindType.
28023 * delegate.cs: Implement DefineType. Take advantage of the
28024 refactored pattern for locating the parent builder without taking
28025 the parent_builder argument (which we know does not work if we are
28026 nested, and triggering a toplevel definition).
28028 2002-03-28 Miguel de Icaza <miguel@ximian.com>
28030 * decl.cs (MemberCore.CheckMethodAgainstBase): Test if the
28031 accessibility of a member has changed during override and report
28034 * class.cs (Method.Define, Property.Define): Only complain on
28035 overrides if the method is private, any other accessibility is
28036 fine (and since we just checked the permission is the same, we are
28039 * cs-tokenizer.cs: only line, region, endregion, if, endif, else
28040 and elif are processed always. The other pre-processing
28041 directives are only processed if we are "taking" the path
28043 2002-03-29 Martin Baulig <martin@gnome.org>
28045 * class.cs (Method.Emit): Only emit symbolic debugging info if the
28046 current location is not Null.
28048 * codegen.cs (CodeGen.SaveSymbols): Split out symbol writing code into
28049 a separate method so we can profile it.
28051 * driver.cs (ShowTime): We need to use `(int) span.TotalSeconds' since
28052 `span.Seconds' are just seconds, but no minutes or hours.
28053 (MainDriver): Profile the CodeGen.SaveSymbols calls.
28055 2002-03-28 Miguel de Icaza <miguel@ximian.com>
28057 * class.cs (Method.Define), (Property.Define), (Indexer.Define):
28058 Remove the gratuitous set of Final:
28060 // If an interface implementation, then we can set Final.
28061 if (((flags & MethodAttributes.Abstract) == 0) &&
28062 implementing.DeclaringType.IsInterface)
28063 flags |= MethodAttributes.Final;
28065 I do not know what I was smoking when I used that.
28068 * cs-parser.jay, delegate.cs: Make Delegate be a DeclSpace, first
28069 step into fixing the name resolution issues for delegates and
28070 unifying the toplevel name resolution.
28072 2002-03-28 Martin Baulig <martin@gnome.org>
28074 * class.cs (Method.Emit): If we have a symbol writer, call its
28075 OpenMethod(), CloseMethod() and SetMethodSourceRange() methods to
28076 tell it about the current method.
28078 * codegen.cs (EmitContext.Mark): New public method. Tell the symbol
28079 writer that we're going to emit the first byte of IL code for a new
28080 statement (a new source line).
28081 (EmitContext.EmitTopBlock): If we have a symbol writer, call
28082 EmitContext.Mark() before emitting any code.
28084 * location.cs (SymbolDocument): Return null when we're Null.
28086 * statement.cs (Statement): Moved the `Location loc' variable here.
28087 (Statement.EmitBoolExpression): If we have a symbol writer, call
28088 ec.Mark() before emitting any code to tell it that we're at the
28089 beginning of a new statement.
28090 (StatementExpression): Added `Location' argument to the constructor.
28091 (Block): Added public readonly variable `StartLocation' and public
28092 variable `EndLocation'. The latter is to be set using SetEndLocation().
28093 (Block): Added constructor which takes a start and end location.
28094 (Block.SetEndLocation): New method. This sets the end location.
28095 (Block.EmitMeta): If we have a symbol writer, tell it the names of the
28096 local variables we create.
28097 (Block.Emit): If we have a symbol writer, call ec.Mark() before emitting
28098 each statement and do also mark the begin and end of the block.
28100 * cs-parser.jay (block : OPEN_BRACE): Use the new `Block' constructor to
28101 tell it the current lexer.Location, use Location.Null for the end of the
28103 (block : OPEN_BRACE opt_statement_list CLOSE_BRACE): When closing the
28104 current block, set its end location using SetEndLocation().
28105 (statement_expression): StatementExpression constructor now takes the
28106 lexer.Location as additional argument.
28107 (for_statement, declare_local_variables): Likewise.
28108 (declare_local_variables): When creating a new implicit block, use the
28109 new Block constructor and pass it the lexer.Location.
28111 2002-03-28 Miguel de Icaza <miguel@ximian.com>
28113 * ecore.cs (Expression.MemberLookup): On interfaces, lookup
28114 members also on the parent interfaces recursively.
28116 2002-03-27 Miguel de Icaza <miguel@ximian.com>
28118 * report.cs: Use new formats, since Gonzalo finished the missing
28121 * expression.cs (Binary.ResolveOperator): added missing operator|
28122 operator& and operator^ for bool/bool.
28124 * cs-parser.jay: CheckDef now takes a Location argument that is
28125 used to report errors more precisly (instead of reporting the end
28126 of a definition, we try to track something which is a lot closer
28127 to the source of the problem).
28129 * cs-tokenizer.cs: Track global token use, so we can properly flag
28130 the use of #define/#undef after the first token has been seen.
28132 Also, rename the reportXXXX to Error_DescriptiveName
28134 * decl.cs (DeclSpace.IsTopLevel): Move property here from
28135 TypeContainer, so that Enum and Interface can use this too.
28137 * class.cs (TypeContainer.LookupInterfaceOrClass,
28138 GetInterfaceOrClass, GetClassBases, DefineType): Drop the
28139 `builder' argument. Typically this was used to pass the parent
28140 builder (a ModuleBuilder or a TypeBuilder from whoever triggered
28143 The problem is that a nested class could trigger the definition of
28144 a toplevel class, and the builder would be obviously wrong in that
28147 So we drop this argument, and we compute dynamically the
28148 TypeBuilder/ModuleBuilder (the correct information was available
28149 to us anyways from DeclSpace.Parent)
28151 * interface.cs (Interface.DefineInterface): Drop builder
28152 parameter cleanup like class.cs
28154 * enum.cs (Enum.DefineEnum): Drop builder parameter. Clean up
28157 * statement.cs (Switch.EmitObjectInteger): Emit short/ushort
28160 (Try.Emit): Propagate the returns value from the statement.
28162 (Return.Emit): Even if we are leavning
28164 * driver.cs: Catch IOExpcetion for Directory.GetFiles as well.
28166 * modifiers.cs: Fix the computation of MethodAttributes flags.
28168 Tue Mar 26 21:14:36 CET 2002 Paolo Molaro <lupus@ximian.com>
28170 * driver.cs: allow compilation of files that start with '/'.
28171 Add a default case when checking the argument of --target.
28173 2002-03-25 Miguel de Icaza <miguel@ximian.com>
28175 * interface.cs: Implement the same search algorithm for types in
28176 the interface code.
28178 * delegate.cs: Do not allow multiple definition.
28180 * Recovered ChangeLog that got accidentally amputated
28182 * interface.cs (Interface.DefineInterface): Prevent from double definitions.
28184 * rootcontext.cs: Load manually enum to allow core classes to
28185 contain enumerations.
28187 * enum.cs, ecore.cs, driver.cs, attribute.cs, class.cs, expression.cs:
28188 Update to new static methods in TypeManager.
28190 * typemanager.cs (GetMethod, GetConstructor): Use our
28191 implementation of FindMembers to find the members, since during
28192 corlib compilation, the types are TypeBuilders and GetMethod and
28193 GetConstructor do not work.
28195 Make all methods in TypeManager static.
28197 (InitCodeHelpers): Split the functionality from
28198 the InitCodeTypes function.
28200 * driver.cs: Call InitCodeHelpers after we have populated the
28203 * cs-parser.jay (delegate_declaration): we did not used to compute
28204 the delegate name correctly for void delegates.
28206 2002-03-24 Miguel de Icaza <miguel@ximian.com>
28208 * rootcontext.cs (RootContext): Init the interface_resolve_order
28209 and type_container_resolve_order always.
28211 (ResolveCore, BootstrapCorlib_ResolveClass,
28212 BootstrapCorlib_ResolveStruct): New functions to bootstrap the
28213 compiler when compiling with --nostdlib
28215 * class.cs (TypeContainer.DefineType): Check that our parent is
28216 not null. This test is most important when we are bootstraping
28219 * codegen.cs: Split out the symbol writing code.
28221 2002-03-25 Martin Baulig <martin@gnome.org>
28223 * driver.cs (-g): Made -g an alias for --debug.
28225 2002-03-24 Martin Baulig <martin@gnome.org>
28227 * codegen.cs (SymbolWriter): New public variable. Returns the
28228 current symbol writer.
28229 (CodeGen): Added `bool want_debugging_support' argument to the
28230 constructor. If true, tell the ModuleBuild that we want debugging
28231 support and ask it for the ISymbolWriter.
28232 (Save): If we have a symbol writer, call it's Close() method after
28233 saving the assembly.
28235 * driver.c (--debug): New command line argument to create a
28236 debugger information file.
28238 * location.cs (SymbolDocument): New public property. Returns an
28239 ISymbolDocumentWriter object for the current source file or null
28240 if we don't have a symbol writer.
28242 2002-03-21 Miguel de Icaza <miguel@ximian.com>
28244 * driver.cs (LoadAssembly): Correctly return when all the paths
28245 have been tried and not before.
28247 * statement.cs (Switch.Emit): return the actual coverage for this
28248 statement (returns/not-returns)
28250 (Switch.SimpleSwitchEmit): Do not generate jumps to the end of the
28251 switch of the statement if we are the last switch section. That
28252 kills two problems: try/catch problems (we used to emit an empty
28253 nop at the end) and switch statements where all branches would
28256 2002-03-19 Miguel de Icaza <miguel@ximian.com>
28258 * driver.cs: Add default assemblies (the equivalent to the
28259 Microsoft CSC.RSP file)
28261 * cs-tokenizer.cs: When updating `cols and setting it to zero,
28262 also update tokens_seen and set it to false.
28264 * driver.cs: Implement --recurse for Mike.
28266 * driver.cs (SplitPathAndPattern): Small bug fix, I was not
28267 correctly splitting out the paths.
28269 2002-03-18 Miguel de Icaza <miguel@ximian.com>
28271 * interface.cs (Interface.PopulateProperty): Instead of using
28272 `parent' as the declaration space for the set parameters, use
28275 * support.cs (InternalParameters): InternalParameters constructor
28276 takes a DeclSpace instead of a TypeContainer.
28278 * expression.cs (ArrayCreation.EmitDynamicInitializers): If value
28279 types are being initialized, load the address of it before calling
28282 (New): Provide a mechanism to disable the generation of local
28283 value type temporaries when the caller will be providing us with
28284 an address to store it.
28286 (ArrayCreation.EmitDynamicInitializers): Use it.
28288 2002-03-17 Miguel de Icaza <miguel@ximian.com>
28290 * expression.cs (Invocation.EmitArguments): Only probe for array
28291 property if there is more than one argument. Sorry about that.
28293 * class.cs (Invocation.EmitArguments): Fix to emit arguments for
28294 empty param arrays.
28296 * class.cs (Method.LabelParameters): Fix incorrect code path that
28297 prevented the `ParamArrayAttribute' from being applied to the
28300 2002-03-16 Miguel de Icaza <miguel@ximian.com>
28302 * support.cs (ReflectionParameters): Correctly compute whether the
28303 last argument is a params array. Fixes the problem with
28306 * typemanager.cs: Make the assemblies array always be non-null
28307 (empty, but non-null)
28309 * tree.cs (RecordDecl): New function that abstracts the recording
28310 of names. This reports error 101, and provides a pointer to the
28311 previous declaration. Fixes a crash in the compiler.
28313 * cs-parser.jay (constructor_declaration): Update to new grammar,
28314 and provide a constructor_body that can be empty.
28316 2002-03-15 Miguel de Icaza <miguel@ximian.com>
28318 * driver.cs: Add support for --resources.
28320 * expression.cs: (FetchGetMethod, FetchAddressMethod, EmitAssign):
28321 Make all types for the various array helper methods be integer.
28323 * ecore.cs (Expression.ConvertNumericExplicit): Pass the
28324 CheckState to ConvCast.
28326 (ConvCast): Now it takes a `checked' state argument, to avoid
28327 depending on the emit context for the conversion, and just using
28328 the resolve time setting.
28330 * expression.cs (ArrayCreation.EmitArrayArguments): New function,
28331 instead of Invocation.EmitArguments. We do not emit the original
28332 arguments, instead we emit those which have been converted to
28333 unsigned int expressions.
28335 * statement.cs (Block.EmitMeta): Drop tracking of indexes.
28337 * codegen.cs: ditto.
28339 * expression.cs (LocalVariableReference): Drop the use of the
28340 Store function that depended on the variable index.
28342 * statement.cs (VariableInfo): Drop the `Idx' property from this
28343 class, as this is not taking into account the indexes for
28344 temporaries tat we generate during the execution, getting the
28347 * class.cs: First emit class initializers, then call the parent
28350 * expression.cs (Binary): Fix opcode emision.
28351 (UnaryMutator.EmitCode): Support checked code generation
28353 * ecore.cs (MemberLookup): TypeManager.FindMembers will return
28354 matches for events for both the Static and Instance scans,
28355 pointing to the same element. Fix that.
28357 2002-03-14 Miguel de Icaza <miguel@ximian.com>
28359 * rootcontext.cs (ResolveTree): Always set the
28360 interface_resolve_order, because nested interfaces will be calling
28363 * class.cs (GetInterfaceOrClass): Track the same resolution
28364 process used by TypeManager.LookupType. This fixes the nested
28365 type lookups in class declarations (separate path from
28368 (TypeContainer.DefineType): Also define nested interfaces.
28369 (TypeContainer.RegisterOrder): New public function used to
28370 register the order in which child interfaces need to be closed.
28372 Nested interfaces need to be closed after their parents have been
28375 * interface.cs (InterfaceAttr): Put all the logic for computing
28376 the interface attribute here.
28378 (DefineInterface): Register our interface order with the
28379 RootContext or with the TypeContainer depending on the case.
28381 2002-03-12 Miguel de Icaza <miguel@ximian.com>
28383 * cs-parser.jay: rework foreach statement to work with the new
28384 changes to the policy on SimpleNames.
28386 * report.cs: support Stacktrace on warnings as well.
28388 * makefile: drop --unsafe and /unsafe from the compile.
28390 2002-03-13 Ravi Pratap <ravi@ximian.com>
28392 * ecore.cs (StandardConversionExists): Modify to take an Expression
28393 as the first parameter. Ensure we do null -> reference type conversion
28396 * Everywhere : update calls accordingly, making use of MyEmptyExpr to store
28397 temporary Expression objects.
28399 Wed Mar 13 12:32:40 CET 2002 Paolo Molaro <lupus@ximian.com>
28401 * interface.cs: workaround bug in method overloading resolution
28402 (there is already a bugzilla bug for it).
28404 2002-03-12 Miguel de Icaza <miguel@ximian.com>
28406 We could also solve this problem by having a separate path for
28407 performing type lookups, instead of DoResolve, we could have a
28408 ResolveType entry point, and only participating pieces of the
28409 production (simplename, deref, array) would implement this.
28411 * codegen.cs (EmitContext): New field OnlyLookupTypes used to
28412 signal SimpleName to only resolve type names and not attempt to
28413 resolve anything else.
28415 * expression.cs (Cast): Set the flag.
28417 * ecore.cs (SimpleName): Use the OnlyLookupTypes flag
28419 * class.cs: Only report 108 if there is no `new' modifier.
28421 * cs-parser.jay: rework foreach statement to work with the new
28422 changes to the policy on SimpleNames.
28424 * report.cs: support Stacktrace on warnings as well.
28426 * makefile: drop --unsafe and /unsafe from the compile.
28428 2002-03-11 Miguel de Icaza <miguel@ximian.com>
28430 * ecore.cs (SimpleName.SimpleNameResolve): Perform local variable
28431 lookups here, instead of doing that at parse time. This means
28432 that our grammar will not introduce `LocalVariableReferences' as
28433 expressions at this point. That solves the problem of code like
28437 static void Main ()
28441 This is only half the fix. The full fix requires parameters to
28442 also be handled in this way.
28444 * Everywhere: Use ec.DeclSpace on calls to LookupType, as this
28445 makes the use more obvious of the DeclSpace. The
28446 ec.TypeContainer.TypeBuilder is now only used to pull the
28447 TypeBuilder for it.
28449 My theory is that I can get rid of the TypeBuilder completely from
28450 the EmitContext, and have typecasts where it is used (from
28451 DeclSpace to where it matters).
28453 The only pending problem is that the code that implements Aliases
28454 is on TypeContainer, and probably should go in DeclSpace.
28456 * ecore.cs (SimpleName.SimpleNameResolve): Perform local variable
28457 lookups here, instead of doing that at parse time. This means
28458 that our grammar will not introduce `LocalVariableReferences' as
28459 expressions at this point. That solves the problem of code like
28463 static void Main ()
28467 This is only half the fix. The full fix requires parameters to
28468 also be handled in this way.
28470 * class.cs (Property.DefineMethod): When implementing an interface
28471 method, set newslot, when implementing an abstract method, do not
28472 set the flag (before we tried never setting it, or always setting
28473 it, which is the difference).
28474 (Indexer.DefineMethod): same.
28475 (Method.DefineMethod): same.
28477 * ecore.cs: Only set the status used flag if we get back a Field.
28479 * attribute.cs: Temporary hack, so Paolo can keep working.
28481 2002-03-08 Ravi Pratap <ravi@ximian.com>
28483 * attribute.cs (Attribute.UnmanagedType): This is to keep track of
28484 the unmanaged type in the case we have a MarshalAs attribute.
28486 (Resolve): Handle the case when we are parsing the special MarshalAs
28487 attribute [we need to store the unmanaged type to use later]
28489 * typemanager.cs (marshal_as_attr_type): Built in type for the
28490 MarshalAs Attribute.
28492 * attribute.cs (ApplyAttributes): Recognize the MarshalAs attribute
28493 on parameters and accordingly set the marshalling info.
28495 2002-03-09 Miguel de Icaza <miguel@ximian.com>
28497 * class.cs: Optimizing slightly by removing redundant code after
28498 we switched to the `NoTypes' return value.
28499 (Property.DefineMethod): use NoTypes here too.
28501 This fixes the bug I introduced in my last batch of changes.
28503 2002-03-05 Ravi Pratap <ravi@ximian.com>
28505 * tree.cs (RecordEnum): Add. We now keep track of enums too.
28507 * class.cs (LookupInterfaceOrClass): Check against the list of recorded
28508 Enums since those are types too.
28510 * cs-parser.jay (enum_declaration): Record enums as we parse them.
28512 * enum.cs (DefineEnum): Return if the TypeBuilder has already been defined
28513 thanks to a call during the lookup process.
28515 2002-03-07 Miguel de Icaza <miguel@ximian.com>
28517 * statement.cs (Foreach): Lots of work to accomodate a particular
28518 kind of foreach statement that I had not kept in mind. It is
28519 possible to have foreachs on classes that provide a GetEnumerator
28520 method that return objects that implement the "pattern" for using
28521 a foreach, there is no need to support GetEnumerator
28524 This is needed to compile nant.
28526 * decl.cs: Only report 114 if the member is not `Finalize' and if
28527 the warning level is at least 2.
28529 * class.cs: Moved the compare function from Method to
28532 (MethodSignature.InheritableMemberSignatureCompare): Add new
28533 filter function that is used to extract inheritable methods from a
28536 (Method.Define): Use the new `inheritable_method_signature_filter'
28539 * cs-tokenizer.cs (get_cmd_arg): Do not add white space to the
28542 2002-03-06 Miguel de Icaza <miguel@ximian.com>
28544 * ecore.cs (Expression.ConvertReferenceExplicit): Removed dead code.
28546 * cs-parser.jay: Add opt_semicolon to the interface declaration.
28548 * expression.cs: Pass location information to
28549 ConvertImplicitStandard.
28551 * class.cs: Added debugging code to track return values from
28554 2002-03-05 Miguel de Icaza <miguel@ximian.com>
28556 * expression.cs (Is.DoResolve): If either side of the `is' is an
28557 interface, do not flag the warning.
28559 * ecore.cs (ImplicitReferenceConversion): We need a separate test
28562 * report.cs: Allow for --fatal to be used with --probe.
28564 * typemanager.cs (NoTypes): Move the definition for the empty Type
28567 * class.cs (TypeContainer.FindMembers): Also look for methods defined by
28569 (TypeContainer.DefineProxy): New function used to proxy to parent
28570 implementations when implementing interfaces.
28571 (TypeContainer.ParentImplements): used to lookup if our parent
28572 implements a public function that is required by an interface.
28573 (TypeContainer.VerifyPendingMethods): Hook this up.
28575 * typemanager.cs (TypeManager, AddModule, AddAssembly): Make the
28576 `modules' and `assemblies' arraylists into arrays. We only grow
28577 these are the very early start up of the program, so this improves
28578 the speedof LookupType (nicely measured).
28580 * expression.cs (MakeByteBlob): Replaced unsafe code with
28581 BitConverter, as suggested by Paolo.
28583 * cfold.cs (ConstantFold.Binary): Special case: perform constant
28584 folding of string concatenation, but if either side is a string,
28585 and the other is not, then return null, and let the runtime use
28586 the concatenation on the string plus the object (using
28587 `Object.ToString').
28589 2002-03-04 Miguel de Icaza <miguel@ximian.com>
28591 Constant Folding has been implemented now.
28593 * expression.cs (Unary.Reduce): Do not throw an exception, catch
28594 the error instead on types that are not supported in one's
28597 * constant.cs (Constant and all children): New set of functions to
28598 perform implict and explicit conversions.
28600 * ecore.cs (EnumConstant): Implement the new functions to perform
28601 conversion by proxying to the child expression.
28603 * codegen.cs: (ConstantCheckState): Constant evaluation has its
28604 own separate setting that can not be turned off from the command
28605 line using --unchecked or --checked and is only controlled using
28606 the checked/unchecked statements and expressions. This setting is
28607 used by the constant folder to flag errors.
28609 * expression.cs (CheckedExpr, UncheckedExpr): Set the
28610 ConstantCheckState as well.
28612 During Resolve, they also have to flag the state, because the
28613 constant folder runs completely in the Resolve phase.
28615 * statement.cs (Checked, Unchecked): Set the ConstantCheckState as
28618 2002-03-01 Miguel de Icaza <miguel@ximian.com>
28620 * cfold.cs: New file, this file contains the constant folder.
28622 * ecore.cs (IMemoryLocation.AddressOf): Now takes an extra
28623 argument to track whether we are using the resulting address to
28624 load or store a value and provide better error messages.
28626 (FieldExpr.Emit, FieldExpr.EmitAssign, FieldExpr.AddressOf): Use
28627 new AddressOf arguments.
28629 * statement.cs (Foreach.EmitCollectionForeach): Update
28631 * expression.cs (Argument.Emit): Call AddressOf with proper
28632 arguments to track usage.
28634 (New.DoEmit): Call AddressOf with new arguments.
28636 (Unary.Emit): Adjust AddressOf call.
28638 2002-03-01 Ravi Pratap <ravi@ximian.com>
28640 * cs-parser.jay (member_access): Change the case for pre-defined types
28641 to use a MemberAccess instead of a SimpleName. Thanks to Felix again for
28644 * class.cs (Operator::Emit): If we are abstract or extern, we don't have
28647 * attribute.cs (CheckAttribute, ApplyAttribute): Ensure that we treat operators
28648 essentially like methods and apply attributes like MethodImplOptions to them too.
28650 * ecore.cs (SimpleName.SimpleNameResolve): Perform a check on ec.TypeContainer.TypeBuilder
28653 * codegen.cs (EmitContext): The constructor now takes in an extra argument specifying the
28654 DeclSpace as the distinction is important. We provide sane defaults as usually the TypeContainer
28657 * Update code everywhere accordingly.
28659 * ecore.cs : Change references to ec.TypeContainer to ec.DeclSpace where appropriate.
28661 * cs-parser.jay (enum_declaration): Set the current namespace of the enum.
28663 2002-02-28 Ravi Pratap <ravi@ximian.com>
28665 * rootcontext.cs (LookupType): As we cycle through the chain of namespaces
28666 try performing lookups against those instead of jumping straight into using
28667 the 'using' clauses.
28669 (ImplicitParent): Add. Thanks to Felix Arrese-Igor for this idea.
28671 (LookupType): Perform lookups in implicit parents too.
28673 * class.cs (GetInterfaceOrClass): Modify to perform the exact same lookup
28674 sequence as RootContext.LookupType.
28676 * rootcontext.cs (NamespaceLookup): Split out code from LookupType which tries
28677 the various cases of namespace lookups into this method.
28679 2002-03-01 Miguel de Icaza <miguel@ximian.com>
28681 * cs-parser.jay: Add support for [Attribute ()] (empty arguments
28682 in positional arguments)
28684 * class.cs (Operator): Update the AllowedModifiers to contain
28687 * cs-parser.jay: Update operator declaration to allow for the
28688 operator body to be empty.
28690 * cs-tokenizer.cs: Added '\u' unicode support in strings and hex
28693 2002-02-27 Miguel de Icaza <miguel@ximian.com>
28695 * class.cs (Method.Emit): Label parameters.
28697 * driver.cs: Return 1 or 0 as the program exit code.
28699 2002-02-26 Miguel de Icaza <miguel@ximian.com>
28701 * expression.cs: Special case the `null' object when trying to
28702 auto-compute the type, as anything can be explicitly converted to
28705 * ecore.cs (Expression.ConvertExplicit): Bug fix, thanks for
28706 spotting this Paolo.
28708 (Expression.ImplicitNumericConversion): Perform comparissions of
28709 the type using the underlying type in the case of an enumeration
28710 rather than using the enumeration type for the compare.
28712 Cope with the underlying == type case, which is not possible to
28715 (Expression.ConvertNumericExplicit): Perform comparissions of
28716 the type using the underlying type in the case of an enumeration
28717 rather than using the enumeration type for the compare.
28719 * driver.cs: If the user does not supply an extension, assume .exe
28721 * cs-parser.jay (if_statement): Rewrote so that we can track the
28722 location for the if statement.
28724 * expression.cs (Binary.ConstantFold): Only concat strings when
28725 the operation is "+", not everything ;-)
28727 * statement.cs (Statement.EmitBoolExpression): Take a location
28729 (If, While, Do): Track location.
28731 * expression.cs (Binary.ResolveOperator): In the object + string
28732 case, I was missing a call to ConvertImplicit
28734 2002-02-25 Ravi Pratap <ravi@ximian.com>
28736 * parameter.cs (Parameter.ExternalType): Take in extra DeclSpace and
28737 Location arguments. Ensure we use RootContext.LookupType to do our work
28738 and not try to do a direct Type.GetType and ModuleBuilder.GetType
28740 * interface.cs (PopulateMethod): Handle the type of the parameter being
28743 * expression.cs (Invocation.BetterFunction): Handle the case when we
28744 have a params method with no fixed arguments and a call is made with no
28747 2002-02-25 Miguel de Icaza <miguel@ximian.com>
28749 * cs-tokenizer.cs: Add support for the quote-escape-sequence in
28750 the verbatim-string-literal
28752 * support.cs (InternalParameters.ParameterModifier): handle null
28754 (InternalParameters.ParameterType): ditto.
28756 * parameter.cs (VerifyArgs): Also check if the fixed parameter is
28757 duplicating the name of the variable parameter.
28758 (GetParameterByName): Fix bug where we were not looking up array
28759 paramters if they were the only present (thanks Paolo!).
28760 (GetParameterInfo): We only have an empty set of types if both
28761 fixed and array are set to null.
28762 (GetParameterInfo-idx): Handle FixedParameter == null
28764 * cs-parser.jay: Handle the case where there is no catch
28765 statements (missing null test).
28767 2002-02-22 Miguel de Icaza <miguel@ximian.com>
28769 * driver.cs (MainDriver): Be conservative on our command line
28772 Catch DirectoryNotFoundException when calling GetFiles.
28774 (SplitPathAndPattern): Used to split the input specification into
28775 a path and a pattern that we can feed to Directory.GetFiles.
28777 2002-02-21 Miguel de Icaza <miguel@ximian.com>
28779 * statement.cs (Fixed): Implement the last case of the Fixed
28780 statement (string handling).
28782 * expression.cs (StringPtr): New class used to return a char * to
28783 a string; Used by the Fixed statement.
28785 * typemanager.cs: Add char_ptr_type. Add get_OffsetToStringData method.
28787 * expression.cs (Binary.ResolveOperator): Remove redundant
28788 MemberLookup pn parent type.
28789 Optimize union call, we do not need a union if the types are the same.
28790 (Unary.ResolveOperator): REmove redundant MemberLookup on parent
28793 Specialize the use of MemberLookup everywhere, instead of using
28794 the default settings.
28796 (StackAlloc): Implement stackalloc keyword.
28798 * cs-parser.jay: Add rule to parse stackalloc.
28800 * driver.cs: Handle /h, /help, /?
28802 * expression.cs (MakeByteBlob): Removed the hacks we had in place
28803 before we supported unsafe code.
28805 * makefile: add --unsafe to the self compilation of mcs.
28807 2002-02-20 Miguel de Icaza <miguel@ximian.com>
28809 * expression.cs (PointerArithmetic): New class that is used to
28810 perform pointer arithmetic.
28811 (Binary.Resolve): Handle pointer arithmetic
28812 Handle pointer comparission.
28813 (ArrayPtr): Utility expression class that is used to take the
28814 address of an array.
28816 (ElementAccess): Implement array access for pointers
28818 * statement.cs (Fixed): Implement fixed statement for arrays, we
28819 are missing one more case before we are done.
28821 * expression.cs (Indirection): Implement EmitAssign and set the
28822 ExprClass to Variable. This allows pointer dereferences to be
28823 treated as variables, and to have values assigned to them.
28825 * ecore.cs (Expression.StoreFromPtr): New utility function to
28826 store values dereferencing.
28828 2002-02-20 Ravi Pratap <ravi@ximian.com>
28830 * expression.cs (Binary.ResolveOperator): Ensure that we are
28831 not trying to operate on a void type - this fixes the reported
28834 * decl.cs (CheckMethodAgainstBase): Do not allow overriding if
28835 the parent implementation is sealed.
28837 * ../errors/cs0239.cs : Add.
28839 * attribute.cs (ApplyAttributes): Handle Modulebuilders too.
28841 * typemanager.cs (unverifiable_code_type): Corresponds to
28842 System.Security.UnverifiableCodeAttribute. We need to emit this for modules
28843 which have unsafe code in them.
28845 * rootcontext.cs (EmitCode): Emit the above attribute when we are in an
28848 2002-02-19 Miguel de Icaza <miguel@ximian.com>
28850 * cs-tokenizer.cs: Add support for @"litreal strings"
28852 Make tokenizer accept pre-processor directives
28853 on any column (remove the old C-like limitation).
28855 * rootcontext.cs (EmitCode): Emit any global attributes.
28856 (AddGlobalAttributes): Used to keep track of assembly attributes.
28858 * attribute.cs (ApplyAttributes): Support AssemblyAttributes.
28860 * cs-parser.jay: Add support for global attributes.
28862 2002-02-17 Miguel de Icaza <miguel@ximian.com>
28864 * expression.cs (Indirection): New helper class. Unary will
28865 create Indirection classes to be able to implement the
28866 IMemoryLocation interface on it.
28868 2002-02-16 Miguel de Icaza <miguel@ximian.com>
28870 * cs-parser.jay (fixed_statement): reference the right statement.
28872 * statement.cs (Fixed.Emit): Finish implementing the fixed
28873 statement for the &x case.
28875 2002-02-14 Miguel de Icaza <miguel@ximian.com>
28877 * class.cs (Property.Define, Method.Define): Remove newslot when
28880 * modifiers.cs: My use of NewSlot when `Abstract' was set was
28881 wrong. NewSlot should only be used if the `new' keyword is present.
28883 * driver.cs (GetSystemDir): Use CodeBase instead of FullName for
28884 locating our system dir. Sorry about this.
28886 2002-02-13 Miguel de Icaza <miguel@ximian.com>
28888 * driver.cs (GetSystemDir): Compute correctly the location of our
28889 system assemblies. I was using the compiler directory instead of
28890 the library directory.
28892 2002-02-13 Ravi Pratap <ravi@ximian.com>
28894 * expression.cs (BetterFunction): Put back in what Miguel commented out
28895 since it is the correct fix. The problem is elsewhere ;-)
28897 (IsParamsMethodApplicable): Fix bug where we were not checking that the fixed
28898 parameters of the parms method are themselves compatible or not !
28900 (StandardConversionExists): Fix very dangerous bug where we were forgetting
28901 to check that a class implements an interface before saying that an implicit
28902 conversion was allowed. Use ImplementsInterface to do the checking.
28904 2002-02-13 Miguel de Icaza <miguel@ximian.com>
28906 * class.cs (Method.Define): Track whether we are an explicit
28907 implementation or not. And only call DefineMethodOverride if we
28908 are an explicit implementation.
28910 (Property.DefineMethod): Ditto.
28912 2002-02-11 Ravi Pratap <ravi@ximian.com>
28914 * expression.cs (BetterFunction): Catch hideous bug which was
28915 preventing us from detecting ambiguous calls due to implicit casts i.e
28918 2002-01-29 Miguel de Icaza <miguel@ximian.com>
28920 * support.cs (Pair): Remove un-needed method. I figured why I was
28921 getting the error in cs-parser.jay, the variable in a foreach loop
28922 is readonly, and the compiler does not really treat this as a variable.
28924 * cs-parser.jay (fixed_statement): Fix grammar. Use ASSIGN
28925 instead of EQUALS in grammar.
28927 * typemanager.cs (VerifyUnmanaged): Report correct error (208)
28929 * expression.cs (Unary.DoResolve): Check whether the argument is
28932 2002-01-28 Miguel de Icaza <miguel@ximian.com>
28934 * support.cs: Api for Pair to set a value. Despite the fact that
28935 the variables are public the MS C# compiler refuses to compile
28936 code that accesses the field if the variable is part of a foreach
28939 * statement.cs (Fixed): Begin implementation of the fixed
28942 (Block.AddVariable): Return the VariableInfo on success and null
28943 on failure instead of true/false.
28945 * cs-parser.jay (foreach): Catch errors on variables already
28946 defined (we were ignoring this value before) and properly unwind
28947 the block hierarchy
28949 (fixed_statement): grammar for the fixed statement.
28951 2002-01-25 Miguel de Icaza <miguel@ximian.com>
28953 * expression.cs (UnaryMutator.IsIncrementableNumber): Allow also
28954 pointer types to be incretemented.
28956 (SizeOf): Implement.
28958 * cs-parser.jay (pointer_member_access): Implement
28959 expr->IDENTIFIER production.
28961 * expression.cs (IndexerAccess.DoResolve, ArrayAccess.DoResolve,
28962 MemberAccess.DoResolve, Invocation.DoResolve): Check for pointers
28965 (Unary): Implement indirection.
28967 * ecore.cs (Expression.UnsafeError): Reports error 214 (pointer
28968 use in non-unsafe context).
28970 (SimpleName.DoResolve): Check for pointers in field access on safe
28973 (Expression.LoadFromPtr): Factor the load-indirect code in this
28974 function. This was duplicated in UnboxCast and ParameterReference
28976 2002-01-24 Miguel de Icaza <miguel@ximian.com>
28978 * expression.cs (ComposedCast): report an error if a pointer cast
28979 is used in a safe region.
28981 * ecore.cs (Expression.ConvertExplicit): Add rules for implicit
28982 pointer type casts in unsafe context.
28984 * codegen.cs (EmitContext): Set up IsUnsafe.
28986 * cs-parser.jay (non_expression_type): Add productions for pointer
28989 * expression.cs (Invocation.EmitCall): Remove chunk of buggy
28990 code. We should not use force into static mode if the method is
28991 not virtual. Fixes bug in MIS
28993 * statement.cs (Do.Emit, While.Emit, For.Emit,
28994 Statement.EmitBoolExpression): Add support to Do and While to
28995 propagate infinite loop as `I do return' semantics.
28997 Improve the For case to also test for boolean constants.
28999 * attribute.cs (Attribute.ApplyAttributes): Add ParameterBuilder
29000 to the list of attributes we can add.
29002 Remove `EmitContext' argument.
29004 * class.cs (Method.Define): Apply parameter attributes.
29005 (Constructor.Define): Apply parameter attributes.
29006 (MethodCore.LabelParameters): Move here the core of labeling
29009 * support.cs (ReflectionParameters.ParameterModifier,
29010 InternalParameters.ParameterModifier): Use IsByRef on the type and
29011 only return the OUT bit for these parameters instead of in/out/ref
29014 This is because I miss-understood things. The ParameterInfo.IsIn
29015 and IsOut represent whether the parameter has the [In] and [Out]
29018 2002-01-22 Miguel de Icaza <miguel@ximian.com>
29020 * ecore.cs (FieldExpr.Emit): Release temporaries.
29022 * assign.cs (LocalTemporary.Release): new function.
29024 * codegen.cs (EmitContext.GetTemporaryStorage,
29025 EmitContext.FreeTemporaryStorage): Rework the way we deal with
29026 temporary storage. Now we can "put back" localbuilders when we
29029 2002-01-21 Miguel de Icaza <miguel@ximian.com>
29031 * ecore.cs (FieldExpr.Emit): Handle initonly fields specially: we
29032 need to make a copy of the variable to generate verifiable code.
29034 2002-01-19 Miguel de Icaza <miguel@ximian.com>
29036 * driver.cs: Compute dynamically the system directory.
29038 * ecore.cs (CopyNewMethods): reworked, exposed, made public.
29039 Slower, but more generally useful. Used by the abstract
29040 registering implementation.
29042 * expression.cs (ResolveMemberAccess): Reorder the way we evaluate
29043 the rules for the special rule on Type/instances. First check if
29044 we have the same name, and if so, try that special static path
29045 rather than the instance path.
29047 2002-01-18 Miguel de Icaza <miguel@ximian.com>
29049 * cs-parser.jay: Emit 642 (warning: possible empty statement) for
29052 * class.cs (TypeBuilder.DefineType): Do not allow inheritance from
29053 Enum, ValueType, Delegate or Array for non-corlib compiles.
29055 * cs-tokenizer.cs: Catch long identifiers (645)
29057 * typemanager.cs (IndexerPropetyName): Ravi never tested this
29060 * class.cs (TypeContainer.RegisterRequiredImplementations): Bug
29061 fix, we were returning too early, so we were not registering
29062 pending methods from abstract classes.
29064 Do not register pending methods if the class is abstract.
29066 * expression.cs (Conditional.DoResolve): Report circular implicit
29067 conversions when we neecd to compute it for conditional
29070 (Is.DoResolve): If the expression is always of the provided type,
29071 flag warning 183. If the expression can not ever be of the
29072 provided type flag warning 184.
29074 * class.cs: Catch 169 as well.
29076 * ecore.cs (FieldExpr): For now in AddressOf mark as assigned and
29079 2002-01-18 Nick Drochak <ndrochak@gol.com>
29081 * makefile: remove path to beta2 csc.exe. path to csc.exe must be in PATH instead.
29083 2002-01-17 Miguel de Icaza <miguel@ximian.com>
29085 * interface.cs: (PopulateMethod): Check for pointers being defined
29086 only if the unsafe context is active.
29087 (PopulateProperty): ditto.
29088 (PopulateIndexer): ditto.
29090 * class.cs (Method, Method.Define): Allow `unsafe' modifier to be
29091 specified. If pointers are present, make sure that they are
29092 present in an unsafe context.
29093 (Constructor, Constructor.Define): ditto.
29094 (Field, Field.Define): ditto.
29095 (Property, Property.Define): ditto.
29096 (Event, Event.Define): ditto.
29098 * interface.cs (Interface.GetInterfaceTypeByName): Only lookup the
29099 hashtable if there are classes or structs defined.
29101 * expression.cs (LocalVariableReference.DoResolve): Simplify this
29102 code, as the constant resolution moved.
29104 * statement.cs (Block.EmitMeta): Resolve all constants as we emit
29105 the metadata, so we can flag error 133.
29107 * decl.cs (MemberCore.UnsafeOK): New function to test that a
29108 pointer is being declared in an unsafe context.
29110 2002-01-16 Miguel de Icaza <miguel@ximian.com>
29112 * modifiers.cs (Modifiers.Check): Require a Location argument.
29113 Report error 227 for Unsafe use.
29115 * typemanager.cs: Remove IsPointerType, we should be using Type.IsPointer
29117 * statement.cs (For.Emit): If the test is null, then report that
29118 we do `return', as we wont reach anything afterwards.
29120 (Switch.SwitchGoverningType): Track the expression that matched
29123 * driver.cs: Allow negative numbers as an error code to flag.
29125 * cs-parser.jay: Handle 1551.
29127 * namespace.cs: Add 1537 checking (repeated using alias namespaces).
29129 2002-01-15 Miguel de Icaza <miguel@ximian.com>
29131 * cs-parser.jay: Report 1518 (type declaration can only contain
29132 class, struct, interface, enum or delegate)
29134 (switch_label): Report 1523 (keywords `case' or `default' must
29137 (opt_switch_sections): Report 1522 (empty switch)
29139 * driver.cs: Report 1515 (response file specified multiple times)
29140 Report 1516 (Source file specified multiple times).
29142 * expression.cs (Argument.Resolve): Signal 1510
29144 (BaseAccess.Resolve, BaseIndexer.Resolve): Signal 1511 (base
29145 access not allowed in static code)
29147 2002-01-11 Ravi Pratap <ravi@ximian.com>
29149 * typemanager.cs (IsPointerType): Utility method which we are going
29152 * ecore.cs (ImplicitReferenceConversion): A pointer type cannot be cast to
29153 the object type, so we take care of that.
29155 * expression.cs (FullMethodDesc): Also include the return type in descriptions.
29157 * support.cs (ParameterDesc): Fix minor bug which was causing params tags to be
29158 added to non-params parameters :-)
29160 * typemanager.cs (CSharpName): Include 'void' type too.
29162 (void_ptr_type): Include in the set of core types.
29164 * ecore.cs (ConvertImplicit): Make use of ConvertImplicitStandard instead of
29167 (ConvertImplicitStandard): Handle standard implicit pointer conversions when we have
29170 * cs-parser.jay (local_variable_pointer_type): Add support for 'void *' as I had
29171 completely forgotten about it.
29173 2002-01-10 Ravi Pratap <ravi@ximian.com>
29175 * cs-parser.jay (pointer_type): Add. This begins our implementation
29176 of parsing rules for unsafe code.
29178 (unsafe_statement): Implement.
29180 (embedded_statement): Modify to include the above.
29182 * statement.cs (Unsafe): Implement new class for unsafe blocks.
29184 * codegen.cs (EmitContext.InUnsafe): Add. This determines
29185 if the current context is an unsafe one.
29187 * cs-parser.jay (local_variable_pointer_type): Since local variable types
29188 are handled differently, we need separate rules for them.
29190 (local_variable_declaration): Update to use local_variable_pointer_type
29191 to allow variable declarations of unmanaged pointer types.
29193 * expression.cs (Unary.ResolveOperator): Ensure that the '&' operator is used only
29194 in unsafe contexts.
29196 * ../errors/cs0214.cs : Add.
29198 2002-01-16 Nick Drochak <ndrochak@gol.com>
29200 * makefile: remove 'response' file when cleaning.
29202 2002-01-15 Miguel de Icaza <miguel@ximian.com>
29204 * cs-parser.jay: Report 1524.
29206 2002-01-14 Miguel de Icaza <miguel@ximian.com>
29208 * typemanager.cs (RegisterMethod): drop checking if we have
29209 registered this from here
29211 2002-01-12 Miguel de Icaza <miguel@ximian.com>
29213 * class.cs (Method.EmitDestructor): Implement calling our base
29216 * statement.cs (Try.Emit): Fix to reset the InFinally to the old
29217 value of InFinally.
29219 * codegen.cs (EmitContext.EmitTopBlock): Destructors will call
29220 this routine and will wrap the call in a try/catch block. Deal
29223 2002-01-11 Miguel de Icaza <miguel@ximian.com>
29225 * ecore.cs (Expression.MemberLookup): instead of taking a
29226 parameter `same_type' that was used to tell whether we could
29227 access private members we compute our containing type from the
29230 (FieldExpr): Added partial support for volatile fields. This does
29231 not work for volatile fields exposed from assemblies, as I can not
29232 figure out how to extract the modreq from it.
29234 Updated all the source files to use this.
29236 * codegen.cs (EmitContext): Compute ContainerType ahead of time,
29237 because it is referenced by MemberLookup very often.
29239 2002-01-09 Ravi Pratap <ravi@ximian.com>
29241 * typemanager.cs (IndexerPropertyName): If we have a TypeBuilder, use
29242 TypeBuilder.GetCustomAttributes to retrieve what we need.
29244 Get rid of redundant default_member_attr_type as this is the same as
29245 default_member_type which already exists.
29247 * interface.cs, attribute.cs : Update accordingly.
29249 2002-01-08 Miguel de Icaza <miguel@ximian.com>
29251 * typemanager.cs: Enable IndexerPropertyName again. It does not
29252 work for TYpeBuilders though. Ravi, can you please fix this?
29254 * cs-tokenizer.cs: Accept _ as a name in pp-expressions.
29256 * expression.cs (Argument.Emit): Handle the case of ref objects
29257 being passed to ref functions;
29259 (ParameterReference.EmitLoad): Loads the content of the pointer
29260 without dereferencing.
29262 2002-01-07 Miguel de Icaza <miguel@ximian.com>
29264 * cs-tokenizer.cs: Implemented the pre-processing expressions.
29266 2002-01-08 Ravi Pratap <ravi@ximian.com>
29268 * class.cs (Indexer.DefineMethod): Incorporate the interface
29269 type in the name of the method if we are doing explicit interface
29272 * expression.cs (ConversionExists): Remove as it is completely obsolete.
29274 (BetterConversion): Fix extremely trivial bug where we were referring to
29275 ConversionExists instead of StandardConversionExists ! Hooray, things are fine
29278 * ../errors/bug16.cs : Add although we have fixed it.
29280 2002-01-07 Miguel de Icaza <miguel@ximian.com>
29282 * expression.cs (BaseIndexer): Begin implementation.
29284 * class.cs (TypeContainer.IsInterfaceMethod): Bug fix.
29286 * cs-parser.jay (indexer_declarator): Use qualified_identifier
29287 production directly to remove a shift/reduce, and implement
29288 explicit interface implementation.
29290 * cs-tokenizer.cs: Fix tokenizer, it was consuming one extra char
29291 after a floating point suffix.
29293 * expression.cs (DoNumericPromotions): Improved the conversion for
29294 uint/uint. If we have a constant, we avoid doing a typecast to a
29297 * class.cs (Indexer): Implement explicit interface implementation
29300 Sat Jan 5 16:08:23 CET 2002 Paolo Molaro <lupus@ximian.com>
29302 * class.cs: make the default instance constructor public and hidebysig.
29304 2001-01-03 Ravi Pratap <ravi@ximian.com>
29306 * interface.cs (EmitDefaultMemberAttr): Make this helper method static
29307 so we can call it from elsewhere.
29309 * class.cs (TypeContainer.Emit): Emit the attribute here too. The rule is that
29310 we emit it internally if the class has a defined indexer; otherwise the user
29311 emits it by decorating the class definition with the DefaultMemberAttribute.
29313 * attribute.cs (ApplyAttributes): Perform checks to see that the DefaultMember
29314 attribute is not used on a type which defines an indexer.
29316 * cs-tokenizer.cs (get_cmd_arg): Ensure we trim whitespace and also include the tab
29317 character when we skip whitespace.
29319 * ../errors/cs0646.cs : Add.
29321 2002-01-03 Miguel de Icaza <miguel@ximian.com>
29323 * ecore.cs (SimpleName.ResolveSimpleName): Report error 120
29326 * makefile: Add practical target `mcs3.exe' which builds the third
29327 generation compiler.
29329 * expression.cs (New): Fix structures constructor calling.
29331 * class.cs (Property, Method, Indexer): Emit Final flag on the
29332 method if we are an interface implementation and we are not
29335 * ecore.cs (PropertyExpr): New public field `IsBase', tells
29336 whether this property is referencing a `base' method.
29338 * expression.cs (Invocation.EmitCall): take an extra argument:
29339 is_base, this is used to determine whether the `call' or
29340 `callvirt' opcode should be used.
29343 * delegate.cs: update EmitCall.
29345 * class.cs (Method.Define): Set NewSlot for the cases where we are
29346 not implementing an interface method.
29348 (Property.Define): ditto.
29350 2002-01-02 Miguel de Icaza <miguel@ximian.com>
29352 * cs-tokenizer.cs: (Tokenizer.escape): Escape '\r' as '\r' not as
29353 'r'. Allows mcs to parse itself fully.
29355 2002-01-02 Ravi Pratap <ravi@ximian.com>
29357 * expression.cs (ArrayCreation.num_automatic_initializers): Keep track
29358 of the number of initializers that require the InitializeArray method.
29360 (CheckIndices): Store the Expression in all cases - not the plain value. Also
29361 update the above field where necessary.
29363 (MakeByteBlob): Update accordingly.
29365 (DoEmit): Call EmitStaticInitializers only if the number of initializers is
29368 (EmitDynamicInitializers): Update in accordance with the new optimization.
29370 (ArrayAccess.EmitStoreOpcode): Include char type along with short and ushort - the
29371 same OpCode applies.
29373 * cs-parser.jay : Fix some glaring errors I introduced.
29375 2002-01-01 Ravi Pratap <ravi@ximian.com>
29377 * parameters.cs (AddVariable, AddConstant): Pass in current_local_parameters
29378 so that we can check for name clashes there too.
29380 * typemanager.cs (default_member_attr_type): The attribute that we need to emit
29381 for interface indexers.
29383 * interfaces.cs (Define): Emit the default member attribute.
29385 * expression.cs (MakeByteBlob): Fix extremely trivial bug where the wrong
29386 variable was being referred to while setting the value ;-)
29388 2002-01-01 Miguel de Icaza <miguel@ximian.com>
29390 * expression.cs (MakeByteBlob): Optimize: we do not need to fill
29391 byte-by-byte information when we know the data is zero.
29393 Make the block always a multiple of 4, because
29394 DefineInitializedData has a bug.
29396 * assign.cs: Fix, we should assign from the temporary, not from
29399 * expression.cs (MakeByteBlob): Fix my incorrect code.
29401 2001-12-31 Miguel de Icaza <miguel@ximian.com>
29403 * typemanager.cs (EnumToUnderlying): This function is used to get
29404 the underlying type from an enumeration, because it does not
29407 * constant.cs: Use the I4_S form for values between -128 and 127.
29409 * statement.cs (Block.LookupLabel): Looks up a label.
29410 (Block): Drop support for labeled blocks.
29412 (LabeledStatement): New kind of statement that represents a label
29415 (Goto): Finally implement this bad boy.
29417 * cs-parser.jay: Update to reflect new mechanism to implement
29420 2001-12-30 Miguel de Icaza <miguel@ximian.com>
29422 * codegen.cs (EmitContext.This): a codegen property that keeps the
29423 a single instance of this instead of creating many different this
29426 * delegate.cs (Delegate.DoResolve): Update to use the property;
29428 * ecore.cs (SimpleName.SimpleNameResolve): Ditto
29430 * expression.cs (BaseAccess.DoResolve): Ditto.
29432 2001-12-29 Ravi Pratap <ravi@ximian.com>
29434 * typemanager.cs (methodimpl_attr_type): Add to hold the type
29435 corresponding to System.Runtime.CompilerServices.MethodImplAttribute.
29437 (InitCoreTypes): Update accordingly.
29439 * attribute.cs (Resolve): Remember if the attribute is a MethodImplAttribute
29440 so we can quickly store the state.
29442 (ApplyAttributes): Set the correct implementation flags
29443 for InternalCall methods.
29445 2001-12-29 Miguel de Icaza <miguel@ximian.com>
29447 * expression.cs (EmitCall): if a method is not virtual, then do
29448 not use callvirt on it.
29450 (ArrayAccess.EmitAssign): storing non-builtin value types (ie,
29451 user defined stuff) requires the use of stobj, which takes an
29452 address on the stack instead of an array and an index. So emit
29453 the Ldelema operation for it.
29455 (EmitStoreOpcode): Use stobj for valuetypes.
29457 (UnaryMutator.EmitCode): Use the right 1 value depending on
29458 whether we are dealing with int64/uint64, float or doubles.
29460 * class.cs (TypeContainer.AddConstructor): Fix the logic to define
29461 constructors that I implemented last night.
29463 (Constructor.IsDefault): Fix to work properly for static
29466 * cs-parser.jay (CheckDef): report method signature errors.
29467 Update error number 103 to be 132.
29469 * decl.cs: New AdditionResult enumeration value: MethodExists.
29470 Although we do this check for methods later on in the semantic
29471 analysis, catching repeated default constructors is so easy that
29472 we catch these here.
29474 * expression.cs (Binary.DoNumericPromotions): Fix the uint64 type
29477 (ParameterReference.EmitAssign, Emit): handle
29480 (ArrayAccess.EmitLoadOpcode): Handle bool type here.
29481 (ArrayAccess.EmitStoreOpcode): ditto.
29483 * cs-tokenizer.cs (is_punct): Eliminated empty computation.
29485 * expression.cs (MakeByteBlob): Complete all the missing types
29486 (uint, short, ushort, byte, sbyte)
29488 * class.cs: Only init instance field initializers on instance
29491 Rename `constructors' to instance_constructors.
29493 (TypeContainer.AddConstructor): Only add constructors to the list
29494 if it is not static.
29496 Make sure that we handle default_static_constructor independently
29497 everywhere where we handle instance_constructors
29499 2001-12-28 Miguel de Icaza <miguel@ximian.com>
29501 * class.cs: Do not lookup or create a base initializer for a
29502 static constructor.
29504 (ConstructorInitializer.Resolve): use the proper type to lookup
29507 * cs-parser.jay: Report error 1585 (modifiers between type and name).
29509 * enum.cs, interface.cs: Remove CloseType, this is taken care by
29512 * decl.cs: CloseType is now an virtual method, the default
29513 implementation just closes this type.
29515 2001-12-28 Ravi Pratap <ravi@ximian.com>
29517 * attribute.cs (DefinePInvokeMethod): Set the implementation flags
29518 to PreserveSig by default. Also emit HideBySig on such methods.
29520 Basically, set the defaults to standard values.
29522 * expression.cs (Invocation.BetterFunction): We need to make sure that for each
29523 argument, if candidate is better, it can't be worse than the best !
29525 (Invocation): Re-write bits to differentiate between methods being
29526 applicable in their expanded form and their normal form - for params
29529 Get rid of use_standard everywhere as only standard conversions are allowed
29530 in overload resolution.
29532 More spec conformance.
29534 2001-12-27 Miguel de Icaza <miguel@ximian.com>
29536 * driver.cs: Add --timestamp, to see where the compiler spends
29539 * ecore.cs (SimpleName.DoResolve): Do not create an implicit
29540 `this' in static code.
29542 (SimpleName.DoResolve): Implement in terms of a helper function
29543 that allows static-references to be passed upstream to
29546 (Expression.ResolveWithSimpleName): Resolve specially simple
29547 names when called by MemberAccess to implement the special
29550 (Expression.ImplicitReferenceConversion): Handle conversions from
29551 Null to reference types before others, as Null's type is
29554 * expression.cs (Invocation.EmitCall): Handle the special case of
29555 calling methods declared on a reference type from a ValueType
29556 (Base classes System.Object and System.Enum)
29558 (MemberAccess.Resolve): Only perform lookups on Enumerations if
29559 the left hand side is a TypeExpr, not on every enumeration.
29561 (Binary.Resolve): If types are reference types, then do a cast to
29562 object on operators != and == of both arguments.
29564 * typemanager.cs (FindMembers): Extract instance and static
29565 members if requested.
29567 * interface.cs (PopulateProperty): Use void_type instead of null
29568 as the return type for the setter method.
29570 (PopulateIndexer): ditto.
29572 2001-12-27 Ravi Pratap <ravi@ximian.com>
29574 * support.cs (ReflectionParameters): Fix minor bug where we
29575 were examining the wrong parameter for the ParamArray attribute.
29577 Cope with requests for the type of the parameter at position
29578 greater than the params parameter's. We now return the element
29579 type of the params array as that makes more sense.
29581 * expression.cs (Invocation.IsParamsMethodApplicable): Update
29582 accordingly as we no longer have to extract the element type
29585 (Invocation.OverloadResolve): Update.
29587 2001-12-27 Miguel de Icaza <miguel@ximian.com>
29589 * statement.cs (Foreach.GetEnumeratorFilter): Do not compare
29590 against IEnumerator, test whether the return value is a descendant
29591 of the IEnumerator interface.
29593 * class.cs (Indexer.Define): Use an auxiliary method to implement
29594 the other bits of the method definition. Begin support for
29595 explicit interface implementation.
29597 (Property.DefineMethod): Use TypeManager.void_type instead of null
29598 for an empty return value.
29600 2001-12-26 Miguel de Icaza <miguel@ximian.com>
29602 * expression.cs (MemberAccess.ResolveMemberAccess): if we are
29603 dealing with a FieldExpr which is composed of a FieldBuilder, in
29604 the code path we did extract the constant, but we should have
29605 obtained the underlying value to be able to cast it (otherwise we
29606 end up in an infinite loop, this is what Ravi was running into).
29608 (ArrayCreation.UpdateIndices): Arrays might be empty.
29610 (MemberAccess.ResolveMemberAccess): Add support for section
29611 14.5.4.1 that deals with the special case of E.I when E is a type
29612 and something else, that I can be a reference to a static member.
29614 (ArrayCreation.MakeByteBlob): It is not an error to not be able to
29615 handle a particular array type to create byte blobs, it is just
29616 something we dont generate byteblobs for.
29618 * cs-tokenizer.cs (get_cmd_arg): Ignore \r in commands and
29621 * location.cs (Push): remove the key from the hashtable that we
29622 are about to add. This happens for empty files.
29624 * driver.cs: Dispose files after we have parsed them.
29626 (tokenize): new function that only runs the tokenizer on its
29627 input, for speed testing.
29629 2001-12-26 Ravi Pratap <ravi@ximian.com>
29631 * class.cs (Event.Define): Define the private field only if there
29632 are no accessors defined.
29634 * expression.cs (ResolveMemberAccess): If there is no associated
29635 field with the event, that means we have an event defined with its
29636 own accessors and we should flag error cs0070 since transforming
29637 ourselves into a field is not valid in that case.
29639 * ecore.cs (SimpleName.DoResolve): Same as above.
29641 * attribute.cs (DefinePInvokeMethod): Set the default calling convention
29642 and charset to sane values.
29644 2001-12-25 Ravi Pratap <ravi@ximian.com>
29646 * assign.cs (DoResolve): Perform check on events only if they
29647 are being accessed outside the declaring type.
29649 * cs-parser.jay (event_declarations): Update rules to correctly
29650 set the type of the implicit parameter etc.
29652 (add_accessor, remove_accessor): Set current local parameters.
29654 * expression.cs (Binary): For delegate addition and subtraction,
29655 cast the return value from the method into the appropriate delegate
29658 2001-12-24 Ravi Pratap <ravi@ximian.com>
29660 * typemanager.cs (RegisterDelegateData, GetDelegateData): Get rid
29661 of these as the workaround is unnecessary.
29663 * delegate.cs (NewDelegate.DoResolve): Get rid of bits which registered
29664 delegate data - none of that is needed at all.
29666 Re-write bits to extract the instance expression and the delegate method
29669 * expression.cs (Binary.ResolveOperator): Handle the '-' binary operator
29672 * attribute.cs (ApplyAttributes): New method to take care of common tasks
29673 of attaching attributes instead of duplicating code everywhere.
29675 * everywhere : Update code to do attribute emission using the above method.
29677 2001-12-23 Miguel de Icaza <miguel@ximian.com>
29679 * expression.cs (IsParamsMethodApplicable): if there are not
29680 parameters, return immediately.
29682 * ecore.cs: The 0 literal can be implicity converted to an enum
29685 (SimpleName.DoResolve): First lookup the type, then lookup the
29688 (FieldExpr.Emit): If the InstanceExpression is a ValueType, we
29689 want to get its address. If the InstanceExpression is not
29690 addressable, store the result in a temporary variable, then get
29693 * codegen.cs: Only display 219 errors on warning level or above.
29695 * expression.cs (ArrayAccess): Make it implement the
29696 IMemoryLocation interface.
29698 (Binary.DoResolve): handle the operator == (object a, object b)
29699 and operator != (object a, object b) without incurring into a
29700 BoxedCast (because 5 != o should never be performed).
29702 Handle binary enumerator operators.
29704 (EmitLoadOpcode): Use Ldelema if the object we are loading is a
29705 value type, otherwise use Ldelem_ref.
29707 Use precomputed names;
29709 (AddressOf): Implement address of
29711 * cs-parser.jay (labeled_statement): Fix recursive block
29712 addition by reworking the production.
29714 * expression.cs (New.DoEmit): New has a special case:
29716 If we are dealing with a ValueType, we have a few
29717 situations to deal with:
29719 * The target of New is a ValueType variable, that is
29720 easy, we just pass this as the variable reference
29722 * The target of New is being passed as an argument,
29723 to a boxing operation or a function that takes a
29726 In this case, we need to create a temporary variable
29727 that is the argument of New.
29730 2001-12-23 Ravi Pratap <ravi@ximian.com>
29732 * rootcontext.cs (LookupType): Check that current_type is not null before
29733 going about looking at nested types.
29735 * ecore.cs (EventExpr.EmitAddOrRemove): Rename from EmitAssign as we do
29736 not implement the IAssignMethod interface any more.
29738 * expression.cs (MemberAccess.ResolveMemberAccess): Handle EventExprs specially
29739 where we tranform them into FieldExprs if they are being resolved from within
29740 the declaring type.
29742 * ecore.cs (SimpleName.DoResolve): Do the same here.
29744 * assign.cs (DoResolve, Emit): Clean up code considerably.
29746 * ../errors/bug10.cs : Add.
29748 * ../errors/cs0070.cs : Add.
29750 * typemanager.cs : Use PtrHashtable for Delegate data hashtable etc.
29752 * assign.cs : Get rid of EventIsLocal everywhere.
29754 2001-12-23 Miguel de Icaza <miguel@ximian.com>
29756 * ecore.cs (ConvertIntLiteral): finished the implementation.
29758 * statement.cs (SwitchLabel): Convert the value we are using as a
29759 key before looking up the table.
29761 2001-12-22 Miguel de Icaza <miguel@ximian.com>
29763 * codegen.cs (EmitTopBlock): Require a Location argument now.
29765 * cs-parser.jay (constructor_declarator): We need to setup
29766 current_local_parameters before we parse the
29767 opt_constructor_initializer, to allow the variables to be bound
29768 to the constructor arguments.
29770 * rootcontext.cs (LookupType): First lookup nested classes in our
29771 class and our parents before we go looking outside our class.
29773 * expression.cs (ConstantFold): Extract/debox the values at the
29776 * rootcontext.cs (EmitCode): Resolve the constants first before we
29777 resolve the types. This is not really needed, but it helps debugging.
29779 * statement.cs: report location.
29781 * cs-parser.jay: pass location to throw statement.
29783 * driver.cs: Small bug fix.
29785 * report.cs: Updated format to be 4-zero filled digits.
29787 2001-12-22 Ravi Pratap <ravi@ximian.com>
29789 * expression.cs (CheckIndices): Fix minor bug where the wrong
29790 variable was being referred to ;-)
29792 (DoEmit): Do not call EmitStaticInitializers when the
29793 underlying type is System.Object.
29795 2001-12-21 Ravi Pratap <ravi@ximian.com>
29797 * ecore.cs (EventExpr.Resolve): Implement to correctly set the type
29798 and do the usual workaround for SRE.
29800 * class.cs (MyEventBuilder.EventType): New member to get at the type
29801 of the event, quickly.
29803 * expression.cs (Binary.ResolveOperator): Handle delegate addition.
29805 * assign.cs (Assign.DoResolve): Handle the case when the target
29806 is an EventExpr and perform the necessary checks.
29808 * ecore.cs (EventExpr.EmitAssign): Implement the IAssignMethod
29811 (SimpleName.MemberStaticCheck): Include check for EventExpr.
29813 (EventExpr): Set the type in the constructor itself since we
29814 are meant to be born fully resolved.
29816 (EventExpr.Define): Revert code I wrote earlier.
29818 * delegate.cs (NewDelegate.Resolve): Handle the case when the MethodGroup's
29819 instance expression is null. The instance expression is a This in that case
29820 or a null, depending on whether it is a static method or not.
29822 Also flag an error if the reference to a method is ambiguous i.e the MethodGroupExpr
29823 refers to more than one method.
29825 * assign.cs (DoResolve): Check whether the event belongs to the same Type container
29826 and accordingly flag errors.
29828 2001-12-21 Miguel de Icaza <miguel@ximian.com>
29830 * statement.cs (Throw.Emit): Add support for re-throwing exceptions.
29832 2001-12-22 Miguel de Icaza <miguel@ximian.com>
29834 * location.cs (ToString): Provide useful rutine.
29836 2001-12-21 Miguel de Icaza <miguel@ximian.com>
29838 * ecore.cs (Expression.ConvertIntLiteral): Do not return Constant
29839 objects, return the actual integral boxed.
29841 * statement.cs (SwitchLabel): define an ILLabel for each
29844 (Switch.CheckSwitch): If the value is a Literal, extract
29845 the underlying literal.
29847 Also in the unused hashtable we had, add the SwitchLabel so we can
29848 quickly look this value up.
29850 * constant.cs: Implement a bunch of new constants. Rewrite
29851 Literal based on this. Made changes everywhere to adapt to this.
29853 * expression.cs (Expression.MakeByteBlob): Optimize routine by
29854 dereferencing array only once, and also copes with enumrations.
29856 bytes are two bytes wide, not one.
29858 (Cast): Perform constant conversions.
29860 * ecore.cs (TryImplicitIntConversion): Return literals instead of
29861 wrappers to the literals here.
29863 * expression.cs (DoNumericPromotions): long literals can converted
29864 to ulong implicity (this is taken care of elsewhere, but I was
29865 missing this spot).
29867 * ecore.cs (Expression.Literalize): Make the return type Literal,
29868 to improve type checking.
29870 * rootcontext.cs: Lookup for nested classes in our class hierarchy.
29872 2001-12-20 Miguel de Icaza <miguel@ximian.com>
29874 * literal.cs: Revert code from ravi that checked the bounds. The
29875 bounds are sane by the definition of the type itself.
29877 * typemanager.cs: Fix implementation of ImplementsInterface. We
29878 need to actually look up in our parent hierarchy for interfaces
29881 * const.cs: Use the underlying type for enumerations
29883 * delegate.cs: Compute the basename for the delegate creation,
29884 that should fix the delegate test case, and restore the correct
29885 Type Lookup semantics in rootcontext
29887 * rootcontext.cs: Revert Ravi's last patch. The correct way of
29888 referencing a nested type with the Reflection API is using the "+"
29891 * cs-parser.jay: Do not require EOF token at the end.
29893 2001-12-20 Ravi Pratap <ravi@ximian.com>
29895 * rootcontext.cs (LookupType): Concatenate type names with
29896 a '.' instead of a '+' The test suite passes again.
29898 * enum.cs (Enum.DefineEnum): Set RTSpecialName on the 'value__'
29899 field of the enumeration.
29901 * expression.cs (MemberAccess.ResolveMemberAccess): Add support for
29902 the case when the member is an EventExpr.
29904 * ecore.cs (EventExpr.InstanceExpression): Every event which is not
29905 static has an associated instance expression.
29907 * typemanager.cs (RegisterEvent): The usual workaround, now for events.
29909 (GetAddMethod, GetRemoveMethod): Workarounds, as usual.
29911 * class.cs (Event.Define): Register event and perform appropriate checks
29914 We define the Add and Remove methods even if the use provides none because
29915 in that case, we provide default implementations ourselves.
29917 Define a private field of the type of the event. This is done by the CSC compiler
29918 and we should be doing it too ;-)
29920 * typemanager.cs (delegate_combine_delegate_delegate, delegate_remove_delegate_delegate):
29921 More methods we use in code we generate.
29923 (multicast_delegate_type, delegate_type): Two separate types since the distinction
29926 (InitCoreTypes): Update accordingly for the above.
29928 * class.cs (Event.Emit): Generate code for default accessors that we provide
29930 (EmitDefaultMethod): Do the job in the above.
29932 * delegate.cs (DefineDelegate): Use TypeManager.multicast_delegate_type in the
29935 2001-12-20 Miguel de Icaza <miguel@ximian.com>
29937 * class.cs (Indexer.Define): Fix bug, we were setting both Get/Set
29938 builders even if we were missing one.
29940 * interface.cs, class.cs, enum.cs: When calling DefineNestedType
29941 pass the Basename as our class name instead of the Name. The
29942 basename will be correctly composed for us.
29944 * parameter.cs (Paramters): Now takes a Location argument.
29946 * decl.cs (DeclSpace.LookupType): Removed convenience function and
29947 make all the code call directly LookupType in RootContext and take
29948 this chance to pass the Location information everywhere.
29950 * Everywhere: pass Location information.
29952 2001-12-19 Miguel de Icaza <miguel@ximian.com>
29954 * class.cs (Constructor.Define): Updated way of detecting the
29955 length of the parameters.
29957 (TypeContainer.DefineType): Use basename as the type name for
29960 (TypeContainer.Define): Do not recursively define types here, as
29961 definition is taken care in order by the RootContext.
29963 * tree.cs: Keep track of namespaces in a per-file basis.
29965 * parameter.cs (Parameter.ComputeSignature): Update to use
29968 (Parameters.GetSignature): ditto.
29970 * interface.cs (InterfaceMethod.GetSignature): Take a DeclSpace
29971 instead of a TypeContainer.
29973 (Interface.SemanticAnalysis): Use `this' instead of our parent to
29974 resolve names. Because we need to be resolve in our context, not
29977 * driver.cs: Implement response files.
29979 * class.cs (TypeContainer.DefineType): If we are defined, do not
29980 redefine ourselves.
29982 (Event.Emit): Emit the code for add/remove handlers.
29983 (Event.Define): Save the MethodBuilders for add/remove.
29985 * typemanager.cs: Use pair here too.
29987 * cs-parser.jay: Replaced use of DictionaryEntry for Pair because
29988 DictionaryEntry requires the first argument to be non-null.
29990 (enum_declaration): Compute full name for registering the
29993 (delegate_declaration): Instead of using
29994 formal_parameter_list, use opt_formal_parameter_list as the list
29997 * cs-tokenizer.cs (PropertyParsing): renamed from `properties'
29998 (EventParsing): New property that controls whether `add' and
29999 `remove' are returned as tokens or identifiers (for events);
30001 2001-12-19 Ravi Pratap <ravi@ximian.com>
30003 * class.cs (Event.Define): Revamp use of EventBuilder completely. We now
30004 use MyEventBuilder only and let it wrap the real builder for us.
30006 (MyEventBuilder): Revamp constructor etc.
30008 Implement all operations that we perform on EventBuilder in precisely the same
30011 (FindMembers): Update to use the EventBuilder member.
30013 (Event.Emit): Update accordingly.
30015 2001-12-18 Ravi Pratap <ravi@ximian.com>
30017 * class.cs (MyEventBuilder.Set*): Chain to the underlying builder
30018 by calling the appropriate methods.
30020 (GetCustomAttributes): Make stubs as they cannot possibly do anything
30023 (Event.Emit): Use MyEventBuilder everywhere - even to set attributes.
30025 2001-12-17 Ravi Pratap <ravi@ximian.com>
30027 * delegate.cs (Delegate.Populate): Check that the return type
30028 and various parameters types are indeed accessible.
30030 * class.cs (Constructor.Define): Same here.
30032 (Field.Define): Ditto.
30034 (Event.Define): Ditto.
30036 (Operator.Define): Check that the underlying Method defined itself
30037 correctly - so it's MethodBuilder should not be null.
30039 * delegate.cs (DelegateInvocation.DoResolve): Bale out if the type of the Instance
30040 expression happens to be null.
30042 * class.cs (MyEventBuilder): Workaround for SRE lameness. Implement various abstract
30043 members but as of now we don't seem to be able to do anything really useful with it.
30045 (FindMembers): Handle events separately by returning the MyEventBuilder of the event,
30046 not the EventBuilder.
30048 2001-12-18 Miguel de Icaza <miguel@ximian.com>
30050 * cs-tokenizer.cs: Add support for defines.
30051 Add support for #if, #elif, #else, #endif
30053 (eval_var): evaluates a variable.
30054 (eval): stubbed for evaluating functions.
30056 * cs-parser.jay: Pass the defines information
30058 * driver.cs: Add --define command line option.
30060 * decl.cs: Move MemberCore here.
30062 Make it the base class for DeclSpace. This allows us to catch and
30063 report 108 and 109 for everything now.
30065 * class.cs (TypeContainer.Define): Extract all the members
30066 before populating and emit the warning 108 (new keyword required
30067 to override) instead of having each member implement this.
30069 (MemberCore.Define): New abstract method, we will be using this in
30070 the warning reporting engine in Populate.
30072 (Operator.Define): Adjust to new MemberCore protocol.
30074 * const.cs (Const): This does not derive from Expression, it is a
30075 temporary object we use to create fields, it is a MemberCore.
30077 * class.cs (Method.Define): Allow the entry point to be in a
30080 * driver.cs: Rewrite the argument handler to clean it up a bit.
30082 * rootcontext.cs: Made it just an auxiliary namespace feature by
30083 making everything static.
30085 * driver.cs: Adapt code to use RootContext type name instead of
30088 * delegate.cs: Remove RootContext argument.
30090 * class.cs: (Struct, TypeContainer, Class): Remove RootContext
30093 * class.cs (Event.Define): The lookup can fail.
30095 * cs-tokenizer.cs: Begin implementation of pre-procesor.
30097 * expression.cs: Resolve the this instance before invoking the code.
30099 2001-12-17 Miguel de Icaza <miguel@ximian.com>
30101 * cs-parser.jay: Add a production in element_access that allows
30102 the thing to become a "type" reference. This way we can parse
30103 things like "(string [])" as a type.
30105 Note that this still does not handle the more complex rules of
30109 * delegate.cs (Delegate.Populate): Register the delegage constructor builder here.
30111 * ecore.cs: (CopyNewMethods): new utility function used to
30112 assemble the list of methods from running FindMembers.
30114 (MemberLookup): Rework FindMembers so that
30116 2001-12-16 Miguel de Icaza <miguel@ximian.com>
30118 * class.cs (TypeContainer): Remove Delegates who fail to be
30121 * delegate.cs (Populate): Verify that we dont get null return
30122 values. TODO: Check for AsAccessible.
30124 * cs-parser.jay: Use basename to emit error 574 (destructor should
30125 have the same name as container class), not the full name.
30127 * cs-tokenizer.cs (adjust_int): Fit the integer in the best
30128 possible representation.
30130 Also implements integer type suffixes U and L.
30132 2001-12-15 Miguel de Icaza <miguel@ximian.com>
30134 * expression.cs (ArrayCreation.DoResolve): We need to do the
30135 argument resolution *always*.
30137 * decl.cs: Make this hold the namespace. Hold the root context as
30139 (LookupType): Move here.
30141 * enum.cs, class.cs, interface.cs: Adapt to new hierarchy.
30143 * location.cs (Row, Name): Fixed the code, it was always returning
30144 references to the first file.
30146 * interface.cs: Register properties defined through interfaces.
30148 * driver.cs: Add support for globbing on the command line
30150 * class.cs (Field): Make it derive from MemberCore as well.
30153 2001-12-15 Ravi Pratap <ravi@ximian.com>
30155 * class.cs (Event::Define): Check that the type of the event is a delegate
30156 type else flag error #66.
30158 Also, re-use TypeContainer.MethodModifiersValid here too as the rules are the
30161 * attribute.cs (DefinePInvokeMethod): Handle named arguments and process
30162 values of EntryPoint, CharSet etc etc.
30164 Pass in the values to TypeBuilder.DefinePInvokeMethod; determine Type etc neatly.
30166 * class.cs (FindMembers): If a method is in transit, its MethodBuilder will
30167 be null and we should ignore this. I am not sure if this is really clean. Apparently,
30168 there's no way of avoiding hitting this because the call is coming from SimpleName.DoResolve,
30169 which needs this to do its work.
30171 * ../errors/cs0066.cs : Add.
30173 2001-12-14 Miguel de Icaza <miguel@ximian.com>
30175 * typemanager.cs: (GetPropertyGetter, GetPropertyGetter): New
30178 * class.cs: (MethodSignature.MethodSignature): Removed hack that
30179 clears out the parameters field.
30180 (MemberSignatureCompare): Cleanup
30182 (MemberCore): New base class used to share code between MethodCore
30185 (RegisterRequiredImplementations) BindingFlags.Public requires
30186 either BindingFlags.Instace or Static. Use instance here.
30188 (Property): Refactored code to cope better with the full spec.
30190 * parameter.cs (GetParameterInfo): Return an empty array instead
30193 * class.cs (Property): Abstract or extern properties have no bodies.
30195 * parameter.cs (GetParameterInfo): return a zero-sized array.
30197 * class.cs (TypeContainer.MethodModifiersValid): Move all the
30198 method modifier validation to the typecontainer so we can reuse
30199 this on properties.
30201 (MethodCore.ParameterTypes): return an empty sized array of types.
30203 (Property.Define): Test property modifier validity.
30205 Add tests for sealed/override too.
30207 (Method.Emit): abstract or extern methods have no bodies.
30209 2001-12-14 Ravi Pratap <ravi@ximian.com>
30211 * class.cs (Method.IsPInvoke): Get rid of it as it is an expensive
30214 (Method::Define, ::Emit): Modify accordingly.
30216 * expression.cs (Invocation::OverloadResolve): Handle error # 121.
30218 (ArrayCreation::MakeByteBlob): Handle floats and doubles.
30220 * makefile: Pass in /unsafe.
30222 2001-12-13 Miguel de Icaza <miguel@ximian.com>
30224 * class.cs (MakeKey): Kill routine.
30226 * class.cs (TypeContainer.Define): Correctly define explicit
30227 method implementations (they require the full interface name plus
30230 * typemanager.cs: Deply the PtrHashtable here and stop using the
30231 lame keys. Things work so much better.
30233 This of course broke everyone who depended on `RegisterMethod' to
30234 do the `test for existance' test. This has to be done elsewhere.
30236 * support.cs (PtrHashtable): A hashtable that avoid comparing with
30237 the object stupid Equals method (because, that like fails all over
30238 the place). We still do not use it.
30240 * class.cs (TypeContainer.SetRequiredInterface,
30241 TypeContainer.RequireMethods): Killed these two routines and moved
30242 all the functionality to RegisterRequiredImplementations.
30244 (TypeContainer.RegisterRequiredImplementations): This routine now
30245 registers all the implementations required in an array for the
30246 interfaces and abstract methods. We use an array of structures
30247 which can be computed ahead of time to reduce memory usage and we
30248 also assume that lookups are cheap as most classes will not
30249 implement too many interfaces.
30251 We also avoid creating too many MethodSignatures.
30253 (TypeContainer.IsInterfaceMethod): Update and optionally does not
30254 clear the "pending" bit if we find that there are problems with
30257 (TypeContainer.VerifyPendingMethods): Update to report errors of
30258 methods that look like implementations but are not.
30260 (TypeContainer.Define): Add support for explicit interface method
30263 2001-12-12 Miguel de Icaza <miguel@ximian.com>
30265 * typemanager.cs: Keep track of the parameters here instead of
30266 being a feature of the TypeContainer.
30268 * class.cs: Drop the registration of parameters here, as
30269 InterfaceMethods are also interface declarations.
30271 * delegate.cs: Register methods with the TypeManager not only with
30272 the TypeContainer. This code was buggy.
30274 * interface.cs: Full registation here.
30276 2001-12-11 Miguel de Icaza <miguel@ximian.com>
30278 * expression.cs: Remove reducer for binary expressions, it can not
30281 * const.cs: Put here the code that used to go into constant.cs
30283 * constant.cs: Put here the code for constants, this is a new base
30284 class for Literals.
30286 * literal.cs: Make Literal derive from Constant.
30288 2001-12-09 Miguel de Icaza <miguel@ximian.com>
30290 * statement.cs (Return.Emit): Report error 157 if the user
30291 attempts to return from a finally block.
30293 (Return.Emit): Instead of emitting a return, jump to the end of
30296 * codegen.cs (EmitContext): ReturnValue, ReturnLabel: new
30297 LocalBuilder to store the result of the function. ReturnLabel is
30298 the target where we jump.
30301 2001-12-09 Radek Doulik <rodo@ximian.com>
30303 * cs-parser.jay: remember alias in current namespace
30305 * ecore.cs (SimpleName::DoResolve): use aliases for types or
30308 * class.cs (LookupAlias): lookup alias in my_namespace
30310 * namespace.cs (UsingAlias): add alias, namespace_or_type pair to
30312 (LookupAlias): lookup alias in this and if needed in parent
30315 2001-12-08 Miguel de Icaza <miguel@ximian.com>
30319 * rootcontext.cs: (ModuleBuilder) Made static, first step into
30320 making things static. I need this to avoid passing the
30321 TypeContainer when calling ParameterType.
30323 * support.cs (InternalParameters.ParameterType): Remove ugly hack
30324 that did string manipulation to compute the type and then call
30325 GetType. Use Parameter.ParameterType instead.
30327 * cs-tokenizer.cs: Consume the suffix for floating values.
30329 * expression.cs (ParameterReference): figure out whether this is a
30330 reference parameter or not. Kill an extra variable by computing
30331 the arg_idx during emission.
30333 * parameter.cs (Parameters.GetParameterInfo): New overloaded
30334 function that returns whether a parameter is an out/ref value or not.
30336 (Parameter.ParameterType): The type of the parameter (base,
30337 without ref/out applied).
30339 (Parameter.Resolve): Perform resolution here.
30340 (Parameter.ExternalType): The full type (with ref/out applied).
30342 * statement.cs (Using.Emit, Using.EmitExpression): Implement
30343 support for expressions on the using statement.
30345 2001-12-07 Miguel de Icaza <miguel@ximian.com>
30347 * statement.cs (Using.EmitLocalVariableDecls): Split the
30348 localvariable handling of the using statement.
30350 (Block.EmitMeta): Keep track of variable count across blocks. We
30351 were reusing slots on separate branches of blocks.
30353 (Try.Emit): Emit the general code block, we were not emitting it.
30355 Check the type of the declaration to be an IDisposable or
30356 something that can be implicity converted to it.
30358 Emit conversions if required.
30360 * ecore.cs (EmptyExpression): New utility class.
30361 (Expression.ImplicitConversionExists): New utility function.
30363 2001-12-06 Miguel de Icaza <miguel@ximian.com>
30365 * statement.cs (Using): Implement.
30367 * expression.cs (LocalVariableReference): Support read only variables.
30369 * statement.cs: Remove the explicit emit for the Leave opcode.
30370 (VariableInfo): Add a readonly field.
30372 2001-12-05 Miguel de Icaza <miguel@ximian.com>
30374 * ecore.cs (ConvCast): new class used to encapsulate the various
30375 explicit integer conversions that works in both checked and
30376 unchecked contexts.
30378 (Expression.ConvertNumericExplicit): Use new ConvCast class to
30379 properly generate the overflow opcodes.
30381 2001-12-04 Miguel de Icaza <miguel@ximian.com>
30383 * statement.cs: The correct type for the EmptyExpression is the
30384 element_type, not the variable type. Ravi pointed this out.
30386 2001-12-04 Ravi Pratap <ravi@ximian.com>
30388 * class.cs (Method::Define): Handle PInvoke methods specially
30389 by using DefinePInvokeMethod instead of the usual one.
30391 * attribute.cs (DefinePInvokeMethod): Implement as this is what is called
30392 above to do the task of extracting information and defining the method.
30394 2001-12-04 Ravi Pratap <ravi@ximian.com>
30396 * expression.cs (ArrayCreation::EmitStaticInitializers): Get rid
30397 of the condition for string type.
30399 (Emit): Move that here.
30401 (ArrayCreation::CheckIndices): Keep string literals in their expression
30404 (EmitDynamicInitializers): Handle strings appropriately.
30406 2001-12-04 Miguel de Icaza <miguel@ximian.com>
30408 * codegen.cs (EmitContext): Replace multiple variables with a
30409 single pointer to the current Switch statement.
30411 * statement.cs (GotoDefault, Switch): Adjust to cleaned up
30414 2001-12-03 Miguel de Icaza <miguel@ximian.com>
30418 * statement.cs (GotoDefault), cs-parser.jay: Implement `goto
30421 (Foreach.Emit): Foreach on arrays was not setting
30422 up the loop variables (for break/continue).
30424 (GotoCase): Semi-implented.
30426 2001-12-03 Ravi Pratap <ravi@ximian.com>
30428 * attribute.cs (CheckAttribute): Handle system attributes by using
30429 Attribute.GetAttributes to examine information we need.
30431 (GetValidPlaces): Same here.
30433 * class.cs (Method::Define): Catch invalid use of extern and abstract together.
30435 * typemanager.cs (dllimport_type): Core type for System.DllImportAttribute.
30437 * class.cs (Method.IsPinvoke): Used to determine if we are a PInvoke method.
30439 (Method::Define): Set appropriate flags if we have a DllImport attribute.
30441 (Method::Emit): Handle the case when we are a PInvoke method.
30443 2001-12-03 Miguel de Icaza <miguel@ximian.com>
30445 * expression.cs: Use ResolveWithSimpleName on compound names.
30447 2001-12-02 Ravi Pratap <ravi@ximian.com>
30449 * constant.cs (EmitConstant): Make sure we resolve the associated expression
30450 before trying to reduce it.
30452 * typemanager.cs (RegisterConstant, LookupConstant): Implement.
30454 * constant.cs (LookupConstantValue): Implement.
30456 (EmitConstant): Use the above in emitting the constant.
30458 * expression.cs (MemberAccess::ResolveMemberAccess): Handle constants
30459 that are user-defined by doing a LookupConstantValue on them.
30461 (SimpleName::DoResolve): When we have a FieldExpr, cope with constants
30464 2001-11-29 Miguel de Icaza <miguel@ximian.com>
30466 * expression.cs (BaseAccess, BaseIndexer): Also split this out.
30468 (BaseAccess.DoResolve): Implement.
30470 (MemberAccess.DoResolve): Split this routine into a
30471 ResolveMemberAccess routine that can be used independently
30473 2001-11-28 Miguel de Icaza <miguel@ximian.com>
30475 * expression.cs (Probe, Is, As): Split Probe in two classes Is and
30476 As that share bits of the implementation. Is returns a boolean,
30477 while As returns the Type that is being probed.
30479 2001-12-01 Ravi Pratap <ravi@ximian.com>
30481 * enum.cs (LookupEnumValue): Re-write various bits, return an object value
30482 instead of a Literal - much easier.
30484 (EnumInTransit): Remove - utterly useless :-)
30486 (Populate): Re-write bits - remove duplicate code etc. The code is much neater now.
30488 * expression.cs (MemberLookup): Cope with user-defined enums when they are in transit.
30490 * enum.cs (LookupEnumValue): Auto-compute next values by going down the dependency
30491 chain when we have no associated expression.
30493 2001-11-30 Ravi Pratap <ravi@ximian.com>
30495 * constant.cs (Define): Use Location while reporting the errror.
30497 Also emit a warning when 'new' is used and there is no inherited
30500 * enum.cs (EnumInTransit): Used to tell if an enum type is in the process of being
30503 (LookupEnumValue): Implement to lookup an enum member's value and define it
30506 (Populate): Re-write accordingly to use the above routine.
30508 2001-11-27 Miguel de Icaza <miguel@ximian.com>
30510 * expression.cs (This): Fix prototype for DoResolveLValue to
30511 override the base class DoResolveLValue.
30513 * cs-parser.cs: Report errors cs574 and cs575 (destructor
30516 * ecore.cs (FieldExpr.EmitAssign): Handle value types specially
30517 (we need to load the address of the field here). This fixes
30520 (FieldExpr.DoResolveLValue): Call the DoResolve
30521 function to initialize the Instance expression.
30523 * statement.cs (Foreach.Emit): Fix the bug where we did not invoke
30524 correctly the GetEnumerator operation on a value type.
30526 * cs-parser.jay: Add more simple parsing error catches.
30528 * statement.cs (Switch): Add support for string switches.
30529 Handle null specially.
30531 * literal.cs (NullLiteral): Make NullLiteral objects singletons.
30533 2001-11-28 Ravi Pratap <ravi@ximian.com>
30535 * cs-parser.jay (local_constant_declaration): Use declare_local_constant.
30537 (declare_local_constant): New helper function.
30539 * statement.cs (AddConstant): Keep a separate record of constants
30541 (IsConstant): Implement to determine if a variable is a constant.
30543 (GetConstantExpression): Implement.
30545 * expression.cs (LocalVariableReference): Handle the case when it is a constant.
30547 * statement.cs (IsVariableDefined): Re-write.
30549 2001-11-27 Ravi Pratap <ravi@ximian.com>
30551 * class.cs (TypeContainer::FindMembers): Look for constants
30552 in the case when we are looking for MemberTypes.Field
30554 * expression.cs (MemberAccess::DoResolve): Check that in the
30555 case we are a FieldExpr and a Literal, we are not being accessed
30556 by an instance reference.
30558 * cs-parser.jay (local_constant_declaration): Implement.
30560 (declaration_statement): Implement for constant declarations.
30562 2001-11-26 Miguel de Icaza <miguel@ximian.com>
30564 * statement.cs (Switch): Catch double defaults.
30566 (Switch): More work on the switch() statement
30567 implementation. It works for integral values now, need to finish
30571 2001-11-24 Miguel de Icaza <miguel@ximian.com>
30573 * ecore.cs (Expression.ConvertIntLiteral): New function to convert
30574 integer literals into other integer literals. To be used by
30577 2001-11-24 Ravi Pratap <ravi@ximian.com>
30579 * expression.cs (ArrayCreation): Get rid of ArrayExprs : we save
30582 (EmitDynamicInitializers): Cope with the above since we extract data
30583 directly from ArrayData now.
30585 (ExpectInitializers): Keep track of whether initializers are mandatory
30588 (Bounds): Make it a hashtable to prevent the same dimension being
30589 recorded for every element in that dimension.
30591 (EmitDynamicInitializers): Fix bug which prevented the Set array method
30594 Also fix bug which was causing the indices to be emitted in the reverse
30597 2001-11-24 Miguel de Icaza <miguel@ximian.com>
30599 * expression.cs (ArrayCreation): Implement the bits that Ravi left
30600 unfinished. They do not work, because the underlying code is
30603 2001-11-22 Miguel de Icaza <miguel@ximian.com>
30605 * cs-parser.jay: Remove bogus fixme.
30607 * statement.cs (Switch, SwitchSection, SwithLabel): Started work
30608 on Switch statement.
30610 2001-11-23 Ravi Pratap <ravi@ximian.com>
30612 * typemanager.cs (IsDelegateType, IsEnumType): Fix logic to determine
30615 * expression.cs (ArrayCreation::CheckIndices): Get rid of the require_constant
30616 parameter. Apparently, any expression is allowed.
30618 (ValidateInitializers): Update accordingly.
30620 (CheckIndices): Fix some tricky bugs thanks to recursion.
30622 * delegate.cs (NewDelegate::DoResolve): Re-write large portions as
30623 I was being completely brain-dead.
30625 (VerifyMethod, VerifyApplicability, VerifyDelegate): Make static
30626 and re-write acordingly.
30628 (DelegateInvocation): Re-write accordingly.
30630 * expression.cs (ArrayCreation::Emit): Handle string initialization separately.
30632 (MakeByteBlob): Handle types more correctly.
30634 * expression.cs (ArrayCreation:Emit): Write preliminary code to do
30635 initialization from expressions but it is incomplete because I am a complete
30638 2001-11-22 Miguel de Icaza <miguel@ximian.com>
30640 * statement.cs (If.Emit): Fix a bug that generated incorrect code
30641 on If. Basically, we have to return `true' (ie, we do return to
30642 our caller) only if both branches of the if return.
30644 * expression.cs (Binary.Emit): LogicalOr and LogicalAnd are
30645 short-circuit operators, handle them as short circuit operators.
30647 (Cast.DoResolve): Resolve type.
30648 (Cast.Cast): Take an expression as the target type.
30650 * cs-parser.jay (cast_expression): Remove old hack that only
30651 allowed a limited set of types to be handled. Now we take a
30652 unary_expression and we resolve to a type during semantic
30655 Use the grammar productions from Rhys to handle casts (this is
30656 not complete like Rhys syntax yet, we fail to handle that corner
30657 case that C# has regarding (-x), but we will get there.
30659 2001-11-22 Ravi Pratap <ravi@ximian.com>
30661 * class.cs (EmitFieldInitializer): Take care of the case when we have a
30662 field which is an array type.
30664 * cs-parser.jay (declare_local_variables): Support array initialization too.
30666 * typemanager.cs (MakeKey): Implement.
30668 (everywhere): Use the above appropriately.
30670 * cs-parser.jay (for_statement): Update for array initialization while
30671 declaring variables.
30673 * ecore.cs : The error message was correct, it's the variable's names that
30674 were misleading ;-) Make the code more readable.
30676 (MemberAccess::DoResolve): Fix the code which handles Enum literals to set
30677 the correct type etc.
30679 (ConvertExplicit): Handle Enum types by examining the underlying type.
30681 2001-11-21 Ravi Pratap <ravi@ximian.com>
30683 * parameter.cs (GetCallingConvention): Always return
30684 CallingConventions.Standard for now.
30686 2001-11-22 Miguel de Icaza <miguel@ximian.com>
30688 * expression.cs (Binary.ResolveOperator): Update the values of `l'
30689 and `r' after calling DoNumericPromotions.
30691 * ecore.cs: Fix error message (the types were in the wrong order).
30693 * statement.cs (Foreach.ProbeCollectionType): Need to pass
30694 BindingFlags.Instance as well
30696 * ecore.cs (Expression.TryImplicitIntConversion): Wrap the result
30697 implicit int literal conversion in an empty cast so that we
30698 propagate the right type upstream.
30700 (UnboxCast): new class used to unbox value types.
30701 (Expression.ConvertExplicit): Add explicit type conversions done
30704 (Expression.ImplicitNumericConversion): Oops, forgot to test for
30705 the target type before applying the implicit LongLiterals to ULong
30708 2001-11-21 Miguel de Icaza <miguel@ximian.com>
30710 * cs-parser.jay (for_statement): Reworked the way For works: now
30711 we declare manually any variables that are introduced in
30712 for_initializer to solve the problem of having out-of-band code
30713 emition (that is what got for broken).
30715 (declaration_statement): Perform the actual variable declaration
30716 that used to be done in local_variable_declaration here.
30718 (local_variable_declaration): Do not declare anything, just pass
30719 the information on a DictionaryEntry
30721 2001-11-20 Ravi Pratap <ravi@ximian.com>
30723 * expression.cs (ArrayCreation::CheckIndices): The story continues :-) Complete
30724 re-write of the logic to now make it recursive.
30726 (UpdateIndices): Re-write accordingly.
30728 Store element data in a separate ArrayData list in the above methods.
30730 (MakeByteBlob): Implement to dump the array data into a byte array.
30732 2001-11-19 Ravi Pratap <ravi@ximian.com>
30734 * expression.cs (ArrayCreation): Factor out some code from ValidateInitializers
30737 * constant.cs (Define): Implement.
30739 (EmitConstant): Re-write fully.
30741 Pass in location info.
30743 * class.cs (Populate, Emit): Call Constant::Define and Constant::EmitConstant
30746 * cs-parser.jay (constant_declarator): Use VariableDeclaration instead of
30747 DictionaryEntry since we need location info too.
30749 (constant_declaration): Update accordingly.
30751 * expression.cs (ArrayCreation): Make ValidateInitializers simpler by factoring
30752 code into another method : UpdateIndices.
30754 2001-11-18 Ravi Pratap <ravi@ximian.com>
30756 * expression.cs (ArrayCreation::ValidateInitializers): Update to perform
30757 some type checking etc.
30759 2001-11-17 Ravi Pratap <ravi@ximian.com>
30761 * expression.cs (ArrayCreation::ValidateInitializers): Implement
30762 bits to provide dimension info if the user skips doing that.
30764 Update second constructor to store the rank correctly.
30766 2001-11-16 Ravi Pratap <ravi@ximian.com>
30768 * expression.cs (ArrayCreation::ValidateInitializers): Poke around
30769 and try to implement.
30771 * ../errors/cs0150.cs : Add.
30773 * ../errors/cs0178.cs : Add.
30775 2001-11-16 Miguel de Icaza <miguel@ximian.com>
30777 * statement.cs: Implement foreach on multi-dimensional arrays.
30779 * parameter.cs (Parameters.GetParameterByName): Also lookup the
30780 name of the params argument.
30782 * expression.cs: Use EmitStoreOpcode to get the right opcode while
30783 initializing the array.
30785 (ArrayAccess.EmitStoreOpcode): move the opcode generation here, so
30786 we can use this elsewhere.
30788 * statement.cs: Finish implementation of foreach for single
30791 * cs-parser.jay: Use an out-of-band stack to pass information
30792 around, I wonder why I need this.
30794 foreach_block: Make the new foreach_block the current_block.
30796 * parameter.cs (Parameters.GetEmptyReadOnlyParameters): New
30797 function used to return a static Parameters structure. Used for
30798 empty parameters, as those are created very frequently.
30800 * cs-parser.jay, class.cs: Use GetEmptyReadOnlyParameters
30802 2001-11-15 Ravi Pratap <ravi@ximian.com>
30804 * interface.cs : Default modifier is private, not public. The
30805 make verify test passes again.
30807 2001-11-15 Ravi Pratap <ravi@ximian.com>
30809 * support.cs (ReflectionParameters): Fix logic to determine
30810 whether the last parameter is a params one. Test 9 passes again.
30812 * delegate.cs (Populate): Register the builders we define with
30813 RegisterParameterForBuilder. Test 19 passes again.
30815 * cs-parser.jay (property_declaration): Reference $6 instead
30816 of $$ to get at the location.
30818 (indexer_declaration): Similar stuff.
30820 (attribute): Ditto.
30822 * class.cs (Property): Register parameters for the Get and Set methods
30823 if they exist. Test 23 passes again.
30825 * expression.cs (ArrayCreation::Emit): Pass null for the method in the
30826 call to EmitArguments as we are sure there aren't any params arguments.
30827 Test 32 passes again.
30829 * suppor.cs (ParameterDesc, ParameterModifier): Fix trivial bug causing
30830 IndexOutOfRangeException.
30832 * class.cs (Property::Define): Register property using TypeManager.RegisterProperty
30833 Test 33 now passes again.
30835 2001-11-15 Miguel de Icaza <miguel@ximian.com>
30837 * cs-parser.jay: Kill horrendous hack ($??? = lexer.Location) that
30838 broke a bunch of things. Will have to come up with a better way
30839 of tracking locations.
30841 * statement.cs: Implemented foreach for single dimension arrays.
30843 2001-11-09 Miguel de Icaza <miguel@ximian.com>
30845 * enum.cs (Enum.Emit): Delay the lookup of loc until we run into
30846 an error. This removes the lookup from the critical path.
30848 * cs-parser.jay: Removed use of temporary_loc, which is completely
30851 2001-11-14 Miguel de Icaza <miguel@ximian.com>
30853 * support.cs (ReflectionParameters.ParameterModifier): Report
30854 whether the argument is a PARAMS argument or not.
30856 * class.cs: Set the attribute `ParamArrayAttribute' on the
30857 parameter argument.
30859 * typemanager.cs: Define param_array_type (ParamArrayAttribute)
30860 and cons_param_array_attribute (ConstructorInfo for
30861 ParamArrayAttribute).,
30863 * codegen.cs: Emit the return using the `Return' statement, that
30864 way we can report the error correctly for missing return values.
30866 * class.cs (Method.Emit): Clean up.
30868 * expression.cs (Argument.Resolve): Take another argument: the
30869 location where this argument is used. Notice that this is not
30870 part of the "Argument" class as to reduce the size of the
30871 structure (we know the approximate location anyways).
30873 Test if the argument is a variable-reference, if not, then
30874 complain with a 206.
30876 (Argument.Emit): Emit addresses of variables.
30878 (Argument.FullDesc): Simplify.
30880 (Invocation.DoResolve): Update for Argument.Resolve.
30882 (ElementAccess.DoResolve): ditto.
30884 * delegate.cs (DelegateInvocation.Emit): Invocation of Invoke
30885 method should be virtual, as this method is always virtual.
30887 (NewDelegate.DoResolve): Update for Argument.Resolve.
30889 * class.cs (ConstructorInitializer.DoResolve): ditto.
30891 * attribute.cs (Attribute.Resolve): ditto.
30893 2001-11-13 Miguel de Icaza <miguel@ximian.com>
30895 * statement.cs (Foreach.Emit): Use EmitAssign instead of Store.
30897 * expression.cs (ParameterReference): Drop IStackStorage and implement
30898 IAssignMethod instead.
30900 (LocalVariableReference): ditto.
30902 * ecore.cs (FieldExpr): Drop IStackStorage and implement
30903 IAssignMethod instead.
30905 2001-11-13 Miguel de Icaza <miguel@ximian.com>
30907 * parameter.cs, expression.cs, class.cs, ecore.cs: Made all
30908 enumerations that are used in heavily used structures derive from
30909 byte in a laughable and pathetic attempt to reduce memory usage.
30910 This is the kind of pre-optimzations that you should not do at
30911 home without adult supervision.
30913 * expression.cs (UnaryMutator): New class, used to handle ++ and
30914 -- separatedly from the other unary operators. Cleans up the
30915 code, and kills the ExpressionStatement dependency in Unary.
30917 (Unary): Removed `method' and `Arguments' from this class, making
30918 it smaller, and moving it all to SimpleCall, so I can reuse this
30919 code in other locations and avoid creating a lot of transient data
30920 strucutres when not required.
30922 * cs-parser.jay: Adjust for new changes.
30924 2001-11-11 Miguel de Icaza <miguel@ximian.com>
30926 * enum.cs (Enum.Populate): If there is a failure during
30929 * cs-parser.jay (opt_enum_base): we used to catch type errors
30930 here, but this is really incorrect. The type error should be
30931 catched during semantic analysis.
30933 2001-12-11 Ravi Pratap <ravi@ximian.com>
30935 * cs-parser.jay (operator_declarator, conversion_operator_declarator): Set
30936 current_local_parameters as expected since I, in my stupidity, had forgotten
30939 * attribute.cs (GetValidPlaces): Fix stupid bug.
30941 * class.cs (Method::Emit): Perform check on applicability of attributes.
30943 (Constructor::Emit): Ditto.
30945 (Field::Emit): Ditto.
30947 (Field.Location): Store location information.
30949 (Property, Event, Indexer, Operator): Ditto.
30951 * cs-parser.jay (field_declaration): Pass in location for each field.
30953 * ../errors/cs0592.cs : Add.
30955 2001-11-12 Ravi Pratap <ravi@ximian.com>
30957 * typemanager.cs (attribute_usage_type): New static member for System.AttributeUsage.
30959 (InitCoreTypes): Update accordingly.
30961 (RegisterAttrType, LookupAttr): Implement.
30963 * attribute.cs (Attribute.Targets, AllowMultiple, Inherited): New fields to hold
30964 info about the same.
30966 (Resolve): Update to populate the above as necessary.
30968 (Error592): Helper.
30970 (GetValidPlaces): Helper to the above.
30972 (CheckAttribute): Implement to perform validity of attributes on declarative elements.
30974 * class.cs (TypeContainer::Emit): Update attribute emission code to perform checking etc.
30976 2001-11-12 Ravi Pratap <ravi@ximian.com>
30978 * attribute.cs (Attribute::Resolve): Expand to handle named arguments too.
30980 * ../errors/cs0617.cs : Add.
30982 2001-11-11 Ravi Pratap <ravi@ximian.com>
30984 * enum.cs (Emit): Rename to Populate to be more consistent with what
30985 we expect it to do and when exactly it is called.
30987 * class.cs, rootcontext.cs : Update accordingly.
30989 * typemanager.cs (RegisterField, GetValue): Workarounds for the fact that
30990 FieldInfo.GetValue does not work on dynamic types ! S.R.E lameness strikes again !
30992 * enum.cs (Populate): Register fields with TypeManager.RegisterField.
30994 * expression.cs (MemberAccess.DoResolve): Adjust code to obtain the value
30995 of a fieldinfo using the above, when dealing with a FieldBuilder.
30997 2001-11-10 Ravi Pratap <ravi@ximian.com>
30999 * ../errors/cs0031.cs : Add.
31001 * ../errors/cs1008.cs : Add.
31003 * ../errrors/cs0543.cs : Add.
31005 * enum.cs (DefineEnum): Check the underlying type and report an error if not a valid
31008 (FindMembers): Implement.
31010 * typemanager.cs (FindMembers): Re-write to call the appropriate methods for
31011 enums and delegates too.
31013 (enum_types): Rename to builder_to_enum.
31015 (delegate_types): Rename to builder_to_delegate.
31017 * delegate.cs (FindMembers): Implement.
31019 2001-11-09 Ravi Pratap <ravi@ximian.com>
31021 * typemanager.cs (IsEnumType): Implement.
31023 * enum.cs (Emit): Re-write parts to account for the underlying type
31024 better and perform checking etc.
31026 (GetNextDefaultValue): Helper to ensure we don't overshoot max value
31027 of the underlying type.
31029 * literal.cs (GetValue methods everywhere): Perform bounds checking and return
31032 * enum.cs (error31): Helper to report error #31.
31034 * cs-parser.jay (enum_declaration): Store location of each member too.
31036 * enum.cs (member_to_location): New hashtable.
31038 (AddEnumMember): Update location hashtable.
31040 (Emit): Use the location of each member while reporting errors.
31042 2001-11-09 Miguel de Icaza <miguel@ximian.com>
31044 * cs-parser.jay: A for_initializer if is a
31045 local_variable_declaration really ammount to have an implicit
31046 block with the variable declaration and no initializer for for.
31048 * statement.cs (For.Emit): Cope with null initializers.
31050 This fixes the infinite loop on for initializers.
31052 2001-11-08 Miguel de Icaza <miguel@ximian.com>
31054 * enum.cs: More cleanup.
31056 * ecore.cs: Remove dead code.
31058 * class.cs (Property.Emit): More simplification.
31059 (Event.Emit): ditto.
31061 Reworked to have less levels of indentation.
31063 2001-11-08 Ravi Pratap <ravi@ximian.com>
31065 * class.cs (Property): Emit attributes.
31075 * enum.cs (Emit): Ditto.
31077 * rootcontext.cs (ResolveTree, EmitCode, CloseTypes): Do the same for
31080 * class.cs (Field, Event, etc.): Move attribute generation into the
31081 Emit method everywhere.
31083 * enum.cs (Enum): Revamp to use the same definition semantics as delegates so
31084 we have a DefineEnum, CloseEnum etc. The previous way of doing things was not right
31085 as we had no way of defining nested enums !
31087 * rootcontext.cs : Adjust code accordingly.
31089 * typemanager.cs (AddEnumType): To keep track of enum types separately.
31091 2001-11-07 Ravi Pratap <ravi@ximian.com>
31093 * expression.cs (EvalConstantExpression): Move into ecore.cs
31095 * enum.cs (Enum): Rename some members and make them public and readonly
31096 according to our convention.
31098 * modifiers.cs (EnumAttr): Implement as we need to set only visibility flags,
31101 * enum.cs (Enum::Define): Use the above instead of TypeAttr.
31103 (Enum::Emit): Write a simple version for now which doesn't try to compute
31104 expressions. I shall modify this to be more robust in just a while.
31106 * class.cs (TypeContainer::Emit): Make sure we include Enums too.
31108 (TypeContainer::CloseType): Create the Enum types too.
31110 * attribute.cs (Resolve): Use the new Reduce method instead of EvalConstantExpression.
31112 * expression.cs (EvalConstantExpression): Get rid of completely.
31114 * enum.cs (Enum::Emit): Use the new expression reducer. Implement assigning
31115 user-defined values and other cases.
31117 (IsValidEnumLiteral): Helper function.
31119 * expression.cs (ExprClassfromMemberInfo): Modify to not do any literalizing
31120 out there in the case we had a literal FieldExpr.
31122 (MemberAccess:DoResolve): Do the literalizing of the FieldExpr here.
31124 (Literalize): Revamp a bit to take two arguments.
31126 (EnumLiteral): New class which derives from Literal to wrap enum literals.
31128 2001-11-06 Ravi Pratap <ravi@ximian.com>
31130 * cs-parser.jay (compilation_unit): Remove extra opt_attributes for now.
31132 * expression.cs (ArrayCreation::ValidateInitializers): Implement.
31134 (Resolve): Use the above to ensure we have proper initializers.
31136 2001-11-05 Ravi Pratap <ravi@ximian.com>
31138 * expression.cs (Expression::EvalConstantExpression): New method to
31139 evaluate constant expressions.
31141 * attribute.cs (Attribute::Resolve): Modify bits to use the above function.
31143 2001-11-07 Miguel de Icaza <miguel@ximian.com>
31145 * expression.cs (ArrayCreation.Emit): Some bits to initialize data
31148 (Binary.ResolveOperator): Handle operator != (object a, object b)
31149 and operator == (object a, object b);
31151 (Binary.DoNumericPromotions): Indicate whether the numeric
31152 promotion was possible.
31154 (ArrayAccess.DoResolve, ArrayAccess.Emit, ArrayAccess.EmitAssign):
31157 Made the ArrayAccess implement interface IAssignMethod instead of
31158 IStackStore as the order in which arguments are passed reflects
31161 * assign.cs: Instead of using expr.ExprClass to select the way of
31162 assinging, probe for the IStackStore/IAssignMethod interfaces.
31164 * typemanager.cs: Load InitializeArray definition.
31166 * rootcontext.cs (RootContext.MakeStaticData): Used to define
31167 static data that can be used to initialize arrays.
31169 2001-11-05 Miguel de Icaza <miguel@ximian.com>
31171 * expression.cs: Handle operator== and operator!= for booleans.
31173 (Conditioal.Reduce): Implement reducer for the ?: operator.
31175 (Conditional.Resolve): Implement dead code elimination.
31177 (Binary.Resolve): Catch string literals and return a new
31178 concatenated string.
31180 (Unary.Reduce): Implement reduction of unary expressions.
31182 * ecore.cs: Split out the expression core handling here.
31184 (Expression.Reduce): New method used to perform constant folding
31185 and CSE. This is needed to support constant-expressions.
31187 * statement.cs (Statement.EmitBoolExpression): Pass true and false
31188 targets, and optimize for !x.
31190 2001-11-04 Ravi Pratap <ravi@ximian.com>
31192 * attribute.cs (Attribute::Resolve): Implement guts. Note that resolution
31193 of an attribute gives us a CustomAttributeBuilder which we use accordingly to
31194 set custom atttributes.
31196 * literal.cs (Literal::GetValue): New abstract method to return the actual
31197 value of the literal, cast as an object.
31199 (*Literal): Implement GetValue method.
31201 * cs-parser.jay (positional_argument_list, named_argument_list): Add not just plain
31202 expressions to the arraylist but objects of type Argument.
31204 * class.cs (TypeContainer::Emit): Emit our attributes too.
31206 (Method::Emit, Constructor::Emit): Ditto.
31208 * cs-parser.jay (constructor_declaration): Set attributes too, which we seemed
31209 to be ignoring earlier.
31211 2001-11-03 Ravi Pratap <ravi@ximian.com>
31213 * attribute.cs (AttributeSection::Define): Implement to do the business
31214 of constructing a CustomAttributeBuilder.
31216 (Attribute): New trivial class. Increases readability of code.
31218 * cs-parser.jay : Update accordingly.
31220 (positional_argument_list, named_argument_list, named_argument): New rules
31222 (attribute_arguments): Use the above so that we are more correct.
31224 2001-11-02 Ravi Pratap <ravi@ximian.com>
31226 * expression.cs (Invocation::IsParamsMethodApplicable): Implement
31227 to perform all checks for a method with a params parameter.
31229 (Invocation::OverloadResolve): Update to use the above method and therefore
31230 cope correctly with params method invocations.
31232 * support.cs (InternalParameters::ParameterDesc): Provide a desc for
31235 * class.cs (ConstructorInitializer::Resolve): Make sure we look for Non-public
31236 constructors in our parent too because we can't afford to miss out on
31239 * attribute.cs (AttributeSection): New name for the class Attribute
31241 Other trivial changes to improve readability.
31243 * cs-parser.jay (opt_attributes, attribute_section etc.): Modify to
31244 use the new class names.
31246 2001-11-01 Ravi Pratap <ravi@ximian.com>
31248 * class.cs (Method::Define): Complete definition for params types too
31250 (Indexer::Define): Ditto.
31252 * support.cs (InternalParameters::ParameterType, ParameterDesc, ParameterModifier):
31253 Cope everywhere with a request for info about the array parameter.
31255 2001-11-01 Ravi Pratap <ravi@ximian.com>
31257 * tree.cs (RecordNamespace): Fix up to check for the correct key.
31259 * cs-parser.jay (GetQualifiedIdentifier): New Helper method used in
31260 local_variable_type to extract the string corresponding to the type.
31262 (local_variable_type): Fixup the action to use the new helper method.
31264 * codegen.cs : Get rid of RefOrOutParameter, it's not the right way to
31267 * expression.cs : Clean out code which uses the above.
31269 2001-10-31 Ravi Pratap <ravi@ximian.com>
31271 * typemanager.cs (RegisterMethod): Check if we already have an existing key
31272 and bale out if necessary by returning a false.
31274 (RegisterProperty): Ditto.
31276 * class.cs (everywhere): Check the return value from TypeManager.RegisterMethod
31277 and print out appropriate error messages.
31279 * interface.cs (everywhere): Ditto.
31281 * cs-parser.jay (property_declaration, event_declaration, indexer_declaration): Pass
31282 location to constructor.
31284 * class.cs (Property, Event, Indexer): Update accordingly.
31286 * ../errors/cs111.cs : Added.
31288 * expression.cs (Invocation::IsApplicable): New static method to determine applicability
31289 of a method, as laid down by the spec.
31291 (Invocation::OverloadResolve): Use the above method.
31293 2001-10-31 Ravi Pratap <ravi@ximian.com>
31295 * support.cs (InternalParameters): Get rid of crap taking in duplicate info. We
31296 now take a TypeContainer and a Parameters object.
31298 (ParameterData): Modify return type of ParameterModifier method to be
31299 Parameter.Modifier and not a string.
31301 (ReflectionParameters, InternalParameters): Update accordingly.
31303 * expression.cs (Argument::GetParameterModifier): Same here.
31305 * support.cs (InternalParameters::ParameterType): Find a better way of determining
31306 if we are a ref/out parameter. Actually, the type shouldn't be holding the '&'
31307 symbol in it at all so maybe this is only for now.
31309 2001-10-30 Ravi Pratap <ravi@ximian.com>
31311 * support.cs (InternalParameters): Constructor now takes an extra argument
31312 which is the actual Parameters class.
31314 (ParameterDesc): Update to provide info on ref/out modifiers.
31316 * class.cs (everywhere): Update call to InternalParameters to pass in
31317 the second argument too.
31319 * support.cs (ParameterData): Add ParameterModifier, which is a method
31320 to return the modifier info [ref/out etc]
31322 (InternalParameters, ReflectionParameters): Implement the above.
31324 * expression.cs (Argument::ParameterModifier): Similar function to return
31325 info about the argument's modifiers.
31327 (Invocation::OverloadResolve): Update to take into account matching modifiers
31330 * class.cs (Indexer::Define): Actually define a Parameter object and put it onto
31331 a new SetFormalParameters object which we pass to InternalParameters.
31333 2001-10-30 Ravi Pratap <ravi@ximian.com>
31335 * expression.cs (NewArray): Merge into the ArrayCreation class.
31337 2001-10-29 Ravi Pratap <ravi@ximian.com>
31339 * expression.cs (NewArray): Merge classes NewBuiltinArray and
31340 NewUserdefinedArray into one as there wasn't much of a use in having
31343 * expression.cs (Argument): Change field's name to ArgType from Type.
31345 (Type): New readonly property which returns the proper type, taking into
31346 account ref/out modifiers.
31348 (everywhere): Adjust code accordingly for the above.
31350 * codegen.cs (EmitContext.RefOrOutParameter): New field to determine
31351 whether we are emitting for a ref or out parameter.
31353 * expression.cs (Argument::Emit): Use the above field to set the state.
31355 (LocalVariableReference::Emit): Update to honour the flag and emit the
31358 * parameter.cs (Attributes): Set the correct flags for ref parameters.
31360 * expression.cs (Argument::FullDesc): New function to provide a full desc.
31362 * support.cs (ParameterData): Add method ParameterDesc to the interface.
31364 (ReflectionParameters, InternalParameters): Implement the above method.
31366 * expression.cs (Invocation::OverloadResolve): Use the new desc methods in
31369 (Invocation::FullMethodDesc): Ditto.
31371 2001-10-29 Miguel de Icaza <miguel@ximian.com>
31373 * cs-parser.jay: Add extra production for the second form of array
31376 * expression.cs (ArrayCreation): Update to reflect the above
31379 * Small changes to prepare for Array initialization.
31381 2001-10-28 Miguel de Icaza <miguel@ximian.com>
31383 * typemanager.cs (ImplementsInterface): interface might be null;
31384 Deal with this problem;
31386 Also, we do store negative hits on the cache (null values), so use
31387 this instead of calling t.GetInterfaces on the type everytime.
31389 2001-10-28 Ravi Pratap <ravi@ximian.com>
31391 * typemanager.cs (IsBuiltinType): New method to help determine the same.
31393 * expression.cs (New::DoResolve): Get rid of array creation code and instead
31394 split functionality out into different classes.
31396 (New::FormArrayType): Move into NewBuiltinArray.
31398 (Invocation::EmitArguments): Get rid of the MethodBase argument. Appears
31401 (NewBuiltinArray): New class to handle creation of built-in arrays.
31403 (NewBuiltinArray::DoResolve): Implement guts of array creation. Also take into
31404 account creation of one-dimensional arrays.
31406 (::Emit): Implement to use Newarr and Newobj opcodes accordingly.
31408 (NewUserdefinedArray::DoResolve): Implement.
31410 * cs-parser.jay (local_variable_type): Fix up to add the rank to the variable too.
31412 * typemanager.cs (AddModule): Used to add a ModuleBuilder to the list of modules
31413 we maintain inside the TypeManager. This is necessary to perform lookups on the
31416 (LookupType): Update to perform GetType on the module builders too.
31418 * driver.cs (Driver): Add the ModuleBuilder to the list maintained by the TypeManager.
31420 * exprssion.cs (NewUserdefinedArray::Emit): Implement.
31422 2001-10-23 Ravi Pratap <ravi@ximian.com>
31424 * expression.cs (New::DoResolve): Implement guts of array creation.
31426 (New::FormLookupType): Rename to FormArrayType and modify ever so slightly.
31428 2001-10-27 Miguel de Icaza <miguel@ximian.com>
31430 * expression.cs: Fix bug I introduced lsat night that broke
31433 (Expression.Resolve): Report a 246 error (can not resolve name)
31434 if we find a SimpleName in the stream.
31436 (Expression.ResolveLValue): Ditto.
31438 (Expression.ResolveWithSimpleName): This function is a variant of
31439 ResolveName, this one allows SimpleNames to be returned without a
31440 warning. The only consumer of SimpleNames is MemberAccess
31442 2001-10-26 Miguel de Icaza <miguel@ximian.com>
31444 * expression.cs (Invocation::DoResolve): Catch SimpleNames that
31445 might arrive here. I have my doubts that this is correct.
31447 * statement.cs (Lock): Implement lock statement.
31449 * cs-parser.jay: Small fixes to support `lock' and `using'
31451 * cs-tokenizer.cs: Remove extra space
31453 * driver.cs: New flag --checked, allows to turn on integer math
31456 * typemanger.cs: Load methodinfos for Threading.Monitor.Enter and
31457 Threading.Monitor.Exit
31459 2001-10-23 Miguel de Icaza <miguel@ximian.com>
31461 * expression.cs (IndexerAccess::DoResolveLValue): Set the
31462 Expression Class to be IndexerAccess.
31464 Notice that Indexer::DoResolve sets the eclass to Value.
31466 2001-10-22 Miguel de Icaza <miguel@ximian.com>
31468 * class.cs (TypeContainer::Emit): Emit code for indexers.
31470 * assign.cs (IAssignMethod): New interface implemented by Indexers
31471 and Properties for handling assignment.
31473 (Assign::Emit): Simplify and reuse code.
31475 * expression.cs (IndexerAccess, PropertyExpr): Implement
31476 IAssignMethod, clean up old code.
31478 2001-10-22 Ravi Pratap <ravi@ximian.com>
31480 * typemanager.cs (ImplementsInterface): New method to determine if a type
31481 implements a given interface. Provides a nice cache too.
31483 * expression.cs (ImplicitReferenceConversion): Update checks to use the above
31486 (ConvertReferenceExplicit): Ditto.
31488 * delegate.cs (Delegate::Populate): Update to define the parameters on the
31489 various methods, with correct names etc.
31491 * class.cs (Operator::OpType): New members Operator.UnaryPlus and
31492 Operator.UnaryNegation.
31494 * cs-parser.jay (operator_declarator): Be a little clever in the case where
31495 we have a unary plus or minus operator.
31497 * expression.cs (Unary): Rename memebers of Operator enum to UnaryPlus and
31500 * everywhere : update accordingly.
31502 * everywhere : Change Negate and BitComplement to LogicalNot and OnesComplement
31505 * class.cs (Method::Define): For the case where we are implementing a method
31506 inherited from an interface, we need to set the MethodAttributes.Final flag too.
31507 Also set MethodAttributes.NewSlot and MethodAttributes.HideBySig.
31509 2001-10-21 Ravi Pratap <ravi@ximian.com>
31511 * interface.cs (FindMembers): Implement to work around S.R.E
31514 * typemanager.cs (IsInterfaceType): Implement.
31516 (FindMembers): Update to handle interface types too.
31518 * expression.cs (ImplicitReferenceConversion): Re-write bits which
31519 use IsAssignableFrom as that is not correct - it doesn't work.
31521 * delegate.cs (DelegateInvocation): Derive from ExpressionStatement
31522 and accordingly override EmitStatement.
31524 * expression.cs (ConvertReferenceExplicit): Re-write similary, this time
31525 using the correct logic :-)
31527 2001-10-19 Ravi Pratap <ravi@ximian.com>
31529 * ../errors/cs-11.cs : Add to demonstrate error -11
31531 2001-10-17 Miguel de Icaza <miguel@ximian.com>
31533 * assign.cs (Assign::Resolve): Resolve right hand side first, and
31534 then pass this as a hint to ResolveLValue.
31536 * expression.cs (FieldExpr): Add Location information
31538 (FieldExpr::LValueResolve): Report assignment to readonly
31541 (Expression::ExprClassFromMemberInfo): Pass location information.
31543 (Expression::ResolveLValue): Add new method that resolves an
31546 (Expression::DoResolveLValue): Default invocation calls
31549 (Indexers): New class used to keep track of indexers in a given
31552 (IStackStore): Renamed from LValue, as it did not really describe
31553 what this did. Also ResolveLValue is gone from this interface and
31554 now is part of Expression.
31556 (ElementAccess): Depending on the element access type
31558 * typemanager.cs: Add `indexer_name_type' as a Core type
31559 (System.Runtime.CompilerServices.IndexerNameAttribute)
31561 * statement.cs (Goto): Take a location.
31563 2001-10-18 Ravi Pratap <ravi@ximian.com>
31565 * delegate.cs (Delegate::VerifyDelegate): New method to verify
31566 if two delegates are compatible.
31568 (NewDelegate::DoResolve): Update to take care of the case when
31569 we instantiate a delegate from another delegate.
31571 * typemanager.cs (FindMembers): Don't even try to look up members
31572 of Delegate types for now.
31574 2001-10-18 Ravi Pratap <ravi@ximian.com>
31576 * delegate.cs (NewDelegate): New class to take care of delegate
31579 * expression.cs (New): Split the delegate related code out into
31580 the NewDelegate class.
31582 * delegate.cs (DelegateInvocation): New class to handle delegate
31585 * expression.cs (Invocation): Split out delegate related code into
31586 the DelegateInvocation class.
31588 2001-10-17 Ravi Pratap <ravi@ximian.com>
31590 * expression.cs (New::DoResolve): Implement delegate creation fully
31591 and according to the spec.
31593 (New::DoEmit): Update to handle delegates differently.
31595 (Invocation::FullMethodDesc): Fix major stupid bug thanks to me
31596 because of which we were printing out arguments in reverse order !
31598 * delegate.cs (VerifyMethod): Implement to check if the given method
31599 matches the delegate.
31601 (FullDelegateDesc): Implement.
31603 (VerifyApplicability): Implement.
31605 * expression.cs (Invocation::DoResolve): Update to accordingly handle
31606 delegate invocations too.
31608 (Invocation::Emit): Ditto.
31610 * ../errors/cs1593.cs : Added.
31612 * ../errors/cs1594.cs : Added.
31614 * delegate.cs (InstanceExpression, TargetMethod): New properties.
31616 2001-10-16 Ravi Pratap <ravi@ximian.com>
31618 * typemanager.cs (intptr_type): Core type for System.IntPtr
31620 (InitCoreTypes): Update for the same.
31622 (iasyncresult_type, asynccallback_type): Ditto.
31624 * delegate.cs (Populate): Fix to use System.Intptr as it is indeed
31627 * typemanager.cs (AddDelegateType): Store a pointer to the Delegate class
31630 * delegate.cs (ConstructorBuilder, InvokeBuilder, ...): New members to hold
31631 the builders for the 4 members of a delegate type :-)
31633 (Populate): Define the BeginInvoke and EndInvoke methods on the delegate
31636 * expression.cs (New::DoResolve): Implement guts for delegate creation.
31638 * ../errors/errors.txt : Update for an error (-11) which only we catch :-)
31640 2001-10-15 Miguel de Icaza <miguel@ximian.com>
31642 * statement.cs (Break::Emit): Implement.
31643 (Continue::Emit): Implement.
31645 (For::Emit): Track old being/end loops; Set Begin loop, ack end loop
31646 (While::Emit): Track old being/end loops; Set Begin loop, ack end loop
31647 (Do::Emit): Track old being/end loops; Set Begin loop, ack end loop
31648 (Foreach::Emit): Track old being/end loops; Set Begin loop, ack
31651 * codegen.cs (EmitContext::LoopEnd, EmitContext::LoopBegin): New
31652 properties that track the label for the current loop (begin of the
31653 loop and end of the loop).
31655 2001-10-15 Ravi Pratap <ravi@ximian.com>
31657 * delegate.cs (Emit): Get rid of it as there doesn't seem to be any ostensible
31658 use of emitting anything at all.
31660 * class.cs, rootcontext.cs : Get rid of calls to the same.
31662 * delegate.cs (DefineDelegate): Make sure the class we define is also sealed.
31664 (Populate): Define the constructor correctly and set the implementation
31667 * typemanager.cs (delegate_types): New hashtable to hold delegates that
31670 (AddDelegateType): Implement.
31672 (IsDelegateType): Implement helper method.
31674 * delegate.cs (DefineDelegate): Use AddDelegateType instead of AddUserType.
31676 * expression.cs (New::DoResolve): Check if we are trying to instantiate a delegate type
31677 and accordingly handle it.
31679 * delegate.cs (Populate): Take TypeContainer argument.
31680 Implement bits to define the Invoke method. However, I still haven't figured out
31681 how to take care of the native int bit :-(
31683 * cs-parser.jay (delegate_declaration): Fixed the bug that I had introduced :-)
31684 Qualify the name of the delegate, not its return type !
31686 * expression.cs (ImplicitReferenceConversion): Implement guts of implicit array
31689 (StandardConversionExists): Checking for array types turns out to be recursive.
31691 (ConvertReferenceExplicit): Implement array conversion.
31693 (ExplicitReferenceConversionExists): New method to determine precisely that :-)
31695 2001-10-12 Ravi Pratap <ravi@ximian.com>
31697 * cs-parser.jay (delegate_declaration): Store the fully qualified
31698 name as it is a type declaration.
31700 * delegate.cs (ReturnType, Name): Rename members to these. Make them
31703 (DefineDelegate): Renamed from Define. Does the same thing essentially,
31704 as TypeContainer::DefineType.
31706 (Populate): Method in which all the definition of the various methods (Invoke)
31709 (Emit): Emit any code, if necessary. I am not sure about this really, but let's
31712 (CloseDelegate): Finally creates the delegate.
31714 * class.cs (TypeContainer::DefineType): Update to define delegates.
31715 (Populate, Emit and CloseType): Do the same thing here too.
31717 * rootcontext.cs (ResolveTree, PopulateTypes, EmitCode, CloseTypes): Include
31718 delegates in all these operations.
31720 2001-10-14 Miguel de Icaza <miguel@ximian.com>
31722 * expression.cs: LocalTemporary: a new expression used to
31723 reference a temporary that has been created.
31725 * assign.cs: Handle PropertyAccess back here, so that we can
31726 provide the proper semantic access to properties.
31728 * expression.cs (Expression::ConvertReferenceExplicit): Implement
31729 a few more explicit conversions.
31731 * modifiers.cs: `NEW' modifier maps to HideBySig.
31733 * expression.cs (PropertyExpr): Make this into an
31734 ExpressionStatement, and support the EmitStatement code path.
31736 Perform get/set error checking, clean up the interface.
31738 * assign.cs: recognize PropertyExprs as targets, and if so, turn
31739 them into toplevel access objects.
31741 2001-10-12 Miguel de Icaza <miguel@ximian.com>
31743 * expression.cs: PropertyExpr::PropertyExpr: use work around the
31746 * typemanager.cs: Keep track here of our PropertyBuilders again to
31747 work around lameness in SRE.
31749 2001-10-11 Miguel de Icaza <miguel@ximian.com>
31751 * expression.cs (LValue::LValueResolve): New method in the
31752 interface, used to perform a second resolution pass for LValues.
31754 (This::DoResolve): Catch the use of this in static methods.
31756 (This::LValueResolve): Implement.
31758 (This::Store): Remove warning, assigning to `this' in structures
31761 (Invocation::Emit): Deal with invocation of
31762 methods on value types. We need to pass the address to structure
31763 methods rather than the object itself. (The equivalent code to
31764 emit "this" for structures leaves the entire structure on the
31765 stack instead of a pointer to it).
31767 (ParameterReference::DoResolve): Compute the real index for the
31768 argument based on whether the method takes or not a `this' pointer
31769 (ie, the method is static).
31771 * codegen.cs (EmitContext::GetTemporaryStorage): Used to store
31772 value types returned from functions when we need to invoke a
31773 method on the sturcture.
31776 2001-10-11 Ravi Pratap <ravi@ximian.com>
31778 * class.cs (TypeContainer::DefineType): Method to actually do the business of
31779 defining the type in the Modulebuilder or Typebuilder. This is to take
31780 care of nested types which need to be defined on the TypeBuilder using
31781 DefineNestedMethod.
31783 (TypeContainer::GetClassBases): Implement. Essentially the code from the
31784 methods in RootContext, only ported to be part of TypeContainer.
31786 (TypeContainer::GetInterfaceOrClass): Ditto.
31788 (TypeContainer::LookupInterfaceOrClass, ::MakeFQN): Ditto.
31790 * interface.cs (Interface::DefineInterface): New method. Does exactly
31791 what RootContext.CreateInterface did earlier, only it takes care of nested types
31794 (Interface::GetInterfaces): Move from RootContext here and port.
31796 (Interface::GetInterfaceByName): Same here.
31798 * rootcontext.cs (ResolveTree): Re-write.
31800 (PopulateTypes): Re-write.
31802 * class.cs (TypeContainer::Populate): Populate nested types too.
31803 (TypeContainer::Emit): Emit nested members too.
31805 * typemanager.cs (AddUserType): Do not make use of the FullName property,
31806 instead just use the name argument passed in as it is already fully
31809 (FindMembers): Check in the Builders to TypeContainer mapping instead of the name
31810 to TypeContainer mapping to see if a type is user-defined.
31812 * class.cs (TypeContainer::CloseType): Implement.
31814 (TypeContainer::DefineDefaultConstructor): Use Basename, not Name while creating
31815 the default constructor.
31817 (TypeContainer::Populate): Fix minor bug which led to creating default constructors
31820 (Constructor::IsDefault): Fix up logic to determine if it is the default constructor
31822 * interface.cs (CloseType): Create the type here.
31824 * rootcontext.cs (CloseTypes): Re-write to recursively close types by running through
31827 Remove all the methods which are now in TypeContainer.
31829 2001-10-10 Ravi Pratap <ravi@ximian.com>
31831 * delegate.cs (Define): Re-write bits to define the delegate
31834 2001-10-10 Miguel de Icaza <miguel@ximian.com>
31836 * makefile: Renamed the compiler to `mcs.exe' instead of compiler.exe
31838 * expression.cs (ImplicitReferenceConversion): handle null as well
31839 as a source to convert to any reference type.
31841 * statement.cs (Return): Perform any implicit conversions to
31842 expected return type.
31844 Validate use of return statement.
31846 * codegen.cs (EmitContext): Pass the expected return type here.
31848 * class.cs (Method, Constructor, Property): Pass expected return
31849 type to EmitContext.
31851 2001-10-09 Miguel de Icaza <miguel@ximian.com>
31853 * expression.cs: Make DoResolve take an EmitContext instead of a
31856 Replaced `l' and `location' for `loc', for consistency.
31858 (Error, Warning): Remove unneeded Tc argument.
31860 * assign.cs, literal.cs, constant.cs: Update to new calling
31863 * codegen.cs: EmitContext now contains a flag indicating whether
31864 code is being generated in a static method or not.
31866 * cs-parser.jay: DecomposeQI, new function that replaces the old
31867 QualifiedIdentifier. Now we always decompose the assembled
31868 strings from qualified_identifier productions into a group of
31871 2001-10-08 Miguel de Icaza <miguel@ximian.com>
31873 * rootcontext.cs: Deal with field-less struct types correctly now
31874 by passing the size option to Define Type.
31876 * class.cs: Removed hack that created one static field.
31878 2001-10-07 Miguel de Icaza <miguel@ximian.com>
31880 * statement.cs: Moved most of the code generation here.
31882 2001-10-09 Ravi Pratap <ravi@ximian.com>
31884 * expression.cs (New::DoResolve): Revert changes for array creation, doesn't
31887 (ElementAccess): Remove useless bits for now - keep checks as the spec
31890 2001-10-08 Ravi Pratap <ravi@ximian.com>
31892 * expression.cs (ElementAccess::DoResolve): Remove my crap code
31893 and start performing checks according to the spec.
31895 2001-10-07 Ravi Pratap <ravi@ximian.com>
31897 * cs-parser.jay (type_suffix*): Remove - they are redundant. Use
31898 rank_specifiers instead.
31900 (rank_specifiers): Change the order in which the rank specifiers are stored
31902 (local_variable_declaration): Use opt_rank_specifier instead of type_suffixes.
31904 * expression.cs (ElementAccess): Implement the LValue interface too.
31906 2001-10-06 Ravi Pratap <ravi@ximian.com>
31908 * expression.cs (ConvertExplicitStandard): Add. Same as ConvertExplicit
31909 except that user defined conversions are not included.
31911 (UserDefinedConversion): Update to use the ConvertExplicitStandard to
31912 perform the conversion of the return type, if necessary.
31914 (New::DoResolve): Check whether we are creating an array or an object
31915 and accordingly do the needful.
31917 (New::Emit): Same here.
31919 (New::DoResolve): Implement guts of array creation.
31921 (New::FormLookupType): Helper function.
31923 2001-10-07 Miguel de Icaza <miguel@ximian.com>
31925 * codegen.cs: Removed most of the code generation here, and move the
31926 corresponding code generation bits to the statement classes.
31928 Added support for try/catch/finalize and throw.
31930 * cs-parser.jay: Added support for try/catch/finalize.
31932 * class.cs: Catch static methods having the flags override,
31933 virtual or abstract.
31935 * expression.cs (UserCast): This user cast was not really doing
31936 what it was supposed to do. Which is to be born in fully resolved
31937 state. Parts of the resolution were being performed at Emit time!
31941 2001-10-05 Miguel de Icaza <miguel@ximian.com>
31943 * expression.cs: Implicity convert the result from UserCast.
31945 2001-10-05 Ravi Pratap <ravi@ximian.com>
31947 * expression.cs (Expression::FindMostEncompassingType): Fix bug which
31948 prevented it from working correctly.
31950 (ConvertExplicit): Make the first try, a call to ConvertImplicitStandard, not
31951 merely ConvertImplicit.
31953 2001-10-05 Miguel de Icaza <miguel@ximian.com>
31955 * typemanager.cs: Make the LookupTypeContainer function static,
31956 and not per-instance.
31958 * class.cs: Make static FindMembers (the one that takes a Type
31961 * codegen.cs: Add EmitForeach here.
31963 * cs-parser.jay: Make foreach a toplevel object instead of the
31964 inline expansion, as we need to perform semantic analysis on it.
31966 2001-10-05 Ravi Pratap <ravi@ximian.com>
31968 * expression.cs (Expression::ImplicitUserConversion): Rename to
31969 UserDefinedConversion.
31971 (Expression::UserDefinedConversion): Take an extra argument specifying
31972 whether we look for explicit user conversions too.
31974 (Expression::ImplicitUserConversion): Make it a call to UserDefinedConversion.
31976 (UserDefinedConversion): Incorporate support for user defined explicit conversions.
31978 (ExplicitUserConversion): Make it a call to UserDefinedConversion
31979 with the appropriate arguments.
31981 * cs-parser.jay (cast_expression): Record location too.
31983 * expression.cs (Cast): Record location info.
31985 (Expression::ConvertExplicit): Take location argument.
31987 (UserImplicitCast): Change name to UserCast. Take an extra constructor argument
31988 to determine if we are doing explicit conversions.
31990 (UserCast::Emit): Update accordingly.
31992 (Expression::ConvertExplicit): Report an error if everything fails.
31994 * ../errors/cs0030.cs : Add.
31996 2001-10-04 Miguel de Icaza <miguel@ximian.com>
31998 * modifiers.cs: If the ABSTRACT keyword is present, also set the
31999 virtual and newslot bits.
32001 * class.cs (TypeContainer::RegisterRequiredImplementations):
32002 Record methods we need.
32004 (TypeContainer::MakeKey): Helper function to make keys for
32005 MethodBases, since the Methodbase key is useless.
32007 (TypeContainer::Populate): Call RegisterRequiredImplementations
32008 before defining the methods.
32010 Create a mapping for method_builders_to_methods ahead of time
32011 instead of inside a tight loop.
32013 (::RequireMethods): Accept an object as the data to set into the
32014 hashtable so we can report interface vs abstract method mismatch.
32016 2001-10-03 Miguel de Icaza <miguel@ximian.com>
32018 * report.cs: Make all of it static.
32020 * rootcontext.cs: Drop object_type and value_type computations, as
32021 we have those in the TypeManager anyways.
32023 Drop report instance variable too, now it is a global.
32025 * driver.cs: Use try/catch on command line handling.
32027 Add --probe option to debug the error reporting system with a test
32030 * report.cs: Add support for exiting program when a probe
32031 condition is reached.
32033 2001-10-03 Ravi Pratap <ravi@ximian.com>
32035 * expression.cs (Binary::DoNumericPromotions): Fix the case when
32036 we do a forcible conversion regardless of type, to check if
32037 ForceConversion returns a null.
32039 (Binary::error19): Use location to report error.
32041 (Unary::error23): Use location here too.
32043 * ../errors/cs0019.cs : Check in.
32045 * ../errors/cs0023.cs : Check in.
32047 * expression.cs (Expression.MemberLookup): Return null for a rather esoteric
32048 case of a non-null MethodInfo object with a length of 0 !
32050 (Binary::ResolveOperator): Flag error if overload resolution fails to find
32051 an applicable member - according to the spec :-)
32052 Also fix logic to find members in base types.
32054 (Unary::ResolveOperator): Same here.
32056 (Unary::report23): Change name to error23 and make first argument a TypeContainer
32057 as I was getting thoroughly confused between this and error19 :-)
32059 * expression.cs (Expression::ImplicitUserConversion): Re-write fully
32060 (::FindMostEncompassedType): Implement.
32061 (::FindMostEncompassingType): Implement.
32062 (::StandardConversionExists): Implement.
32064 (UserImplicitCast): Re-vamp. We now need info about most specific
32065 source and target types so that we can do the necessary conversions.
32067 (Invocation::MakeUnionSet): Completely re-write to make sure we form a proper
32068 mathematical union with no duplicates.
32070 2001-10-03 Miguel de Icaza <miguel@ximian.com>
32072 * rootcontext.cs (RootContext::PopulateTypes): Populate containers
32073 in order from base classes to child classes, so that we can in
32074 child classes look up in our parent for method names and
32075 attributes (required for handling abstract, virtual, new, override
32076 constructs: we need to instrospect our base class, and if we dont
32077 populate the classes in order, the introspection might be
32078 incorrect. For example, a method could query its parent before
32079 the parent has any methods and would determine that the parent has
32080 no abstract methods (while it could have had them)).
32082 (RootContext::CreateType): Record the order in which we define the
32085 2001-10-02 Miguel de Icaza <miguel@ximian.com>
32087 * class.cs (TypeContainer::Populate): Also method definitions can
32088 fail now, keep track of this.
32090 (TypeContainer::FindMembers): Implement support for
32091 DeclaredOnly/noDeclaredOnly flag.
32093 (Constructor::Emit) Return the ConstructorBuilder.
32095 (Method::Emit) Return the MethodBuilder.
32096 Check for abstract or virtual methods to be public.
32098 * rootcontext.cs (RootContext::CreateType): Register all the
32099 abstract methods required for the class to be complete and the
32100 interface methods that must be implemented.
32102 * cs-parser.jay: Report error 501 (method requires body if it is
32103 not marked abstract or extern).
32105 * expression.cs (TypeOf::Emit): Implement.
32107 * typemanager.cs: runtime_handle_type, new global type.
32109 * class.cs (Property::Emit): Generate code for properties.
32111 2001-10-02 Ravi Pratap <ravi@ximian.com>
32113 * expression.cs (Unary::ResolveOperator): Find operators on base type
32114 too - we now conform exactly to the spec.
32116 (Binary::ResolveOperator): Same here.
32118 * class.cs (Operator::Define): Fix minor quirk in the tests.
32120 * ../errors/cs0215.cs : Added.
32122 * ../errors/cs0556.cs : Added.
32124 * ../errors/cs0555.cs : Added.
32126 2001-10-01 Miguel de Icaza <miguel@ximian.com>
32128 * cs-tokenizer.cs: Reimplemented Location to be a struct with a
32129 single integer which is really efficient
32131 2001-10-01 Ravi Pratap <ravi@ximian.com>
32133 * expression.cs (Expression::ImplicitUserConversion): Use location
32134 even in the case when we are examining True operators.
32136 * class.cs (Operator::Define): Perform extensive checks to conform
32137 with the rules for operator overloading in the spec.
32139 * expression.cs (Expression::ImplicitReferenceConversion): Implement
32140 some of the other conversions mentioned in the spec.
32142 * typemanager.cs (array_type): New static member for the System.Array built-in
32145 (cloneable_interface): For System.ICloneable interface.
32147 * driver.cs (Driver::Driver): Initialize TypeManager's core types even before
32148 we start resolving the tree and populating types.
32150 * ../errors/errors.txt : Update for error numbers -7, -8, -9, -10
32152 2001-10-01 Miguel de Icaza <miguel@ximian.com>
32154 * expression.cs (Expression::ExprClassFromMemberInfo,
32155 Expression::Literalize): Create literal expressions from
32156 FieldInfos which are literals.
32158 (ConvertNumericExplicit, ImplicitNumericConversion): Fix a few
32159 type casts, because they were wrong. The test suite in tests
32162 (ImplicitNumericConversion): ushort to ulong requires a widening
32165 Int32 constant to long requires widening cast as well.
32167 * literal.cs (LongLiteral::EmitLong): Do not generate i4 constants
32168 for integers because the type on the stack is not i4.
32170 2001-09-30 Miguel de Icaza <miguel@ximian.com>
32172 * expression.cs (report118): require location argument.
32174 * parameter.cs: Do not dereference potential null value.
32176 * class.cs: Catch methods that lack the `new' keyword when
32177 overriding a name. Report warnings when `new' is used without
32178 anything being there to override.
32180 * modifiers.cs: Handle `NEW' as MethodAttributes.NewSlot.
32182 * class.cs: Only add constructor to hashtable if it is non-null
32183 (as now constructors can fail on define).
32185 (TypeManager, Class, Struct): Take location arguments.
32187 Catch field instance initialization in structs as errors.
32189 accepting_filter: a new filter for FindMembers that is static so
32190 that we dont create an instance per invocation.
32192 (Constructor::Define): Catch errors where a struct constructor is
32195 * cs-parser.jay: Pass location information for various new
32198 * delegate.cs (Delegate): take a location argument.
32200 * driver.cs: Do not call EmitCode if there were problesm in the
32201 Definition of the types, as many Builders wont be there.
32203 * decl.cs (Decl::Decl): Require a location argument.
32205 * cs-tokenizer.cs: Handle properly hex constants that can not fit
32206 into integers, and find the most appropiate integer for it.
32208 * literal.cs: Implement ULongLiteral.
32210 * rootcontext.cs: Provide better information about the location of
32211 failure when CreateType fails.
32213 2001-09-29 Miguel de Icaza <miguel@ximian.com>
32215 * rootcontext.cs (RootContext::PopulateTypes): Populates structs
32218 * expression.cs (Binary::CheckShiftArguments): Add missing type
32220 (Binary::ResolveOperator): Add type to the logical and and logical
32221 or, Bitwise And/Or and Exclusive Or code paths, it was missing
32224 (Binary::DoNumericPromotions): In the case where either argument
32225 is ulong (and most signed types combined with ulong cause an
32226 error) perform implicit integer constant conversions as well.
32228 2001-09-28 Miguel de Icaza <miguel@ximian.com>
32230 * expression.cs (UserImplicitCast): Method should always be
32232 (Invocation::BetterConversion): Simplified test for IntLiteral.
32234 (Expression::ImplicitNumericConversion): Split this routine out.
32235 Put the code that performs implicit constant integer conversions
32238 (Expression::Resolve): Become a wrapper around DoResolve so we can
32239 check eclass and type being set after resolve.
32241 (Invocation::Badness): Remove this dead function
32243 (Binary::ResolveOperator): Do not compute the expensive argumnets
32244 unless we have a union for it.
32246 (Probe::Emit): Is needs to do an isinst and then
32247 compare against null.
32249 (::CanConvert): Added Location argument. If the Location argument
32250 is null (Location.Null), then we do not report errors. This is
32251 used by the `probe' mechanism of the Explicit conversion. We do
32252 not want to generate an error for something that the user
32253 explicitly requested to be casted. But the pipeline for an
32254 explicit cast first tests for potential implicit casts.
32256 So for now, if the Location is null, it means `Probe only' to
32257 avoid adding another argument. Might have to revise this
32260 (ClassCast): New class used to type cast objects into arbitrary
32261 classes (used in Explicit Reference Conversions).
32263 Implement `as' as well.
32265 Reverted all the patches from Ravi below: they were broken:
32267 * The use of `level' as a mechanism to stop recursive
32268 invocations is wrong. That was there just to catch the
32269 bug with a strack trace but not as a way of addressing
32272 To fix the problem we have to *understand* what is going
32273 on and the interactions and come up with a plan, not
32274 just get things going.
32276 * The use of the type conversion cache that I proposed
32277 last night had an open topic: How does this work across
32278 protection domains. A user defined conversion might not
32279 be public in the location where we are applying the
32280 conversion, a different conversion might be selected
32281 (ie, private A->B (better) but public B->A (worse),
32282 inside A, A->B applies, but outside it, B->A will
32285 * On top of that (ie, even if the above is solved),
32286 conversions in a cache need to be abstract. Ie, `To
32287 convert from an Int to a Short use an OpcodeCast', not
32288 `To convert from an Int to a Short use the OpcodeCast on
32289 the variable 5' (which is what this patch was doing).
32291 2001-09-28 Ravi Pratap <ravi@ximian.com>
32293 * expression.cs (Invocation::ConversionExists): Re-write to use
32294 the conversion cache
32296 (Expression::ConvertImplicit): Automatic bailing out if level != 0. Also
32297 cache all conversions done, not just user-defined ones.
32299 (Invocation::BetterConversion): The real culprit. Use ConversionExists
32300 to determine if a conversion exists instead of acutually trying to
32301 perform the conversion. It's faster too.
32303 (Expression::ConvertExplicit): Modify to use ConversionExists to check
32304 and only then attempt the implicit conversion.
32306 2001-09-28 Ravi Pratap <ravi@ximian.com>
32308 * expression.cs (ConvertImplicit): Use a cache for conversions
32309 already found. Check level of recursion and bail out if necessary.
32311 2001-09-28 Miguel de Icaza <miguel@ximian.com>
32313 * typemanager.cs (string_concat_string_string, string_concat_object_object):
32314 Export standard methods that we expect for string operations.
32316 * statement.cs (Block::UsageWarning): Track usage of variables and
32317 report the errors for not used variables.
32319 * expression.cs (Conditional::Resolve, ::Emit): Implement ?:
32322 2001-09-27 Miguel de Icaza <miguel@ximian.com>
32324 * codegen.cs: remove unnneded code
32326 * expression.cs: Removed BuiltinTypeAccess class
32328 Fix the order in which implicit conversions are
32331 The previous fixed dropped support for boxed conversions (adding a
32332 test to the test suite now)
32334 (UserImplicitCast::CanConvert): Remove test for source being null,
32335 that code is broken. We should not feed a null to begin with, if
32336 we do, then we should track the bug where the problem originates
32337 and not try to cover it up here.
32339 Return a resolved expression of type UserImplicitCast on success
32340 rather than true/false. Ravi: this is what I was talking about,
32341 the pattern is to use a static method as a "constructor" for
32344 Also, do not create arguments until the very last minute,
32345 otherwise we always create the arguments even for lookups that
32346 will never be performed.
32348 (UserImplicitCast::Resolve): Eliminate, objects of type
32349 UserImplicitCast are born in a fully resolved state.
32351 * typemanager.cs (InitCoreTypes): Init also value_type
32352 (System.ValueType).
32354 * expression.cs (Cast::Resolve): First resolve the child expression.
32356 (LValue): Add new method AddressOf to be used by
32359 Change the argument of Store to take an EmitContext instead of an
32360 ILGenerator, because things like FieldExpr need to be able to call
32361 their children expression to generate the instance code.
32363 (Expression::Error, Expression::Warning): Sugar functions for
32366 (Expression::MemberLookup): Accept a TypeContainer instead of a
32367 Report as the first argument.
32369 (Expression::ResolvePrimary): Killed. I still want to improve
32370 this as currently the code is just not right.
32372 (Expression::ResolveMemberAccess): Simplify, but it is still
32375 (Unary::Resolve): Catch errors in AddressOf operators.
32377 (LocalVariableReference::Emit, ::Store, ::AddressOf): typecast
32378 index to a byte for the short-version, or the compiler will choose
32379 the wrong Emit call, which generates the wrong data.
32381 (ParameterReference::Emit, ::Store): same.
32383 (FieldExpr::AddressOf): Implement.
32385 * typemanager.cs: TypeManager: made public variable instead of
32388 * driver.cs: document --fatal.
32390 * report.cs (ErrorMessage, WarningMessage): new names for the old
32391 Error and Warning classes.
32393 * cs-parser.jay (member_access): Turn built-in access to types
32394 into a normal simplename
32396 2001-09-27 Ravi Pratap <ravi@ximian.com>
32398 * expression.cs (Invocation::BetterConversion): Fix to cope
32399 with q being null, since this was introducing a bug.
32401 * expression.cs (ConvertImplicit): Do built-in conversions first.
32403 2001-09-27 Ravi Pratap <ravi@ximian.com>
32405 * expression.cs (UserImplicitCast::Resolve): Fix bug.
32407 2001-09-27 Ravi Pratap <ravi@ximian.com>
32409 * class.cs (TypeContainer::AddConstructor): Fix a stupid bug
32410 I had introduced long ago (what's new ?).
32412 * expression.cs (UserImplicitCast::CanConvert): Static method to do
32413 the work of all the checking.
32414 (ConvertImplicit): Call CanConvert and only then create object if necessary.
32415 (UserImplicitCast::CanConvert, ::Resolve): Re-write.
32417 (Unary::Operator): Rename Add and Subtract to Addition and Subtraction because
32418 that is the right way.
32420 (Invocation::MakeUnionSet): Convenience function to make unions of sets for
32421 overloading resolution. Use everywhere instead of cutting and pasting code.
32423 (Binary::ResolveOperator): Use MakeUnionSet.
32425 (UserImplicitCast::CanConvert, ::Resolve): Update to take care of the case when
32426 we have to convert to bool types. Not complete yet.
32428 2001-09-27 Miguel de Icaza <miguel@ximian.com>
32430 * typemanager.cs (TypeManager::CSharpName): support ushort.
32432 * expression.cs (Expression::TryImplicitIntConversion): Attempts
32433 to provide an expression that performsn an implicit constant int
32434 conversion (section 6.1.6).
32435 (Expression::ConvertImplicitRequired): Reworked to include
32436 implicit constant expression conversions.
32438 (Expression::ConvertNumericExplicit): Finished.
32440 (Invocation::Emit): If InstanceExpression is null, then it means
32441 that we perform a call on this.
32443 2001-09-26 Miguel de Icaza <miguel@ximian.com>
32445 * expression.cs (Unary::Emit): Remove some dead code.
32446 (Probe): Implement Resolve and Emit for `is'.
32447 (Expression::ConvertImplicitRequired): Attempt to do constant
32448 expression conversions here. Maybe should be moved to
32449 ConvertImplicit, but I am not sure.
32450 (Expression::ImplicitLongConstantConversionPossible,
32451 Expression::ImplicitIntConstantConversionPossible): New functions
32452 that tell whether is it possible to apply an implicit constant
32453 expression conversion.
32455 (ConvertNumericExplicit): Started work on explicit numeric
32458 * cs-parser.jay: Update operator constants.
32460 * parameter.cs (Parameters::GetParameterInfo): Hook up VerifyArgs
32461 (Parameters::GetSignature): Hook up VerifyArgs here.
32462 (Parameters::VerifyArgs): Verifies that no two arguments have the
32465 * class.cs (Operator): Update the operator names to reflect the
32466 ones that the spec expects (as we are just stringizing the
32469 * expression.cs (Unary::ResolveOperator): Fix bug: Use
32470 MethodInfo's ReturnType instead of LookupMethodByBuilder as the
32471 previous usage did only work for our methods.
32472 (Expression::ConvertImplicit): Handle decimal implicit numeric
32473 conversions as well.
32474 (Expression::InternalTypeConstructor): Used to invoke constructors
32475 on internal types for default promotions.
32477 (Unary::Emit): Implement special handling for the pre/post
32478 increment/decrement for overloaded operators, as they need to have
32479 the same semantics as the other operators.
32481 (Binary::ResolveOperator): ditto.
32482 (Invocation::ConversionExists): ditto.
32483 (UserImplicitCast::Resolve): ditto.
32485 2001-09-26 Ravi Pratap <ravi@ximian.com>
32487 * expression.cs (Unary::Emit and Binary::Emit): If we have an overloaded
32488 operator, return after emitting body. Regression tests pass again !
32490 * expression.cs (ConvertImplicit): Take TypeContainer as first argument
32491 (Unary::ForceConversion, Binary::ForceConversion): Ditto.
32492 (Invocation::OverloadResolve): Ditto.
32493 (Invocation::BetterFunction, BetterConversion, ConversionExists): Ditto.
32495 * everywhere : update calls to the above methods accordingly.
32497 2001-09-26 Miguel de Icaza <miguel@ximian.com>
32499 * assign.cs (Assign): Make it inherit from ExpressionStatement.
32501 * expression.cs (ExpressionStatement): New base class used for
32502 expressions that can appear in statements, so that we can provide
32503 an alternate path to generate expression that do not leave a value
32506 (Expression::Emit, and all the derivatives): We no longer return
32507 whether a value is left on the stack or not. Every expression
32508 after being emitted leaves a single value on the stack.
32510 * codegen.cs (EmitContext::EmitStatementExpression): Use the
32511 facilties of ExpressionStatement if possible.
32513 * cs-parser.jay: Update statement_expression.
32515 2001-09-25 Miguel de Icaza <miguel@ximian.com>
32517 * driver.cs: Change the wording of message
32519 2001-09-25 Ravi Pratap <ravi@ximian.com>
32521 * expression.cs (Binary::ResolveOperator): Had forgottten to set
32522 the type of the expression to the return type of the method if
32523 we have an overloaded operator match ! The regression tests pass again !
32524 (Unary::ResolveOperator): Ditto.
32526 * expression.cs (Invocation::ConversionExists): Correct the member lookup
32527 to find "op_Implicit", not "implicit" ;-)
32528 (UserImplicitCast): New class to take care of user-defined implicit conversions.
32529 (ConvertImplicit, ForceConversion): Take TypeContainer argument
32531 * everywhere : Correct calls to the above accordingly.
32533 * expression.cs (UserImplicitCast::Resolve, ::Emit): Implement.
32534 (ConvertImplicit): Do user-defined conversion if it exists.
32536 2001-09-24 Miguel de Icaza <miguel@ximian.com>
32538 * assign.cs: track location.
32539 (Resolve): Use implicit conversions on assignment.
32541 * literal.cs: Oops. Not good, Emit of short access values should
32542 pass (Bytes) or the wrong argument will be selected.
32544 * expression.cs (Unary::Emit): Emit code for -expr.
32546 (Unary::ResolveOperator): Handle `Substract' for non-constants
32547 (substract from zero from the non-constants).
32548 Deal with Doubles as well.
32550 (Expression::ConvertImplicitRequired): New routine that reports an
32551 error if no implicit conversion exists.
32553 (Invocation::OverloadResolve): Store the converted implicit
32554 expressions if we make them
32556 2001-09-24 Ravi Pratap <ravi@ximian.com>
32558 * class.cs (ConstructorInitializer): Take a Location argument.
32559 (ConstructorBaseInitializer): Same here.
32560 (ConstructorThisInitializer): Same here.
32562 * cs-parser.jay : Update all calls accordingly.
32564 * expression.cs (Unary, Binary, New): Take location argument.
32565 Update accordingly everywhere.
32567 * cs-parser.jay : Update all calls to the above to take a location
32570 * class.cs : Ditto.
32572 2001-09-24 Ravi Pratap <ravi@ximian.com>
32574 * expression.cs (Invocation::BetterFunction): Take TypeContainer argument
32575 (Invocation::BetterConversion): Same here
32576 (Invocation::ConversionExists): Ditto.
32578 (Invocation::ConversionExists): Implement.
32580 2001-09-22 Ravi Pratap <ravi@ximian.com>
32582 * expression.cs (OverloadResolve): Improve some more to catch errors 1502 and 1503
32583 Also take an additional TypeContainer argument.
32585 * All over : Pass in TypeContainer as argument to OverloadResolve.
32587 * typemanager.cs (CSharpName): Update to check for the string type and return
32590 * expression.cs (Invocation::FullMethodDesc): New static method to return a string fully describing
32593 2001-09-21 Ravi Pratap <ravi@ximian.com>
32595 * expression.cs (Invocation::OverloadResolve): Re-write to conform more to the spec.
32596 (Invocation::BetterFunction): Implement.
32597 (Invocation::BetterConversion): Implement.
32598 (Invocation::ConversionExists): Skeleton, no implementation yet.
32600 Okay, things work fine !
32602 2001-09-21 Miguel de Icaza <miguel@ximian.com>
32604 * typemanager.cs: declare and load enum_type, delegate_type and
32607 * expression.cs (Expression::Emit): Now emit returns a value that
32608 tells whether a value is left on the stack or not. This strategy
32609 might be reveted tomorrow with a mechanism that would address
32610 multiple assignments.
32611 (Expression::report118): Utility routine to report mismatches on
32614 (Unary::Report23): Report impossible type/operator combination
32617 (Unary::IsIncrementableNumber): Whether the type can be
32618 incremented or decremented with add.
32619 (Unary::ResolveOperator): Also allow enumerations to be bitwise
32621 (Unary::ResolveOperator): Implement ++, !, ~,
32623 (Invocation::Emit): Deal with new Emit convetion.
32625 * All Expression derivatives: Updated their Emit method to return
32626 whether they leave values on the stack or not.
32628 * codegen.cs (CodeGen::EmitStatement): Pop values left on the
32629 stack for expressions that are statements.
32631 2001-09-20 Miguel de Icaza <miguel@ximian.com>
32633 * expression.cs (LValue): New interface. Must be implemented by
32635 (LocalVariableReference, ParameterReference, FieldExpr): Implement
32638 * assign.cs (Assign::Emit, Assign::Resolve): Use new LValue
32639 interface for generating code, simplifies the code.
32641 2001-09-20 Ravi Pratap <ravi@ximian.com>
32643 * expression.cs (everywhere): Comment out return statements in ::Resolve
32644 methods to avoid the warnings.
32646 2001-09-20 Miguel de Icaza <miguel@ximian.com>
32648 * driver.cs (parse): Report error 2001 if we can not open the
32651 * expression.cs (SimpleName::ResolveSimpleName): Error if we can
32654 * cs-parser.jay (QualifierIdentifier): Pass location to SimpleName
32657 * statement.cs (Block::EmitMeta): Reuse the count across all the variables,
32658 otherwise nested blocks end up with the same index.
32660 * codegen.cs (CodeGen::EmitTopBlock): Pass initial sequence
32662 * expression.cs: Instead of having FIXMEs in the Resolve
32663 functions, throw exceptions so it is obvious that we are facing a
32666 * cs-parser.jay (invocation_expression): Pass Location information.
32668 * codegen.cs (CodeGen::Save, CodeGen::CodeGen, CodeGen::Basename):
32669 Use a basename for those routines because .NET does not like paths
32672 * class.cs (TypeContainer::AddMethod): Do not call DefineName if the name was
32675 2001-09-19 Miguel de Icaza <miguel@ximian.com>
32677 * typemanager.cs (TypeManager::CoreLookupType): A function to make sure that we
32678 are loading the correct data types (throws an exception if not).
32679 (TypeManager::InitCoreTypes): Use CoreLookupType
32681 * expression.cs (Unary::ResolveOperator): return the child
32682 expression for expressions which are just +expr.
32683 (Unary::ResolveOperator): Return negative literals for -LITERAL
32684 expressions (otherwise they are Unary {Literal}).
32685 (Invocation::Badness): Take into account `Implicit constant
32686 expression conversions'.
32688 * literal.cs (LongLiteral): Implement long literal class.
32689 (IntLiteral): export the `Value' of the intliteral.
32691 2001-09-19 Ravi Pratap <ravi@ximian.com>
32693 * expression.cs (Binary::Emit): Finally get the emission right ! Woo!
32695 * class.cs (Operator::Define): Change the methodname prefix to 'op_'
32696 instead of 'Operator'
32698 * expression.cs (Binary::ResolveOperator): Update accordingly.
32699 (Unary::Operator): Change names to 'Add' and 'Subtract' instead 'Plus'
32702 * cs-parser.jay (unary_expression): Update to use the new names.
32704 * gen-treedump.cs (GetUnary): Same here.
32706 * expression.cs (Unary::Resolve): Implement.
32707 (Binary::ResolveOperator): Re-write bits to quietly continue if no overloaded
32708 operators are found instead of making noise ;-)
32709 (Unary::ResolveOperator): New method to do precisely the same thing which
32710 Binary::ResolveOperator does for Binary expressions.
32711 (Unary.method, .Arguments): Add.
32712 (Unary::OperName): Implement.
32713 (Unary::ForceConversion): Copy and Paste !
32715 * class.cs (Operator::Define): Fix a small bug for the case when we have
32718 * expression.cs (Unary::Emit): Implement. Need to find the right Opcodes
32719 for the inbuilt operators. Only overloading works for now ;-)
32721 2001-09-18 Miguel de Icaza <miguel@ximian.com>
32723 * expression.cs (CheckedExpr::Resolve, CheckedExpr::Emit,
32724 UnCheckedExpr::Resolve, UnCheckedExpr::Emit): Implement.
32726 * expression.cs (This::Emit): Implement.
32727 (This::Resolve): Implement.
32728 (TypeOf:Resolve): Implement.
32729 (Expression::ResolveSimpleName): Add an implicit this to instance
32731 (MemberAccess::Resolve): Deal with Parameters and Fields.
32732 Bind instance variable to Field expressions.
32733 (FieldExpr::Instance): New field used to track the expression that
32734 represents the object instance.
32735 (FieldExpr::Resolve): Track potential errors from MemberLookup not
32737 (FieldExpr::Emit): Implement.
32739 * codegen.cs (EmitIf, EmitStatement, EmitBlock): Propagate whether
32740 the last instruction contains a return opcode to avoid generating
32741 the last `ret' instruction (this generates correct code, and it is
32742 nice to pass the peverify output).
32744 * class.cs (TypeContainer::EmitFieldInitializers): Implement field
32745 initializer for static and instance variables.
32746 (Constructor::Emit): Allow initializer to be null in the case of
32747 static constructors. Only emit initializer for instance
32750 (TypeContainer::FindMembers): Return a null array if there are no
32753 Also fix the code for the MemberTypes.Method branch, as it was not
32754 scanning that for operators (or tried to access null variables before).
32756 * assign.cs (Assign::Emit): Handle instance and static fields.
32760 * driver.cs: Stop compilation if there are parse errors.
32762 * cs-parser.jay (constructor_declaration): Provide default base
32763 initializer for non-static constructors.
32764 (constructor_declarator): Do not provide a default base
32765 initializers if none was specified.
32766 Catch the fact that constructors should not have parameters.
32768 * class.cs: Do not emit parent class initializers for static
32769 constructors, that should be flagged as an error.
32771 2001-09-18 Ravi Pratap <ravi@ximian.com>
32773 * class.cs (RegisterMethodBuilder): Remove : it's unnecessary.
32774 Move back code into TypeContainer::Populate.
32776 2001-09-18 Ravi Pratap <ravi@ximian.com>
32778 * class.cs (TypeContainer::AddConstructor): Fix the check to
32779 compare against Name, not Basename.
32780 (Operator::OpType): Change Plus and Minus to Add and Subtract.
32782 * cs-parser.jay : Update accordingly.
32784 * class.cs (TypeContainer::FindMembers): For the case where we are searching
32785 for methods, don't forget to look into the operators too.
32786 (RegisterMethodBuilder): Helper method to take care of this for
32787 methods, constructors and operators.
32788 (Operator::Define): Completely revamp.
32789 (Operator.OperatorMethod, MethodName): New fields.
32790 (TypeContainer::Populate): Move the registering of builders into
32791 RegisterMethodBuilder.
32792 (Operator::Emit): Re-write.
32794 * expression.cs (Binary::Emit): Comment out code path to emit method
32795 invocation stuff for the case when we have a user defined operator. I am
32796 just not able to get it right !
32798 2001-09-17 Miguel de Icaza <miguel@ximian.com>
32800 * expression.cs (Expression::OverloadResolve): Drop TypeContainer
32803 (Expression::MemberLookup): Provide a version that allows to
32804 specify the MemberTypes and BindingFlags.
32806 * statement.cs (Block::GetVariableInfo): Forgot to recurse here,
32807 so it was not fetching variable information from outer blocks.
32809 * modifiers.cs: (Modifiers::TypeAttr): Invert condition on
32810 Beforefieldinit as it was buggy.
32812 * rootcontext.cs (::LookupInterfaceOrClass): Removed an Error -200
32813 that Ravi put here.
32815 * class.cs (Constructor::Emit): Only emit if block is not null.
32816 (TypeContainer::EmitDefaultConstructor): Removed routine, now we
32817 deal with this by semantically definining it as if the user had
32820 (TypeContainer::FindMembers): Removed ad-hoc hack to deal with
32821 constructors as we now "emit" them at a higher level.
32823 (TypeContainer::DefineDefaultConstructor): Used to define the
32824 default constructors if none was provided.
32826 (ConstructorInitializer): Add methods Resolve and Emit.
32828 * expression.cs: Cast to ConstructorInfo instead of MethodInfo
32830 2001-09-17 Ravi Pratap <ravi@ximian.com>
32832 * class.cs (TypeContainer::EmitDefaultConstructor): Register
32833 the default constructor builder with our hashtable for methodbuilders
32836 * expression.cs (Invocation::OverloadResolve): Add a check for pd == null
32837 and argument_count is 0 in which case we have a match.
32838 (Binary::ResolveOperator): More null checking and miscellaneous coding
32841 2001-09-17 Ravi Pratap <ravi@ximian.com>
32843 * rootcontext.cs (IsNameSpace): Compare against null.
32845 * everywhere : Correct spelling to 'Greater' and to 'Subtract'
32847 * class.cs (Operator::OpType): Change names to match the ones in Binary::Operator
32848 and Unary::Operator.
32850 * cs-parser.jay (operator_declaration, CheckBinaryOperator, CheckUnaryOperator): Update
32853 * expression.cs (Binary::method): New member to hold the MethodBase for the case when
32854 we have overloaded operators.
32855 (Binary::ResolveOperator): Implement the part which does the operator overload
32858 * class.cs (Operator::Emit): Implement.
32859 (TypeContainer::Emit): Emit the operators we have too.
32861 * expression.cs (Binary::Emit): Update to emit the appropriate code for
32862 the case when we have a user-defined operator.
32864 2001-09-17 Miguel de Icaza <miguel@ximian.com>
32866 * rootcontext.cs: Fix bug: tree.Namespaces might be null.
32868 2001-09-16 Ravi Pratap <ravi@ximian.com>
32870 * class.cs (EmitStaticFieldInitializers, EmitFieldInitializers): Make public.
32871 (TypeContainer::EmitConstructor): Remove and move code into Contructor::Emit.
32872 (Constructor::Emit): Implement.
32873 (EmitStaticFieldInitializers, EmitFieldInitializers): Ensure we return immediately
32874 if we have no work to do.
32875 (TypeContainer::Emit): Pass in TypeContainer as argument to the constructor's
32878 * interface.cs (Interface::InterfaceAttr): Re-write to be more correct and complete.
32879 (Interface::IsTopLevel): Add. Same as TypeContainer::IsTopLevel.
32881 * class.cs (TypeContainer::IsTopLevel): Modify to use parent.Parent instead
32884 2001-09-15 Ravi Pratap <ravi@ximian.com>
32886 * tree.cs (Tree::namespaces): New hashtable to keep track of namespaces
32888 (Tree::RecordNamespace): Method to do what the name says ;-)
32889 (Tree::Namespaces): Property to get at the namespaces hashtable.
32891 * cs-parser.jay (namespace_declaration): Call RecordNamespace to
32894 * rootcontext.cs (IsNamespace): Fixed it :-)
32896 2001-09-14 Miguel de Icaza <miguel@ximian.com>
32898 * class.cs (TypeContainer::FindMembers): Add support for
32900 (MethodCore): New class that encapsulates both the shared aspects
32901 of a Constructor and a Method.
32902 (Method, Constructor): Factored pieces into MethodCore.
32904 * driver.cs: Added --fatal which makes errors throw exceptions.
32905 Load System assembly as well as part of the standard library.
32907 * report.cs: Allow throwing exceptions on errors for debugging.
32909 * modifiers.cs: Do not use `parent', instead use the real type
32910 container to evaluate permission settings.
32912 * class.cs: Put Ravi's patch back in. He is right, and we will
32913 have to cope with the
32915 2001-09-14 Ravi Pratap <ravi@ximian.com>
32917 * modifiers.cs (TypeAttr, MethodAttr, FieldAttr): Map protected internal to
32918 FamORAssem, not FamANDAssem.
32920 2001-09-14 Miguel de Icaza <miguel@ximian.com>
32922 * driver.cs: Added --parse option that only parses its input files
32925 * class.cs: Reverted last change from Ravi to IsTopLevel. That is
32926 incorrect. IsTopLevel is not used to tell whether an object is
32927 root_types or not (that can be achieved by testing this ==
32928 root_types). But to see if this is a top-level *class* (not
32929 necessarly our "toplevel" container).
32931 2001-09-14 Ravi Pratap <ravi@ximian.com>
32933 * enum.cs (Enum::Define): Modify to call the Lookup method on the
32934 parent instead of a direct call to GetType.
32936 2001-09-14 Ravi Pratap <ravi@ximian.com>
32938 * class.cs (TypeContainer::TypeAttr): Remove property code and move it into
32939 Modifiers.TypeAttr. This should just be a call to that method.
32941 * modifiers.cs (TypeAttr): Re-write and take an extra argument, the TypeContainer
32942 object so that we can determine if we are top-level or not.
32944 * delegate.cs (Delegate::Define): Update call to TypeAttr method to pass in the
32947 * enum.cs (Enum::Define): Ditto.
32949 * modifiers.cs (FieldAttr): Re-write.
32951 * class.cs (TypeContainer::IsTopLevel): Change accessibility to public.
32952 (TypeContainer::HaveStaticConstructor): New property to provide access
32953 to precisely that info.
32955 * modifiers.cs (MethodAttr): Re-write.
32956 (EventAttr): Remove altogether as there seems to be no ostensible use for it.
32958 * class.cs (TypeContainer::IsTopLevel): Re-write. root_types doesn't seem to be the parent
32959 of top-level types as claimed.
32961 2001-09-13 Miguel de Icaza <miguel@ximian.com>
32963 * expression.cs (MemberLookup): Fruitless attempt to lookup
32964 constructors. Maybe I need to emit default constructors? That
32965 might be it (currently .NET emits this for me automatically).
32966 (Invocation::OverloadResolve): Cope with Arguments == null.
32967 (Invocation::EmitArguments): new function, shared by the new
32968 constructor and us.
32969 (Invocation::Emit): Handle static and instance methods. Emit
32970 proper call instruction for virtual or non-virtual invocations.
32971 (New::Emit): Implement.
32972 (New::Resolve): Implement.
32973 (MemberAccess:Resolve): Implement.
32974 (MethodGroupExpr::InstanceExpression): used conforming to the spec
32975 to track instances.
32976 (FieldExpr::Resolve): Set type.
32978 * support.cs: Handle empty arguments.
32980 * cs-parser.jay (CompositeLookup, QualifierIdentifier,
32981 SimpleLookup): Auxiliary routines to help parse a qualifier
32984 Update qualifier_identifier rule.
32986 * codegen.cs: Removed debugging messages.
32988 * class.cs: Make this a global thing, this acts just as a "key" to
32989 objects that we might have around.
32991 (Populate): Only initialize method_builders_to_methods once.
32993 * expression.cs (PropertyExpr): Initialize type from the
32996 * codegen.cs (EmitContext::EmitBoolExpression): Use propper
32997 Resolve pattern. Attempt to implicitly convert value to boolean.
33000 * expression.cs: Set the type for the int32/int32 argument case.
33001 (Binary::ResolveOperator): Set the return type to boolean for
33002 comparission operators
33004 * typemanager.cs: Remove debugging print code.
33006 (Invocation::Resolve): resolve type.
33008 * class.cs: Allocate a MemberInfo of the correct size, as the code
33009 elsewhere depends on the test to reflect the correct contents.
33011 (Method::) Keep track of parameters, due to System.Reflection holes
33013 (TypeContainer::Populate): Keep track of MethodBuilders to Method
33016 (TypeContainer::FindMembers): Use ArrayList and then copy an array
33017 of the exact size and return that.
33019 (Class::LookupMethodByBuilder): New function that maps
33020 MethodBuilders to its methods. Required to locate the information
33021 on methods because System.Reflection bit us again.
33023 * support.cs: New file, contains an interface ParameterData and
33024 two implementations: ReflectionParameters and InternalParameters
33025 used to access Parameter information. We will need to grow this
33028 * expression.cs (Invocation::GetParameterData): implement a cache
33029 and a wrapper around the ParameterData creation for methods.
33030 (Invocation::OverloadResolve): Use new code.
33032 2001-09-13 Ravi Pratap <ravi@ximian.com>
33034 * class.cs (TypeContainer::EmitField): Remove and move into
33035 (Field::Define): here and modify accordingly.
33036 (Field.FieldBuilder): New member.
33037 (TypeContainer::Populate): Update accordingly.
33038 (TypeContainer::FindMembers): Implement.
33040 2001-09-13 Miguel de Icaza <miguel@ximian.com>
33042 * statement.cs: (VariableInfo::VariableType): New field to be
33043 initialized with the full type once it is resolved.
33045 2001-09-12 Miguel de Icaza <miguel@ximian.com>
33047 * parameter.cs (GetParameterInfo): Use a type cache to compute
33048 things only once, and to reuse this information
33050 * expression.cs (LocalVariableReference::Emit): Implement.
33051 (OpcodeCast::Emit): fix.
33053 (ParameterReference::Resolve): Implement.
33054 (ParameterReference::Emit): Implement.
33056 * cs-parser.jay: Fix bug introduced by Ravi, variable initializers
33057 that are expressions need to stay as Expressions.
33059 * typemanager.cs (CSharpName): Returns the C# name of a type if
33062 * expression.cs (Expression::ConvertImplicit): New function that
33063 implements implicit type conversions.
33065 (Expression::ImplicitReferenceConversion): Implements implicit
33066 reference conversions.
33068 (EmptyCast): New type for transparent casts.
33070 (OpcodeCast): New type for casts of types that are performed with
33071 a sequence of bytecodes.
33073 (BoxedCast): New type used for casting value types into reference
33074 types. Emits a box opcode.
33076 (Binary::DoNumericPromotions): Implements numeric promotions of
33077 and computation of the Binary::Type.
33079 (Binary::EmitBranchable): Optimization.
33081 (Binary::Emit): Implement code emission for expressions.
33083 * typemanager.cs (TypeManager): Added two new core types: sbyte
33086 2001-09-12 Ravi Pratap <ravi@ximian.com>
33088 * class.cs (TypeContainer::FindMembers): Method which does exactly
33089 what Type.FindMembers does, only we don't have to use reflection. No
33090 implementation yet.
33092 * typemanager.cs (typecontainers): New hashtable to hold the corresponding
33093 typecontainer objects as we need to get at them.
33094 (TypeManager::AddUserType): Overload to take an extra argument, the TypeContainer.
33096 * rootcontext.cs : Correspondingly modify called to AddUserType to pass the
33097 typecontainer object.
33099 * expression.cs (MemberLookup): Modify signature to take a RootContext object instead
33100 of just a Report object.
33102 2001-09-11 Ravi Pratap <ravi@ximian.com>
33104 * class.cs (Event::Define): Go back to using the prefixes "add_" and
33106 (TypeContainer::Populate): Now define the delegates of the type too.
33107 (TypeContainer.Delegates): Property to access the list of delegates defined
33110 * delegates.cs (Delegate::Define): Implement partially.
33112 * modifiers.cs (TypeAttr): Handle more flags.
33114 2001-09-11 Ravi Pratap <ravi@ximian.com>
33116 * class.cs (Indexer::Define): Fix for loop iteration condition to be just <
33118 (Operator::Define): Re-write logic to get types by using the LookupType method
33119 instead of blindly doing a Type.GetType ! How stupid can I get ;-) ?
33120 (Indexer::Define): Ditto.
33121 (Event::Define): Ditto.
33122 (Property::Define): Ditto.
33124 2001-09-10 Ravi Pratap <ravi@ximian.com>
33126 * class.cs (TypeContainer::Populate): Now define operators too.
33127 (TypeContainer.Operators): New property to access the list of operators
33129 (Operator.OperatorMethodBuilder): New member to hold the method builder
33130 for the operator we are defining.
33131 (Operator::Define): Implement.
33133 2001-09-10 Ravi Pratap <ravi@ximian.com>
33135 * class.cs (Event::Define): Make the prefixes of the accessor methods
33136 addOn_ and removeOn_
33138 * genericparser.cs (GenericParser::error): Overloaded method to handle the case
33139 of the location being passed in too. Ideally, this should go later since all
33140 error reporting should be done through the Report object.
33142 * class.cs (TypeContainer.Indexers): New property to access the list of indexers.
33143 (Populate): Iterate thru the indexers we have and define them too.
33144 (Indexer.GetMethodBuilder, .SetMethodBuilder): New members to hold the method builders
33145 for the get and set accessors.
33146 (Indexer::Define): Implement.
33148 2001-09-09 Miguel de Icaza <miguel@ximian.com>
33150 * expression.cs (Binary::Resolve): Beginning of it. I scratched
33151 my previous implementation, did not work.
33153 * typemanager.cs: Add a couple of missing types (the longs).
33155 * literal.cs: Use TypeManager.bool_type instead of getting it.
33157 * expression.cs (EventExpr): New kind of expressions.
33158 (Expressio::ExprClassFromMemberInfo): finish
33160 2001-09-08 Miguel de Icaza <miguel@ximian.com>
33162 * assign.cs: Emit stores to static fields differently.
33164 2001-09-08 Ravi Pratap <ravi@ximian.com>
33166 * Merge in changes and adjust code to tackle conflicts. Backed out my
33167 code in Assign::Resolve ;-)
33169 2001-09-08 Ravi Pratap <ravi@ximian.com>
33171 * cs-parser.jay (CheckAttributeTarget): Modify call to error to use
33172 instead Report.Error and also pass in the location.
33173 (CSharpParser::Lexer): New readonly property to return the reference
33174 to the Tokenizer object.
33175 (declare_local_variables): Use Report.Error with location instead of plain
33179 * class.cs (Operator::CheckUnaryOperator): Move into cs-parser.jay.
33180 (Operator.CheckBinaryOperator): Ditto.
33182 * cs-parser.jay (operator_declarator): Update accordingly.
33184 * cs-parser.jay (CheckUnaryOperator): Modify to use Report.Error
33185 (CheckBinaryOperator): Same here.
33187 * rootcontext.cs (LookupType): Add an extra lookup which simply does a lookup
33188 on the name without any prefixes of namespace names etc. This is because we
33189 already might have something already fully qualified like
33190 'System.Console.WriteLine'
33192 * assign.cs (Resolve): Begin implementation. Stuck ;-)
33194 2001-09-07 Ravi Pratap <ravi@ximian.com>
33196 * cs-tokenizer.cs (location): Return a string which also contains
33199 * expression.cs (ElementAccess): New class for expressions of the
33200 type 'element access.'
33201 (BaseAccess): New class for expressions of the type 'base access.'
33202 (CheckedExpr, UnCheckedExpr): New classes for Checked and Unchecked expressions
33205 * cs-parser.jay (element_access): Implement action.
33206 (base_access): Implement actions.
33207 (checked_expression, unchecked_expression): Implement.
33209 * cs-parser.jay (local_variable_type): Correct and implement.
33210 (type_suffixes, type_suffix_list, type_suffix): Implement actions.
33212 * cs-tokenizer.cs (real_type_suffix): Comment out the extra getchar.
33214 * cs-parser.jay (rank_specifiers): Remove space while concatenating the type's
33215 name and the specifiers.
33217 * interface.cs (InterfaceAttr): New property to return the corresponding TypeAttributes
33219 * rootcontext.cs (CreateInterface): Use the InterfaceAttr property instead of
33220 making them all public ;-)
33222 * cs-parser.jay (error): Remove entirely as we have an implementation in the base
33225 2001-09-07 Miguel de Icaza <miguel@ximian.com>
33227 * expression.cs (ExprClassFromMemberInfo): Return FieldExpr and
33229 (FieldExpr, PropertyExprs): New resolved expressions.
33230 (SimpleName::MemberStaticCheck): Perform static checks for access
33231 to non-static fields on static methods. Maybe this should be
33232 generalized for MemberAccesses.
33233 (SimpleName::ResolveSimpleName): More work on simple name
33236 * cs-parser.jay (primary_expression/qualified_identifier): track
33237 the parameter index.
33239 * codegen.cs (CodeGen::Save): Catch save exception, report error.
33240 (EmitContext::EmitBoolExpression): Chain to expression generation
33241 instead of temporary hack.
33242 (::EmitStatementExpression): Put generic expression code generation.
33244 * assign.cs (Assign::Emit): Implement variable assignments to
33245 local variables, parameters and fields.
33247 2001-09-06 Miguel de Icaza <miguel@ximian.com>
33249 * statement.cs (Block::GetVariableInfo): New method, returns the
33250 VariableInfo for a variable name in a block.
33251 (Block::GetVariableType): Implement in terms of GetVariableInfo
33253 * literal.cs (IntLiteral::Emit, FloatLiteral::Emit,
33254 DoubleLiteral::Emit, CharLiteral::Emit, BoolLiteral::Emit): Implement
33256 2001-09-06 Ravi Pratap <ravi@ximian.com>
33258 * cs-parser.jay (operator_declaration): Continue on my quest : update
33259 to take attributes argument.
33260 (event_declaration): Ditto.
33261 (enum_declaration): Ditto.
33262 (indexer_declaration): Ditto.
33264 * class.cs (Operator::Operator): Update constructor accordingly.
33265 (Event::Event): Ditto.
33267 * delegate.cs (Delegate::Delegate): Same here.
33269 * enum.cs (Enum::Enum): Same here.
33271 2001-09-05 Ravi Pratap <ravi@ximian.com>
33273 * cs-parser.jay (CheckAttributeTarget): Update to use the right error number.
33275 * ../tests/cs0658.cs : New file to demonstrate error 0658.
33277 * attribute.cs (Attributes): New class to encapsulate all attributes which were
33278 being passed around as an arraylist.
33279 (Attributes::AddAttribute): Method to add attribute sections.
33281 * cs-parser.jay (opt_attributes): Modify actions to use the new Attributes class.
33282 (struct_declaration): Update accordingly.
33283 (constant_declaration): Update.
33284 (field_declaration): Update.
33285 (method_header): Update.
33286 (fixed_parameter): Update.
33287 (parameter_array): Ditto.
33288 (property_declaration): Ditto.
33289 (destructor_declaration): Ditto.
33291 * class.cs (Struct::Struct): Update constructors accordingly.
33292 (Class::Class): Ditto.
33293 (Field::Field): Ditto.
33294 (Method::Method): Ditto.
33295 (Property::Property): Ditto.
33296 (TypeContainer::OptAttribute): update property's return type.
33298 * interface.cs (Interface.opt_attributes): New member.
33299 (Interface::Interface): Update to take the extra Attributes argument.
33301 * parameter.cs (Parameter::Parameter): Ditto.
33303 * constant.cs (Constant::Constant): Ditto.
33305 * interface.cs (InterfaceMemberBase): New OptAttributes field.
33306 (InterfaceMemberBase::InterfaceMemberBase): Update constructor to take
33307 the attributes as a parameter.
33308 (InterfaceProperty): Update constructor call.
33309 (InterfaceEvent): Ditto.
33310 (InterfaceMethod): Ditto.
33311 (InterfaceIndexer): Ditto.
33313 * cs-parser.jay (interface_indexer_declaration): Update call to constructor to
33314 pass the attributes too.
33315 (interface_event_declaration): Ditto.
33316 (interface_property_declaration): Ditto.
33317 (interface_method_declaration): Ditto.
33318 (interface_declaration): Ditto.
33320 2001-09-05 Miguel de Icaza <miguel@ximian.com>
33322 * class.cs (Method::Define): Track the "static Main" definition to
33323 create an entry point.
33325 * rootcontext.cs (RootContext::EntryPoint): MethodInfo that holds the
33326 EntryPoint if we find it.
33328 * codegen.cs (EmitContext::EmitInvocation): Emit invocations.
33329 (EmitContext::ig): Make this variable public.
33331 * driver.cs: Make the default output file be the first file name
33332 with the .exe extension.
33334 Detect empty compilations
33336 Handle various kinds of output targets. Handle --target and
33337 rename -t to --dumper.
33339 * expression.cs, literal.cs, assign.cs, constant.cs: All `Resolve'
33340 methods inherited from Expression return now an Expression. This
33341 will is used during the tree rewriting as we resolve them during
33344 (Expression::MemberLookup): Implements the MemberLookup (7.3) from
33345 the spec. Missing entirely is the information about
33346 accessability of elements of it.
33348 (Expression::ExprClassFromMemberInfo): New constructor for
33349 Expressions that creates a fully initialized Expression based on
33350 a MemberInfo that is one of Eventinfo, FieldINfo, PropertyInfo or
33353 (Invocation::Resolve): Begin implementing resolution of invocations.
33355 * literal.cs (StringLiteral): Implement Emit.
33357 2001-09-05 Ravi Pratap <ravi@ximian.com>
33359 * cs-parser.jay (error): Add new modifier because we are hiding an inherited
33362 2001-09-04 Ravi Pratap <ravi@ximian.com>
33364 * cs-parser.jay (attribute_arguments): Implement actions.
33365 (attribute): Fix bug in production. Implement action.
33366 (attribute_list): Implement.
33367 (attribute_target): Implement.
33368 (attribute_target_specifier, opt_target_specifier): Implement
33369 (CheckAttributeTarget): New method to check if the attribute target
33371 (attribute_section): Implement.
33372 (opt_attributes): Implement.
33374 * attribute.cs : New file to handle attributes.
33375 (Attribute): Class to hold attribute info.
33377 * cs-parser.jay (opt_attribute_target_specifier): Remove production
33378 (attribute_section): Modify production to use 2 different rules to
33379 achieve the same thing. 1 s/r conflict down !
33380 Clean out commented, useless, non-reducing dimension_separator rules.
33382 * class.cs (TypeContainer.attributes): New member to hold list
33383 of attributes for a type.
33384 (Struct::Struct): Modify to take one more argument, the attribute list.
33385 (Class::Class): Ditto.
33386 (Field::Field): Ditto.
33387 (Method::Method): Ditto.
33388 (Property::Property): Ditto.
33390 * cs-parser.jay (struct_declaration): Update constructor call to
33391 pass in the attributes too.
33392 (class_declaration): Ditto.
33393 (constant_declaration): Ditto.
33394 (field_declaration): Ditto.
33395 (method_header): Ditto.
33396 (fixed_parameter): Ditto.
33397 (parameter_array): Ditto.
33398 (property_declaration): Ditto.
33400 * constant.cs (Constant::Constant): Update constructor similarly.
33401 Use System.Collections.
33403 * parameter.cs (Parameter::Parameter): Update as above.
33405 2001-09-02 Ravi Pratap <ravi@ximian.com>
33407 * class.cs (TypeContainer::AddDelegate): New method to add a delegate.
33408 (TypeContainer.delegates): New member to hold list of delegates.
33410 * cs-parser.jay (delegate_declaration): Implement the action correctly
33411 this time as I seem to be on crack ;-)
33413 2001-09-02 Miguel de Icaza <miguel@ximian.com>
33415 * rootcontext.cs (RootContext::IsNamespace): new function, used to
33416 tell whether an identifier represents a namespace.
33418 * expression.cs (NamespaceExpr): A namespace expression, used only
33419 temporarly during expression resolution.
33420 (Expression::ResolveSimpleName, ::ResolvePrimary, ::ResolveName):
33421 utility functions to resolve names on expressions.
33423 2001-09-01 Miguel de Icaza <miguel@ximian.com>
33425 * codegen.cs: Add hook for StatementExpressions.
33427 * class.cs: Fix inverted test for static flag in methods.
33429 2001-09-02 Ravi Pratap <ravi@ximian.com>
33431 * class.cs (Operator::CheckUnaryOperator): Correct error number used
33432 to make it coincide with MS' number.
33433 (Operator::CheckBinaryOperator): Ditto.
33435 * ../errors/errors.txt : Remove error numbers added earlier.
33437 * ../errors/cs1019.cs : Test case for error # 1019
33439 * ../errros/cs1020.cs : Test case for error # 1020
33441 * cs-parser.jay : Clean out commented cruft.
33442 (dimension_separators, dimension_separator): Comment out. Ostensibly not
33443 used anywhere - non-reducing rule.
33444 (namespace_declarations): Non-reducing rule - comment out.
33446 * enum.cs (Enum::AddEnum): Rename to AddEnumMember as I was getting confused
33447 with TypeContainer::AddEnum.
33449 * delegate.cs : New file for delegate handling classes.
33450 (Delegate): Class for declaring delegates.
33452 * makefile : Update.
33454 * cs-parser.jay (delegate_declaration): Implement.
33456 2001-09-01 Ravi Pratap <ravi@che.iitm.ac.in>
33458 * class.cs (Event::Define): Implement.
33459 (Event.EventBuilder): New member.
33461 * class.cs (TypeContainer::Populate): Update to define all enums and events
33463 (Events): New property for the events arraylist we hold. Shouldn't we move to using
33464 readonly fields for all these cases ?
33466 2001-08-31 Ravi Pratap <ravi@che.iitm.ac.in>
33468 * class.cs (Property): Revamp to use the convention of making fields readonly.
33469 Accordingly modify code elsewhere.
33471 * class.cs : Apply patch from Mr. Mandar <go_mono@hotmail.com> for implementing
33472 the Define method of the Property class.
33474 * class.cs : Clean up applied patch and update references to variables etc. Fix
33476 (TypeContainer::Populate): Update to define all the properties we have. Also
33477 define all enumerations.
33479 * enum.cs (Define): Implement.
33481 2001-08-31 Ravi Pratap <ravi@che.iitm.ac.in>
33483 * cs-parser.jay (overloadable_operator): The semantic value is an
33484 enum of the Operator class.
33485 (operator_declarator): Implement actions.
33486 (operator_declaration): Implement.
33488 * class.cs (Operator::CheckUnaryOperator): New static method to help in checking
33489 validity of definitions.
33490 (Operator::CheckBinaryOperator): Static method to check for binary operators
33491 (TypeContainer::AddOperator): New method to add an operator to a type.
33493 * cs-parser.jay (indexer_declaration): Added line to actually call the
33494 AddIndexer method so it gets added ;-)
33496 * ../errors/errors.txt : Update to include new error numbers. Are these numbers
33497 already taken care of by the MS compiler ?
33499 2001-08-29 Ravi Pratap <ravi@che.iitm.ac.in>
33501 * class.cs (Operator): New class for operator declarations.
33502 (Operator::OpType): Enum for the various operators.
33504 2001-08-29 Ravi Pratap <ravi@che.iitm.ac.in>
33506 * class.cs (TypeContainer::AddIndexer): Remove FIXME comment. We
33507 ostensibly handle this in semantic analysis.
33509 * cs-parser.jay (general_catch_clause): Comment out
33510 (specific_catch_clauses, specific_catch_clause): Ditto.
33511 (opt_general_catch_clause, opt_specific_catch_clauses): Ditto
33512 (catch_args, opt_catch_args): New productions.
33513 (catch_clause): Rewrite to use the new productions above
33514 (catch_clauses): Modify accordingly.
33515 (opt_catch_clauses): New production to use in try_statement
33516 (try_statement): Revamp. Basically, we get rid of one unnecessary rule
33517 and re-write the code in the actions to extract the specific and
33518 general catch clauses by being a little smart ;-)
33520 * ../tests/try.cs : Fix. It's not 'finalize' my friend, it's 'finally' !
33521 Hooray, try and catch statements parse fine !
33523 2001-08-28 Ravi Pratap <ravi@che.iitm.ac.in>
33525 * statement.cs (Block::GetVariableType): Fix logic to extract the type
33526 string from the hashtable of variables.
33528 * cs-parser.jay (event_accessor_declarations): Trivial fix. Man, how did
33529 I end up making that mistake ;-)
33530 (catch_clauses): Fixed gross error which made Key and Value of the
33531 DictionaryEntry the same : $1 !!
33533 2001-08-28 Ravi Pratap <ravi@che.iitm.ac.in>
33535 * cs-tokenizer.cs (initTokens): Add keywords 'add' and 'remove'
33537 * cs-parser.jay (event_declaration): Correct to remove the semicolon
33538 when the add and remove accessors are specified.
33540 2001-08-28 Ravi Pratap <ravi@che.iitm.ac.in>
33542 * cs-parser.jay (IndexerDeclaration): New helper class to hold
33543 information about indexer_declarator.
33544 (indexer_declarator): Implement actions.
33545 (parsing_indexer): New local boolean used to keep track of whether
33546 we are parsing indexers or properties. This is necessary because
33547 implicit_parameters come into picture even for the get accessor in the
33548 case of an indexer.
33549 (get_accessor_declaration, set_accessor_declaration): Correspondingly modified.
33551 * class.cs (Indexer): New class for indexer declarations.
33552 (TypeContainer::AddIndexer): New method to add an indexer to a type.
33553 (TypeContainer::indexers): New member to hold list of indexers for the
33556 2001-08-27 Ravi Pratap <ravi@che.iitm.ac.in>
33558 * cs-parser.jay (add_accessor_declaration): Implement action.
33559 (remove_accessor_declaration): Implement action.
33560 (event_accessors_declaration): Implement
33561 (variable_declarators): swap statements for first rule - trivial.
33563 * class.cs (Event): New class to hold information about event
33565 (TypeContainer::AddEvent): New method to add an event to a type
33566 (TypeContainer::events): New member to hold list of events.
33568 * cs-parser.jay (event_declaration): Implement actions.
33570 2001-08-27 Ravi Pratap <ravi@che.iitm.ac.in>
33572 * cs-parser.jay (dim_separators): Implement. Make it a string
33573 concatenating all the commas together, just as they appear.
33574 (opt_dim_separators): Modify accordingly
33575 (rank_specifiers): Update accordingly. Basically do the same
33576 thing - instead, collect the brackets here.
33577 (opt_rank_sepcifiers): Modify accordingly.
33578 (array_type): Modify to actually return the complete type string
33579 instead of ignoring the rank_specifiers.
33580 (expression_list): Implement to collect the expressions
33581 (variable_initializer): Implement. We make it a list of expressions
33582 essentially so that we can handle the array_initializer case neatly too.
33583 (variable_initializer_list): Implement.
33584 (array_initializer): Make it a list of variable_initializers
33585 (opt_array_initializer): Modify accordingly.
33587 * expression.cs (New::NType): Add enumeration to help us
33588 keep track of whether we have an object/delegate creation
33589 or an array creation.
33590 (New:NewType, New::Rank, New::Indices, New::Initializers): New
33591 members to hold data about array creation.
33592 (New:New): Modify to update NewType
33593 (New:New): New Overloaded contructor for the array creation
33596 * cs-parser.jay (array_creation_expression): Implement to call
33597 the overloaded New constructor.
33599 2001-08-26 Ravi Pratap <ravi@che.iitm.ac.in>
33601 * class.cs (TypeContainer::Constructors): Return member
33602 constructors instead of returning null.
33604 2001-08-26 Miguel de Icaza <miguel@ximian.com>
33606 * typemanager.cs (InitCoreTypes): Initialize the various core
33607 types after we have populated the type manager with the user
33608 defined types (this distinction will be important later while
33609 compiling corlib.dll)
33611 * expression.cs, literal.cs, assign.cs, constant.cs: Started work
33612 on Expression Classification. Now all expressions have a method
33613 `Resolve' and a method `Emit'.
33615 * codegen.cs, cs-parser.jay: Fixed the bug that stopped code
33616 generation from working. Also add some temporary debugging
33619 2001-08-24 Miguel de Icaza <miguel@ximian.com>
33621 * codegen.cs: Lots of code generation pieces. This is only the
33622 beginning, will continue tomorrow with more touches of polish. We
33623 handle the fundamentals of if, while, do, for, return. Others are
33624 trickier and I need to start working on invocations soon.
33626 * gen-treedump.cs: Bug fix, use s.Increment here instead of
33629 * codegen.cs (EmitContext): New struct, used during code
33630 emission to keep a context. Most of the code generation will be
33633 * cs-parser.jay: Add embedded blocks to the list of statements of
33634 this block. So code generation proceeds in a top down fashion.
33636 2001-08-23 Miguel de Icaza <miguel@ximian.com>
33638 * statement.cs: Add support for multiple child blocks.
33640 2001-08-22 Miguel de Icaza <miguel@ximian.com>
33642 * codegen.cs (EmitCode): New function, will emit the code for a
33643 Block of code given a TypeContainer and its ILGenerator.
33645 * statement.cs (Block): Standard public readonly optimization.
33646 (Block::Block constructors): Link children.
33647 (Block::Child): Child Linker.
33648 (Block::EmitVariables): Emits IL variable declarations.
33650 * class.cs: Drop support for MethodGroups here, delay until
33652 (Method::): Applied the same simplification that I did before, and
33653 move from Properties to public readonly fields.
33654 (Method::ParameterTypes): Returns the parameter types for the
33655 function, and implements a cache that will be useful later when I
33656 do error checking and the semantic analysis on the methods is
33658 (Constructor::GetCallingConvention): Renamed from CallingConvetion
33659 and made a method, optional argument tells whether this is a class
33660 or a structure to apply the `has-this' bit.
33661 (Method::GetCallingConvention): Implement, returns the calling
33663 (Method::Define): Defines the type, a second pass is performed
33664 later to populate the methods.
33666 (Constructor::ParameterTypes): implement a cache similar to the
33667 one on Method::ParameterTypes, useful later when we do semantic
33670 (TypeContainer::EmitMethod): New method. Emits methods.
33672 * expression.cs: Removed MethodGroup class from here.
33674 * parameter.cs (Parameters::GetCallingConvention): new method.
33676 2001-08-21 Miguel de Icaza <miguel@ximian.com>
33678 * class.cs (TypeContainer::Populate): Drop RootContext from the
33681 (Constructor::CallingConvention): Returns the calling convention.
33682 (Constructor::ParameterTypes): Returns the constructor parameter
33685 (TypeContainer::AddConstructor): Keep track of default constructor
33686 and the default static constructor.
33688 (Constructor::) Another class that starts using `public readonly'
33689 instead of properties.
33691 (Constructor::IsDefault): Whether this is a default constructor.
33693 (Field::) use readonly public fields instead of properties also.
33695 (TypeContainer::TypeAttr, TypeContainer::AddConstructor): Keep
33696 track of static constructors; If none is used, turn on
33697 BeforeFieldInit in the TypeAttributes.
33699 * cs-parser.jay (opt_argument_list): now the return can be null
33700 for the cases where there are no arguments.
33702 (constructor_declarator): If there is no implicit `base' or
33703 `this', then invoke the default parent constructor.
33705 * modifiers.cs (MethodAttr): New static function maps a set of
33706 modifiers flags into a MethodAttributes enum
33707 (FieldAttr): renamed from `Map'. So now we have FieldAttr,
33708 MethodAttr, TypeAttr to represent the various mappings where the
33709 modifiers are used.
33710 (FieldAttr): Map also `readonly' to `FieldAttributes.InitOnly'
33712 2001-08-19 Miguel de Icaza <miguel@ximian.com>
33714 * parameter.cs (GetParameterInfo): Fix bug where there would be no
33717 * interface.cs (PopulateIndexer): Implemented the code generator
33718 for interface indexers.
33720 2001-08-17 Miguel de Icaza <miguel@ximian.com>
33722 * interface.cs (InterfaceMemberBase): Now we track the new status
33725 (PopulateProperty): Implement property population. Woohoo! Got
33726 Methods and Properties going today.
33728 Removed all the properties for interfaces, and replaced them with
33729 `public readonly' fields.
33731 2001-08-16 Miguel de Icaza <miguel@ximian.com>
33733 * interface.cs (AddEvent, AddMethod, AddIndexer, AddProperty):
33734 initialize their hashtables/arraylists only when they are needed
33735 instead of doing this always.
33737 * parameter.cs: Handle refs and out parameters.
33739 * cs-parser.jay: Use an ArrayList to construct the arguments
33740 instead of the ParameterCollection, and then cast that to a
33743 * parameter.cs: Drop the use of ParameterCollection and use
33744 instead arrays of Parameters.
33746 (GetParameterInfo): Use the Type, not the Name when resolving
33749 2001-08-13 Miguel de Icaza <miguel@ximian.com>
33751 * parameter.cs: Eliminate the properties Name, Type and ModFlags,
33752 and instead use public readonly fields.
33754 * class.cs: Put back walking code for type containers.
33756 2001-08-11 Miguel de Icaza <miguel@ximian.com>
33758 * class.cs (MakeConstant): Code to define constants.
33760 * rootcontext.cs (LookupType): New function. Used to locate types
33763 2001-08-08 Miguel de Icaza <miguel@ximian.com>
33765 * rootcontext.cs: OH MY! My trick works! It is amazing how nice
33766 this System.Reflection code is. Kudos to Microsoft
33768 * typemanager.cs: Implement a type cache and avoid loading all
33769 types at boot time. Wrap in LookupType the internals. This made
33770 the compiler so much faster. Wow. I rule!
33772 * driver.cs: Make sure we always load mscorlib first (for
33773 debugging purposes, nothing really important).
33775 * Renamespaced things that were on `CSC' to `CIR'. Maybe I should
33776 have moved to `CSC' rather than `CIR'. Oh man! The confussion!
33778 * rootcontext.cs: Lookup types on their namespace; Lookup types
33779 on namespaces that have been imported using the `using' keyword.
33781 * class.cs (TypeContainer::TypeAttr): Virtualize.
33782 (Class::TypeAttr): Return attributes suitable for this bad boy.
33783 (Struct::TypeAttr): ditto.
33784 Handle nested classes.
33785 (TypeContainer::) Remove all the type visiting code, it is now
33786 replaced with the rootcontext.cs code
33788 * rootcontext.cs (GetClassBases): Added support for structs.
33790 2001-08-06 Miguel de Icaza <miguel@ximian.com>
33792 * interface.cs, statement.cs, class.cs, parameter.cs,
33793 rootcontext.cs, gen-treedump.cs, enum.cs, cs-parse.jay:
33794 Drop use of TypeRefs, and use strings instead.
33796 2001-08-04 Miguel de Icaza <miguel@ximian.com>
33800 * class.cs (Struct::Struct): set the SEALED flags after
33801 checking the modifiers.
33802 (TypeContainer::TypeAttr): new property, returns the
33803 TypeAttributes for a class.
33805 * cs-parser.jay (type_list): Oops, list production was creating a
33806 new list of base types.
33808 * rootcontext.cs (StdLib): New property.
33809 (GetInterfaceTypeByName): returns an interface by type name, and
33810 encapsulates error handling here.
33811 (GetInterfaces): simplified.
33812 (ResolveTree): Encapsulated all the tree resolution here.
33813 (CreateClass, GetClassBases, GetInterfaceOrClass): Create class
33816 * driver.cs: Add support for --nostdlib, to avoid loading the
33817 default assemblies.
33818 (Main): Do not put tree resolution here.
33820 * rootcontext.cs: Beginning of the class resolution.
33822 2001-08-03 Miguel de Icaza <miguel@ximian.com>
33824 * rootcontext.cs: Provide better error reporting.
33826 * cs-parser.jay (interface_base): set our $$ to be interfaces.
33828 * rootcontext.cs (CreateInterface): Handle the case where there
33829 are no parent interfaces.
33831 (CloseTypes): Routine to flush types at the end.
33832 (CreateInterface): Track types.
33833 (GetInterfaces): Returns an array of Types from the list of
33834 defined interfaces.
33836 * typemanager.c (AddUserType): Mechanism to track user types (puts
33837 the type on the global type hash, and allows us to close it at the
33840 2001-08-02 Miguel de Icaza <miguel@ximian.com>
33842 * tree.cs: Removed RecordType, added RecordClass, RecordStruct and
33843 RecordInterface instead.
33845 * cs-parser.jay: Updated to reflect changes above.
33847 * decl.cs (Definition): Keep track of the TypeBuilder type that
33848 represents this type here. Not sure we will use it in the long
33849 run, but wont hurt for now.
33851 * driver.cs: Smaller changes to accomodate the new code.
33853 Call ResolveInterfaceBases, Call ResolveClassBases, Save assembly
33856 * rootcontext.cs (CreateInterface): New method, used to create
33857 the System.TypeBuilder type for interfaces.
33858 (ResolveInterfaces): new entry point to resolve the interface
33860 (CodeGen): Property, used to keep track of the code generator.
33862 2001-07-26 Miguel de Icaza <miguel@ximian.com>
33864 * cs-parser.jay: Add a second production for delegate_declaration
33867 (enum_body): Put an opt_comma here instead of putting it on
33868 enum_body or enum_member_declarations so we can handle trailing
33869 commas on enumeration members. Gets rid of a shift/reduce.
33871 (type_list): Need a COMMA in the middle.
33873 (indexer_declaration): Tell tokenizer to recognize get/set
33875 * Remove old targets.
33877 * Re-add the parser target.
33879 2001-07-13 Simon Cozens <simon@simon-cozens.org>
33881 * cs-parser.jay: Add precendence rules for a number of operators
33882 ot reduce the number of shift/reduce conflicts in the grammar.
33884 2001-07-17 Miguel de Icaza <miguel@ximian.com>
33886 * tree.cs: moved IGenerator interface and renamed it to ITreeDump
33889 Get rid of old crufty code.
33891 * rootcontext.cs: Use this to keep track of the parsed
33892 representation and the defined types available to the program.
33894 * gen-treedump.cs: adjust for new convention.
33896 * type.cs: Split out the type manager, and the assembly builder
33899 * typemanager.cs: the type manager will live here now.
33901 * cil-codegen.cs: And the code generator here.
33903 2001-07-14 Sean MacIsaac <macisaac@ximian.com>
33905 * makefile: Fixed up for easy making.
33907 2001-07-13 Simon Cozens <simon@simon-cozens.org>
33909 * cs-parser.jay (rank_specifier): Remove a conflict by reordering
33912 (unary_expression): Expand pre_increment_expression and
33913 post_decrement_expression to reduce a shift/reduce.
33915 2001-07-11 Simon Cozens
33917 * cs-tokenizer.cs: Hex numbers should begin with a 0.
33919 Improve allow_keyword_as_indent name.
33921 2001-06-19 Miguel de Icaza <miguel@ximian.com>
33923 * Adjustments for Beta2.
33925 2001-06-13 Miguel de Icaza <miguel@ximian.com>
33927 * decl.cs: Added `Define' abstract method.
33928 (InTransit): new property, used to catch recursive definitions.
33930 * interface.cs: Implement `Define'.
33932 * modifiers.cs: Map Modifiers.constants to
33933 System.Reflection.TypeAttribute flags.
33935 * class.cs: Keep track of types and user-defined types.
33936 (BuilderInit): New method for creating an assembly
33937 (ResolveType): New function to launch the resolution process, only
33938 used by interfaces for now.
33940 * cs-parser.jay: Keep track of Classes, Structs and Interfaces
33941 that are inserted into the name space.
33943 2001-06-08 Miguel de Icaza <miguel@ximian.com>
33945 * ARGH. I have screwed up my tree so many times due to the use of
33946 rsync rather than using CVS. Going to fix this at once.
33948 * driver.cs: Objetify driver. Load assemblies, use assemblies to
33951 2001-06-07 Miguel de Icaza <miguel@ximian.com>
33953 * Experiment successful: Use System.Type rather that our own
33956 2001-05-25 Miguel de Icaza <miguel@ximian.com>
33958 * cs-parser.jay: Removed nsAliases from here.
33960 Use new namespaces, handle `using XXX;'
33962 * namespace.cs: Reimplemented namespace handling, use a recursive
33963 definition of the class. Now we can keep track of using clauses
33964 and catch invalid using clauses.
33966 2001-05-24 Miguel de Icaza <miguel@ximian.com>
33968 * gen-treedump.cs: Adapted for all the renaming.
33970 * expression.cs (Expression): this class now has a Type property
33971 which returns an expression Type.
33973 (Probe::, New::, TypeOf::, SizeOf::, Constant::): renamed from
33974 `Type', as this has a different meaning now in the base
33976 2001-05-22 Miguel de Icaza <miguel@ximian.com>
33978 * interface.cs, class.cs: Removed from all the sources the
33979 references to signature computation, as we can not do method
33980 signature computation during the parsing time, as we are not
33981 trying to solve at that point distinguishing:
33985 void a (NS.Blah x) {}
33988 Which depending on the context might be valid or not, as we do not
33989 know if Blah is the same thing as NS.Blah at that point.
33991 * Redid everything so the code uses TypeRefs now instead of
33992 Types. TypeRefs are just temporary type placeholders, that need
33993 to be resolved. They initially have a pointer to a string and the
33994 current scope in which they are used. This is used later by the
33995 compiler to resolve the reference to an actual Type.
33997 * DeclSpace is no longer a CIR.Type, and neither are
33998 TypeContainers (Class and Struct) nor Interfaces nor Enums. They
33999 are all DeclSpaces, but no Types.
34001 * type.cs (TypeRefManager): This implements the TypeRef manager,
34002 which keeps track of all the types that need to be resolved after
34003 the parsing has finished.
34005 2001-05-13 Miguel de Icaza <miguel@ximian.com>
34007 * ARGH. We are going to have to store `foreach' as a class rather
34008 than resolving it, as we need to verify error 1579 after name
34009 resolution. *OR* we could keep a flag that says `This request to
34010 IEnumerator comes from a foreach statement' which we can then use
34011 to generate the error.
34013 2001-05-10 Miguel de Icaza <miguel@ximian.com>
34015 * class.cs (TypeContainer.AddMethod): we now add methods to the
34016 MethodGroup instead of the method hashtable.
34018 * expression.cs: Add MethodGroup abstraction, which gets us one
34019 step closer to the specification in the way we handle method
34022 * cs-parser.jay (primary_expression): qualified_identifier now
34023 tried to match up an identifier to a local variable reference or
34024 to a parameter reference.
34026 current_local_parameters is now a parser global variable that
34027 points to the current parameters for the block, used during name
34030 (property_declaration): Now creates an implicit `value' argument to
34033 2001-05-09 Miguel de Icaza <miguel@ximian.com>
34035 * parameter.cs: Do not use `param' arguments as part of the
34036 signature, per the spec.
34038 2001-05-08 Miguel de Icaza <miguel@ximian.com>
34040 * decl.cs: Base class for classes, structs and interfaces. This
34041 is the "Declaration Space"
34043 * cs-parser.jay: Use CheckDef for checking declaration errors
34044 instead of having one on each function.
34046 * class.cs: Factor out some code for handling error handling in
34047 accordance to the "Declarations" section in the "Basic Concepts"
34048 chapter in the ECMA C# spec.
34050 * interface.cs: Make all interface member classes derive from
34051 InterfaceMemberBase.
34053 2001-05-07 Miguel de Icaza <miguel@ximian.com>
34055 * Many things: all interfaces are parsed and generated in
34056 gen-treedump. Support for member variables, constructors,
34057 destructors, properties, constants is there.
34059 Beginning of the IL backend, but very little done, just there for
34062 2001-04-29 Miguel de Icaza <miguel@ximian.com>
34064 * cs-parser.jay: Fix labeled statement.
34066 * cs-tokenizer.cs (escape): Escape " and ' always.
34067 ref_line, ref_name: keep track of the line/filename as instructed
34068 by #line by the compiler.
34071 2001-04-27 Miguel de Icaza <miguel@ximian.com>
34073 * System.CodeDOM/CodeBinaryOperatorExpression.cs: Rearrange enum
34074 to match the values in System.CodeDOM.
34076 Divid renamed to Divide.
34078 * System.CodeDOM/CodeForLoopStatement.cs: Always have valid
34080 (Statements.set): remove.
34082 * System.CodeDOM/CodeCatchClause.cs: always have a valid
34085 * System.CodeDOM/CodeIfStatement.cs: trueStatements and
34086 falseStatements always have valid values.
34088 * cs-parser.jay: Use System.CodeDOM now.