1 2009-11-19 Marek Safar <marek.safar@gmail.com>
3 * *.cs: Made constant expressions fully compatible with any other
6 2009-11-19 Marek Safar <marek.safar@gmail.com>
8 * *.cs: DoResolve is a worker method and has to be protected.
10 2009-11-18 Marek Safar <marek.safar@gmail.com>
12 * *.cs: More context specific handling.
14 2009-11-17 Marek Safar <marek.safar@gmail.com>
16 * *.cs: More context specific handling.
18 2009-11-16 Marek Safar <marek.safar@gmail.com>
20 * dynamic.cs, class.cs: Removed few fixed user types conversions.
22 * symbolwriter.cs: Uses public ILOffset.
24 2009-11-13 Marek Safar <marek.safar@gmail.com>
27 * generic.cs: Another missing TypeToCoreType, still too many to fix.
29 2009-11-13 Marek Safar <marek.safar@gmail.com>
33 * class.cs, delegate.cs, enum.cs: Constants have to be available
34 for parameters resolve.
36 2009-11-12 Marek Safar <marek.safar@gmail.com>
38 * typemanager.cs, argument.cs, support.cs, delegate.cs: Dynamic
41 2009-11-12 Marek Safar <marek.safar@gmail.com>
43 * argument.cs, context.cs, expression.cs, ecore.cs: Dynamic binding
44 with a statically known candidate set.
46 2009-11-11 Scott Peterson <lunchtimemama@gmail.com>
48 * generic.cs: Made type inflation for generic constraint checks
49 recursive. This fixes BGO #553655.
51 2009-11-11 Marek Safar <marek.safar@gmail.com>
53 * dynamic.cs, decl.cs, expression.cs, ecore.cs: More dynamic type
56 2009-11-10 Marek Safar <marek.safar@gmail.com>
58 * typemanager.cs, generic.cs, parameter.cs, argument.cs, dynamic.cs,
59 linq.cs, rootcontext.cs, ecore.cs, class.cs, delegate.cs,
60 attribute.cs: Add some dynamic error checking.
62 2009-11-07 Marek Safar <marek.safar@gmail.com>
66 * expression.cs: Fixed mixed version of expression tree anonymous
69 2009-11-06 Marek Safar <marek.safar@gmail.com>
73 * linq.cs, expression.cs, class.cs, cs-parser.jay: Initialize
74 expression tree version of anonymous type with members declaration.
76 2009-11-05 Marek Safar <marek.safar@gmail.com>
78 * parameter.cs: Handle nullable parameter default expression.
80 * argument.cs, dynamic.cs, expression.cs, support.cs, ecore.cs,
81 class.cs, attribute.cs: Check for wrong dynamic arguments.
83 2009-11-05 Marek Safar <marek.safar@gmail.com>
85 * statement.cs: Dynamic statements.
87 2009-11-04 Marek Safar <marek.safar@gmail.com>
89 * dynamic.cs, assign.cs, context.cs, expression.cs, ecore.cs:
90 Compound assignments over dynamic type.
92 2009-11-03 Marek Safar <marek.safar@gmail.com>
94 * argument.cs, dynamic.cs, expression.cs, delegate.cs: Dynamic
95 constructor arguments.
97 2009-10-30 Marek Safar <marek.safar@gmail.com>
99 * dynamic.cs, convert.cs, assign.cs, constant.cs, expression.cs,
100 codegen.cs: Unary mutator on dynamic member access expression.
102 2009-10-29 Marek Safar <marek.safar@gmail.com>
104 A fix for bug #550580
105 * convert.cs: Don't eliminate explicit precission casts.
107 2009-10-28 Marek Safar <marek.safar@gmail.com>
109 A fix for bug #550404
111 * parameter.cs, iterators.cs, context.cs, anonymous.cs,
112 expression.cs, statement.cs, ecore.cs: Quote any nested expression
115 2009-10-27 Marek Safar <marek.safar@gmail.com>
117 * constant.cs, nullable.cs: Create nullable-null as LiftedNull
120 * class.cs: Allow nullable binary user operators.
122 2009-10-26 Marek Safar <marek.safar@gmail.com>
124 * expression.cs: Move binary expression optimization at the end of
127 2009-10-23 Marek Safar <marek.safar@gmail.com>
129 * constant.cs, nullable.cs, expression.cs, literal.cs, cfold.cs:
130 Separate NullConstant from NullLiteral.
132 2009-10-23 Marek Safar <marek.safar@gmail.com>
134 * typemanager.cs, eval.cs, decl.cs, roottypes.cs, context.cs,
135 anonymous.cs, expression.cs, rootcontext.cs, ecore.cs, class.cs,
136 flowanalysis.cs, cs-parser.jay, driver.cs, codegen.cs: Split
137 ModuleContainer. Add common unclosed member check routine.
139 2009-10-22 Marek Safar <marek.safar@gmail.com>
141 * argument.cs: Use literal flag for real literals only.
143 * dynamic.cs: Use correct return type for custom delegates.
145 2009-10-22 Marek Safar <marek.safar@gmail.com>
147 * dynamic.cs, expression.cs: Pass logical binary flag to dynamic
150 2009-10-22 Marek Safar <marek.safar@gmail.com>
152 * dynamic.cs, ecore.cs: Dynamic invocation with void return type.
154 2009-10-21 Marek Safar <marek.safar@gmail.com>
156 * dynamic.cs, convert.cs, expression.cs, ecore.cs: Wrap array index
159 2009-10-21 Marek Safar <marek.safar@gmail.com>
161 * typemanager.cs, dynamic.cs, expression.cs: Don't resolve runtime
164 2009-10-20 Marek Safar <marek.safar@gmail.com>
166 * argument.cs, dynamic.cs, expression.cs: Latest API update.
168 2009-10-19 Marek Safar <marek.safar@gmail.com>
170 * typemanager.cs, expression.cs: Dynamic array initializer.
172 2009-10-16 Marek Safar <marek.safar@gmail.com>
174 * typemanager.cs, rootcontext.cs: Clear -nostdlib flag when object
177 2009-10-16 Marek Safar <marek.safar@gmail.com>
179 A fix for bug #493523, #507067
180 * convert.cs, nullable.cs, expression.cs: Do implicit and explicit
181 standard nullable conversion using underlying standard conversion
182 and not full conversion.
184 2009-10-15 Marek Safar <marek.safar@gmail.com>
186 * dynamic.cs, expression.cs, ecore.cs, delegate.cs: Check return
187 type in VerifyArgumentsCompat.
189 2009-10-15 Marek Safar <marek.safar@gmail.com>
191 * nullable.cs, expression.cs, statement.cs, namespace.cs, ecore.cs:
192 Reject variable used with type arguments.
194 2009-10-14 Marek Safar <marek.safar@gmail.com>
196 * argument.cs, dynamic.cs, assign.cs, expression.cs, ecore.cs:
197 Implement dynamic expressions assignment.
199 2009-10-14 Marek Safar <marek.safar@gmail.com>
201 * expression.cs: Build underlying expression when resolving unary
204 2009-10-14 Marek Safar <marek.safar@gmail.com>
206 * expression.cs: Emit enum array initializer using binary blob.
208 2009-10-08 Marek Safar <marek.safar@gmail.com>
210 * typemanager.cs, constant.cs: Optimize decimal constants which fit
213 2009-10-07 Marek Safar <marek.safar@gmail.com>
215 * typemanager.cs: Reset object_type.
217 * assign: Made SimpleAssign public.
219 2009-10-06 Marek Safar <marek.safar@gmail.com>
221 * typemanager.cs, decl.cs, namespace.cs, ecore.cs, class.cs: Pass
222 invocation assembly to IsThisOrFriendAssembly.
224 2009-10-05 Marek Safar <marek.safar@gmail.com>
226 * expression.cs: Equality comparison of generic parameter with
229 2009-10-05 Marek Safar <marek.safar@gmail.com>
231 A fix for bug #543570
232 * generic.cs: Import predefined constraints correctly.
234 2009-10-02 Marek Safar <marek.safar@gmail.com>
236 * ecore.cs: Don't crash on overloads with optional paremeters where
237 arguments count overflows.
239 * parameter.cs: Import optional parameter constants using optional
242 2009-10-01 Marek Safar <marek.safar@gmail.com>
244 * Makefile: Default is gmcs compiler.
246 2009-10-01 Marek Safar <marek.safar@gmail.com>
248 * cs-parser.jay: Fixed few NRE.
250 2009-10-01 Marek Safar <marek.safar@gmail.com>
252 * cs-parser.jay, driver.cs: Expose parser exception in verbose mode.
254 2009-09-30 Marek Safar <marek.safar@gmail.com>
256 * linq.cs, convert.cs, assign.cs, expression.cs, ecore.cs: Add
257 ShimExpression, ImplicitCast.
259 2009-09-30 Marek Safar <marek.safar@gmail.com>
261 A fix for bug #542959
262 * delegate.cs: Emit correct delegate instance variable when there
263 are static and non-static overloads.
265 2009-09-29 Marek Safar <marek.safar@gmail.com>
267 * dynamic.cs, linq.cs, anonymous.cs, expression.cs, statement.cs,
268 ecore.cs, cs-parser.jay: Unary expression dynamic compiler.
270 2009-09-28 Marek Safar <marek.safar@gmail.com>
272 A fix for bug #542487
273 * ecore.cs: Resolve extension methods hidden by properties.
275 2009-09-25 Marek Safar <marek.safar@gmail.com>
277 * expression.cs, ecore.cs: More dynamic binary expressions.
279 2009-09-22 Marek Safar <marek.safar@gmail.com>
281 * nullable.cs, expression.cs: Fixed null lifted conversion for
282 bitwise enum operations.
284 2009-09-22 Marek Safar <marek.safar@gmail.com>
286 * convert.cs, ecore.cs: Fixed explicit unsafe coversion of long
287 values in checked context.
289 2009-09-22 Marek Safar <marek.safar@gmail.com>
291 * expression.cs, ecore.cs: Fixed array index constant conversion.
293 2009-09-20 Miguel de Icaza <miguel@novell.com>
295 * expression.cs: Do not crash when MemberLookup returns something
296 that is not a MemberExpr here. Report error 582 instead.
300 2009-09-18 Marek Safar <marek.safar@gmail.com>
302 * decl.cs, class.cs: Check protected property accessors.
304 2009-09-18 Marek Safar <marek.safar@gmail.com>
306 * dynamic.cs, assign.cs: Dynamic compound assignment.
308 2009-09-17 Marek Safar <marek.safar@gmail.com>
310 * expression.cs: Fixed compound assignment explicit conversion.
312 2009-09-17 Marek Safar <marek.safar@gmail.com>
314 * expression.cs, ecore.cs: Cannot infer variables from method group.
316 2009-09-16 Marek Safar <marek.safar@gmail.com>
318 * argument.cs, dynamic.cs, convert.cs, context.cs, anonymous.cs,
319 constant.cs, nullable.cs, expression.cs, literal.cs, ecore.cs,
320 codegen.cs: Dynamic binary operations scaffolding.
322 2009-09-15 Marek Safar <marek.safar@gmail.com>
324 * expression.cs: Fixes nullable promotion for enum type variables.
326 2009-09-11 Marek Safar <marek.safar@gmail.com>
328 * driver.cs, dynamic.cs: Reset more static variables.
330 2009-09-11 Marek Safar <marek.safar@gmail.com>
332 * dynamic.cs, expression.cs, rootcontext.cs, namespace.cs, ecore.cs,
333 driver.cs: Introduced Expression::MakeExpression.
335 2009-09-11 Marek Safar <marek.safar@gmail.com>
337 * eval.cs: Exposed MessageOutput instead of cleaning up eval API.
339 2009-09-09 Marek Safar <marek.safar@gmail.com>
341 * eval.cs, report.cs: Use Console.Out for all eval error or warning
344 2009-09-09 Marek Safar <marek.safar@gmail.com>
346 A fix for bug #518707
347 * expression.cs (Is): Optimize only generic parameter type
348 expression probing value type generic parameter.
350 2009-09-09 Marek Safar <marek.safar@gmail.com>
352 A fix for bug #532571
353 * ecore.cs: Check for simple name type arguments used with
356 2009-09-08 Marek Safar <marek.safar@gmail.com>
358 A fix for bug #497421
359 * generic.cs (CheckConstraint): Don't use buildin types to check for
360 parameterless constructor.
362 2009-09-08 Marek Safar <marek.safar@gmail.com>
364 A fix for bug #537402
365 * generic.cs (CheckConstraint): Correctly inflate generic type
366 arguments when checking generic method.
368 2009-09-08 Marek Safar <marek.safar@gmail.com>
370 A fix for bug #536463
371 * decl.cs (AddToContainer): Don't report collision between explicit
372 and parameterless non-explicit members.
374 2009-09-08 Marek Safar <marek.safar@gmail.com>
376 * eval.cs: Reset more static stuff.
378 2009-09-07 Marek Safar <marek.safar@gmail.com>
380 A fix for bug #324625
381 * expression.cs, ecore.cs: Create nested generic type expression
382 using declaring and not current type.
384 2009-09-07 Marek Safar <marek.safar@gmail.com>
386 * *.cs: Changed Report class to accept various output printers and
387 be an instance class. An expression resolver can now use different
388 message reporter for each call and Report.Error can safely throw
389 an exception. Part of ongoing work to turn mcs into proper library.
391 2009-09-04 Marek Safar <marek.safar@gmail.com>
393 * statement.cs, ecore.cs: Removed error reporting from emit code.
395 2009-09-04 Marek Safar <marek.safar@gmail.com>
397 * cs-parser.jay, parameter.cs: Moved parser check out of constructor
399 2009-09-03 Marek Safar <marek.safar@gmail.com>
401 * anonymous.cs, expression.cs, statement.cs, cs-parser.jay: Moved
402 parser checks out of constructors.
404 2009-09-02 Marek Safar <marek.safar@gmail.com>
406 * expression.cs, statement.cs, ecore.cs: Use common Report.Error.
408 2009-09-02 Marek Safar <marek.safar@gmail.com>
410 A fix for bug #535448
411 * anonymous.cs, class.cs: Copy return label between all contexts.
413 2009-09-02 Marek Safar <marek.safar@gmail.com>
415 A fix for bug #535395
416 * namespace.cs: Resolve context can be null.
418 2009-08-25 Marek Safar <marek.safar@gmail.com>
420 A fix for bug #533912
421 * generic.cs: Use correct context for constraints resolving.
423 2009-08-25 Marek Safar <marek.safar@gmail.com>
425 A fix for bug #532630
426 * driver.cs: Trim conditional symbols.
428 2009-08-25 Marek Safar <marek.safar@gmail.com>
430 * context.cs: New file.
432 * *.exe.sources, *.csproj: Updated.
434 2009-08-25 Marek Safar <marek.safar@gmail.com>
436 * generic.cs, parameter.cs, decl.cs, statement.cs, namespace.cs,
437 class.cs, generic-mcs.cs, codegen.cs: Add GetSignatureForError to
438 IMembercontext, some small cleanups.
440 2009-08-24 Marek Safar <marek.safar@gmail.com>
442 * *.cs: Split ResolveContext and EmitContext.
444 2009-08-24 Marek Safar <marek.safar@gmail.com>
446 * *.cs: Only ResolveContext implements IMemberContext.
448 2009-08-21 Marek Safar <marek.safar@gmail.com>
450 * *.cs: Renamed IResolveContext to IMemberContext.
452 2009-08-21 Marek Safar <marek.safar@gmail.com>
454 * *.cs: Detached ResolveContext from EmitContext.
456 2009-08-21 Marek Safar <marek.safar@gmail.com>
458 * codegen.cs: Moved flow-analysis to BlockContext.
460 2009-08-21 Marek Safar <marek.safar@gmail.com>
462 * *.cs: Detached BlockContext from EmitContext.
464 2009-08-20 Gonzalo Paniagua Javier <gonzalo@novell.com>
466 * statement.cs: avoid nullref when the return value of GetEnumerator()
467 does not contain any MoveNext() method.
469 2009-08-19 Marek Safar <marek.safar@gmail.com>
471 * *.cs: Removed IResolveContext::GenericDeclContainer.
473 2009-08-19 Marek Safar <marek.safar@gmail.com>
475 * class.cs, delegate.cs: Changed Delegate to be TypeContainer based.
477 2009-08-19 Marek Safar <marek.safar@gmail.com>
479 * generic.cs, iterators.cs, expression.cs, statement.cs, ecore.cs,
480 cs-parser.jay, attribute.cs, codegen.cs: Better error reports.
482 2009-08-18 Marek Safar <marek.safar@gmail.com>
484 * *.cs: Removed boolean fields from EmitContext.
486 2009-08-18 Marek Safar <marek.safar@gmail.com>
488 * *.cs: Add IResolveContext::IsStatic.
490 2009-08-18 Marek Safar <marek.safar@gmail.com>
492 * *.cs: Moved TopBlock's methods from EmitContext to TopBlock.
494 2009-08-17 Marek Safar <marek.safar@gmail.com>
496 * *.cs: Removed DeclContainer from EmitContext.
498 2009-08-17 Marek Safar <marek.safar@gmail.com>
500 * *.cs: Add IResolveContext::CurrentTypeParameters.
502 2009-08-14 Marek Safar <marek.safar@gmail.com>
504 * *.cs: Removed TypeContainer and ContainerType from EmitContext.
506 2009-08-14 Marek Safar <marek.safar@gmail.com>
508 * decl.cs, expression.cs, namespace.cs, ecore.cs, class.cs,
509 codegen.cs: Add IResolveContext::LookupExtensionMethod.
511 2009-08-13 Marek Safar <marek.safar@gmail.com>
513 * decl.cs: Look in PartialContainer for parent type parameters.
515 2009-08-13 Marek Safar <marek.safar@gmail.com>
517 * decl.cs, namespace.cs, ecore.cs, class.cs, attribute.cs,
518 codegen.cs: Add IResolveContext::LookupTypeParameter.
520 2009-08-13 Marek Safar <marek.safar@gmail.com>
522 * lambda.cs, expression.cs, statement.cs, namespace.cs, ecore.cs:
523 Moved resolved logic from Emit to Resolve.
525 2009-08-13 Marek Safar <marek.safar@gmail.com>
527 * parameter.cs, decl.cs, roottypes.cs, class.cs, attribute.cs,
528 codegen.cs: Reworked atttributes handling of ResolveContext.
530 2009-08-12 Marek Safar <marek.safar@gmail.com>
532 * decl.cs, ecore.cs, class.cs, attribute.cs, codegen.cs: Pushed
533 LookupNamespaceOrType to ResolveContext.
535 2009-08-12 Marek Safar <marek.safar@gmail.com>
537 * typemanager.cs, decl.cs, expression.cs, namespace.cs, ecore.cs,
538 class.cs: Removed unused parameters and methods.
540 2009-08-11 Marek Safar <marek.safar@gmail.com>
542 * generic.cs, lambda.cs, anonymous.cs, statement.cs, generic-mcs.cs,
543 codegen.cs: Finding the best common type of a set of expressions for
546 2009-08-07 Marek Safar <marek.safar@gmail.com>
548 * dynamic.cs, expression.cs: More dynamic conversions.
550 2009-08-06 Miguel de Icaza <miguel@novell.com>
552 * generic.cs: This loop was incorrect, it was increment ii, but
553 checking for `i'. This was a change introduced to fix #327497,
556 * class.cs: Catch another case for cs0533 error, fixes #324782.
558 2009-08-06 Rodrigo Kumpera <rkumpera@novell.com>
560 * typemanager.cs (GetGenericArguments): SRE returns null for
561 generic methods on type builder instances if they are not generic
562 themselves. For example, for Foo<int>::Bar() it returns null, but
563 not for Foo<int>::Bar<>() or Foo<int>::Bar<double>().
565 2009-08-05 Marek Safar <marek.safar@gmail.com>
567 * argument.cs, dynamic.cs, expression.cs, ecore.cs, class.cs,
568 delegate.cs: Work on dynamic binding.
570 2009-08-04 Marek Safar <marek.safar@gmail.com>
572 A second fix for bug #525342
573 * class.cs: Attach partial method attributes to method
576 2009-08-03 Marek Safar <marek.safar@gmail.com>
578 * typemanager.cs, parameter.cs, support.cs, class.cs: Dynamic type
581 * rootcontext.cs: Default to langversion v4.
583 2009-08-03 Marek Safar <marek.safar@gmail.com>
585 * pending.cs: Check return type before member info is set.
587 2009-08-03 Marek Safar <marek.safar@gmail.com>
589 * anonymous.cs: Fully initialize generic hoisted field expression.
591 2009-08-02 Miguel de Icaza <miguel@novell.com>
593 * cs-parser.jay: Flag variables declared on the interactive shell
594 as used to prevent the 168 warning about local variable not being
597 2009-07-31 Marek Safar <marek.safar@gmail.com>
599 * parameter.cs, dynamic.cs, support.cs, class.cs, delegate.cs,
600 attribute.cs: Emit dynamic export attribute.
602 2009-07-30 Marek Safar <marek.safar@gmail.com>
604 * expression.cs: More verifier work.
606 2009-07-29 Marek Safar <marek.safar@gmail.com>
608 * nullable.cs: Fixed SRE crash during corlib compilation.
610 2009-07-29 Marek Safar <marek.safar@gmail.com>
612 * generic.cs, typemanager.cs, decl.cs, iterators.cs, convert.cs,
613 nullable.cs, expression.cs, ecore.cs, class.cs, attribute.cs:
614 More TypeManager.TypeToCoreType needed.
616 2009-07-29 Marek Safar <marek.safar@gmail.com>
618 * anonymous.cs: Update after recent SRE fixes.
620 2009-07-28 Marek Safar <marek.safar@gmail.com>
622 * typemanager.cs, expression.cs, ecore.cs, delegate.cs: Use correct
623 version of GetFieldHandle for fields of generic types.
625 2009-07-27 Marek Safar <marek.safar@gmail.com>
627 * typemanager.cs, argument.cs, convert.cs, assign.cs, expression.cs,
628 ecore.cs: Add TypeManager.IsDynamicType,
629 PredefinedAttributes.Dynamic.
631 2009-07-27 Marek Safar <marek.safar@gmail.com>
633 A fix for bug #415375
634 * expression.cs: Fixed object and reference type parameter
637 2009-07-27 Marek Safar <marek.safar@gmail.com>
639 A fix for bug #525342
640 * class.cs: Attach partial method attributes to method
643 2009-07-24 Marek Safar <marek.safar@gmail.com>
645 * argument.cs, dynamic.cs, expression.cs, class.cs, attribute.cs:
648 2009-07-24 Marek Safar <marek.safar@gmail.com>
650 * anonymous.cs (MutateField): Add imported types handling.
652 2009-07-23 Marek Safar <marek.safar@gmail.com>
654 * expression.cs, delegate.cs: Moved arguments resolve into their
655 counterparts expressions. Removed argument resolve from
656 CollectionElementInitializer.
658 2009-07-23 Marek Safar <marek.safar@gmail.com>
660 A fix for bug #523683
661 * convert.cs, delegate.cs: Use common overload mechanism for method
662 group conversion check.
664 2009-07-22 Marek Safar <marek.safar@gmail.com>
666 A fix for bug #523899
667 * generics.cs: Exact type inference with other bound types.
669 2009-07-22 Raja R Harinath <harinath@hurrynot.org>
671 Don't complain when the same type is implemented by the output
672 assembly as well as multiple referenced assemblies
673 * namespace.cs (RootNamespace.LookupTypeReflection): Add
674 'must_be_unique' flag.
675 (GlobalRootNamespace): Update to changes.
676 (Namespace.LookupType): Pass 'must_be_unique' only when we don't
677 already have a type in hand.
679 2009-07-22 Marek Safar <marek.safar@gmail.com>
681 * expression.cs: More verifier instrumentation.
683 * statement.cs: Do proper throw expression conversion.
685 2009-07-22 Marek Safar <marek.safar@gmail.com>
687 A fix for bug #522789
688 * expression.cs: Mutate invocation return type.
690 2009-07-16 Marek Safar <marek.safar@gmail.com>
692 * anonymous.cs: Split assignable and readonly generated variable
695 2009-07-16 Marek Safar <marek.safar@gmail.com>
697 A fix for bug #521671
698 * statement.cs: Fixed crash when checking missing type.
700 2009-07-16 Marek Safar <marek.safar@gmail.com>
702 * typemanager.cs, generic.cs, argument.cs, linq.cs, convert.cs,
703 assign.cs, expression.cs, statement.cs, support.cs, ecore.cs,
704 class.cs, driver.cs: Work on dynamic binding.
706 * dynamic.cs: New file.
708 * *.sources, *.proj: Updated.
710 2009-07-15 Marek Safar <marek.safar@gmail.com>
712 * expression.cs (Conditional): Avoid double Resolve.
714 2009-07-13 Marcus Griep <marcus@griep.us>
716 * ecore.cs: Fix obscure bug with resolving members of interfaces
717 that hide parent interface members. Fixes bug #444388 and corrects
720 2009-07-13 Marek Safar <marek.safar@gmail.com>
722 * expression.cs (LocalVariableReference): Bounce resolve.
724 2009-07-10 Marek Safar <marek.safar@gmail.com>
726 * typemanager.cs, lambda.cs, parameter.cs, convert.cs, anonymous.cs,
727 expression.cs, literal.cs, ecore.cs, complete.cs: Moved internal
730 * support.cs: New dynamic type wrapper.
732 2009-07-08 Marek Safar <marek.safar@gmail.com>
734 * ecore.cs, cs-parser.jay: Better error reporting for implicitly
735 typed local variable.
737 2009-07-06 Marek Safar <marek.safar@gmail.com>
739 A fix for bug #519005
740 * anonymous.cs: Use null_type as no return type placeholder.
742 2009-07-02 Marek Safar <marek.safar@gmail.com>
744 * generic.cs: Handle type inference of identical type parameters
745 with different bounds.
747 2009-07-01 Marek Safar <marek.safar@gmail.com>
749 * expression.cs, class.cs: Events variance.
751 * cs-parser.jay: Interface events error messages.
753 2009-07-01 Marek Safar <marek.safar@gmail.com>
755 * generic.cs, argument.cs: Updated type inference logic to C# 4.0.
757 2009-06-29 Marek Safar <marek.safar@gmail.com>
759 * parameter.cs, convert.cs, expression.cs, class.cs: Default
760 parameter expression can be value-type New.
762 * cs-parser.jay: Clean up too many parameter modifier boolean flags.
764 2009-06-26 Marek Safar <marek.safar@gmail.com>
766 * generic.cs, argument.cs, expression.cs, ecore.cs, cs-parser.jay:
767 Implemented C# 4.0 named arguments.
769 2009-06-24 Marek Safar <marek.safar@gmail.com>
771 * typemanager.cs, parameter.cs, iterators.cs, convert.cs,
772 expression.cs, ecore.cs, delegate.cs: Removed unnecessary ArgList
773 parameter modifier. Also fixes bug #515497.
775 2009-06-24 Marek Safar <marek.safar@gmail.com>
777 * *.cs: Replaced ArrayList with Arguments in need of a nonsequential
778 arguments expression to be implemented.
780 *.sources: Add argument.cs
782 2009-06-23 Marek Safar <marek.safar@gmail.com>
784 * parameter.cs: Moved GetParameterIndexByName to base class.
786 * expression.cs, statement.cs, ecore.cs, delegate.cs: Removed
787 unused AType. Use argument's version of GetExpressionTree.
789 2009-06-22 Marek Safar <marek.safar@gmail.com>
791 * expression.cs, cs-parser.jay, attribute.cs, codegen.cs: Named
794 2009-06-17 Marek Safar <marek.safar@gmail.com>
796 A fix for bug #514096
797 * class.cs: Allow IntPtr/UIntPtr fields to be volatile.
799 2009-06-17 Marek Safar <marek.safar@gmail.com>
801 * expression.cs: The first multi-dimensional array nested array
802 initializers was not checked.
804 * statement.cs (Switch): Fixed error message to reflect 2.0 changes.
806 2009-06-17 Marek Safar <marek.safar@gmail.com>
808 A fix for bug #513400
809 * nullable.cs (EmitEquality): Operands emit could be simplified for
810 built-in types when we now emit user operators differently.
812 2009-06-16 Marek Safar <marek.safar@gmail.com>
814 * ecore.cs: Report inaccessible delegate methods correctly.
816 2009-06-16 Marek Safar <marek.safar@gmail.com>
818 * parameter.cs, expression.cs, ecore.cs, class.cs, delegate.cs,
819 cs-parser.jay: Implemented C# 4.0 optional parameters.
821 2009-06-16 Marek Safar <marek.safar@gmail.com>
823 * driver.cs: Removed broken DefineManifestResource.
825 2009-06-16 Raja R Harinath <harinath@hurrynot.org>
827 * Makefile [net_2_0_bootstrap]: Don't explicitly mention net_1_1.
828 Use $(BOOTSTRAP_PROFILE) instead.
830 2009-06-12 Jb Evain <jbevain@novell.com>
832 * rootcontext.cs: add a Platform field.
833 * driver.cs: handle /platform.
834 * codegen.cs: pass the proper flags according to
835 the platform when saving the assembly.
837 2009-06-11 Marek Safar <marek.safar@gmail.com>
839 * parameter.cs, const.cs, report.cs, cs-parser.jay, attribute.cs:
840 Add optional parameters grammar.
842 2009-06-10 Marek Safar <marek.safar@gmail.com>
844 * eval.cs, anonymous.cs, report.cs, rootcontext.cs, cs-parser.jay,
845 driver.cs: Split lang version and metadata version.
847 2009-06-10 Marek Safar <marek.safar@gmail.com>
849 * decl.cs: Better overload ctor collision error message.
851 2009-06-05 Jb Evain <jbevain@novell.com>
853 * driver.cs (EmbededResource): avoid using an internal method
854 in gmcs to embed manifest resources.
856 2009-06-04 Sebastien Pouliot <sebastien@ximian.com>
858 * generic.cs, parameter.cs: Avoid using 'var' so we can bootstrap
859 the compiler from older mono versions (like moon's bots)
861 2009-06-04 Marek Safar <marek.safar@gmail.com>
863 * namespace.cs (LookupTypeReflection): Ignore collisions between
866 2009-06-04 Marek Safar <marek.safar@gmail.com>
868 * codegen.cs: Enabled generic type forwarders.
870 2009-06-04 Marek Safar <marek.safar@gmail.com>
872 * dmcs.*: Add another version of SRE compiler.
874 2009-06-03 Marek Safar <marek.safar@gmail.com>
876 * generic.cs, typemanager.cs, parameter.cs, convert.cs,
877 generic-mcs.cs: Fixed variant type conversions.
879 2009-06-02 Marek Safar <marek.safar@gmail.com>
881 A fix for bug #507863
882 * codegen.cs: Fixes a crash on invalid string value attribute.
884 2009-06-01 Marek Safar <marek.safar@gmail.com>
886 A fix for bug #508334
887 * typemanager.cs, parameter.cs, convert.cs, expression.cs, ecore.cs,
888 cs-parser.jay: Fully import __arglist modifier.
890 2009-05-29 Marek Safar <marek.safar@gmail.com>
892 * generic.cs, typemanager.cs, parameter.cs, ecore.cs, class.cs,
893 delegate.cs, generic-mcs.cs: Rewrote type variance checks to
894 actually work with closed generic types.
896 2009-05-27 Alan McGovern <amcgovern@novell.com>
898 * class.cs, decl.cs, delegate.cs, parameter.cs:
899 Fix the build by replacing the use of 'var' with the actual type.
901 2009-05-27 Marek Safar <marek.safar@gmail.com>
903 * generic.cs, parameter.cs, decl.cs, ecore.cs, class.cs, delegate.cs
904 cs-parser.jay, generic-mcs.cs: Report wrong variant types
907 * driver.cs, rootcontext.cs, report.cs: Add 3.0 language version
910 2009-05-26 Rodrigo Kumpera <rkumpera@novell.com>
911 Marek Safar <marek.safar@gmail.com>
913 A fix for bug #377509
914 * parameter.cs: Use predefined and not empty name for implicit
917 2009-05-21 Marek Safar <marek.safar@gmail.com>
919 * class.cs: Don't report wrong warnings for event fields.
921 2009-05-21 Marek Safar <marek.safar@gmail.com>
923 A fix for bug #504667
924 * class.cs: Check for static class using parent container instead of
927 2009-05-08 Marek Safar <marek.safar@gmail.com>
929 A fix for bug #496922
930 * expression.cs: Always use temporary variable when using object
933 2009-04-28 Marek Safar <marek.safar@gmail.com>
935 A fix for bug #495112
936 * class.cs (IsUnmanagedType): Handle recursive unmanaged types using
939 2009-04-27 Miguel de Icaza <miguel@novell.com>
941 * driver.cs: Add a flag to work as a replacement for CSC in VS.
943 2009-04-24 Miguel de Icaza <miguel@novell.com>
945 * complete.cs: No idea how gonzalo got a null in the list, but
948 2009-04-24 Miguel de Icaza <miguel@novell.com>
950 * complete.cs (CompletionElementInitializer): New completion class
951 to support completing inside a C# 3 element initializer, so this
952 allows completion for Silverlight situations where it is very
955 new TextBlock () { Fo<TAB>
957 (CompletionSimpleName): Expose the prefix that was
958 passed to the simple name.
960 * cs-parser.jay (object_or_collection_initializer): Add support
961 for element_initializers.
963 * expression.cs (CollectionOrObjectInitializers.DoResolve):
964 special case completion expressions as this method aggressively
965 collects data before it operates, and errors were being thrown
966 earlier than we were able to complete.
968 2009-04-23 Miguel de Icaza <miguel@novell.com>
970 * eval.cs: Make getcompletions silent and enable debugging output
971 if the -v option is passed.
973 * namespace.cs (NamespaceEntry.CompletionGetTypesStartingWith):
974 Consider looking up the namespace that matches the prefix being
977 This is part of the support for allowing completions like:
978 `System.Co<TAB>' to complete to System.Console.
980 * complete.cs (CompletionSimpleName.AppendResults): Make this
983 2009-04-21 Raja R Harinath <harinath@hurrynot.org>
985 * cs-parser.jay (GetTokenName): Mark GENERATE_COMPLETION and
986 COMPLETE_COMPLETION as internal.
988 2009-04-17 Miguel de Icaza <miguel@novell.com>
990 * complete.cs: Include namespace resolution in simple names as
991 well as global types and types in the using scope in the
994 * namespace.cs: Supporting infrastrcture to provide completions
995 based on the current using scope.
997 * eval.cs: Introduce an entry point that allows for initialization
998 to return a list of the files passed on the command line.
1000 2009-04-14 Marek Safar <marek.safar@gmail.com>
1002 A fix for bug #494243
1003 * report.cs (SymbolRelatedToPreviousError): Fixed NRE.
1005 2009-04-13 Marek Safar <marek.safar@gmail.com>
1007 A fix for bug #493887
1008 * statement.cs: Don't skip string multi-section with default or
1009 null label when populating string hashtable.
1011 2009-04-06 Marek Safar <marek.safar@gmail.com>
1013 A fix for bug #492329
1014 * expression.cs (New): Load variable when assigning type parameter
1017 2009-04-06 Marek Safar <marek.safar@gmail.com>
1019 A fix for bug #488960
1020 * decl.cs: Compare MVAR types using non-null values.
1022 2009-03-27 Marek Safar <marek.safar@gmail.com>
1024 * typemanager.cs, expression.cs: Removed unused nullable checks.
1026 2009-03-27 Marek Safar <marek.safar@gmail.com>
1028 * *.cs: Removed some gmcs conditionals.
1030 2009-03-26 Marek Safar <marek.safar@gmail.com>
1032 * generic.cs, support.cs: Moved generics stuff out of support.cs
1034 2009-03-24 Marek Safar <marek.safar@gmail.com>
1036 * ecore.cs, expression.cs: Use queried type for MethodGroupExpr
1039 2009-03-23 Marek Safar <marek.safar@gmail.com>
1041 * attribute.cs: Consider all members for error reporting when
1042 checking named arguments.
1044 2009-03-23 Marek Safar <marek.safar@gmail.com>
1046 A fix for bug #487625
1047 * namespace.cs: Use a warning for all predefined type conflicts.
1049 2009-03-23 Marek Safar <marek.safar@gmail.com>
1051 A fix for bug #485706
1052 * statement.cs: Explicitly type catch type argument to pass verifier
1055 2009-03-22 Miguel de Icaza <miguel@novell.com>
1057 Initial support to provide code completion facilities to consumers
1058 of the evaluator API.
1060 * cs-tokenizer.cs (CompleteOnEOF): this new property is used to
1061 support the completion engine. When we reach the end of the
1062 input stream instead of returning EOF, when this flag is true the
1063 tokenizer instead produces:
1065 One GENERATE_COMPLETION token: this token then must be
1066 handled in the grammar at every point where the user
1067 would likely request a completion.
1069 As many COMPLETE_COMPLETION tokens as necessary. These
1070 tokens are generated to assist the parser in unwinding and
1071 producing a valid parse tree.
1073 The parser rules do not have to be perfect, the parser needs to be
1074 augmented with judicious use of GENERATE_COMPLETION tokens to
1075 improve the areas where we can provide completion and the parser
1076 needs to add support for COMPLETE_COMPLETION tokens in productions
1079 It is common to not have enough support for COMPLETE_COMPLETION
1080 under certain rules and that even if we generated the
1081 GENERATE_COMPLETION token that the resulting tree will be invalid
1082 due to the missing rules that support COMPLETE_COMPLETION.
1084 The final EOF token is produced by having the parser notify the
1085 tokenizer when it reaches the root production that the next token
1088 * support.cs (CompletionResult): New Exception. This exception
1089 is thrown to return the completion results when one of the special
1090 completion expressions is reached.
1092 This exception is thrown by the completing ExpressionStatements
1093 classes that live in complete.cs
1095 * complete.cs (CompletingExpression): a new base class for
1096 completing expressions. This derives from the
1097 ExpressionStatement class and not from Expression as it allows
1098 completion to happen not only where expressions are expected in
1099 the grammar, but also where statements are expected.
1101 (CompletionSimpleName): A new class used to provide completions
1102 for SimpleNames. This currently only resolves to local
1103 variables from the evaluator context (GetVars call).
1105 (CompletionMemberAccess): Implements support for completing member
1108 * cs-parser.jay: Add support for completion in a few places.
1110 * eval.cs (GetCompletions): New public API for the evaluator that
1111 returns a list of possible completions given the input. The
1112 return value is an array of completions
1114 * anonymous.cs (Compatible): If the exception thrown from the
1115 resolved expression is a CompletionResult exception let that one
1116 through instead of printing a diagnostic error in the try/catch.
1118 2009-03-22 Miguel de Icaza <miguel@novell.com>
1122 * driver.cs (Main): Use Environment.Exit to quit quickly and
1123 prevent the compiler from doing the usual wait for helper thread
1126 This is to prevent a slowdown that was reported by Gonzalo on
1129 2009-03-19 Marek Safar <marek.safar@gmail.com>
1131 * ecore.cs: Load build-in types directly instead of accessing
1134 2009-03-18 Marek Safar <marek.safar@gmail.com>
1136 * ecore.cs: Always use unbox.any when available.
1138 2009-03-18 Marek Safar <marek.safar@gmail.com>
1140 * class.cs: Always set TypeAttributes.BeforeFieldInit conditionally.
1142 2009-03-17 Marek Safar <marek.safar@gmail.com>
1144 * generic.cs: Removed obsolete version of type inference.
1146 2009-03-16 Marek Safar <marek.safar@gmail.com>
1148 * typemanager.cs, decl.cs, roottypes.cs, anonymous.cs, nullable.cs,
1149 expression.cs, rootcontext.cs, namespace.cs, ecore.cs, class.cs,
1150 delegate.cs, flowanalysis.cs, cs-parser.jay, driver.cs,
1151 attribute.cs, codegen.cs: Changed RootTypes to be ModuleContainer.
1153 2009-03-11 Marek Safar <marek.safar@gmail.com>
1155 A fix for bug #482996
1156 * anonymous.cs: Make sure we are not infering return type when
1157 checking type compatibility.
1159 2009-03-11 Marek Safar <marek.safar@gmail.com>
1161 * typemanager.cs, generic.cs, parameter.cs, decl.cs, const.cs,
1162 rootcontext.cs, namespace.cs, class.cs, delegate.cs, driver.cs,
1163 generic-mcs.cs, attribute.cs, codegen.cs: Maintain predefined
1164 attributes in their own structure. Needed when accessing their
1165 properties before they are resolved.
1167 2009-03-09 Marek Safar <marek.safar@gmail.com>
1169 * cs-tokenizer.cs: Optimized GetKeyword using an array instead of
1170 hashtable (~10x faster).
1172 * driver.cs: Removed wrong Reset.
1174 2009-03-08 Marek Safar <marek.safar@gmail.com>
1176 * class.cs: Use correct common base type for unmanaged delayed
1179 * rootcontext.cs: Wrap unhandled exception.
1181 2009-03-06 Raja R Harinath <harinath@hurrynot.org>
1183 Make SeekableStreamReader self-tuning and arbitrarily seekable
1184 * support.cs (SeekableStreamReader.ResetStream): New. Allocates
1186 (SeekableStreamReader.Position.set): Use it. Simplify logic
1187 which, as a side-effect, makes it arbitrarily-seekable. Tune the
1188 buffer size when the stream needs to be re-read from the beginning.
1190 2009-03-05 Marek Safar <marek.safar@gmail.com>
1192 A fix for bug #480100
1193 * parameter.cs: A parameter is not hoisted when used directly as ET.
1195 2009-03-04 Marek Safar <marek.safar@gmail.com>
1197 * statement.cs: Fixed an issue when using variable is of interface
1200 2009-03-03 Marek Safar <marek.safar@gmail.com>
1202 A fix for bug #480319
1203 * report.cs, driver.cs: Support -warnaserror-:<warning list> option.
1205 2009-03-03 Marek Safar <marek.safar@gmail.com>
1207 A fix for bug #480867
1208 * typemanager.cs, expression.cs, ecore.cs: Changed method group
1209 expression to have no valid type.
1211 2009-03-03 Marek Safar <marek.safar@gmail.com>
1213 A fix for bug #481258
1214 * class.cs: Set extension method flag in partial container.
1216 2009-03-03 Marek Safar <marek.safar@gmail.com>
1218 * statement.cs, typemanager.cs: Use expression for StringEmitter.
1220 * attribute.cs: Add sanity check.
1222 2009-02-27 Marek Safar <marek.safar@gmail.com>
1224 * class.cs: Add external constructor error.
1226 2009-02-26 Marek Safar <marek.safar@gmail.com>
1228 A fix for bug #475354
1229 * convert.cs, nullable.cs, expression.cs, statement.cs: Emit
1230 correctly user defined nullable equality operators.
1232 2009-02-25 Marek Safar <marek.safar@gmail.com>
1234 A fix for bug #479532
1235 * expression.cs: Implement NewInitialize::AddressOf.
1237 2009-02-25 Marek Safar <marek.safar@gmail.com>
1239 A fix for bug #413633
1240 * expression.cs: Iterate all base class-constraint types.
1242 2009-02-24 Marek Safar <marek.safar@gmail.com>
1244 A fix for bug #479209
1245 * literal.cs: Mutate null underlying type.
1247 2009-02-24 Marek Safar <marek.safar@gmail.com>
1249 A fix for bug #476295
1250 * convert.cs: Avoid wrapping implicitly convertible reference type.
1252 2009-02-23 Marek Safar <marek.safar@gmail.com>
1254 * iterators.cs: Create MemberName correctly.
1256 2009-02-23 Marek Safar <marek.safar@gmail.com>
1258 A fix for bug #478655
1259 * literal.cs: Check also underlying null type conversion.
1261 2009-02-21 Marek Safar <marek.safar@gmail.com>
1263 * generic.cs, ecore.cs, class.cs: Removed redundant AsAccessible.
1265 2009-02-20 Marek Safar <marek.safar@gmail.com>
1267 A fix for bug #477447
1268 * statement.cs: Add reference to correct parent storey when this
1269 is accessible from deep children storey (more than 1 level).
1271 2009-02-19 Marek Safar <marek.safar@gmail.com>
1273 A fix for bug #475860 by David Mitchell <dmitchell@logos.com>
1274 * class.cs: Define base type members before setting up member cache.
1276 2009-02-18 Marek Safar <marek.safar@gmail.com>
1278 A fix for bug #477378
1279 * nullable.cs, expression.cs, statement.cs: More precise null type
1282 2009-02-18 Marek Safar <marek.safar@gmail.com>
1284 A fix for bug #472805
1285 * typemanager.cs, namespace.cs: Import only visible extension method
1288 2009-02-18 Marek Safar <marek.safar@gmail.com>
1290 A fix for bug #476895
1291 * attribute.cs: Use correct resolve context for attribute type.
1293 2009-02-18 Marek Safar <marek.safar@gmail.com>
1295 A fix for bug #476266
1296 * anonymous.cs: Mutate multi-dimensional arrays.
1298 2009-02-18 Marek Safar <marek.safar@gmail.com>
1300 A fix for bug #476400
1301 * statement.cs, expression.cs: Removed wrong Dispose optimization.
1303 2009-02-18 Marek Safar <marek.safar@gmail.com>
1305 A fix for bug #476811
1306 * generics.cs: Fixed null-literal check.
1308 2009-02-17 Marek Safar <marek.safar@gmail.com>
1310 * typemanager.cs, convert.cs, flowanalysis.cs, driver.cs,
1311 expression.cs, ecore.cs, rootcontext.cs, eval.cs, class.cs: More
1312 messing with static variables.
1314 2009-02-16 Marek Safar <marek.safar@gmail.com>
1316 A fix for bug #475965
1317 * generics.cs: Check generic parameter type after extracting from
1320 2009-02-16 Marek Safar <marek.safar@gmail.com>
1322 A fix for bug #475823
1323 * convert.cs, expression.cs, literal.cs, ecore.cs, cfold.cs: Add
1326 2009-02-14 Marek Safar <marek.safar@gmail.com>
1328 * modifiers.cs, decl.cs, ecore.cs, class.cs, flowanalysis.cs:
1329 Simplified event field definition using backing field and not
1330 field builder directly.
1332 * expression.cs (EmitLdArg): Optimize fast paths.
1334 2009-02-13 Marek Safar <marek.safar@gmail.com>
1336 A fix for bug #475327
1337 * expression.cs (ArrayCreation): Don't mutate values optimized away.
1339 2009-02-13 Marek Safar <marek.safar@gmail.com>
1341 A fix for bug #475342
1342 * cs-parser.jay: Using 'super' instead of 'base' to call base
1343 constructor crashes compiler.
1345 2009-02-13 Marek Safar <marek.safar@gmail.com>
1347 A fix for bug #475354
1348 * expression.cs (Constantify): Add nullable types.
1350 * const.cs (EmitDecimalConstant): Avoid explicit cast.
1352 2009-02-12 Marek Safar <marek.safar@gmail.com>
1354 A fix for bug #475246
1355 * expression.cs: More broken flowanalysis hacking needed.
1357 2009-02-12 Marek Safar <marek.safar@gmail.com>
1359 * attribute.cs: Compare only ref/out array modifiers.
1361 2009-02-11 Marek Safar <marek.safar@gmail.com>
1363 * statement.cs: Use member cache when looking for foreach members.
1365 2009-02-11 Marek Safar <marek.safar@gmail.com>
1367 * expression.cs: Don't expose internal initializer types.
1369 * statement.cs: Check also explicit conversions for goto case.
1371 2009-02-11 Marek Safar <marek.safar@gmail.com>
1373 * convert.cs, statement.cs: Removed usage of IsAssignableFrom.
1375 2009-02-10 Marek Safar <marek.safar@gmail.com>
1377 * *.cs: Replace null-type with NullLiteral where appropriate.
1379 2009-02-09 Marek Safar <marek.safar@gmail.com>
1381 * expression.cs: Initializer of reference argument use temporary
1382 variable to be verifiable.
1384 * parameter.cs: Share EmitLdArg.
1386 2009-02-09 Marek Safar <marek.safar@gmail.com>
1388 A fix for bug #473559
1389 * class.cs: Fixed: Not reporting error about nested class with the
1392 2009-02-06 Scott Peterson <lunchtimemama@gmail.com>
1394 Contributed under the MIT/X11 license.
1396 * generic.cs: Added VerifyVariantTypeParameters which performs new
1397 variance verification logic. The old logic, based on the spec, was
1398 wrong because the spec is full of LIES!
1400 * generic-mcs.cs: Stubbed out the VerifyVariantTypeParameters method.
1402 *typemanager.cs: Moved variance verification logic to GenericTypeExpr.
1405 * ecore.cs: Added calls to the new variance verification logic.
1408 * delegate.cs: Removed calls to the old variance verification logic.
1410 2009-02-06 Marek Safar <marek.safar@gmail.com>
1412 * delegate.cs: Use cached Invoke method directly.
1414 2009-02-06 Marek Safar <marek.safar@gmail.com>
1416 * expression.cs: Emit expression tree for hoisted variable access.
1418 2009-02-04 Marek Safar <marek.safar@gmail.com>
1420 * namespace.cs: Add better extension class check.
1422 2009-02-05 Scott Peterson <lunchtimemama@gmail.com>
1424 * generic.cs: Fixed typeo (TypeParameter.Variacne).
1426 2009-02-04 Scott Peterson <lunchtimemama@gmail.com>
1428 This patch adds initial generic variance support to the compiler.
1429 It is contributed under the MIT/X11 license.
1431 * typemanager.cs: Modified ImplementsInterface to check variance.
1432 Added VerifyVariantTypeParameters which checks the specified type to see
1433 if it uses a variant type parameter as a type argument (which is not
1434 allowed). Added IsVariantOf which determins if the first type is a
1435 variant of the second. NOTE: This only supports reference types at
1436 the moment to conform with the current level of VM support. When the
1437 VM supports value types, this will follow step.
1439 * generic.cs: Added the Variance enum. Added a Variance property to
1440 TypeParameter and added variance support to definition phase. Added a
1441 Variance property to TypeParameterName. Also check to make sure that
1442 no variant types appear in generic method parameters.
1444 * cs-tokenizer.cs: Modified parse_less_than to tokenize the variance
1445 keywords if the langversion supports it.
1447 * parameter.cs: Added Parameter.VerifyNoVariantTypeParameters to ensure
1448 that variant types are only used in legal positions. Also added
1449 ParametersCompiled.VerifyNoVariantTypeParameters to check all of its
1452 * decl.cs: Construct TypeParameter with the variance information.
1454 * convert.cs: Checks variance in ImplicitReferenceConversionExists
1455 and ImplicitConversionStandard.
1457 * rootcontext.cs: Added new "Future" language version.
1459 * class.cs: In TypeContainer.DoDefineMembers, ensure that contravariant
1460 type parameters are not used as type arguments in interface inheritance.
1461 In MemberBase.DoMemberDependentChecks, ensure that contravariant type
1462 parameters are not used as method return types. In MemberBase.
1463 ResolveMemberType, ensure that variant type parameters are not used
1464 as type arguments. Also call VerifyNoVariantTypeParameters on every
1465 set of parameters which are resolved.
1467 * delegate.cs: Modified Delegate.Define to ensure that variant
1468 parameters are not used as type arguments and that a contravariant
1469 parameter is not used as the return type. Also call
1470 VerifyNoVariantTypeParameters on the delegate parameters.
1472 * cs-parser.jay: Modified grammar to support "in" and "out" keywords
1473 to specify generic variance.
1475 * driver.cs: Added support for LanguageVersion.Future in the form of
1476 "-langversion:future".
1478 * generic-mcs.cs: Stubbed out new members in generic.cs.
1480 2009-02-03 Marek Safar <marek.safar@gmail.com>
1482 * class.cs, generic.cs: Emit type parameter constraints for nested
1485 2009-02-02 Marek Safar <marek.safar@gmail.com>
1487 A fix for bug #471213
1488 * class.cs: Avoid emitting backing field for abstract event fields.
1490 2009-02-01 Marek Safar <marek.safar@gmail.com>
1492 A fix for bug #359731
1493 * cs-tokenizer.cs, cs-parser.jay: Correctly parse nested query
1496 2009-01-30 Marek Safar <marek.safar@gmail.com>
1498 A fix for bug #470767
1499 * statement.cs: Introduced BlockScopeExpression, needed when
1500 expression tree conversion has to emit scope variables.
1502 2009-01-29 Marek Safar <marek.safar@gmail.com>
1504 * class.cs: Remove duplicate CallingConvention.
1506 2009-01-29 Marek Safar <marek.safar@gmail.com>
1508 *.cs: Rename Parameters to ParametersCompiled and ParametersImported
1509 when I finally found the right naming convention.
1511 2009-01-29 Marek Safar <marek.safar@gmail.com>
1513 * cs-tokenizer.cs: Put back different open parens optimization.
1515 2009-01-28 Marek Safar <marek.safar@gmail.com>
1517 A fix for bug #470227
1518 * cs-tokenizer.cs: Remove too agressive parser optimization.
1520 2009-01-28 Marek Safar <marek.safar@gmail.com>
1522 A fix for bug #324319
1523 * class.cs: Remove too early base type resolve.
1525 2009-01-27 Marek Safar <marek.safar@gmail.com>
1527 A fix for bug #324319
1528 * ecore.cs: Explicitly type null when assigning to type argument to
1529 make pass verifier check.
1531 2009-01-27 Marek Safar <marek.safar@gmail.com>
1533 * anonymous.cs: Fixed recent regression when initializing captured
1536 2009-01-26 Marek Safar <marek.safar@gmail.com>
1538 A fix for bug #469019
1539 * anonymous.cs: Use all parent type parameters when instantiating
1540 nested generic storey.
1542 2009-01-26 Marek Safar <marek.safar@gmail.com>
1544 * expression.cs: Check for null instance methodgroup expression.
1546 2009-01-26 Marek Safar <marek.safar@gmail.com>
1548 A fix for bug #469244
1549 * cs-tokenizer.cs, cs-parser.jay: Fixed parsing of nullable type
1550 instance inside a conditional expression.
1552 2009-01-23 Marek Safar <marek.safar@gmail.com>
1554 * typemanager.cs, generic.cs, parameter.cs, decl.cs, anonymous.cs,
1555 expression.cs, report.cs, ecore.cs, attribute.cs: Use common
1556 GetElementType and HasElementType. IsValueType clean up.
1558 2009-01-23 Marek Safar <marek.safar@gmail.com>
1560 * nullable.cs: Use common EmitCall.
1562 * expression.cs: Emit constraint. for virtual calls only.
1564 2009-01-23 Marek Safar <marek.safar@gmail.com>
1566 * typemanager.cs, generic.cs, eval.cs, convert.cs, const.cs,
1567 expression.cs, statement.cs, rootcontext.cs, ecore.cs, class.cs,
1568 driver.cs, attribute.cs, enum.cs: Split IsValueType and IsStruct
1571 2009-01-22 Jb Evain <jbevain@novell.com>
1573 * anonymous.cs: make anonymous types' ToString implementation
1574 match what csc outputs.
1576 2009-01-21 Marek Safar <marek.safar@gmail.com>
1578 * typemanager.cs, ecore.cs, iterator.cs: TypeLookupExpression clean
1581 2009-01-17 Marek Safar <marek.safar@gmail.com>
1583 * convert.cs, ecore.cs: Explicitly casts type arguments to pass
1586 2009-01-16 Marek Safar <marek.safar@gmail.com>
1588 * nullable.cs (LiftedBinaryOperator): Check for all possible null
1591 2009-01-15 Marek Safar <marek.safar@gmail.com>
1593 A fix for bug #466634
1594 * statement.cs: Add reference for nested storey when only this
1597 2009-01-15 Marek Safar <marek.safar@gmail.com>
1599 A fix for bug #466474
1600 * codegen.cs: Emit SecurityPermissionAttribute when -unsafe option
1603 2009-01-15 Marek Safar <marek.safar@gmail.com>
1605 * iterators.cs, anonymous.cs, expression.cs, statement.cs, ecore.cs:
1606 Fixed nested stories parent referencing process. Also fixes #463985.
1608 2009-01-06 Marek Safar <marek.safar@gmail.com>
1610 * decl.cs, iterators.cs, expression.cs, statement.cs, doc.cs,
1611 class.cs, cs-parser.jay, codegen.cs: Clean up destructor
1612 implementation. Also fixes #463108.
1614 2009-01-05 Marek Safar <marek.safar@gmail.com>
1616 A fix for bug #416109
1617 * decl.cs: Issue correct CLSAttribute warning location.
1619 2009-01-05 Marek Safar <marek.safar@gmail.com>
1621 A fix for bug #456775
1622 * attribute.cs: Use attribute owner scope when resolving attribute
1625 2009-01-05 Marek Safar <marek.safar@gmail.com>
1627 A fix for bug #457257
1628 * decl.cs: Fixed incorrect member declaring type comparison.
1630 2009-01-05 Marek Safar <marek.safar@gmail.com>
1632 A fix for bug #460896
1633 * driver.cs: Handle /RES resources as embeddable.
1635 2009-01-05 Marek Safar <marek.safar@gmail.com>
1637 A fix for bug #462515
1638 * ecore.cs: Report inacessible members upwards.
1640 2009-01-05 Marek Safar <marek.safar@gmail.com>
1642 A fix for bug #463190, #463192
1643 * decl.cs, namespace.cs: Also import internal extension classes.
1645 2009-01-04 Marek Safar <marek.safar@gmail.com>
1647 A fix for bug #463415
1648 * generic.cs: Use right index for RemoveDependentTypes.
1650 2009-01-02 Marek Safar <marek.safar@gmail.com>
1652 A fix for bug #463196
1653 * expression.cs: Fixed enum to null comparison.
1655 2009-01-02 Marek Safar <marek.safar@gmail.com>
1657 A fix for bug #463121
1658 * nullable.cs: Fixed nullable user equality operator comparison.
1660 2009-01-02 Marek Safar <marek.safar@gmail.com>
1662 A fix for bug #462950
1663 * class.cs, decl.cs: Use full explicit name when defining automatic
1664 property backing field.
1666 2009-01-02 Marek Safar <marek.safar@gmail.com>
1668 A fix for bug #462592
1669 * pending.cs: Emit type arguments for generic proxy method.
1671 2008-12-30 Marek Safar <marek.safar@gmail.com>
1673 * expression.cs (As): Mutate all type arguments.
1675 2008-12-29 Marek Safar <marek.safar@gmail.com>
1677 A fix for bug #462622
1678 * anonymous.cs: Resolve anonymous type GetHashCode in unchecked
1681 2008-12-29 Marek Safar <marek.safar@gmail.com>
1683 A fix for bug #450782
1684 * ecore.cs: Consider more variables of form V.I to be fixed.
1686 2008-12-29 Marek Safar <marek.safar@gmail.com>
1688 A fix for bug #460712
1689 * typemanager.cs: Core types could be imported.
1691 2008-12-28 Marek Safar <marek.safar@gmail.com>
1693 A fix for bugs #460847, #460772, #458049, #457339, #447807
1694 * generic.cs, parameter.cs, lambda.cs, linq.cs, anonymous.cs
1695 statement.cs, ecore.cs, class.cs, delegate.cs, flowanalysis.cs
1696 cs-parser.jay, driver.cs: LINQ implementation upgrade to deal with
1697 user lambdas used inside query clauses.
1699 2008-12-18 Marek Safar <marek.safar@gmail.com>
1701 A fix for bug #460229
1702 * cs-tokenizer.cs: Ignore wrongly placed BOM markers.
1704 2008-12-18 Marek Safar <marek.safar@gmail.com>
1706 A fix for bug #459952
1707 * decl.cs, namespace.cs: Use common CheckAccessLevel.
1709 2008-12-18 Marek Safar <marek.safar@gmail.com>
1711 A fix for bug #459630
1712 * convert.cs: Enum to valuetype conversion is not allowed.
1714 2008-12-18 Marek Safar <marek.safar@gmail.com>
1716 A fix for bug #457087
1717 * generic.cs: Don't crash when constraint comes from type
1720 2008-12-16 Marek Safar <marek.safar@gmail.com>
1722 A fix for bug #459221
1723 * anonymous.cs, statement.cs: Delay only captured this
1726 2008-12-12 Marek Safar <marek.safar@gmail.com>
1728 A fix for bug #457489
1729 * anonymous.cs, statement.cs: Split anonymous storey instantiation
1730 and initialization to capture scope initializers correctly.
1732 2008-12-11 Marek Safar <marek.safar@gmail.com>
1734 * generic.cs, parameter.cs, expression.cs, statement.cs, doc.cs:
1735 ParameterReference refactoring.
1737 2008-12-03 Marek Safar <marek.safar@gmail.com>
1739 * typemanager.cs, namespace.cs, driver.cs: Allow ExtensionAttribute
1740 to be imported from any assembly.
1742 2008-12-03 Marek Safar <marek.safar@gmail.com>
1744 * parameter.cs, lambda.cs, linq.cs, iterators.cs, anonymous.cs
1745 statement.cs, class.cs, cs-parser.jay: Removed duplicate parameters
1746 from anonymous method and lambda expression.
1748 2008-12-01 Marek Safar <marek.safar@gmail.com>
1750 A fix for bug #448560
1751 * expression.cs (As): Box any generic type arguments to be
1754 2008-11-29 Raja R Harinath <harinath@hurrynot.org>
1756 Add tripwire for implicit conversion bugs
1757 * ecore.cs (MethodGroupExpr.Error_ArgumentCountWrong): New helper
1759 (MethodGroupExpr.OverloadResolve): Add sanity check between
1760 IsApplicable and VerifyArgumentsCompat.
1761 (VerifyArgumentsCompat): Report CS1501 where appropriate.
1763 2008-11-29 Raja R Harinath <harinath@hurrynot.org>
1765 Fix build break in System.Data_test
1766 * convert.cs (ImplicitConversionExists): Move NullLiteral
1768 (ImplicitStandardConversionExists): ... here.
1770 2008-11-28 Marek Safar <marek.safar@gmail.com>
1772 * literal.cs: Emit correctly explicit null to nullable cast.
1774 2008-11-28 Marek Safar <marek.safar@gmail.com>
1776 * ecore.cs, generics.cs: Fixed crash when type arguments fail to
1779 2008-11-28 Marek Safar <marek.safar@gmail.com>
1781 A fix for bug #449005
1782 * convert.cs, nullable.cs: Use only one implicit nullable
1785 2008-11-27 Marek Safar <marek.safar@gmail.com>
1787 * convert.cs, literal.cs: More Convert cleanup is needed.
1789 2008-11-27 Marek Safar <marek.safar@gmail.com>
1791 * decl.cs, class.cs: Fixed misleading error message.
1793 2008-11-26 Marek Safar <marek.safar@gmail.com>
1795 A fix for bug #449005
1796 * nullable.cs (EmitEquality): Disable optimization for user operator
1799 2008-11-25 Marek Safar <marek.safar@gmail.com>
1801 A fix for bug #447027
1802 * anonymous.cs (HoistedVariable): Cache also outer access to deal
1803 with context variables stored as expression instances.
1805 2008-11-25 Marek Safar <marek.safar@gmail.com>
1807 A fix for bug #447027
1808 * delegate.cs: Fixed delegate VerifyMethod logic.
1810 2008-11-24 Marek Safar <marek.safar@gmail.com>
1812 * ecore.cs, delegate.cs: MethodGroup expressions can be applicable
1815 2008-11-21 Marek Safar <marek.safar@gmail.com>
1817 * typemanager.cs, decl.cs, anonymous.cs, class.cs, enum.cs: Rewrote
1818 member type resolve to follow normal flow, instead of random
1821 2008-11-21 Marek Safar <marek.safar@gmail.com>
1823 * iterators.cs (GetEnumeratorStatement): Re-use already resolved
1826 2008-11-21 Marek Safar <marek.safar@gmail.com>
1828 * const.cs: Emit decimal array constant as literal.
1830 2008-11-20 Marek Safar <marek.safar@gmail.com>
1832 * iterators.cs, ecore.cs: Removed CurrentBlock statement.
1834 2008-11-19 Marek Safar <marek.safar@gmail.com>
1836 * eval.cs, location.cs, driver.cs (Location.SourceFiles): Turned
1837 into real property (saves 8 MB for corlib compilation).
1839 2008-11-19 Marek Safar <marek.safar@gmail.com>
1841 * generic.cs, lambda.cs, linq.cs, iterators.cs, anonymous.cs,
1842 nullable.cs, expression.cs, statement.cs, ecore.cs, cs-parser.jay
1843 generic-mcs.cs: Small cleanup of TypeArguments.
1845 2008-11-18 Marek Safar <marek.safar@gmail.com>
1847 * generic.cs, iterators.cs, anonymous.cs, nullable.cs, ecore.cs,
1848 expression.cs, namespace.cs, generic-mcs.cs, class.cs: Small cleanup
1849 of ConstructedType expression, renamed to GenericTypeExpr.
1851 2008-11-17 Marek Safar <marek.safar@gmail.com>
1853 A fix for bug #445303
1854 * location.cs (IsConditionalDefined): Handle undefined global
1857 2008-11-17 Marek Safar <marek.safar@gmail.com>
1859 A fix for bug #444678
1860 * expression.cs (TryReduceConstant): Always create new constant
1863 2008-11-17 Marek Safar <marek.safar@gmail.com>
1865 A fix for bug #444673
1866 * ecore.cs: Ignore open generic types when used as generic type
1869 2008-11-17 Marek Safar <marek.safar@gmail.com>
1871 A fix for bug #445458
1872 * expression.cs, cs-parser.jay: Don't crash when an expression
1875 2008-11-17 Marek Safar <marek.safar@gmail.com>
1877 A fix for bug #445464
1878 * expression.cs, cs-parser.jay: Fixed typeof of non-generic type
1879 inside unbound type.
1881 2008-11-14 Jb Evain <jbevain@novell.com>
1883 * driver.cs: ignore empty -nowarn argument such as
1884 the one in -nowarn:12,13,,.
1886 2008-11-13 Marek Safar <marek.safar@gmail.com>
1888 A fix for bug #444271
1889 * anonymous.cs: Rescan parent storeys when best candidate was
1892 2008-11-13 Marek Safar <marek.safar@gmail.com>
1894 * generic.cs, expression.cs, ecore.cs, cs-parser.jay: Removed
1895 useless UnboundTypeExpression.
1897 * attribute.cs: Do check obsolete attribute on generic types.
1899 2008-11-12 Marek Safar <marek.safar@gmail.com>
1901 A fix for bugs #425680, #400139
1902 * ecore.cs, expression.cs: Trying to do some almost_matched_members
1905 2008-11-11 Marek Safar <marek.safar@gmail.com>
1907 A fix for bug #435747
1908 * assign.cs, expression.cs: Cleanup New assignment to emit correcly
1909 compound value types assignment. Few micro optimizations added.
1911 2008-11-10 Marek Safar <marek.safar@gmail.com>
1913 A fix for bug #442610
1914 * anonymous.cs (MutateConstructor): More SRE hacking.
1916 2008-11-10 Marek Safar <marek.safar@gmail.com>
1918 A fix for bug #442579
1919 * ecore.cs: Also initialize expanded form of a method with 1 params
1922 2008-11-06 Marek Safar <marek.safar@gmail.com>
1924 * expression.cs (UnaryMutator): Do early l-side check.
1926 2008-11-05 Miguel de Icaza <miguel@novell.com>
1928 * codegen.cs (InitDynamic): also setup Assembly.Name like we do in
1929 Init, otherwise we would crash later on when checking for friend
1932 * eval.cs: Do not hide errors from invalid calls to LoadAssembly.
1933 Otherwise we never get any meaningful information as to what
1936 2008-11-05 Marek Safar <marek.safar@gmail.com>
1938 A fix for bug #436318
1939 * driver.cs, report.cs: Add -warnaserror:Wn to command line options.
1941 2008-11-05 Miguel de Icaza <miguel@novell.com>
1943 * namespace.cs: Turns out that it was a really bad idea to hide
1944 the errors for namespaces not found here in eval mode.
1946 * eval.cs: When we process using clauses, only enter those into
1947 the list of valid using clauses after they have been validated.
1949 The above change gives the proper semantics: it does not
1950 senselessly report the same errors with broken using statements by
1951 never storing them in the first place when they are invalid.
1953 2008-11-05 Marek Safar <marek.safar@gmail.com>
1955 A fix for bug #421839
1956 * cs-parser.jay: Remove expression from coalesce rule to force lower
1957 priority than the assignment operator.
1959 2008-11-05 Marek Safar <marek.safar@gmail.com>
1961 A fix for bug #437875
1962 * nullable.cs: Compile correctly method group operand used with null
1963 coalescing operator.
1965 2008-11-04 Marek Safar <marek.safar@gmail.com>
1967 A fix for bug #434589
1968 * expression.cs (Binary): Ignore lifted conversions when at least
1969 one operand is of reference type.
1971 2008-11-04 Marek Safar <marek.safar@gmail.com>
1973 * cs-parser.jay: Better syntax error report.
1975 2008-11-03 Marek Safar <marek.safar@gmail.com>
1977 A fix for bug #436792
1978 * cs-parser.jay: Use GetLocation to access location.
1980 2008-11-03 Marek Safar <marek.safar@gmail.com>
1982 A fix for bug #440774
1983 * cs-parser.jay: Also set current_array_type when parsing local
1986 2008-11-03 Marek Safar <marek.safar@gmail.com>
1988 A fix for bug #440785
1989 * expression.cs (As): Don't resolve self modifing expression
1992 2008-11-03 Marek Safar <marek.safar@gmail.com>
1994 A fix for bug #439447
1995 * cs-tokenizer.cs: Tokenize surrogates only where allowed.
1997 2008-11-03 Marek Safar <marek.safar@gmail.com>
1999 A fix for bug #437571
2000 * cs-parser.jay: Fixes internal error for invalid expression
2003 2008-10-17 Marek Safar <marek.safar@gmail.com>
2005 * ecore.cs: Resolve correctly ambiguous params delegate methods.
2007 2008-10-17 Marek Safar <marek.safar@gmail.com>
2009 * generic.cs, anonymous.cs: Simplified GetDeclarations.
2011 2008-10-17 Marek Safar <marek.safar@gmail.com>
2013 * cs-tokenizer.cs: More precise cast parsing.
2015 2008-10-16 Martin Baulig <martin@ximian.com>
2017 * anonymous.cs (AnonymousMethodStorey): Put back the
2018 `hoisted_locals' hashtable and use it in EmitType().
2020 2008-10-15 Marek Safar <marek.safar@gmail.com>
2022 * cs-tokenizer.cs, nullable.cs, expression.cs, statement.cs,
2023 cs-parser.jay: Tokenizer optimizations and memory reduction, saves
2026 2008-10-14 Marek Safar <marek.safar@gmail.com>
2028 * cs-tokenizer.cs: Add bool type to the list of valid cast tokens.
2030 2008-10-14 Marek Safar <marek.safar@gmail.com>
2032 * statement.cs: Mutate scope initializers.
2034 2008-10-14 Marek Safar <marek.safar@gmail.com>
2036 * expression.cs: Use typeless value for This constant.
2038 * ecore.cs: Access FieldInfo via GetConstructedFieldInfo.
2040 2008-10-14 Marek Safar <marek.safar@gmail.com>
2042 * cs-tokenizer.cs, cs-parser.jay: Unify context sensite keyword
2045 2008-10-13 Marek Safar <marek.safar@gmail.com>
2047 * cs-tokenizer.cs: Add missing alias qualifier and dotted generic
2050 2008-10-13 Marek Safar <marek.safar@gmail.com>
2052 * cs-tokenizer.cs, expression.cs, cs-parser.jay: Reworked parens
2053 parser and tokenizer. Fixes many ambiguities including #433258.
2055 2008-10-10 Marek Safar <marek.safar@gmail.com>
2057 * cs-parser.jay: Fixed missing accessor recovery.
2059 2008-10-10 Marek Safar <marek.safar@gmail.com>
2061 A fix for bug #433701
2062 * expression.cs: Better error message.
2064 2008-10-10 Marek Safar <marek.safar@gmail.com>
2066 * cs-parser.jay, expression.cs: Start reporting real parser errors.
2068 * Makefile: Disabled unused debug symbols.
2070 Also fixes: #320556, #321097, #321656, #321876, #351316
2072 2008-10-09 Miguel de Icaza <miguel@novell.com>
2074 * eval.cs: rename "<interactive>" to "{interactive}", to work
2075 around a requirement in the compiler that this be a valid
2076 filename, and in Windows it is not (433886).
2078 2008-10-09 Marek Safar <marek.safar@gmail.com>
2080 * cs-tokenizer.cs, cs-parser.jay: Fixed more subtle parser problems
2082 2008-10-08 Marek Safar <marek.safar@gmail.com>
2084 * cs-tokenizer.cs, eval.cs, anonymous.cs, statement.cs, class.cs
2085 cs-parser.jay: Generic type declaration and type arguments cleanup.
2087 2008-10-05 Marek Safar <marek.safar@gmail.com>
2089 * cs-parser.jay: Allow parsing weird array creation construct.
2091 2008-10-05 Marek Safar <marek.safar@gmail.com>
2093 * cs-parser.jay: Conflicts reduction.
2095 2008-10-04 Marek Safar <marek.safar@gmail.com>
2097 * cs-parser.jay: Conflicts reduction.
2099 2008-10-04 Raja R Harinath <harinath@hurrynot.org>
2102 * flowanalysis.cs (MyBitvector.MakeShared): Rename from 'Shared'
2103 property. Add a 'count' hint about the use of the shared vector.
2104 Ensure that we don't leak out dirty bits.
2105 (UsageVector.MergeChild): Throw away information about variables
2107 Based on patch and analysis by Moritz Kroll <Moritz.Kroll@gmx.de>.
2109 2008-10-03 Marek Safar <marek.safar@gmail.com>
2111 A fix for bug #431746
2112 * iterators.cs, anonymous.cs: Re-initialize hoisted iterator
2113 parameters when iterator is created.
2115 2008-10-03 Marek Safar <marek.safar@gmail.com>
2117 A fix for bug #431827
2118 * expression.cs: Fixed right based pointer arithmetic operations
2121 2008-10-03 Marek Safar <marek.safar@gmail.com>
2123 A fix for bug #353779
2124 * assign.cs, expression.cs: Fixed compound assignment conversions.
2126 2008-10-02 Marek Safar <marek.safar@gmail.com>
2128 A fix for bug #375262
2129 * statement.cs: Refactor ArrayForeach to be usable with string
2130 indexer. Optimized single dimentional arrays foreach.
2132 2008-10-02 Marek Safar <marek.safar@gmail.com>
2134 A fix for bug #431255
2135 * anonymous.cs, expression.cs: Removed broken optimization.
2137 2008-10-01 Marek Safar <marek.safar@gmail.com>
2139 * anonymous.cs: Use full type parameters of parent generic
2140 containers. Removed unnecessary AddParentStoreyReference call.
2142 2008-10-01 Marek Safar <marek.safar@gmail.com>
2144 A fix for bug #324702
2145 * class.cs: Use better shorter names for explicit interface member
2148 * ecore.cs, typemanager.cs: Convert only mscorlib predefined names.
2150 2008-10-01 Marek Safar <marek.safar@gmail.com>
2152 * expression.cs: Use new interface to check fixed expression.
2154 2008-10-01 Marek Safar <marek.safar@gmail.com>
2156 A fix for bug #421101
2157 * expression.cs, statement.cs, ecore.cs: Use IFixedExpression
2158 interface to check for fixed fixed-buffers.
2160 2008-10-01 Marek Safar <marek.safar@gmail.com>
2162 A fix for bug #429264
2163 * assign.cs, anonymous.cs, ecore.cs: More type mutators added.
2165 * delegate.cs: Removed unnecessary casts.
2167 2008-09-30 Marek Safar <marek.safar@gmail.com>
2169 A fix for bug #352151
2170 * decl.cs, iterators.cs, anonymous.cs, report.cs, namespace.cs,
2171 class.cs: Fixed already defined explicit interface members check.
2173 2008-09-29 Rodrigo Kumpera <rkumpera@novell.com>
2175 cs-tokenizer.cs: Fix typo.
2177 2008-09-28 Miguel de Icaza <miguel@novell.com>
2179 * eval.cs (InteractiveBase): The quit command now just sets a
2180 flag, instead of calling Environment.Exit(), it is milder on
2183 CompiledMethod is now in Mono.CSharp, not nested inside
2184 the Evaluator, it was inconvenient to use.
2186 2008-09-27 Miguel de Icaza <miguel@novell.com>
2188 * eval.cs (Evaluator): Introduce Compile method, to allow compiled
2189 code to be invoked without having to reparse.
2191 2008-09-27 Miguel de Icaza <miguel@novell.com>
2193 * ecore.cs: The recent changes to FieldExpr broke this as well.
2194 Fixes LINQ queries in the interactive shell.
2196 * Multiple files: indentation fixing for the Mono coding
2197 guidelines for the switch statement.
2199 * eval.cs: Make the Evaluator API thread safe.
2201 2008-09-26 Marek Safar <marek.safar@gmail.com>
2203 * anonymous.cs, statement.cs, class.cs, cs-parser.jay: Simplified
2204 constructor parsing.
2206 2008-09-26 Marek Safar <marek.safar@gmail.com>
2208 A fix for bug #325326
2209 * statement.cs: Check possible mistaken empty statement using
2210 explicit blocks only.
2212 2008-09-25 Miguel de Icaza <miguel@novell.com>
2214 * eval.cs (LoadAssembly, ReferenceAssembly): Call
2215 RootNamespace.ComputeNamespaces to update the internal list of
2216 namespaces, this is no longer done for us.
2218 (InteractiveBase): Use the Evaluator APIs instead of calling into
2221 2008-09-25 Marek Safar <marek.safar@gmail.com>
2223 A fix for bug #429264
2224 * expression.cs: Missing mutator for access to multidimensional
2227 2008-09-25 Marek Safar <marek.safar@gmail.com>
2229 * class.cs, statement: Emit DebuggerHidden attribute for iterator
2232 * driver.cs: Missing input argument check.
2234 2008-09-25 Marek Safar <marek.safar@gmail.com>
2236 * typemanager.cs, generic.cs, eval.cs, decl.cs, anonymous.cs,
2237 expression.cs, statement.cs, rootcontext.cs, class.cs,
2238 cs-parser.jay, driver.cs, generic-mcs.cs, enum.cs: Removed obsolete
2241 2008-09-24 Miguel de Icaza <miguel@novell.com>
2243 * ecore.cs (FieldExpr): Only initialize eclass when we return a
2244 fully constructed FieldExpr, fixes the regression introduced in
2247 * ecore.cs, expression.cs: Plug back the eclass initialization as
2248 otherwise it regresses `csharp'.
2250 2008-09-24 Marek Safar <marek.safar@gmail.com>
2252 * typemanager.cs, decl.cs, convert.cs, assign.cs, expression.cs,
2253 ecore.cs, attribute.cs: Moved obsolete method checks from emit
2254 phase to resolve phase. It resolves problems with expression trees
2255 and fixes bugs #323796, #325156.
2257 2008-09-23 Marek Safar <marek.safar@gmail.com>
2259 * codegen.cs: Report better error when symbol writer is missing.
2261 2008-09-23 Marek Safar <marek.safar@gmail.com>
2263 * codegen.cs: Set .NET symbol writer.
2265 * decl.cs: Guard against null generic arguments.
2267 * report.cs: Don't report exactly same additional details.
2269 2008-09-22 Marek Safar <marek.safar@gmail.com>
2271 A fix for bug #324917
2272 * cs-parser.jay: Add missing multidimensional non-expression type
2275 2008-09-22 Marek Safar <marek.safar@gmail.com>
2277 A fix for bug #428191
2278 * anonymous.cs: Create an outer generic fields also for non-storey
2281 2008-09-22 Marek Safar <marek.safar@gmail.com>
2283 A fix for bug #378294
2284 * class.cs: Make fixed size buffers gmcs feature only.
2286 2008-09-22 Marek Safar <marek.safar@gmail.com>
2288 A fix for bug #355622, #324993
2289 * assign.cs, const.cs, class.cs: Create new EmitContext for each
2292 2008-09-19 Marek Safar <marek.safar@gmail.com>
2294 * nullable.cs, expression.cs, namespace.cs, delegate.cs: Duplicate
2297 2008-09-19 Marek Safar <marek.safar@gmail.com>
2299 A fix for bug #416110
2300 * generic.cs: Struct constraint results in default ctor and
2301 ValueType base type constraint to be set.
2303 2008-09-19 Marek Safar <marek.safar@gmail.com>
2305 A fix for bug #423791
2306 * generic.cs: Fixed params output type type-inference.
2308 2008-09-19 Marek Safar <marek.safar@gmail.com>
2310 * cs-parser.jay, expression.cs: Fixed few expression crashes.
2312 2008-09-19 Marek Safar <marek.safar@gmail.com>
2314 * cs-tokenizer.cs: Don't break on extra partial modifier.
2316 2008-09-19 Marek Safar <marek.safar@gmail.com>
2318 A fix for bug #427592
2319 * generic.cs: Use common parameter resolve method.
2321 2008-09-18 Marek Safar <marek.safar@gmail.com>
2323 A fix for bug #414758
2324 * expression.cs, ecore.cs: Fixed crash when accessing non-static
2327 2008-09-18 Marek Safar <marek.safar@gmail.com>
2329 * driver.cs, namespace.cs: Read types and namespaces after all
2330 requested assemblies are loaded, fixes issues with System.Core
2331 auto-reference, and #419888.
2333 2008-09-18 Marek Safar <marek.safar@gmail.com>
2335 A fix for bug #417705
2336 * cs-parser.jay: Fixed as/is operator expression split.
2338 2008-09-18 Marek Safar <marek.safar@gmail.com>
2340 * const.cs, expression.cs, statement.cs, ecore.cs, cs-parser.jay:
2341 Fixed expression tree representation of empty new expression and
2342 new initializer expression.
2344 2008-09-18 Miguel de Icaza <miguel@novell.com>
2346 * eval.cs: Remove warning, keep reference to driver around.
2348 * Hide fields that do not need to be public.
2350 2008-09-17 Marek Safar <marek.safar@gmail.com>
2352 A fix for bug #426385
2353 * expression.cs (ImplicitlyTypedArrayCreation): Use full implicit
2354 conversion for array elements.
2356 2008-09-17 Marek Safar <marek.safar@gmail.com>
2358 * expression.cs, statement.cs, class.cs, cs-parser.jay: Fixed
2359 void parsing conflicts.
2361 2008-09-15 Marek Safar <marek.safar@gmail.com>
2363 A fix for bug #425601
2364 * driver.cs, typemanager.cs, namespace.cs: Automatically reference
2365 System.Core only when there is no custom ExtensionAttribute
2368 2008-09-15 Miguel de Icaza <miguel@novell.com>
2370 * namespace.cs: Do not report CS0246 (name
2372 2008-09-12 Marek Safar <marek.safar@gmail.com>
2374 A fix for bug #425669
2375 * generic.cs: Don't cache generic static anonymous method
2378 2008-09-12 Marek Safar <marek.safar@gmail.com>
2380 * generic.cs, class.cs, delegate.cs: Check recursive inherited
2381 conflicting constraints.
2383 2008-09-12 Raja R Harinath <harinath@hurrynot.org>
2385 * cs-tokenizer.cs (consume_identifier): Allow partial methods in
2388 2008-09-12 Marek Safar <marek.safar@gmail.com>
2390 * literal.cs, convert.cs, expression.cs, statement.cs: More null
2391 to null pointer conversion fixes.
2393 2008-09-11 Marek Safar <marek.safar@gmail.com>
2395 * cs-parser.jay, expression.cs: An implicitly typed local variable
2396 declarator cannot use an array initializer.
2398 2008-09-11 Marek Safar <marek.safar@gmail.com>
2400 * cs-parser.jay: Reduced number of printed tokens, add sorting.
2402 2008-09-11 Marek Safar <marek.safar@gmail.com>
2404 * generic.cs (InflatedConstraints): Don't crash when constraints
2407 * cs-parser.jay: const_declarator is a block.
2409 * constant.cs: Check for not allowed NaN conversions.
2411 2008-09-10 Miguel de Icaza <miguel@novell.com>
2413 * driver.cs: Drop --shell argument, the compiler is no longer a
2416 * eval.cs: Move most of the code that deals with evaluation into
2417 this file and document the public API from repl.cs
2419 * repl.cs: Remove from here.
2421 2008-09-10 Marek Safar <marek.safar@gmail.com>
2423 A fix for bug #424684
2424 * generic.cs: Generic class constraints must come first.
2426 2008-09-09 Miguel de Icaza <miguel@novell.com>
2428 * cs-parser.jay: Improve error reporting for syntax errors in
2429 statements and expressions, we now report the expected tokens
2430 instead of reporting the useless "; expected".
2432 Drop the strings from the token declaration, it turns out that
2433 they did not do what I thought they did. Instead they were adding
2434 two sets of tokens to the tables.
2436 2008-09-09 Marek Safar <marek.safar@gmail.com>
2438 * typemanager.cs, generic.cs, parameter.cs, expression.cs, class.cs,
2439 delegate.cs: Share special type check.
2441 2008-09-09 Marek Safar <marek.safar@gmail.com>
2443 A fix for bug #423981
2444 * expression.cs (EmitBranchable): Correctly emit inverted float conditions.
2446 2008-09-09 Marek Safar <marek.safar@gmail.com>
2448 * ecore.cs (ReducedConstantExpression): Implemented ConvertExplicitly and
2451 2008-09-09 Marek Safar <marek.safar@gmail.com>
2453 A fix for bugs: #324750, #335946
2454 * cs-tokenizer.cs, cs-parser.jay, expression.cs: Use a custom
2455 lookup rule to determine ?-based tokens.
2457 2008-09-08 Miguel de Icaza <miguel@novell.com>
2459 * repl.cs (OptionalAssign.EmitStatement): It is possible that some
2460 expressions (like event adding or removing) end up here, so we
2461 need to treat those as statements.
2463 Add LoadAssembly method.
2465 2008-09-04 Miguel de Icaza <miguel@novell.com>
2467 * repl.cs: Add Time method.
2469 2008-09-05 Marek Safar <marek.safar@gmail.com>
2471 * cs-tokenizer.cs: Fixed swaped UTF-16 surrogates parsing.
2473 2008-09-05 Miguel de Icaza <miguel@novell.com>
2475 * repl.cs: Add workaround for old compilers.
2477 2008-09-04 Jb Evain <jbevain@novell.com>
2479 * repl.cs (PrettyPrint): pretty print everything that
2480 implements IDictionary, as well as IEnumerables. Also,
2481 add a quit helper property.
2483 2008-09-04 Marek Safar <marek.safar@gmail.com>
2485 * constant.cs: Better error reporting for decimal literals.
2487 * class.cs, attribute.cs, typemanager.cs: Emit more fixed buffer
2490 2008-09-04 Marek Safar <marek.safar@gmail.com>
2491 Miguel de Icaza <miguel@novell.com>
2493 A fix for bug #422951
2494 * assign.cs (Assign.DoResolve): Perform the type conversions
2495 checks before we attempt to initialize `New' initializers.
2497 2008-09-04 Marek Safar <marek.safar@gmail.com>
2499 A fix for bug #422853
2500 * delegate.cs (DelegateCreation): Add special handling for
2501 EmptyExpression.Null instance expression which is just another
2502 hack for undecided member instance exression.
2504 2008-09-04 Marek Safar <marek.safar@gmail.com>
2506 * expression.cs, ecore.cs: Emit full expression tree for reduced
2509 2008-09-04 Marek Safar <marek.safar@gmail.com>
2511 * expression.cs (This): Guard against multi-resolving.
2513 * ecore.cs, statement.cs (Throw): Simplified.
2515 * flowanalysis.cs: Also verify event fields.
2517 2008-09-04 Miguel de Icaza <miguel@novell.com>
2519 * assign.cs (Assign.DoResolve): Perform the type conversions
2520 checks before we attempt to initialize `New' initializers.
2522 * repl.cs (PrettyPrint): Add Hashtable prettyprint
2524 * anonymous.cs (AnonymousTypeClass): On EvalMode make the class
2527 * repl.cs: Update help.
2529 2008-09-03 Miguel de Icaza <miguel@novell.com>
2531 * driver.cs (ProcessDefaultConfig): Now it encapsulates all the
2532 handling of the default config handling, including the special
2533 treatment of System.Core assembly.
2535 Fixes the REPL processing for LINQ.
2537 2008-09-03 Marek Safar <marek.safar@gmail.com>
2539 A fix for bug #422507
2540 * expression.cs (UnboxCast): Add missing child expression mutator.
2542 2008-09-03 Marek Safar <marek.safar@gmail.com>
2544 * driver.cs: Don't self reference System.Core assembly.
2546 2008-09-03 Marek Safar <marek.safar@gmail.com>
2548 A fix for bug #422507
2549 * expression.cs (StringConcat): Add missing type mutator.
2551 2008-09-03 Marek Safar <marek.safar@gmail.com>
2553 * generic.cs (TypeInferenceContext): Follow equality rule for
2554 constructed type lower bound type inference.
2556 2008-09-02 Miguel de Icaza <miguel@novell.com>
2558 * getline.cs (CmdRefresh): Apply patch from Douglas S. Blank
2559 <dblank@cs.brynmawr.edu> which updates the cursor position on
2562 2008-09-02 Marek Safar <marek.safar@gmail.com>
2564 A fix for bug #367145
2565 * driver.cs: Fixed import of extension methods when using -noconfig
2568 2008-09-02 Marek Safar <marek.safar@gmail.com>
2570 * iterator.cs: Don't emit GetEnumerator method twice but call a generic
2571 version from non-generic implementation instead.
2573 2008-09-01 Marek Safar <marek.safar@gmail.com>
2575 A fix for bug #418908
2576 * class.cs: Use AddScopeStatement for field initializers.
2578 2008-09-01 Marek Safar <marek.safar@gmail.com>
2580 A fix for bug #415385
2581 * ecore.cs, convert.cs: Do method group conversion for equal group types.
2583 2008-09-01 Marek Safar <marek.safar@gmail.com>
2585 A fix for bug #421736
2586 * iterators.cs: Don't crash on unreachable iterators.
2588 2008-09-01 Marek Safar <marek.safar@gmail.com>
2590 A fix for bug #421628
2591 * parameter.cs, attribute.cs: Clone also parameter attributes.
2593 2008-08-30 Miguel de Icaza <miguel@novell.com>
2595 * namespace.cs (LookupType): In EvalMode, try to replace
2596 the TypeBuilder from our cache with a Type as Reflection.Emit does
2597 not like to mix code from older assemblies emitted and new
2600 This sounds like a serious Mono bug that prevents multiple
2601 assemblies to be generated and consumed at the same time.
2603 * cs-parser.jay (push_current_class): Do not make interactive
2604 classes internal or private, make them public as we currently
2605 generate each new class in a new assembly.
2607 2008-08-29 Miguel de Icaza <miguel@novell.com>
2609 * decl.cs, roottypes.cs, class.cs:: Add an infrastructure to
2610 remove types that are entered into the global namespace during
2611 parsing so that we can remove them on failure.
2613 * cs-parser.jay: Parsing: we now keep track of types that are
2614 entered into global variables and queue those in case the parsing
2617 This happens in a few situations: during partial-input, we invoke
2618 the parser repeatedly for example with the string "class X", this
2619 would cause X to be registed, and we need to remove this
2620 registration so that another parse attempt later with say "class X {"
2621 would actually work.
2623 Additionally, if there is an error in the resolution phase, for
2624 example: "class X : NonExistant {}" th
2626 * cs-parser.jay: Be more precise with the errors being raised,
2627 instead of flagging all exceptions during parsing to be attributed
2628 to the parsing process, distinguish those from errors happening in
2629 the actions and hint that using -v would produce the actual
2632 * repl.cs: Do not load all compiler references on each reset,
2633 doing the partial reset takes care of this.
2635 2008-08-28 Miguel de Icaza <miguel@novell.com>
2637 * repl.cs: Add support for loading all the files from
2638 ~/.config/csharp/*cs as startup scripts and ~/.config/csharp/*.dll
2641 Introduce a micro-parser that is able to deambiguate on its input
2642 whether we are dealing with a compilation unit (namespace, class,
2643 interface, struct, delegate) declaration or a statement. This
2644 allows both declarations and statements to be entered.
2646 Set history size by default to 300 lines.
2648 Instead of distinguishing based on the parser.InteractiveResult,
2649 have only two cases: statements were parsed, or a compilation unit
2650 was. Always pull the Using statement additions from the
2651 compilation unit parse.
2653 * cs-tokenizer.cs: Rename tokens to better describe their intent
2654 (EvalStatementParserCharacter and EvalCompilationUnitParserCharacter).
2656 * rootcontext.cs: Split EvalMode into EvalMode and StatementMode.
2657 EvalMode is used to trigger the lookup of global variables while
2658 StatementMode is used turn variable declarations into static
2661 * getline.cs: Allow history size to be set.
2663 2008-08-29 Marek Safar <marek.safar@gmail.com>
2665 A fix for bug #360755
2666 * ecore.cs (SimpleName): Exclude indexers from simple name resolve.
2668 2008-08-29 Marek Safar <marek.safar@gmail.com>
2670 * generic.cs, iterators.cs, codegen.cs: Removed unused variable.
2672 * typemanager.cs, statement.cs, ecore.cs, enum.cs: Don't reconstruct enum
2673 member name, it is too confusing
2675 * decl.cs, class.cs: Don't report unused fields with attached attribute.
2677 * rootcontext.cs: Finally default to warning level 4.
2679 2008-08-28 Marek Safar <marek.safar@gmail.com>
2681 * class.cs (CheckBase): Ignore overloaded operators.
2683 2008-08-28 Marek Safar <marek.safar@gmail.com>
2685 A fix for bug #420830
2686 * expression.cs, cs-parser.jay: Put back InvocationOrCast expression.
2688 2008-08-28 Marek Safar <marek.safar@gmail.com>
2690 A fix for bug #420832
2691 * anonymous.cs, iterators.cs: Also clone hoisted this iterator variable.
2693 2008-08-28 Marek Safar <marek.safar@gmail.com>
2695 A fix for bug #420386
2696 * nullables.cs: Fixed logic of nullable user comparison operators involving
2699 2008-08-28 Marek Safar <marek.safar@gmail.com>
2701 * attribute (IsClsCompliant): Use FALSE value for pointer types.
2703 2008-08-27 Miguel de Icaza <miguel@novell.com>
2705 * repl.cs: Add support for aborting the running code with C-c.
2707 2008-08-27 Raja R Harinath <harinath@hurrynot.org>
2709 * cs-parser.jay (CS1002): Dump 'yyToken' with Report.ExtraInformation.
2711 2008-08-27 Miguel de Icaza <miguel@novell.com>
2713 * cs-parser.jay (interactive_statement_list): A new set of rules
2714 for hosting statements that uses the "interactive_" prefix.
2716 * repl.cs: Add support for parsing `using' as a statement or as a
2717 directive. Deambiguating before passing this to the parser.
2719 We need to distinguish statement_expressions that occur at the
2720 toplevel vs those that occur embedded into expressions.
2722 * getline.cs: Applied patch from Stuart Carnie <stuart.carnie@gmail.com>
2723 that fixes the cursor key handling, and a history bug.
2725 2008-08-26 Miguel de Icaza <miguel@novell.com>
2727 * Makefile: Drop BOOTSTRAP_COMPILER as that was masking the
2728 limitations in Console, instead the 2.0 bootstrap libraries now
2729 include the Console bits.
2731 Also, remove the use of Nullables from getline.cs
2735 Interactive support for the C# compiler. Use gmcs --shell to
2736 enter a read-eval-print loop shell.
2738 Docs: http://www.mono-project.com/CsharpRepl
2740 * sources: include repl.cs here and getline.cs for gmcs.exe,
2741 everything else is getline.cs impaired.
2743 * Makefile: when bootstrapping pass a special flag
2744 BOOTSTRAP_COMPILER which we use to prevent failures in compilation
2745 as we use NET_2_0 define to pull 2.0 APIs from System.Console.
2746 This distinguishes those two cases.
2748 * repl.cs: Support for a read-eval-print loop. Will be soon
2749 refactored into eval support and then REPL on top of it.
2751 * ecore.cs: If a simplename lookup fails, before erroring out,
2752 if we are in EvalMode to resolve the name to a declaration in the
2755 This means that variable declarations that happened in previous
2756 classes (as repl puts every statement in a separate class) are
2757 made visible in this way.
2759 * cs-parser.jay: UnexpectedEOF, a new flag that is set if we
2760 triggered an error due to the end of file being reached. This is
2761 used to do multi-line input, and notify the caller that the user
2762 needs to provide more text before a successful parse.
2764 Add new grammar rules after the INTERACTIVE_PARSER token is seen
2765 to drive the evaluation with a custom wrapper.
2767 * driver.cs: Add support for --shell, and refactor some code to be
2770 * namespace.cs: Add support for serializing the contents of the
2771 namespaces and reloading them.
2773 * getline.cs: A managed implementation of ReadLine under
2774 X11/Apache2 license terms. Easy to embed in other applications as
2777 * namespace.cs: Add some functions to save and restore the
2780 * rootcontext.cs: New public field.
2782 * cs-tokenizer.cs: Add support for one of the possible characters
2783 we introduce into the token stream.
2785 This patch does not affect the regular tokenization process, the
2786 only performance hit would happen if there is an invalid character
2787 on the input string.
2789 * support.cs: Move isatty helper routine here.
2791 * codegen.cs: Small cleanup, and add a mechanism to initialize the
2792 code generator for in-memory assemblies.
2794 2008-08-26 Marek Safar <marek.safar@gmail.com>
2796 * generic.cs, ecore.cs, delegate.cs, cs-parser.jay, expression.cs: A type
2797 parameter cannot be always used as a type.
2799 2008-08-21 Marek Safar <marek.safar@gmail.com>
2801 * convert.cs, expression.cs: Use single ExplicitReferenceConversion routine.
2803 2008-08-21 Marek Safar <marek.safar@gmail.com>
2805 * convert.cs: Implement explicit array to IList<T> conversion.
2807 2008-08-20 Marek Safar <marek.safar@gmail.com>
2809 A fix for bug #362740
2810 * cs-tokenizer.cs: Handle UTF-16 surrogates.
2812 2008-08-20 Marek Safar <marek.safar@gmail.com>
2814 * generic.cs, support.cs, typemanager.cs, lambda.cs, parameter.cs,
2815 pending.cs, ecore.cs, linq.cs, class.cs, decl.cs, delegate.cs,
2816 flowanalysis.cs, iterators.cs, cs-parser.jay, convert.cs, anonymous.cs,
2817 expression.cs, attribute.cs, statement.cs, doc.cs: Refactored parameters
2818 handling to use just one type of infrastructure and deal with generics
2821 2008-07-23 Martin Baulig <martin@ximian.com>
2823 *** Merged this from trunk revision 108527 ***
2826 (ExplicitBlock.EmitSymbolInfo): Moved to `ToplevelBlock'.
2827 (ToplevelBlock.EmitSymbolInfo): Tell the symbol writer about the
2830 2008-08-15 Marek Safar <marek.safar@gmail.com>
2832 * ecore.cs, linq.cs, const.cs, expression.cs, statement.cs: More robust
2835 2008-08-15 Marek Safar <marek.safar@gmail.com>
2837 * delegate.cs: Fixed compiler crash when creating delegate using partial
2840 * typemanager.cs: MulticastDelegate is not a delegate.
2842 2008-08-14 Marek Safar <marek.safar@gmail.com>
2844 * expression.cs, ecore.cs, anonymous.cs, class.cs: Fixed missing error
2847 2008-08-14 Raja R Harinath <harinath@hurrynot.org>
2849 * cs-parser.jay (type): Allow 'var' in mcs too.
2850 (local_variable_type): Likewise.
2852 2008-08-14 Marek Safar <marek.safar@gmail.com>
2854 * driver.cs: Removed broken -noconfig variants.
2856 2008-08-14 Marek Safar <marek.safar@gmail.com>
2858 A fix for bug #417078
2859 * expression.cs: Emit correctly left side pointer operators.
2861 2008-08-13 Marek Safar <marek.safar@gmail.com>
2863 * generic.cs, lambda.cs: Inflate method generic arguments only.
2865 2008-08-12 Marek Safar <marek.safar@gmail.com>
2867 * class.cs: Fixed struct layout check regression.
2869 2008-08-12 Marek Safar <marek.safar@gmail.com>
2871 * cs-parser.jay, enum.cs: Simplified enum parsing.
2873 * decl.cs: Check all type parameters conflicts.
2875 * expression.cs, statement.cs, attribute.cs: More expression checks.
2877 2008-08-11 Marek Safar <marek.safar@gmail.com>
2879 * generic.cs: Add type inference types restriction.
2881 * parameter.cs, class.cs, delegate.cs, iterators.cs, cs-parser.jay,
2882 anonymous.cs, expression.cs: Allocate less accessor parameters.
2884 2008-08-08 Marek Safar <marek.safar@gmail.com>
2886 * typemanager.cs, ecore.cs: Ambiguous operators can come from different
2889 2008-08-08 Marek Safar <marek.safar@gmail.com>
2891 * convert.cs, delegate.cs: Fixed delegate compatibility conversion.
2893 2008-08-07 Marek Safar <marek.safar@gmail.com>
2895 * class.cs, decl.cs, iterator.cs, ecore.cs: Refactor base type resolving.
2896 Also fixes #362146 and #381592.
2898 2008-08-07 Marek Safar <marek.safar@gmail.com>
2900 * ecore.cs: Reduced constant cannot be used as an attribute value.
2902 * cs-parser.jay: Base expression has to be a type.
2904 * expression.cs (Conditional): Uses ReducedExpression.
2906 2008-08-06 Marek Safar <marek.safar@gmail.com>
2908 A fix for bug #376826
2909 * parameter.cs, ecore.cs, anonymous.cs, expression.cs, statement.cs: An
2910 address of hoisted local variable or parameter cannot be taken.
2912 2008-08-05 Marek Safar <marek.safar@gmail.com>
2914 * ecore.cs, constant.cs, expression.cs, statement.cs: Resolve correctly
2915 anonymous method inside checked/unchecked expression.
2917 2008-08-05 Marek Safar <marek.safar@gmail.com>
2919 * typemanager.cs (IsEqual): Guard against null.
2921 * ecore.cs, class.cs, convert.cs, const.cs, constant.cs, expression.cs,
2922 attribute.cs, enum.cs, statement.cs: Pass EmitContext to constant conversion
2923 routine. Fixed few misleading conversion errors.
2925 2008-08-04 Marek Safar <marek.safar@gmail.com>
2927 * class.cs: Consider generics when checking cycles in struct layout.
2929 2008-08-04 Raja R Harinath <harinath@hurrynot.org>
2931 * cs-tokenizer.cs (get_cmd_arg): Simplify. Don't be too pedantic.
2933 2008-08-04 Marek Safar <marek.safar@gmail.com>
2935 A fix for bug #414165
2936 * anonymous.cs: Use same anonymous implementation method for all anonymous
2939 2008-08-04 Marek Safar <marek.safar@gmail.com>
2941 * generic.cs, anonymous.cs, statement.cs: Emit inherited anonymous method
2944 2008-08-04 Marek Safar <marek.safar@gmail.com>
2946 * cs-parser.jay: Typeof argument has to be a type expression.
2948 * namespace.cs: Check alias and namespace definitions collisions.
2950 * class.cs, pending.cs: Moved explicit interface accessor implementation
2953 * delegate.cs, expression.cs: Verify special name invocations.
2955 2008-08-01 Marek Safar <marek.safar@gmail.com>
2957 * cs-parser.jay: Don't choke on empty generic type arguments.
2959 * cs-tokenizer.cs: Handle escaped preprocessor directives.
2961 * expression.cs, ecore.cs: Minor expressions bugs.
2963 2008-08-01 Marek Safar <marek.safar@gmail.com>
2965 * cs-parser.jay: Removed duplicate interface declaration (fixes 2 conflicts)
2966 and added more error handling.
2968 * class.cs, iterators.cs, anonymous.cs: Removed useless interface parameter.
2970 * modifiers.cs, enum.cs: Fixed.
2972 2008-07-31 Jb Evain <jbevain@novell.com>
2974 * driver.cs: remove -pkg ability of smcs.
2976 2008-07-30 Marek Safar <marek.safar@gmail.com>
2978 * statement.cs (Switch): Correctly set empty default target for single
2981 2008-07-30 Marek Safar <marek.safar@gmail.com>
2983 * typemanager.cs, assign.cs, driver.cs, expression.cs, statement.cs: Rewrote
2984 string switch statement implementation to use string dictionary which
2985 significantly (2-8x) improves performance of generated code.
2987 2008-07-29 Marek Safar <marek.safar@gmail.com>
2989 A fix for bug #412880 by Atsushi Enomoto <atsushi@ximian.com>
2990 * modifiers.cs (GetDescription): Fixed FamANDAssem case.
2992 2008-07-29 Marek Safar <marek.safar@gmail.com>
2994 A fix for bug #412595
2995 * typemanager.cs, convert.cs, expression.cs: Some types are never
2996 convertible to each other.
2998 2008-07-29 Marek Safar <marek.safar@gmail.com>
3000 * nullable.cs (CreateNullConstant): An error messages update.
3002 2008-07-29 Marek Safar <marek.safar@gmail.com>
3004 A fix for bug #412595
3005 * cfold.cs: Don't cast undefined bool constant.
3007 2008-07-29 Martin Baulig <martin@ximian.com>
3010 (SymbolWriter.Reset): New public static method.
3013 (CompilerCallableEntryPoint.Reset): Call SymbolWriter.Reset().
3015 2008-07-28 Marek Safar <marek.safar@gmail.com>
3017 * cs-tokenizer.cs (IsLambdaOpenParens): Optimized using more stop tokens.
3019 * expression.cs (ElementAccess): Exact size allocation.
3021 2008-07-26 Marek Safar <marek.safar@gmail.com>
3023 * driver.cs: Replaced outdated UnixParseOption with CSCParseOption.
3025 2008-07-25 Marek Safar <marek.safar@gmail.com>
3027 * flowanalysis.cs (StructInfo): Fixed detection of dynamic types.
3029 * class.cs: Removed $PRIVATE$ field hack which caused problems during
3032 2008-07-25 Marek Safar <marek.safar@gmail.com>
3034 A fix for bug #412217
3035 * assign.cs: Mutate also assignment type.
3037 2008-07-25 Marek Safar <marek.safar@gmail.com>
3039 A fix for bug #323644
3040 * typemanager.cs (IsValidProperty): Verify DefaultMemberName when checking
3043 2008-07-25 Marek Safar <marek.safar@gmail.com>
3045 A fix for bug #412134
3046 * expression.cs (ResolveOperatorEnum): Do implicit conversion of
3047 non-enumerable operands when overloading equality or bitwise operators.
3049 2008-07-25 Marek Safar <marek.safar@gmail.com>
3051 * anonymous.cs: Cache closed generic anonymous method delegates.
3053 2008-07-24 Marek Safar <marek.safar@gmail.com>
3055 * lambda.cs, linq.cs, class.cs, iterators.cs, cs-parser.jay, assign.cs,
3056 anonymous.cs, statement.cs: Always emit anonymous method as static method
3057 when is instance free. Use nesting for nested anynomous methods blocks.
3059 2008-07-23 Marek Safar <marek.safar@gmail.com>
3061 * anonymous.cs (MutateGenericMethod): Added extra code path for imported
3064 2008-07-23 Marek Safar <marek.safar@gmail.com>
3066 * expression.cs: Removed MakeSimpleCall.
3068 2008-07-23 Marek Safar <marek.safar@gmail.com>
3070 A fix for bug #323012
3071 * class.cs, pending.cs: Emit proxy for indexers when they differ in name.
3072 Base method implementing interface has to be public.
3074 2008-07-23 Marek Safar <marek.safar@gmail.com>
3076 * cs-parser.jay: Don't break on missing argument.
3078 2008-07-22 Marek Safar <marek.safar@gmail.com>
3080 A fix for bug #320993
3081 * report.cs, parameter.cs, class.cs, decl.cs, delegate.cs, attribute.cs,
3082 enum.cs, codegen.cs: Report CLS compliance errors as warnings.
3084 2008-07-22 Marek Safar <marek.safar@gmail.com>
3086 A fix for bug #320748
3087 * convert.cs: Implicit user operators cannot convert to interfaces
3089 2008-07-22 Marek Safar <marek.safar@gmail.com>
3091 A fix for bug #312686
3092 * driver.cs: Ignore empty assembly references.
3094 2008-07-22 Marek Safar <marek.safar@gmail.com>
3096 A fix for bug #387040
3097 * ecore.cs: Skip constrains check for an explicit implementation.
3099 2008-07-21 Marek Safar <marek.safar@gmail.com>
3101 A fix for bug #409045
3102 * cs-tokenizer.cs, rootcontext.cs, class.cs, location.cs, delegate.cs,
3103 cs-parser.jay, driver.cs, expression.cs, attribute.cs: Conditional
3104 identifiers are file specific unless passed as input arguments.
3106 2008-07-21 Marek Safar <marek.safar@gmail.com>
3108 * typemanager.cs, parameter.cs, class.cs, attribute.cs: Use an attribute
3109 to emit UnmanagedMarshal data under 2.0 profile.
3111 2008-07-21 Marek Safar <marek.safar@gmail.com>
3113 A fix for bug #410369
3114 * parameter.cs: Clone correctly ParamsParameter.
3116 2008-07-21 Marek Safar <marek.safar@gmail.com>
3118 * expression.cs (Argument): Always report type for type based expressions
3121 2008-07-18 Marek Safar <marek.safar@gmail.com>
3123 A fix for bug #410666
3124 * anonymous.cs: Correctly initialize generic storey reference.
3126 2008-07-18 Marek Safar <marek.safar@gmail.com>
3128 * convert.cs: Don't box same type arguments.
3130 2008-07-18 Marek Safar <marek.safar@gmail.com>
3132 * ecore.cs, linq.cs, delegate.cs, constant.cs, nullable.cs, expression.cs:
3133 Finished missing generic type mutators.
3135 2008-07-18 Marek Safar <marek.safar@gmail.com>
3137 * iterators.cs, statement.cs: Finished statements CloneTo.
3139 2008-07-18 Marek Safar <marek.safar@gmail.com>
3141 * anonymous.cs: ExpressionTreeProxy is of Value type expression.
3143 * expression.cs: Emit optimized default value expressions in expression tree
3146 2008-07-18 Marek Safar <marek.safar@gmail.com>
3148 * ecore.cs, cs-parser.jay, statement.cs: Error reporting fixes.
3150 2008-07-17 Marek Safar <marek.safar@gmail.com>
3152 A fix for bug #367536
3153 * cs-parser.jay: Check static constructor of generic types for an access
3156 2008-07-17 Marek Safar <marek.safar@gmail.com>
3158 A fix for bug #353800
3159 * lambda.cs: Emit ret for contextual statements.
3161 * codegen.cs: Keep both resolved and unreachable flags, otherwise we end
3162 up emitting redundant ret for all anonymous methods with return.
3164 2008-07-17 Marek Safar <marek.safar@gmail.com>
3166 A fix for bug #365188
3167 * ecore.cs, anonymous.cs, expression.cs, codegen.cs, statement.cs: Don't
3168 create anonymous method storey in unreachable block.
3170 2008-07-17 Marek Safar <marek.safar@gmail.com>
3172 * generic.cs, typemanager.cs, cs-tokenizer.cs, parameter.cs, namespace.cs,
3173 class.cs, delegate.cs, flowanalysis.cs, iterators.cs, anonymous.cs,
3174 driver.cs, nullable.cs, expression.cs, attribute.cs, codegen.cs,
3175 statement.cs: Fixed relevant defects found by Gendarme.
3177 2008-07-17 Marek Safar <marek.safar@gmail.com>
3179 A fix for bug #325291
3180 * modifiers.cs, class.cs, cs-parser.jay, anonymous.cs, codegen.cs,
3181 statement.cs: Replaced IAnonymousHost with top level block flag.
3183 2008-07-17 Marek Safar <marek.safar@gmail.com>
3185 * cs-parser.jay: Clean up unused open_parens.
3187 2008-07-17 Marek Safar <marek.safar@gmail.com>
3189 * ecore.cs: Custom error message for a range variable assignment.
3191 2008-07-16 Marek Safar <marek.safar@gmail.com>
3193 * constant.cs, typemanager.cs: Emit empty string ("") as string.Empty field
3196 2008-07-16 Marek Safar <marek.safar@gmail.com>
3198 * literal.cs: Null literal is of object type.
3200 2008-07-16 Marek Safar <marek.safar@gmail.com>
3202 * nullable.cs (LiftedBinaryOperator): Always lift unwrapped nullable
3203 expression of nullable equality comparison.
3205 2008-07-15 Marek Safar <marek.safar@gmail.com>
3207 * expression.cs(PointerArithmetic): Removed redundant assignment.
3209 2008-07-15 Marek Safar <marek.safar@gmail.com>
3211 * decl.cs (GetSignatureForError): Report full namespace name for containers.
3213 2008-07-14 Marek Safar <marek.safar@gmail.com>
3215 A fix for bug #408361
3216 * anonymous.cs (MutateGenericMethod): Store generic type arguments before
3217 they are replaced by GetMethod.
3219 2008-07-14 Marek Safar <marek.safar@gmail.com>
3221 A fix for bug #408721 by jeremie.laval@gmail.com
3222 * expression.cs (Indirection): Implemented CloneTo.
3224 2008-07-14 Marek Safar <marek.safar@gmail.com>
3226 * statement.cs (AssignableSlots): Temporary disabled variable initialization
3229 2008-07-14 Marek Safar <marek.safar@gmail.com>
3231 * report.cs (EnableReporting): Don't reinitialize 0-based values.
3233 2008-07-11 Marek Safar <marek.safar@gmail.com>
3235 * linq.cs: Reset tranparent parameter counter in probing mode.
3237 2008-07-11 Marek Safar <marek.safar@gmail.com>
3239 * anonymous.cs: Mutate anonymous method type.
3241 2008-07-11 Marek Safar <marek.safar@gmail.com>
3243 * ecore.cs, anonymous.cs: Mutate field expressions.
3245 2008-07-10 Marek Safar <marek.safar@gmail.com>
3247 A fix for bug #369670
3248 * linq.cs, statement.cs: Use explicit block for query expressions variables.
3250 2008-07-10 Marek Safar <marek.safar@gmail.com>
3252 * report.cs, ecore.cs: Flush recorder only when silent mode is off.
3254 2008-07-10 Raja R Harinath <harinath@hurrynot.org>
3257 * cs-tokenizer.cs (is_punct): If a generic lookahead is looking
3258 only one '>', and finds a '>>', abort the generic lookahead.
3260 2008-07-10 Marek Safar <marek.safar@gmail.com>
3262 A fix for bug #319902
3263 * cs-tokenizer.cs: Always look-ahed for `>=' when tokenizing `>'.
3265 2008-07-10 Marek Safar <marek.safar@gmail.com>
3267 A fix for bug #406371
3268 * statement.cs: Moved EmitSymbolInfo to Block.
3270 2008-07-09 Marek Safar <marek.safar@gmail.com>
3272 * ecore.cs: Report better error for extension method overload failures.
3274 2008-07-09 Marek Safar <marek.safar@gmail.com>
3276 * expression.cs (Is): No need to box reference values.
3278 2008-07-09 Marek Safar <marek.safar@gmail.com>
3280 * class.cs: Use event resolve context when initializing CreateEmitContext.
3282 2008-07-09 Marek Safar <marek.safar@gmail.com>
3284 A fix for bug #394436
3285 * anonymous.cs, class.cs, expression.cs, lambda.cs: Emit correctly extension
3286 method used inside expression trees. Added more LINQ to expression tree
3289 2008-07-08 Marek Safar <marek.safar@gmail.com>
3291 A fix for bug #378189, #370577
3292 * lambda.cs, ecore.cs: Implemented 3.0 enhancement to better conversion
3295 2008-07-08 Marek Safar <marek.safar@gmail.com>
3297 * anonymous.cs, class.cs, decl.cs: Emit CompilerGenerated attribute
3300 2008-07-08 Marek Safar <marek.safar@gmail.com>
3302 A fix for bug #406702
3303 * anonymous.cs: Always park anonymous method in the nearest parent storey.
3305 2008-07-07 Marek Safar <marek.safar@gmail.com>
3307 A fix for bug #406648
3308 * cs-parser.jay: Report nullable use in mcs for some cases.
3310 2008-07-07 Marek Safar <marek.safar@gmail.com>
3312 * ecore.cs: Improved argument mismatch error messages.
3314 2008-07-07 Marek Safar <marek.safar@gmail.com>
3316 * anonymous.cs: Don't cache generic delegates when reference MVAR argument.
3318 2008-07-07 Marek Safar <marek.safar@gmail.com>
3320 * expression.cs (TypeOf): Mutate type argument.
3322 2008-07-04 Marek Safar <marek.safar@gmail.com>
3324 * class.cs: Report missing partial modifier for correct type.
3326 2008-07-04 Marek Safar <marek.safar@gmail.com>
3328 * ecore.cs, expression.cs (VariableReference): Variable property is
3331 2008-07-04 Marek Safar <marek.safar@gmail.com>
3333 * ecore.cs, convert.cs: Made OpcodeCast more memory efficient.
3335 2008-07-04 Marek Safar <marek.safar@gmail.com>
3337 * anonymous.cs, class.cs, lambda.cs, iterator.cs: Cache static anonymous
3340 2008-07-04 Marek Safar <marek.safar@gmail.com>
3342 * anonymous.cs, class.cs, expression.cs, iterator.cs, statement.cs: Reduce
3343 anonymous method storey to an instance method when only "this" is hoisted.
3345 2008-07-03 Marek Safar <marek.safar@gmail.com>
3347 A fix for bug #321615
3348 * expression.cs: Pointer comparisons use unsigned operator.
3350 2008-07-03 Marek Safar <marek.safar@gmail.com>
3352 * expression.cs: Fixed native pointer conversions. Also fixes #321615.
3354 2008-07-02 Marek Safar <marek.safar@gmail.com>
3356 A fix for bug #404905
3357 * class.cs: Always initialize local unsafe variables.
3359 2008-06-30 Marek Safar <marek.safar@gmail.com>
3361 A fix for bug #396987
3362 * expression.cs (NewInitialize): Clear local temporary variable for next run
3364 2008-06-27 Marek Safar <marek.safar@gmail.com>
3366 A fix for bug #401020
3367 * ecore.cs: Both types and modifiers have to match for ref and out arguments
3369 2008-06-27 Marek Safar <marek.safar@gmail.com>
3371 A fix for bug #398319
3372 * cs-parser.jay: Implemented undocumented base access expression inside
3375 2008-06-26 Marek Safar <marek.safar@gmail.com>
3377 A fix for bug #404227
3378 * cs-parser.jay: Parse namespace declaration using qualified identifier.
3380 2008-06-26 Marek Safar <marek.safar@gmail.com>
3382 A fix for bug #404227
3383 * convert.cs: Fixed explicit array to interface cast.
3385 2008-06-26 Marek Safar <marek.safar@gmail.com>
3387 A fix for bug #403894
3388 * delegate.cs: Mutate DelegateInvocation type.
3390 2008-06-26 Marek Safar <marek.safar@gmail.com>
3392 A fix for bug #379348
3393 * delegate.cs: Box a load of generic parameters.
3395 2008-06-26 Marek Safar <marek.safar@gmail.com>
3397 * expression.cs: Add an array creation arguments mutate.
3399 2008-06-26 Marek Safar <marek.safar@gmail.com>
3401 A fix for bug #386068
3402 * anonymous.cs, expression.cs: Emit correctly hoisted expression tree
3405 2008-06-25 Marek Safar <marek.safar@gmail.com>
3407 * ecore.cs, expression.cs: Fixed broken TypeCast clone, implemented few more
3410 2008-06-25 Marek Safar <marek.safar@gmail.com>
3412 A fix for bug #403518
3413 * delegate.cs: Type correctly anonymous method new invocation.
3415 2008-06-24 Marek Safar <marek.safar@gmail.com>
3417 A fix for bug #394826
3418 * anonymous.cs: Fully qualify members when resolving anonymous type internal
3421 2008-06-24 Marek Safar <marek.safar@gmail.com>
3423 A fix for bug #394826
3424 * anonymous.cs, iterators.cs: Construct generic storey only when is really
3427 2008-06-24 Marek Safar <marek.safar@gmail.com>
3429 * class.cs: Clone indexer parameters for localized capturing.
3431 2008-06-24 Marek Safar <marek.safar@gmail.com>
3433 A fix for bug #402379
3434 * expression.cs: Don't crash when an object initializer resolve fails.
3436 2008-06-24 Marek Safar <marek.safar@gmail.com>
3438 A fix for bug #402888
3439 * expression.cs: Mutate conditional expression.
3441 2008-06-24 Marek Safar <marek.safar@gmail.com>
3443 A fix for bug #401012
3444 * class.cs: Keep StructLayout in shared container.
3446 2008-06-24 Marek Safar <marek.safar@gmail.com>
3448 A fix for bug #400438
3449 * decl.cs, class.cs: Only properties can be automatically implemented.
3451 2008-06-24 Marek Safar <marek.safar@gmail.com>
3453 * statement.cs (ChangeToIterator): Copy also labels.
3455 2008-06-23 Marek Safar <marek.safar@gmail.com>
3457 * ecore.cs: Pass type argument details to parent extension method.
3459 2008-06-23 Marek Safar <marek.safar@gmail.com>
3461 A fix for bug #375966
3462 * delegate.cs: Fixed IsTypeCovariant generic type conversions.
3464 2008-06-23 Raja R Harinath <harinath@hurrynot.org>
3466 * Makefile (bootstrap-libs): Pass NO_DIR_CHECK to sub-make.
3468 2008-06-22 Marek Safar <marek.safar@gmail.com>
3470 A fix for bug #394347
3471 * anonymous.cs: Cache compatible delegates as compatibility check produces
3472 a new method every time.
3474 2008-06-20 Marek Safar <marek.safar@gmail.com>
3476 * anonymous.cs: Propagate storey reference for single references.
3478 2008-06-20 Marek Safar <marek.safar@gmail.com>
3480 A fix for bug #387615
3481 * assign.cs, expression.cs: Correctly clone compound assignment.
3483 2008-06-19 Marek Safar <marek.safar@gmail.com>
3485 A fix for bug #359611, #359604
3486 * anonymous.cs: Mutate all types of hoisted parameters.
3488 2008-06-19 Marek Safar <marek.safar@gmail.com>
3490 * typemanager.cs, lambda.cs, parameter.cs, ecore.cs, linq.cs, class.cs
3491 delegate.cs, iterators.cs, cs-parser.jay, assign.cs, anonymous.cs, driver.cs
3492 expression.cs, codegen.cs, statement.cs
3494 Fixes bugs: #318652, #323223, #234779, #325069, #325476, #332532, #334465,
3495 #345907, #349190, #353276, #355256, #359617, #378542, #384584, #396530
3497 ** Anonymous methods, lambda expressions rewrite **
3499 Anonymous expressions are now resolved when an explicit block is resolved
3500 and they don't require any registration procedure anymore. Further,
3501 anonymous methods are defined when explicit block is emitted which allows
3502 better control of whole process and opens possibilities for more
3503 optimizations as well as alternative to reverse whole process.
3505 A concept of `MutateHoistedGenericType' was introduced to keep the resolve
3506 process consistent and to correctly emit hoisted generic methods when they
3507 have at least 1 hoisted variable.
3509 2008-06-17 Martin Baulig <martin@ximian.com>
3511 * class.cs: Also emit the `[DebuggerHidden]' attribute on the main
3513 (AbstractPropertyEventMethod.IsDebuggerHidden): New protected
3514 virtual property; check it in Emit().
3515 (PropertyMethod.IsDebuggerHidden): Override, check whether we're
3517 (MethodOrOperator.ResolveMethods): Set `DEBUGGER_HIDDEN' if we're
3519 (Indexer.Define): Likewise.
3521 2008-06-17 Marek Safar <marek.safar@gmail.com>
3523 * convert.cs: Don't use IsInterface on type arguments.
3525 * delegate.cs: DelegateInvocation uses MethodInfo.
3527 * parameter.cs: Removed IsTypeParameter.
3529 * generic-mcs.cs: More missing stuff.
3531 2008-06-16 Martin Baulig <martin@ximian.com>
3534 (Modifiers.DEBUGGER_HIDDEN): New public const.
3537 (TypeManager.GetDebuggerHiddenAttribute): New public static method.
3540 (MethodOrOperator.Emit): Check `Modifiers.DEBUGGER_HIDDEN'.
3541 (AbstractPropertyEventMethod): Likewise.
3542 (Constructor.Emit): Likewise.
3543 (SourceMethod.SetCompilerGenerated): Removed.
3545 * iterator.cs: Set `Modifiers.DEBUGGER_HIDDEN' everywhere except
3549 (RootScopeInfo.DoDefineMembers): Set `Modifiers.DEBUGGER_HIDDEN'
3550 if we're an `IteratorHost'.
3551 (AnonymousMethodMethod..ctor): Don't set
3552 `Modifiers.COMPILER_GENERATED'; csc only sets this on the class,
3555 2008-06-16 Marek Safar <marek.safar@gmail.com>
3557 * statement.cs: Clean-up foreach statements.
3559 2008-06-12 Marek Safar <marek.safar@gmail.com>
3561 * class.cs: Stop using public method which should not exist
3562 (MethodBuilder.SetGenericMethodSignature).
3564 2008-06-11 Martin Baulig <martin@ximian.com>
3567 (Location.LookupFile): Add `CompilationUnit' argument; when given
3568 a relative file name, make it relative to the directory the .cs
3569 file is located in instead of using the current directory.
3571 2008-06-11 Martin Baulig <martin@ximian.com>
3574 (IMethodData.EmitExtraSymbolInfo): Added `SourceMethod' argument.
3575 (MethodOrOperator.EmitExtraSymbolInfo): Likewise.
3576 (SourceMethod.SetRealMethodName): Moved here from the symbol writer.
3577 (SourceMethod.SetCompilerGenerated): Likewise.
3579 2008-06-11 Marek Safar <marek.safar@gmail.com>
3581 * codegen.cs, driver: Only write symbol file when it's asked for.
3583 2008-06-11 Marek Safar <marek.safar@gmail.com>
3585 * codegen.cs: Don't use assembly writer error handling for symbol writer.
3587 2008-06-10 Martin Baulig <martin@ximian.com>
3589 * symbolwriter.cs: Reflect latest MarkSequencePoint() API changes.
3591 2008-06-09 Marek Safar <marek.safar@gmail.com>
3593 A fix for bug #316290
3594 * expression.cs: Include decimal operators in predefined table.
3596 * parameters.cs: More readonlyness.
3598 2008-06-09 Marek Safar <marek.safar@gmail.com>
3600 A fix for bug #397213
3601 * cs-parser.jay: One more missing current_local_parameters reset.
3603 2008-06-09 Marek Safar <marek.safar@gmail.com>
3605 A fix for bug #396633
3606 * class.cs: Host backing field in partial container.
3608 2008-06-09 Marek Safar <marek.safar@gmail.com>
3610 A fix for bug #397068
3611 * expression.cs: Check both operand types when predefined operator is used.
3613 2008-06-05 Martin Baulig <martin@ximian.com>
3615 Merged the `debugger-kahalo' branch.
3618 (MethodData.Emit): Call SymbolWriter.SetCompilerGenerated() if
3619 we're an iterator method.
3620 (SourceMethod): Reflect latest symbol writer changes;
3621 SymbolWriter.OpenMethod() now takes a `ICompileUnit' argument and
3622 now `start_row' and `end_row'.
3623 (Constructor.Emit): Fix the logic whether to emit symbol information.
3625 * iterator.cs: Call SymbolWriter.SetCompilerGenerated() on all the
3629 (CompilationUnit): New public class; derives from `SourceFile'.
3630 (SourceFileEntry.DefineSymbolInfo): New public method.
3631 (SourceFileEntry.SetChecksum): New public method.
3632 (Location): Encode hidden line numbers by using `column == 255';
3633 the .ctor now accepts `column == -1' to mark a hidden line number.
3634 (Location.Hidden): New public property.
3635 (Location.CheckPoint): Add `CompilationUnit'.
3636 (Location.SourceFiles): Change return type to `CompilationUnit[]'.
3637 (Location.Push): Add `CompilationUnit compile_unit' argument.
3638 (Location.CompilationUnit): New public property.
3641 (ToplevelBlock.Emit): Add `ec.Mark (EndLocation)'.
3643 * cs-parser.jay: `SourceFile' -> `CompilationUnit'.
3645 * driver.cs: `SourceFile' -> `CompilationUnit'.
3647 * cs-tokenizer.cs: `SourceFile' -> `CompilationUnit'.
3649 * namespace.cs: `SourceFile' -> `CompilationUnit'.
3651 * cs-tokenizer.cs: Add support for `#pragma checksum' and
3655 (SymbolWriter.MarkSequencePoint): Take a `Location' and use the
3656 new symbol writer API to also pass the file.
3658 2008-06-05 Marek Safar <marek.safar@gmail.com>
3660 * statement.cs: Emit catch variable assignment using variable expression.
3662 2008-06-05 Marek Safar <marek.safar@gmail.com>
3664 * ecore.cs, expression.cs, statement.cs: Make TemporaryVariable compatible
3665 with other variable types.
3667 2008-06-04 Marek Safar <marek.safar@gmail.com>
3669 * ecore.cs, expression.cs, statement.cs, typemanager.cs: Removed custom
3670 GetLength method emit, it breaks resolve rules.
3672 2008-06-02 Atsushi Enomoto <atsushi@ximian.com>
3673 Marek Safar <marek.safar@gmail.com>
3675 A fix for bug #395542
3676 * cs-parser.jay: The trailing comma is allowed in anonymous type member
3679 2008-06-02 Marek Safar <marek.safar@gmail.com>
3681 A fix for bug #395287
3682 * class.cs, modifiers.cs: Automatic properties method base modifiers checks.
3684 2008-05-31 Marek Safar <marek.safar@gmail.com>
3686 A fix for bug #395845
3687 * class.cs, nullable.cs: User unary operator is allowed to have nullable and
3688 non-nullable parameter type.
3690 2008-05-31 Marek Safar <marek.safar@gmail.com>
3692 * class.cs: Handle contructor initializer as a statement in top-level block.
3694 2008-05-30 Marek Safar <marek.safar@gmail.com>
3696 * attribute.cs: Don't mix old and new corlib types when emitting corlib
3697 security attributes.
3699 2008-05-24 Marek Safar <marek.safar@gmail.com>
3701 * ecore.cs, expression.cs: Small IVariable refactoring.
3703 2008-05-22 Marek Safar <marek.safar@gmail.com>
3705 * assign.cs (LocalTemporary): Implemented CreateExpressionTree.
3707 2008-05-21 Marek Safar <marek.safar@gmail.com>
3709 * cs-parser.jay: Removed redundant catch type check.
3711 2008-05-21 Marek Safar <marek.safar@gmail.com>
3713 A fix for bug #390372
3714 * nullable.cs: Set correct return type.
3716 2008-05-21 Marek Safar <marek.safar@gmail.com>
3718 A fix for bug #391062
3719 * typemanager.cs: Fixed crash when comparing null types.
3721 2008-05-21 Marek Safar <marek.safar@gmail.com>
3723 A fix for bug #391871
3724 * cs-parser.jay: Better error handling for invalid catch type.
3726 2008-05-20 Marek Safar <marek.safar@gmail.com>
3728 A fix for bug #392155
3729 * cs-tokenizer.cs: Fixed casting of byte and decimal expression.
3731 2008-05-15 Marek Safar <marek.safar@gmail.com>
3733 A fix for bug #390666
3734 * ecore.cs (BetterExpressionConversion): Unwrap each Expression<T>
3737 2008-05-15 Marek Safar <marek.safar@gmail.com>
3739 * class.cs, expression.cs, statement.cs: Removed a hack, setting block flag
3742 2008-05-13 Marek Safar <marek.safar@gmail.com>
3744 A fix for bug #389625
3745 * delegate.cs, generic.cs: Some progress on method group return type
3748 2008-05-13 Marek Safar <marek.safar@gmail.com>
3750 A fix for bug #378419
3751 * namespace.cs: Inspect also parent namespaces not only namespace entries.
3753 2008-05-12 Marek Safar <marek.safar@gmail.com>
3755 * class.cs (Constructor): Added IsCompilerGenerated.
3757 2008-05-12 Marek Safar <marek.safar@gmail.com>
3759 * expression.cs: Enum binary operators can accept non-enum operand only when
3760 is implicitly convertible to underlying type.
3762 2008-05-12 Marek Safar <marek.safar@gmail.com>
3764 A fix for bug #389272
3765 * support.cs: Workaround System.InvalidOperationException for enums.
3767 2008-05-12 Marek Safar <marek.safar@gmail.com>
3769 A fix for bug #389073
3770 * convert.cs: More undocumented explicit IntPtr/UIntPtr conversions.
3772 2008-05-10 Marek Safar <marek.safar@gmail.com>
3774 * driver.cs: Split Parse.
3776 * location.cs (LookupFile): Uses string.Empty.
3778 2008-05-07 Marek Safar <marek.safar@gmail.com>
3780 * expression.cs, parameter.cs: Small ParameterReference clean up.
3782 2008-05-07 Marek Safar <marek.safar@gmail.com>
3784 * anonymous.cs, codegen.cs, convert.cs, ecore.cs: Removed uber ugly TempEc
3785 hack. Fixes #387502.
3787 2008-05-06 Martin Baulig <martin@ximian.com>
3789 * class.cs (Constructor.Emit): Fix the logic whether to emit
3792 2008-05-06 Raja R Harinath <harinath@hurrynot.org>
3795 * iterators.cs (Iterator.CurrentBlock.DoEmit): Don't emit
3796 InvalidOperationException when the iterator is before the start or
3799 2008-05-06 Marek Safar <marek.safar@gmail.com>
3801 * nullable.cs (NullCoalescingOperator): Result is underlying type of left,
3802 when left is nullable type.
3804 2008-05-06 Marek Safar <marek.safar@gmail.com>
3806 A fix for bug #386628
3807 * expression.cs (LocalVariableReference): Continue in resolving when
3808 variable is not assigned.
3810 2008-05-05 Marek Safar <marek.safar@gmail.com>
3812 * nullable.cs, statement.cs (Unwrap): Store non-variable expression in all
3813 nullable operations.
3815 2008-05-04 Marek Safar <marek.safar@gmail.com>
3817 * nullable.cs, statement.cs (Unwrap): Don't duplicate variable expressions,
3818 it saves many redundant temporary variables for nullable operations.
3820 2008-05-03 Marek Safar <marek.safar@gmail.com>
3822 * assign.cs: EventAddOrRemove is a statement and cannot have a type.
3824 * cfold.cs, constant.cs, expression.cs: Share Error_OperatorCannotBeApplied
3827 * nullable.cs: Constant coalescing operator optimizations.
3829 2008-05-03 Marek Safar <marek.safar@gmail.com>
3831 * constant.cs: Use unsigned conversion for values which are unsigned only.
3833 2008-05-03 Marek Safar <marek.safar@gmail.com>
3835 * convert.cs, literal.cs, nullabel.cs, typemanager.cs: Implemeted null
3836 coalescing operator as it should be.
3838 2008-05-02 Marek Safar <marek.safar@gmail.com>
3840 A fix for bug #371016
3841 * expression.cs: All predefined delegate operators require implicit method
3844 2008-05-02 Marek Safar <marek.safar@gmail.com>
3846 * constant.cs: Emit long constant as uint when fits the range.
3848 * convert.cs, expression.cs: Fixed few unsafe conversions.
3850 2008-05-02 Marek Safar <marek.safar@gmail.com>
3852 * convert.cs, literal.cs: Don't wrap implicit reference conversion to object
3854 2008-05-02 Raja R Harinath <harinath@hurrynot.org>
3857 * convert.cs (ImplicitNumericConversion): Don't modify the type of
3859 * ecore.cs (EmptyCast.Create): Flatten nested EmptyCasts.
3861 2008-05-01 Marek Safar <marek.safar@gmail.com>
3863 * constant.cs, literal.cs: IsLiteral property for error reporting.
3865 * ecore.cs, expression.cs: Implemented Property expression.
3867 2008-05-01 Marek Safar <marek.safar@gmail.com>
3869 * class.cs, modifiers.cs, flowanalysis.cs: New BACKING_FIELD flag.
3871 * nullable.cs: Implemented nullable coalescing null operator.
3873 * ecore.cs, expression.cs: Expression trees work.
3875 2008-05-01 Marek Safar <marek.safar@gmail.com>
3877 * ecore.cs: CreateExpressionTree is finally abstract.
3879 * expression.cs, linq.cs: Updated.
3881 2008-05-01 Marek Safar <marek.safar@gmail.com>
3883 * expression.cs, ecore.cs: Block base access expression inside expression
3886 2008-05-01 Marek Safar <marek.safar@gmail.com>
3888 A fix for bug #385058
3889 * expression.cs: User-defined operator implementations always take
3890 precedence over predefined operator implementations.
3892 2008-04-30 Marek Safar <marek.safar@gmail.com>
3894 * assign.cs, anonymous.cs, lambda.cs, nullable.cs, ecore.cs, linq.cs,
3895 class.cs, iterators.cs, expression.cs, attribute.cs: Filled a few more
3896 expression tree conversions.
3898 2008-04-30 Marek Safar <marek.safar@gmail.com>
3900 * typemanager.cs, ecore.cs, class.cs, expression.cs, doc.cs: Merged all
3901 operators method details to Operator class.
3903 2008-04-30 Marek Safar <marek.safar@gmail.com>
3905 * anonymous.cs: Pass unsafe flags to anonymous container.
3907 * ecore.cs, expression.cs, statement.cs: Block unsafe pointer operations
3908 inside expression tree.
3910 2008-04-29 Martin Baulig <martin@ximian.com>
3912 * cs-tokenizer.cs (Tokenizer.Position): Added `line'.
3913 (Tokenizer.PopPosition): Also restore the `line'.
3915 2008-04-29 Marek Safar <marek.safar@gmail.com>
3917 * delegate.cs: Implemented Invoke expression.
3919 2008-04-29 Marek Safar <marek.safar@gmail.com>
3921 * expression.cs: Fixed equality reference comparison regression.
3923 2008-04-29 Marek Safar <marek.safar@gmail.com>
3925 * ecore.cs: Clean up EmptyCast hack.
3927 * expression.cs, nullable.cs: Implemented enum binary and unary operations
3928 using correct conversion rules. Also fixes #383993.
3930 2008-04-28 Martin Baulig <martin@ximian.com>
3932 * class.cs (Constructor.Emit): Don't emit debugging information
3933 for generated default .ctor's.
3935 2008-04-28 Marek Safar <marek.safar@gmail.com>
3937 * convert.cs: Empty-cast ushort to int conversion.
3939 2008-04-28 Marek Safar <marek.safar@gmail.com>
3941 A fix for bug #384191
3942 * ecore.cs, expression.cs: Fixed expression cloning.
3944 2008-04-28 Marek Safar <marek.safar@gmail.com>
3946 * ecore.cs, delegate.cs, assign.cs: Few tweaks for recent changes.
3948 2008-04-28 Raja R Harinath <harinath@hurrynot.org>
3950 Fix #381559, test-638.cs, test-639.cs
3951 * assign.cs (CompoundAssign.Helper): New wrapper.
3952 (CompoundAssign.DoResolve): Use it to wrap the nested 'target'
3954 * ecore.cs (MethodGroupExpr.VerifyArgumentsCompat) <params arguments>:
3955 Pass unconverted expressions to the params array creation expression.
3956 (FieldExpr.EmitAssign): Don't special-case StringConcat.
3957 (PropertyExpr.EmitAssign): Likewise.
3958 * expression.cs (ArrayCreation.ResolveArrayElement): Keep track of the
3959 element if it is of kind CompoundAssign.Helper.
3960 (ArrayCreation.Emit): If we saw a CompoundAssign.Helper, emit it
3961 first before anything else.
3962 (ArrayAccess.EmitAssign): Don't special-case StringConcat.
3963 (ArrayAccess.LoadArrayAndArguments): Simplify.
3965 2008-04-27 Marek Safar <marek.safar@gmail.com>
3967 * expression.cs: Fixed cloning of typeof(void).
3969 2008-04-27 Raja R Harinath <harinath@hurrynot.org>
3971 * assign.cs (Assign.DoResolve): Remove support for EventExprs.
3972 (Assign.Emit): Likewise. Move it to ...
3973 (CompoundAssign.DoResolve): ... here and ...
3974 (CompoundAssign.Emit): ... here.
3975 (EventAddOrRemove): New helper to handle += and -= on events, and
3976 avoid the use of BinaryDelegates.
3977 * ecore.cs (EventExpr.DoResolveLValue): Emit CS0070 unconditionally.
3978 (EventExpr.EmitAddOrRemove): Improve.
3979 * delegate.cs (DelegateInvocation.DoResolve): Simplify slightly.
3981 * cs-parser.jay (type) <namespace_or_type_name variant>: Don't
3982 create VarExprs for 'foo.bar.var'.
3983 * ecore.cs (VarExpr.InferType): Rename from DoResolveLValue, which
3984 is a highly inappropriate name for its functionality.
3986 2008-04-26 Raja R Harinath <harinath@hurrynot.org>
3988 Simplify handling of multiple assignments
3989 * assign.cs (Assign): Clear out all 'embedded assign' gunk. Make
3991 (SimpleAssign): New. Class to be used for normal assignments.
3992 * anonymous.cs, class.cs, cs-parser.jay: Update to changes.
3993 * expression.cs, parameter.cs, statement.cs: Likewise.
3995 2008-04-25 Marek Safar <marek.safar@gmail.com>
3997 * ecore.cs, expression.cs, nullable.cs: Implemeted enum binary add operation
3998 for incompatible underlying types, more to come, uff.
4000 2008-04-26 Raja R Harinath <harinath@hurrynot.org>
4003 * expression.cs (VariableReference.EmitAssign) <source is NewInstance>:
4004 Handle 'leave_copy'.
4006 2008-04-25 Marek Safar <marek.safar@gmail.com>
4008 * expression.cs, nullable.cs: Implemented UnaryPlus expression.
4010 2008-04-24 Raja R Harinath <harinath@hurrynot.org>
4012 Fix test-636.cs. Sprinkle a few more 'EmitSideEffect's around
4013 * expression.cs (Unary.TryReduceConstant): Unwrap SideEffectConstant.
4014 * statement.cs (While, Do, For): Allow test to have side effects.
4015 (For.DoEmit): Always emit InitStatement.
4018 * expression.cs (Binary.DoResolve) <BitwiseAnd with zero constant>:
4019 Always create SideEffectConstant.
4020 (Binary.EnumLiftUp): Don't assume that the enumeration constant is
4021 of type EnumConstant.
4023 * expression.cs (Binary.EmitBranchable) <Equality with constant>:
4024 Handle 'right' being SideEffectConstant of type 'bool'.
4026 * expression.cs (Binary.EmitBranchable) <Equality with constant>:
4027 Use left.EmitBranchable instead of open coding it, so as to
4028 improve optimization opportunities.
4030 * constant.cs (SideEffectConstant.EmitSideEffect): Simplify slightly.
4032 * ecore.cs (Expression.EmitBranchable): Document some non-obvious
4034 (Expression.EmitSideEffect): Document.
4036 2008-04-23 Marek Safar <marek.safar@gmail.com>
4038 * expression.cs: Implemented NewArrayBounds, TypeIs, and TypeAs expressions.
4040 2008-04-23 Marek Safar <marek.safar@gmail.com>
4042 * constant.cs, statement.cs: Use EmitSideEffect for constant if statement.
4044 2008-04-23 Marek Safar <marek.safar@gmail.com>
4046 * ecore.cs, expression.cs, delegate.cs: Implemeted delegate instantiation
4047 conversion to expression tree.
4049 2008-04-23 Marek Safar <marek.safar@gmail.com>
4051 * ecore.cs: Removed unused expression.
4053 2008-04-22 Marek Safar <marek.safar@gmail.com>
4055 * expression.cs: Implemented NegateChecked and New expressions.
4057 2008-04-22 Marek Safar <marek.safar@gmail.com>
4059 * convert.cs, nullable.cs, expression.cs: Implemented Negate expression.
4061 2008-04-22 Raja R Harinath <harinath@hurrynot.org>
4064 * anonymous.cs (AnonymousMethodExpression.DoResolve): Mark as
4065 needing final 'ret' instruction.
4067 2008-04-22 Marek Safar <marek.safar@gmail.com>
4069 * expression.cs: Disabled lifted binary conversion on ISO-1 profiles.
4071 2008-04-21 Marek Safar <marek.safar@gmail.com>
4073 * expression.cs: Emit ldnull and not null expression as an instance argument
4074 of static method expression calls.
4076 2008-04-21 Marek Safar <marek.safar@gmail.com>
4078 A fix for bug #378200
4079 * expression.cs: Fixed crash when creating parameterless expression tree
4082 2008-04-21 Marek Safar <marek.safar@gmail.com>
4084 A fix for bug #375297
4085 * anonymous.cs: Fixed crash when inferring from null argument anonymous
4088 2008-04-21 Marek Safar <marek.safar@gmail.com>
4090 A fix for bug #377596
4091 * decl.cs, class.cs: Emit delegate type argument attributes.
4093 2008-04-21 Marek Safar <marek.safar@gmail.com>
4095 A fix for bug #365314
4096 * generic.cs, ecore.cs: Type parameter declaration cannot be of generic type
4098 2008-04-21 Marek Safar <marek.safar@gmail.com>
4100 * cs-parser.jay, expression.cs: ComposedCast can work with type expressions
4103 2008-04-21 Marek Safar <marek.safar@gmail.com>
4105 * generic.cs (TypeParameter): Removed redundant location.
4107 2008-04-19 Marek Safar <marek.safar@gmail.com>
4109 * generic.cs, parameter.cs, namespace.cs, ecore.cs, class.cs, decl.cs,
4110 delegate.cs, iterators.cs, cs-parser.jay, const.cs, enum.cs: Use
4111 FullNamedExpression in all declaration type expression, statements will come
4114 2008-04-18 Marek Safar <marek.safar@gmail.com>
4116 * generic.cs, namespace.cs, ecore.cs, class.cs, decl.cs, generic-mcs.cs,
4117 nullable.cs, expression.cs, enum.cs, doc.cs: Cleaning up type expressions.
4119 2008-04-18 Marek Safar <marek.safar@gmail.com>
4121 * parameter.cs, delegate.cs, cs-parser.jay, expression.cs: Removed unused
4124 2008-04-17 Marek Safar <marek.safar@gmail.com>
4126 * decl.cs, class.cs, generic.cs: Verify partial parts type parameters and
4129 2008-04-17 Marek Safar <marek.safar@gmail.com>
4131 * decl.cs, class.cs, cs-parser.jay, ecore.cs, expression.cs: Unify all type
4135 2008-04-17 Raja R Harinath <harinath@hurrynot.org>
4137 Hook up 'EmitSideEffect'
4138 * constant.cs (Constant.EmitSideEffect): New.
4139 (SideEffectConstant.Emit): Simplify. Use EmitSideEffect.
4140 (SideEffectConstant.EmitSideEffect): New.
4141 * ecore.cs (BoxedCast.EmitBranchable): Remove. We can't use an
4142 unconditional branch in EmitBranchable.
4143 (FieldExpr.EmitBranchable): New.
4144 * expression.cs (Unary.EmitSideEffect): New.
4145 (Binary.EmitSideEffect): New.
4146 (VariableReference.EmitSideEffect): New. Do nothing.
4148 2008-04-16 Raja R Harinath <harinath@hurrynot.org>
4150 Introduce 'EmitSideEffect'
4151 * ecore.cs (Expression.EmitSideEffect): New.
4152 (TypeCast): Rename from EmptyCast.
4154 (EmptyCast.EmitBranchable, EmptyCast.EmitSideEffect): Implement.
4155 (BoxedCast.EmitBranchable, BoxedCast.EmitSideEffect): Implement.
4156 * convert.cs, nullable.cs: Update to changes.
4158 2008-04-16 Marek Safar <marek.safar@gmail.com>
4160 * class.cs, cs-parser.jay: Early check for base types expression.
4162 2008-04-16 Marek Safar <marek.safar@gmail.com>
4164 * decl.cs (MemberName): Declare PrettyName as obsolete.
4166 2008-04-16 Marek Safar <marek.safar@gmail.com>
4168 * namespace.cs: Use MemberName comparison.
4170 2008-04-16 Raja R Harinath <harinath@hurrynot.org>
4173 * decl.cs (MemberName.PrettyName): New. Replaces the misnamed
4175 (MemberName.MethodName, MemberName.GetSignatureForError): Improve.
4176 (MemberName.FullyQualifiedName): New. Provides the functionality
4177 that users assume FullName would have.
4178 * ecore.cs, namespace.cs: Update to changes.
4180 * statement.cs (Using.assign): Make into ExpressionStatement.
4181 (Using.EmitPreTryBody): Simplify.
4183 2008-04-16 Marek Safar <marek.safar@gmail.com>
4185 * report.cs: ColorFormat is protected.
4187 * rootcontext.cs: Unused fields clean-up.
4189 * namespace.cs: Made UsingEntry name private.
4191 2008-04-16 Marek Safar <marek.safar@gmail.com>
4193 * cs-tokenizer.cs, location.cs: Removed unused field.
4195 2008-04-16 Jan Oravec <jan.oravec@6com.sk>
4196 Raja R Harinath <harinath@hurrynot.org>
4199 * constant.cs (SideEffectConstant.value): Rename from 'left'.
4200 (SideEffectConstant.side_effect): Rename from 'right'.
4201 (SideEffectConstant..ctor): Normalize 'side_effect'.
4202 (SideEffectConstant.Emit): Emit 'value', not 'side_effect' as the
4203 value of this constant.
4204 * cfold.cs: Update to changes.
4206 2008-04-15 Marek Safar <marek.safar@gmail.com>
4208 * cs-paser.jay: Removed unused variable.
4210 * driver.cs: Made Compile instance method.
4212 2008-04-15 Raja R Harinath <harinath@hurrynot.org>
4214 * flowanalysis.cs (FlowBranching.MergeChild): Simplify.
4216 2008-04-15 Marek Safar <marek.safar@gmail.com>
4218 * cs-paser.jay, namespace.cs: Simplified handling of namespace imports.
4220 2008-04-13 Jb Evain <jbevain@novell.com>
4222 * namespace.cs: update the System.Core fullname for 2.1
4223 * driver.cs: update the list of required assemblies for 2.1.
4224 Merged from the Moonlight 2 branch.
4226 2008-04-11 Marek Safar <marek.safar@gmail.com>
4228 * assign.cs, ecore.cs, expression.cs, nullable.cs: More work on nullable
4229 types and user defined operators. User operators arguments has to be checked
4230 for null value before invocation, which also means no operator is called
4231 when any argument is not convertible to unwrapped nullable type.
4233 2008-04-09 Marek Safar <marek.safar@gmail.com>
4235 * convert.cs, ecore.cs, expression.cs, nullable.cs: Initial refactoring
4236 of Unary expressions to follow operator overloading rules precisely.
4237 Also fixes #321794, #323794
4239 2008-04-08 Marek Safar <marek.safar@gmail.com>
4241 * cs-parser.jay, expression.cs: Don't wrap Indirection expression in Unary
4244 2008-04-08 Marek Safar <marek.safar@gmail.com>
4246 * expression.cs, ecore.cs: Implemented MemberInit expression.
4248 2008-04-08 Raja R Harinath <harinath@hurrynot.org>
4250 Fix mono/tests/exception4.cs
4251 * statement.cs (ExceptionStatement, TryCatch): Revert to using
4252 ec.NeedReturnLabel () rather emitting a 'nop'.
4254 * statement.cs (ExceptionStatement.SomeCodeFollows): A hook for a
4256 (TryCatch.SomeCodeFollows): Likewise.
4257 * flowanalysis.cs (FlowBranchingException): Call 'SomeCodeFollows'
4258 for 'break', 'continue' and 'return' statements inside a try.
4259 We're fairly sure that the generated IL stream will have more
4260 instructions textually following the try.
4261 (FlowBranchingTryCatch): Likewise.
4263 * statement.cs (Throw.Resolve): Move CS0156 and CS0724 testing ...
4264 * flowanalysis.cs (FlowBranching.CheckRethrow): ... here and to its
4267 * statement.cs (CollectionForeach.DisposableWrapper): Make a true
4268 wrapper -- forward everything to CollectionForeach.
4269 (CollectionForeach.NonDisposableWrapper): New.
4270 (CollectionForeach.EmitFinallyBody): Use 'endfinally' instruction
4271 instead of a pop + branch to end.
4273 2008-04-07 Marek Safar <marek.safar@gmail.com>
4275 A fix for bug #377485
4276 * assign.cs, expression.cs, decl.cs, class.cs, ecore.cs, namespace.cs:
4277 Propagate location for extension method groups. Report conversion failure at
4280 2008-04-07 Marek Safar <marek.safar@gmail.com>
4282 * anonymous.cs, expression.cs, ecore.cs, typemanager.cs: Implemented
4283 ListInit and Field expressions.
4285 2008-04-06 Raja R Harinath <harinath@hurrynot.org>
4287 * iterators.cs (Iterator.EmitMoveNext): Remove try/fault wrapper.
4288 Since $PC is always -1 inside the body of MoveNext, the fault
4290 * flowanalysis.cs (FlowBranchingException.EmitFinally): Kill.
4291 * statement.cs (ExceptionStatement.emit_finally): Likewise.
4292 (ExceptionStatement.ResolveFinally): Drop 'branching' argument.
4294 The denouement! Fix #324708
4295 * iterators.cs (Iterator.EmitMoveNext): Reset $PC to -1 on entry.
4296 (Iterator.EmitYieldBreak): We no longer need to reset $PC.
4297 * statement.cs (ExceptionStatement.DoEmit): Actually emit the
4298 'finally' inside the finally clause.
4300 * statement.cs (ExceptionStatement.DoEmit): Emit try/finally block
4301 inside an iterator. Don't emit the body of the 'finally' inside
4302 the finally clause yet.
4304 Use the ResumableStatement infrastructure for MoveNext ()
4305 * iterators.cs (Iterator.EmitMoveNext_NoResumePoints): New.
4306 (Iterator.EmitMoveNext): Use 'resume_points'. Get rid of
4307 'old_resume_points'. Move dispatcher upfront.
4308 (Iterator.MarkYield): Mark the 'resume_point' of a Yield.
4309 * statement.cs (ExceptionStatement.DoEmit): Emit a dispatcher if
4310 in an enumerator. This encodes the main fix in this patch series
4311 -- we can only jump into the first instruction of a try from the
4312 outside, but we want to emit try/finally regions in iterators and
4313 resume in the middle of them.
4315 2008-04-05 Raja R Harinath <harinath@hurrynot.org>
4317 * statement.cs (ExceptionStatement.ResolveFinally): Move setting
4318 of NeedReturnLabel here.
4320 Introduce a common point for emitting try/finally to IL
4321 * statement.cs (ExceptionStatement.DoEmit): New. Combines all the
4322 features of the various subclasses, which are now driven by ...
4323 (ExceptionStatement.EmitPreTryBody): ... this and ...
4324 (ExceptionStatement.EmitTryBody): ... this and the original
4326 (TryFinally, Lock, Using, UsingTemporary, DisposableWrapper):
4327 Remove DoEmit and update to follow above protocol.
4329 * statement.cs (ExceptionStatement.EmitForDispose): If all labels
4330 of the dispatcher are the same, skip emitting the 'switch'.
4331 * iterator.cs (Iterator.EmitDispose): Update to changes.
4333 Clean up handling of 'using' statement
4334 * statement.cs (UsingTemporary): New. Carved out of ...
4335 (Using): ... this. Simplify drastically. Handle exactly
4337 * cs-parser.jay (using_statement): Split. Create UsingTemporary
4338 or Using as appropriate. If there are multiple variable declared,
4339 create nested Using statements.
4340 (resource_acquisition): Kill.
4342 * statement.cs (ExceptionStatement.EmitForDispose): Use
4343 EmitFinallyBody, not EmitFinally.
4345 * flowanalysis.cs (FlowBranching.StealFinallyClauses): Remove.
4346 * iterator.cs: Update to changes.
4348 Start using the ResumableStatement infrastructure
4349 * statement.cs (ResumeableStatement.PrepareForDispose): New.
4350 (ResumableStatement.EmitForDispose): New.
4351 (ExceptionStatement): Override them.
4352 * iterators.cs (Iterator.EmitDispose): Use PrepareForDispose and
4353 EmitForDispose to create the body of the Dispose method. Don't
4356 * iterator.cs (Iterator.AddResumePoint): Move here from ...
4357 * statement.cs (Toplevel.AddResumePoint): ... here.
4358 (Toplevel.MoveNextStatement.Resolve): Create FlowBranchingIterator.
4359 * flowanalysis.cs (FlowBranchingIterator): New.
4360 * codegen.cs (EmitContext): Update to changes.
4362 * iterators.cs (Iterator.OldResumePoint): Rename from ResumePoint.
4363 (Iterator.old_resume_points): Rename from 'resume_points'.
4364 (Iterator.MoveNextStatement): Remove unused class.
4366 New infrastructure for try/finally in iterators (still unused)
4367 * flowanalysis.cs (FlowBranching.AddResumePoint): New.
4368 (FlowBranchingToplevel.AddResumePoint): Hook into
4369 ToplevelBlock.AddResumePoint.
4370 (FlowBranchingTryCatch): Move CS01626 and CS01631 checks here.
4371 (FlowBranchingException): Hook into ExceptionBlock.AddResumePoint.
4372 * statement.cs (ToplevelBlock.AddResumePoint): New. Collect
4373 resume points and assign program-counter values.
4374 (ExceptionBlock.AddResumePoint): Collect resume points for
4375 de-muxer at the top of try block.
4376 * iterators.cs (Yield.CheckContext): Simplify.
4377 (Yield.Resolve): Use FlowBranching.AddResumePoint.
4379 2008-04-04 Raja R Harinath <harinath@hurrynot.org>
4381 * flowanalysis.cs (FlowBranching.AddReturnOrigin): Change Location
4382 argument to an ExitStatement.
4383 (FlowBranchingException): Refactor saved origins code.
4384 * statement.cs (ExitStatement): Update to cahges.
4385 * iterator.cs (YieldBreak): Likewise.
4387 * statement.cs (ResumableStatement): New. Common base class for
4388 YieldReturn and ExceptionStatement.
4389 (ExitStatement): New. Common base class for Return and YieldBreak.
4390 (Return): Update to changes.
4391 * iterator.cs (YieldBreak): Likewise.
4392 * lambda.cs (ContextualReturn): Likewise.
4395 * ecore.cs (Expression.ResolveAsTypeStep): If '!silent' attempt to
4396 emit a meaningful error message.
4398 Fix #324765, #319508
4399 * flowanalysis.cs (VariableInfo.IsEverAssigned): New.
4400 (VariableInfo.SetAssigned): Set it.
4401 * statement.cs (Block.UsageWarning): Use 'IsEverAssigned' to
4402 determine if CS0219 or CS0168 is appropriate. Don't use
4403 flow-analysis information.
4404 (Block.Resolve): Use ec.EndFlowBranching, not ec.DoEndFlowBranching.
4405 * codegen.cs (EmitContext.DoEndFlowBranching): Kill. Inline into ...
4406 (EmitContext.EndFlowBranching): ... this.
4408 2008-04-03 Marek Safar <marek.safar@gmail.com>
4410 * class.cs, typemanager.cs: Emit volatile field with IsVolatile modifier.
4412 2008-04-03 Marek Safar <marek.safar@gmail.com>
4414 A fix for bug #376508
4415 * convert.cs, expression.cs: Fixed difference between ImplicitConversion and
4416 ImplicitConversionExists.
4418 2008-04-03 Marek Safar <marek.safar@gmail.com>
4420 * expression.cs (Binary): Added remaining binary operators to expression
4423 * nullable.cs: Optimize shift with null argument.
4425 2008-04-03 Raja R Harinath <harinath@hurrynot.org>
4427 Fix minor IL regression
4428 * statement.cs (TryCatch..ctor): Add 'inside_try_finally' argument.
4429 (TryCatch.DoEmit): Use it to avoid creating another ExceptionBlock.
4430 * cs-parser.jay (try_statement): Update to changes.
4432 * statement.cs (TryFinally.need_exc_block): Delete.
4433 (TryFinally): Update to changes.
4435 Now all ExceptionStatements are unconditional
4436 * statement.cs (CollectionForeach.DisposableWrapper): New.
4437 Extract out the try/finally code into a new wrapper.
4438 (CollectionForeach.Resolve): Use it to simplify the code.
4440 2008-04-02 Raja R Harinath <harinath@hurrynot.org>
4442 Start at simplifying ExceptionStatement semantics a bit
4443 * statement.cs (TryCatch, TryFinally): Split 'Try' into two pieces.
4444 * cs-parser.jay (try_statement): Update to changes.
4445 (opt_catch_clauses): Remove.
4446 * flowanalysis.cs: Update to changes.
4447 (FlowBranching.BranchingType.TryCatch): New.
4448 (FlowBranchingTryCatch): New.
4450 * flowanalysis.cs (FlowBranching.BranchingType.SwitchSection): Kill.
4451 (FlowBranching.CreateBranching): Update to changes.
4452 (FlowBranchingBlock.AddSibling): Add sanity check.
4453 * codegen.cs (EmitContext.StartFlowBranching) <Block variant>:
4456 * iterators.cs (Iterator.MarkFinally): Remove.
4457 * statement.cs (ExceptionStatement): Update to changes.
4459 Add support for skipping over finally blocks at runtime. First
4460 in a series to fix #324708
4461 * iterators.cs (Iterator.SkipFinally): New LocalBuilder.
4462 (Iterator.EmitMoveNext): Initialize it.
4463 * statement.cs (ExceptionStatement.EmitFinally): Use it to emit a
4464 branch over the body of the 'finally' clause.
4466 2008-03-31 Raja R Harinath <harinath@hurrynot.org>
4468 Avoid lopsided use of Foo/DoFoo names
4469 * statement.cs (ExpressionStatement.EmitFinallyBody):
4470 Rename from EmitFinally.
4471 (ExpressionStatement.EmitFinally): Rename from DoEmitFinally.
4472 * iterator.cs: Update to changes.
4474 2008-04-02 Marek Safar <marek.safar@gmail.com>
4476 * ecore.cs, expression.cs, nullable.cs: ConditionalLogicalOperator is now
4477 based on UserOperatorCall. More binary nullable operators clean up.
4479 2008-04-02 Martin Baulig <martin@ximian.com>
4481 * symbolwriter.cs: Remove the `#if !DISABLE_TERRANIA_CHANGES' conditionals.
4483 2008-04-02 Marek Safar <marek.safar@gmail.com>
4485 * nullable.cs: Merge user and empty conversions when lifting expression
4488 * expression.cs (StringConcat): Implemented expression tree representation.
4490 2008-04-01 Marek Safar <marek.safar@gmail.com>
4492 * nullable.cs: When lifting null literal and a user operator exists, no call
4495 2008-04-01 Marek Safar <marek.safar@gmail.com>
4497 * nullable.cs, ecore.cs, expression.cs: Convert null arithmetic to lifted
4500 2008-04-01 Marek Safar <marek.safar@gmail.com>
4502 * nullable.cs, expression.cs: Use namespace instead heavily nested
4503 monster abstract class.
4505 2008-04-01 Marek Safar <marek.safar@gmail.com>
4507 * ecore.cs, convert.cs, constant.cs, nullable.cs, expression.cs: Implemented
4508 lifting of null literal and user operators. Clean up of some temporary
4511 2008-03-30 Raja R Harinath <harinath@hurrynot.org>
4513 Fix #368224, test-629.cs
4514 * flowanalysis.cs (FlowBranching.StealFinallyClauses): Return true
4515 if it crossed an unwind-protect boundary.
4516 * iterators.cs (Yield.CheckContext): Relax check for 'yield break'.
4517 (Yield.Resolve, Yield.DoEmit): Track whether the yield occurs
4518 inside an unwind-protected region.
4519 (YieldBreak.Resolve, YieldBreak.DoEmit): Likewise.
4520 (Iterator.MarkYield): Add 'unwind_protect' parameter. Emit a
4521 'leave' instead of a 'br' if unwind-protected.
4522 (Iterator.EmitYieldBreak): Likewise.
4524 2008-03-29 Gert Driesen <drieseng@users.sourceforge.net>
4526 * driver.cs: Only define versioninfo resources if no win32 resource
4529 2008-03-28 Marek Safar <marek.safar@gmail.com>
4531 A fix for bug #372375
4532 * convert.cs: Fixed boxing of nullable types.
4534 2008-03-28 Marek Safar <marek.safar@gmail.com>
4536 * typemanager.cs: Initialize InternalsVisibleTo as the very first optional
4539 2008-03-28 Marek Safar <marek.safar@gmail.com>
4541 A fix for bug #374619
4542 * nullable.cs: Fixed guarding of EmitBitwiseBoolean.
4544 2008-03-27 Marek Safar <marek.safar@gmail.com>
4546 * lambda.cs: Check return type only for invocation.
4548 2008-03-27 Marek Safar <marek.safar@gmail.com>
4550 A fix for bug #374214
4551 * ecore.cs: Correctly report argument type mismatch.
4553 2008-03-27 Marek Safar <marek.safar@gmail.com>
4555 * convert.cs (ImplicitReferenceConversionCore): Correctly compare enum type
4556 and not rely on broken IsEnum.
4558 2008-03-27 Marek Safar <marek.safar@gmail.com>
4560 * nullable.cs: New file, extracted from generic.cs.
4562 * generic.cs, generic-mcs.cs, *.csproj, *.sources: Updated.
4564 2008-03-27 Marek Safar <marek.safar@gmail.com>
4566 * generic.cs, convert.cs, generic-mcs.cs, expression.cs: Added lifting of
4567 predefined comparison operators and null literals.
4569 * report.cs: New warning ID.
4571 2008-03-25 Marek Safar <marek.safar@gmail.com>
4573 A fix for bug #370577
4574 * lambda.cs: Check return type too.
4576 2008-03-25 Marek Safar <marek.safar@gmail.com>
4578 A fix for bug #372846
4579 * class.cs: Automatic properties can be declared as unsafe.
4581 2008-03-20 Marek Safar <marek.safar@gmail.com>
4583 * location.cs: Use string based concatenation.
4585 * expression.cs: LiftedBinaryOperator is gmcs only.
4587 2008-03-20 Marek Safar <marek.safar@gmail.com>
4589 * generic.cs, literal.cs, ecore.cs, expression.cs: Ongoing work on nullable
4590 conversions rules and expression trees.
4592 2008-03-19 Marek Safar <marek.safar@gmail.com>
4594 * delegate.cs: Use extension method source as delegate target.
4596 2008-03-19 Marek Safar <marek.safar@gmail.com>
4598 * generic.cs, generic-mcs.cs, expression.cs, ecore.cs: Rewrote nullable
4599 binary operations to be purely based on binary operations and optimized
4600 emitted code (30% less in some cases). Introduced ReducedExpression for ETs
4601 and other ET refactoring.
4603 * typemanager.cs: Fixed warning.
4605 2008-03-17 Marek Safar <marek.safar@gmail.com>
4607 * class.cs, decl.cs, delegate.cs: Do protected modifier check on each member
4609 * symbolwriter.cs: Fixed.
4611 2008-03-17 Marek Safar <marek.safar@gmail.com>
4613 * anonymous.cs, driver.cs: Reset anonymous types counters.
4615 2008-03-17 Marek Safar <marek.safar@gmail.com>
4617 * ecore.cs (MethodGroupExpr): Skip first candidate, it's already the best.
4619 * class.cs: Use fullname for all type member definitions.
4621 2008-02-19 Martin Baulig <martin@ximian.com>
4624 (IMethodData.EmitExtraSymbolInfo): New interface method.
4625 (MethodData.Emit): Call method.EmitExtraSymbolInfo().
4626 (MethodOrOperator.EmitExtraSymbolInfo): Implement this new
4627 interface method here as an empty public virtual method.
4630 (AnonymousMethodMethod.ctor): Added `string real_name' argument.
4631 (AnonymousMethodMethod.EmitExtraSymbolInfo): Override and call
4632 CodeGen.SymbolWriter.SetRealMethodName().
4634 2008-02-18 Martin Baulig <martin@ximian.com>
4637 (ScopeInfo.EmitType): Override this and emit debugging
4638 information for captured variables.
4639 (RootScopeInfo.EmitType): Override this and emit symbol
4640 information for a captured `this'.
4642 2008-02-15 Martin Baulig <martin@ximian.com>
4644 * iterators.cs: Emit debugging info.
4647 (EmitContext.Flags): Add `OmitDebuggingInfo'.
4648 (EmitContext.OmitDebuggingInfo): New public property.
4651 (While): Override Emit() and don't emit symbol info there; do it
4652 inside DoEmit() instead.
4653 (Block.Emit): Omit symbol information while emitting the scope
4654 initializers; don't ec.Mark() the `EndLocation'. Fix the lexical
4656 (ExplicitBlock.IsIterator): Moved here from `ToplevelBlock'.
4657 (ToplevelBlock.MakeIterator): Pass the `flags' to `ExplicitBlock's
4658 .ctor to make `IsIterator' work.
4660 2008-03-14 Martin Baulig <martin@ximian.com>
4662 * symbolwriter.cs: Added the new symbol writer function from the
4663 debugger's `terrania' branch; temporarily enclose them inside
4664 `#if !DISABLE_TERRANIA_CHANGES' conditionals until I'm back from
4667 2008-03-14 Martin Baulig <martin@ximian.com>
4670 (SymbolWriter): Make this a public static class.
4673 (CodeGen.SymbolWriter): Removed; use the new static `SymbolWriter'
4674 class instead of using `if (CodeGen.SymbolWriter != null)' everywhere.
4676 2008-03-14 Marek Safar <marek.safar@gmail.com>
4678 A fix for bug #370577
4679 * statement.cs, lambda.cs: Added extra limitations when dealing with void
4682 2008-03-14 Marek Safar <marek.safar@gmail.com>
4684 * typemanager.cs (CSharpName): Made 250 times faster.
4686 2008-03-13 Marek Safar <marek.safar@gmail.com>
4688 * ecore.cs, expression.cs: Emit conversion for ET shift argument.
4690 2008-03-12 Marek Safar <marek.safar@gmail.com>
4692 * generic.cs, typemanager.cs, enum.cs, codegen.cs, statement.cs: Try not to
4693 crash when predefined field does not exist.
4695 2008-03-12 Marek Safar <marek.safar@gmail.com>
4697 * ecore.cs (PropertyExpr): Fixed IsSingleDimensionalArrayLength regression.
4699 2008-03-12 Marek Safar <marek.safar@gmail.com>
4701 * class.cs (FixedField): Don't crash when contructors are missing.
4703 2008-03-11 Marek Safar <marek.safar@gmail.com>
4705 * typemanager.cs, namespace.cs, literal.cs, ecore.cs, class.cs, decl.cs,
4706 convert.cs, constant.cs, expression.cs, statement.cs: Use same method to
4707 check internal types accessibility for internal and external types.
4708 Replaced EnumToUnderlying by GetEnumUnderlyingType.
4710 2008-03-11 Marek Safar <marek.safar@gmail.com>
4712 * support.cs, typemanager.cs, pending.cs, ecore.cs, class.cs, delegate.cs
4713 convert.cs, const.cs, anonymous.cs, constant.cs, expression.cs,
4714 attribute.cs, statement: Use corect instance of predefined types (work
4715 related to #364674).
4717 2008-03-07 Marek Safar <marek.safar@gmail.com>
4719 * expression.cs (TypeOfVoid): Fixed predefined method initialization.
4721 2008-03-07 Marek Safar <marek.safar@gmail.com>
4723 * generic.cs, typemanager.cs, parameter.cs, rootcontext.cs, ecore.cs,
4724 class.cs, delegate.cs, iterators.cs, const.cs, constant.cs, driver.cs,
4725 expression.cs, attribute.cs, codegen.cs, statement.cs: TypeManager optional
4726 predefined types clean up, delayed predefined types members initialization
4727 (work related to #364674).
4729 2008-03-05 Marek Safar <marek.safar@gmail.com>
4731 * typemanager.cs (IsFriendAssembly): InternalsVisibleTo is not mandatory.
4733 2008-03-05 Marek Safar <marek.safar@gmail.com>
4735 * typemanager.cs, parameter.cs, rootcontext.cs, ecore.cs, class.cs, decl.cs,
4736 delegate.cs, convert.cs, driver.cs, attribute.cs, codegen.cs: TypeManager
4737 predefined types clean up (work related to #364674).
4739 2008-03-04 Marek Safar <marek.safar@gmail.com>
4741 * ecore.cs: Print an error message instead of throwing exception.
4743 2008-03-04 Marek Safar <marek.safar@gmail.com>
4745 * generic.cs, typemanager.cs, literal.cs, convert.cs, cfold.cs, constant.cs,
4746 expression.cs, statement.cs: Unififed null literal representation.
4748 2008-03-03 Marek Safar <marek.safar@gmail.com>
4750 * anonymous.cs, cfold.cs, convert.cs, delegate.cs, doc.cs, ecore.cs,
4751 expression.cs: Refactored binary operators resolve phase and improved speed.
4752 The nullable code is still missing and won't work correctly, more fixes
4755 It also fixes #323726, #324312, #324248, and many other unreported issues.
4757 2008-02-29 Zoltan Varga <vargaz@gmail.com>
4759 * report.cs (FeatureIsNotAvailable): Use 'mcs1' instead of 'mcs', and 'mcs'
4762 2008-02-27 Marek Safar <marek.safar@gmail.com>
4764 * ecore.cs: Clean-up and split BetterConversion.
4766 2008-02-25 Raja R Harinath <harinath@hurrynot.org>
4769 * enum.cs (EnumMember.Value): Only access 'value' if
4770 ResolveValue says it's ok.
4771 (EnumMember.DoResolveValue): Don't set prev_member.value.
4772 (Enum.GetDefinition): Reverse arguments of Equals --
4773 EnumMember.Value can return 'null'.
4775 * statement.cs (Switch.Error_AlreadyOccurs): Fix typo in name.
4777 2008-02-22 Marek Safar <marek.safar@gmail.com>
4779 * generic.cs, expression.cs: More ongoing work on expression trees.
4781 2008-02-21 Marek Safar <marek.safar@gmail.com>
4783 * class.cs, typemanager.cs: Rewrote operator matching logic to correctly
4784 handle missing matches when mutiple operators exist.
4786 2008-02-20 Marek Safar <marek.safar@gmail.com>
4788 A fix for bug #363218
4789 * expression.cs (ArrayCreation.Clone): Deal with multi-dimensional
4792 2008-02-20 Marek Safar <marek.safar@gmail.com>
4794 * expression.cs, constant.cs, cfold.cs: Yet another side-effect constant
4795 update. This time to deal correctly with SideEffectConstant expression used
4796 as an argument for another constant folding.
4798 2008-02-20 Raja R Harinath <harinath@hurrynot.org>
4800 * typemanager.cs (DropGenericMethodArguments): Ensure we get an underlying
4803 2008-02-19 Marek Safar <marek.safar@gmail.com>
4805 * constant.cs, cfold.cs: SideEffectConstant results can apply for folding.
4807 2008-02-19 Marek Safar <marek.safar@gmail.com>
4809 A fix for bug #328136
4810 * expression.cs: Do not fold immediately LogicalAnd operators when the left
4811 side is a false constant, because we still need to evaluate the right-hand
4814 * statement.cs (If): Emit two types of boolean constants (simple constant,
4815 side-effect constant).
4817 2008-02-19 Marek Safar <marek.safar@gmail.com>
4819 * constant.cs (SideEffectConstant): Don't emit boolean constant.
4821 * expression.cs: Fold immediately LogicalAnd operators when both sides are
4824 2008-02-18 Marek Safar <marek.safar@gmail.com>
4826 A fix for bug #361457
4827 * ecore.cs (IsApplicable): Params methods have lower priority.
4829 * support.cs: Return correct parameter modifier for params types.
4831 2008-02-18 Marek Safar <marek.safar@gmail.com>
4833 * generic.cs (TypeParameter): Cache attribute target name.
4835 * support.cs: Removed unused variable.
4837 * typemanager.cs: Removed debugging leftover.
4839 * ecore.cs: Use local type instead of a property;
4841 * class.cs (VerifyMembers): Consider also parent to test whether type member
4844 * expression.cs (FullMethodDesc): Removed.
4846 * attribute.cs (IsValidArgumentType): Made static.
4848 2008-02-17 Raja R Harinath <harinath@hurrynot.org>
4850 Cleanup to be more readable.
4851 * Makefile (GMCS_PROFILE): Remove.
4852 (COMPILER_NAME): New helper.
4854 2008-02-15 Miguel de Icaza <miguel@novell.com>
4856 * cs-tokenizer.cs: if a conditional expression happens inside a
4857 (...) this also means that we do not need to de-ambiguate between
4858 an parenthesized expression and a cast.
4862 * constant.cs (SideEffectConstant): a constant value that happens
4863 to have a side effect.
4865 Fixes the build regressions introduced by the fix for #359789
4867 2008-02-14 Rodrigo Kumpera <rkumpera@novell.com>
4869 * expression.cs (Conditional.Emit): when emitting the ternary
4870 operator, use local variables to generate code verifiable code.
4872 The verifier cannot infer that the type on stack before the
4873 stloc.0 is executed is of type ParentB. This happens because the
4874 stack merge algorithm uses only parent types when deciding which
4875 is the common type. This is described in Part III 1.8.1.3 of ECMA
4878 This code compiled with mcs is not verifiable under MS. The MS
4879 verifier picks the first common interface of Foo and Bar, which is
4880 wrong, but doesn't use a full join type of the 2 interfaces.
4882 CSC uses a clever hack to compile such code in a verifiable
4883 way. It stores the intermediate values in a local variable with
4888 2008-02-14 Miguel de Icaza <miguel@novell.com>
4890 * expression.cs: Do not fold BitwiseAnd operators when the left
4891 side is a false constant, because we still need to evaluate the
4896 * support.cs: Instead of throwing an InternalErrorException when
4897 the position of the stream is outside the boundary of our buffer,
4898 reset the state of the reader, and restart the reading from the
4899 beginning of the file.
4901 2008-02-14 Marek Safar <marek.safar@gmail.com>
4903 * generic.cs (TypeParameter.GetMembers): Is not supported operation.
4905 2008-02-14 Marek Safar <marek.safar@gmail.com>
4907 A fix for bug #361686
4908 * decl.cs: A protected types used inside a private class which parents
4909 derives from the protected class are accessible.
4911 2008-02-13 Marek Safar <marek.safar@gmail.com>
4913 * generic.cs (ConstraintChecker): Use cached member lookup when looking for
4914 the parameterless constructor.
4916 2008-02-13 Marek Safar <marek.safar@gmail.com>
4918 * generic.cs, typemanager.cs, iterators.cs, codegen.cs: Refactored core
4919 lookup methods to use standard member cache when doing member lookup.
4921 2008-02-12 Marek Safar <marek.safar@gmail.com>
4923 * driver.cs: Don't report full path for referenced module as assembly error.
4925 2008-02-12 Marek Safar <marek.safar@gmail.com>
4927 * Makefile: Fixed `qh' target to work on all machines.
4929 * report.cs, typemanager.cs, parameter.cs, ecore.cs, class.cs, anonymous.cs,
4930 expression.cs, codegen.cs, statement.cs, doc.cs: Replaced type IsSubclassOf
4931 and HasElementType with TypeManager implementation.
4933 2008-02-08 Marek Safar <marek.safar@gmail.com>
4935 A fix for bugs #325134, #359749
4936 * expression.cs, ecore.cs: Try to resolve an extension method even if the
4937 first binds point to non-method member expression.
4939 2008-02-08 Marek Safar <marek.safar@gmail.com>
4941 * cs-parser.jay: Null coalescing operator is not part of ISO-1.
4943 2008-02-08 Marek Safar <marek.safar@gmail.com>
4945 A fix for bugs #321394, #323028
4946 * generic.cs, parameter.cs, ecore.cs, class.cs, decl.cs, delegate.cs:
4947 Reworked naive IsAccessibleAs implementation to handle nested types.
4949 2008-02-05 Jb Evain <jbevain@novell.com>
4951 * class.cs: use generic type comparison for parameters
4954 2008-02-05 Marek Safar <marek.safar@gmail.com>
4956 A fix for bug #325372
4957 * class.cs: Use generic type comparison when testing method signatures.
4959 2008-02-05 Marek Safar <marek.safar@gmail.com>
4961 A fix for bug #357047
4962 * ecore.cs: Applied C# 3.0 changes to better conversion.
4964 2008-02-05 Marek Safar <marek.safar@gmail.com>
4966 A fix for bug #358374
4967 * cs-parser.jay: Correctly set modifiers for all constructor types.
4969 2008-02-04 Marek Safar <marek.safar@gmail.com>
4971 A fix for bug #355251
4972 * generic.cs: Added base class constraint based type inference.
4974 2008-02-01 Marek Safar <marek.safar@gmail.com>
4976 A fix for bug #357255
4977 * decl.cs: One more missing visibility check.
4979 2008-02-01 Marek Safar <marek.safar@gmail.com>
4981 * support.cs: Fixed broken return.
4983 2008-01-25 Marek Safar <marek.safar@gmail.com>
4985 * report.cs: Correctly reset warnings count after probing.
4987 2008-01-25 Martin Baulig <martin@ximian.com>
4990 (NamespaceEntry.SymbolFileID): Make this work again after
4991 MemberName.ToString() is gone.
4993 2008-01-25 Marek Safar <marek.safar@gmail.com>
4995 * expression.cs: Implemented Divide, Equal, ExclusiveOr, GreaterThanOrEqual
4998 2008-01-25 Marek Safar <marek.safar@gmail.com>
5000 * generic.cs: Use full implicit conversion for type inference fixing.
5002 2008-01-24 Marek Safar <marek.safar@gmail.com>
5004 * ecore.cs, expression.cs, generic.cs: Implemented Convert, ConvertChecked.
5005 Fixed user operator conversions.
5007 2008-01-24 Marek Safar <marek.safar@gmail.com>
5009 * generic.cs: Do nullable type to null comparison optimization during
5012 2008-01-24 Marek Safar <marek.safar@gmail.com>
5014 A fix for bug #355163
5015 * generic.cs: Enabled l-value resolve on nullable expressions.
5017 2008-01-24 Marek Safar <marek.safar@gmail.com>
5019 A fix for bug #353986
5020 * class.cs: Ingore static ctors with parameters for any further checks.
5022 2008-01-24 Marek Safar <marek.safar@gmail.com>
5024 A fix for bug #354310
5025 * namespace.cs: Removed redundant check.
5027 2008-01-24 Marek Safar <marek.safar@gmail.com>
5029 A fix for bug #354928
5030 * expression.cs: ElementInitializers can be resolved only once.
5032 2008-01-24 Marek Safar <marek.safar@gmail.com>
5034 * convert.cs, ecore.cs, expression.cs, generic.cs: Implemented Coalesce and
5035 Condition expressions.
5037 2008-01-23 Marek Safar <marek.safar@gmail.com>
5039 * codegen.cs: Fixed AssemblyBuilder initialization on other platforms.
5041 2008-01-22 Marek Safar <marek.safar@gmail.com>
5043 * ecore.cs, expression.cs, generic.cs: Implicit bool? to bool conversion is
5046 * generic.cs: Implemented coalesce expression.
5048 2008-01-22 Marek Safar <marek.safar@gmail.com>
5050 A fix for bug #355145
5051 * anonymous.cs, convert.cs, ecore.cs, generic.cs, lambda.cs: Implemented
5052 expression tree type inference.
5054 2008-01-22 Raja R Harinath <harinath@hurrynot.org>
5057 * expression.cs (Binary.IsUnsignedType): Fix typo.
5059 2008-01-22 Marek Safar <marek.safar@gmail.com>
5061 * ecore.cs, expression.cs, generic.cs: Implemented NewArrayInit expression.
5063 2008-01-22 Marek Safar <marek.safar@gmail.com>
5065 A fix for bug #355161
5066 * ecore.cs, expression.cs: Wider range of extension method supported
5069 2008-01-22 Gert Driesen <drieseng@users.sourceforge.net>
5071 * codegen.cs: Use magic value for AssemblyBuilderAccess to instruct
5072 AssemblyBuilder to operate in compiler context. Fixes mcs part of
5075 2008-01-22 Marek Safar <marek.safar@gmail.com>
5077 A fix for bug #355148
5078 * ecore.cs, expression.cs: Correctly report misused ref and out modifiers.
5080 2008-01-22 Miguel de Icaza <miguel@novell.com>
5082 * expression.cs (CreateExpressionTree): Add support for or and
5083 logical or, and indent following the coding conventions.
5085 * typemanager.cs (LinqExpression): renamed from
5086 ExpressionTreeManager, for a shorter name.
5088 Use TypeManager.CoreLookupType to lookup types from our core
5089 assemblies and turn those into "Type" variables.
5091 Consumers that previously used "Namespace" and "Type" from this
5092 class should instead use the TypeExpression which is a type that
5093 is fully resolved (without involving the regular C# resolution
5096 This typically looks like this:
5098 TypeExpression texpr = new TypeExpression (LinqExpression.expression_type, loc);
5099 new MemberAccess (texpr, name, type_arguments, loc)
5101 This avoids the problem in: #355178
5103 2008-01-21 Marek Safar <marek.safar@gmail.com>
5105 * cs-parser.jay, expression.cs: Check `namespace alias qualifier' language
5106 feature in parser only as we do in other cases.
5108 2008-01-21 Marek Safar <marek.safar@gmail.com>
5110 * attribute.cs, ecore.cs, class.cs, delegate.cs, expression.cs, linq.cs,
5111 typemanager.cs: A refactoring of params arguments to reuse existing
5112 expressions (params -> array initializer) to emit params argument instead
5113 of specialized handling.
5114 It was required by expression tree implementation and it has other benefits
5115 as well, we now apply same optimization for params arguments as we do for
5118 2008-01-18 Marek Safar <marek.safar@gmail.com>
5120 A fix for bug #353526
5121 * generic.cs: A type inference of params arguments may not required any
5122 temporary array creation.
5124 2008-01-18 Marek Safar <marek.safar@gmail.com>
5126 A fix for bug #353534
5127 * generic.cs, ecore.cs, expression.cs: A method group type inference is
5128 supported for delegates only.
5130 2008-01-18 Marek Safar <marek.safar@gmail.com>
5132 * generic.cs: Fixed 3.0 type inference fixing phase to determine a unique
5133 type for more than 1 candidates.
5135 2008-01-18 Marek Safar <marek.safar@gmail.com>
5137 * typemanager.cs, ecore.cs, expression.cs: Implemented ArrayLength and Call
5140 2008-01-16 Marek Safar <marek.safar@gmail.com>
5142 * generic.cs, typemanager.cs, lambda.cs, parameter.cs, ecore.cs, constant.cs,
5143 expression.cs: Implemented Add, And, AndAlso, and ArrayIndex (without unary
5144 operator) expressions.
5146 2008-01-16 Zoltan Varga <vargaz@gmail.com>
5148 * statement.cs: Avoid declaring an IL variable for this_variable since it is
5149 not accessed from the generated IL.
5151 2008-01-14 Marek Safar <marek.safar@gmail.com>
5153 * typemanager.cs, lambda.cs, parameter.cs, ecore.cs, class.cs, delegate.cs,
5154 iterators.cs, convert.cs, assign.cs, anonymous.cs, expression.cs,
5155 statement.cs: The first expression tree implementation drop, mostly
5156 infrastructure work.
5158 2008-01-14 Marek Safar <marek.safar@gmail.com>
5160 * ecore.cs (IsNestedChild): Refactored.
5162 2008-01-11 Marek Safar <marek.safar@gmail.com>
5164 * lambda.cs: Don't use a cast on unknown expression statement.
5166 2008-01-10 Geoff Norton <gnorton@novell.com>
5168 * cs-tokenizer.cs: One more token to distinguish between method and lambda
5171 2008-01-09 Marek Safar <marek.safar@gmail.com>
5173 * doc.cs: Report better /doc crash details.
5175 2008-01-09 Marek Safar <marek.safar@gmail.com>
5177 A fix for bug #352536
5178 * ecore.cs, assign.cs, codegen.cs: Check event assignments.
5180 2008-01-08 Marek Safar <marek.safar@gmail.com>
5182 A fix for bug #352287
5183 * ecore.cs, expression.cs: Do `this' access checking in all member access
5186 2008-01-08 Marek Safar <marek.safar@gmail.com>
5188 * rootcontext.cs, driver.cs: Switch to linq mode by default.
5190 * report.cs: Reset message stacks.
5192 2008-01-08 Marek Safar <marek.safar@gmail.com>
5194 * generic.cs (InferInPhases): Correctly calculate params position.
5196 2008-01-08 Marek Safar <marek.safar@gmail.com>
5198 * cs-tokenizer.cs: No need to parse full string when parsing lambda
5201 2008-01-07 Marek Safar <marek.safar@gmail.com>
5203 * cs-tokenizer.cs: Enabled lambda arguments micro-parser for all profiles.
5205 * decl.cs (LookupNamespaceOrType): Don't cache names which caused an error.
5207 * driver.cs: Updated --help option.
5209 2008-01-07 Marek Safar <marek.safar@gmail.com>
5211 * generic.cs (InferParamsTypeArguments): Removed.
5212 (InferInPhases): Add params type inference.
5213 (LowerBoundInference): Fixed scoring mechanism.
5215 * cs-tokenizer.cs (PreProcessPragma): Use Location instead of line.
5217 2008-01-06 Gert Driesen <drieseng@users.sourceforge.net>
5219 * typemanager.cs: On 2.0 profile, GetPublicKeyToken returns an empty
5220 byte array for unsigned "baked" assemblies.
5222 2008-01-05 Gert Driesen <drieseng@users.sourceforge.net>
5224 * codegen.cs: AssemblyName.GetPublicKey returns a zero-length byte
5225 array for assemblies that are not strongnamed.
5227 2008-01-04 Marek Safar <marek.safar@gmail.com>
5229 A fix for bug #351481
5230 * expression.cs (MemberAccess.ResolveNamespaceOrType): Use correct
5231 declaring type for nested generic types.
5233 2008-01-04 Marek Safar <marek.safar@gmail.com>
5235 * namespace.cs, class.cs, decl.cs, cs-parser.jay: Use GetSignatureForError
5236 instead of ToString.
5238 2008-01-03 Marek Safar <marek.safar@gmail.com>
5240 A fix for bug #351047
5241 * expression.cs (Binary.ResolveOperator): Allow equality operators between
5242 null and structs only when equality and inequality operators are defined
5243 either as an user-operators or predefined operators.
5245 2008-01-03 Marek Safar <marek.safar@gmail.com>
5247 A fix for bug #351047
5248 * generic.cs, typemanager.cs, class.cs: New IsReferenceType helper method.
5250 2008-01-03 Marek Safar <marek.safar@gmail.com>
5252 A fix for bug #351257
5253 * cs-tokenizer.cs: Advance line number for '\r' correctly.
5255 2008-01-03 Marek Safar <marek.safar@gmail.com>
5257 A fix for bug #351157
5258 * class.cs (Using): Fixed yet another broken cloning.
5260 (Block): Put back more sensible default value for statements.
5262 2008-01-01 Gert Driesen <drieseng@users.sourceforge.net>
5264 * codegen.cs: Allow AssemblyVersion with only major version component.
5267 2007-12-29 Marek Safar <marek.safar@gmail.com>
5269 A fix for bug #324654
5270 * class.cs: Use FullName property as member name.
5272 2007-12-28 Marek Safar <marek.safar@gmail.com>
5274 A fix for bug #342117
5275 * generic.cs (ConstraintChecker): Struct constraint also satisfies default
5276 constructor constraint.
5278 2007-12-28 Marek Safar <marek.safar@gmail.com>
5280 A fix for bug #338273
5281 * class.cs (ProbertyBase): Access modifier checks are required for overrides
5284 2007-12-28 Marek Safar <marek.safar@gmail.com>
5286 A fix for bug #350839
5287 * ecore.cs (MethodroupExpr): Probing hacks are no longer required.
5289 2007-12-27 AdTsai (http://code.google.com/u/AdTsai/)
5291 Reviewed by Ben Maurer, Miguel de Icaza, patches from Google's
5294 http://code.google.com/p/google-highly-open-participation-mono/issues/detail?id=4
5296 * statement.cs: Changed some Hashtables to use HybridDictionaries
5297 instead. It was observed that some HashTables only contained a few
5298 items in the vast majority of cases. Since HybridDictionary is
5299 more efficient on small sets (<10 elements), "known_variables"
5300 from class ExplicitBlock as well as "labels" and "constants " from
5301 class Block were changed to HybridDictionaries.
5303 Atsai results: (56216kb->54987kb)
5305 Miguel results (bootstrap of mcs): 59819kb -> 59290kb
5308 2007-12-27 AdTsai (http://code.google.com/u/AdTsai/)
5310 Reviewed by Ben Maurer, Miguel de Icaza, patches from Google's
5313 http://code.google.com/p/google-highly-open-participation-mono/issues/detail?id=4
5315 * expression.cs: foreach loop to for loop, saved on allocation of
5316 enumerator (59333kb->59141kb)
5318 * statement.cs. Changed foreach loops to for loops, saved on
5319 allocation of enumerator (59141kb->59006kb)
5321 * decl.cs: ArrayLists in .NET 1.1 allocate 16 elements by default
5322 when constructed with no specified capacity. This was causing a
5323 few ArrayLists to allocate more memory than they would potentially
5324 need in the Block class and MemberCache class. Setting the
5325 ArrayLists to construct with a capacity of 1 saves some
5326 memory. (56216kb->55585kb)
5328 2007-12-27 Marek Safar <marek.safar@gmail.com>
5330 A fix for bug #347189 (2nd issue)
5331 * expression.cs (MemberAccess): Nested type can be found in base non-generic
5334 2007-12-27 Miguel de Icaza <miguel@novell.com>
5336 * report.cs: Do not use colors if stdout and stderr are not a
5339 2007-12-27 Marek Safar <marek.safar@gmail.com>
5341 A fix for bug #346998
5342 * ecore.cs (MethodGroupExpr): Implemented override filter for generic
5345 2007-12-27 Marek Safar <marek.safar@gmail.com>
5347 A fix for bug #343465
5348 * class.cs: Explicit method name for nested types uses dots only.
5350 2007-12-27 Marek Safar <marek.safar@gmail.com>
5352 A fix for bug #343707
5353 * cs-tokenizer.cs: Advance line number for mixed CR/LF files correctly.
5355 2007-12-27 Marek Safar <marek.safar@gmail.com>
5357 * ecore.cs: Report type inference errors only when arguments count matches
5360 * generic.cs (NullCoalescingOperator): Cannot be applied to null.
5362 * expression.cs, report.cs: New warning.
5364 * typemanager.cs: Catch anonymous method type too.
5366 2007-12-23 Marek Safar <marek.safar@gmail.com>
5368 A fix for bug #346379
5369 * expression.cs (UnaryMutator): Emit size of type for pointer mutator.
5371 2007-12-23 Marek Safar <marek.safar@gmail.com>
5373 A fix for bug #347359
5374 * expression.cs (Invocation): Don't resolve already resolved expression.
5376 2007-12-23 Marek Safar <marek.safar@gmail.com>
5378 A fix for bug #347189
5379 * class.cs (FixedField): Use non-dependent code only in the define phase.
5381 2007-12-23 Marek Safar <marek.safar@gmail.com>
5383 A fix for bug #348076
5384 * ecore.cs (FieldExpr.DoResolve): Allow any variable based expression.
5386 2007-12-22 Marek Safar <marek.safar@gmail.com>
5388 * ecore.cs (MethodGroupExpr.OverloadResolve): Set type arguments for
5389 discovered extension methods.
5391 2007-12-22 Marek Safar <marek.safar@gmail.com>
5393 * ecore.cs, namespace.cs, expression.cs: Removed broken ResolveGeneric
5396 2007-12-21 Miguel de Icaza <miguel@novell.com>
5398 * report.cs (ErrorMessage): Add support for using colors on
5399 terminals that support it.
5401 2007-12-21 Marek Safar <marek.safar@gmail.com>
5403 * ecore.cs: Use information about expanded params for error reporting.
5405 2007-12-21 Marek Safar <marek.safar@gmail.com>
5407 * ecore.cs, generic.cs, delegate.cs: Refactoring of method overloading code
5408 and logic for params overloads.
5410 2007-12-15 Miguel de Icaza <miguel@novell.com>
5412 * generic.cs (NullCoalescingOperator.CloneTo): implement this one,
5413 as this is also created from the parser. Fixes #349034
5415 2007-12-12 Miguel de Icaza <miguel@novell.com>
5417 * statement.cs (Throw.CloneTo): it is valid to have empty
5418 expressions for throw.
5420 2007-12-03 Marek Safar <marek.safar@gmail.com>
5422 * cs-parser.jay: Set delegate constraint parsing region correctly.
5424 2007-12-03 Marek Safar <marek.safar@gmail.com>
5426 A fix for bug #345467
5427 * typemanager.cs (IsEqual): Compare generic parameters position only.
5429 2007-11-28 Marek Safar <marek.safar@gmail.com>
5431 * expression.cs (BaseAccess): Type arguments can be null.
5433 2007-11-27 Raja R Harinath <harinath@gmail.com>
5435 * statement.cs (Block.Resolve): Ensure flow-branching tree is
5436 consistent even when an error has occured.
5437 (Switch.Resolve): Likewise.
5439 2007-11-22 Marek Safar <marek.safar@gmail.com>
5441 A fix for bug #334505
5442 * class.cs: Don't ignore InternalsVisibleTo attribute for internal
5445 2007-11-22 Marek Safar <marek.safar@gmail.com>
5447 * ecore.cs, typemanager.cs, delegate.cs, expression.cs: The first of
5448 refactorings required to resolve extension methods correctly when mixing
5449 generics and non-generics members.
5451 2007-11-20 Marek Safar <marek.safar@gmail.com>
5453 A fix for bug #342584
5454 * convert.cs: Added not documented explicit IntPtr/UIntPtr to enum
5457 2007-11-19 Marek Safar <marek.safar@gmail.com>
5459 A fix for bug #342512
5460 * delegate.cs: Use delegate argument expression when is available. Don't
5461 emit virtual call when class is sealed.
5463 2007-11-16 Marek Safar <marek.safar@gmail.com>
5465 A fix for bug #325423
5466 * assign.cs (FieldInitializer): Use resolved expression for emit.
5468 * class.cs: Print less confusing error message.
5470 2007-11-16 Marek Safar <marek.safar@gmail.com>
5472 * cs-tokenizer.cs: Removed GMCS ifdefs.
5474 * rootcontext.cs, report.cs: Report unavailable gmcs features used by
5477 * cs-parser.jay: Disabled nullable check.
5479 * generic-mcs: Copied more generic stuff.
5481 2007-11-16 Marek Safar <marek.safar@gmail.com>
5483 * gcs-parser.jay: Merged to cs-parser.jay.
5485 * generic.cs, typemanager.cs, cs-tokenizer.cs, linq.cs, Makefile
5486 * *.csproj, *.sources: Updated to use only jay parser file.
5488 2007-11-16 Marek Safar <marek.safar@gmail.com>
5490 * gcs-parser.jay: Added nullable and default expression feature checks.
5492 2007-11-16 Marek Safar <marek.safar@gmail.com>
5494 * gcs-parser.jay, cs-parser.jay, class.cs: Unified parameters parsing,
5495 it fixes many TODOs and hidden bugs.
5497 * expression: Removed duplicate error check.
5499 2007-11-15 Marek Safar <marek.safar@gmail.com>
5501 * gcs-parser.jay, statement.cs, decl.cs, ecore.cs: Try to resolve an
5502 implicitly type local variable only when it is used in a declaration.
5504 2007-11-15 Marek Safar <marek.safar@gmail.com>
5506 * attribute.cs: Use CS0612 for empty strings.
5508 2007-11-14 Marek Safar <marek.safar@gmail.com>
5510 * lambda.cs, statement.cs: Contextual return may act as a statement.
5512 2007-11-14 Marek Safar <marek.safar@gmail.com>
5514 A fix for a regression cause by #324222
5515 * class.cs: Don't report unused even when it implements an interface.
5517 2007-11-13 Marek Safar <marek.safar@gmail.com>
5519 A fix for bug #341205
5520 * ecore.cs, expression.cs: Method group expression cannot do static
5521 method access with an instance reference check before overloading takes
5524 2007-11-13 Marek Safar <marek.safar@gmail.com>
5526 A fix for bug #325359
5527 * class.cs: Use predictable name for automatically generated property.
5529 2007-11-12 Marek Safar <marek.safar@gmail.com>
5531 A fix for bug #324996
5532 * expression.cs (Is): Handle case where D is nullable and T is not
5535 * generics.cs (Nullable.HasValue): Nullable HasValue expression.
5537 2007-11-12 Marek Safar <marek.safar@gmail.com>
5539 * generic.cs, literal.cs, ecore.cs, class.cs, delegate.cs, const.cs,
5540 anonymous.cs, expression.cs, attribute.cs, codegen.cs, statement.cs:
5541 Flush small error reporting changes.
5543 2007-11-09 Marek Safar <marek.safar@gmail.com>
5545 A fix for bug #324996
5546 * expression.cs: Rewrote Is expression implementation to work with
5547 generics, nullable types, anonymous method. A const result expression
5548 uses existing infrastructure instead of custom not fully-featured one.
5550 2007-11-08 Marek Safar <marek.safar@gmail.com>
5552 A fix for bug #340202
5553 * class.cs: Consider generics for volatile field.
5555 2007-11-08 Marek Safar <marek.safar@gmail.com>
5557 A fix for bug #335594
5558 * expression.cs: Use conversion rules when handling string addition.
5560 2007-11-07 Marek Safar <marek.safar@gmail.com>
5562 A fix for bug #336651
5563 * expression.cs: Fixed a crash when probing is on.
5565 2007-11-07 Marek Safar <marek.safar@gmail.com>
5567 A fix for bug #324242
5568 * covert.cs: Added a conversion from any nullable-type with an
5569 underlying enum-type to the type System.Enum.
5571 2007-11-07 Marek Safar <marek.safar@gmail.com>
5573 A fix for bug #324222
5574 * class.cs: Report all non-used event fields.
5576 2007-11-07 Marek Safar <marek.safar@gmail.com>
5578 A fix for bug #325161
5579 * cs-parser.jay, gcs-parser.jay, decl.cs: Implemented namespace alias
5580 qualifier for generic types.
5582 2007-11-07 Marek Safar <marek.safar@gmail.com>
5584 A fix for bug #322971
5585 * expression.cs, ecore.cs: Added intermediate result value check for
5588 2007-11-07 Marek Safar <marek.safar@gmail.com>
5590 A fix for bug #324754
5591 * cs-parser.jay, gcs-parser.jay, class.cs: Try to create an interator
5592 when it was requested.
5594 2007-11-07 Marek Safar <marek.safar@gmail.com>
5596 A fix for bug #325101
5597 * expression.cs: Do type not value comparison for `is' expression.
5599 2007-11-07 Marek Safar <marek.safar@gmail.com>
5601 A fix for bug #320236
5602 * convert.cs: Don't apply user conversion on underlying target type.
5604 2007-11-06 Marek Safar <marek.safar@gmail.com>
5606 * expression.cs: Don't use unresolved expression for error reporting.
5608 2007-11-06 Marek Safar <marek.safar@gmail.com>
5610 A fix for bugs #337712, #324490
5611 * ecore.cs (MethodGroupExpr): Refactored to handle delegate method
5612 overloading resolution too.
5614 * delegate.cs: Uses MethodGroupExpr for overloading resolution. It makes
5615 the process consistent and more robust.
5617 * expression.cs, linq.cs, report.cs: Update.
5619 2007-11-02 Marek Safar <marek.safar@gmail.com>
5621 A fix for bug #332909
5622 * attribute.cs: Resolve attributes in correct context using error
5625 * rootcontext.cs: Define Obsolete attribute members as core members.
5627 2007-11-02 Marek Safar <marek.safar@gmail.com>
5629 * statement.cs: Removed unused methods.
5631 2007-10-31 Wade Berrier <wberrier@novell.com>
5633 * Makefile: reenable copy of gmcs.exe.config, but include it in EXTRA
5634 DIST (it doesn't get included because PROGRAM isn't defined to be gmcs
5637 2007-10-31 Marek Safar <marek.safar@gmail.com>
5639 A fix for bug #338102
5640 * decl.cs (CheckExistingMembersOverloads): Workaround issue with generic
5641 methods registered as non-generics.
5643 2007-10-31 Marek Safar <marek.safar@gmail.com>
5645 A fix for bugs #337712, #324490
5646 * delegate.cs: Delegate covariance and contravariance is not allowed for
5649 2007-10-31 Marek Safar <marek.safar@gmail.com>
5651 A fix for bug #337719
5652 * cs-tokenizer.cs: Restore identifier buffer when parsing contextual
5655 2007-10-30 Marek Safar <marek.safar@gmail.com>
5657 * Makefile (net_2_0_bootstrap/mcs.exe.config): Reverted copy gmcs.exe.config.
5659 2007-10-29 Marek Safar <marek.safar@gmail.com>
5661 * cs-tokenizer.cs, gcs-parser.jay, driver.cs: Fixed parsing of nested
5664 2007-10-29 Raja R Harinath <rharinath@novell.com>
5666 * Makefile (net_2_0_bootstrap/mcs.exe.config): Copy gmcs.exe.config.
5668 2007-10-29 Marek Safar <marek.safar@gmail.com>
5670 A fix for bug #334652
5671 * ecore.cs (MethodGroupExpr.OverloadResolve): Do also lookup for
5672 extension methods when we have not found the best candidate in normal
5675 2007-10-27 Marek Safar <marek.safar@gmail.com>
5677 * AssemblyInfo.cs: Keep up-to-date.
5679 2007-10-27 Marek Safar <marek.safar@gmail.com>
5681 * Makefile: Fixed generics compiler name.
5683 2007-10-27 Marek Safar <marek.safar@gmail.com>
5685 * lambda.test: removed, lambda parsing is done differently.
5687 * gen-il.cs, gen-treedump.cs, old-code.cs : Obsolete.
5689 2007-10-27 Gert Driesen <drieseng@users.sourceforge.net>
5691 * Makefile: Removed dependency on gmcs.exe.config. Fixes build.
5693 2007-10-27 Marek Safar <marek.safar@gmail.com>
5695 * Makefile, *.sources : All C# compilers are in mcs folder.
5697 * *.cs: Use existing 2_1 define for smcs.
5699 2007-10-26 Marek Safar <marek.safar@gmail.com>
5701 A fix for bug #335847
5702 * assign.cs, expression.cs: Couple of changes to avoid creating a
5703 temporary variable for each object initializer assignment statement. It
5704 simplifies struct initialization too, otherwise two temporary variables
5706 Implemented optimization of redundant default element initializers.
5708 2007-10-25 Marek Safar <marek.safar@gmail.com>
5710 A fix for bug #336766
5711 * expression.cs (Class.CheckBase): Use generic name when method is
5714 2007-10-25 Marek Safar <marek.safar@gmail.com>
5716 A fix for bug #334737
5717 * expression.cs (IndexerAccess.EmitAssign): Emit local temporary
5718 variable and not variable argument for prepared copies.
5720 2007-10-24 Marek Safar <marek.safar@gmail.com>
5722 A fix for bug #325110
5723 * class.cs, expression.cs, attribute.cs: Use open generic method when
5724 checking conditional attribute.
5726 2007-10-24 Marek Safar <marek.safar@gmail.com>
5728 * report.cs, cs-tokenizer.cs, class.cs, cs-parser.jay, anonymous.cs,
5729 expression.cs, statement.cs: Renamed method FeatureIsNotISO to
5730 FeatureIsNotAvailable.
5732 2007-10-24 Marek Safar <marek.safar@gmail.com>
5734 ** C# 3.0 Partial methods
5736 * cs-tokenizer.cs, support.cs, class.cs, decl.cs: Implemented partial
5737 methods support. Because of member cache issue with generics only
5738 non-generics partial methods are fully supported.
5740 2007-10-23 Marek Safar <marek.safar@gmail.com>
5742 * class.cs, decl.cs: Rewrote member overloads check to cope with
5743 generics and to use member cache for member checking. It also improves
5744 performance and fixes remaining overloads issues.
5746 2007-10-20 Marek Safar <marek.safar@gmail.com>
5748 * class.cs, const.cs, decl.cs, delegate.cs, enum.cs, generic.cs,
5749 roottypes.cs, typemanager.cs:
5751 A member cache creation logic changed to add members immediately and
5752 not rely on fallback. The member cache is now only prefered way
5753 how to access and find type declaration members. It saves 5 MB of memory
5754 during MWF compilation and makes code ready for more optimizations and
5755 clean-ups, it's also a pre-requirement for partial methods.
5757 2007-10-18 Raja R Harinath <harinath@gmail.com>
5759 * ecore.cs (Expression.Error_ValueCannotBeConverted): Add special
5760 handling for generic parameters.
5762 2007-10-15 Marek Safar <marek.safar@gmail.com>
5764 * class.cs (FixedField): Removed redundant volatile check.
5766 2007-10-15 Marek Safar <marek.safar@gmail.com>
5768 * class.cs, decl.cs: Fixed overload members verification to do only one
5769 check per possible collision.
5771 2007-10-13 Marek Safar <marek.safar@gmail.com>
5773 A fix for bug #325478
5774 * anonymous.cs (AnonymousContainer.Compatible): Merge are flags together
5775 and create only one disposable flags container.
5777 2007-10-12 Marek Safar <marek.safar@gmail.com>
5779 A fix for bug #332442 by Alexandre Gomes <alexmipego@gmail.com>
5780 * statement.cs (Fixed): Fixed variables cloning.
5782 2007-10-12 Marek Safar <marek.safar@gmail.com>
5784 A fix for bug #333342
5785 * class.cs (EventField): Don't mark value type event as synchronized.
5787 2007-10-12 Marek Safar <marek.safar@gmail.com>
5789 * ecore.cs, anonymous.cs (MethodGroupExpr): Use score from type
5790 inference to identify best candidate method correctly.
5791 (ProperyExpr): A range variable is read only and cannot be modified.
5793 2007-10-11 Marek Safar <marek.safar@gmail.com>
5795 * ecore.cs, delegate.cs (MethodGroupExpr): Refactored best candidate
5796 logic to identify best candidate method correctly.
5798 2007-10-11 Marek Safar <marek.safar@gmail.com>
5800 * location.cs (Equals, GetHashCode): Removed.
5802 2007-10-11 Marek Safar <marek.safar@gmail.com>
5804 * report.cs: Implemented message recorder. It is used mainly for lambda
5805 expressions to capture otherwise swallowed error messages.
5807 * anonymous.cs, lambda.cs.cs: Do full parameters check.
5809 * ecore.cs (ExtensionMethodGroup): Report binding failure at the botton
5811 (MethodGroupExpr.DoResolve): Use message recorder for error handling.
5813 * expression.cs (MemberAccess): Always report lookup failure.
5815 * location.cs: Implemented Equals, GetHashCode.
5817 * statement.cs (Return.DoResolve): Fixed hardcoded error argument.
5819 2007-10-10 Jb Evain <jbevain@novell.com>
5821 * codegen.cs: re-enable assembly version check.
5823 2007-10-09 Marek Safar <marek.safar@gmail.com>
5825 * report.cs, anonymous.cs, driver.cs, expression.cs: Added few ISO-2
5828 * namespace.cs (UsingAlias): Do correct version check.
5830 2007-10-08 Marek Safar <marek.safar@gmail.com>
5832 * expresison.cs, ecore.cs: Issue extension method error message when
5835 * rootcontext.cs: Added ISO_2 compiler mode option.
5837 2007-10-08 Marek Safar <marek.safar@gmail.com>
5839 * expresison.cs (UnaryMutator.ResolveOperator): Print more useful error
5842 2007-10-08 Marek Safar <marek.safar@gmail.com>
5844 * attribute.cs (GetString, GetBoolean): Work with both literal and
5847 * ecore.cs, expresison.cs, delegate.cs (Invocation, MethodGroupExpr):
5848 Moved method overload specific methods to MethodGroupExpr.
5850 (IndexerAccess): Re-wrote resolving mechanism, fixed many issues and
5851 it should be less memory consuming.
5853 Mon Oct 8 09:29:15 CEST 2007 Paolo Molaro <lupus@ximian.com>
5855 * codegen.cs: remove the assembly version check until the buildbot is
5858 2007-10-07 Jb Evain <jbevain@novell.com>
5860 * attribute.cs (Attribute.GetString): if the value
5861 expression is a StringConstant, return its string value.
5863 2007-10-07 Jb Evain <jbevain@novell.com>
5865 * typemanager.cs: add `assembly_version_attribute_type`.
5866 * codegen.cs: on attribute emission, check that the
5867 AssemblyVersionAttribute doesn't overflow.
5869 2007-10-05 Marek Safar <marek.safar@gmail.com>
5871 A fix for bug #324677
5872 * anonymous.cs, decl.cs: Yes another anonymous container hack. Overwrite
5873 parent container of a scope container with currently resolved one.
5875 2007-10-05 Marek Safar <marek.safar@gmail.com>
5877 A fix for bug #325534
5878 * class.cs (Invocation.DoResolve): Check invocation of object finalizer
5881 2007-10-05 Marek Safar <marek.safar@gmail.com>
5883 A fix for bug #327504
5884 * class.cs (Operator.Define): Refactored implicit and explicit user
5885 operator conversion rules.
5887 2007-10-05 Marek Safar <marek.safar@gmail.com>
5889 A fix for bug #327520
5890 * ecore.cs (ExtensionMethodGroupExpr): Emit resolved extension argument.
5892 2007-10-04 Marek Safar <marek.safar@gmail.com>
5894 A fix for bug #328022
5895 * class.cs (MethodData.Define): Use correct method to check whether
5896 a method implementents an accessor.
5898 2007-10-04 Marek Safar <marek.safar@gmail.com>
5900 A fix for bug #330069
5901 * statement.cs (Fixed.Resolve): Read the first array element only when
5902 an array is instantiated.
5904 2007-10-04 Marek Safar <marek.safar@gmail.com>
5906 * expression.cs, assign.cs, generics.cs: Print correct operator when
5907 compound assignment is used.
5909 2007-10-04 Marek Safar <marek.safar@gmail.com>
5911 A fix for bug #325841
5912 * expression.cs (ArrayAccess): Use full argument cloning only for
5913 string compound concatenation.
5915 2007-10-03 Marek Safar <marek.safar@gmail.com>
5917 A fix for bug #328774
5918 * ecore.cs (FieldExpr.EmitAssign): Fixed string concatenation compound
5920 (PropertyExpr.EmitAssign): Fixed string concatenation compound
5923 2007-10-03 Raja R Harinath <rharinath@novell.com>
5926 * ecore.cs (SimpleName.DoSimpleNameResolve): Handle Property and
5927 Event accessibility checks here. Remove some bogus code that
5928 accidently made GenericMethods work.
5929 (PropertyExpr.IsAccessibleFrom, EventExpr.IsAccessibleFrom): New.
5931 2007-09-25 Marek Safar <marek.safar@gmail.com>
5933 * expression.cs (ArrayCreation): Fixed cloning of an implicit types.
5935 * statement.cs (Block): Refactored AddVariable to allow error handling
5938 * generic.cs: New stub.
5940 2007-09-23 Marek Safar <marek.safar@gmail.com>
5942 * anonymous.cs, codegen.cs: Changed InferReturnType to be EmitContext
5945 2007-09-17 Marek Safar <marek.safar@gmail.com>
5947 * class.cs: Use partial container to record whether any partial part
5948 contains static field initializer and therefore default contructor has
5951 2007-09-14 Marek Safar <marek.safar@gmail.com>
5953 * class.cs (TypeContainer.AddPartial): Fixed an issue reported on
5954 mono-list when only one of two partial parts has defined accessibility
5957 2007-09-14 Marek Safar <marek.safar@gmail.com>
5959 A fix for bug #82845
5961 * class.cs (TypeContainer): Set correct resolve context for all field
5964 2007-09-13 Marek Safar <marek.safar@gmail.com>
5966 * assign.cs: Fixed a crash when field is resolved twice with an error.
5968 * codegen.cs: Changed InFieldInitializer to be flag.
5970 * anonymous.cs, ecore.cs, expression.cs: Update after
5971 IsInFieldInitializer rename.
5973 * const.cs: Removed unused parameter.
5975 * class.cs: Changed the way how we resolve and emit field initializers.
5976 The field initilizers have to have access to contructor block to emit
5977 compiler generated code.
5979 2007-09-13 Marek Safar <marek.safar@gmail.com>
5981 * expression.cs (MemberAccess.DoResolve): DeclSpace is broken by
5982 generics use TypeContainer instead.
5984 2007-09-12 Marek Safar <marek.safar@gmail.com>
5986 * generic.cs (TypeInferenceContext.InflateGenericArgument): Stub.
5988 * lambda.cs (ResolveParameters): Use more powerful
5989 InflateGenericArgument.
5991 * parameters.cs: Better exception message.
5993 2007-09-10 Marek Safar <marek.safar@gmail.com>
5995 * anonymous.cs (AnonymousMethodExpression.CompatibleChecks): Report
5996 correct expression block type.
5998 * ecore.cs (Expression.Error_MemberLookupFailed): Made virtual.
6000 * expression.cs (Invocation): Extracted method group resolve to
6003 2007-09-07 Marek Safar <marek.safar@gmail.com>
6005 * ecore.cs (Expression.MemberLookupFinal): Removed unused loc parameter.
6006 (MethodGroupExpr.ResolveGeneric): Use existing method group instance.
6008 * expression.cs (MemberAccess.DoResolve): Uses generic resolver for
6009 generic extension methods.
6011 2007-09-06 Marek Safar <marek.safar@gmail.com>
6013 A fix for bug #82676 (Do I get it right now?)
6014 * convert.cs (Binary.ResolveOperator): An interface is converted to the
6015 object before a standard conversion is applied.
6017 2007-09-06 Marek Safar <marek.safar@gmail.com>
6019 * convert.cs (ImplicitReferenceConversionCore): Reverted wrong fix of
6022 2007-09-05 Marek Safar <marek.safar@gmail.com>
6024 A fix for bug #82676
6025 * convert.cs (ImplicitReferenceConversionCore): Check both sides for
6026 non-generic interface types.
6028 2007-09-05 Marek Safar <marek.safar@gmail.com>
6030 A fix for bug #82690
6031 * ecore.cs (PropertyExpr.EmitAssign): Leave a copy does just that.
6033 2007-09-05 Marek Safar <marek.safar@gmail.com>
6035 A fix for bug #82571
6036 * anonymous.cs (AnonymousMethod.DoCreateMethodHost): Use internal
6037 modifier for container based methods.
6039 2007-09-05 Marek Safar <marek.safar@gmail.com>
6041 A fix for bug #82676
6042 * convert.cs (ImplicitReferenceConversionCore): From any class-type S to
6043 any interface-type T means to any of interface type T.
6045 2007-09-04 Marek Safar <marek.safar@gmail.com>
6047 * namespace.cs: We have 2 versions of System.Core assembly.
6049 2007-09-04 Marek Safar <marek.safar@gmail.com>
6051 A fix for bug #82652
6052 * class.cs (Class.GetClassBases): Compare types and not expressions.
6054 2007-09-04 Marek Safar <marek.safar@gmail.com>
6056 A fix for bug #82620
6057 * expression.cs (Invocation.EmitArguments): Duplicate params arguments
6058 actually never worked before.
6059 (IndexerAccess): Emit prepared arguments before they are modified.
6061 2007-09-04 Marek Safar <marek.safar@gmail.com>
6063 A fix for bug #82563
6064 * assign.cs: Revert wrong fix.
6066 * expression.cs (VariableReference.EmitAssign): Handle ref reference
6068 (ArrayAccess): Changed the way we emit compound (prepared) assignments.
6069 Instead of ldelema/stdind we have to use temporary variables to handle
6070 cases like String.Concat (params string[]).
6072 2007-08-31 Marek Safar <marek.safar@gmail.com>
6074 * class.cs: EmitAttributes to Emit rename.
6076 * decl.cs (MemberCore.GetClsCompliantAttributeValue): Parent can be
6078 (MemberCore.HasClsCompliantAttribute): Don't depend on
6079 GetClsCompliantAttributeValue execution.
6081 2007-08-31 Marek Safar <marek.safar@gmail.com>
6083 * anonymous.cs: Use shorter type prefix.
6085 * ecore.cs (SimpleName.DoSimpleNameResolve): Use transparent identifiers
6088 * expression.cs (LocalVariableReference.DoResolveBase): Don't capture
6089 variables when probing is on.
6091 * statement.cs (LocaLInfo.Clone): Clone correctly resolved and
6092 unresolved variables.
6093 (TopLevelBlock.GetTransparentIdentifier): Default implementation doesn't
6094 handle transparent identifiers.
6096 2007-08-26 Marek Safar <marek.safar@gmail.com>
6098 * attribute.cs (IsClsCompliant): Add nullable types test.
6100 2007-08-24 Atsushi Enomoto <atsushi@ximian.com>
6102 * doc.cs : catch other types of exception than XmlException to
6103 report CS1570. Fixed bug #82565.
6105 2007-08-23 Marek Safar <marek.safar@gmail.com>
6107 * anonymous.cs (AnonymousMethodExpressin.ExplicitTypeInference):
6108 The number of delegate parameters has to match.
6109 (AnonymousMethodExpressin.VerifyParameterCompatibility): Handles generic
6112 2007-08-21 Marek Safar <marek.safar@gmail.com>
6114 * anonymous.cs (AnonymousMethod): Generate private anonymous method
6115 to fix problem with private arguments.
6117 2007-08-20 Marek Safar <marek.safar@gmail.com>
6119 * anonymous.cs (AnonymousTypeClass): An anonymous type can be empty.
6121 * decl.cs (MemberName): Ignore generic type with no generic arguments.
6123 * expression.cs (AnonymousTypeDeclaration): An anonymous type can be
6124 empty. Add cloning suport.
6126 * roottypes.cs (GetAnonymousType): Fixed argument comparison logic.
6128 2007-08-20 Marek Safar <marek.safar@gmail.com>
6130 * convert.cs, ecore.cs, expression.cs, literal.cs: Use factory method
6131 to create EmptyCast. It handles EmptyConstantCast specialization for
6134 2007-08-18 Marek Safar <marek.safar@gmail.com>
6136 * expression.cs (Binary.is_unsigned): Handle unsafe types too.
6137 (EmitArrayArgument): One routine for array arguments.
6138 (ArrayCreation.MakeByteBlob): Fixed an array alignment.
6140 2007-08-17 Marek Safar <marek.safar@gmail.com>
6142 * cs-tokenizer.cs (GetKeyword): Handle from keyword in a different way.
6144 2007-08-17 Marek Safar <marek.safar@gmail.com>
6146 * anonymous.cs: MemberLookupFinal update.
6148 * class.cs (ConstructorInitializer): Is expression based.
6150 * delegate.cs: MethodGroupExpr update.
6152 * ecore.cs (Error_MemberLookupFailed): Improved to report better error
6154 (Error_MemberLookupFailed): Customizable error override.
6155 (MethodGroupExpr): Keep queried type for later usage.
6156 (MethodGroupExpr.OverloadResolve): Catch errors related to overload
6159 * expression.cs: Error_MemberLookupFailed refactoring.
6160 (New.DoResolve): Resolve as much as possible.
6161 (ElementInitializer.Error_MemberLookupFailed): Object initializer
6162 customization for invalid member types.
6164 * statement.cs: MethodGroupExpr update.
6166 2007-08-16 Marek Safar <marek.safar@gmail.com>
6168 * modifier.cs (Check): Check all modifiers and not only accessibility
6171 2007-08-16 Marek Safar <marek.safar@gmail.com>
6173 * ecore.cs (Expression.Error_ValueCannotBeConverted): Report always a
6174 type and not an expression.
6176 2007-08-16 Marek Safar <marek.safar@gmail.com>
6178 * statement.cs (Catch.Clone): Type and variable can be null.
6180 2007-08-16 Marek Safar <marek.safar@gmail.com>
6182 A fix for bug #81979
6183 * assign.cs (Assign.Emit): Prepare arguments for string concatenation.
6184 I am really not sure whether this is the best fix.
6186 * expression.cs (VariableReference.EmitAssign): Do prepare_load test
6189 2007-08-14 Marek Safar <marek.safar@gmail.com>
6191 ** C# 3.0 Object and collection initializers (major re-write)
6193 * assign.cs (DoResolve): Initializers are not assign related.
6195 * codegen.cs (EmitContext.CurrentInitializerVariable): Holds a varible
6196 used during collection or object initialization.
6198 * expression.cs (Error_InvalidArguments): Add initializers specific
6199 messages. More will come later because it requires some general
6201 (New.DoResolve): Better error handling for unsafe types.
6202 (EmptyExpressionStatement): New class.
6203 (ElementInitializer): An object initializer expression.
6204 (CollectionElementInitializer): A collection initializer expression.
6205 (CollectionOrObjectInitializers): A block of object or collection
6207 (NewInitialize): New expression with element/object initializers.
6209 * statement.cs: Reverted object/collection initializer hacks.
6211 * typemanager.cs (CSharpName): Filter __arglist type.
6213 2007-08-09 Marek Safar <marek.safar@gmail.com>
6215 ** C# 3.0 Anonymous Types (update to the latest standard)
6217 * expression.cs (Binary.ResolveOperator): Threat all null based types
6219 (AnonymousTypeDeclaration): Renamed from AnonymousType and simplified.
6220 (AnonymousTypeParameter): Updated.
6222 * anonymous.cs (CompilerGeneratedClass): Add custom name overload.
6223 (AnonymousTypeClass): New anonymous type container.
6225 * class.cs (AddField): Return operation result.
6227 * generic.cs: Another empty TypeArguments overload.
6229 * roottypes.cs (AddAnonymousType, GetAnonymousType): Anonymous types
6230 are stored at top of normal hierarchy.
6232 * typemanager.cs (CSharpName): Filter anonymous types.
6234 2007-08-09 Marek Safar <marek.safar@gmail.com>
6236 * expression.cs (StringConcat.Append): Handle 3 and more concatenation
6237 as single Concat call. How could we miss that :-(
6239 2007-08-08 Marek Safar <marek.safar@gmail.com>
6241 * expression.cs (ArrayCreation.CloneTo): Allocate exact size.
6243 2007-08-07 Miguel de Icaza <miguel@novell.com>
6245 * expression.cs: Fix the previous commit, the creation of the
6246 arguments array list needs also to be conditional on the arguments
6249 * class.cs: Add a little bit of help to help narrow down problems.
6251 * expression.cs (ArrayCreation.CloneTo): Argument can be null, do
6252 not try to copy in that case.
6254 * driver.cs: When building SMCS, include a new different set of
6255 default assemblies here. Do this here so we can control whether
6256 to include the default assemblies with /noconfig.
6258 2007-08-03 Marek Safar <marek.safar@gmail.com>
6260 A fix for bug #81979
6261 * expression.cs (TypeOf.GetAttributableValue): Check for type arguments
6264 2007-08-03 Marek Safar <marek.safar@gmail.com>
6266 A fix for bug #82300
6268 * anonymous.cs (AnonymousContainer.Define): Don't define anything when
6269 we are in probing scope.
6271 2007-08-03 Marek Safar <marek.safar@gmail.com>
6273 A fix for bug #82301
6275 * statement.cs (Catch.CloneTo): Clone blocks in the right order.
6276 (Statement.CloneTo): Clone and not map children blocks.
6278 2007-08-03 Marek Safar <marek.safar@gmail.com>
6280 A fix for bug #82299
6282 * expression.cs (LocalVariableReference.CloneTo): Remap local info
6285 * statement.cs (Statement.CloneTo): Clone variables before statements
6286 to allow remaping of local variables.
6288 2007-08-03 Marek Safar <marek.safar@gmail.com>
6290 A fix for bug #82296
6293 * report.cs: Log crash details for future clone problems.
6295 * statement.cs (Return.Clone): Don't clone non-existent expression.
6297 2007-08-03 Raja R Harinath <harinath@gmail.com>
6299 * class.cs (TypeContainer.AddBasesForPart): Make virtual.
6300 (Class.AddBasesForPart): Move CS0537 check here from ...
6301 * cs-parser.jay (class_declaration): ... here. Move calling of
6302 'AddBasesForPart' to ...
6303 (class_bases): ... here.
6304 (struct_declaration, interface_declaration): Update to changes.
6306 2007-08-02 Marek Safar <marek.safar@gmail.com>
6308 A fix for bug #81923
6310 * statement.cs (Using.ResolveLocalVariableDecls): Only non-user implicit
6311 conversion is allowed.
6313 2007-08-02 Marek Safar <marek.safar@gmail.com>
6315 A fix for bug #81564
6317 * ecore.cs (EventExpr): Add IsBase handling.
6319 * expression.cs (BaseAccess.CommonResolve): Events can use base accessor
6322 2007-08-02 Raja R Harinath <harinath@gmail.com>
6324 Reduce some differences between cs-parser.jay in mcs/ and gmcs/.
6325 * cs-parser.jay: Some whitespace cleanups.
6326 (current_delegate): New.
6328 (struct_declaration): Make similar to gmcs/cs-parser.jay -- add
6329 a dummy code block, and use 'type_name' instead of 'member_name'.
6330 (interface_declaration, class_declaration): Likewise.
6331 (delegate_declaration): Likewise. Rearrange slightly and use
6333 * cs-tokenizer.cs (handle_where): Rename from handle_constraints.
6334 (GetKeyword): Update to change. Use '!foo' instead of 'foo == false'.
6336 2007-08-02 Marek Safar <marek.safar@gmail.com>
6338 A fix for bug #82039
6340 * ecore.cs (TypeLookup.GetSignatureForError): Use name when type is not
6343 * typemanager.cs (CSharpName): Split to string overload.
6345 2007-08-02 Marek Safar <marek.safar@gmail.com>
6348 * report.cs: Updated warning CS0472.
6350 2007-08-01 Marek Safar <marek.safar@gmail.com>
6352 A fix for bug #82181
6354 * cs-tokenizer.cs: Ignore partial keyword inside block expression.
6356 2007-08-01 Marek Safar <marek.safar@gmail.com>
6358 A fix for bug #82277
6359 * statememnt.cs (Block.Clone): Don't clone explicit blocks twice.
6361 2007-08-01 Marek Safar <marek.safar@gmail.com>
6363 ** C# 3.0 Type Inference (major bits are working)
6365 * anonymous.cs (AnonymousMethodExpression): Removed refactored fields.
6366 (.ImplicitStandardConversionExists): Uses compatible.
6367 (.ExplicitTypeInference): Infers type arguments based on explicit arguments
6368 (.InferReturnType): New method.
6369 (.Compatible): Refactored.
6370 (.ResolveParameters): Uses factory to create resolved parameters.
6371 (.CompatibleMethod): Add probing mode support.
6372 (AnonymousContainer): Removed unused fields. Split Define and Resolve to
6373 clearly distinguish between 2 different operations.
6374 (LambdaMethod): Moved to lambda.cs.
6375 (AnonymousMethod): Removed unused fields and methods.
6376 (AnonymousDelegate): Simplified.
6378 * codegen.cs (ResolveTopBlock): Updated renamed Resolve to Define.
6380 * convert. cs (ImplicitConversionStandard): Compatible works differently.
6382 * delegate.cs (Delegate): New mehods to reduce code duplication.
6383 (.GetConstructor): New method.
6384 (.GetInvokeMethod): New method.
6385 (DelegateCreation): Updated.
6387 * ecore.cs (ResolveOverloadExtensions): Don't crash when extension method
6389 (OverloadResolve): Made probing little bit faster.
6391 * expression.cs (ParameterReference.DoResolveLValue): Reference can be null
6394 * generic.cs (TypeInferenceContext): Dummy implementation.
6396 * iterators.cs: Updated after Resolve/Define rename.
6398 * lambda.cs (LambdaExpression)
6399 (.ResolveParameters): Handles both type of arguments and type inference too.
6401 * parameter.cs (ImplicitLambdaParameter.Resolve): Sanity check.
6402 (InflateTypes): Updated.
6404 * support.cs (InflateTypes): Changed signature and updated.
6406 * typemanager.cs (LookupMemberCache): Better dynamic type check.
6407 (MemberLookup_FindMembers): More MS tricks.
6408 (GetParameterData): Ditto.
6409 (GetDelegateParameters): Uses quick path for dynamic types.
6411 2007-08-01 Marek Safar <marek.safar@gmail.com>
6413 * class.cs (MethodData.Define): EmitContext is required for generic stuff
6416 2007-07-31 Marek Safar <marek.safar@gmail.com>
6418 * statement.cs (ProcessParameters): Don't crash when parameters have wrong
6421 2007-07-26 Jb Evain <jbevain@novell.com>
6423 * typemanager.cs (TypeManager.GetConstructor): Add a method overload
6424 which takes a boolean 'report_errors', similar to the GetMethod.
6425 (InitCodeHelpers): StructLayoutAttribute.ctor(int16) is not visible
6426 in .net 2.1, do not report errors here.
6428 * typemanager.cs (TypeManager.InitCoreTypes): System.ArgIterator,
6429 System.Runtime.CompilerServices.RequiredAttributeAttribute and
6430 System.Runtime.CompilerServices.TypeForwardedToAttribute are internal
6433 * typemanager.cs (TypeManager.InitCoreTypes): Move the resolution
6434 of the type InternalsVisibleToAttribute before the first call
6435 to CoreLookupType which is allowed to fail (third boolean parameter
6436 to true). Because, during the resolution for a type that is not
6437 immediately found, we try to check if the type is not defined in
6438 a friend assembly, and to do so, we need the
6439 InternalVisibleToAttribute.
6441 2007-07-23 Miguel de Icaza <miguel@novell.com>
6443 * expression.cs (Binary): Add support for the brain-dead CSC 2.x
6444 feature that allows structs to be compared against null and inline
6445 the result as true or false.
6447 Notice that the same code is not permitted inside a generic block
6448 of code that would do:
6450 class Foo<T> where T : struct {
6457 It is only allowed if the type of T is not bound (no where
6458 clause). In my opinion, this CSC 2 behavior is broken but people
6459 seem to be using it (IronRuby does, a few bug reports on bugzilla
6460 have it and some people have complained about it).
6462 All of the users that depend on this behavior have code that is
6465 * report.cs (Warning, Error): make these take object arguments,
6466 not strings, as that allows us to take advantage of Format.
6468 2007-07-20 William Holmes <billholmes54@gmail.com>
6470 * decl.cs: Changed MemberName.CountTypeArguments to also check the
6471 Left member variable for the Count.
6472 * doc.cs: Changed DocUtil.GetMethodDocCommentName to call
6473 MemberName.CountTypeArguments to avoid a NRE.
6475 This code is contributed under the MIT X11 license
6477 2007-07-18 Marek Safar <marek.safar@gmail.com>
6479 * cs-tokenizer.cs: Improved lambda parsing and removed old code.
6481 2007-07-18 Atsushi Enomoto <atsushi@ximian.com>
6483 * doc.cs : generic method arguments are written as ``x while generic
6484 type arguments are `x. Combined with the previous change, fixed bug
6487 2007-07-18 Raja R Harinath <rharinath@novell.com>
6490 * expression.cs (Binary.ResolveOperator): When converting
6491 'a + (- b)' to 'a - b', ensure that the unary '-' is discarded.
6493 2007-07-18 Atsushi Enomoto <atsushi@ximian.com>
6495 * doc.cs : when T: or whatever x: is specified, it does not really
6496 check the doc comment's syntax correctness. Fixed bug #82006.
6498 2007-07-18 Marek Safar <marek.safar@gmail.com>
6500 * anonymous.cs (AnonymouseMethodExpression): Refactored to work with
6501 LambdaExpression better.
6503 * cs-tokenizer.cs: Changed a way how we detect lambda parameters.
6505 * driver.cs (LambdaTypeParseTest): Removed, tested method is gone.
6507 * ecore.cs (Expression.MemberLookupFailed): Don't show currect context
6508 as it can be generated.
6510 * expression.cs (Invocation.Error_InvalidArguments): Show correct
6513 * lambda.cs (LambdaExpression): Refactored to share same code with
6514 AnonymousMethodExpression.
6516 2007-07-17 Marek Safar <marek.safar@gmail.com>
6518 * anonymous.cs (MakeName): Include host name for easier debugging.
6519 (LambdaMethod): New class for lambda spcecific stuff.
6521 * attribute.cs: Set EmitContext return type.
6523 * class.cs: Set EmitContext return type.
6525 * codegen.cs (EmitContext): Return type cannot be null to stop messing
6526 with null/void meaning.
6528 * iterators.cs (ContainerType): Implemented.
6530 * rootcontext.cs: Set value of TypeManager.bool_type at early stage.
6532 * statement.cs (Return): Updated to lambda expressions.
6533 (Block.CloneTo): Parent can be null.
6535 2007-07-13 Marek Safar <marek.safar@gmail.com>
6537 A fix for bug #81917
6538 * attribute.cs (AttributeTester.GetFixedBuffer): More robust testing.
6540 * class.cs (FixedField): Check whether field is in unsafe scope.
6542 * ecore.cs (FieldExpr.DoResolve): Create fixed buffer expression here.
6543 (FieldExpr.Emit): Fixed buffers cannot be volatile.
6545 * expression.cs (ElementAccess.Resolve): Move fixed buffers resolve to
6548 * statement.cs (Fixed.Resolve): Simplified fixed buffers.
6550 2007-07-13 Marek Safar <marek.safar@gmail.com>
6552 * cs-tokenizer.cs, class.cs, decl.cs, driver.cs, namespace.cs,
6553 rootcontext.cs, expression.cs, statement.cs: Updated to use WarningLevel
6556 2007-07-13 Marek Safar <marek.safar@gmail.com>
6558 * ecore.cs (FieldExpr.AddressOf): Less confusing warning message.
6560 2007-07-13 Marek Safar <marek.safar@gmail.com>
6562 * anonymous.cs (AnonymousMethodExpression): Parameters are r/o.
6563 (AnonymousContainer.ResolveNoDefine): Another ec to aec flag conversion.
6565 * codegen.cs(EmitContext): Add ProbingMode flag.
6567 * delegate.cs (DelegateInvocation): Set few instance variables as r/o.
6569 * driver.cs: For now set both warning values.
6571 * ecore.cs (SimpleName): Name is readonly.
6572 (MethodGroup.OverloadResolve): One quick path for probing.
6574 * expression.cs (Unary): Set Oper r/o.
6575 (Binary): Set Oper r/o.
6576 (ParameterReference): Set few instance variables as r/o.
6577 (ParameterReference.DoResolveBase): Don't capture aruments when
6579 (Invocation.CloneTo): Fixed typo, looks easy, yeah.
6580 (Arglist): arguments are private.
6581 (SizeOf): type is private and r/o.
6582 (MemberAccess): arguments are private.
6584 * report.cs: Enhanced reporting on/off capabilities.
6586 * lambda.cs: Uses ec.IsInProbingMode.
6587 (ContextualReturn): Derives from return.
6589 * rootcontext.cs: For now set both warning values.
6591 * statement.cs (CloneContext.RemapBlockCopy): Remaps block to cloned
6593 (Return.Resolve): Don't die immediately.
6594 (Block.Resolve): Speed-up probing.
6595 (Block.CloneTo): Clone only child blocks.
6597 Fri Jul 13 11:19:28 CEST 2007 Paolo Molaro <lupus@ximian.com>
6599 * iterators.cs: reverted Miguel's latest change (r81925) as it
6600 breaks the build in System.
6602 2007-07-13 Miguel de Icaza <miguel@novell.com>
6604 * iterators.cs (Yield.CheckContext): Check for the iterator type
6605 also here as we can call into Yield even in codepaths that are not
6607 (MethodOrOperator is the only path that was checked).
6609 In addition to the standard check, use a more specific check for
6610 constructors to report a more verbose error.
6612 2007-07-12 Miguel de Icaza <miguel@novell.com>
6614 * ecore.cs (FieldExpr.AddressOf): Do not stop processing here,
6615 report the warning and continue
6617 * statement.cs (Using.EmitLocalVariableDecls): We were leaving
6618 values on the stack on the call to Emit. Use EmitStatement if
6619 possible, or using Emit + Pop if not possible. Fixes #82064
6621 2007-07-12 Raja R Harinath <rharinath@novell.com>
6623 * expression.cs (Invocation.IsApplicable): Reorganize slightly to
6624 avoid try...finally in some cases.
6626 2007-07-10 Marek Safar <marek.safar@gmail.com>
6628 * attribute.cs (Attribute.ResolveConstructor): Uses method group.
6630 * class.cs (ConstructorInitializer.Resolve): Use and keep method group
6631 instead of method. Re-use standard error handling.
6632 (ConstructorInitializer.Emit): Simplified.
6634 * delegate.cs: Updated after Invocation.EmitCall change.
6636 * ecore.cs (GetOperatorTrueOrFalse): Uses MethodGroupExpr only.
6637 (SimpleName.SimpleNameResolve): Set and reset in_transit flag correctly.
6638 (ExtensionMethodGroupExpr): Refactored to use same OverloadResolve
6639 method and don't permanently changing input arguments.
6640 (MethodGroupExpr): Introduced resolved best_candidate, when method group
6641 is resolved it has one of the candidates is the best one which is later
6642 used to emit. Removed a few unused method.
6643 (MethodGroupExpr.MakeUnionSet): Moved from Invocation, it belongs here.
6645 * expression.cs (StaticCallExpr.MakeSimpleCall): Uses method group.
6646 (Binary.ResolveOperator): Ditto.
6647 (ConditionalLogicalOperator.DoResolve): Ditto.
6648 (Invocation): Uses method group.
6649 (Invocation.DoResolve): Simplified.
6650 (Invocation.EmitCall): Removed useless is_static.
6651 (Invocation.Emit): Delegate to method group.
6652 (Invocation.EmitStatement): Simplified.
6653 (New): Uses method group.
6654 (MemberAccess.DoResolve): Don't destroy original expression.
6656 * statement.cs (ForEach.Resolve): Use null for no method arguments.
6658 2007-07-04 Marek Safar <marek.safar@gmail.com>
6660 * ecore.cs (VarExpr.DoResolveLValue): More restriction checks.
6663 * lambda.cs: Add custom error message type.
6665 2007-07-03 Marek Safar <marek.safar@gmail.com>
6667 * lambda.cs: Simplified little bit.
6669 * parameter.cs: Introduced ImplicitLambdaParameter.
6670 (Parameters.CreateFullyResolved): New factory instead of ctor.
6674 * delegate.cs: Updated parameter creation.
6676 2007-07-03 Marek Safar <marek.safar@gmail.com>
6678 * ecore.cs (SimpleName.GetSignatureForError): Display correctly generic
6681 * generic.cs: Synchronized with gmcs.
6683 2007-07-03 Marek Safar <marek.safar@gmail.com>
6685 * class.cs (Indexer): Check return type as soon as possible.
6687 * cs-parser.jay: Initialize implicit_value_parameter_type for interface
6690 * ecore.cs (VarExpr.DoResolveLValue): Set eclass value.
6692 * expression.cs (Invocation.Error_InvalidArguments): Show type only.
6694 * parameter.cs (Parameter): Use expression type when it is available.
6696 * support.cs (ReflectionParameters.ParameterDesc): Show an extension
6697 method modifier for the first parameter only.
6699 2007-06-24 Marek Safar <marek.safar@gmail.com>
6701 A fix for bug #81938
6702 * typemanager.cs (ChangeType): Fixed couple of char conversions.
6704 * constant.cs: Tide up an exception message.
6706 2007-06-22 Marek Safar <marek.safar@gmail.com>
6708 * ecore.cs (SimpleName.DoSimpleNameResolve): Better error reporting when
6709 an uninitialized variable is used.
6711 * expression.cs (LocalVariableReference.DoResolve): Ditto.
6713 2007-06-22 Marek Safar <marek.safar@gmail.com>
6715 * ecore.cs (SimpleName.TypeOrNamespaceNotFound): Allow to override type
6716 not found error handling.
6718 * expression.cs (ArrayCreation): Removed redundant fields and little bit
6720 (ArrayCreation.ResolveArrayElement): To be ready to customization.
6721 (ArrayCreation.DoResolve): Simplified.
6722 (ImplicitlyTypedArrayCreation.DoResolve): Implicitly typed arrays have
6723 its own resolve process.
6724 (ImplicitlyTypedArrayCreation.ResolveArrayElement): Conversion magic.
6726 2007-06-20 Marek Safar <marek.safar@gmail.com>
6728 * namespace.cs (NamespaceEntry.Error_AmbiguousTypeReference): Print
6731 2007-06-20 Marek Safar <marek.safar@gmail.com>
6733 * cs-tokenizer.cs: Removed var related stuff.
6735 * ecore.cs (Expression.ResolveAsContextualType): Introduced new method.
6736 (VarExpr): Changed to derive from SimpleName. VarExpr now behaves as
6737 a type and a keyword at same time.
6739 * decl.cs (MembeName.GetTypeExpression): Create VarExpr when type name
6742 * expression.cs (ImplicitlyTypedArrayCreation): New empty class for
6743 implicitly typed arrays, more changes will follow.
6745 * statement.cs (LocalInfo.Resolve): Resolve type as contextual type.
6747 2007-06-19 Marek Safar <marek.safar@gmail.com>
6749 * ecore.cs (VarExpr): Removed Handled field.
6751 * statement.cs (Using.ResolveLocalVariableDecls): Refactored to use
6752 build-in assign functionality.
6753 (ForEach.Resolve): Removed all implicitly typed local variable code and
6755 (ArrayForeach.Resolve): Infer implicitly typed local variable here.
6756 (CollectionForeach.Resolve): Infer implicitly typed local variable here.
6758 2007-06-18 Marek Safar <marek.safar@gmail.com>
6760 * assign.cs: Removed implicitly typed local variable check.
6762 * expression.cs (LocalVariableReference.DoResolve): Add check for self
6763 referencing implicitly typed local variable.
6764 (LocalVariableReference.DoResolveLValue): Infer implicitly typed local
6767 * statement.cs (Fixed): Removed unsupported implicitly typed local
6770 2007-06-15 Marek Safar <marek.safar@gmail.com>
6772 * decl.cs (MemberName): Moved all Unbound stuff to parser.
6774 2007-06-14 Marek Safar <marek.safar@gmail.com>
6776 A fix for bugs #81855 and #76274
6777 * attribute.cs (AttachTo): Always set owner for global attributes to
6780 * ecore.cs (Error_TypeDoesNotContainDefinition): A type location can be
6783 * cs-parser.jay: Assembly and module attributes must precede all other
6784 elements except using clauses and extern alias declarations.
6786 2007-06-13 Marek Safar <marek.safar@gmail.com>
6788 A fix for bug #81748
6790 * expression.cs: More checks for non ISO-1 features.
6792 2007-06-12 Marek Safar <marek.safar@gmail.com>
6794 A fix for bug #81807
6795 * statement.cs(Switch.TableSwitchEmit): Define null label when it's not
6796 present inside switch statement and it is required by nullable check.
6798 2007-06-12 Marek Safar <marek.safar@gmail.com>
6800 A fix for bug #81840
6801 * ecore.cs (SimpleName.ResolveAsTypeStep): Look for non-generic type
6802 when type matching fails.
6804 * namespace.cs: Tiny error message change.
6806 2007-06-12 Marek Safar <marek.safar@gmail.com>
6808 * decl.cs (CheckAbstractAndExtern): Moved to MemberCore for easier error
6809 reporting. Added automatic property check.
6811 * class.cs: Updated after CheckAbstractAndExtern relocation.
6812 (AEventPropertyAccessor.GetSignatureForError): Customized.
6814 2007-06-11 Marek Safar <marek.safar@gmail.com>
6816 * class.cs (DefineBaseTypes): Base type can be undefined.
6818 * ecore.cs (TypeLookup): Minor refactoring.
6819 (DoResolveAsTypeStep): Removed redundant check.
6821 * namespace.cs (Lookup): Removed redundant check.
6823 * rootcontext.cs (BootstrapCorlib_ResolveType): Uses normal
6824 ResolveAsTypeTerminal step.
6825 (BootstrapCorlib_*): Simplified.
6826 (PopulateCoreType): Core types can be now external.
6828 2007-06-07 Marek Safar <marek.safar@gmail.com>
6830 * anonymous.cs (VerifyExplicitParameterCompatibility): Add flag to do
6832 (InferTypeArguments): Infers anonymous expression type arguments.
6833 (Compatible): Split to Compatible and InferTypeArguments.
6835 * lambda.cs: Updated.
6837 2007-06-08 Marek Safar <marek.safar@gmail.com>
6839 * anonymous.cs (AnonymousContainer): Marked as compiler generated.
6841 2007-06-07 Raja R Harinath <harinath@gmail.com>
6843 Fix #80477, cs0135-2.cs, cs0135-3.cs
6844 * statement.cs (ToplevelBlock.ProcessParameters): Add parameter
6845 names to the "known" variables list.
6846 (Block.CheckInvariantMeaningInBlock): Handle the fact the
6847 parameter names are also "known".
6848 (Block.CheckError136): Remove.
6849 (ExplicitBlock.CloneTo): New. Set 'known_variables' in target to
6852 2007-06-07 Marek Safar <marek.safar@gmail.com>
6854 * ecore.cs (MethodGroupExpr.OverloadResolve): Print full method definition.
6856 2007-06-06 Marek Safar <marek.safar@gmail.com>
6858 * ecore.cs (SimpleName.Emit): Emitting unresolved simple name is
6859 internal error not an user error.
6861 * expression.cs (IsApplicable): Refactored to make debugging easier.
6863 * support.cs: More tricks for non-mono runtimes.
6865 * typemanager.cs (CoreLookupType): Made public.
6866 (InitSystemCore): All linq specific stuff moved to linq.cs
6868 2007-06-05 Marek Safar <marek.safar@gmail.com>
6870 * typemanager.cs (CSharpSignature): One more missing build-in types
6872 More tricks for non-mono runtime.
6874 2007-06-05 Raja R Harinath <harinath@gmail.com>
6876 * statement.cs (Block.CheckError136_InParents): Remove.
6877 (Block.AddVariable): Use GetParameterInfo instead.
6878 (ToplevelBlock.ProcessArguments): Likewise.
6880 2007-06-04 Raja R Harinath <rharinath@novell.com>
6882 * statement.cs (ToplevelBlock.CloneTo): New. Copy over parameter
6884 (ToplevelBlock.GetParameterInfo): Split out of ...
6885 (ToplevelBlock.GetParameterRefernce): ... this.
6886 (ToplevelBlock.ParameterMap): Remove.
6887 * expression.cs (ParameterReference): Update to use
6888 ToplevelParameterInfo.
6890 * statement.cs (ToplevelBlock.ProcessParameters): Workaround some
6893 * flowanalysis.cs (FlowBranching.CheckOutParameters): Move ...
6894 * statement.cs (ToplevelBlock.CheckOutParameters): ... here.
6896 * statement.cs (ToplevelBlock.ResolveMeta): Move CS0136 checks ...
6897 (ToplevelBlock.ProcessParameters) ... here.
6898 (ToplevelBlock..ctor): Invoke it.
6900 * statement.cs (ToplevelBlock.ResolveMeta): Add sanity checks for
6903 * statement.cs (IKnownVariable): New interface.
6904 (LocalInfo): Implement it.
6905 (ToplevelParameterInfo): New class.
6906 (ExplicitBlock.AddKnownVariable): Use IKnownVariable.
6907 (ExplicitBlock.GetKnownVariable): Likewise. Rename from
6908 GetKnownVariableInfo.
6910 2007-06-03 Raja R Harinath <harinath@gmail.com>
6912 Partly speed up CS0136 error checks.
6913 * statement.cs (ExplicitBlock.GetKnownVariableInfo): Remove
6914 'recurse' parameter.
6915 (Block.DoCheckError136): Only check errors in parameters. Move
6916 local variable checks ...
6917 (Block.AddVariable): ... here, and ...
6918 (ToplevelBlock.ResolveMeta): ... here.
6920 2007-06-02 Raja R Harinath <harinath@gmail.com>
6922 * statement.cs (Block.IsChildOf): Remove.
6924 * statement.cs (Statement.Clone): Move special case code ...
6925 (Block.CloneTo): ... here.
6927 2007-05-29 Raja R Harinath <rharinath@novell.com>
6929 * statement.cs (ToplevelBlock.container): Remove field. It's
6930 redundant with 'Parent'.
6931 (ToplevelBlock.ContainerBlock): Remove accessor.
6932 (ToplevelBlock..ctor): Update to changes. Register anonymous
6933 child with parent here, ...
6934 * cs-parser.jay (end_anonymous): ... not here. Don't modify
6936 (start_anonymous): Don't save current_block.
6937 (top_current_block): Remove.
6939 * statement.cs (Block.Flags): Remove IsExplicit and IsToplevel flags.
6940 (Block.Resolve): Update to changes.
6941 (Block..ctor): Move setting of "correct" 'Toplevel'
6942 and 'Explicit' fields to ...
6943 (ExplicitBlock..ctor, ToplevelBlock..ctor): ... here.
6945 2007-05-27 Raja R Harinath <harinath@gmail.com>
6948 * statement.cs (Block.Implicit): Remove.
6949 (Block): Update to changes.
6950 * flowanalysis.cs: Likewise.
6952 Mildly speed up CheckInvariantMeaningInBlock
6953 * statement.cs (ExplicitBlock.AddKnownVariable): Move here from Block.
6954 Recursively call AddKnownVariable to all enclosing blocks.
6955 (ExplicitBlock.GetKnownVariableInfo): Move here from Block.
6956 Remove recursive calls.
6957 (Block): Update to changes.
6959 New ExplicitBlock invariants
6960 * statement.cs (Block.Explicit): New field. It points to the
6961 immediately enclosing non-implicit block.
6962 (Block..ctor): Maintain the invariant.
6963 * cs-parser.jay: Take advantage of invariant.
6965 Introduce ExplicitBlock
6966 * statement.cs (ExplicitBlock): New.
6967 (ToplevelBlock): Derive from it.
6968 (Block.Flags.IsExplicit): Rename from '...Implicit' and invert
6970 (Block.Implicit): Update to changes.
6971 * cs-parser.jay: Update to changes.
6974 * codegen.cs (EmitContext.IsLastStatement): Remove.
6975 * statement.cs (Block.DoEmit): Update to changes.
6977 2007-05-25 Raja R Harinath <rharinath@novell.com>
6979 * cs-parser.jay: Use 'start_block' and 'end_block' rather than
6980 modifying current_block directly.
6982 2007-05-23 Scott Peterson <lunchtimemama@gmail.com>
6984 * class.cs: Implemented automatic properties (C# 3.0)
6985 Thanks to Marek for the help.
6987 2007-05-23 Raja R Harinath <rharinath@novell.com>
6989 * flowanalysis.cs (VariableInfo.SetAssigned): When noting a
6990 variable as assigned, note also that all its components are
6992 (MyBitVector.SetRange): New. Function to set multiple bits to true.
6994 2007-05-19 Marek Safar <marek.safar@gmail.com>
6996 * anonymous.cs, class.cs: Emit Compiler generated attribute when
6997 member is marked as compiler generated.
6999 * decl.cs (MemberCore): Refactored ModFlags into property.
7001 * modifiers.cs: Add new modifier (COMPILER_GENERATED).
7002 (Check): Check only accessibility modifiers.
7004 2007-05-18 Raja R Harinath <rharinath@novell.com>
7006 Track all assignable slots in one bit array
7007 * statement.cs (ToplevelBlock.ParameterMap): Convert into array.
7008 (ToplevelBlock.ResolveMeta): Don't create a VariableMap. Move
7009 logic from VariableMap constructor here. Use the same 'offset'
7010 variable that's later used for computing offsets of local
7012 * flowanalysis.cs (UsageVector.parameters): Remove.
7013 (UsageVector): Update to changes.
7014 (VariableMap): Remove.
7016 Avoid creating ParameterMap in every block
7017 * statement.cs (Block.ParameterMap): Move ...
7018 (ToplevelBlock.ParameterMap): ... here.
7019 (ToplevelBlock.ResolveMeta): Create VariableMap for parameters
7021 * flowanalysis.cs (FlowBranching.param_map): Remove.
7022 (FlowBranching.UsageVector): Update to changes.
7023 (FlowBranchingToplevel.CheckOutParameters): Likewise.
7025 * statement.cs (Block.CloneTo): Clone Toplevel field too.
7027 * expression.cs (ParameterReference): Distinguish between block
7028 where parameter was referenced and declared.
7030 2007-05-18 Marek Safar <marek.safar@gmail.com>
7032 * flowanalysis.cs, statement.cs: Put back improved error handling.
7034 2007-05-15 Scott Peterson <lunchtimemama@gmail.com>
7038 Imporved object and collection initialization (C# 3.0).
7040 2007-05-15 Marek Safar <marek.safar@gmail.com>
7042 A fix for bug #81380
7043 * expression.cs (Is.DoResolve): Only value types have constant `is'
7046 2007-05-15 Raja R Harinath <rharinath@novell.com>
7048 * statement.cs (ToplevelBlock.child): Remove.
7050 2007-05-15 Raja R Harinath <harinath@gmail.com>
7052 Rationalize ResolveMeta: refactoring
7053 (Block.ResolveMeta): Remove wrong or superfluous comments. Carve
7054 out constant handling code into ...
7055 (Block.DoResolveConstants): ... this.
7057 Rationalize ResolveMeta: kill local_map
7058 * statement.cs (Block.local_map, Block.LocalMap): Remove.
7059 (Block.AssignableSlots): New.
7060 (Block.ResolveMeta): Make protected. Don't create a VariableMap
7061 for locals -- move code from VariableMap here. Avoid unnecessary
7063 * flowanalysis.cs (FlowBranching.local_map): Remove.
7064 (FlowBranching..ctor): Use Block.AssignableSlots.
7065 (VariableMap): Remove unused constructors.
7067 2007-05-11 Raja R Harinath <rharinath@novell.com>
7069 * Makefile [PROFILE=net_2_0_bootstrap]: Add special-case rules.
7071 2007-05-11 Marek Safar <marek.safar@gmail.com>
7073 * typemanager.cs (IsFriendAssembly): Should not be called for building
7076 2007-05-09 Marek Safar <marek.safar@gmail.com>
7078 * literal.cs (NullConstant): Print null in all cases.
7080 * expression.cs (Binary.ResolveOperator): Implemented delegate
7081 comparison based on C# 2.0 changes.
7083 2007-04-28 Scott Peterson <lunchtimemama@gmail.com>
7085 This code is contributed under the MIT X11 license
7087 The following enables support for several C# 3.0 language features:
7089 * cs-tokenizer.cs: Added support for the "var" keyword.
7091 * ecore.cs: Refactored TypeLookupExpression.DoResolveAsTypeStep().
7092 Added VarExpr class to facilitate type inferencing.
7094 * class.cs: Added IDictionary field AnonymousTypes to TypeContainer
7095 to support anonymous types.
7097 * assign.cs: Added support for type inferencing and initialization.
7099 * anonymous.cs: Added AnonymousClass class to enable anonymous types.
7101 * expression.cs: Added implicit array support to ArrayCreation.
7102 Added 5 types and 1 interface:
7104 IInitializable Implementing classes can inject initializing
7105 statements after object instantiation.
7107 Initializer Stores data for object initialization.
7109 AnonymousType An expression for anonymous types.
7111 AnonymousTypeParameter Stores data about an anonymous type's field.
7113 NewInitialize An expression for object initialization.
7115 CollectionInitialize An expression for collection initialization.
7117 * statement.cs: Added "var" keyword support to the foreach, using, and fixed
7120 2007-05-06 Marek Safar <marek.safar@gmail.com>
7122 A fix for bug #81500
7123 * cs-tokenizer.cs: Add special handling for coalescing operator.
7125 2007-05-06 Marek Safar <marek.safar@gmail.com>
7127 A fix for bug #81529
7128 * attribute.cs (GetAttributeUsage): AttributeUsage attribute inherits
7129 its value from base class until it is redefined.
7131 2007-05-02 Raja R Harinath <rharinath@novell.com>
7133 Fix regression in cs0631-3.cs
7134 * cs-parser.jay (operator_declarator): Add opt_attributes to error
7135 fallback. Make error fallback catch more cases.
7137 2007-05-01 Miguel de Icaza <miguel@novell.com>
7139 * cs-parser.jay: Allow parameters in operator declarations to have
7142 2007-04-27 Miguel de Icaza <miguel@novell.com>
7144 * statement.cs (If.CloneTo): Only clone the FalseStatement if it
7147 * lambda.cs (ContextualReturn.Resolve): An expression is valid
7148 inside the ContextualReturn, it does not have to be an
7149 ExpressionStatement.
7151 2007-04-24 Miguel de Icaza <miguel@novell.com>
7153 * lambda.cs (ContextualReturn.Resolve): if the return type is not
7156 2007-04-23 Miguel de Icaza <miguel@novell.com>
7158 * anonymous.cs (AnonymousContainer): split the virtual Resolve
7159 method in two methods: ResolveNoDefine and Resolve.
7161 ResolveNoDefine will stop just after ResolveTopBlock has been
7164 Resolve will then continue by creating a method and issuing the
7165 call to method.Define ().
7167 (AnonymousMethod): Split and implement the new Resolve and
7168 ResolveNoDefine as well.
7170 * lambda.cs (LambdaExpression): Split the anonymous method
7171 resolution code into a separate routine (CoreCompatibilityTest)
7172 from DoCompatibleTest.
7174 (LambdaExpression.TryBuild): New method, this method tries to
7175 build the LambdaExpression with the given set of types to be used
7176 as the types for the various parameters of the lambda expression.
7178 If the compilation succeed with the given types, the infered type
7179 of the Anonymous method is returned, otherwise null is returned.
7181 2007-04-23 Marek Safar <marek.safar@gmail.com>
7183 A fix for bug #81414
7184 * delegate.cs: Better fix, moved ApplyAttributes from Define to Emit.
7186 2007-04-22 Miguel de Icaza <miguel@novell.com>
7188 * cs-tokenizer.cs: Change various identifiers here from the
7189 camelCasing to the recommended Linux-like style for instance
7190 variables from the Coding Guidelines.
7192 2007-04-19 Martin Baulig <martin@ximian.com>
7195 (Convert.ImplicitReferenceConversionCore): Allow conversions from
7196 System.Enum to System.ValueType.
7198 2007-04-13 Martin Baulig <martin@ximian.com>
7200 Rewrote implicit reference conversions. We need to distinguish
7201 between implicit reference conversions (13.1.4) and implicit
7202 boxing conversions (13.1.5).
7204 According to the spec, there's an an implicit conversion
7205 "From a one-dimensional array-type S[] to IList<T> and base
7206 interfaces of this interface, provided there is an implicit
7207 reference conversion from S to T." Note that this does not
7208 include boxing conversions.
7211 (Convert.ImplicitTypeParameterBoxingConversion): New method.
7212 (Convert.ImplicitReferenceConversion): Split into
7213 ImplicitReferenceConversionCore() and
7214 ImplicitBoxingConversionExist().
7215 (Convert.ImplicitReferenceConversionExists): Use the new
7216 ImplicitReferenceConversionCore() and ImplicitBoxingConversionExists().
7218 2007-04-12 Martin Baulig <martin@ximian.com>
7220 * convert.cs (Convert.ImplicitReferenceConversion): Move the
7221 `TypeManager.null_type' checks up to the top of the method.
7223 2007-04-11 Marek Safar <marek.safar@gmail.com>
7225 A fix for bug #81350
7226 * class.cs, decl.cs, ecore.cs, namespace.cs: The optimization for private
7229 2007-04-11 Martin Baulig <martin@ximian.com>
7231 * statement.cs (Foreach.CollectionForeach.ProbeCollectionType):
7232 Use `TypeManager.GetInterfaces(t)' rather than `t.GetInterfaces()'
7233 to make this work for generic classes; fixes #79561.
7235 2007-04-11 Martin Baulig <martin@ximian.com>
7237 * expression.cs (As): Add support for nullable types; fixes #79371.
7239 2007-04-11 Martin Baulig <martin@ximian.com>
7241 * doc.cs (DocUtil.GetSignatureForDoc): Don't crash if
7242 `type.FullName' is null; fixes #80243.
7244 2007-04-11 Martin Baulig <martin@ximian.com>
7246 * expression.cs (Invocation.IsApplicable): Don't modify the method
7247 if type inference succeeded, but the method was not applicable.
7250 2007-04-10 Marek Safar <marek.safar@gmail.com>
7252 A fix for bug #81324
7253 * namespace.cs (Namespace.LookupExtensionMethod): Always inspect both
7254 internal and external namespaces containers.
7256 2007-04-10 Martin Baulig <martin@ximian.com>
7258 * delegate.cs (DelegateCreation.ResolveMethodGroupExpr): Use
7259 TypeManager.DropGenericMethodArguments() so we also call
7260 IMethodData.SetMemberIsUsed() for generic methods. Fixes #80357.
7262 2007-04-10 Martin Baulig <martin@ximian.com>
7264 * iterators.cs (Iterator.CreateIterator): Don't crash if
7265 `method.ReturnType' is null. This happens if something went wrong
7266 while resolving that typ (we already reported an error in this case).
7268 2007-04-10 Martin Baulig <martin@ximian.com>
7270 * expression.cs (New.DoResolve): Don't call CheckComImport() on
7271 generic interfaces; report the CS0144 directly.
7273 2007-04-10 Martin Baulig <martin@ximian.com>
7275 * ecore.cs (MemberExpr.ResolveMemberExpr): If `left' is a
7276 `TypeExpr', call ResolveAsTypeTerminal() on it; fixes #81180.
7278 2007-04-10 Martin Baulig <martin@ximian.com>
7280 * expression.cs (New.DoEmitTypeParameter): Fix #81109.
7282 2007-04-09 Raja R Harinath <rharinath@novell.com>
7285 * flowanalysis.cs (UsageVector.MergeChild): Handle child.Block == null.
7286 * statement.cs: Use KillFlowBranching only in ResolveUnreachable.
7289 * statement.cs (For.Resolve): If resolution fails, use
7292 2007-04-08 Marek Safar <marek.safar@gmail.com>
7294 * anonymous.cs (MakeName): Make faster and zero-based.
7295 (VerifyExplicitParameterCompatibility): Back to mode where generic
7296 parameter is ignored.
7297 (AnonymousMethodMethod.Emit): Decorate method as compiler generated.
7299 * class.cs (EmitType): Method can emit another new method.
7301 * cs-tokenizer.cs (IsLinqEnabled): Fixes static cctor race.
7303 * driver.cs: Updated.
7305 * lambda.cs: Reuse predefined empty parameters.
7307 * parameter.cs: Updated
7309 * support.cs: Implemented InflateTypes.
7311 * typemanager.cs (GetFullName): Don't use FullName as it can be null.
7312 (InitSystemCore): Introduced to isolate 3.0 dependencies.
7314 2007-04-03 Martin Baulig <martin@ximian.com>
7318 * statement.cs (Foreach.CollectionForeach.TryType): Use a custom
7319 version of TypeManager.IsOverride() which also works with generic
7322 2007-04-03 Martin Baulig <martin@ximian.com>
7327 (Convert.ExplicitReferenceConversion): We need to cast when
7328 converting from IList<T> to S[].
7330 2007-04-01 Marek Safar <marek.safar@gmail.com>
7332 * decl.cs (FindExtensionMethods): Consider all candidates with same name
7335 * expression.cs (MemberAccess.DoResolve): Cache resolved expression.
7337 2007-03-31 Marek Safar <marek.safar@gmail.com>
7339 * anonymous.cs (AnonymousMethodExpression.Compatible): Handles both
7340 argument and return type inferring.
7342 * codegen.cs (InferReturnType): Flag whether return can be inferred.
7343 (ReturnType): Turned to property.
7345 * statement.cs (Return): Implemented return type inferring.
7347 * support.cs (ReflectionParameters): Use local types if possible.
7349 2007-03-30 Raja R Harinath <rharinath@novell.com>
7351 * flowanalysis.cs (FlowBranching.Reachability): Remove.
7352 (FlowBranching.UsageVector): Update to changes.
7354 Prepare to kill 'Reachability'
7355 * flowanalysis.cs (UsageVector): Remove 'Reachability' from
7356 argument of constructor.
7358 2007-03-29 Raja R Harinath <rharinath@novell.com>
7360 Prepare to kill 'Reachability'
7361 * flowanalysis.cs (UsageVector.is_unreachable): New.
7362 (UsageVector): Update to maintain 'is_unreachable' in parallel to
7363 'reachability', and verify they're consistent.
7366 * expression.cs (New.EmitStatement): Handle type parameters here too.
7368 2007-03-29 Martin Baulig <martin@ximian.com>
7373 (ScopeInfo.ctor): Use `Modifiers.PUBLIC' if we're a nested
7374 CompilerGeneratedClass.
7375 (ScopeInfo.EmitScopeInstance): Make this protected.
7376 (CapturedVariable.EmitInstance): Use `Ldarg_0' if
7377 `ec.CurrentAnonymousMethod.Scope == Scope'.
7379 * statement.cs (Block.ScopeInfo): Make this a property.
7381 2007-03-27 Raja R Harinath <harinath@gmail.com>
7383 Prepare to kill 'Reachability'
7384 * flowanalysis.cs (FlowBranching.Reachability): Make class private.
7385 (FlowBranching.UsageVector.Reachability): Remove property.
7386 (FlowBranching.UsageVector.IsUnreachable): New property.
7387 (FlowBranching.UsageVector.ResetBarrier): New.
7388 (FlowBranching.UsageVector, FlowBranchingLabeled): Update to changes.
7389 * codegen.cs, statement.cs: Update to changes.
7391 2007-03-27 Martin Baulig <martin@ximian.com>
7396 (DeclSpace.LookupNestedTypeInHierarchy): Correctly handle nested
7399 2007-03-26 Raja R Harinath <rharinath@novell.com>
7401 * flowanalysis.cs (FlowBranching.Reachability): Use a boolean
7402 instead of TriState. Remove all mention of TriState.
7404 * flowanalysis.cs (FlowBranching.Reachability): Prepare to be
7405 replaced by a boolean. Add boolean 'is_unreachable' field, check
7406 and maintain invariants.
7408 2007-03-25 Marek Safar <marek.safar@gmail.com>
7410 * anonymous.cs: Restored checks disabled for uninflated anonymous methods.
7412 2007-03-25 Marek Safar <marek.safar@gmail.com>
7414 * expression.cs: Stop using obsolete 2.0 opcodes.
7416 2007-03-25 Marek Safar <marek.safar@gmail.com>
7418 * enum.cs (EnumMember.Define): Fixed regression and slowdown caused by
7419 one of the latests Martin's fixes.
7421 2007-03-23 Miguel de Icaza <miguel@novell.com>
7423 * expression.cs: On BigEndian systems, swap the bytes, temporary
7424 solution until we get a new bitconverter class.
7426 2007-03-23 Martin Baulig <martin@ximian.com>
7430 * decl.cs (MemberCache.AddMembers): Add generic methods both as
7431 "Method" and "Method`1". Normally, a cache lookup is done on the
7432 "Method" form (ie. without the generic arity), but this one makes
7433 lookups on the full form work as well.
7435 2007-03-22 Raja R Harinath <rharinath@novell.com>
7437 * flowanalysis.cs (Reachability): Reorganize slightly, and remove
7440 2007-03-20 Bill Holmes <billholmes54@gmail.com>
7442 Added 2 MemberCoreArrayList objects, ordered_explicit_member_list and
7443 ordered_member_list, to TypeBuilder to store members to be defined
7444 in the order they were parsed in.
7445 - ordered_explicit_member_list contains all properties indexers
7446 and methods that are defined as explicit implementation of an
7447 interface or base class.
7448 - ordered_member_list contains all properties indexers and methods
7449 that are not defined as explicit implementation of an interface
7452 Removed MethodArrayList and IndexerArrayList from TypeBuilder. The
7453 functionality in these removed classes has been replaced with
7454 ComputeIndexerName, EmitIndexerName, HasEqualss, HasGetHashCode, and
7455 CheckEqualsAndGetHashCode members defined and called in the TypeBuilderClass.
7457 Adding CheckForDuplications to PropertyBase.PropertyMethod and calls
7458 to CheckForDuplications inside GetMethod and SetMethod Define Method
7459 to handle method property and indexer name conflicts.
7463 All code is contributed under the MIT/X11 license.
7465 2007-03-20 Martin Baulig <martin@ximian.com>
7467 * class.cs (TypeContainer.Interfaces): Removed; they're now
7468 included in `TypeContainer.Types'.
7470 2007-03-20 Martin Baulig <martin@ximian.com>
7472 Fix #77963, #80314 and #81019. Added gtest-317, ..., gtest-320.
7474 * class.cs (TypeContainer.CreateType): New public method. This is
7475 now called before DefineType() to create the TypeBuilders.
7476 (TypeContainer.DefineType): Don't create the TypeBuilder here; it
7477 has already been created by CreateType().
7478 (TypeContainer.DefineTypeBuilder): Renamed into CreateTypeBuilder();
7479 don't resolve our base classes here; this has been moved into
7480 DefineBaseTypes(). We're now called from CreateType().
7481 (TypeContainer.DefineBaseTypes): New private method; resolve our
7482 base classes here. We're now called from DefineType().
7485 (RootContext.ResolveTree): Call TypeContainer.CreateType() on all
7486 our types first to create all the TypeBuilders. After that, call
7487 TypeContainer.DefineType() on all the types which'll resolve their
7488 base classes and setup the resolve order.
7490 2007-03-20 Martin Baulig <martin@ximian.com>
7492 * class.cs (TypeContainer.Enums): Removed; they're now included in
7493 `TypeContainer.Types'.
7495 2007-03-20 Martin Baulig <martin@ximian.com>
7498 (TypeContainer.DefineType): Don't call ResolveMembers() here.
7499 (TypeContainer.DoResolveMembers): Call DefineType() on our
7500 `compiler_generated' classes; moved here from DefineNestedTypes().
7503 (RootContext.ResolveTree): Call ResolveMembers() on all
7504 TypeContainer's in the `type_container_resolve_order'.
7506 2007-03-19 Marek Safar <marek.safar@gmail.com>
7508 * class.cs: Use corlib to handle InternalMethodImplAttribute.
7510 2007-03-17 Marek Safar <marek.safar@gmail.com>
7512 * class.cs (EventFieldAccessor.EmitMethod): Don't override existing
7513 implementation flags.
7515 2007-03-17 Marek Safar <marek.safar@gmail.com>
7517 * class.cs: More optimizations for type parameters.
7519 2007-03-15 Marek Safar <marek.safar@gmail.com>
7521 * anonymous.cs (AnomymousMethod): Can be now hosted in generic container.
7523 * ecore.cs, parameter.cs: More common code for both corlibs.
7525 * typemanager.cs (IsGenericMethod): Simplified.
7527 2007-03-15 Raja R Harinath <rharinath@novell.com>
7529 * flowanalysis.cs (FlowBranching.Reachability): Remove handling of
7531 * statement.cs, iterators.cs, lambda.cs: Update to changes.
7533 * statement.cs (Lock.Resolve): Invoke 'ec.NeedReturnLabel'
7534 unconditionally. Simplify explanation.
7535 (Try.Resolve, Using.Resolve): Likewise.
7537 2007-03-15 Martin Baulig <martin@ximian.com>
7541 * decl.cs (DeclSpace): If we're a partial class, use our
7542 `PartialContainer's `TypeParameters' and `CurrentTypeParameters'.
7544 2007-03-15 Raja R Harinath <rharinath@novell.com>
7546 * flowanalysis.cs (FlowBranching.Reachability): Remove handling of
7548 (FlowBranching.UsageVector): Update to changes.
7549 (FlowBranching.MergeSiblings): Likewise.
7550 * statement.cs: Likewise.
7552 2007-03-15 Martin Baulig <martin@ximian.com>
7557 (MemberCache): Added a special .ctor for type parameters.
7560 (TypeManager.MemberLookup_FindMembers): `TypeParameter' now has a
7563 2007-03-09 Martin Baulig <martin@ximian.com>
7565 * enum.cs (Enum): Make this a TypeContainer.
7566 (EnumMember): Derive from `Const'.
7569 (Const.DoResolveValue): New protected virtual method; move most of
7570 the functionality of ResolveValue() here so we can override it in
7572 (Const.CreateConstantReference): Make this virtual.
7574 * class.cs (Kind): Add `Kind.Enum'.
7575 (TypeContainer.Emit): Don't emit the enums here; they're already
7576 in the `RootContext.typecontainer_resolve_order'.
7578 * rootcontext.cs (RootContext.EmitCode): Don't emit the enums
7579 here; they're already in the `typecontainer_resolve_order'.
7581 * ecore.cs (EnumConstant.ConvertImplicitly): Add
7582 TypeManager.DropGenericTypeArguments().
7585 (TypeManager.CSharpEnumValue): Add DropGenericTypeArguments().
7586 (TypeManager.IsEnumType): Likewise.
7587 (TypeManager.EnumToUnderlying): Likewise.
7588 (TypeManager.IsEqual): Add support for enums.
7590 2007-03-12 Raja R Harinath <rharinath@novell.com>
7592 * typemanager.cs (InitCoreTypes) [NET_2_0]: Allow
7593 DefaultParameterValueAttribute to be undefined, say if System.dll
7596 2007-03-11 Marek Safar <marek.safar@gmail.com>
7598 * ecore.cs, parameter.cs, typemanager.cs: Another gmcs fix to work with
7601 2007-03-10 Marek Safar <marek.safar@gmail.com>
7603 * class.cs, parameter.cs: Unified parameters verification.
7605 2007-03-08 Martin Baulig <martin@ximian.com>
7607 * cs-parser.jay (constructor_header): Pass the location to the
7608 newly created TopLevelBlock.
7610 2007-03-07 Martin Baulig <martin@ximian.com>
7612 * statement.cs (Block.Resolve): Don't crash on error; bug #80715.
7614 2007-03-06 Miguel de Icaza <miguel@novell.com>
7616 * convert.cs (ExplicitReferenceConversionExists): Sync this method
7617 with the changes from David, fixes the build.
7619 2007-03-05 David Mitchell <dmitchell@logos.com>
7621 * convert.cs: Implement From System.Collecitons.Generic.IList<T>
7622 and its base interfaces to a one-dimensional array type S[],
7623 provided there is an implicit or explicit reference conversion
7626 2007-03-03 Marek Safar <marek.safar@gmail.com>
7628 * cs-tokenizer.cs: Implemented basic linq grammar.
7630 * driver.cs: Set linq lang version on demand.
7632 2007-02-26 Marek Safar <marek.safar@gmail.com>
7634 * cs-parser.jay, expression.cs: Compile empty __arglist correctly.
7636 2007-02-25 Marek Safar <marek.safar@gmail.com>
7638 * attribute.cs: Replaced DefinePInvoke in favor of S.R.E implementation
7641 * class.cs (InterfaceMemberBase): Share common `extern' modifier checks
7643 Check property and event extern attributes.
7645 * codegen.cs (ModuleClass): HasDefaultCharSet when module defined global
7648 2007-02-24 Marek Safar <marek.safar@gmail.com>
7650 A fix for bug #80407
7651 * ecore.cs: Don't report ambiguity error when methods have same parent.
7653 2007-02-23 Marek Safar <marek.safar@gmail.com>
7655 A fix for bug #80878
7656 * class.cs, cs-parser.jay: Event property can host anonymous methods.
7658 2007-02-22 Marek Safar <marek.safar@gmail.com>
7660 * attribute.cs: Enable ExtensionAttribute presence test.
7662 2007-02-22 Marek Safar <marek.safar@gmail.com>
7664 * class.cs: Warn about missing GetHashCode only when Equals is override.
7666 * decl.cs: Check accessibility of type arguments.
7668 * typemanager.cs: Correctly report nullable array.
7670 2007-02-20 Marek Safar <marek.safar@gmail.com>
7672 * class.cs, report.cs: Capture more details when things go wrong.
7674 2007-02-20 Marek Safar <marek.safar@gmail.com>
7676 A fix for bug #80650
7677 * cs-parser.jay: Anonymous container starts at constructor declaration
7678 and not at block beginning because it has to be usable in constructor
7681 * statement.cs: Use context location and not block one for error reporting.
7683 2007-02-18 Marek Safar <marek.safar@gmail.com>
7685 A fix for bug #78712
7686 * class.cs.cs, decl.cs, ecore.cs: LookupAnyGeneric inspects nested types
7689 2007-02-18 Marek Safar <marek.safar@gmail.com>
7691 A fix for bug #80493 by Atsushi Enomoto
7692 * cs-parser.jay: Ignore invalid attribute target.
7694 2007-02-18 Marek Safar <marek.safar@gmail.com>
7696 * cs-tokenizer.cs: Ignore '\0' as white space character.
7698 2007-02-17 Miguel de Icaza <miguel@novell.com>
7700 * cs-parser.jay: Add support for lambda expressions to the mcs
7703 * lambda.cs: Only clone when we are probing, not on the final call
7704 (Compatible is the final call).
7706 * statement.cs (CloneContext): Introduce class to provide block
7707 remapping during clone.
7709 All statements Clone themselves now.
7711 (Clone): special handling for blocks, when we clone a block, we
7712 register the block inside this routine, as children of the block
7713 might trigger a lookup.
7715 * expression.cs: Add support for CloneContext in all expressions.
7717 2007-02-17 Marek Safar <marek.safar@gmail.com>
7719 A fix for bug #80493
7720 * statement.cs: Report ambiguous warning when interfaces are not related.
7722 2007-02-15 Marek Safar <marek.safar@gmail.com>
7724 C# 3.0 extension methods.
7726 * attribute.cs (Error_MisusedExtensionAttribute): Extension attribute
7727 cannot be used directly.
7729 * class.cs (Class.Emit): Emit extension attribute if any class method
7730 is extension method.
7731 (Method.Define): Add basic extension method validation conditions.
7732 (Method.Emit): Emit extension attribute for method.
7734 * codegen.cs (AssemblyClass): Emit extension attribute if at least one
7735 extension method exists. Currently we follow same approach as Microsoft
7736 does, emit even if a method or a class are private but this can change
7739 * cs-parser.jay: Add handling of `this' keyword in method parameters
7742 * decl.cs (DeclSpace.IsStaticClass): New property.
7743 (MemberCache.FindExtensionMethods): Looks for extension methods with
7744 defined name and extension type.
7746 * doc.cs: Updated after OverloadResolve changes.
7748 * driver.cs: Add new soft reference to System.Core.dll.
7750 * ecore.cs (MethodLookup): Can return only MethodGroupExpr.
7751 (ExtensionMethodGroupExpr): Represents group of extension methods.
7753 * expression.cs (Invocation): Moved methods BetterConversion, MoreSpecific,
7754 BetterFunction, IsOverride, IsAncestralType, OverloadResolve
7755 to MethodGroupExpr and made non-static for easier customization.
7756 (Invocation.DoResolve): Add extension method lookup when no standard
7758 (MemberAccess.DoResolve): Try extension methods if no member exists.
7760 * modifiers.cs: Add METHOD_EXTENSION modifier.
7762 * namespace.cs (RegisterExtensionMethodClass): Register class namespace
7763 as well as candidate extension type.
7764 (ComputeNamespaces): When assembly constains extension methods registers
7766 (Namespace.RegisterExternalExtensionMethodClass): Register type for later
7767 extension method lookup.
7768 (Namespace.LookupExtensionMethod): Looks for extension method in this
7770 (NamespaceEntry.LookupExtensionMethod): Does extension methods lookup to
7771 find a method which matches name and extensionType.
7773 * parameter.cs (Parameter): Add This modifer.
7774 (HasExtensionMethodModifier): New property.
7775 (Resolve): Add extension parameter check.
7776 (ModFlags): turned to property to exclude this modifier as it is not real
7778 (Parameters): Implemented ExtensionMethodType and HasExtensionMethodType.
7780 * support.cs (ParameterData): Add ExtensionMethodType.
7781 (ReflectionParameters): Implemented ExtensionMethodType interface property.
7783 * typemanager.cs: Add type and ctor extension attribute type.
7785 2007-02-15 Miguel de Icaza <miguel@novell.com>
7787 * report.cs (DisableErrors, EnableErrors): used to prevent error
7788 output when we are "trying" to compile various methods with
7791 * ecore.cs (Expression): Add Clone method that calls the virtual
7792 CloneTo method. The current CloneTo method in Expression throws
7793 an exception so we can track down all the places where this must
7794 be implemented (not using abstract, because that would be a lot of
7795 up-front-work before we can start testing the implementation
7798 Important: we only need Clone capabilities for expressions created
7799 by the parser, as the expressions we will be cloning are
7800 expressions in the pre-resolved state. This vastly simplifies
7803 (SimpleName): Add CloneTo that does nothing.
7804 (EmptyCast): Add CloneTo.
7806 * expression.cs (Binary): Implement CloneTo.
7807 (Invocation.IsApplicable): Store the current ec in
7808 EmitContext.TempEc and restore it on return. This is used so we
7809 do not have to sprinkle hundres of methods with an extra
7810 EmitContext, we know that the only user is the lambda expression
7811 ImplicitConversionExists code.
7813 (Argument): Add Cloning capabilities.
7814 (LocalVariableReference, ParenthesizedExpression, Unary, Probe,
7815 Cast, Conditional, ArrayCreation, InvocationOrCast, Invocation,
7816 ArglistAccess, ArgList, TypeOf, SizeOf, CheckedExpr,
7817 UnCheckedExpr, ElementAccess, BaseAccess, BaseIndexerAccess,
7818 IndexerAccess): Add Clone capability.
7820 (LocalVariableReference, This): TODO: needs cloned Block mapping.
7822 (Argument): Add cloning capability.
7824 * assign.cs (Assign): Implement CloneTo.
7826 * anonymous.cs (ImplicitStandardConversionExists): Make virtual.
7828 * lambda.cs (ImplicitStandardConversionExists): Implement lambda
7829 version by calling Convert with the EmitContext (that we are
7830 currently storing in ec, this is not great, but will do for now,
7831 to avoid passing EmitContext parameters to hundreds of functions
7832 that do not need them now).
7834 (SetExpression): Remove, it is not needed.
7836 (ContextualReturn): Implement CloneTo.
7838 * statement.cs (Statement): Implement cloning infrastructure,
7839 similar to expressions.
7841 (Block): Partial implementation of Clone for statements.
7843 (Return): Implement clone.
7845 * constant.cs (Constant.CloneTo): New method, does nothing.
7847 * codegen.cs (TempEc): Add a static EmitContext as a temporary
7848 solution, until we decide how to exactly do this.
7850 2007-02-14 Marek Safar <marek.safar@gmail.com>
7852 A fix for bug #80493
7853 * class.cs (FindOutBaseMethod): When the base accessor does not exist and
7854 a property is override we need to use second accessor.
7856 2007-02-13 Marek Safar <marek.safar@gmail.com>
7858 A fix for bug #80418
7859 * attribute.cs, class.cs: Use correct calling conventions for pinvoke
7862 2007-02-13 Marek Safar <marek.safar@gmail.com>
7864 Another fix for bug #80749
7865 * pending.cs: Abstract class has priority over interfaces.
7867 2007-02-13 Marek Safar <marek.safar@gmail.com>
7869 Another fix for bug #80749
7870 * pending.cs: Abstract class has priority over interfaces.
7872 2007-02-13 Marek Safar <marek.safar@gmail.com>
7874 Another fix for bug #80749
7875 * pending.cs: Abstract class has priority over interfaces.
7877 2007-02-13 Marek Safar <marek.safar@gmail.com>
7879 Another fix for bug #80749
7880 * pending.cs: Abstract class has priority over interfaces.
7882 2007-02-13 Marek Safar <marek.safar@gmail.com>
7884 * class.cs Better error message.
7886 * driver.cs: Add shorter versions of -optimize option.
7888 2007-02-13 Martin Baulig <martin@ximian.com>
7890 * class.cs (Constructor.Emit): Check the return value of
7891 ec.ResolveTopBlock() and return on error.
7893 2007-02-13 Raja R Harinath <rharinath@novell.com>
7895 * ecore.cs (Error_InvalidExpressionStatement): Add a comma to error
7896 message to fix error message regression.
7898 2007-02-12 Marek Safar <marek.safar@gmail.com>
7900 * delegate.cs: Delegate creation expression cannot be of Nullable type.
7902 2007-02-12 Marek Safar <marek.safar@gmail.com>
7904 A fix for bug #80749
7905 * assign.cs (FieldInitializer): FieldInitializer has to keep track of
7906 its parent container.
7908 * class.cs (DefineFieldInitializers): Each initializer can has different
7911 * const.cs: Updated.
7913 2007-02-11 Miguel de Icaza <miguel@novell.com>
7915 * lambda.cs (LambdaExpression.Compatible): Remove some early code,
7916 now all the heavy lifting to check that embedded statements or
7917 expressions have the right form is done in the ContextualReturn.
7919 (ContextualReturn): New class.
7921 * ecore.cs (Error_InvalidExpressionStatement): Make a helper
7922 method that can be invoked to report 201, so we do not replicate
7925 * cs-parser.jay: Reuse Error_InvalidExpressionStatement.
7927 * cs-tokenizer.cs (xtoken): Correctly compute the column, it was
7928 treating tabs as spaces.
7930 2007-02-09 Marek Safar <marek.safar@gmail.com>
7932 A fix for bug #80315 by martin.voelkle@gmail.com (Martin Voelkle)
7933 * assign.cs: Use full implicit conversion for right side check.
7935 2007-02-09 Marek Safar <marek.safar@gmail.com>
7937 * statement.cs (Switch): Switch over boolean type is not standardized.
7939 2007-02-08 Marek Safar <marek.safar@gmail.com>
7941 A fix for bug #80755
7942 * decl.cs (FindBaseEvent): Don't use method cache for events.
7944 2007-02-07 Marek Safar <marek.safar@gmail.com>
7946 * cs-parser.jay: Better syntax error handling.
7948 * ecore.cs, enum.cs, statement.cs, typemanager.cs: Print enum member name
7949 instead of underlying type value.
7951 2007-02-06 Marek Safar <marek.safar@gmail.com>
7953 * driver.cs: Check define identifier before is registered.
7955 * namespace.cs: Use existing error message.
7957 * report.cs: New warning.
7959 2007-02-06 Marek Safar <marek.safar@gmail.com>
7961 A fix for bug #80742
7962 * expression.cs: Delegate Invoke method can be called directly.
7964 2007-02-06 Marek Safar <marek.safar@gmail.com>
7966 A fix for bug #80676
7967 * class.cs (IsEntryPoint): The Main method can have params modifier.
7969 2007-02-04 Miguel de Icaza <miguel@novell.com>
7971 * parameter.cs (Parameter, Parameters): Add Clone method.
7973 * anonymous.cs (Compatible): Turn method into virtual method, so
7974 LambdaExpression can implement a different behavior.
7976 (CompatibleChecks, VerifyExplicitParameterCompatibility): Factor
7977 out the basic checking here, so it can be used by
7980 * lambda.cs: Introduce "Compatible" function that will do the
7983 2007-02-02 Marek Safar <marek.safar@gmail.com>
7985 * attribute.cs: Unified one error message.
7987 * class.cs (Class): Use type attributes and not properties to test static
7989 (IsEntryPoint): Don's pass local variable.
7991 * convert.cs: Removed duplicate check.
7993 * decl.cs, doc.cs, ecore.cs (LookupType): Renamed to LookupNamespaceOrType.
7995 * driver.cs: Don't crash when soft reference does not exist.
7997 * namespace.cs (EnsureNamespace): Renamed to RegisterNamespace.
7998 (UsingEntry): Removed redundant allocation.
8000 * parameter.cs: Add fast path for type parameters.
8002 * support.cs: Don't allocate attribute when it's not used.
8004 2007-01-30 Miguel de Icaza <miguel@novell.com>
8007 (AnonymousMethodExpression.ImplicitStandardConversionExists): turn
8008 this into a virtual method, so we can override it in LambdaExpression.
8010 * driver.cs: Improve diagnostics in case of failure.
8012 * cs-tokenizer.cs: Instead of trying to parse a type and a name,
8013 write a function that is slightly more complex and that parses:
8015 type identifier [, type identifier]* )
8017 The old function would return incorrectly a OPEN_PARENS_LAMBDA for
8020 (canEmpty ? i >= 0 : i > 0)
8022 2007-01-30 Raja R Harinath <rharinath@novell.com>
8024 * cs-tokenizer.cs (parse_namespace_or_typename): Don't throw an
8025 exception on possibly valid code.
8027 2007-01-29 Raja R Harinath <rharinath@novell.com>
8029 * cs-tokenizer.cs (is_punct) ['<']: Update to changes in
8031 (parse_opt_type_arguments): Remove. It's almost the same as
8033 (parse_namespace_or_typename): Use parse_less_than.
8035 2007-01-28 Miguel de Icaza <miguel@novell.com>
8037 * cs-tokenizer.cs: Typo fix, its not GMCS_SOURCES but GMCS_SOURCE,
8038 this bug took a few hours to find, because the state saved and
8039 restored by PushPosition and PopPosition was ignoring the state of
8040 parse_generic_less_than.
8042 I can also now remove the handling of OP_LT and OP_GT, this solves
8045 * cs-tokenizer.cs: store the location for the ARROW token, we use
8048 (PushPosition, PopPosition): save/restore also `current_token',
8049 restore `parse_generic_less_than' (was missing).
8051 (parse_opt_type_arguments): use parse_type, not
8052 parse_namespace_or_typename to parse types.
8054 * lambda.cs: Empty new file, will eventually have the lambda
8055 expression implementation.
8057 * lambda.test: used to test the internal tokenizer.
8059 * report.cs (FeatureIsNotISO1): Rename from
8060 FeatureIsNotStandardized, because it was about the language level
8061 (1 vs 2) it was not about standarization.
8063 (FeatureRequiresLINQ): New.
8065 * support.cs (SeekableStreamReader): Only require that the reader
8066 is a TextReader, not a StreamReader, so we can plug StringReader.
8068 * cs-tokenizer.cs (parse_type_and_parameter): Returns true if at a
8069 given position in the input stream the following tokens can be
8070 parsed as a type followed by an identifier.
8072 (is_punct): after a '(' if parse_type_and_parameter returns true,
8073 then return a special token OPEN_PARENS_LAMBDA which is used to
8074 avoid reduce/reduce errors in the grammar for the
8075 lambda_expression rules.
8077 (parse_type): implement a type parser inside the
8078 tokenizer, the parser only returns true or false depending on
8079 whether the input at a given position can be parsed as a type.
8081 (peek_token): new method used during type parsing.
8083 2007-01-28 Raja R Harinath <rharinath@novell.com>
8086 * anonymous.cs (ScopeInfo.InflateParameters): New.
8087 (AnonymousContainer.Resolve): Use it to redirect types of
8088 delegate parameters.
8090 2007-01-27 Raja R Harinath <rharinath@novell.com>
8093 * expression.cs (Error_InvalidArguments): Don't use two different
8094 messages for CS1503. Use ExtraInformation and
8095 SymbolRelatedToPreviousError instead.
8098 * decl.cs (DeclSpace.initialize_type_params): Don't access
8099 'type_params' of a partial class directly.
8101 2007-01-26 Miguel de Icaza <miguel@novell.com>
8103 * constant.cs: Removed a handful of out-of-range checks that were
8106 2007-01-25 Marek Safar <marek.safar@gmail.com>
8108 * expression.cs (CheckUselessComparison): Add additional check for char
8111 * namespace.cs: Fixed typo.
8113 2007-01-23 Miguel de Icaza <miguel@novell.com>
8115 * constant.cs: Bloat removal, CheckRange and CheckUnsigned are
8116 gone, instead we inline the test, preventing the needless casts to
8117 longs, ulongs and doubles for the parameters, avoiding calls to
8118 methods that overchecked stuff, and instead inlined things
8121 2007-01-20 Marek Safar <marek.safar@gmail.com>
8123 * cs-parser.jay: Better parameter error handling.
8125 2007-01-17 Marek Safar <marek.safar@gmail.com>
8127 A fix for bug #80368, #80522
8128 * expression.cs (ArrayCreation.only_constant_initializers): Indicates
8129 whether array initializer contains constants only.
8130 (ArrayCreation.Emit): Use better formula to decide when
8131 are array initializers for static initialization.
8132 (ArrayCreation.EmitDynamicInitializers): When the array is small enough we
8133 have to emit even constants otherwise they are pre-initialized.
8135 2007-01-17 Bill Holmes <bill.holmes@ansys.com>
8136 Raja R Harinath <rharinath@novell.com>
8138 Fix emit order of 'get' vs. 'set'.
8139 * support.cs (Accessors): New.
8140 * cs-parser.jay (accessor_declarations): Use it instead of 'Pair'.
8141 Note the order in which accessors are declared in the source.
8142 * class.cs (PropertyBase.DefineGet, PropertyBase.DefineSet): New.
8143 Refactored from Property.Define and Indexer.Define.
8144 (PropertyBase.DefineAccessors): New helper that calls the above in
8145 appropriate order as noted by the parser.
8146 (Property.Define, Indexer.Define): Update to changes.
8147 (PropertyBase.SetMethod.PropertyInfo): Don't return a null.
8149 2007-01-17 Raja R Harinath <rharinath@novell.com>
8151 Fix cs0029-6.cs and gcs0029-2.cs (regression)
8152 * ecore.cs (EmptyConstantCast.ConvertImplicitly): Check that
8153 there's an implicit conversion from the current type to the target
8154 type before converting the underlying constant.
8156 2007-01-16 Marek Safar <marek.safar@gmail.com>
8158 * const.cs (ResolveValue): Updated after constant conversion was made more
8161 * constant.cs (GetAttributableValue): constant to object conversion is
8162 used for attributes only.
8163 (IntConstant.ConvertImplicitly): Moved from convert to be used in all
8164 constant conversions.
8165 (LongConstant.ConvertImplicitly): Ditto.
8167 * convert.cs (ImplicitNumericConversion): Extracted constant bussiness.
8168 (ImplicitConversionStandard): Handle constant conversion as extra step.
8169 It solves the issue when constant conversion was called indirectly like
8170 inside array initializer and constant folding was skipped.
8172 * literal.cs (NullLiteral.ConvertImplicitly): Fixed an issue exposed by
8175 * statement.cs(ImplicitConversionStandard): Updated after constant
8176 conversion was made more generic.
8178 2007-01-16 Sergey P. Kondratyev <se@unicom.tomica.ru>
8180 * expression.cs (As.DoResolve): Use GenericConstraints instead of
8181 Constraints, solves the problem where the compiler incorrectly
8182 reported that a type parameter was not constrained to a class (Bug
8185 2007-01-14 Marek Habersack <grendello@gmail.com>
8187 * doc-bootstrap.cs: Fix a compilation problem in the bootstrap phase.
8189 2007-01-14 Marek Safar <marek.safar@gmail.com>
8191 A fix for bug #80368
8192 * assign.cs (FieldInitializer): New class implements field
8193 initializer statement.
8195 * attribute.cs: Update after FieldMember rename.
8197 * class.cs (PropertyBasedMember): New common class for property based
8199 (InterfaceMemberBase): New base class for all members which can be used as
8200 an interface members.
8201 (MethodCore): Moved really common code to InterfaceMemberBase.
8202 (Method.Define): Equal and GetHasCode detection is relevant for methods
8204 (MethodData.Define): Don't assume that public event implements an
8205 interface automatically.
8206 (MethodData.DefineMethodBuilder): Issue an error even if only extern
8208 (MemberBase): Moved all interface speficic code to InterfaceMemberBase.
8209 (FieldMember): Merged with FieldBase.
8210 (EventProperty.AEventPropertyAccessor): New specialization to check whether
8211 event extern modifier can be used.
8212 (EventField.EventFieldAccessor): Moved event field specific code here.
8213 (Event.AllowedModifiers): Even event can be extern.
8214 (Event.FindOutBaseMethod): New override specific to events.
8215 (Indexer.parameters): Reintroduce parameters because base class holds
8216 only properties common data.
8217 (Indexer.CheckForDuplications): Indexers are threated as methods so we
8218 need do extra parameters check.
8220 * const.cs: Update after FieldMember rename.
8222 * decl.cs (MemberCache.FindBaseEvent): New method.
8224 * doc.cs (GetMethodDocCommentName): Accept parameters as extra argument
8225 to reflect that indexer is now derived from PropertyBased.
8227 * ecore.cs (GetMemberType): Made public.
8228 (EventExpr.ResolveMemberAccess): Use right event cache and checks for
8231 * flowanalysis.cs, statement.cs: Update after FieldMember rename.
8233 * typemanager.cs (CSharpSignature): Correctly print event accessors.
8234 (RegisterEvent): Removed.
8235 (RegisterPrivateFieldOfEvent): Renamed to RegisterEventField.
8236 (GetPrivateFieldOfEvent): Renamed to GetEventField.
8238 2007-01-11 Raja R Harinath <rharinath@novell.com>
8241 * statement.cs (CollectionForeach.TryType): Prefer generic
8242 GetEnumerator over non-generic variant. Fix code to follow comments.
8244 2007-01-09 Raja R Harinath <rharinath@novell.com>
8247 * support.cs (ReflectionParameter): Don't use an invalid index on
8248 the generic parameter data.
8250 2007-01-08 Miguel de Icaza <miguel@novell.com>
8252 * driver.cs: Just add a tiny bit of infrastructure.
8254 2007-01-02 Marek Safar <marek.safar@gmail.com>
8256 * class.cs (VerifyMembers): Fixed an crash reported on mono mailing list
8257 where field type is struct from current assembly.
8259 * ecore.cs (EnumConstant.AsString): Report an enum member name whenever
8262 2007-01-02 Marek Safar <marek.safar@gmail.com>
8264 A fix for bug #80381
8265 * attribute.cs (AttributeTester.RegisterNonObsoleteType): Registers
8268 * namespace.cs (GlobalRootNamespace.LookupTypeReflection): Better error
8270 (Namespace.LookupType): Always use core types from corlib when speficied.
8272 * report.cs: A new warning.
8274 * rootcontext.cs (BootstrapCorlib_ResolveInterface,
8275 BootstrapCorlib_ResolveClass): Register type as non-obsolete type.
8276 (ResolveCore): Add missing System.Runtime.InteropServices._Attribute.
8278 * typemanager.cs (CoreLookupType): Register type as non-obsolete type.
8279 (InitCoreTypes): Set expression type of object_type and value_type
8280 immediately after lookup.
8282 2007-01-01 Miguel de Icaza <miguel@novell.com>
8284 * cs-tokenizer.cs: Accept Pc class characters (Connector
8285 Punctuation) as valid identifiers. Fixes #78259
8287 * expression.cs (Invocation.DoResolve): Moved the check for the
8288 use of `this' for doing method calls to the Invocation resolution
8289 step, after overload resolution has taken place instead of doing
8290 the check at the low-level `This.DoResolve' level.
8292 The `This.DoResolve'(appens before overload resolution, so it has
8293 no way of knowing if the method that will be called will be
8294 instace or static, triggering an erroneous report for cs0188 (Bug
8297 We now do the check for instance method invocations after we know
8298 what method will be called.
8300 (This.CheckThisUsage): Move the actual use of this structure
8301 checking into its own method and expose it.
8303 * Everywhere that called Error_ValueCannotBeConverted: pass a new
8306 Exceptions: Null.ConvertImplicitly,
8307 Constant.ImplicitConversionRequired as there are too many call
8308 sites for passing the ec.
8310 * ecore.cs (Expression.Error_ValueCannotBeConverted): Take an
8311 EmitContext, if the value is null, then we do not try to provide
8312 the extra information from the error (If a userdefined conversion
8313 exists, as UserDefinedConversion requires a non null-EmitContext).
8317 2006-12-30 Raja R Harinath <rharinath@novell.com>
8319 * flowanalysis.cs (MyBitVector): Document some invariants.
8320 (MyBitVector.Or, MyBitVector.And): Reimplement the optimizations
8321 introduced below, and add a couple of others,
8323 2006-12-30 Marek Safar <marek.safar@gmail.com>
8325 * attribute.cs (GetMethodObsoleteAttribute): Uses new
8326 GetPropertyFromAccessor and GetEventFromAccessor.
8328 * class.cs (MethodCore.CheckBase): A new warning when obsolete member
8329 overrides non-obsolete one.
8330 (Indexer.Define): Error message has been moved to the parser.
8332 * cs-parser.jay: Better syntax errors handling.
8334 * delegate.cs (NewDelegate.DoResolve): Issue less confusing error message
8335 when an invocation has no arguments.
8337 * ecore.cs: Removed not used caching.
8339 * expression.cs (IsSpecialMethodInvocation): Reuses TypeManager
8342 * report.cs: Add a new warning.
8344 * support.cs (ReflectionParameters): Implements Equals, GetHashCode.
8346 * typemanager.cs (enumeration_type): Removed.
8347 (CSharpSignature): Reuses IsSpecialMethod.
8348 (IsEqual): Hack for MS BCL.
8349 (GetPropertyFromAccessor): New method.
8350 (GetEventFromAccessor): New method.
8351 (IsSpecialMethod): Fixed to handle more cases.
8353 2006-12-30 Marek Safar <marek.safar@gmail.com>
8355 * cs-tokenizer.cs (PreProcessDefinition, handle_preprocessing_directive):
8356 Made white spaces array static.
8358 * ecore.cs (RemoveGenericArity): Optimized.
8360 * flowanalysis.cs (MyBitVector.Or, MyBitVector.And): Optimized (up to
8362 (MyBitVector.initialize_vector): Simplified.
8364 2006-12-22 Miguel de Icaza <miguel@novell.com>
8366 * ecore.cs: Am not entirely happy with this hack, but it seems to
8367 address the issue in 80257 (a small test case for
8370 I set the MethodGroupExpr.Type to an internal compiler type
8371 (itself in this case) to force the resolution to take place. Why
8372 it does not take place with a null is beyond me.
8374 2006-12-20 Marek Safar <marek.safar@gmail.com>
8376 A fix for bug #80288
8377 * expression.cs (ResolveOperator): Consider user defined conversion for
8378 logical and operator too.
8379 (EmitBranchable): Optimization for logical and when full constant folding
8380 could not be applied but one operand is constant.
8382 2006-12-19 Marek Safar <marek.safar@gmail.com>
8384 * class.cs (GetClassBases): Write 5 times every day, will never use
8385 FullName for error reporting.
8387 * decl.cs (AsAccessible, CheckAccessLevel): Always unpack arrays first.
8389 2006-12-19 Martin Baulig <martin@ximian.com>
8391 * statement.cs (LocalInfo.EmitSymbolInfo): New public method; emit
8392 the symbol file info here.
8394 2006-12-18 Marek Safar <marek.safar@gmail.com>
8396 * cs-tokenizer.cs (handle_preprocessing_directive): When previous section
8397 of `elseif' is taking then following sections are not taking.
8398 Fixes an issue reported on mono mailing list.
8400 2006-12-18 Marek Safar <marek.safar@gmail.com>
8402 A fix for bug #80300
8403 * cs-tokenizer.cs (PreProcessDefinition): Do no define/undefine when
8404 a caller is not taking.
8406 2006-12-18 Raja R Harinath <rharinath@novell.com>
8408 * anonymous.cs: Change several TypeContainer declarations to DeclSpace.
8409 (CompilerGeneratedClass): Use parent.PartialContainer unconditionally.
8410 (RootScopeInfo, AnonymousMethodMethod): Update to changes.
8411 * iterator.cs: Change several TypeContainer declarations to DeclSpace.
8412 * class.cs: Update to changes.
8414 2006-12-17 Marek Safar <marek.safar@gmail.com>
8416 A fix for bug #79934
8417 * anonymous.cs (CompilerGeneratedClass): Register class in a shared
8420 * class.cs (ResolveMembers): Register an iterator in current container and
8423 2006-12-16 Raja R Harinath <rharinath@novell.com>
8426 * expression.cs (VerifyArgumentsCompat): Allow zero arguments to
8427 satisfy a params annotated parameter.
8429 2006-12-16 Marek Safar <marek.safar@gmail.com>
8431 A fix for bug #77014
8432 * expression.cs (Invocation.BetterFunction): Fixed to cope with dynamic
8433 paramters correctly and not rely on hacks in Parameters class.
8434 (Invocation.IsParamsMethodApplicable): Changed to accept params parameter
8436 (Invocation.VerifyArgumentsCompat): Ditto.
8437 (Invocation.EmitArguments): Changed to correctly emit params arguments at
8440 * parameter.cs (HasParams): Don't assume that params is the last one.
8442 * support.cs (ReflectionParameters.ctor): Look for params attribute
8444 (ReflectionParameters.ParameterType): Removed hack when we returned last
8445 parameter for out of range parameters.
8446 (ParameterName, ParameterModifier): Ditto.
8448 2006-12-14 Marek Safar <marek.safar@gmail.com>
8450 A fix for bug #79987
8451 * decl.cs (DeclSpace.VerifyClsCompliance): External names cache is null
8452 when assembly is not CLS compliant but type is. I have no idea why is this
8455 * typemanager.cs (Reset): Invalidate AllClsTopLevelTypes cache.
8457 2006-12-13 Miguel de Icaza <miguel@novell.com>
8459 * class.cs (ConstructorInitializer.Resolve): Allow for ":this()"
8460 in struct constructors, they are basically no-ops.
8462 2006-12-12 Marek Safar <marek.safar@gmail.com>
8464 * cs-tokenizer.cs (Position): Save preprocessor status too.
8466 2006-12-12 Marek Safar <marek.safar@gmail.com>
8468 A fix for bug #77794
8469 * cs-tokenizer.cs (consume_identifier): Check for correct partial context.
8471 2006-12-12 Marek Safar <marek.safar@gmail.com>
8473 * cs-tokenizer.cs (get_cmd_arg): Support CR as the line terminator.
8475 (pp_expr): Report error for an invalid expression.
8476 (handle_preprocessing_directive): Simplified; add more error checking.
8478 2006-12-11 Marek Safar <marek.safar@gmail.com>
8480 A fix for bug #74939
8481 * cs-tokenizer.cs (is_punct): We cannot simply disable preprocessor
8482 directives handling.
8484 2006-12-10 Marek Safar <marek.safar@gmail.com>
8486 A fix for bugs #80093, and #75984
8487 * cs-tokenizer.cs (handle_preprocessing_directive): Fixed #if/#else/#endif
8488 logic, it seems to me as it worked before "by coincidence".
8489 (xtoken): Simplified to use reworked handle_preprocessing_directive.
8490 (cleanup): Enabled endif check.
8492 2006-12-09 Marek Safar <marek.safar@gmail.com>
8494 A fix for bug #80162
8495 * statement.cs (CollectionForeach.TryType): Generics and non-generics
8496 enumerators are never ambiguous.
8498 2006-12-08 Raja R Harinath <rharinath@novell.com>
8501 * cs-tokenizer.cs (parse_less_than): Recognize double-colons too.
8503 2006-12-06 Marek Safar <marek.safar@gmail.com>
8505 A fix for bug #80144
8506 * class.cs (EventProperty.Define): Explicit implementation means
8507 that an even is used.
8509 2006-12-06 Marek Safar <marek.safar@gmail.com>
8511 Fixes the operators implementation (part II)
8513 * cfold.cs (DoConstantNumericPromotions): Renamed to
8514 DoBinaryNumericPromotions and simplified.
8515 (BinaryFold): Couple of conversion fixes; simplified.
8517 * constant.cs, ecore.cs, literal.cs
8518 (ToType): Renamed to ConvertImplicitly.
8519 (Reduce): Renamed to ConvertExplicitly.
8521 * class.cs, convert.cs: Updated.
8523 * expression.cs: TryReduce doesn't throw an exception.
8525 2006-12-01 Marek Safar <marek.safar@gmail.com>
8527 A fix for bug #80108
8528 * ecore.cs (EventExpr.EmitAddOrRemove): Don't crash when right side is not
8531 2006-11-30 Marek Safar <marek.safar@gmail.com>
8533 Fixes unary operators implementation (part I)
8536 * cfold.cs (Error_CompileTimeOverflow): Made internal
8538 * const.cs (IConstant): Changed to use reference to constant and
8539 not constant itself.
8540 Updated IConstant implementations.
8542 * constant.cs (CreateConstant): New factory method.
8543 Updated IConstant implementation.
8545 * convert.cs (ImplicitStandardConversionExists): Uses compiler Equals.
8547 * ecore.cs: Updated to use CreateConstantReference.
8549 * enum.cs: Reflects IConstant changes.
8551 * expression.cs (Unary): Reimplemented +,-,~ to conform C# standard.
8553 * literal.cs (NullConstant): Change to be independently usable.
8555 2006-11-29 Martin Baulig <martin@ximian.com>
8557 * class.cs (Constructor.Emit): Correctly handle anonymous methods;
8558 we need to emit the scope initializer before calling the base .ctor.
8560 * anonymous.cs: Merged back from the new anonymous methods branch.
8561 (AnonymousMethodHost): Renamed to `RootScopeInfo'.
8563 * expression.cs (ParameterReference.DoResolveBase): Create a
8564 "normal" ScopeInfo when capturing parameters rather than using the
8565 root scope; this makes things work with anonymous methods having
8569 (ToplevelBlock.AnonymousMethodHost): Renamed into `RootScope'.
8571 2006-11-22 Marek Safar <marek.safar@gmail.com>
8573 A fix for bug #79987
8574 * class.cs (VerifyClsCompliance): Move redundant CLS compliance attribute
8575 check to a base class.
8576 * decl.cs (VerifyClsCompliance): Warn that CLS compliance cannot be tested
8577 only when assembly has missing attribute.
8578 * report.cs: Update.
8580 2006-11-21 Marek Safar <marek.safar@gmail.com>
8582 * cs-tokenizer.cs: Merged with gmcs version.
8584 2006-11-20 Marek Safar <marek.safar@gmail.com>
8587 * cs-parser.jay: Better error message when partial keyword is misplaced.
8589 2006-11-19 Gert Driesen <drieseng@users.sourceforge.net>
8591 A fix for bug #79810
8592 report.cs: CS1058 only applies to 2.0 profile (gmcs).
8593 codegen.cs: on 2.0 profile, non-exception throwables are wrapped in
8594 a RuntimeWrappedException by default.
8596 2006-11-18 Marek Safar <marek.safar@gmail.com>
8598 A fix for bug #79843
8599 * delegate.cs (Delegate.VerifyMethod): Fixed covariance and contravariance
8601 (DelegateCreation.Error_NoMatchingMethodForDelegate): Ditto.
8603 2006-11-18 Marek Safar <marek.safar@gmail.com>
8605 * driver.cs, namespace.cs: Uses faster IndexOf version.
8607 2006-11-17 Marek Safar <marek.safar@gmail.com>
8609 A fix for bug #79941
8610 * class.cs (MemberCore.IsDuplicateImplementation): Add more tricks for
8612 (Operator.Define): Implicit/Explicit operator of same type is duplicate
8613 even if internal name is different.
8614 * convert.cs (GetConversionOperator): Replaced EmitContext with parentType.
8615 (UserDefinedConversion): Simplified as the operators cannot be internal.
8616 * ecore.cs (Error_ValueCannotBeConverted): Take account of user
8618 (MethodLookup): Replaced EmitContext with parentType.
8619 * expression.cs: Updated.
8621 2006-11-09 Raja R Harinath <rharinath@novell.com>
8623 * driver.cs (BadAssembly): Handle all the ugliness of
8624 DefineDynamicAssembly.
8626 2006-11-08 Raja R Harinath <rharinath@novell.com>
8628 Address parts of #58244 -- most of what's left is in the runtime
8629 * driver.cs (LoadAssembly): Simplify slightly. Add CS0009 and
8630 CS1509 error checks, and handle them for all assembly loads, not
8631 just the first invocation.
8632 (LoadModule): Likewise. Move handling of 'adder_method' ...
8633 * codegen.cs (AssemblyClass.AddModule): ... here.
8635 2006-11-02 Marek Safar <marek.safar@gmail.com>
8637 * statement.cs.cs (CollectionForeach.TryType): Issue a error when
8638 IEnumerable<T> is ambiguous.
8640 2006-10-31 Marek Safar <marek.safar@gmail.com>
8642 A fix for bug #67689
8643 * statement.cs.cs (CollectionForeach.TryType): Issue a warning when
8644 GetEnumerator is ambiguous.
8646 * report.cs: Add new warning.
8648 2006-10-29 Marek Safar <marek.safar@gmail.com>
8650 A fix for bug #78602
8651 ecore.cs (PropertyExpr.InstanceResolve): The qualifier for access
8652 to protected member can be nested type.
8654 2006-10-28 Marek Safar <marek.safar@gmail.com>
8656 A fix for bug #78965
8657 ecore.cs (PropertyExpr.InstanceResolve): The qualifier for access
8658 to protected member must derive from current type.
8660 2006-10-27 Marek Safar <marek.safar@gmail.com>
8662 assign.cs: Reuses error method.
8664 ecore.cs (Expression.Error_ValueCannotBeConverted): Report a value
8665 instead of type for constants.
8666 (Expression.Error_ValueAssignment): Common error method.
8668 * expression.cs (UnaryMutator.ResolveOperator): Value cannot be used
8671 2006-10-27 Marek Safar <marek.safar@gmail.com>
8673 A fix for bug #79081
8674 * expression.cs (MemberAccess.DoResolve): Check nested type
8677 2006-10-27 Atsushi Enomoto <atsushi@ximian.com>
8679 * doc.cs : nested delegates were not handled. Fixed bug #79754.
8681 2006-10-26 Marek Safar <marek.safar@gmail.com>
8683 A fix for bug #76591
8684 * cs-tokenizer.cs (IsCastToken): Enable a cast of anonymous method.
8686 2006-10-26 Marek Safar <marek.safar@gmail.com>
8688 * codegen.cs (AssemblyClass.ApplyAttributeBuilder): Don't allow to have
8689 type forwarder of the same type multiple times.
8691 2006-10-26 Raja R Harinath <rharinath@novell.com>
8694 * ecore.cs (PropertyExpr.InstanceResolve): Always resolve the
8695 instance as an rvalue, even when we later resolve as an lvalue.
8697 2006-10-25 Martin Baulig <martin@ximian.com>
8699 * anonymous.cs: Fix #79673.
8701 2006-10-24 Marek Safar <marek.safar@seznam.cz>
8703 A fix for bug #79666
8704 expression.cs (ArrayCreation.GetAttributableValue): An initializer can be
8705 ignored when is optimized (= default value) as its value is already set.
8707 2006-10-23 Marek Safar <marek.safar@seznam.cz>
8709 A fix for bug #79724
8710 * report.cs (SymbolRelatedToPreviousError): Uses DeclSpace instead of
8711 TypeContainer for type lookup.
8713 2006-10-23 Marek Safar <marek.safar@seznam.cz>
8715 A fix for bug #79231
8716 * ecore.cs (ResolveAsBaseTerminal): Removed redundant error test.
8717 * expression.cs (OverloadResolve): Always convert type name for
8719 (ResolveNamespaceOrType): Don't confuse a nested type with any
8722 2006-10-18 Martin Baulig <martin@ximian.com>
8724 * anonymous.cs: Propagate the IsStatic state, fixes the crasher in banshee.
8726 2006-10-17 Miguel de Icaza <miguel@novell.com>
8728 * convert.cs: Fix typo, fixes the test-535.cs, we were casting to
8729 an int32, but requesting an int64 from the conversion
8731 2006-10-12 Martin Baulig <martin@ximian.com>
8734 (AnonymousContainer.Resolve): Inflate the `ReturnType'. Fixes #79592.
8736 2006-10-12 Martin Baulig <martin@ximian.com>
8739 (Using.EmitLocalVariableDeclFinally): Small fix for iterators.
8741 2006-10-11 Miguel de Icaza <miguel@novell.com>
8743 * convert.cs: Remove broken code: I was doing the "Existance"
8744 tests for Implicit conversions.
8746 2006-10-10 Miguel de Icaza <miguel@novell.com>
8748 * convert.cs: Added one missing case in
8749 ImplicitStandardConversionExists uint64 to intptr.
8753 * typemanager.cs (uintptr_type): another core known type.
8755 * ecore.cs (OperatorCast): routine used to do cast operations that
8756 depend on op_Explicit. We could change some of the Decimal
8757 conversions to use this.
8759 This one has a probe mechanism that checks both types for an op_
8760 which it coudl be used to eliminate two classes: CastToDecimal
8761 and CastFromDecimal.
8763 * convert.cs: Implement the conversions documented in #59800
8765 2006-10-10 Martin Baulig <martin@ximian.com>
8767 * iterators.cs (Iterator.Resolve): Call RootScope.ResolveType()
8768 before RootScope.ResolveMembers().
8770 * anonymous.cs (ScopeInfo.CapturedScope.ctor): Use the child's
8771 `CurrentType' if appropriate.
8773 2006-10-09 Marek Safar <marek.safar@seznam.cz>
8775 A fix for bug #78568
8776 * cs-tokenizer.cs (Deambiguate_CloseParens): Expression cannot be cast
8777 when contains binary operators.
8778 * cs-parser.jay: Updated.
8780 2006-10-09 Martin Baulig <martin@ximian.com>
8783 (Delegate.DefineType): Don't call TypeParameter.Resolve() here;
8784 moved that into Define() and also do the other type parameter
8785 checks there. Fixes #79094. Added gtest-292.cs.
8788 (ArrayCreation.EmitDynamicInitializers): Use `etype.IsValueType'
8789 since that doesn't include type parameters; don't use `Ldelema'
8790 for type parameters. Fixes #78980. Added gtest-293.cs.
8792 2006-10-08 Marek Safar <marek.safar@seznam.cz>
8795 * convert.cs (ExplicitReferenceConversion): Only enum to enum value
8796 conversion is allowed.
8798 2006-10-06 Marek Safar <marek.safar@seznam.cz>
8800 * ecore.cs (Expression.MemberLookup): Don't register any symbol for
8801 error reporting when no error occurs.
8803 2006-10-06 Marek Safar <marek.safar@seznam.cz>
8805 * cfold.cs (ConstantFold.BinaryFold): Report an error when the conversion
8808 2006-10-06 Raja R Harinath <rharinath@novell.com>
8811 * class.cs (DefineTypeBuilder): Check circular dependencies before
8812 setting the parent of the TypeBuilder.
8813 (CheckRecursiveDefinition): Don't use 'BaseType', since
8814 it may not be valid until after DefineTypeBuilder. Use
8815 'base_type' instead.
8817 2006-10-04 Martin Baulig <martin@ximian.com>
8819 Merged the Anonymous Methods patch.
8821 * anonymous.cs, iterators.cs: The new anonymous methods code.
8823 * statement.cs (Variable): New public abstract class.
8824 (LocalInfo.Variable): New public property.
8825 (LocalInfo.ResolveVariable): New public method.
8826 (Block.Flags): Add `IsIterator'.
8827 (Block.AddVariable): Improved the CS0136 check.
8828 (Block.AnonymousChildren): New public property.
8829 (Block.AddAnonymousChild): New public method.
8830 (ToplevelBlock): Update to use the new anonymous method framework.
8831 (ToplevelBlock.ctor): `container' is now a `Block' and not a
8832 `ToplevelBlock'; this is required to correctly implement the
8834 (Fixed, Using): Use `TemporaryVariable' instead of directly
8835 creating the `LocalBuilder'.
8837 * parameter.cs (Parameter.ResolveVariable): New public method.
8838 (Parameters.ResolveVariable): Likewise.
8840 * ecore.cs (TemporaryVariable): Use the new `Variable' framework.
8842 * class.cs (TypeContainer): Replaced the `iterators' list and
8843 corresponding methods with a list of `CompilerGeneratedClass'es.
8844 (TypeContainer.ResolveMembers): New public method.
8845 (Method): `IIteratorContainer' has been replaced by
8848 * expression.cs (VariableReference): New public abstract base
8849 class for `LocalVariableReference', `ParameterReference' and
8852 * codegen.cs (EmitContext): Removed `capture_context',
8853 `HaveCaptureInfo', `EmitScopeInitFromBlock()' and `Capture*()'.
8854 (EmitContext.EmitThis): Removed.
8856 * cs-parser.jay: Replace `iterator_container' with
8859 2006-10-04 Martin Baulig <martin@ximian.com>
8861 * generic.cs (GenericMethod): Don't make this abstract.
8862 (Constraints.Clone): Added dummy implementation.
8864 2006-10-04 Raja R Harinath <harinath@gmail.com>
8867 * namespace.cs (LookForAnyGenericType): Avoid nullref on
8868 'declspaces'. Avoid allocating arrays willy-nilly.
8871 * cfold.cs (BinaryFold): Move boolean Equality and Inequality
8872 cases out of the switch.
8874 2006-09-28 Marek Safar <marek.safar@seznam.cz>
8876 * namespace.cs (Namespace.Error_NamespaceDoesNotExist): Better error
8877 message when non-generic type is used with the type arguments.
8878 * expression.cs: Updated.
8880 2006-09-28 Raja R Harinath <rharinath@novell.com>
8883 * convert.cs (Convert.ImplicitStandardConversionExists): Avoid infloop.
8884 * expression.cs (EmptyExpression.Grab, EmptyExpression.Release):
8885 Change semantics slightly. Don't insist on having only one
8886 temporary EmptyExpression -- just throttle the creation of new ones.
8889 * ecore.cs (Expression.MemberLookup): Enable CS0229 errors for
8890 non-interfaces too. If no methods are found, don't try to create
8893 2006-09-28 Marek Safar <marek.safar@seznam.cz>
8895 * ecore.cs (ResolveAsTypeStep): Print better error when type can be
8898 * namespace.cs (Namespace.LookForAnyGenericType): New method to help
8899 us produce better error message.
8901 2006-09-27 Marek Safar <marek.safar@seznam.cz>
8903 * expression.cs (Binary.ResolveOperator): Warn about a side effect
8904 of the `|' operator.
8906 * report.cs: A new warning added.
8908 2006-09-27 Martin Baulig <martin@ximian.com>
8910 * generic.cs (GenericMethod): Don't make this abstract.
8912 2006-09-27 Martin Baulig <martin@ximian.com>
8915 (InternalErrorException): Added overloaded ctor taking a params array.
8917 2006-09-26 Marek Safar <marek.safar@seznam.cz>
8919 * class.cs, codegen.cs, const.cs, cs-tokenizer.cs, driver.cs, ecore.cs:
8920 Fixed the cases when same error was reported twice.
8922 * report.cs (SymbolRelatedToPreviousError): Simplified as all our messages
8923 now report symbol information.
8925 2006-09-25 Martin Baulig <martin@ximian.com>
8927 * class.cs: Completely unified with the gmcs version.
8929 2006-09-25 Martin Baulig <martin@ximian.com>
8931 * typemanager.cs (TypeManager.IsNullableType): New public function.
8932 (TypeManager.IsNullableTypeOf): Likewise.
8933 (TypeManager.IsNullableValueType): Likewise.
8935 * class.cs (MethodCore): Added the `GenericMethod' argument from
8936 gmcs and also unified all classes derived from `MethodCore' with gmcs.
8938 2006-09-24 Raja R Harinath <harinath@gmail.com>
8940 * convert.cs: Unify with gmcs version.
8942 2006-09-24 Marek Safar <marek.safar@seznam.cz>
8944 * decl.cs (DeclSpace.VerifyClsCompliance): When type has type parameters
8945 verify them as well.
8947 * report.cs: New warning.
8949 2006-09-24 Marek Safar <marek.safar@seznam.cz>
8951 * anonymous.cs (AnonymousMethod.Compatible): Cannot generate arguments
8952 for anonymous block with out argument.
8954 2006-09-24 Marek Safar <marek.safar@seznam.cz>
8956 * class.cs (ClassOrStruct.VerifyMembers): Fixed to report correctly
8957 not used private events only.
8959 2006-09-23 Marek Safar <marek.safar@seznam.cz>
8961 * cfold.cs (BinaryFold): On the guest to unify empty constant cast.
8963 * const.cs (Const.Define): Check for constant type.
8964 (Const.IsConstantTypeValid): Looks for valid constant types.
8966 * convert.cs (ImplicitReferenceConversion): NullCast to EmptyConstantCast.
8968 * ecore.cs (EmptyConstantCast): New common class for all constant based
8971 * expression.cs (Is.DoResolve): Handle null constant especially.
8972 (New.DoResolve): Check for new void().
8973 (MemberAccess.DoResolve): Cope with all kind of nulls.
8975 * literal.cs (NullConstant): Uses EmptyConstantCast.
8976 (NullDefault): Based on EmptyConstantCast.
8977 (NullLiteral): Uses EmptyConstantCast.
8979 * statement.cs (Block.ResolveMeta): Check for constant type.
8981 2006-09-22 Martin Baulig <martin@ximian.com>
8983 * delegate.cs, attribute.cs: Merged with the gmcs versions.
8985 2006-09-22 Raja R Harinath <rharinath@novell.com>
8987 * literal.cs (NullDefault): The type of default(IFoo) is 'IFoo',
8991 * typemanager.cs (Closure.Filter): Consider PrivateScope attributes.
8992 * decl.cs (DeclSpace.FindMemberToOverride): Likewise. Reorganize
8995 2006-09-22 Martin Baulig <martin@ximian.com>
8997 * ecore.cs: Merged with the gmcs version.
8999 * generic.cs (ConstructedType): New dummy class.
9000 (TypeArguments): Don't make this abstract.
9003 (TypeManager.IsGenericTypeDefinition): New method.
9004 (TypeManager.GetGenericFieldDefinition): Moved here from gmcs.
9006 2006-09-22 Raja R Harinath <rharinath@novell.com>
9008 * expression.cs (ComposedCast): Check for arrays of TypedReference
9009 before creating the type, not after.
9011 2006-09-21 Marek Safar <marek.safar@seznam.cz>
9013 * cfold.cs, const.cs, enum.cs, statement.cs: Updated
9014 after ToType change.
9016 * constant.cs (Constant.ImplicitConversionRequired): Designed to used
9017 when constant must be implicitly convertible.
9019 * convert.cs (ImplicitReferenceConversion): Reuse ToType.
9021 * ecore.cs (NullCast): Derives from NullConstant.
9023 * expression.cs (Is.DoResolve): Removed useless variables.
9024 (Conditional.DoResolve): Quick hack for `Foo () ? null : null'.
9025 (New.Constantify): Add enum support.
9026 (MemberAccess.DoResolve): Add warning when accessing null constant or
9029 * generic.cs (GenericConstraints.IsReferenceType): Another dummy
9032 * literal.cs (NullConstant): New abstract class with common
9033 functionality for all null specializations.
9034 (NullDefault): Represents default(X) when result can be
9036 (NullLiteral): Updated.
9038 * report.cs: Add new warning.
9040 2006-09-21 Martin Baulig <martin@ximian.com>
9042 * generic.cs (GenericTypeParameterBuilder): Removed this ugly hack.
9044 2006-09-21 Martin Baulig <martin@ximian.com>
9046 * generic.cs (GenericConstraints): New dummy class.
9047 (Constraints): Likewise.
9048 (TypeParameter): Likewise.
9049 (TypeParameterName): Likewise.
9050 (GenericMethod): Likewise.
9052 * typemanager.cs (TypeManager.GetGenericArguments): New method.
9054 * decl.cs: Merged with the gmcs version.
9056 2006-09-21 Raja R Harinath <rharinath@novell.com>
9058 * generic.cs (TypeParameter): Implement IMemberContainer.
9059 (GenericTypeParameterBuilder): New. An abominable repugnant hack.
9061 * rootcontext.cs: Unify with gmcs version.
9063 * report.cs: Unify with gmcs version.
9064 * typemanager.cs (AddTypeParameter, LookupTypeParameter): Move
9065 from gmcs/generics.cs.
9066 * generics.cs (TypeParameter): New dummy class.
9068 * support.cs: Unify with gmcs version.
9070 2006-09-20 Raja R Harinath <rharinath@novell.com>
9072 * ecore.cs (MethodGroupExpr.ResolveGeneric): New dummy method.
9073 * expression.cs (MemberAccess, BaseAccess): Remove GMCS_SOURCE #ifdef.
9075 * decl.cs (MemberName): Unify with gmcs, except for GetTypeExpression.
9076 * generic.cs (TypeArguments): New dummy class to help avoid #ifdefs.
9077 * mcs.exe.sources: Add generic.cs.
9079 * codegen.cs: Unify with gmcs version.
9081 * codegen.cs (IResolveContent.GenericDeclContainer): Copy from gmcs.
9082 (EmitContext): Add GenericDeclContainer implementation.
9083 * decl.cs (MemberCore, DeclSpace): Likewise.
9084 * namespace.cs: Remove #ifdef GMCS_SOURCE.
9086 * namespace.cs (GetTypeInAssembly): Remove #ifdef GMCS_SOURCE.
9087 MCS TypeManager has a corresponding dummy method.
9089 2006-09-19 Martin Baulig <martin@ximian.com>
9091 * expression.cs: Completely merged with the gmcs version.
9093 2006-09-19 Martin Baulig <martin@ximian.com>
9095 * expression.cs (Invocation): Merged with the gmcs version.
9096 (ArrayAccess.GetStoreOpcode): Likewise.
9098 2006-09-19 Martin Baulig <martin@ximian.com>
9101 (TypeManager.IsGenericMethod): Moved here from ../gmcs/generic.cs.
9102 (TypeManager.IsGenericMethodDefinition): Likewise.
9104 2006-09-19 Martin Baulig <martin@ximian.com>
9107 (TypeManager.IsEqual): Moved the gmcs implementation here.
9108 (TypeManager.DropGenericTypeArguments): Likewise.
9109 (TypeManager.DropGenericMethodArguments): Likewise.
9110 (TypeManager.GetTypeArguments): Moved here from gmcs.
9111 (TypeManager.HasGenericArguments): Likewise.
9113 2006-09-19 Martin Baulig <martin@ximian.com>
9115 * expression.cs (Binary): Merged with the gmcs version.
9117 2006-09-19 Martin Baulig <martin@ximian.com>
9119 * expression.cs (Probe, As, Is): Merged with the gmcs version.
9121 2006-09-19 Martin Baulig <martin@ximian.com>
9123 * typemanager.cs: Merged with the gmcs version.
9125 2006-09-16 Raja R Harinath <rharinath@novell.com>
9127 * AssemblyInfo.cs [GMCS_SOURCE]: Unify with gmcs source.
9128 * driver.cs: Likewise.
9130 2006-09-16 Marek Safar <marek.safar@seznam.cz>
9133 * class.cs (MethodCore.VerifyClsCompliance): Do check for abstract members
9134 only if parent type is class.
9135 * decl.cs (MemberCore.GetClsCompliantAttributeValue): Fixed missing cache
9138 2006-09-15 Marek Safar <marek.safar@seznam.cz>
9141 * expression.cs(MemberAccess.DoResolve): Don't crash when not allowed
9143 * typemanager.cs(CSharpName): Converts NullType to null.
9145 2006-09-15 Martin Baulig <martin@ximian.com>
9148 (TypeManager.GetMethodName): Added mcs implementation.
9149 (TypeManager.IsEqual): Likewise.
9152 (SimpleName.RemoveGenericArity): Added dummy implementation.
9154 * pending.cs: Merged with the gmcs version.
9156 2006-09-15 Martin Baulig <martin@ximian.com>
9158 * statement.cs: Merge with the gmcs version.
9160 2006-09-15 Martin Baulig <martin@ximian.com>
9162 * statement.cs (Switch): Merge with the gmcs implementation
9163 (without nullables), which is newer.
9165 2006-09-15 Martin Baulig <martin@ximian.com>
9167 * statement.cs (Block.Variables): Make this public.
9168 (ToplevelBlock.Parameters): Make this a property.
9169 (Throw.Resolve): Use `TypeManager.IsSubclassOf ()'.
9171 2006-09-15 Martin Baulig <martin@ximian.com>
9173 * namespace.cs: Merge with the gmcs version.
9175 2006-09-15 Martin Baulig <martin@ximian.com>
9177 * decl.cs (MemberName): Minor code cleanups.
9179 2006-09-15 Martin Baulig <martin@ximian.com>
9181 * parameter.cs: Merge with the gmcs version.
9183 2006-09-15 Martin Baulig <martin@ximian.com>
9185 * enum.cs: Merge with the gmcs version: 3005 is a warning in gmcs
9186 and an error in mcs.
9188 2006-09-15 Martin Baulig <martin@ximian.com>
9190 * flowanalysis.cs: Merged from GMCS; added the generics code into
9191 a `GMCS_SOURCE' conditional so we can share this file.
9193 2006-09-08 Martin Baulig <martin@ximian.com>
9195 * typemanager.cs (TypeManager.interlocked_type): New public field.
9196 (TypeManager.int_interlocked_compare-exchange): New public field.
9197 (TypeManager.InitEnumUnderlyingTypes): Also initialize the
9198 enumerator types here and call InitGenericCoreTypes().
9199 (TypeManager.InitCoreTypes): Call InitEnumeratorTypes() right
9200 after calling InitEnumUnderlyingTypes().
9203 (RootContext.ResolveCore): Added `System.Threading.Interlocked' to
9204 `classes_second_stage'.
9206 2006-09-14 Marek Safar <marek.safar@seznam.cz>
9208 * assign.cs, ecore.cs, expression.cs: Share error message text.
9209 * class.cs (FieldMember.Define): Check for varible of static type.
9210 * driver.cs (LoadAssembly): Uses error output for errors.
9211 * statement.cs: Updated.
9213 2006-09-08 Marek Safar <marek.safar@seznam.cz>
9215 * expression.cs (Error_OperatorCannotBeApplied): Report type instead of
9218 2006-09-07 Martin Baulig <martin@ximian.com>
9221 (MainDriver): Revert r62663 from Marek; see #70506 for details.
9223 2006-08-29 Miguel de Icaza <miguel@novell.com>
9225 * cs-parser.jay: Turn 1522 into a warning, instead of an error #79210
9227 2006-08-17 Miguel de Icaza <miguel@novell.com>
9229 * cs-tokenizer.cs: Apply patch from Atsushi Enomoto that fixes
9230 #52019 and #79064, the use of the \uXXXX sequence in source code
9231 to represent unicode characters.
9233 2006-08-15 Marek Safar <marek.safar@seznam.cz>
9235 * expression.cs (SizeOf.DoResolve): Check for void type. Fixed enum types
9237 * class.cs, ecore.cs, statement.cs: Merged to one error message.
9239 2006-08-13 Miguel de Icaza <miguel@novell.com>
9241 * assign.cs: Catch attempts to assign to a method groups in += and
9244 2006-08-13 Marek Safar <marek.safar@seznam.cz>
9247 * cs-parser.jay: Don't destroy current array type by typeof of array's.
9249 2006-08-12 Marek Safar <marek.safar@seznam.cz>
9251 * class.cs (Method.Define): Issue a warning when generic method looks like
9253 * decl.cs (MemberCore.GetSignatureForError): Print member type arguments
9256 2006-08-09 Marek Safar <marek.safar@seznam.cz>
9258 * anonymous.cs(AnonymousDelegate.Emit): Uses Constructor filter when
9260 * decl.cs (MemberCache.FindMembers): When container is interface we need to
9261 search all base interfaces as a member can be ambiguous.
9262 * delegate.cs (Delegate.FindMembers): Fixed to return valid data for
9263 Constructor member type filter.
9264 (Delegate.ResolveConstructorMethod) Uses Constructor filter.
9265 * ecore.cs: (Expression.MemberLookup): Implemented ambiguity error/warning
9266 reporting for returned memberinfos.
9267 * report.cs: Updated.
9268 * typemanager.cs (TypeManager.LookupBaseInterfacesCache): Uses TypeManager
9269 version to work on all runtimes.
9270 (TypeManager.RealMemberLookup): Removed members filtering.
9272 2006-08-08 Raja R Harinath <rharinath@novell.com>
9274 * ecore.cs (FieldExpr.EmitAssign): Release temporary.
9275 (PropertyExpr.EmitAssign): Likewise.
9276 * expression.cs (Indirection.EmitAssign): Likewise.
9277 (LocalVariableReference.EmitAssign): Likewise.
9278 (ParameterReference.EmitAssign): Likewise.
9279 (Invocation.EmitArguments): Likewise.
9280 (ArrayAccess.EmitAssign): Likewise.
9281 (IndexerAccess.EmitAssign): Likewise.
9282 (This.EmitAssign): Likewise.
9283 (ConditionalLogicalOperator.Emit): Likewise.
9286 * codegen.cs (EmitContext.GetTemporaryLocal): Simplify. Use Stack
9287 instead of ArrayList. If the hashtable has a LocalBuilder, don't
9288 leave it in after returning it.
9289 (EmitContext.FreeTemporaryLocal): Simplify. Update to changes.
9291 2006-08-06 Marek Safar <marek.safar@seznam.cz>
9293 * expresssion.cs (IndexerAccess.DoResolve): Fixed to report correct error
9296 2006-08-03 Raja R Harinath <rharinath@novell.com>
9298 Fix cs0146-3.cs and cs0146-4.cs.
9299 * class.cs (TypeManager.CheckRecursiveDefinition): Check that
9300 enclosing types don't depend on the current type.
9302 2006-08-02 Raja R Harinath <rharinath@novell.com>
9305 * class.cs (TypeContainer.DoDefineMembers): Use
9306 FindBaseMemberWithSameName on Parent, since we're interested in
9307 whether we hide inherited members or not.
9308 (FindBaseMemberWithSameName): Make slightly more robust.
9310 Fix the non-generic testcase from #77396
9311 * decl.cs (DeclSpace.DeclContainer): Remove override.
9313 * namespace.cs (NamespaceEntry.Doppelganger): Create slave
9314 declspaces for doppelgangers too.
9315 (UsingEntry): Implement IResolveContext.
9316 (UsingEntry.Resolve): Don't set ToplevelTypes.Namespace. Use
9317 'this' as the resolve context.
9318 (LocalAliasEntry): Likewise.
9320 Implement parts of #77403
9321 * roottypes.cs (RootDeclSpace): New. Used to represent the
9322 toplevel declaration space. Each namespace declaration introduces
9323 a "partial" root declaretion space.
9324 * namespace.cs (NamespaceEntry.SlaveDeclSpace): New.
9325 (NamespaceEntry.ctor): Create a SlaveDeclSpace if necessary.
9326 * cs-parser.jay (CSharpParser.ctor): Initialize 'current_class'
9327 from 'current_namespace.SlaveDeclSpace'.
9328 (namespace_declaration): Likewise.
9329 * class.cs (TypeContainer.ctor): Remove parent==ToplevelTypes
9330 check. It can't happen now.
9331 * decl.cs (DeclSpace.LookupType): Likewise.
9332 * driver.cs (MainDriver): Sanity check.
9334 2006-08-01 Raja R Harinath <rharinath@novell.com>
9336 * decl.cs (DeclSpace.FindNestedType): Remove.
9337 (DeclSpace.LookupNestedTypeINHierarchy): Use PartialContainer and
9338 LookupTypeContainer to get the container of the nested type.
9339 * class.cs (TypeContainer.FindNestedType): Make non-override.
9341 2006-07-31 Raja R Harinath <rharinath@novell.com>
9343 * decl.cs (DeclSpace.PartialContainer): Move field from ...
9344 * class.cs (TypeContainer.PartialContainer): ... here.
9345 (TypeContainer.AddBasesForPart): New helper.
9346 (MemberBase.ParentContainer): Remove. Use Parent.PartialContainer
9348 * cs-parser.jay (current_class): Convert to DeclSpace.
9349 (struct_declaration, interface_declaration, class_declaration):
9350 Use AddBasesForPart instead of .Bases directly.
9351 * const.cs, iterators.cs: Update to changes.
9353 2006-07-28 Raja R Harinath <rharinath@novell.com>
9355 * class.cs (TypeContainer.AddMemberType): Rename from
9357 (TypeContainer.AddMember): Rename from AddToMemberContainer.
9358 (AddTypeContainer): New. Combine AddClassOrStruct and
9360 (AddPartial): Update. Add 'is_partial' argument.
9361 * roottypes.cs: Update to changes.
9362 * cs-parser.jay (push_current_class): New helper for handling
9363 current_container and current_class.
9364 (struct_declaration, interface_declaration, class_declaration):
9367 2006-07-26 Raja R Harinath <rharinath@novell.com>
9369 * roottypes.cs: Rename from tree.cs.
9371 Rename RootContext.Tree.Types to RootContext.ToplevelTypes.
9372 * tree.cs (Tree, ITreeDump): Remove types.
9373 * rootcontext.cs (tree, Tree): Remove fields.
9374 (root, ToplevelTypes): New.
9375 * *.cs: Update to rename.
9377 * tree.cs (Tree.RecordDecl): Remove.
9378 (RootTypes.AddToTypeContainer): Record the toplevel type in its
9380 * class.cs, cs-parser.jay: Remove mention of RecordDecl.
9382 2006-07-23 Raja R Harinath <harinath@gmail.com>
9384 * codegen.cs (EmitContext.Flags): Move InCatch, InFinally,
9385 DoFlowAnalysis and OmitStructFlowAnalysis here.
9386 (ec.With): Rename from WithUnsafe and generalize.
9387 (ec.WithCheckState): Remove. All users can be handled by 'With'.
9388 (ec.WithFlowAnalyis): New.
9389 * ecore.cs, expression.cs, statement.cs: Update.
9391 2006-07-22 Raja R Harinath <harinath@gmail.com>
9393 * statement.cs (Block.ResolveMeta): Simplify slightly.
9395 * codegen.cs (EmitContext.Flags): New enum. Used to represent the
9396 multiple boolean fields. Convert InUnsafe, constant_check_state,
9397 check_state to flags.
9398 (CheckState, ConstantCheckState): Update.
9399 (InUnsafe): New read-only property.
9400 (FlagsHandle): Rename from CheckStateHandle and convert to handle
9402 (WithUnsafe): New helper similar to WithCheckState.
9403 * statement.cs (Block.ResolveMeta): Use WithUnsafe.
9404 (Unsafe.Resolve, Unsafe.DoEmit): Likewise.
9406 2006-07-21 Raja R Harinath <rharinath@novell.com>
9408 Make comparisons use the same IL irrespective of whether they're
9409 in a 'checked' or 'unchecked' context: one of the issues in #78899
9410 * codegen.cs (EmitContext.CheckState): Make read-only property.
9411 (EmitContext.ConstantCheckState): Likewise.
9412 (EmitContext.CheckStateHandle, EmitContext.WithCheckState): New
9413 helper that implement a save/restore stack for CheckState
9414 values. This is the only way to change check-state.
9415 * ecore.cs (Expression.ExpressionToArrayArgument): Use WithCheckState.
9416 * expression.cs (CheckedExpr.DoResolve, CheckedExpr.Emit): Likewise.
9417 (CheckedExpr.EmitBranchable): New forwarding method.
9418 (UnCheckedExpr): Likewise.
9419 * statement.cs (Block.ResolveMeta): Use WithCheckState.
9420 (Unchecked.Resolve, Unchecked.DoEmit): Likewise.
9421 (Checked.Resolve, checked.DoEmit): Likewise.
9423 2006-07-20 Miguel de Icaza <miguel@novell.com>
9425 * anonymous.cs: Cache the resolved anonymous delegate, and return
9426 this so that the ResolveTopBlock is only triggered once, not
9429 Currently we trigger ResolvetopBlock twice due to a first pass of
9430 argument check compatibility, and a second pass that does the
9433 2006-07-15 Marek Safar <marek.safar@seznam.cz>
9435 * annonymous.cs (AnonymousMethod.CreateScopeType): Fixed nested type
9437 * rootcontext.cs (Reset): Add helper_classes.
9439 2006-07-15 Marek Safar <marek.safar@seznam.cz>
9442 * statement.cs (Switch.SimpleSwitchEmit): Handle case null at any position
9445 2006-07-13 Miguel de Icaza <miguel@novell.com>
9447 * statement.cs (Lock): Handle expressions of type
9448 TypeManager.null_type specially. Fixes #78770
9450 2006-07-08 Marek Safar <marek.safar@seznam.cz>
9452 * expression.cs (Binary.ResolveOperator): Don't crash when null is assigned
9455 2006-07-08 Marek Safar <marek.safar@seznam.cz>
9457 * attribute.cs (AttributeTester.GetMethodObsoleteAttribute): Fixed to look
9458 for accessors as well.
9459 * ecore.cs (EventExpr): Add AccessorTable.
9461 2006-07-01 Marek Safar <marek.safar@seznam.cz>
9464 * attribute.cs, class.cs, ecore.cs : Add missing location of related symbol
9465 for CS0122 where appropriate.
9466 * typemanager.cs (IsNestedChildOf): Type can be null in the case of top
9468 (Filter): Assembly can be null in the case of top level attributes.
9470 2006-06-25 Marek Safar <marek.safar@seznam.cz>
9474 * ecore.cs (Expression.MemberLookupFailed): Don't crash when failed lookup
9475 is done at global level.
9477 2006-06-24 Marek Safar <marek.safar@seznam.cz>
9479 A fix for #77002, Implemented TypeForwarder support.
9481 * attribute.cs (Attribute.GetArgumentType): Reads type argument.
9482 * expression.cs (TypeOf.TypeArgument): Exposes typeof type.
9483 * typemanager.cs (): Add type_forwarder_attr_type.
9485 2006-06-24 Marek Safar <marek.safar@seznam.cz>
9487 * report.cs: Add CS0469 warning.
9489 2006-06-21 Martin Baulig <martin@ximian.com>
9491 * codegen.cs (CodeGen.Save): Moved the symbol file generation into
9492 the `try'-block, so we also report CS0016 etc. there.
9494 2006-06-21 Martin Baulig <martin@ximian.com>
9497 (Delegate.VerifyMethod): Allow `params' methods; fixes #78678.
9499 2006-06-21 Martin Baulig <martin@ximian.com>
9501 * expression.cs (Unary.ResolveOperator): In `Operator.AddressOf',
9502 also report CS1686 for parameters.
9504 2006-06-21 Martin Baulig <martin@ximian.com>
9506 * statement.cs (GotoCase.Resolve): Report a warning (CS0469)
9507 instead of an error if the value is not implicitly convertible to
9508 the switch types; fixes #77964.
9510 2006-06-21 Raja R Harinath <rharinath@novell.com>
9513 * class.cs (FieldBase.ResolveInitializer): Stop resolution if
9514 FieldBuilder is null.
9517 * expression.cs (Binary.CheckShiftArguments): Don't overwrite original
9518 'left' and 'right' before error-checking.
9520 2006-06-16 Juraj Skripsky <js@hotfeet.ch>
9522 * ecore.cs (SimpleName.Error_ObjectRefRequired): Do not truncate the name.
9524 (MemberExpr.EmitInstance): Use GetSignatureForError () to get full name.
9525 (FieldExpr.DoResolve): likewise.
9526 (PropertyExpr.InstanceResolve): likewise.
9527 (EventExpr.InstanceResolve): likewise.
9529 2006-06-04 Marek Safar <marek.safar@seznam.cz>
9531 * parameter.cs (Parameter.ApplyAttributeBuilder): More DefaultValue
9532 attribute applicable tests for attribute argument.
9534 2006-06-02 Raja R Harinath <rharinath@novell.com>
9537 * expression.cs (Binary.DoNumericPromotions): Remove and rewrite.
9538 (Binary.OverloadResolve_PredefinedIntegral): New.
9539 (Binary.OverloadResolve_PredefinedFloating): New.
9540 (Binary.OverloadResolve_PredefinedString): New.
9541 (Binary.ResolveOperator): Use those instead of DoNumericPromotions.
9542 Follow the standard more closely, and treat numeric promotions in
9543 terms of overload resolution.
9544 (Binary.CheckShiftArguments): Simplify.
9546 2006-06-01 Raja R Harinath <rharinath@novell.com>
9548 * flowanalysis.cs (MyBitVector): Simplify representation.
9549 (MyBitVector.Clone): Avoid allocating BitArray.
9550 (MyBitVector.operator&): Rename from MyBitVector.And and make symmetric.
9551 (MyBitVector.operator|): Likewise, with MyBitVector.Or.
9552 (*): Update. Change all references to MyBitVector.And and
9553 MyBitVector.Or to &= and |=.
9555 2006-05-29 Raja R Harinath <rharinath@novell.com>
9558 * cs-parser.jay (formal_parameter_list): Extend the pattern below
9559 to param arguments too.
9561 2006-05-26 Miguel de Icaza <miguel@novell.com>
9563 * cs-parser.jay: Catch another parsing form for arglist being
9564 followed by other arguments. Fixes #78313.
9566 2006-05-24 Raja R Harinath <rharinath@novell.com>
9568 * flowanalysis.cs (FlowBranchingToplevel.AddReturnOrigin): Move
9569 checking of out parameters to ...
9570 (FlowBranchingToplevel.Merge): ... here.
9571 (FlowBranchingException.AddBreakOrigin): If 'finally_vector' is
9572 set, propagate the origin upward, and only complain if there was
9574 (FlowBranchingException.AddContinueOrigin): Likewise.
9575 (FlowBranchingException.AddReturnOrigin): Likewise.
9576 (FlowBranchingException.AddGotoOrigin): Likewise.
9578 2006-05-23 Raja R Harinath <rharinath@novell.com>
9580 * flowanalysis.cs (UsageVector.MergeOrigins): If an origin is
9581 unreachable, skip it.
9582 (FlowBranchingException.Merge): Always propagate jumps, even if
9583 the finally block renders subsequent code unreachable.
9585 2006-05-18 Raja R Harinath <rharinath@novell.com>
9588 * statement.cs (Goto.Resolve): Move responsibility for resolving
9589 'goto' to FlowBranching.AddGotoOrigin.
9590 (Goto.SetResolvedTarget): New. Callback to set the
9591 LabeledStatement that's the target of the goto.
9592 (Goto.DoEmit): Use Leave instead of Br when crossing an
9593 unwind-protect boundary.
9594 * flowanalysis.cs (FlowBranching.AddGotoOrigin): Rename from
9595 LookupLabel and adjust to new semantics.
9596 (FlowBranchingToplevel.AddGotoOrigin): Likewise.
9597 (FlowBranchingBlock.AddGotoOrigin): Likewise. Use
9598 Goto.SetResolvedTarget to update target.
9599 (FlowBranchingLabeled.AddGotoOrigin): Likewise.
9600 (FlowBranchingException.AddGotoOrigin): Rewrite to be similar to
9601 AddBreakOrigin & co. Delay propagation until ...
9602 (FlowBranchingException.Merge): ... this.
9604 * statement.cs (Block.Resolve): Always depend on flow-branching to
9605 determine unreachability. Kill workaround that originally emitted
9606 only one statement after an "unreachable" label (see infloop in
9609 Fix #77869, #76148, #77755, #75255 and a host of other bugs.
9610 This is still "wrong", but anything better would probably need a
9611 multi-pass algorithm.
9612 * flowanalysis.cs (FlowBranchingLabeled): Salt away a copy of the
9613 usage vector. Force current usage vector to be reachable, to
9614 optimistically signify backward jumps.
9615 (FlowBranchingLabeled.LookupLabel): Note if a backward jump is
9617 (FlowBranchingLabeled.Merge): New. If no backward jump was
9618 detected, return the original salted-away usage vector instead,
9619 updated with appropriate changes. Print unreachable warning if
9621 * statement.cs (Block.Resolve): Don't print unreachable warning on
9622 a labeled statement.
9624 2006-05-17 Gert Driesen <drieseng@users.sourceforge.net>
9626 * driver.cs: Pass filename without path to AssemblyBuilder's
9627 AddResourceFile. Fixes bug #78407.
9629 2006-05-17 Raja R Harinath <rharinath@novell.com>
9631 * statement.cs (LabeledStatement.Resolve): Move merging of origins ...
9632 * flowanalysis.cs (FlowBranchingLabeled): ... here.
9633 (FlowBranching.MergeChild): Overwrite
9634 reachability information from Labeled branchings too.
9636 2006-05-16 Raja R Harinath <rharinath@novell.com>
9638 * statement.cs (Goto.Resolve): Merge jump origins here ...
9639 * flowanalysis.cs (FlowBranching.Label): ... rather than here.
9641 * flowanalysis.cs (FlowBranching.LookupLabel): Move CS0159 check ...
9642 (FlowBranchingToplevel.LookupLabel): ... here. Add CS1632 check.
9643 (FlowBranchingGoto.LookupLabel): New. Handle back jumps.
9644 (FlowBranchingBlock.LookupLabel): Call LabeledStatement.AddReference
9646 * statement.cs (Goto.Resolve): ... not here.
9647 (Goto.Emit): Remove CS1632 check.
9649 2006-05-14 Marek Safar <marek.safar@seznam.cz>
9651 * ecore.cs (Expression.ResolveAsTypeTerminal): Fixed type in the obsolete
9654 2006-05-11 Raja R Harinath <rharinath@novell.com>
9656 * flowanalysis.cs (UsageVector.MergeJumpOrigins): Kill.
9657 (FlowBranchingBlock.Label): Use UsageVector.MergeOrigins.
9658 (FlowBranchingException.Label): Likewise.
9660 * flowanalysis.cs (MyBitVector.SetAll): New. Sets all bits to the
9662 (MyBitVector.Or): Use it to avoid losing information (Count).
9663 (FlowBranching.MergeOrigins): Likewise.
9665 * flowanalysis.cs (UsageVector.IsDirty): Remove.
9666 (UsageVector.Parameters, UsageVector.ParameterVector): Likewise.
9667 (UsageVector.Locals, UsageVector.LocalVector): Likewise.
9668 (UsageVector.ToString): Simplify.
9669 (UsageVector.MergeSiblings): Move here from ...
9670 (FlowBranching.Merge): ... here.
9671 (FlowBranchingToplevel.CheckOutParameters): Take an UsageVector,
9674 2006-05-10 Raja R Harinath <rharinath@novell.com>
9676 * flowanalysis.cs (UsageVector.MergeOrigins): Simplify, now that a
9677 null bitvector is treated as all-true.
9679 * flowanalysis.cs (MyBitVector.And, MyBitVector.Or): Make lazier.
9680 (MyBitVector): Rationalize invariants. 'vector != null' implies
9681 that we have our own copy of the bitvector. Otherwise,
9682 'InheritsFrom == null' implies all inherited bits are true.
9684 2006-05-09 Marek Safar <marek.safar@seznam.cz>
9686 * statement.cs (LocalInfo): Add IsConstant.
9687 (LocalInfo.DeclareLocal): Moved from EmitMeta and changed to don't emit
9688 local variable for constants.
9690 2006-05-09 Raja R Harinath <rharinath@novell.com>
9692 * flowanalysis.cs (MyBitVector.Empty): New.
9693 (MyBitVector): Don't allow InheritedFrom to be null.
9694 (MyBitVector.And, MyBitVector.Or): Treat 'null' as all-ones.
9695 (UsageVector, FlowBranching): Update to changes.
9697 * flowanalysis.cs (FlowBranching.InTryWithCatch): Don't terminate
9698 recursion. The 'Parent == null' condition isn't sufficient for
9700 (FlowBranching.AddBreakOrigin): Likewise.
9701 (FlowBranching.AddContinueOrigin): Likewise.
9702 (FlowBranching.AddReturnOrigin): Likewise.
9703 (FlowBranching.StealFinallyClauses): Likewise.
9704 (FlowBranching.MergeTopBlock): Move to FlowBranchingToplevel.
9705 (FlowBranching.CheckOutParameters): Likewise.
9706 (FlowBranchingToplevel): Terminate all the above recursions here.
9707 (FlowBranchingToplevel.End): Rename from MergeTopBlock.
9708 * codegen.cs (EmitContext.ResolveTopBlock): Update to changes.
9710 * flowanalysis.cs (BranchingType.Toplevel): New. Represents a
9712 (FlowBranchingToplevel): New. Empty for now.
9713 (FlowBranching.MergeTopBlock): Update.
9714 * codegen.cs (EmitContext.ResolveTopBlock): Create a Toplevel
9715 branching for the anonymous delegate.
9716 (EmitContext.StartFlowBranching): Add ToplevelBlock variant.
9718 * flowanalysis.cs (UsageVector.MergeOrigins): Reorganize.
9719 (UsageVector.MergeJumpOrigins): Don't ignore current reachability
9720 information at the start of the merge. Reorganize.
9722 2006-05-07 Marek Safar <marek.safar@seznam.cz>
9724 * class.cs (MethodData.Define): Method cannot implement interface accessor.
9726 2006-05-07 Marek Safar <marek.safar@seznam.cz>
9728 * expression.cs (QualifiedAliasMember.ResolveAsTypeStep): Pass location
9729 to newly introduced ctor.
9731 * namespace.cs (Namespace.Error_NamespaceDoesNotExist): Moved an error
9732 message to one place.
9733 (GlobalRootNamespace.Error_NamespaceDoesNotExist): Custom message for
9736 2006-05-07 Marek Safar <marek.safar@seznam.cz>
9738 * const.cs (Const.Error_ExpressionMustBeConstant): Better error message.
9740 * ecore.cs (Expression.ResolveAsConstant): Updated.
9742 * statement.cs (ResolveMeta): Updated.
9744 2006-05-06 Marek Safar <marek.safar@seznam.cz>
9746 * cs-parser.jay: __arglist cannot be used in initializer.
9748 2006-05-06 Marek Safar <marek.safar@seznam.cz>
9751 * namespace.cs (LocalAliasEntry.DoResolve): Don't allow to access nested
9754 2006-05-05 Raja R Harinath <rharinath@novell.com>
9756 * statement.cs (EmptyStatement.ResolveUnreachable): Override.
9757 (LabeledStatement): Add 'name' parameter.
9758 (LabeledStatement.Name, LabeledStatement.JumpOrigins): New.
9759 (Block.AddLabel): Update to changes.
9760 * cs-parser.jay (labeled_statement): Likewise.
9762 * flowanalysis.cs (BranchingType.Labeled): New.
9763 (UsageVector.MergeOrigins): Remove unused 'branching' argument.
9764 (FlowBranchingLabeled): New. Does nothing for now, but will
9765 eventually handle 'goto' flows.
9766 * codegen.cs (StartFlowBranching): Add new LabeledStatement variant.
9767 * statement.cs (LabeledStatement.Resolve): Create a FlowBranching
9768 that's terminated ...
9769 (Block.Resolve): ... here.
9771 * flowanalysis.cs (UsageVector.MergeFinally): Remove.
9772 (UsageVector.MergeFinallyOrigins): Likewise.
9773 (FlowBranching.InTryOrCatch): Likewise.
9774 (FlowBranching.AddFinallyVector): Likewise.
9775 (FlowBranchingException): Update to changes.
9778 * statement.cs (Return.Resolve): Move error checking to ...
9779 * flowbranching.cs (FlowBranching.AddReturnOrigin): ... this.
9780 (FlowBranchingException): Handle return origins like break and
9782 (FlowBranching.UsageVector.CheckOutParameters): Remove.
9784 2006-05-04 Marek Safar <marek.safar@seznam.cz>
9787 * class.cs (TypeContainer.FindMembers): Includes event method in the methods
9790 2006-05-04 Marek Safar <marek.safar@seznam.cz>
9793 * class.cs (MethodData.Define): Do public accessor check only when method
9794 implements an interface.
9796 2006-05-04 Raja R Harinath <rharinath@novell.com>
9798 Remove special handling of 'break'
9799 * flowanalysis.cs (Reachability): Remove all mention of 'breaks'.
9800 (Reachability.Meet): Simplify. Remove 'do_breaks' argument.
9801 (UsageVector.Break): Remove.
9802 (FlowBranching.Merge): Use 'Reachable.IsUnreachable' to determine
9804 (FlowBranchingBreakable.Merge): Don't ResetBreaks.
9806 * statement.cs (Break.Resolve): Call UsageVector.Goto (), not
9807 UsageVector.Breaks (). Don't set NeedsReturnLabel.
9809 2006-05-03 Marek Safar <marek.safar@seznam.cz>
9812 * pending.cs (PendingImplementation.BaseImplements): A found member cannot
9813 be the interface member.
9815 2006-05-03 Marek Safar <marek.safar@seznam.cz>
9818 * constant.cs (LongConstant.EmitLong): Fixed to catch also negative values
9819 for emitting small (int) values.
9821 2006-05-03 Raja R Harinath <rharinath@novell.com>
9824 * flowanalysis.cs (FlowBranchingException.Merge): Ensure
9825 control-flow passes through the 'finally' after merging-in all the
9826 control-flows from 'try' and the 'catch' clauses.
9828 * flowanalysis.cs (FlowBranching.IsLoop): Remove.
9829 (FlowBranching.IsTryOrCatch): Remove 'is_return' parameter. It's
9830 always true at the only non-recursive entry point.
9831 (FlowBranching.CreateBranching) [BranchingType.Loop]: Return a
9832 FlowBranchingBreakable.
9833 (FlowBranchingLoop): Remove.
9834 * statement.cs (Return.DoResolve): Update to changes.
9837 * flowanalysis.cs (FlowBranching.BranchingType.Embedded): New.
9838 (FlowBranching.CreateBranching): Handle it: create a
9839 FlowBranchingContinuable.
9840 (FlowBranching.BreakCrossesExceptionBoundary): Remove.
9841 (FlowBranching.AddContinueOrigin): Similar to AddBreakOrigin,
9842 except that it handles the 'continue' command.
9843 (FlowBranching.UsageVector.MergeOrigins): Rename from
9845 (FlowBranchingContinuable): Similar to FlowBranchingBreakable,
9846 except that it overrides AddContinueOrigin.
9847 (FlowBranchingException): Override AddContinueOrigin, similar to
9849 * statement.cs (While.Resolve, Foreach.ArrayForeach.Resolve):
9850 Create a new branching around the embedded statement.
9851 (Do.Resolve, For.Resolve): Likewise. Do reachability analysis for
9852 control flow after the embedded statement.
9853 (Continue.Resolve): Move all error checking to AddContinueOrigin.
9855 * flowanalysis.cs (FlowBranching.IsSwitch): Remove.
9856 (FlowBranching.CreateBranching) [BranchingType.Switch]: Create a
9857 FlowBranchingBreakable.
9858 (FlowBranchingSwitch): Remove.
9861 * statement.cs (Break.Resolve): Simplify. Move responsibility for
9862 error reporting to ...
9863 * flowanalysis.cs (FlowBranching.AddBreakOrigin) ... this.
9864 Rename from 'AddBreakVector'. Add new location argument. Return
9865 a bool indicating whether the 'break' crosses an unwind-protect.
9866 (FlowBranchingException.AddBreakOrigin): Add.
9867 (FlowBranchingException.Merge): Propagate 'break's to surrounding
9868 flowbranching after updating with the effects of the 'finally'
9870 (FlowBranchingBreakable): New common base class for
9871 FlowBranchingLoop and FlowBranchingSwitch.
9873 * statement.cs (Foreach.ArrayForeach.Resolve): Set barrier after
9875 (Foreach.CollectionForeach.Resolve): Remove extraneous flowbranching.
9877 2006-05-02 Raja R Harinath <rharinath@novell.com>
9879 * statement.cs (Do.Resolve): If the loop is infinite, set the
9881 (While.Resolve, For.Resolve): Set a barrier after the embedded
9882 statement. There's no direct control flow that goes from the end
9883 of the embedded statement to the end of the loop.
9884 * flowanalysis.cs (FlowBranching.Infinite): Remove.
9885 (FlowBranchingLoop.Merge): Don't look at 'Infinite'. The changes
9886 above ensure that the reachability is correctly computed.
9888 * flowanalysis.cs (Reachability.ResetBarrier): Remove.
9889 (UsageVector.MergeBreakOrigins): If the current path is
9890 unreachable, treat it as if all parameters/locals are initialized.
9891 (FlowBranchingLoop.Merge): Don't clear any barriers. Handle
9892 infinite loops before merging-in break origins.
9894 * flowanalysis.cs (Reachability.Meet): Simplify code handling 'returns'.
9895 (Reachability.Reachable): Split part into ...
9896 (Reachability.Unreachable): ... this. Simplify.
9897 (Reachability.IsUnreachable): Use 'Unreachable' instead.
9899 * flowanalysis.cs (Reachability.SetReturnsSometimes): Remove.
9900 (Reachability.SetThrowsSometimes): Likewise.
9901 (FlowBranchingBlock.MergeTopBlock): Don't compare against
9902 TriState.Always, use corresponding property.
9903 * statement.cs (Lock.Resolve, Try.Resolve, Using.Resolve): Likewise.
9904 (Block.Resolve): Likewise. Remove some redundant checks.
9906 2006-05-02 Raja R Harinath <harinath@gmail.com>
9908 * flowanalysis.cs (UsageVector.Throw): Set barrier too.
9909 (Reachability.Meet): Don't bother checking AlwaysThrows --
9910 barrier is always set.
9911 (FlowBranchingBlock.Merge): Likewise.
9913 2006-05-01 Raja R Harinath <harinath@gmail.com>
9915 * codegen.cs (EmitContext.ResolveTopBlock): Remove redundant
9916 checks for unreachable.
9918 2006-05-01 Marek Safar <marek.safar@seznam.cz>
9921 * flowanalysis.cs (UsageVector.IsAssigned): Add flag to ignore short path.
9923 * statement.cs (Block.UsageWarning): Uses newly introduced flag to detect
9924 whether field is really assigned.
9926 2006-04-30 Raja R Harinath <harinath@gmail.com>
9928 * flowanalysis.cs (Reachability): Make 4-argument constructor
9930 (Reachability.Meet): Rename from 'And'. Remove static variant.
9931 (Reachability.Always): Rename from the highly misleading
9932 'Reachability.Never'.
9933 (FlowBranching.Merge): Update to changes. Mark an impossible
9934 situation with a 'throw'.
9935 (*): Update to changes.
9937 2006-04-29 Raja R Harinath <harinath@gmail.com>
9939 * flowanalysis.cs (TriState): Rename from FlowBranching.FlowReturns.
9941 (FlowBranching.TriState_Meet): Rename from AndFlowReturns. Simplify.
9942 (FlowBranching.TriState_Max): Rename from OrFlowReturns. Simplify.
9943 (*): Update to changes.
9944 * statement.cs: Update to changes.
9946 2006-04-28 Marek Safar <marek.safar@seznam.cz>
9949 *class.cs (Method.FindOutBaseMethod): Base method cannot be property method.
9951 2006-04-28 Raja R Harinath <harinath@gmail.com>
9953 * flowanalysis.cs (FlowBranching.MergeTopBlock): Don't create a
9956 * flowanalysis.cs (UsageVector.MergeChild): Change FlowBranching
9957 argument to two arguments: an usage-vector and a bool. Move call
9958 to FlowBranching.Merge () ...
9959 (FlowBranching.MergeChild, FlowBranching.MergeTopBlock): ... here.
9961 * flowanalysis.cs (UsageVector.MergeChild): Move special-case
9962 handling of loop and switch reachability to ...
9963 (FlowBranchingLoop.Merge, FlowBranchingSwitch.Merge): ... these.
9965 2006-04-27 Raja R Harinath <harinath@gmail.com>
9967 * flowanalysis.cs (FlowBranching.InLoop): Move special-case
9968 handling to FlowBranchingLoop.InLoop.
9969 (FlowBranching.InSwitch): Likewise, to FlowBranchingSwitch.
9971 2006-04-26 Marek Safar <marek.safar@seznam.cz>
9974 * anonymous.cs (AnonymousMethod.DoResolve): Moved the check whether
9975 anonymous method is allowed from AnonymousContainer here.
9977 * attribute.cs, codegen.cs (EmitContext): Add IsAnonymousMethodAllowed.
9979 2006-04-24 Raja R Harinath <rharinath@novell.com>
9982 * flowanalysis.cs (MyBitVector.Or): Add null check on argument.
9984 2006-04-23 Marek Safar <marek.safar@seznam.cz>
9987 * constant.cs (FloatConstant.Reduce): Add range checking for checked context.
9988 (DoubleConstant.Reduce): Ditto.
9990 2006-04-23 Raja R Harinath <rharinath@novell.com>
9992 * expression.cs (LocalVariableReference.DoResolveBase): Simplify.
9993 Remove 'lvalue_right_side' argument. Move parts to ...
9994 (LocalVariableReference.ResolveLocalInfo, LocalVariable.DoResolve)
9995 (LocalVariable.DoResolveLValue): ... these.
9997 2006-04-21 Raja R Harinath <rharinath@novell.com>
10000 * codegen.cs (EmitContext.InRefOutArgumentResolving): Remove.
10001 * expression.cs (EmptyExpression.LValueMemberOutAccess): New.
10002 (LocalVariableReference.DoResolveBase): Use it to implement new
10004 (IndexerAccess.DoResolveLValue): Handle LValueMemberOutAccess.
10005 (Argument.Resolve): Simplify. Move CS1510 check ...
10006 * ecore.cs (Expression.ResolveLValue): ... here.
10007 (UnboxCast.DoResolveLValue): Handle LValueMemberOutAccess.
10008 (PropertyExpr.DoResolveLValue): Likewise.
10009 (FieldExpr.Report_AssignToReadonly): Likewise.
10010 (FieldExpr.DoResolve): Add 'out_access' argument. Use
10011 LValueMemberAccess or LValueMemberOutAccess on instance depending
10013 (FieldExpr.DoResolveLValue): Pass 'out_access' argument to
10014 DoResolve as appropriate.
10016 2006-04-20 Raja R Harinath <rharinath@novell.com>
10019 * expression.cs (Invocation.VerifyArgumentsCompat): Don't try
10020 implicit conversions on 'out' and 'ref' arguments.
10022 * expression.cs (Invocation.VerifyArgumentsCompat): Reorganize to
10023 improve clarity. Remove dead code.
10026 * statement.cs (Block.UsageWarning): Allow VariableInfo to be null.
10027 (Catch.Resolve): Resolve VarBlock if it exists.
10029 2006-04-19 Miguel de Icaza <miguel@novell.com>
10031 * statement.cs (Foreach.EmitFinally): Do not emit the enumerator
10032 twice, this was some residual code, the enumerator was emitted
10033 properly in the two branche of if later.
10035 2006-04-19 Raja R Harinath <rharinath@novell.com>
10037 * expression.cs (Cast.ResolveLValue): Remove. The result of a
10038 cast is never an lvalue.
10039 (Cast.DoResolve, Cast.ResolveRest): Combine.
10040 (Argument.Emit): Simplify slightly. Move 'Expr is
10041 IMemoryLocation' check ...
10042 (Argument.Resolve): ... here.
10043 (Argument.Error_LValueRequired): Remove. Inline into only user.
10045 Simplifications. Fix cs0191-2.cs
10046 * ecore.cs (FieldExpr.DoResolve): Move handling of CS0192, CS0198,
10047 CS1649 and CS1651 to ...
10048 (FieldExpr.Report_AssignToReadonly): ... this. Simplify by moving
10049 the actual selection of the error code and message to a lookup
10050 table. Add a dummy return value to simplify callsites.
10051 (FieldExpr.ResolveLValue): Don't allow a constructor to write to
10052 readonly fields of other instances of the same type. Move CS0197
10054 * expression.cs (Argument.Resolve): ... here. Simplify code.
10055 Ensure that ec.InRefOutArgumentResolving is only set during LValue
10056 resolution of an out or ref argument. The code simplification
10057 above uses this invariant.
10059 2006-04-18 Raja R Harinath <rharinath@novell.com>
10061 Possibly fix #77752. Fix cs1690-[4-7].cs.
10062 * ecore.cs (Expression.CheckMarshalByRefAccess): Renamed from
10063 CheckMarshallByRefAccess. Drop parameter.
10064 (FieldExpr.CheckMarshalByRefAccess): Update. Change CS1690 to a
10066 (FieldExpr.DoResolve): Call CheckMarshalByRefAccess on
10067 InstanceExpression.
10068 * report.cs (AllWarnings): Add CS1690.
10069 * expression.cs (Argument.Resolve): Use EmptyExpression.OutAccess
10070 for ref access too.
10071 (LocalVariableReference.DoResolveBase): Update.
10073 2006-04-09 Marek Safar <marek.safar@seznam.cz>
10075 * class.cs (MethodOrOperator): Moved common parts from method class.
10076 detect obsolete attributes.
10077 (Method.Define): Simplified as it reuses code from base.
10078 (Constructor.ValidAttributeTargets): Fixed issue found during
10080 (Destructor.ValidAttributeTargets): Fixed issue found during
10082 (Operator): Finished refactoring set off by #78020. Operator class is now
10083 ordinary method class.
10085 * anonymous.cs: Updated.
10087 * decl.cs (DeclSpace): Add IsGeneric
10089 2006-04-09 Marek Safar <marek.safar@seznam.cz>
10091 * class.cs (Constructor.Emit): Don't emit the attributes twice.
10093 2006-04-09 Marek Safar <marek.safar@seznam.cz>
10095 * class.cs (Operator.Emit): Extracted code from MethodData to correctly
10096 detect obsolete attributes.
10097 (Method.CreateEmitContext): Moved to MethodOrOperator.
10099 2006-04-09 Marek Safar <marek.safar@seznam.cz>
10102 * class.cs (TypeContainer.MemberCoreArrayList.DefineContainerMembers): Throw
10103 customized exception to make crash detection easier.
10104 (MethodOrOperator): Started to work on new base class for methods and
10106 (Method): Derives from MethodOrOperator.
10107 (Constructor.Emit): Emits its own attributes.
10108 (AbstractPropertyEventMethod.Emit): Ditto.
10109 (Operator): Derives from MethodOrOperator, will refactor fully in extra
10111 (Operator.Emit): It's temporary more tricky than should be.
10113 * doc.cs (GetMethodDocCommentName): Updated after operator changes.
10115 * report.cs (InternalErrorException): Add ctor with inner exception.
10117 2006-04-08 Marek Safar <marek.safar@seznam.cz>
10120 * ecore.cs (SimpleName.ResolveAsTypeStep): Report better error when type is
10123 2006-04-07 Marek Safar <marek.safar@seznam.cz>
10126 * expression.cs (ArrayCreation.GetAttributableValue): Creates correctly typed
10129 2006-04-06 Marek Safar <marek.safar@seznam.cz>
10131 * class.cs (Class.ApplyAttributeBuilder): Report an error when ComImport
10132 attribute is present and Guid not.
10133 (Interface.ApplyAttributeBuilder): Ditto.
10135 * attribute.cs: Add error message.
10137 2006-04-06 Marek Safar <marek.safar@seznam.cz>
10141 * attribute.cs (Attribute.AttachTo): The attribute can have multiple
10142 sources (it's composite) so hold them in extra array as they are used in
10143 Emit phase only. It worked in the previous versions by mistake.
10144 (Attribute.Emit): Emit attribute for more owners when exist.
10146 * codegen.cs, class.cs: Updated to don't re-attach attribute twice as now
10147 it has now different behaviour.
10149 2006-04-04 Marek Safar <marek.safar@seznam.cz>
10151 * constant.cs (Constant.IsDefaultInitializer): New method.
10153 * class.cs: Updated.
10155 * expression.cs (ArrayCreation.CheckIndices): Add an optimization to don't
10156 re-initialize default values. It saves KBs almost for every assembly.
10157 Thanks Zoltan for the idea.
10158 (ArrayCreation.ResolveInitializers): Renamed from ValidateInitializers.
10159 (ArrayCreation.DoResolve): Resolve only once.
10160 (ArrayCreation.Emit): Emit static initializer only when it is faster.
10161 (ArrayCreation.GetAttributableValue): Cope with optimized values.
10163 2006-04-03 Zoltan Varga <vargaz@gmail.com>
10165 * report.cs (Warning, Error): Add 0-, 1-, and 2- argument specializations.
10168 2006-04-01 Marek Safar <marek.safar@seznam.cz>
10170 * assign.cs (Assign.DoResolve): Assignment to same variable can occur
10171 in an embedded statement too.
10173 2006-04-01 Raja R Harinath <rharinath@novell.com>
10176 * statement.cs (Switch.EmitObjectInteger) [ulong]: Remove bad cast.
10178 2006-04-01 Marek Safar <marek.safar@seznam.cz>
10182 * class.cs (TypeContainer.AddPartial): Don't report an error when modifier
10185 * modifiers.cs: Add DEFAULT_ACCESS_MODIFER.
10187 2006-03-31 Marek Safar <marek.safar@seznam.cz>
10189 * assign.cs (LocalTemporary): Don't require ILGenerator in the resolve
10192 * anonymous.cs, assign.cs, ecore.cs, expression.cs: Updated after
10193 LocalTemporary change.
10195 * class.cs (ClassOrStruct.DefineDefaultConstructor): Moved from
10197 (ClassOrStruct.DefineFieldInitializers): Implemented static field
10198 initializers optimization.
10199 (ClassOrStruct.TypeAttr): Moved from modifiers.
10200 (Constructor.CheckBase): Don't crash when static ctor has parameters.
10201 (FieldBase.ResolveInitializer): Resolves initializer.
10202 (FieldBase.HasDefaultInitializer): New property.
10204 * cs-parser.jay: Removed message.
10206 * expression.cs (CompilerGeneratedThis): New specialization.
10208 * modifiers.cs (TypeAttr): Moved to ClassOrStruct.TypeAttr
10210 2006-03-28 Marek Safar <marek.safar@seznam.cz>
10212 * cs-parser.jay, cs-tokenizer.cs: On demand Stack allocation.
10214 2006-03-27 Marek Safar <marek.safar@seznam.cz>
10216 * ecore.cs (Expression.ResolveAsConstant): Clean up, enum constants should
10217 be now EnumConstants only.
10219 2006-03-27 Marek Safar <marek.safar@seznam.cz>
10221 * attribute.cs, driver.cs: Reset more caches.
10223 2006-03-26 Marek Safar <marek.safar@seznam.cz>
10225 * cs-tokenizer.cs (adjust_real): Uses float.Parse for float literals.
10227 2006-03-26 Marek Safar <marek.safar@seznam.cz>
10229 * constant.cs (Constant.Reduce): Replaced EmitContext with single bool
10230 for easier reuse. Updated all overrides.
10231 (IntegralConstant): New base class for all integral constants.
10232 (IntegralConstant.Error_ValueCannotBeConverted): When assigned value if out
10233 of the constant range, report custom error.
10234 (UIntConstant.Reduce): Fixed uint conversion.
10236 * ecore.cs, literal.cs: Reduce updates.
10238 2006-03-26 Marek Safar <marek.safar@seznam.cz>
10242 * class.cs (Constructor.Define): Removed extra if for default ctors.
10243 A patch from Atsushi Enomoto.
10245 2006-03-26 Marek Safar <marek.safar@seznam.cz>
10247 * attribute.cs (Attribute.ResolveConstructor): Conversion was moved to
10248 GetAttributableValue.
10250 * constant.cs (Constant.GetAttributableValue): Does implicit conversion
10253 * convert.cs (ImplicitConversionRequired): Error message moved to
10256 * ecore.cs (Expression.GetAttributableValue): Add type parameter for
10257 automatic implicit conversion of an output value.
10258 (EnumConstant.GetAttributableValue): Don't reduce the enum constants.
10260 * expression.cs (ArrayCreation.GetAttributableValue): Add element type
10262 (TypeOf.GetAttributableValue): Add extra handling for object type.
10264 * literal.cs (DoubleLiteral.Error_ValueCannotBeConverted): Doubles can have
10265 special error message.
10267 2006-03-25 Marek Safar <marek.safar@seznam.cz>
10269 * class.cs (Constructor.Emit): Don't crash when struct ctor is
10271 (Constructor.ApplyAttributeBuilder): Transform MethodImplAttribute to be
10272 compatible with MS runtime.
10274 2006-03-23 Marek Safar <marek.safar@seznam.cz>
10276 * attribute.cs (Attribute.ResolveConstructor): Check for an invalid
10277 attribute arguments here.
10279 * class.cs (Indexer.Define): The check was moved to attribute class.
10281 2006-03-22 Marek Safar <marek.safar@seznam.cz>
10283 * assign.cs, class.cs, codegen.cs, convert.cs, decl.cs, ecore.cs,
10284 expression.cs, typemanager.cs: Minor changes from gmcs to make merging
10287 2006-03-22 Raja R Harinath <rharinath@novell.com>
10289 Support ParameterDefaultValueAttribute in gmcs. Also applied to
10290 mcs to keep code differences small.
10291 * attribute.cs (Attribute.GetParameterDefaultValue): New.
10292 * typemanager.cs (parameter_default_value_attribute_type): New.
10293 * parameter.cs (Parameter.ApplyAttributeBuilder): Use them. Add
10296 2006-03-21 Marek Safar <marek.safar@seznam.cz>
10298 * expression.cs (StringConcat.Append): Reverted back to no warning state.
10300 2006-03-21 Marek Safar <marek.safar@seznam.cz>
10302 * const.cs (Error_ConstantCanBeInitializedWithNullOnly): Share a message.
10304 * statement.cs (Block.ResolveMeta): Look for wrong object constants in
10307 2006-03-21 Atsushi Enomoto <atsushi@ximian.com>
10309 * doc-bootstrap.cs : fix build.
10311 2006-03-20 Marek Safar <marek.safar@seznam.cz>
10313 * expression.cs (StringConcat.Append): Issue a warning when empty string
10314 is going to append.
10316 2006-03-20 Marek Safar <marek.safar@seznam.cz>
10318 * assign.cs (CompoundAssign.ResolveSource): Removed.
10320 * attribute.cs (ResolvePossibleAttributeType): Updated after MemberAccess
10323 * class.cs (TypeContainer.FindMethods): Removed.
10324 (TypeContainer.CheckMemberUsage): Made static.
10326 * codegen.cs (GetAssemblyName): Uses Length for empty string test.
10328 * constant.cs (CheckRange): Removed unused type argument.
10329 (CheckUnsigned): Removed unused type argument.
10331 * cs-parser.jay: Updated after MemberAccess clean up.
10332 Uses Length for empty string test.
10334 * cs-tokenizer.cs: Uses Length for empty string test.
10335 (IsCastToken): Made static.
10336 (is_hex): Made static.
10337 (real_type_suffix): Made static.
10339 * decl.cs (SetupCache): Made static.
10340 (OnGenerateDocComment): Removed unused ds argument.
10342 * delegate.cs (VerifyDelegate): Removed unused argument.
10344 * doc.cs: Uses Length for empty string test.
10346 * driver.cs: Uses Length for empty string test.
10348 * enum.cs (IsValidEnumType): Made static
10350 * expression.cs (EnumLiftUp): Removed unused argument.
10351 (ResolveMethodGroup): Ditto.
10352 (BetterConversion): Ditto.
10353 (GetVarargsTypes): Ditto.
10354 (UpdateIndices): Ditto.
10355 (ValidateInitializers): Ditto.
10356 (MemberAccess.ctor): Ditto.
10357 (GetIndexersForType): Ditto.
10359 * flowanalysis.cs: (MergeFinally): Removed unused argument.
10361 * iterators.cs: Updated after MemberAccess clean up.
10363 * location.cs: Uses Length for empty string test.
10365 * namespace.cs: Uses Length for empty string test.
10367 * report.cs (CheckWarningCode): Made static.
10369 * statement.cs (LabeledStatement): Removed unused argument.
10371 * typemanager.cs (FilterNone): Removed.
10373 2006-03-18 Marek Safar <marek.safar@seznam.cz>
10375 * codegen.cs (EmitContext.TestObsoleteMethodUsage): Removed as it become
10378 * class.cs: Updated.
10380 2006-03-18 Marek Safar <marek.safar@seznam.cz>
10382 * cs-parser.jay.cs: __arglist is not allowed for delegates.
10384 2006-03-18 Marek Safar <marek.safar@seznam.cz>
10388 * expression.cs (VerifyArgumentsCompat): Reverted to double error
10389 reporting, it's more tricky than I thought.
10391 2006-03-18 Marek Safar <marek.safar@seznam.cz>
10395 * anonymous.cs.cs (AnonymousMethod): Add host to allow access to
10397 (AnonymousMethod.ImplicitStandardConversionExists): New method.
10398 (AnonymousMethod.Compatible): Moved parameter resolving to DoResolve.
10399 Add more error reporting; Fixed issue with params.
10401 * convert.cs (ImplicitStandardConversionExists): Returned conversion check.
10403 * cs-parser.jay: AnonymousMethod requires host container.
10405 * delegate.cs (NewDelegate.DoResolve): Updated after Compatible changes.
10407 2006-03-18 Raja R Harinath <harinath@gmail.com>
10409 * class.cs: Change 'TypeContainer ds' constructor argument to
10410 'DeclSpace parent'. Some classes were missed below due to
10411 different naming convention.
10413 * class.cs (MemberCore.Parent): Delete. This makes the
10414 ParentContainer changes below enforceable by the compiler.
10416 Treat pointers to enclosing declaration space as 'DeclSpace', not
10418 * class.cs, const.cs, delegate.cs, enum.cs, iterator.cs: Change
10419 'TypeContainer parent' constructor argument to 'DeclSpace parent'.
10421 * statement.cs (LocalInfo..ctor): Use DeclSpace argument instead
10423 (Block.AddThisVariable): Likewise.
10424 * class.cs (MethodData.Define, MethodData.Emit): Likewise.
10425 (AbstractPropertyEventMethod.Emit): Likewise.
10426 (AbstractPropertyEventMethod.EmitMethod): Likewise.
10427 (GetMethod.Define, SetMethod.Define): Likewise.
10428 (PropertyMethod.Define, DelegateMethod.Define): Likewise.
10429 (DelegateMethod.EmitMethod): Likewise.
10431 Fix regression test-partial-13.cs.
10432 Rationalize use of PartialContainer. Ensure that the partial
10433 class semantics can be tied to type-correctness, i.e., any
10434 violation will cause a compile error.
10435 * class.cs, const.cs: Access all fields that belong to class
10436 TypeContainer via ParentContainer. Arguments of EmitContexts and
10437 Resolve()-like functions still use 'Parent'.
10439 * class.cs (SourceMethod): Use DeclSpace, not TypeContainer.
10440 (*.CreateEmitContext): Change TypeContainer argument to DeclSpace.
10441 (PropertyMethod.CheckModifiers): Remove unused argument.
10442 * codegen.cs (EmitContext..ctor): Change TypeContainer argument to
10445 2006-03-17 Raja R Harinath <harinath@gmail.com>
10447 Make semantics of PartialContainer simpler.
10448 * decl.cs (DeclSpace.IsPartial): Remove.
10449 * class.cs (TypeContainer.IsPartial): Likewise.
10450 (TypeContainer..ctor): Set PartialContainer to point to self.
10451 (TypeContainer.GetClsCompliantAttributeValue): Don't use IsPartial.
10452 (TypeContainer.FindNestedType): Likewise.
10453 (MemberCore.ParentContainer): Simplify. Remove deprecation.
10455 2006-03-17 Marek Safar <marek.safar@seznam.cz>
10457 * typemanager.cs.cs (GetInterfaces): Don't recreate 0-sized arrays.
10459 2006-03-15 Marek Safar <marek.safar@seznam.cz>
10461 * class.cs (FieldMember.Emit): ParentContainer is real parent for partial
10464 2006-03-15 Marek Safar <marek.safar@seznam.cz>
10466 * class.cs (Operator.Define): An error for base conversion was not
10467 reported correctly.
10469 2006-03-14 Atsushi Enomoto <atsushi@ximian.com>
10471 * iterator.cs : yield break is allowed in try statement which has
10472 catch clauses. Fixed bug #77767.
10474 2006-03-13 Marek Safar <marek.safar@seznam.cz>
10476 A fix for #77593, #77574.
10478 * class.cs (MethodCore.CheckBase): Another if for operator.
10480 2006-03-09 Marek Safar <marek.safar@seznam.cz>
10482 * anonymous.cs (AnonymousMethod.Compatible): Don't crash when parameters
10485 * delegate.cs (Delegate.GetInvokeMethod): Use emitcontext free MemberLookup.
10486 (DelegateCreation.ImplicitStandardConversionExists): New method for just
10489 *ecore.cs (Expression.MemberLookup): Don't ask for emitcontext when it's
10492 * assign.cs, constant.cs, convert.cs, delegate.cs, expression.cs:
10493 Updated after another emitcontext usage was clean up. It should help us to
10494 synchronize with gmcs easier.
10496 2006-03-04 Marek Safar <marek.safar@seznam.cz>
10500 * class.cs (SetMethod.DefineParameters): Uses new parameters type ctor.
10501 (Event.Define): ditto
10502 (SetIndexerMethod.DefineParameters): Uses Parameters.MergeGenerated.
10504 * delegate.cs (Delegate.Define): Uses Parameters.MergeGenerated.
10505 Removed redundant code and set NewSlot for Invoke method too.
10507 * parameter.cs (Parameters.ctor): Add custom, type ctor.
10508 (Parameters.MergeGenerated): New method. Use this method when you merge
10509 compiler generated argument with user arguments.
10511 2006-03-03 Marek Safar <marek.safar@seznam.cz>
10513 * attribute.cs (ResolveAsTypeTerminal): Removed.
10515 * ecore.cs (Expression.ResolveAsTypeTerminal): Make virtual to allow
10516 specialization for predefined types; 30% speed up.
10517 Finally placed obsolete check to right place.
10518 (Expression.ResolveType): Removed.
10520 * enum.cs, expression.cs, parameter.cs, statement.cs, typemanager.cs:
10521 Updated after ResolveType was removed.
10523 * expression.cs (Cast.ctor): Check void cast.
10524 (Binary.ResolveAsTypeTerminal): Is never type.
10525 (Conditional.ResolveAsTypeTerminal): Is never type.
10527 * rootcontext.cs (ResolveCore): Set base type to simplify some code later.
10529 2006-03-01 Raja R Harinath <rharinath@novell.com>
10532 * expression.cs (ParameterReference.DoResolveBase): Change return
10534 (ParameterReference.DoResolve, ParameterReference.DoResolveLValue):
10538 * ecore.cs (PropertyExpr.InstanceResolve): Fix CS1540 check.
10541 * typemanager.cs (GetFullNameSignature): Don't nullref on
10542 protected accessors.
10544 2006-02-27 Marek Safar <marek.safar@seznam.cz>
10546 * attribute.cs (Attribute.PosArguments, Attribute.NamedArguments): Use
10547 these two separated members to simplify the code.
10548 (Attribute.Resolve): Refactored to use new fields and methods.
10549 (Attribute.ResolveConstructor): Extracted from ResolveArguments and
10550 implemented obsolete attribute checking.
10551 (Attribute.ResolveNamedArguments): Extracted from ResolveArguments and
10552 implemented obsolete checking again. It look line never ending quest ;-)
10553 (GlobalAttribute.ResolveConstructor): Need to override as the rest.
10555 * cfold.cs (BinaryFold): TryReduce throws an exception to indicate error.
10557 * constanct.cs (TryReduce): Throws OverflowException to indicate error.
10559 *class.cs (Property.Define): Add RegisterProperty call.
10561 * cs-parser.jay: Replaced ArrayList with fixed array for attribute
10562 argument groups (only 2).
10564 * ecore.cs (Expression.GetAttributableValue): New virtual method used for
10565 encoding expression to arguments.
10566 (Expression.ExprClassToResolveFlags): Just turned to property.
10568 * expression.cs (ArrayCreation.ValidateInitializers): Slightly optimized.
10569 (ArrayCreation.GetAttributableValue): Renamed from EncodeAsAttribute and
10570 optimized as well as implemented support for zero-length attributes.
10572 * typemanager.cs (TypeManager.RegisterProperty, TypeManager.GetProperty):
10573 Add caching of PropertyInfo's.
10575 2006-02-25 Marek Safar <marek.safar@seznam.cz>
10577 * delegate.cs (DelegateCreation.ResolveMethodGroupExpr): Don't report
10578 error multiple times.
10580 2006-02-25 Marek Safar <marek.safar@seznam.cz>
10582 New partial class implementation.
10583 A fix for #77027, #77029, #77403
10585 * attribute.cs (Attributable): Made attributes protected.
10587 * class.cs (TypeContainer): Add PartialContainer and partial_parts as
10588 the replacements of ClassPart and PartialContainer.
10589 (TypeContainer.AddClassOrStruct): Call RecordDecl here.
10590 (TypeContainer.AddInterface): Ditto.
10591 (TypeContainer.AddPartial): The main method for partial classes. It checks
10592 for errors and merges ModFlags and attributes. At the end class is added to
10593 partial_parts list.
10594 (TYpeContainer.DefineDefaultConstructor): Checks whether default ctor is
10596 (TypeContainer.GetClsCompliantAttributeValue): Cope with partial class too.
10597 (TypeContainer.GetNormalPartialBases): Resolves base classes and interfaces
10598 from the rest of partial classes.
10599 (TypeContainer.GetClassBases): Simplified.
10600 (TypeContainer.DefineTypeBuilder): New method, mostly extracted from
10602 (TypeContainer.DefineDefaultConstructor): Is used by derived classes.
10603 (TypeContainer.HasExplicitLayout): Uses Flags now.
10604 (PartialContainer): Removed.
10605 (ClassOrStruct.AddToContainer): Moved enclosing member name check here.
10606 (StaticClass): Was merged with Class.
10607 (Class.GetClassBases): class and static class bases are verified here.
10608 (Class.TypeAttr): Added static attributes when class is static.
10609 (Struct.RegisterFieldForInitialization): Moved from TypeContainer.
10610 (MemberBase): In some cases we need to call parent container for partial
10611 class. It should be eliminated but it's not easy now.
10613 * cs-parser.jay: Replaced all PartialContainer with AddPartial.
10615 * decls.cs (MemberCore.DocComment): Introduced new property as is used by
10616 partial classed to accumulate class comments.
10617 (MemberCore.GetClsCompliantAttributeValue): Moved from TypeContainer.
10619 * doc.cs (GenerateTypeDocComment): Partial classes clean up.
10621 * driver.cs (MainDriver): Tree.GetDecl was removed.
10623 * modifiers.cs (Modifiers): Add partial modifier.
10625 * tree.cs (Tree.decl): Removed.
10626 (RootTypes): Started to use this class more often for root types
10629 2006-02-22 Marek Safar <marek.safar@seznam.cz>
10633 * attribute.cs (AttributeTester.GetCoClassAttribute): Don't crash when
10634 external interface does not have an attribute.
10636 2006-02-22 Marek Safar <marek.safar@seznam.cz>
10638 Another prerequisites for new partial classs implementation.
10640 * attribute.cs (Attribute.Equal): Implemented.
10641 (Attribute.Emit): Changed as attributes can be applied more than twice.
10642 (Attributes.Emit): Check for duplicate attributes here.
10644 * class.cs, decl.cs, delegate.cs, doc.cs, enum.cs: Don't pass DeclSpace
10645 as a parameter, clean-up.
10647 2006-02-11 Marek Safar <marek.safar@seznam.cz>
10651 * class.cs (TypeContainer.DefineType): Cannot use ResolveType because it
10652 contains obsolete attribute check which can in some cases look for base
10653 type of current class which is not initialized yet.
10654 (TypeContainer.BaseType): Replacement of ptype.
10656 * decl.cs (MemberCore.CheckObsoleteType): Reuse existing code.
10658 2006-02-11 Marek Safar <marek.safar@seznam.cz>
10660 First of prerequisites for new partial classs implemention.
10662 * attribute.cs (Attributable): Extended by ResolveContext;
10663 Attributes finally have correct context for resolving in all cases.
10664 (AttachTo): Attribute owner is assigned here.
10666 * codegen.cs (IResolveContext): Introduce new interface to hold
10667 all information needed in resolving phase.
10668 (EmitContext): Implements IResolveContext; more clean-up needed here.
10670 * decl.cs (MemberCore): Implemented IResolveContext.
10672 * anonymous.cs, attribute.cs, class.cs, codegen.cs, const.cs,
10673 decl.cs, ecore.cs, enum.cs, expression.cs, iterators.cs, namespace.cs,
10674 parameter.cs, statement.cs, tree.cs, typemanager.cs:
10675 Refactored to use new IResolveContext instead of EmitContext; cleanup
10677 2006-02-06 Miguel de Icaza <miguel@novell.com>
10679 * codegen.cs (EmitScopeInitFromBlock): check here the
10680 capture_context, there is no need to make two calls to the
10683 * anonymous.cs: Add some debugging messages that might help me
10684 track other instances of this problem in the future (the
10685 regression of test 467).
10687 * cs-parser.jay: track the variable block, as we need to initalize
10688 any captured variables declared in this block for the "catch"
10689 portion of the "Try" statement.
10691 * statement.cs (Try.Emit): If the "Catch" has a VarBlock, emit any
10692 scope initialization for captured variables.
10694 Also, move the emit for the variables after the block location has
10697 2006-02-06 Marek Safar <marek.safar@seznam.cz>
10699 * ecore.cs (PropertyExpr.FindAccessors): Just made flags const.
10701 2006-02-02 Miguel de Icaza <miguel@novell.com>
10703 * anonymous.cs (CaptureContext.EmitInitScope): I was wrong in the
10704 commit yesterday, the initialization for the roots is necessary.
10705 What is not necessary is the scope activation.
10707 2006-02-02 Raja R Harinath <rharinath@novell.com>
10709 * ecore.cs (PropertyExpr.DoResolveLValue): Add CS0206 check.
10710 * expression.cs (IndexerAccess.DoResolveLValue): Add CS1612 and
10712 (Argument.Resolve): Remove CS0206 checks.
10714 2006-02-01 Miguel de Icaza <miguel@novell.com>
10716 * anonymous.cs (CaptureContext.EmitInitScope): Do not emit the
10717 scopes for all the roots, the scopes will now be emitted when the
10718 Blocks are entered. [This change was wrong, fixed on 2006-02-02]
10720 (CaptureContext.EmitScopeInitFromBlock): Simply emit the ScopeInfo
10721 code. This reduces a lot of existing cruft.
10723 * statement.cs (Block.Emit): Call EmitScopeInitFromBlock here, so
10724 that the ScopeInfo is generated as we enter the scope, not at the
10725 time of use, which is what we used to do before.
10727 * codegen.cs (EmitScopeInitFromBlock): New routine, this is called
10728 every time a Block is about to be emitted if we have a
10731 2006-02-01 Raja R Harinath <rharinath@novell.com>
10733 * typemanager.cs (NoTypes, NoTypeExprs): Remove.
10735 * *.cs: Use Type.EmptyTypes instead of TypeManager.NoTypes.
10737 * typemanager.cs (cons_param_array_attribute): Make private.
10738 (Reset): Set it to null.
10739 (InitCoreHelpers): Don't initialize it.
10740 (ConsParamArrayAttribute): New. Initialize it as needed.
10741 * parameter.cs (ParamsParameter.ApplyAttribute): Update to change.
10743 2006-01-31 Miguel de Icaza <miguel@novell.com>
10745 * expression.cs: There might be errors reported during the
10746 selection of applicable methods. If there are errors, do not
10747 continue execution as it will lead the compiler to crash.
10749 2006-01-30 Miguel de Icaza <miguel@novell.com>
10751 * expression.cs: Member access is not allowed on anonymous
10752 methods. Fixes #77402.
10754 2006-01-30 Raja R Harinath <rharinath@novell.com>
10757 * cs-parser.jay (VariableDeclaration): Don't set
10758 current_array_type to null.
10759 (field_declaration, event_declaration, declaration_statement):
10760 Set it to null here.
10762 2006-01-28 Raja R Harinath <harinath@gmail.com>
10764 * typemanager.cs (GenericParameterPosition): New.
10767 2006-01-28 Atsushi Enomoto <atsushi@ximian.com>
10769 * doc.cs : To process "include" elements, first we should create
10770 another list than XmlNodeList, because it could result in node
10771 removal, which could result in that the XmlNodeList gives up
10772 yielding next node.
10774 (Also made code identical to gmcs again.)
10776 2006-01-25 Miguel de Icaza <miguel@novell.com>
10778 * ecore.cs: Introduce an error report that we were not catching
10779 before, if not silent, we must report the error. Gonzalo ran into
10782 2006-01-23 Miguel de Icaza <miguel@novell.com>
10784 A fix for bug: #76957
10786 * iterators.cs (MoveNextMethod.CreateMethodHost): call
10787 ComputeMethodHost before creating the method, this is a new
10790 * anonymous.cs (AnonymousContainer): Now we track all the scopes
10791 that this method references (RegisterScope). The actual scope
10792 where the method is hosted is computed with the ComputeMethodHost
10793 before we create the method.
10795 Moved the Deepest routine here.
10797 (AnonymousContainer.ComputeMethodHost): New routine used to
10798 compute the proper ScopeInfo that will host the anonymous method.
10800 (ScopeInfo): Deal with multiple roots. The problem was that we
10801 did not have a unique root where all ScopeInfos could be hanged
10802 from. Remove `topmost' ScopeInfo, and instead keep an arraylist
10805 Remove AdjustMethodScope which is now computed at the end. Remove
10806 LinkScope which did a partial link, instead link all ScopeInfos
10807 before code generation from the new "LinkScopes" routine.
10809 Simplify all the Add* routines as they no longer need to maintain
10810 the tree, they just need to record that they are using variables
10813 (IsAncestor, GetAncestorScopes, GetParentScope, LinkScope): New
10814 routines to produce the forest of ScopeInfo trees.
10816 * class.cs (TypeContainer.AppendMethod): This is just like
10817 AddMethod, but ensures that an interface implementation method
10818 (IEnumerable.XXX) is not inserted at the beginning of the queue of
10819 methods, but at the end.
10821 We use this functionality to ensure that the generated MoveNext
10822 method in the iterator class is resolved/emitted before the
10823 enumerator methods created.
10825 This is required because the MoveNext method computes the right
10826 ScopeInfo for the method. And the other methods will eventually
10827 need to resolve and fetch information computed from the anonymous
10830 2006-01-21 Raja R Harinath <harinath@gmail.com>
10831 Carlos Alberto Cortez <calberto.cortez@gmail.com>
10833 Fix rest of #76995.
10834 * namespace.cs (NamespaceEntry.UsingExternalAliases): Don't add to
10835 the 'aliases' hash.
10836 (NamespaceEntry.LookupAlias): Lookup 'extern_aliases' hash too.
10837 (NamespaceEntry.VerifyUsing): Resolve external aliases too.
10839 2006-01-18 Raja R Harinath <rharinath@novell.com>
10841 Fix #76656, cs0231-2.cs.
10842 * cs-parser.jay (formal_parameter_list): Make error case catch
10844 (parenthesized_expression_0): Add CS1026 check.
10845 (invocation_expression): Remove unused { $$ = lexer.Location }.
10847 2006-01-17 Raja R Harinath <rharinath@novell.com>
10850 * cs-parser.jay (statement_expression): Don't list out the
10851 individual statement-expressions. Convert syntax error into
10854 2006-01-16 Raja R Harinath <rharinath@novell.com>
10857 * ecore.cs (MemberAccess.CheckIntermediateModification): Remove.
10858 (UnboxCast.DoResolveLValue): New. Move CS0445 check from
10859 CheckIntermediateModification.
10860 (FieldExpr.DoResolve): Add new two-argument version that
10861 allows us to resolve the InstanceExpression as an lvalue.
10862 The one-argument variant is now just a wrapper.
10863 (FieldExpr.DoResolveLValue): Use two-argument DoResolve.
10864 Resolve the lhs as an lvalue if the it has a value type.
10865 (FieldExpr.AssignToReadonly): Move CS1648 and CS1650 checks
10866 from Assign.DoResolve.
10867 (PropertyExpr.InstanceResolve): Allow InstanceExpression to be
10868 resolved as an lvalue.
10869 (PropertyExpr.DoResolve): Update.
10870 (PropertyExpr.DoResolveLValue): Resolve the lhs as an lvalue if it
10871 has a value type. Move CS1612 check here from
10872 CheckIntermediateModification.
10873 * assign.cs (Assign.DoResolve): Remove CS1648 and CS1650 checks.
10874 * expression.cs (EmptyExpression.OutAccess): New. Used as the
10875 'right_side' of a ResolveLValue on an 'out' argument.
10876 (EmptyExpression.LValueMemberAccess): New. Used as the
10877 'right_side' of a propagated ResolveLValue on a value type.
10878 (LocalVariableReference.DoResolveBase): Recognize
10879 EmptyExpression.OutAccess and EmptyExpression.LValueMemberAccess.
10881 (Argument.Resolve): Use EmptyExpression.OutAccess rather than
10882 EmptyExpression.Null.
10884 2006-01-16 Atsushi Enomoto <atsushi@ximian.com>
10886 * typemanager.cs : added IsGenericParameter(). In mcs it always
10888 * doc.cs : for generic parameters, use GenericParameterPosition,
10891 2006-01-12 Ben Maurer <bmaurer@andrew.cmu.edu>
10893 * expression.cs: Fix Console.WriteLine ((this = x).foo);
10895 2006-01-12 Miguel de Icaza <miguel@novell.com>
10897 This fixes the problem where we used ldfld instead of ldflda to
10898 load the "THIS" pointer on captured parameters, when THIS is a
10899 value type. See bug #77205.
10901 * iterators.cs (CapturedThisReference.Emit): Pass false to
10902 EmitThis (we do not need the address).
10904 * codegen.cs (EmitThis): it needs to know whether we need the
10905 address of `this' or not. This is used by value types.
10907 * expression.cs (This.AddressOf): Pass true to the EmitThis call,
10908 every other call passes false.
10910 2006-01-12 Raja R Harinath <rharinath@novell.com>
10913 * typemanager.cs (TryGetBaseDefinition): Rename from the mis-named
10915 * expression.cs (Invocation.OverloadResolve): Update.
10916 (Invocation.DoResolve): Avoid double resolution of invocation.
10918 2006-01-11 Raja R Harinath <rharinath@novell.com>
10921 * expression.cs (Unary.Emit): When in /checked+ mode, don't emit
10922 unary negation of floating point types as 0-expr; negation cannot
10923 overflow in floating point types.
10926 * expression.cs (MemberAccess.DoResolve): Disallow the use of '.'
10927 on operands of 'void' type.
10930 * cfold.cs (BinaryFold): Implement folding of BinaryOr, BinaryAnd
10931 and ExclusiveOr for boolean constants too.
10933 2006-01-09 Raja R Harinath <rharinath@novell.com>
10936 * expression.cs (Invocation.OverloadResolve): Replace reflected
10937 override methods with their base virtual methods, rather than
10938 skipping over them.
10939 * typemanager.cs (TypeManager.GetOverride): New.
10941 2006-01-05 Jb Evain <jbevain@gmail.com>
10943 * class.cs (Property.Define, Indexer.Define): do not tag the
10944 properties as SpecialName | RTSpecialName.
10946 2006-01-04 Miguel de Icaza <miguel@novell.com>
10948 * class.cs (MethodCore.IsDuplicateImplementation): This method was
10949 doing a low-level comparission of parameter types. It was lacking
10950 a check for __argslist.
10952 2005-12-30 Miguel de Icaza <miguel@novell.com>
10954 * expression.cs (ParameterReference.DoResolveBase): Allow
10955 reference parameters if they are local to this block.
10957 This allows the ref and out parameters of a delegate to be used in
10958 an anonymous method, for example:
10960 delegate void set (out int x);
10962 set s = delegate (out int x){
10966 This is used by functionality introduced late in the C# language.
10968 * anonymous.cs (AnonymousMethod.Compatible): Allow anonymous
10969 method that take ref and out parameters.
10971 Fixes #77119 which was a late change in the spec.
10973 2005-12-23 Miguel de Icaza <miguel@novell.com>
10975 * anonymous.cs (ScopeInfo.LinkScope): Do not link the scope to its
10976 parent if its the same scope. Fixes #77060.
10978 2005-12-21 Miguel de Icaza <miguel@novell.com>
10980 * driver.cs: Report the case of no source files and no -out:
10983 2005-12-20 Raja R Harinath <rharinath@novell.com>
10986 * expression.cs (ComposedCast.GetSignatureForError): Define.
10988 2005-12-18 Carlos Alberto Cortez <calberto.cortez@gmail.com>
10992 * namespace.cs (NamespaceEntry): Add extern_aliases as a
10993 ListDictionary, to contain the ExternAliasEntry entries (in
10994 addition to the NamespaceEntry.aliases hashtable). This field is
10995 shared between the original entry and its doppelganger (bodyless
10997 (NamespaceEntry.UsingExternalAlias): Add the extern alias entry to
10998 extern_aliases field.
10999 (NamespaceEntry.Lookup): Move the IsImplicit check after the
11000 lookup in extern_aliases.
11002 2005-12-16 Raja R Harinath <rharinath@novell.com>
11005 * class.cs (TypeContainer.Mark_HasEquals): New.
11006 (TypeContainer.Mark_HasGetHashCode): New.
11007 (ClassPart): Override them.
11008 (MethodCore.CheckBase): Use them instead of referring to Parent.Methods.
11011 * enum.cs (EnumMember.EnumMember): Pass the parent_enum as the
11012 'parent' argument to the base constructor.
11014 Remove all mention of TypeContainer from decl.cs.
11015 * decl.cs (MemberCore.Parent): Change into a DeclSpace.
11016 (MemberCore.MemberCore): Change type of 'parent' argument to DeclSpace.
11017 (DeclSpace.DeclSpace): Likewise.
11018 (DeclSpace.DefineMembers): Remove unused argument.
11019 * cs-parser.jay (pop_current_class): Update to changes. Simplify
11020 debugging check -- we don't care if the debug code throws an
11021 InvalidCastException instead of an InternalErrorException.
11022 * class.cs (TypeContainer.DefineMembers): Update to changes.
11023 (TypeContainer.DoDefineMembers): Likewise.
11024 (TypeContainer.GetMethods): Likewise.
11025 (PropertyMember.Define): Likewise.
11026 (MemberBase.Parent): New property that forwards to
11027 MemberCore.Parent, but ensures that we get a TypeContainer.
11028 * rootcontext.cs (RootContext.PopulateCoreType): Update to changes.
11029 (RootContext.PopulateTypes): Likewise. Remove special case code
11030 for !RootContext.StdLib: DefineMembers is idempotent.
11032 2005-12-14 Miguel de Icaza <miguel@novell.com>
11034 * convert.cs (ExplicitConversionCore): Check the return value from
11035 ExplicitConversionCore which can return null on failure. Fixes #76914
11037 2005-12-13 Marek Safar <marek.safar@seznam.cz>
11039 * class.cs (Method.ApplyAttributeBuilder): Test out modifier properly.
11041 2005-12-11 Atsushi Enomoto <atsushi@ximian.com>
11043 * doc.cs : The search for referenced namespace was insufficient to
11044 get global one as it used to do. Fixed bug #76965.
11046 2005-12-10 Atsushi Enomoto <atsushi@ximian.com>
11048 * doc.cs : check name in cref in the last phase that whether it is
11051 2005-12-09 Atsushi Enomoto <atsushi@ximian.com>
11053 * cs-tokenizer.cs : reverted the latest change: it somehow broke
11056 2005-12-09 Atsushi Enomoto <atsushi@ximian.com>
11058 * doc.cs : so it turned out that we cannot skip override check for
11059 interface members. Fixed bug #76954.
11061 2005-12-09 Atsushi Enomoto <atsushi@ximian.com>
11063 * cs-tokenizer.cs : fixed bug #75984:
11064 - #warning and #error should not be handled when the source line
11066 - #line is not checked strictly when the source line is disabled.
11067 - #define and #undef is on the other hand checked strictly at any
11070 2005-12-08 Atsushi Enomoto <atsushi@ximian.com>
11072 * cs-tokenizer.cs : missing Location (actually, filename) in one of
11075 2005-12-05 Marek Safar <marek.safar@seznam.cz>
11077 * attribute.cs (GlobalAttribute.ctor): Pass NamespaceEntry only.
11079 * class.cs (EmitFieldInitializers): Simplified and fixed to work with
11080 event initializers.
11081 (FieldBase.EmitInitializer): Moved from TypeContainer and simplified.
11082 (FieldBase.Initializer): Initializer is now optional.
11083 (EventField.Define): Only event field can have initializer.
11085 * codegen.cs (EmitContext): DeclSpace is not readonly (small hack).
11087 * const.cs (Const): Reuse initializer.
11089 * cs-parser.jay: Updated after FieldBase changes.
11090 Added current_array_type to simplify array initializers.
11092 * ecore.cs (NullCast.IsDefaultValue): Implemented.
11094 * expression.cs, iterators.cs: Updated.
11096 * namespace.cs (NamespaceEntry): Made UsingFound private.
11098 2005-12-05 Marek Safar <marek.safar@seznam.cz>
11100 * parameterCollection.cs: Obsolete, removed.
11101 * parser.cs: Obsolete, removed.
11103 2005-12-05 Marek Safar <marek.safar@seznam.cz>
11106 * class.cs (Constructor.Emit): Set obsolete checking for whole context.
11108 * enum.cs (Enum.Define): Set obsolete context here.
11110 2005-12-05 Atsushi Enomoto <atsushi@ximian.com>
11113 - FindDocumentedMember() now expects 1) paramList as null
11114 when "we don't have to check the number of parameters" and
11115 2) Type.EmptyTypes when "there is no arguments".
11116 - Introduced FoundMember struct to hold the exact type which was
11117 used to find the documented member (the above change broke
11118 test-xml-044; it might be better just to use DeclaringType than
11119 what MS does, like this change does, but it depends on usage.)
11121 2005-12-05 Atsushi Enomoto <atsushi@ximian.com>
11123 * doc.cs : documented member might be from DeclaringType for nested
11124 types. Fixed bug #76782.
11126 2005-12-03 Ben Maurer <bmaurer@ximian.com>
11128 * anonymous.cs: Have the param code handle leaving copies on the
11129 stack etc. Allows anonymous params to take part in the assignment
11130 code (++, +=, etc). Fixes bug #76550
11132 * expression.cs: Handle the prepare_for_load/leave_copy by passing
11133 it down to the anon code.
11135 * iterators.cs: Use dummy var here
11137 * codegen.cs: Handle new vars
11139 2005-12-01 Marek Safar <marek.safar@seznam.cz>
11142 * class.cs (MethodData.Define): Set proper Obsolete context.
11144 * ecore.cs (FieldExpr.ResolveMemberAccess): Don't check [Obsolete] in
11146 (FieldExpr.DoResolve): Ditto.
11148 2005-12-01 Marek Safar <marek.safar@seznam.cz>
11151 * class.cs (MethodCore.DoDefineParameters): Test [Obsolete] only when
11152 parent is not obsolete.
11154 2005-12-01 Atsushi Enomoto <atsushi@ximian.com>
11156 * doc.cs : (FindDocumentedMember) find parameterless members first
11157 and get CS0419 in the early stage. Fixed first case of bug #76727.
11159 2005-11-30 Marek Safar <marek.safar@seznam.cz>
11162 * ecore.cs (Expression.ResolveAsConstant): Report constant error only when
11163 no error was reported.
11165 *expression.cs (Binary.DoResolve): left can be null.
11167 2005-11-22 Marek Safar <marek.safar@seznam.cz>
11170 * class.cs (MethodData.Emit): Parameters should be labeled first.
11172 2005-11-21 Marek Safar <marek.safar@seznam.cz>
11175 * parameter.cs (Parameter.ApplyAttributeBuilder): Fixed `ref' detection.
11177 2005-11-18 Marek Safar <marek.safar@seznam.cz>
11179 * attribute.cs (AreParametersCompliant): Moved to Parameter.
11181 * class.cs (MethodCore): Parameter clean up.
11182 (IMethodData): Added ParameterInfo.
11183 (MethodData): Parameter clean up.
11184 (Indexer.Define): Parameter clean up.
11196 * typemanager.cs: Parameter clean up.
11198 * delegate.cs (Define): Get rid of duplicated code.
11200 * expression.cs (ParameterReference): Removed useless parameters
11202 (Invocation): Ditto.
11204 * parameter.cs (ParamsParameter): New class, params specialization.
11205 (ArglistParameter): Attemp to separate arglist.
11206 (Parameter): Refactored to be reusable and faster.
11207 (Parameter.Modifier): Made understandable.
11208 (Parameters): Changed to be used as a class for `this' assembly
11209 parameters. Refactored to use new specialized classes.
11211 * support.cs (ParameterData): Added Types property.
11212 (InternalParameters): Deleted.
11214 2005-08-20 Martin Baulig <martin@ximian.com>
11216 Merging this patch from GMCS to fix #75867.
11218 * anonymous.cs (CaptureContext.CaptureThis): Create the topmost
11219 scope if we don't already have it.
11221 2005-11-17 Martin Baulig <martin@ximian.com>
11224 (CaptureContext.EmitMethodHostInstance): Use `Ldarg_0' if we
11225 inherit the scope from our parent. Fixes #76653.
11227 2005-11-16 Atsushi Enomoto <atsushi@ximian.com>
11229 * doc.cs : the previous patch does not actually fix the bug.
11230 PropertyInfo override check is now implemented and really fixed it.
11231 * expression.cs : Invocation.IsAncestralType() is used from doc.cs.
11233 2005-11-16 Atsushi Enomoto <atsushi@ximian.com>
11235 * doc.cs : apply "override filter" also to properties.
11238 2005-11-16 Atsushi Enomoto <atsushi@ximian.com>
11240 * doc.cs : renamed FindMembers() to FindMethodBase(). For interfaces,
11241 no need to check overrides. For classes, omit those results from
11242 interfaces since they must exist in the class. Fixed bug #76726.
11244 2005-11-15 Atsushi Enomoto <atsushi@ximian.com>
11246 * typemanager.cs : (GetFullNameSignature) differentiate indexers
11247 with different parameters. Fixed the second problem in #76685.
11249 2005-11-15 Atsushi Enomoto <atsushi@ximian.com>
11251 * doc.cs : (FindDocumentedMember) pass invocation_type as well (to
11252 get expected 'protected' access in CheckValidFamilyAccess()).
11255 2005-11-15 Atsushi Enomoto <atsushi@ximian.com>
11257 * doc.cs : (GenerateTypeDocComment) Fields could be FixedField.
11258 Fixed bug #76705. CS1569 was incorrectly commented out.
11260 2005-11-14 Atsushi Enomoto <atsushi@ximian.com>
11262 * doc.cs : use Invocation.IsOverride() to do real override check.
11263 * expression.cs : made Invocation.IsOverride() internal.
11265 2005-11-14 Atsushi Enomoto <atsushi@ximian.com>
11267 * doc.cs : use TypeManager.FindMembers() instead of (possible)
11268 TypeBuilder.FindMembers() and filter overriden base members out.
11271 2005-11-13 Atsushi Enomoto <atsushi@ximian.com>
11273 * doc.cs : ref/out parameters are represented as '@' (instead of
11274 '&' in type FullName). Fixed bug #76630 (additionally crefs).
11276 2005-11-13 Atsushi Enomoto <atsushi@ximian.com>
11278 * doc.cs : when there was no '.' in cref to methods in doc comment,
11279 then parameters were missing in the output. Fixed bug #76691.
11281 2005-11-13 Atsushi Enomoto <atsushi@ximian.com>
11283 * driver.cs : don't output docs when there is an error.
11286 2005-11-13 Atsushi Enomoto <atsushi@ximian.com>
11289 Now it should detect indexers. Fixed primary concern in bug #76685.
11290 Fixed CS0419 message to not show the identical member signature in
11293 2005-11-13 Atsushi Enomoto <atsushi@ximian.com>
11295 * doc.cs : (FindDocumentedMember) use TypeManager.MemberLookup()
11296 instead of Type.FindMembers() since it does not handle events.
11299 2005-11-12 Gert Driesen <drieseng@users.sourceforge.net>
11301 * codegen.cs: Fixed typo (speficied -> specified).
11303 2005-11-11 Marek Safar <marek.safar@seznam.cz>
11306 * doc.cs (FindDocumentedTypeNonArray): Don't resolve again.
11308 2005-11-11 Marek Safar <marek.safar@seznam.cz>
11310 * attribute.cs: Changed error message.
11312 * cs-tokenizer.cs: One more check.
11314 2005-11-10 Marek Safar <marek.safar@seznam.cz>
11316 * statement.cs (Block.Resolve): Ignore empty statement.
11318 2005-11-10 Marek Safar <marek.safar@seznam.cz>
11320 * report.cs: Made error/warning methods more strict to avoid
11323 * anonymous.cs, attribute.cs, class.cs, codegen.cs, constant.cs,
11324 convert.cs, cs-parser.jay, cs-tokenizer.cs, decl.cs, delegate.cs,
11325 doc.cs, driver.cs, ecore.cs, expression.cs, location.cs,
11326 namespace.cs, parameter.cs, statement.cs, typemanager.cs: Updated.
11328 2005-11-08 Marek Safar <marek.safar@seznam.cz>
11330 * attribute.cs (Attribute.GetCoClassAttributeValue): New method.
11331 (AttributeTester.GetCoClassAttribute): Get CoClassAttribute.
11333 * class.cs (TypeContainer.IsComImport): New property.
11334 (Constructor.Define): Create proper ctor for ComImport types.
11336 * expression.cs (New.CheckComImport): Fixed.
11338 2005-11-07 Miguel de Icaza <miguel@novell.com>
11340 * anonymous.cs (CaptureContext.AddParameterToContext): The fact
11341 that a parameter has been captured does not mean that we do not
11342 have to do the rest of the processing. This fixes the second part
11343 of #76592. If there was another anonymous method capturing
11344 values in the past, the Scope would never be set for the second
11345 method that captured the same parameter.
11347 (CaptureContext.EmitAssignParameter): When `leave_copy' is passed,
11348 properly manipulate the stack. Second part of fix for #76592.
11350 * expression.cs (New): Add support for invoking "new" on
11351 interfaces that have been flagged with the ComImport attribute and
11352 the CoClass. Fixes #76637
11354 * statement.cs (Try.DoEmit): When a variable is captured, do not
11355 try to emit the vi.LocalBuilder variable as it has been captured.
11356 Create a temporary variable and store the results on the
11357 FieldBuilder. Fixes #76642
11359 2005-11-07 Marek Safar <marek.safar@seznam.cz>
11361 * class.cs (CheckPairedOperators): Made compilable with csc 2.0.
11363 * ecore.cs (InstanceResolve): Fixed CS1540 detection.
11365 * expression.cs (Binary.DoResolve): Added && optimalization.
11367 * typemanager.cs (AddUserType): Removed useless argument.
11369 2005-11-04 Marek Safar <marek.safar@seznam.cz>
11371 * statement.cs (Block.variables): Uses ListDictionary.
11373 2005-11-03 Marek Safar <marek.safar@seznam.cz>
11376 * class.cs (PartialContainer.EmitType): Customized to emit
11377 security attributes.
11378 (ClassPart.ApplyAttributeBuilder): Transform security attribute
11379 for partial classes.
11381 2005-11-03 Marek Safar <marek.safar@seznam.cz>
11384 * expression.cs (ElementAccess.DoResolveLValue): Fixed buffer
11385 access has to be fixed.
11387 * typemanager.cs (IsUnmanagedType): Wrong common field type.
11389 2005-11-01 Marek Safar <marek.safar@seznam.cz>
11392 * ecore.cs (NullCast.Reduce): Implemented.
11394 * expression.cs (ArrayCreation.CheckIndices): Correcly check
11397 * statement.cs (SwitchLabel.ResolveAndReduce): Catch null
11399 (Foreach.Resolve): Catch null properly.
11401 2005-10-29 Marek Safar <marek.safar@seznam.cz>
11403 * cs-tokenizer.cs: Warning text fix.
11405 * driver.cs: AllWarningNumbers exposed on public interface.
11407 * report.cs (): Reviewed warning numbers.
11408 (IsValidWarning): Use binary search.
11410 2005-10-29 Marek Safar <marek.safar@seznam.cz>
11412 * driver.cs: Implemeted resource visibility.
11413 (Resources): New class for code sharing between /res: and
11416 2005-10-28 Marek Safar <marek.safar@seznam.cz>
11419 * cfold.cs (ConstantFold.BinaryFold): Implemented null cast
11422 * convert (Convert.ImplicitReferenceConversion): NullCast holds
11425 * ecore.cs (NullCast): Child is contant only.
11427 * literal.cs (NullLiteral.Reduce): null can be converted to any
11430 2005-10-28 Kornél Pál <kornelpal@hotmail.com>
11432 * driver.cs: Use Encoding.Default as default code page instead
11435 2005-10-27 Raja R Harinath <rharinath@novell.com>
11438 * expression.cs (Invocation.Error_InvalidArguments): Handle
11439 __arglist parameters.
11440 (Invocation.VerifyArgumentsCompat): Likewise.
11441 * support.cs (ReflectionParameters.GetSignatureForError): Print
11442 __arglist parameters.
11443 (InternalParamters.GetSignatureForError): Likewise.
11444 * parameter.cs (Parameters.GetSignatureForError): Likewise.
11446 2005-10-26 Marek Safar <marek.safar@seznam.cz>
11448 * attribute.cs (GetPropertyValue): Made public.
11450 * codegen.cs (AssemblyClass): ResolveClsCompliance renamed to
11452 Add new property WrapNonExceptionThrows to handle 2.0 assembly
11454 (AssemblyClass.Emit): Emit RuntimeCompatibilityAttribute when it
11457 * driver.cs: Reflect method name change.
11459 * statement.cs (Try.Resolve): Warn when try has both general
11460 exception handlers.
11462 * typemanager.cs: runtime_compatibility_attr_type new predefined
11465 2005-10-26 Raja R Harinath <harinath@gmail.com>
11468 * pending.cs (InterfaceMethod): Allow tm.args [i] to be null --
11469 treat it as an empty parameter list.
11471 2005-10-26 Raja R Harinath <rharinath@novell.com>
11474 * ecore.cs (SimpleName.DoSimpleNameResolve): Make fall-back
11475 ResolveAsTypeStep silent.
11476 * statement.cs (Block.AddConstant): Mark block as used.
11477 (Block.ResolveMeta): Avoid piling on error messages
11478 if a constant initializer resolution fails.
11480 2005-10-25 Raja R Harinath <rharinath@novell.com>
11482 * namespace.cs (RootNamespace.VerifyUsingForAll, Namespace.VerifyUsing):
11484 (NamespaceEntry.VerifyAllUsing): New.
11485 (NamespaceEntry.AliasEntry.Resolve): New. Handles common error
11486 behaviour. Delegates actual resolution of alias to ...
11487 (NamespaceEntry.DoResolve): ... this. Renamed from Resolve.
11488 (NamespaceEntry.LocalAliasEntry, NamespaceEntry.ExternAliasEntry):
11490 * driver.cs (Driver.MainDriver): Update.
11492 * namespace.cs (NamespaceEntry.DefineNamespace): Remove.
11493 (NamespaceEntry.SymbolFileID): Make into a on-demand computed
11495 (Namespace.DefineNamespaces, RootNamespace.DefineNamespacesForAll):
11497 * symbolwriter.cs (SymbolWriter.Initialize): Don't call
11498 RootNamespace.DefineNamespacesForAll.
11500 2005-10-24 Raja R Harinath <harinath@gmail.com>
11502 * typemanager.cs (assemblies, external_aliases, modules)
11503 (AddAssembly, AddExternAlias, AddModule GetAssemblies, Modules)
11504 (ComputeNamespaces, GetRootNamespace): Remove extra staging
11505 overhead. Move resposibility ...
11506 * namespace.cs (GlobalRootNamespace): ... here. Update to changes.
11507 * driver.cs, attribute.cs, codegen.cs: Update to changes.
11509 2005-10-23 Raja R Harinath <harinath@gmail.com>
11511 * namespace.cs (RootNamespace.all_namespaces): Renamed from
11512 cached_namespaces. Improve usage.
11513 (RootNamespace.Reset, RootNamespace.RegisterNamespace)
11514 (RootNamespace.VerifyUsingForAll, RootNamespace.DefineNamespacesForAll):
11515 Move from GlobalRootNamespace and simplify.
11516 (RootNamespace.Global): Make instance variable.
11517 (RootNamespace.RootNamespace): Add "alias name" parameter.
11518 (GlobalRootNamespace): Simplify drastically.
11519 (Namespace.Lookup): Don't use GetNamespace.
11520 * typemanager.cs (GetRootNamespace): Rename from
11521 ComputeNamespaceForAlias.
11522 (NamespaceClash): Use Global.IsNamespace instead of GetNamespace.
11524 2005-10-23 Marek Safar <marek.safar@seznam.cz>
11526 * anonymous.cs (AnonymousContainer): Don't crash when container
11529 2005-10-23 Marek Safar <marek.safar@seznam.cz>
11531 * expression.cs (Binary.DoResolve): Warn when comparing same
11534 2005-10-23 Marek Safar <marek.safar@seznam.cz>
11537 * expression.cs (Binary.DoResolve): It looks like there are no
11538 convetsion rules in enum context.
11540 2005-10-19 Carlos Alberto Cortez <calberto.cortez@gmail.com>
11542 Add support for extern alias qualifiers.
11543 * typemanager.cs: Move some LookupTypeReflection code
11544 to namespace.cs, to have cleaner code. Added some methods
11545 to help us keep track of the extern aliased references.
11546 * driver.cs: Add suport for extern alias assemblies on command
11547 line and check for their warnings/errors. Also keep track of the
11548 extern aliased assemblies.
11549 * namespace.cs: Move the global functionality of Namespace
11550 to GlobalRootNamespace/RootNamespace. Now the global namespace
11551 is GlobalRootNamespace.Globa. Also the code moved from
11552 typemanager.cs lives in GlobalRootNames.cs/RootNamespace.cs.
11553 Finally added LocalAliasEntry (AliasEntry before) and
11554 ExternAliasEntry, to handle alias statements.
11555 * cs-parser.jay: Add support in the grammar for extern alias
11557 * doc.cs, delegate.cs, expression.cs ecore.cs, symbolwriter.cs:
11558 Update callings to Namespace (now in GlobalRootNamespace).
11560 2005-10-18 Raja R Harinath <rharinath@novell.com>
11563 * class.cs (TypeContainer.DefineType): Move updating of
11564 topological sort earlier in the code.
11565 * decl.cs (DeclSpace.ResolveBaseTypeExpr): Don't use TypeBuilder.
11567 2005-10-18 Marek Safar <marek.safar@seznam.cz>
11570 * cfold.cs (BinaryFold): Reduce constant in enum conversion.
11572 * constant.cs (Constant.TryReduce): Moved from Cast class.
11573 (Reduce): Made little bit more OO and fixed missing conversions.
11575 * ecore.cs (Reduce): Implemented.
11576 (Binary.EnumLiftUp): New method to upgrade values to enum values.
11578 * literal.cs (Reduce): Implemented.
11580 * class.cs: Reverted Miguel's wrong commit.
11582 2005-10-14 Miguel de Icaza <miguel@novell.com>
11584 * ecore.cs (GetMemberType): Report the correct mapping for the MemberCore
11586 2005-10-14 Atsushi Enomoto <atsushi@ximian.com>
11588 * cs-parser.jay, expression.cs : CS0214 was missing error location
11589 for constants. Fixed bug #76404.
11591 2005-10-11 Marek Safar <marek.safar@seznam.cz>
11594 * convert.cs (ExplicitConversionCore): Fixed object->enum
11597 2005-10-10 Raja R Harinath <rharinath@novell.com>
11599 * ecore.cs (PropertyExpr.Emit): Use Invocation.EmitCall to emit
11600 InstanceExpression.
11601 (PropertyExpr.EmitCall): Likewise.
11602 * expression.cs (Invocation.EmitArguments): Handle case where
11604 (Invocation.EmitCall): Avoid allocating temporary variable if
11605 there are no arguments.
11607 2005-10-07 Raja R Harinath <rharinath@novell.com>
11610 * convert.cs (ImplicitConversionStandard): Move conversion of
11611 void* to arbitrary pointer types ...
11612 (ExplicitConversionStandard): .. here.
11613 * ecore.cs (Expression.Error_ValueCannotBeConverted): Fix CS0266
11614 error to always print typenames.
11616 2005-10-07 Raja R Harinath <rharinath@novell.com>
11618 * convert.cs (GetConversionOperator): Rename from
11619 GetConversionOperators. Move operator selection code from ...
11620 (UserDefinedConversion): ... here.
11622 2005-10-06 Marek Safar <marek.safar@seznam.cz>
11624 * convert.cs (ExplicitConversionCore): Removed duplicate enum
11627 2005-10-05 Marek Safar <marek.safar@seznam.cz>
11629 * assign.cs (Assign.DoResolve): Error method changed.
11631 * cfold.cs (DoConstantNumericPromotions): Error method changed.
11633 * const.cs (ResolveValue): Reset in_transit immediately.
11635 * constant.cs: Error method changed.
11637 * convert.cs: Removed useless location parameter.
11638 (ExplicitNumericConversion): Don't do double enum check.
11639 (ExplicitConversionCore): Renamed from ExplicitConversion.
11640 (ExplicitUnsafe): Extracted from ExplicitConversion.
11641 (ExplicitConversion): Uses for error reporting.
11643 * ecore.cs (Error_ValueCannotBeConverted): More logic for more
11645 (ResolveBoolean): Uses common error method.
11646 (CastToDecimal): Get rid of ec.
11647 (CastFromDecimal): Optimized.
11648 (ConvCast): Get rid of ec.
11650 * enum.cs (ResolveValue): Reset in_transit immediately.
11651 (Emit): Return after first error.
11653 * expression.cs: Convert changes.
11655 * literal.cs: Error method changed.
11657 * statement.cs: Error method changed.
11659 2005-10-03 Raja R Harinath <rharinath@novell.com>
11661 * support.cs (SeekableStreamReader.Position): Don't error out when
11662 the requested position is just beyond the end of the current
11665 2005-09-28 Raja R Harinath <rharinath@novell.com>
11667 * support.cs (SeekableStreamReader): Simplify drastically. Don't
11668 try to keep in sync with the byte count of the underlying Stream.
11669 However, this limits us to a window size of 2048 characters: i.e.,
11670 the maximum lookahead of our lexer/parser can be 2048 characters.
11672 2005-09-28 Marek Safar <marek.safar@seznam.cz>
11675 * driver.cs: Fix compilation files with full root path.
11677 2005-09-25 Miguel de Icaza <miguel@novell.com>
11679 * report.cs (SymbolRelatedToPreviousError): Format the output so
11680 it does not use an open parenthesis that is never closed.
11682 * driver.cs: Follow coding guidelines
11684 2005-09-27 Marek Safar <marek.safar@seznam.cz>
11687 * const.cs (Const.ResolveValue): Check for assigning non-null
11688 value to reference type.
11690 2005-09-27 Marek Safar <marek.safar@seznam.cz>
11692 * anonymous.cs: Implemented ExprClassName.
11694 * assign.cs (Assign.DoResolve): Don't chrash when type is not
11697 * attribute.cs (ResolveArguments): Enabled MethodImplOptions
11700 * class.cs (StaticClass.DefineContainerMembers): Report protected
11703 * codegen.cs: if(ed) PRODUCTION.
11705 * convert.cs (Error_CannotImplicitConversion): Better error
11708 * cs-parser.jay: More error checks.
11710 * cs-tokenizer.cs (consume_identifier): Fixed Miguel's revert.
11712 * driver.cs (CSCParseOption): Enabled wrong option check.
11714 * ecore.cs (Expression.ExprClassName): Turned to property.
11715 (MemberExpr.CheckIntermediateModification): For checking boxed
11716 value types modification.
11718 * statement.cs (Fixed.Resolve): Expression type must be
11719 convertible to fixed type.
11720 (CollectionForeach.GetEnumeratorFilter,TryType):
11721 Small refactoring for easier error checking.
11723 2005-09-26 Marek Safar <marek.safar@seznam.cz>
11725 * attribute.cs (Attribute.Resolve): Check Obsolete attribute for
11728 * class.cs (GeneratedBaseInitializer): New class for customization
11729 compiler generated initializers.
11730 (MemberBase.DoDefine): Check Obsolete attribute here.
11731 (FieldMember.DoDefine): Ditto.
11733 * const.cs (ExternalConstant.CreateDecimal): Builder for decimal
11736 * decl.cs (MemberCore.EmitContext): Returns valid current ec.
11737 (MemberCore.GetObsoleteAttribute): Removed argument.
11738 (MemberCore.CheckObsoleteness): Obsolete attributes are hierarchic.
11739 (MemberCore.CheckObsoleteType): New helper.
11743 * statement.cs: Updates after MemberCore changes.
11745 * ecore.cs (TypeExpr.ResolveType): Check type obsoleteness here.
11746 (FieldExpr.ResolveMemberAccess): Fixed decimal constants checks.
11748 * expression.cs (ComposedCast.DoResolveAsTypeStep): Don't check
11749 obsolete attribute for compiler construct.
11750 (As.DoResolve): Cache result.
11752 * iterators.cs (Define_Constructor): Use GeneratedBaseInitializer.
11754 2005-09-26 Raja R Harinath <rharinath@novell.com>
11757 * expression.cs (This.VerifyFixed): In a value type T, the type of
11758 'this' is T&, iow, 'this' is either an out or ref parameter. In a
11759 value type R, 'this' is treated as a value parameter.
11761 2005-09-22 Miguel de Icaza <miguel@novell.com>
11763 * statement.cs (Lock): Use the TemporaryVariable class instead of
11764 manually using local variables as those do not work when variables
11767 * ecore.cs: Moved the TemporaryVariable class from being a nested
11768 class inside Foreach to be a public class that can be employed in
11771 2005-09-19 Marek Safar <marek.safar@seznam.cz>
11773 * cs-parser.jay: interface_accessors replaced by
11774 accessor_declarations.
11776 * ecore.cs, literal.cs, statement.cs: NullLiteral holds null
11779 * statement.cs (GotoCase.Resolve): Convert null constant to
11781 (SwitchLabel.ResolveAndReduce): Ditto.
11782 (SwitchLabel.NullStringCase): Custom null stamp.
11783 (Switch.SimpleSwitchEmit): Fix from NullLiteral to NullStringCase.
11785 typemanager.cs (CSharpSignature): Don't skip first argument
11788 2005-09-18 Miguel de Icaza <miguel@novell.com>
11790 * driver.cs: Set InEmacs based on the environment variable EMACS.
11792 * location.cs (InEmacs): in this mode, do not report column
11793 location as it confuses Emacs.
11795 2005-09-16 Marek Safar <marek.safar@seznam.cz>
11797 * cfold.cs, constant.cs, convert.cs, ecore.cs,
11798 expression.cs, iterators.cs, literal.cs: Store constants and
11801 * class.cs (MemberBase.ShortName): Pass location.
11803 * cs-parser.jay: Some location fixes.
11805 * ecore.cs (Expression.Location): Made virtual.
11807 2005-09-05 Miguel de Icaza <miguel@novell.com>
11809 * expression.cs (Cast.TryReduce): Only reduce to an EnumConstant
11810 if the underlying types are the same, otherwise we need to produce
11811 code that will do the proper cast.
11813 This was exposed by Marek's constant rewrite which produced
11814 invalid code for the call site:
11816 enum X : long { a }
11817 void Method (X v) {}
11821 This fixes test-49.cs
11823 2005-09-05 Atsushi Enomoto <atsushi@ximian.com>
11825 * attribute.cs : (Attribute.IsValidArgumentType): array of string/
11826 Type/Object should be allowed as well. Fixed bug #75968.
11828 2005-09-05 Atsushi Enomoto <atsushi@ximian.com>
11830 * expression.cs : (Binary.DoResolve): when one is enum constant and
11831 another is constant 0, then return enum one *as enum type*.
11834 2005-09-02 Raja R Harinath <rharinath@novell.com>
11836 * attribute.cs (GetMarshal): Work even if "DefineCustom" is
11840 * ecore.cs (SimpleNameResolve.DoSimpleNameResolve): Disable
11841 flow-branching for LocalVariableReferences in case we were invoked
11842 from a MemberAccess.
11843 * expression.cs (LocalVariableReference.VerifyAssigned): New.
11845 (LocalVariableReference.DoResolveBase): ... this.
11846 (MemberAccess.Resolve): Do the check that was disabled during
11849 2005-09-01 Atsushi Enomoto <atsushi@ximian.com>
11852 (PartialContainer.Create): check abstract/sealed/static strictly
11853 but abstract/sealed can exist only at one side. Fixed bug #75883.
11855 2005-09-01 Kornél Pál <kornelpal@hotmail.com>
11858 * attribute.cs (Attribute.GetMarshal): If ArraySubType is not
11859 specified, don't default to UnmanagedType.I4.
11861 2005-09-01 Atsushi Enomoto <atsushi@ximian.com>
11863 * expression.cs : conditional operator should check possibly
11864 incorrect assign expression. Fixed bug #75946.
11866 2005-08-31 Atsushi Enomoto <atsushi@ximian.com>
11868 * cs-tokenizer.cs, cs-parser.jay, driver.cs, support.cs :
11869 Reverting the change. gmcs is much complex than mcs on this matter.
11871 2005-08-31 Atsushi Enomoto <atsushi@ximian.com>
11873 * cs-tokenizer.cs : To read another token ahead of the actual
11874 consumption, use new SavedToken and cache token instead of moving
11875 back the stream with SeekableStreamReader (it seemed problematic).
11877 driver.cs : Thus use StreamReader directly.
11878 * support.cs : Thus removed SeekableStreamReader.
11880 2005-08-30 Raja R Harinath <rharinath@novell.com>
11883 * anonymous.cs (ScopeInfo.MakeFieldName): New helper.
11884 (ScopeInfo.EmitScopeType): Use it to construct field names from
11885 names of captured locals.
11888 * ecore.cs (BoxedCast.BoxedCast) [1-argument variant]: Remove.
11889 * convert.cs (ImplicitReferenceConversion, TryImplicitIntConversion):
11890 Pass 'target_type' to BoxedCast. Don't default to 'object'.
11891 (ExplicitConversion): Remove enum cases already handled by
11892 implicit conversion. Move implicit conversion check to the beginning.
11893 * delegate.cs (DelegateCreation.ResolveMethodGroupExpr): Update.
11894 * expression.cs (ArrayCreation.EmitDynamicInitializers):
11895 Don't treat System.Enum as a struct.
11897 2005-08-30 Jb Evain <jbevain@gmail.com>
11899 * attribute.cs: handles as expression in parameters.
11901 2005-08-30 Raja R Harinath <rharinath@novell.com>
11904 * class.cs (TypeContainer.VerifyClsName): Don't use a
11905 PartialContainer when verifying CLS compliance.
11906 (AbstractPropertyEventMethod): Set Parent here, ...
11907 (PropertyMethod): ... not here.
11909 2005-08-30 Atsushi Enomoto <atsushi@ximian.com>
11911 * attribute.cs : escaped attribute name should not be allowed to be
11912 resolved (e.g. @class as classAttribute). Fixed bug #75930.
11914 2005-08-29 Raja R Harinath <rharinath@novell.com>
11917 * convert.cs (ImplicitStandardConversionExists): Allow zero also
11918 when converting a long constant to unsigned long.
11919 * expression.cs (Invocation.OverloadResolve): Add sanity check to
11920 detect where IsApplicable and VerifyArgumentsCompat disagree.
11922 2005-08-29 Raja R Harinath <rharinath@novell.com>
11923 and Carlos Alberto Cortez <carlos@unixmexico.org>
11926 * class.cs (TypeContainer.CanElideInitializer): New helper.
11927 (TypeContainer.EmitFieldInitializers): Use it to determine if we
11928 can safely emitting the initializer of a field.
11930 2005-08-25 Atsushi Enomoto <atsushi@ximian.com>
11932 * statement.cs : (Continue.Resolve()) Unlike break, continue is not
11933 allowed inside a switch (without loop). Fixed bug #75433.
11935 2005-08-26 Kornél Pál <kornelpal@hotmail.com>
11937 * AssemblyInfo.cs: Using Consts.MonoVersion instead of MonoVersion.cs.
11938 * mcs.exe.sources: Using Consts.MonoVersion instead of MonoVersion.cs.
11940 2005-08-25 Atsushi Enomoto <atsushi@ximian.com>
11942 * driver.cs : kinda reverting the default encoding changes (not exact
11943 revert since I noticed that "codepage:reset" might not work fine).
11945 2005-08-25 Atsushi Enomoto <atsushi@ximian.com>
11947 * class.cs : (AbstractPropertyEventMethod) SetupName() now takes
11948 Location. Now getter and setter store location correctly.
11949 (errors/cs0111-12.cs now reports the expected location.)
11951 2005-08-25 Atsushi Enomoto <atsushi@ximian.com>
11953 * driver.cs : Use default encoding on the environment.
11954 Removed (now that) extra parameter for SeekableStreamReader.
11955 * support.cs : (SeekableStreamReader) third .ctor() argument for
11956 StreamReader is not required (always true). preamble size could
11957 be acquired in simpler and safe way.
11959 2005-08-24 Atsushi Enomoto <atsushi@ximian.com>
11961 * cs-parser.jay: report CS0642 at warning level 3
11962 and report CS0642 for an if else statement also
11963 fixes bug #74745. Patch by John Luke (and a bit
11965 Removed extra CS0642 warning check for "while",
11967 * statement.cs: In Block.Resolve(), CS0642 check
11968 is reimplemented to check a sequence of an empty
11969 statement and a block.
11971 Both fix bug #66777.
11973 2005-08-24 Marek Safar <marek.safar@seznam.cz>
11975 * attribute.cs (GetMethodObsoleteAttribute): Disabled obsolete properties
11976 detection until I fix it.
11978 * cs-tokenizer.cs: Changed error message.
11980 * cs-parser.jay: Fixed 2 error locations.
11982 * ecore.cs (Error_TypeDoesNotContainDefinition): Share error message.
11983 (PropertyExpr.Error_PropertyNotFound): First attempt to detect non C#
11986 * enum.cs (GetSignatureForError): Fixed.
11988 * expression.cs (Invocation.IsSpecialMethodInvocation): Improved special
11992 * typemanager.cs (RegisterProperty): Removed.
11994 * statement.cs (CheckInvariantMeaningInBlock): Changed error message.
11996 2005-08-24 Raja R Harinath <rharinath@novell.com>
11999 * expression.cs (ArrayAccess.EmitLoadOpcode): Emit ldelem.i for pointers.
12000 (ArrayAccess.GetStoreOpcode): Return stelem.i for pointers.
12002 2005-08-23 Atsushi Enomoto <atsushi@ximian.com>
12004 * expression.cs : tiny fix is required for not warning positive ulong.
12007 2005-08-23 Atsushi Enomoto <atsushi@ximian.com>
12009 * expression.cs : add CS0652 check for constant and integral
12010 expression. Fixed bug #53974.
12012 2005-08-23 Atsushi Enomoto <atsushi@ximian.com>
12014 * expression.cs : in DoNumericPromotions(), check if there is implicit
12015 conversion overload for string (to check CS0034). Fixed bug #52492.
12017 2005-08-23 Atsushi Enomoto <atsushi@ximian.com>
12019 * cs-tokenizer.cs : Check newline in char constant. Fixed bug #75245.
12021 2005-08-23 Atsushi Enomoto <atsushi@ximian.com>
12023 * ecore.cs : report location when it is *not* Null.
12025 2005-08-23 Atsushi Enomoto <atsushi@ximian.com>
12031 Added OmitStructFlowAnalysis to EmitContext to handle CS0165 check
12032 correctly. Fixed bug #75721.
12034 2005-08-23 Raja R Harinath <rharinath@novell.com>
12036 * support.cs (SeekableStreamReader.Position): Avoid an expensive
12037 loop that performs 'min (pos, char_count)'.
12040 * expression.cs (Unary.ResolveOperator): Don't discard implicit
12041 converted value in Operator.OnesComplement.
12043 2005-08-22 Ben Maurer <bmaurer@ximian.com>
12045 * anonymous.cs: If the anon method is pulled into a helper class,
12046 it needs to be `internal' not `private'. Fixes runtime behavior on
12049 2005-08-20 Martin Baulig <martin@ximian.com>
12051 * anonymous.cs (CaptureContext.CaptureThis): Create the topmost
12052 scope if we don't already have it.
12054 * expression.cs (Invocation.EmitCall): Use `ec.EmitThis ()' rather
12055 than `ig.Emit (OpCodes.Ldarg_0)' to make it work inside iterators;
12058 2005-08-17 Marek Safar <marek.safar@seznam.cz>
12061 * decl.cs (DeclSpace.VerifyClsCompliance): Skip when collision object
12062 is a partial class.
12064 2005-08-16 Marek Safar <marek.safar@seznam.cz>
12066 The big constants rewrite
12067 Fix #75746, #75685 and more
12068 As a side effect saved 1MB for MWF ;-)
12070 * attribute.cs (GetAttributeArgumentExpression): Use ToType, GetTypedValue.
12071 (GetMarshal, GetMethodImplOptions, GetLayoutKindValue): Values are not
12072 enum based for corlib compilation.
12074 * cfold.cs (BinaryFold): Convert operand for enum additions. Fixed enum
12077 * class.cs (FixedField.Define): Use ResolveAsConstant.
12079 * const.cs (IConstant): Interface constants and enums.
12080 (Const.ResolveValue): New method for constant resolvning.
12081 (ExternalConstant): Constants from imported assemblies.
12083 * constant.cs (Constant.GetTypedValue): Used to get constant with forced
12084 conversion; like enums.
12085 (Constant.ToType): Converts this constant to different type.
12086 (Constant.Increment): Adds 1.
12088 * convert.cs (ImplicitConversionRequired): Simplified.
12090 * cs-parser.jay: Create EnumMember directly.
12092 * decl.cs (MemberCore.CheckObsoleteness): Checks for ObsoleteAttribute presence.
12094 * doc.cs (GenerateEnumDocComment): Removed.
12096 * ecore.cs (Expression.ResolveAsConstant): New constant specific method.
12097 (ConvertIntLiteral): Removed.
12098 (FieldExpr.ResolveMemberAccess): Refactored to remove constant specific if(s).
12100 * enum.cs (EnumMember): Implement IConstant.
12101 (Enum.IsValidEnumConstant): Removed.
12102 (Enum.GetNextDefaultValue): Removed.
12103 (Enum.FindMembers): Updated.
12104 (Enum.GenerateDocComment): Iterate enum members.
12106 * expression.cs (Cast.TryReduce): Handle enums correctly.
12107 (New.Constantify): Made public.
12108 (MemberAccess.DoResolve): Removed contant specific if(s).
12110 * literal.cs (NullLiteral): Implement new abstract methods.
12112 * statement.cs (GotoCase.Resolve): Use new constant methods.
12113 (SwitchLabel.ResolveAndReduce): Use new constant methods.
12115 * typemanager.cs (LookupEnum): Removed.
12116 (IsEnumType): Fixed to work with corlib.
12117 (RegisterConstant): Removed.
12118 (LookupConstant): Removed.
12119 (GetConstant): Changed to work with IConstant.
12121 2005-08-04 Atsushi Enomoto <atsushi@ximian.com>
12123 * location.cs : Fixed overflown (>255) column number.
12125 2005-08-03 Raja R Harinath <rharinath@novell.com>
12127 First cut of the qualified-alias-member feature.
12128 * cs-tokenizer.cs (Tokenizer.is_punct): Recognize the double-colon
12130 * cs-parser.jay (DOUBLE_COLON): New token.
12131 (namespace_or_type_name): Add rule for recognizing
12132 qualified-alias-members.
12133 (primary_expression): Likewise.
12134 (element_access): Allow QualifiedAliasMember as a possible
12135 type-bearing expression.
12136 (local_variable_type, local_variable_pointer_type): Likewise.
12137 * namespace.cs (NamespaceEntry.LookupAlias): New. Looks up
12138 aliases in the current and enclosing namespace declarations.
12139 (NamespaceEntry.UsingAlias): Add CS0440 warning.
12140 * decl.cs (MemberName.is_double_colon): New.
12141 (MemberName.MemberName): Add new constructor for alias-member.
12142 (MemberName.GetTypeExpression): Generate QualifiedAliasMember too.
12143 * expression.cs (QualifiedAliasMember): New expression type.
12145 2005-08-02 Atsushi Enomoto <atsushi@ximian.com>
12147 * location.cs : it borked when no argument was specified.
12149 2005-08-02 Atsushi Enomoto <atsushi@ximian.com>
12151 * location.cs : tiny ToString() format fix.
12153 2005-08-02 Atsushi Enomoto <atsushi@ximian.com>
12155 * statement.cs : oops, it was missing.
12157 2005-08-02 Atsushi Enomoto <atsushi@ximian.com>
12159 A set of fixes for precise line/column location.
12162 "token" field now holds a file/line "delta", a line number offset
12163 from the segment, and a column number. See also:
12164 http://lists.ximian.com/pipermail/mono-devel-list/2004-
12165 December/009508.html
12166 Removed static IsNull. Use instance IsNull property instead.
12167 * cs-tokenizer.cs :
12168 For some tokens it stores Location. For Identifier it stores
12169 LocatedToken which is a pair of string name and location.
12170 Column numbers are adjusted only at getChar().
12172 Use Location.ToString() for reporting (it now contains column).
12174 Largely modified to use LocatedToken instead of
12175 string (IDENTIFIER), and to acquire Location from some tokens.
12176 * namespace.cs, decl.cs, ecore.cs, class.cs, delegate.cs,
12177 iterators.cs, const.cs, anonymous.cs, tree.cs, enum.cs,
12179 Now MemberName holds Location. DeclSpace.ctor() receives Location
12180 as a parameter. Removed extra parameters to all derived classes.
12181 Replaced Location.IsNull() with instance property.
12182 * assign.cs, expression.cs :
12183 Added .ctor() overload that omits Location.
12185 Added "nameEscaped" flag that indicates the identifier was escaped
12186 in the source file. This fixes bug #57047.
12188 2005-08-02 Marek Safar <marek.safar@seznam.cz>
12190 * attribute.cs (AttributeTester.GetImportedIgnoreCaseClsType):
12191 New method, looking for lo-case imported cls type.
12193 * decl.cs (DeclSpace.VerifyClsCompliance): Check CS3005 for types
12196 * driver.cs: Removed VerifyTopLevelNameClsCompliance usage.
12198 * enum (Enum.VerifyClsCompliance): Hardcode non-compliant types.
12200 * typemanager.cs (TypeManager.AllClsTopLevelTypes): Renamed from
12201 all_imported_types.
12202 (TypeManager.LoadAllImportedTypes): Lo-case imported types.
12204 Optimized to save 3.5 MB for SWF compilation.
12206 2005-08-01 Marek Safar <marek.safar@seznam.cz>
12208 * class.cs (AddToTypeContainer): Use inheritance insted of if(s).
12209 (PartialContainer.Create): Moved logic AddToContainer.
12210 (PartialContainer.MarkForDuplicationCheck): Shares name.
12212 * decl.cs (DeclSpace.AddToContainer): Check name collisions at one
12215 * namespace.cs (Namespace.AddDeclSpace): Lazy declspaces
12217 (Namespace.GetSignatureForError): New method.
12219 * tree.cs (Tree.RecordDecl): Moved to AddToContainer.
12220 (RootTypes.AddToTypeContainer): se inheritance insted of if(s).
12222 2005-08-01 Raja R Harinath <rharinath@novell.com>
12225 * ecore.cs (Expression.MemberLookupFailed): Use queried_type for
12226 member lookup rather than qualifier_type, since qualifier_type can
12229 2005-08-01 Marek Safar <marek.safar@seznam.cz>
12231 * enum.cs (Enum.VerifyClsName): Fixed to allow not CLSCompliant
12234 2005-07-31 Miguel de Icaza <miguel@novell.com>
12236 * statement.cs: Copy the local exception into the exception
12237 captured local. Fixes 75674
12239 2005-07-31 Raja R Harinath <harinath@gmail.com>
12242 * expression.cs (Invocation.OverloadResolve): Don't report error
12243 CS1501 if error CS1502 has been reported.
12244 (New.DoResolve): Delegate CS1501 reporting to
12245 Invocation.OverloadResolve.
12248 * statement.cs (Block.CheckInvariantMeaningInBlock): Verify
12249 invariant-meaning-in-block property in an enclosing block if
12252 2005-07-29 Marek Safar <marek.safar@seznam.cz>
12254 * statement.cs (SwitchLabel.ResolveAndReduce): Refactored.
12255 (SwitchLabel.Erorr_AlreadyOccurs): Share error message.
12256 (Switch.CheckSwitch): Just save 50kb for SWF.
12258 2005-07-27 Martin Baulig <martin@ximian.com>
12260 * anonymous.cs (CaptureContext.AddField): Added
12261 `AnonymousContainer am' argument; compute its toplevel scope if
12262 it's not already computed. Fixes #75649.
12264 2005-07-26 Raja R Harinath <rharinath@novell.com>
12267 * class.cs (Constructor.Emit): Reset block to null if the block
12270 2005-07-25 Marek Safar <marek.safar@seznam.cz>
12272 * class.cs (TypeContainer.VerifyMembers): Be compatible in warning 169.
12274 2005-07-25 Marek Safar <marek.safar@seznam.cz>
12276 * class.cs (MethodData.Define): Check whether accessor implementing
12277 interface is public.
12279 * driver.cs (Driver.parse): Try to be smart and check for `MZ' header.
12281 2005-07-22 Marek Safar <marek.safar@seznam.cz>
12284 * namespace.cs (LookupType): Moved same type check to...
12286 * typemanager.cs (LookupTypeReflection): Don't allow to import more types
12287 with the same name.
12289 2005-07-21 Raja R Harinath <rharinath@novell.com>
12291 * namespace.cs (NamespaceLookupType): Avoid a string allocation when we
12292 already found a typebuilder.
12293 * class.cs (MethodCore.IsDuplicateImplementation): Compare
12294 MemberNames, not strings.
12296 * const.cs (Error_ExpressionMustBeConst):
12297 Rename from Error_EpressionMustBeConst.
12298 * const.cs, class.cs, statement.cd: Update.
12300 2005-07-21 Marek Safar <marek.safar@seznam.cz>
12304 * const.cs (Const.LookupConstantValue): Report missing contant expression
12306 (Error_EpressionMustBeConstant): Only one error method.
12308 * class.cs, statement.c: Updated.
12310 2005-07-20 Raja R Harinath <rharinath@novell.com>
12312 * statement.cs (Block.Flags): Add back HasVarargs.
12313 (Block.flags): Make protected.
12314 (ToplevelBlock.HasVarargs): Convert to a property that updates flags.
12316 * typemanager.cs (types, typecontainers, user_types): Remove.
12317 (UserTypes, TypeContainers): Likewise.
12318 (HandleDuplicate, AddDelegateType, AddEnumType): Likewise.
12319 (CleanUp, Reset): Update.
12320 (AddUserType): Combine variants. Now, only updates builder_to_declspace.
12321 (GetNestedType): Use Type.GetNestedType.
12322 (CoreLookupType): Take two arguments, the namespace and the
12323 basename of the type. Update to use the Namespace.Lookup
12325 (InitEnumUnderlyingTypes, InitCoreTypes): Update.
12326 (RealMemberLookup): Use IsNestedChildOf instead of playing with
12327 string concatenation and substring matches.
12328 * class.cs, enum.cs, delegate.cs: Update to changes.
12330 2005-07-20 Marek Safar <marek.safar@seznam.cz>
12332 * constant.cs (Constant.Error_ConstantValueCannotBeConverted): Moved from
12333 Expression and made virtual.
12335 * convert.cs (ImplicitReferenceConversionExists): Skip for value types.
12336 (ImplicitStandardConversionExists): Fixed `byte' typo ?
12338 * ecore.cs (Expression.Error_ConstantValueCannotBeConverted): Moved.
12340 * literal.cs (NullLiteral.Error_ConstantValueCannotBeConverted): Customize
12343 * convert.cs, ecore.cs, enum.cs: Reflect Error_ConstantValueCannotBeConverted
12346 2005-07-18 Marek Safar <marek.safar@seznam.cz>
12349 * codegen.cs (AssemblyClass.ApplyAttributeBuilder): Check whether
12350 AssemblyCultureAttribute is not used on executable.
12353 * typemanager.cs: Add System.Reflection.AssemblyCultureAttribute.
12355 2005-07-16 Raja R Harinath <rharinath@novell.com>
12358 * expression.cs (Binary.Warning_UnintendeReferenceComparison):
12359 New. Reports CS0252/CS0253.
12360 Mostly taken from preliminary patch by Duncak Mak.
12361 (Binary.DoResolveOperator): Store results of operator lookup.
12362 Use them to detect if we need to warn about unintended reference
12365 2005-07-15 Raja R Harinath <rharinath@novell.com>
12368 * namespace.cs (Namespace.Lookup): Add back location parameter.
12369 (Namespace.LookupType): Add CS0436 report. Add location parameter.
12370 * delegate.cs, ecore.cs, expression.cs: Update to changes.
12372 * codegen.cs (EmitContext.DeclSpace): Make readonly.
12373 * namespace.cs (Namespace.Lookup): Carve out type lookup into ...
12374 (Namespace.LookupType): ... this.
12375 (NamespaceEntry.GetUsingTable): Allocate only one zero-sized array
12377 * typemanager.cs (LookupTypeReflection): Remove buggy code that
12378 purported to handle pointers.
12379 (char_ptr_type, void_ptr_type): Use GetPointerType rather than
12382 2005-07-15 Marek Safar <marek.safar@seznam.cz>
12384 * expression.cs (MemberAccess.ResolveNamespaceOrType): Don't report nested
12387 2005-07-15 Raja R Harinath <rharinath@novell.com>
12389 * namespace.cs (Namespace.Lookup): Drop location parameter.
12390 (NamespaceEntry.LookupAlias): Remove. Merge into ...
12391 (NamespaceEntry.Lookup): ... this.
12392 (NamespaceEntry.Error_AmbiguousTypeReference):
12393 Move here from DeclSpace.
12394 (NamespaceEntry.LookupNamespaceOrType): Move support for dotted
12396 * ecore.cs (TypeLookupExpression.DoResolveAsTypeStep): ... here.
12397 * decl.cs (DeclSpace.ErrorAmbiguousTypeReference):
12398 Move to NamespaceEntry.
12399 * delegate.cs, expression.cs: Update to changes.
12401 2005-07-14 Marek Safar <marek.safar@seznam.cz>
12403 * attribute.cs (Attribute.ResolveAttributeType): Renamed from
12404 CheckAttributeType and refactored.
12405 (Attribute.ResolvePossibleAttributeType): Changed to reuse
12406 ResolveAsTypeTerminal error handling.
12407 (ResolveAsTypeTerminal): Introduced because of global attributes extra
12409 (GetSignatureForError): Print errors in same way.
12412 * codegen.cs: Reflect attribute GetSignatureForError change.
12415 * expression.cs: Add silent parameter to ResolveAsTypeStep.
12417 * namespace.cs (UsingEntry): Refactored to make fields private.
12420 statement.cs: Error_UnexpectedKind has extra parameter.
12422 2005-07-14 Raja R Harinath <rharinath@novell.com>
12424 * ecore.cs (IAlias): Remove.
12425 * decl.cs (DeclSpace): Don't derive from IAlias. Remove members
12426 that implement the interface.
12427 * namespace.cs (Namespace): Likewise.
12428 (Namespace.declspaces): Renamed from 'defined_names'.
12429 (Namespace.AddDeclSpace): Renamed from 'DefineName'. Take a
12430 DeclSpace instead of an IAlias.
12431 * tree.cs (Tree.AddDecl): Update.
12433 2005-07-12 Raja R Harinath <rharinath@novell.com>
12435 * statement.cs (Block.Flags); Remove HasVarargs.
12436 (Block.HasVarargs): Move to ToplevelBlock.
12437 (Block.ThisVariable, Block.AddThisVariable): Likewise.
12438 (Block.Variables): Make protected. Initialize variable hashtable
12440 (Block.AddVariable): Update.
12441 (Block.Resolve): Update to changes.
12442 (ToplevelBlock.HasVarargs): New boolean.
12443 (ToplevelBlock.ThisVariable): Move here from Block.
12444 (ToplevelBlock.AddThisVariable): Likewise.
12445 (ToplevelBlock.IsThisAssigned): New. Forwards call to this_variable.
12446 * expression.cs (This.ResolveBase): Update to changes.
12447 (ArglistAccess.DoResolve): Likewise.
12449 2005-07-11 Marek Safar <marek.safar@seznam.cz>
12452 * ecore.cs, class.cs: Use SetAssigned instead of direct access.
12454 * class.cs (TypeContainer.VerifyMembers): Distinguish between
12455 not used and not used & assigned.
12456 (FieldBase.ASSIGNED): Moved to MemberCore.Flags.
12458 2005-07-11 Marek Safar <marek.safar@seznam.cz>
12461 * expression.cs (Is.DoResolve): null is never provided type.
12463 2005-07-08 Marek Safar <marek.safar@seznam.cz>
12466 * cs-parser.jay: Less strict event error rule to catch more errors.
12468 2005-07-08 Martin Baulig <martin@ximian.com>
12470 Fix test-iter-10.cs - distinguish whether we `yield' in a property
12471 gettter (allowed) or setter (not allowed).
12473 * class.cs (Accessor): Implement IIteratorContainer.
12474 (Accessor.Yields): New public field.
12475 (PropertyBase.PropertyMethod.Define): Handle iterators on a
12476 per-accessor basis.
12479 (get_accessor_declaration, set_accessor_declaration): Set the
12480 `yields' flag on the accessor, not the property.
12481 (property_declaration): Do the iterators check on a per-accessor
12482 basis and not for the whole property.
12484 2005-07-08 Martin Baulig <martin@ximian.com>
12486 * anonymous.cs (CaptureContext.EmitParameterInstance): Correctly
12487 handle parameters in nested scopes; fixes #74808; see gtest-188.cs.
12489 2005-07-07 Marek Safar <marek.safar@seznam.cz>
12492 * attribute.cs (orig_sec_assembly): Holds original version of assembly.
12493 (ExtractSecurityPermissionSet): Cope with self referencing security
12494 attributes properly.
12496 * driver.cs (SetOutputFile): Made public property OutputFile.
12498 2005-07-07 Raja R Harinath <rharinath@novell.com>
12501 * class.cs (TypeContainer.first_nonstatic_field): Rename from
12502 has_nonstatic_fields. Make into a FieldBase pointer.
12503 (TypeContainer.AddField): Add CS0282 check.
12504 (TypeContainer.EmitType): Update.
12506 2005-07-06 Miguel de Icaza <miguel@novell.com>
12508 * cs-tokenizer.cs (consume_identifier): Do not create strings to
12509 compare if they start with __.
12511 2005-07-06 Raja R Harinath <rharinath@novell.com>
12513 * statement.cs (Switch.SwitchGoverningType): Only look at
12514 UserCasts that don't need implicit standard conversions to one of
12515 the allowed switch types (Fixes test-322.cs).
12516 (LocalInfo.Resolve): Re-enable sanity-test.
12518 2005-07-06 Marek Safar <marek.safar@seznam.cz>
12520 * cs-tokenizer.cs (consume_identifier): Detect double undescores
12522 * ecore.cs (FieldExpr.AddressOf): Changed volatile error to warning.
12524 * expression.cs (Invocation.DoResolve): Report error CS0245 here.
12526 2005-07-06 Raja R Harinath <rharinath@novell.com>
12529 * ecore.cs (SimpleName.GetSignatureForError): Add.
12530 * expression.cs (MemberAccess.DoResolve): Don't clobber 'expr' field.
12531 (MemberAccess.GetSignatureForError): Add.
12533 2005-07-05 Marek Safar <marek.safar@seznam.cz>
12535 The big error and warning messages review.
12565 * typemanager.cs: Updated.
12567 * class.cs: (MethodCore.SetYields): Moved here to share.
12568 (PropertyMethod.Define): Moved iterator setup here.
12570 * iterators.cs: Add orig_method to have full access to parent
12573 2005-07-05 Raja R Harinath <rharinath@novell.com>
12575 Make 'fixed variable' handling standards compliant. Fix #70807, #72729.
12576 * ecore.cs (IVariable.VerifyFixed): Remove 'is_expression' parameter.
12577 (FieldExpr.VerifyFixed): Ensure that the field is part of a fixed
12578 variable of struct type.
12579 * expression.cs (Unary.ResolveOperator): Update to change.
12580 (Indirection.VerifyFixed): Likewise.
12581 (LocalVariableReference.VerifyFixed): A local variable is always fixed.
12582 (ParameterReference.VerifyFixed): Value parameters are fixed.
12583 (This.VerifyFixed): Treat 'this' as a value parameter.
12584 * statement.cs (LocalInfo.IsFixed): Remove.
12586 2005-07-01 Martin Baulig <martin@ximian.com>
12588 * iterators.cs (Iterator.CapturedThisReference.Emit): Use
12589 `ec.EmitThis ()' to get the correct scope.
12591 2005-07-01 Martin Baulig <martin@ximian.com>
12593 * ecore.cs (FieldExpr.DoResolve): Don't capture the field if it's
12594 instance is a ParameterReference; fixes #75299.
12596 2005-07-01 Martin Baulig <martin@ximian.com>
12598 Reverted Marek's latest patch (r46725):
12599 - it contains structural changes which are neither mentioned in
12600 the ChangeLog nor explained anywhere; for example the additional
12601 argument of EmitContext's and Iterator's .ctor's and the
12602 TypeContainer.DefineMembers() change.
12603 - structural changes like this should go in in seperate patches
12604 and not be hidden in a huge patch which just seems to affect
12605 warnings and errors.
12606 a big and hard to understand patch.
12607 - it breaks iterators and causes regressions, for instance in
12610 2005-06-30 Raja R Harinath <rharinath@novell.com>
12613 * expression.cs (Indexers.map): Remove.
12614 (Indexers.Append): Filter out inaccessible setters and getters.
12615 (IndexerAccess.DoResolve, IndexerAccess.DoResolveLValue): Update.
12618 * ecore.cs (MemberExpr.EmitInstance): New. Add CS0120 check.
12619 Refactored from ...
12620 (FieldExpr.EmitInstance, PropertyExpr.EmitInstance): ... these.
12621 (FieldExpr.Emit, PropertyExpr.Emit): Update.
12622 (FieldExpr.EmitAssign, PropertyExpr.EmitAssign): Update.
12623 * expression.cs (Invocation.EmitCall): Add CS0120 check.
12625 2005-06-30 Marek Safar <marek.safar@seznam.cz>
12628 * class.cs (FieldBase.GetInitializerExpression): One more field
12631 2005-06-28 Miguel de Icaza <miguel@novell.com>
12633 * pending.cs: Do not define a proxy if the base method is virtual,
12634 it will be picked up by the runtime (bug 75270).
12636 2005-06-08 Martin Baulig <martin@ximian.com>
12638 The big Iterators rewrite :-)
12640 * iterators.cs: Rewrite this to use the anonymous methods framework.
12642 * rootcontext.cs (RootContext.DefineTypes): Define Delegates
12643 before the TypeContainers; see 2test-21.cs.
12646 (TypeContainer.DefineType): Don't create a new EmitContext if we
12647 already have one (this only happens if we're an Iterator).
12648 (TypeContainer.Define): Also call Define() on all our iterators.
12649 (Method.CreateEmitContext): Added support for iterators.
12652 (AnonymousContainer): New abstract base class for `AnonymousMethod'.
12653 (AnonymousContainer.CreateMethodHost): Moved here from
12654 AnonymousMethod and made abstract.
12655 (AnonymousContainer.CreateScopeType): New abstract method.
12656 (AnonymousContainer.IsIterator): New public property.
12657 (ScopeInfo.EmitScopeType): Call CreateScopeType() on our Host to
12658 get the ScopeTypeBuilder rather than manually defining it here.
12659 (ScopeInfo.EmitScopeInstance): New public method; correctly handle
12662 * driver.cs (Driver.MainDriver): Call TypeManager.InitCodeHelpers()
12663 before RootContext.DefineTypes().
12665 * codegen.cs (EmitContext.RemapToProxy): Removed.
12666 (EmitContext.CurrentAnonymousMethod): Changed type from
12667 AnonymousMethod -> AnonymousContainer.
12668 (EmitContext.ResolveTopBlock): Protect from being called twice.
12669 (EmitContext.MapVariable, RemapParameter(LValue)): Removed.
12670 (EmitContext.EmitThis): Removed the iterators hacks; use the
12671 anonymous methods framework for that.
12674 (ToplevelBlock.Container): Make this a property, not a field.
12675 (ToplevelBlock.ReParent): New public method; move the
12676 ToplevelBlock into a new container.
12677 (Foreach.TemporaryVariable): Simplify.
12679 2005-06-05 Martin Baulig <martin@ximian.com>
12681 * statement.cs (LocalInfo.CompilerGenerated): New flag.
12682 (Block.AddTemporaryVariable): New public method; creates a new
12683 `LocalInfo' for a temporary variable.
12684 (Block.EmitMeta): Create the LocalBuilders for all the temporary
12686 (Foreach.TemporaryVariable): Use Block.AddTemporaryVariable() for
12687 non-iterator variables.
12689 2005-06-05 Martin Baulig <martin@ximian.com>
12691 * statement.cs (Foreach.TemporaryVariable): Create the
12692 LocalBuilder in the Emit phase and not in Resolve since in some
12693 situations, we don't have an ILGenerator during Resolve; see
12694 2test-19.cs for an example.
12696 2005-06-04 Martin Baulig <martin@ximian.com>
12698 **** Merged r45395 from GCS ****
12700 The big Foreach rewrite - Part II.
12702 * typemanager.cs (TypeManager.object_getcurrent_void): Replaced
12703 with `PropertyInfo ienumerator_getcurrent'.
12705 * codegen.cs (VariableStorage): Removed.
12708 (Foreach): Derive from Statement, not ExceptionStatement.
12709 (Foreach.CollectionForeach): New nested class. Moved all the code
12710 dealing with collection foreach here.
12711 (Foreach.ForeachHelperMethods): Removed.
12712 (Foreach.TemporaryVariable): Implement IMemoryLocation.
12714 2005-05-23 Martin Baulig <martin@ximian.com>
12716 * statement.cs (Try.DoResolve): Don't create a `finally' if we
12717 don't need to. Fix #75014.
12719 2005-05-20 Martin Baulig <martin@ximian.com>
12721 Merged r44808 from GMCS.
12723 * class.cs (TypeContainer.CircularDepException): Removed.
12724 (TypeContainer.DefineType): Removed the `InTransit' stuff.
12725 (TypeContainer.CheckRecursiveDefinition): Check for circular class
12726 (CS0146) and interface (CS0529) dependencies here.
12728 2005-06-21 Raja R Harinath <rharinath@novell.com>
12730 * expression.cs (Invocation.EmitCall): Fix initialization
12731 'this_call' to reflect current behaviour. Fix indentation.
12733 * convert.cs (FindMostEncompassedType): Add two trivial special
12734 cases (number_of_types == 0 || number_of_types == 1).
12735 (FindMostEncompasingType): Likewise.
12737 2005-06-17 Raja R Harinath <rharinath@novell.com>
12739 Some cleanups preparing for the fix of #75283.
12740 * ecore.cs (PropertyExpr.InstanceResolve): Tighten conditions for
12742 (EventExpr.InstanceResolve): Likewise.
12743 (EventExpr.DoResolve): Remove redundant checks.
12745 2005-06-10 Duncan Mak <duncan@novell.com>
12747 * cs-tokenizer.cs (process_directives): New flag for controlling
12748 the processing of preprocessor directives.
12749 (x_token): After seeing a '#', return Token.NONE instead of going
12750 to handle_preprocessing_directive() when not processing
12751 directives. This avoids unnecessary processing during the token peek in
12756 * cs-tokenizer.cs (handle_preprocessing_directive, xtoken): Use
12757 the existing error reporting methods instead of Report.Error.
12759 * convert.cs (priv_fmt_expr): Remove. It's not needed anymore
12760 after Raja's rewrite.
12762 2005-06-08 Miguel de Icaza <miguel@novell.com>
12764 * class.cs: Small fix.
12766 2005-06-08 Raja R Harinath <rharinath@novell.com>
12769 * class.cs (GetPartialBases): Fix return value check of
12770 part.GetClassBases.
12772 2005-06-07 Raja R Harinath <rharinath@novell.com>
12774 Ensure that partial classes are registered in their enclosing
12775 namespace. Initial part of fix of #75160.
12776 * tree.cs (Tree.RecordDecl): Add new namespace argument.
12777 Register declspace with namespace here, not in
12778 DeclSpace.RecordDecl.
12779 * cs-parser.jay: Pass namespace to RecordDecl.
12780 * class.cs (PartialContainer.Create): Likewise.
12781 (ClassPart.DefineType): New sanity-check. Throws an exception if
12783 * decl.cs (Declspace.RecordDecl): Remove.
12784 * namespace.cs (NamespaceEntry.DefineName): Remove.
12786 2005-06-06 Marek Safar <marek.safar@seznam.cz>
12788 * rootcontext.cs: Reset TargetExt as well.
12790 2005-06-03 Raja R Harinath <rharinath@novell.com>
12792 * ecore.cs (Expression.Resolve): Emit CS0654 error when
12793 -langversion:ISO-1.
12795 2005-06-02 Raja R Harinath <rharinath@novell.com>
12797 Fix #75080, cs0119.cs.
12798 * ecore.cs (Expression.ExprClassToResolveFlags): New. Broken out
12800 (Expression.Resolve): ... this. Use it. Remove bogus code
12801 allowing ExprClass.Type and ExprClass.Namespace for
12802 ResolveFlags.VariableOrValue.
12803 (Expression.Resolve) [1-argument variant]: Change default resolve
12804 flags based on language version.
12805 (Expression.Error_UnexpectedKind): Use a simple string array
12806 rather than an ArrayList.
12807 * expression.cs (TypeOf.DoResolve): Set eclass to ExprClass.Value,
12808 not ExprClass.Type.
12809 (TypeOfVoid.DoResolve): Likewise.
12810 (MemberAccess.DoResolve) [3-argument variant]: Make private. Drop
12811 flags argument -- it always has the same value.
12813 2005-05-31 Raja R Harinath <rharinath@novell.com>
12816 * ecore.cs (Expression.ResolveLValue): Add a Location parameter.
12817 Use it in the error message.
12818 * assign.cs, expression.cs, statement.cs: Update.
12820 2005-05-30 Raja R Harinath <rharinath@novell.com>
12823 * ecore.cs (Expression.MemberLookupFailed): Add CS0122 check in
12824 the "almostMatchedMember" case too.
12825 * typemanager.cs (Closure.CheckValidFamilyAccess): Add anything
12826 that failed the accessibility checks to 'almost_match'.
12828 2005-05-27 Vladimir Vukicevic <vladimir@pobox.com>
12830 * attribute.cs: Use internal MethodBuilder methods to set
12831 ExactSpelling and SetLastError on PInvoke methods, instead
12832 of passing them via charset. Fixes #75060.
12834 2005-05-27 Raja R Harinath <rharinath@novell.com>
12836 * parameter.cs (Parameter): Remove TODO comment.
12837 (Parameter.DefineParameter): Remove Location parameter.
12838 (Parameters.LabelParameters): Likewise.
12839 * class.cs (Constructor.Emit): Update to change.
12840 (MethodData.Emit): Likewise.
12841 * anonymous.cs (AnonymousMethod.EmitMethod): Likewise.
12842 * delegate.cs (Delegate.Define, Delegate.Emit): Likewise.
12844 2005-05-27 Atsushi Enomoto <atsushi@ximian.com>
12847 Removed Parameters.Location and added Parameter.Location instead.
12848 Removed Location parameter from Emit() and GetSignature().
12855 Modified all related calls.
12857 2005-05-26 Raja R Harinath <rharinath@novell.com>
12859 Improve user-defined conversion handling.
12860 * convert.cs (GetConversionOperators): Rewrite. Return only the
12861 applicable operators.
12862 (AddConversionOperators): New. Helper for GetConversionOperators.
12863 (FindMostEncompassedType, FindMostEncompassingType): Verify that
12864 there is only one most encompassed/encompassing type.
12865 (FindMostSpecificSource, FindMostSpecificTarget): Remove
12866 "applicable operator" handling.
12867 (UserConversion): Move cache here from GetConversionOperators.
12868 Directly cache the chosen operator, rather than the whole
12870 (ExplicitNumericConversion): Fix buggy implementation of Decimal
12871 case. Allow conversion of decimal to sbyte and byte too.
12872 * expression.cs (EmptyExpression.Grab, EmptyExpression.Release):
12873 New static methods. Used to avoid allocating EmptyExpressions in
12876 2005-05-24 Duncan Mak <duncan@novell.com>
12878 * ecore.cs (CastFromDecimal): New class for casting a decimal to
12879 another class, used in Convert.ExplicitNumericConversion.
12880 (CastToDecimal): New class, similar to above, but casts to
12881 System.Decimal, used in Convert.ImplicitNumericConversion and also
12882 in explicit convesion from double/float to decimal.
12884 * convert.cs (ImplicitNumericConversion): Handle implicit
12885 conversions to System.Decimal.
12886 (ExplicitNumericConversion): handle explicit conversions to
12891 2005-05-20 Miguel de Icaza <miguel@novell.com>
12893 * typemanager.cs (EnumToUnderlying): Do not throw if we do not
12894 know the type at this stage, just break through. Fixes #75008
12896 2005-05-19 Martin Baulig <martin@ximian.com>
12899 (ImplicitDelegateCreation.Check): Added `bool check_only' argument
12900 to disable error reporting.
12902 * convert.cs (Convert.ImplicitStandardConversionExists): Use it
12903 here since we don't want to report an error; see the new test-336.cs.
12905 2005-05-19 Raja R Harinath <rharinath@novell.com>
12907 * statement.cs (ToplevelBlock.GetParameterReference)
12908 (ToplevelBlock.IsParameterReference,ToplevelBlock.IsLocalParameter):
12909 Move here from class Block.
12910 * ecore.cs (SimpleName.SimpleNameResolve): Update to changes.
12911 * expression.cs (ParameterReference.DoResolveBase): Likewise.
12913 2005-05-18 Martin Baulig <martin@ximian.com>
12918 (FlowBranching.Reachability): Add non-static public And() and Or()
12920 (FlowBranchingSwitch): New class; do the `break_origins' thing
12921 like in FlowBranchingLoop.
12922 (FlowBranching.UsageVector.MergeBreakOrigins): Also merge the
12923 reachability, not just locals and parameters.
12924 (FlowBranching.MergeChild): Remove some of the hacks for loop and
12925 switch; MergeBreakOrigins() now takes care of that.
12927 2005-05-18 Martin Baulig <martin@ximian.com>
12929 * flowanalysis.cs (FlowBranching.UsageVector.MergeChild): If we're
12930 a loop and may leave it, reset the barrier; fixes #74974.
12932 2005-05-17 Marek Safar <marek.safar@seznam.cz>
12934 * attribute.cs (Attribute.ResolveArguments): GuidAttribute check
12937 * cs-parser.jay: Catch more lexical errors.
12939 * report.cs: Add one more Error method.
12942 * typemanager.cs: Register System.Runtime.InteropServices.GuidAttribute
12944 2005-05-17 Martin Baulig <martin@ximian.com>
12946 * expression.cs (Argument.Resolve): Turn on flow analysis; fix
12949 2005-05-16 Raja R Harinath <rharinath@novell.com>
12951 Fix test-382.cs. Emit values of decimal constants.
12952 * class.cs (TypeContainer.RegisterFieldForInitialization): New.
12954 (TypeContainer.AddField): ... this.
12955 (TypeContainer.EmitFieldInitializers): Allow the list of fields
12956 with initializers to include 'Const's.
12957 (ClassPart.RegisterFieldForInitialization): Forward to
12959 * const.cs (Const.Const): Pass initializer to base class.
12960 (Const.Define): In case of decimal constants, register them for
12961 initialization in a static constructor.
12963 2005-05-14 Martin Baulig <martin@ximian.com>
12965 * statement.cs (Block.Resolve): Correctly handle unreachable code;
12966 do not call ResolveUnreachable() on unreachable statements in
12967 here, see the comment in the source code.
12969 2005-05-13 Raja R Harinath <rharinath@novell.com>
12972 * expression.cs (BinaryResolveOperator): If one of the operands of
12973 an equality comparison is 'null' and the other is a pointer type,
12974 convert the null to a NullPointer.
12975 * convert.cs (ImplicitReferenceConversion): If the expression is a
12976 NullLiteral and the target type is a pointer type, return a
12977 NullPointer instead.
12978 (ImplicitConversionStandard): Likewise.
12980 2005-05-13 Marek Safar <marek.safar@seznam.cz>
12982 * cs-parser.jay: Set readonly context based on special constructs.
12984 * expression.cs (LocalVariableReference.DoResolveBase): Improved
12985 readonly variable error handling.
12987 * rootcontext.cs (EmitCode): Don't verify members when error
12990 * statement.cs (LocalInfo): Add reaodnly context information.
12991 (SetReadOnlyContext, GetReadOnlyContext): New methods.
12993 2005-05-13 Raja R Harinath <rharinath@novell.com>
12995 * statement.cs (Block.Resolve): Revert change below. Modify fix
12996 for #74041 to initialize 'resolved' to false only for explicit
12997 blocks. Fixes #74873.
12999 2005-05-12 Raja R Harinath <harinath@gmail.com>
13002 * typemanager.cs (unmanaged_enclosing_types): New.
13003 (IsUnmanagedType): Avoid infloops by using
13004 'unmanaged_enclosing_types' to talk with recursive invocations.
13006 2005-05-13 Martin Baulig <martin@ximian.com>
13008 * statement.cs (Block.Resolve): Make the `bool unresolved' flag an
13009 instance variable, not a local. Fix #74873.
13010 (Block.ResolveUnreachable): Set it to true here.
13012 2005-05-11 Duncan Mak <duncan@novell.com>
13014 * cs-tokenizer.cs (get_cmd_arg): Check that 'c' is not -1 before
13015 continuing to process for 'arg'.
13016 (handle_preprocessing_directive): Check the argument of the #endif
13017 directive and report error CS1025 if there are any trailing
13020 According to the C# spec, having even whitespace after the #endif
13021 directive is illegal; however, because we call arg.TrimEnd ()
13022 beforehand, we have the same behavior as csc, allowing whitespace
13023 after the directive.
13027 2005-05-11 Marek Safar <marek.safar@seznam.cz>
13031 * class.cs (ConstructorInitializer.GetOverloadedConstructor): Removed.
13032 (Constructor.GetObsoleteAttribute): Implemented correctly.
13034 2005-05-10 Martin Baulig <martin@ximian.com>
13036 * support.cs (ReflectionParameters.ParameterModifier): Use
13037 `Parameter.Modifier.REF' if we both have `ParameterAttributes.Out'
13038 and `ParameterAttributes.In'. Fixes #74884.
13040 2005-05-10 Marek Safar <marek.safar@seznam.cz>
13042 * class.cs (Method.Define): Catch attempt for Finalizer declaration.
13044 * expression.cs (Argument.GetParameterModifier): Turned to property.
13045 (Invocation.Error_InvalidArguments): Add more descriptive errors.
13047 * parameter.cs (Parameter.GetModifierSignature): Translates modifier to
13050 2005-05-09 Raja R Harinath <rharinath@novell.com>
13053 * decl.cs (MemberCache.AddMethods): Register override methods,
13054 rather than non-override methods.
13055 * typemanager.cs (RegisterOverride): New.
13056 (IsOverride): Update.
13058 2005-05-09 Marek Safar <marek.safar@seznam.cz>
13062 * ecore.cs (SimpleName.SimpleNameResolve): Add in_transit to catch
13063 recursive declaration.
13065 * statement.cs (Block.ResolveMeta): Report any error in resolving.
13067 2005-05-06 Marek Safar <marek.safar@seznam.cz>
13069 * cfold (DoConstantNumericPromotions): Don't try to convert 0 enum.
13071 * expression.cs (Binary.DoResolve): (x && 0) is always 0.
13073 2005-05-05 Raja R Harinath <rharinath@novell.com>
13076 * decl.cs (DeclSpace.FamilyAccessible):
13077 Use TypeManager.IsNestedFamilyAccessible.
13079 Fix reopened #64812.
13080 * typemanager.cs (Closure.Filter): Introduce checks for 'protected
13083 2005-05-04 Raja R Harinath <rharinath@novell.com>
13084 Abin Thomas <projectmonokochi@rediffmail.com>
13085 Anoob V E <projectmonokochi@rediffmail.com>
13086 Harilal P R <projectmonokochi@rediffmail.com>
13089 * typemanager.cs (Closure.CheckValidFamilyAccess): Don't blindly
13090 allow access to all static members.
13092 2005-05-04 Martin Baulig <martin@ximian.com>
13094 * ecore.cs (FieldExpr.DoResolveLValue): Always call fb.SetAssigned().
13096 2005-05-04 Martin Baulig <martin@ximian.com>
13100 * statement.cs (Switch.SimpleSwitchEmit): Always emit the default
13101 section at the end; make things work if `default' is not the last
13104 2005-05-04 Martin Baulig <martin@ximian.com>
13108 * statement.cs (Switch): Replaced the `got_default' field with a
13109 `default_section' one.
13110 (Switch.CheckSwitch): Set `default_section' here.
13111 (Switch.Resolve): If we're a constant switch and the constant is
13112 not found, use the default section.
13114 2005-05-03 Martin Baulig <martin@ximian.com>
13116 * expression.cs (ArrayAccess.EmitGetLength): New public method.
13118 * statement.cs (Foreach.ArrayForeach): New nested class.
13119 (Foreach.TemporaryVariable): New nested class.
13120 (Foreach.EmitArrayForeach): Removed; this is now in the new
13121 ArrayForeach class.
13123 2005-05-03 Raja R Harinath <rharinath@novell.com>
13125 * pending.cs (BaseImplements): Move the #74773 fix here. This is
13127 (VerifyPendingMethods): Revert change below.
13129 * typemanager.cs (IsOverride, RegisterNonOverride): New.
13130 * decl.cs (MemberCache.AddMethod): Register "non-override" methods
13131 that used to trigger warning -28. Remove warning -28.
13132 * expression.cs (Invocation.OverloadResolve): Use
13133 TypeManager.IsOverride to distinguish override methods.
13136 * pending.cs (VerifyPendingMethods): If a base type implements the
13137 requested interface, don't bother checking individual methods of
13138 the base type. As a side-effect, this prevents the creation of
13139 unnecessary proxies.
13141 2005-05-02 Martin Baulig <martin@ximian.com>
13145 * flowanalysis.cs (FlowBranching.UsageVector.MergeJumpOrigins):
13146 Also `And' the locals if the old vector is null.
13147 (FlowBranching.UsageVector.BitVector.And): Allow `vector' being
13148 null; in this case we basically reset all the variables.
13150 2005-05-02 Martin Baulig <martin@ximian.com>
13154 * flowanalysis.cs (FlowBranching.UsageVector.MergeBreakOrigins):
13155 Added `FlowBranching branching' argument; always `and' the
13156 variables instead of `or'ing them unless we're an infinite loop.
13158 * statement.cs (While.Resolve): Create a new sibling unless we're
13161 2005-05-02 Martin Baulig <martin@ximian.com>
13165 * class.cs (ConstructorInitializer.Resolve): Added `Block block'
13166 arguments; use it instead of creating a new TopLevelBlock.
13167 (Constructor.Emit): Call `block.ResolveMeta ()' before resolving
13168 our ConstructorInitializer.
13171 (TopLevelBlock.TopLevelBranching): New public property.
13172 (TopLevelBlock.ResolveMeta): New public method; call ResolveMeta()
13173 and create our `TopLevelBranching'.
13175 * codegen.cs (EmitContext.ResolveTopBlock): If we're not an
13176 anonymous method host, use `block.TopLevelBranching' rather than
13177 creating a new branching.
13179 2005-04-20 Miguel de Icaza <miguel@novell.com>
13181 * anonymous.cs (ScopeInfo.AddChild): when adding a new child to
13182 a ScopeInfo, if any of the current children is a child of the new
13183 entry, move those children there.
13185 2005-04-30 Martin Baulig <martin@ximian.com>
13187 * statement.cs (Switch.SimpleSwitchEmit): Reset `default_at_end'
13188 at the beginning of a SwitchSection. Fix #73335.
13190 2005-04-27 Marek Safar <marek.safar@seznam.cz>
13193 * class.cs (EmitFieldInitializers): Use FieldExpr in initializer.
13195 * ecore.cs (FieldExpr): Add a new ctor with in_initializer.
13196 (FieldExpr.DoResolve): Obsolete members are ignored for field
13199 2005-04-26 Marek Safar <marek.safar@seznam.cz>
13201 * attribute.cs (AreOverloadedMethodParamsClsCompliant): Add array
13202 of arrays detection.
13204 * class.cs (Interface.VerifyClsCompliance): Add base interfaces
13206 (Field.VerifyClsCompliance): Volatile fields are not compliant.
13208 * decl.cs (MemberCache.VerifyClsParameterConflict): Add array of
13211 2005-04-25 Ben Maurer <bmaurer@ximian.com>
13213 * cs-parser.jay: Use the prefered version of -unsafe in error
13216 2005-04-22 Marek Safar <marek.safar@seznam.cz>
13218 * driver.cs (CompilerCallableEntryPoint.Invoke): Reset under any
13221 2005-04-20 John Luke <john.luke@gmail.com>
13223 * driver.cs: fix typo in error message, --outout to --output
13225 2005-04-20 Marek Safar <marek.safar@seznam.cz>
13227 * codegen.cs (InRefOutArgumentResolving): New field.
13229 * ecore.cs (FieldExpr.DoResolve): Check for assigning to readonly
13230 fields outside contructor.
13232 * expression.cs (Argument.Resolve): Set InRefOutArgumentResolving.
13234 2005-04-19 Miguel de Icaza <miguel@novell.com>
13236 * anonymous.cs (CaptureContext.EmitParameterInstance): The
13237 parameter code was not completed ever, so it was not as up-to-date
13238 as local variables. Must finish it.
13240 The bug fix was to compare the Toplevel of the block, not the
13241 current block. Thanks for Ben for pointing this out.
13243 2005-04-19 Raja R Harinath <rharinath@novell.com>
13245 * decl.cs (AddMethods): Use the declaring type of the problem
13246 method to determine if we want to squash a warning.
13248 2005-04-19 Marek Safar <marek.safar@seznam.cz>
13250 * attribute.cs: Removed debug output.
13252 * decl.cs (MemberCache.AddMethods): Fixed Finalize ignoring.
13254 * driver.cs (Driver.parse): Synchronize parser ErrorOutput with
13257 2005-04-18 Raja R Harinath <rharinath@novell.com>
13260 * expression.cs (Binary.EqualsNullIsReferenceEquals): New.
13261 (Binary.DoResolveOperator): Use it to avoid blindly optimizing out
13262 all null comparisons against reference types.
13264 2005-04-18 Marek Safar <marek.safar@seznam.cz>
13267 * class.cs (TypeContainer.CircularDepException) New nested
13269 (GetPartialBases, GetNormalBases, GetClassBases): Removed error.
13270 (TypeContainer.DefineType): Removed error, reset InTransit before
13272 (Class.DefineType): Throw exception when is in Transit.
13273 Catch exception and report error.
13274 (Struct.DefineType): Throw exception when is in Transit.
13275 Catch exception and report error.
13276 (Interface.DefineType): Throw exception when is in Transit.
13277 Catch exception and report error.
13279 * codegen.cs: Add InCatch,InFinally to EmitContext to easily
13280 handle nested exception handlers.
13282 * flowanalysis.cs (InTryWithCatch): New method, search for try with
13285 * iterators.cs (Yield.CheckContext): Add CS1626 report. Updated
13286 InFinally and InCatch storage.
13288 * statement.cs (Throw.Resolve): Use InCatch, InFinally from ec.
13289 (Catch.Resolve): Set and Restore ec.InCatch.
13290 (Try.Resolve): Set and Restore ec.InFinally.
13291 (Try.HasCatch): True when try has catch.
13293 2005-04-17 Atsushi Enomoto <atsushi@ximian.com>
13295 * doc.cs : In some cases FilterName returns MonoEvent and MonoField
13296 for the same event member, so exclude such cases from warning 419.
13299 2005-04-16 Miguel de Icaza <miguel@novell.com>
13301 * expression.cs (Binary.ResolveOperator): Apply patch from John
13302 Luke to fix bug 59864: operators &, | and ^ on enumerations
13303 require that the same enum type on both sides.
13305 * driver.cs: Add warnings to old flag usage, this is to assist
13306 people who produce Makefiles and hope that the Makefiles will be
13309 * class.cs (TypeContainer.EmitType): Moved the definition of the
13310 special $PRIVATE$ field from the resolve phase to the Emit phase.
13311 During resolve we do not know if we are a struct with
13312 HasExplicitLayout, we know this only after the attributes for the
13315 Set the FieldOffset to zero on the dummy field that we create for
13316 the class. Fixes 74590.
13318 2005-04-16 Raja R Harinath <rharinath@novell.com>
13321 * ecore.cs (PropertyExpr.resolved): New.
13322 (DoResolve): Use it to handle a case of double resolution here.
13323 Handle a case of identical-name-and-type-name.
13324 * expression.cs (ArrayCreation.CheckIndices): Avoid double
13325 resolution by storing the results of expression resolution back
13326 into the "probes" array.
13328 2005-04-15 Raja R Harinath <rharinath@novell.com>
13330 Fix cs0208-7.cs and cs0208-8.cs.
13331 * typemanager.cs (IsUnmanagedType): Arrays are not allowed
13332 (cf. ECMA standard, behaviour of CSC 1.1 and CSC 2.0). Improve
13333 error reporting to point out the reason a struct is not unmanaged.
13335 2005-04-13 Atsushi Enomoto <atsushi@ximian.com>
13337 * doc.cs : In FindDocumentedType(), avoid TypeExpr.ResolveType() and
13338 just use TypeExpr.Type. This fixes bug #74595 when merged to gmcs.
13340 2005-04-13 Raja R Harinath <rharinath@novell.com>
13343 * ecore.cs (PropertyExpr.InstanceResolve): Handle a case of
13344 IdenticalNameAndTypeName here.
13345 (EventExpr.InstanceResolve): Likewise.
13347 2005-04-13 Marek Safar <marek.safar@seznam.cz>
13349 C# 2.0 DefaultCharSetAttribute implementation
13351 * attribute.cs (Attribute.ResolveAsTypeStep): New protected method
13352 which allows us to set GlobalNamespace for every resolve.
13353 (Attribute.ResolveArguments): Cut from Resolve.
13354 (Attribute.GetCharSetValue): Returns CharSet named argument.
13355 (Attribute.DefinePInvokeMethod): Gets default charset from
13357 (GlobalAttribute.ResolveAsTypeStep): Override.
13358 (GlobalAttribute.ResolveArguments): Override.
13360 * class.cs (TypeAttr): Is protected.
13362 * codegen.cs (ModuleClass.DefaultCharSet): New member.
13363 (ModuleClass.DefaultCharSetType): New memeber.
13364 (ModuleClass.ResolveAttributes): Resolves DefaultCharSetAttribute.
13366 * decl.cs (Decl.TypeAttr): New protected virtual. Returns default
13367 charset from module.
13369 * delegate.cs (TypeAttr): Override.
13370 (Delegate.DefineType): Use this TypeAttr.
13372 * driver.cs (Driver.MainDriver): Call Module.ResolveAttributes
13373 at very early stage (before types are defined) to resolve model
13374 module attributes. It will probably not work with corlib but it
13377 * enum.cs (Enum.TypeAttr): New protected virtual. Returns default
13378 charset from module.
13380 * typemanager.cs (default_charset_type): New type.
13382 2005-04-13 Raja R Harinath <rharinath@novell.com>
13384 * decl.cs (MemberCache.AddMethods): Don't warn if
13385 System.Object.Finalize has buggy MethodAttributes.
13387 * typemanager.cs (IsUnmanagedType): Restore !IsValueType check
13390 2005-04-13 Atsushi Enomoto <atsushi@ximian.com>
13392 * doc.cs : detect ambiguous reference to overloaded members.
13393 Fixed bug #71603. MS 1.1 csc does not detect it.
13395 2005-04-13 Atsushi Enomoto <atsushi@ximian.com>
13397 * doc.cs : delegates must not be referenced with parameters.
13400 2005-04-12 Miguel de Icaza <miguel@novell.com>
13402 * typemanager.cs (IsUnmanagedType): Arrays are allowed.
13404 2005-04-10 Miguel de Icaza <miguel@novell.com>
13406 * driver.cs (MainDriver): Stop processing if the CLS stage found
13409 (CompilerCallableEntryPoint.InvokeCompiler): Always
13410 reset after execution; Take a TextWriter argument for the
13413 * report.cs: Use the error stream instead of hardcoding stderr.
13415 2005-04-09 Miguel de Icaza <miguel@novell.com>
13417 * class.cs: Reduce code paths to test, too small of an
13418 optimization to make it worth the extra testing. Always perform
13421 2005-04-08 Raja R Harinath <rharinath@novell.com>
13424 * class.cs (OperatorArrayList.CheckPairedOperators): Skip
13425 operators that had errors reported on them.
13427 2005-04-08 Marek Safar <marek.safar@seznam.cz>
13429 * attribute.cs (Attribute.IsValidArgumentType): Test valid named
13431 (Attribute.Resolve): Add named argument type checking.
13433 * class.cs (FixedField.Define): Use IsPrimitiveType
13435 * expression.cs (Binary.ResolveOperator): Reflect IsCLRType renaming.
13437 * iterators.cs (Iterator.DefineIterator): Add check for arglist and
13438 unsafe parameter types.
13440 * statement.cs (Using.ResolveExpression): Add better error description.
13442 * typemanager.cs (IsCLRType): Renamed to IsPrimitiveType.
13444 2005-04-08 Raja R Harinath <rharinath@novell.com>
13447 * attribute.cs (Attribute.GetAttributeUsage): Resolve
13448 AttributeUsageAttribute in the emitcontext of the attribute class,
13449 not in the emitcontext of the attributable entity it was attached to.
13450 * cs-parser.jay: Use 'current_class', not 'current_container',
13451 when creating a GlobalAttribute.
13453 2005-04-08 Alp Toker <alp@atoker.com>
13455 * pending.cs: The fix to #58413 failed to compile methods implementing
13456 interfaces with/without params modifiers and vice versa, even though
13457 params modifiers aren't part of the signature. Make the modifier check
13458 less strict as in csc.
13460 2005-04-07 Abin Thomas <projectmonokochi@rediffmail.com>
13461 Anoob V E <projectmonokochi@rediffmail.com>
13462 Harilal P R <projectmonokochi@rediffmail.com>
13465 * pending.cs (TypeAndMethods.mods): New. Store the parameter
13466 modifiers of pending methods.
13467 (PendingImplementation.PendingImplementation): Initialize it.
13468 Add Parameter.Modifier [][] mods and initialize it with ParameterData.
13469 (PendingImplementation.InterFaceMethod): Repalce Type[] argument
13470 with ParameterData. Add check for modifiers.
13471 * class.cs (MethodData.Define): Update to changes.
13473 2005-04-07 Raja R Harinath <rharinath@novell.com>
13475 * ecore.cs (Expression.IsAccessorAccessible): Clarify code somewhat.
13477 2005-04-07 Marek Safar <marek.safar@seznam.cz>
13479 * class.cs (PropertyMethod.Define): Check private accessor in abstract
13482 * decl.cs (DeclSpace.ApplyAttributeBuilder): Don't allow RequiredAttribute
13485 * typemanager.cs: Registered RequiredAttributeAttribute.
13487 2005-04-06 Marek Safar <marek.safar@seznam.cz>
13489 * class.cs (VerifyMembers): Doesn't need EmitContext argument.
13490 Warning CS0169 is back at level 3.
13491 (IMethodData.SetMemberIsUsed): New method.
13493 * decl.cs (IsUsed): New value; moved from FieldBase.Status
13494 (SetMemberIsUsed, IsUsed): New methods, encapsulate IsUsed.
13496 * delegate.cs (ResolveMethodGroupExpr): Call SetMemberIsUsed.
13498 * ecore.cs (FieldExpr.ResolveMemberAccess): Call SetMemberIsUsed for
13500 (PropertyExpr.ResolveAccessors): Call SetMemberIsUsed when delegate
13503 * expression.cs (OverloadResolve): Call SetMemberIsUsed. when method
13506 * rootcontext.cs (RootContext.EmitCode): Call VerifyMembers in extra run
13507 to avoid the problems with nested types.
13509 2005-04-05 Abin Thomas <projectmonokochi@rediffmail.com>
13510 Anoob V.E <projectmonokochi@rediffmail.com>
13511 Harilal P.R <projectmonokochi@rediffmail.com>
13512 Raja R Harinath <rharinath@novell.com>
13515 * delegate.cs (Define): Emit ParamArrayAttribute for 'params'
13517 * typemanager (GetConstructor): Make public.
13519 2005-04-05 John Luke <john.luke@gmail.com>
13520 Raja R Harinath <rharinath@novell.com>
13523 * typemanager.cs (IsUnmanagedType): Check non-public fields of a
13524 struct too. Return false quicker in a few cases.
13525 (VerifyUnManaged): Use it.
13527 2005-04-05 Raja R Harinath <rharinath@novell.com>
13530 * statement.cs (Block.Resolve): Initialize 'unreachable' to false,
13531 not 'unreachable_seen'.
13533 2005-04-04 Marek Safar <marek.safar@seznam.cz>
13535 * attribute.cs (Attribute.GetValue): Removed unused.
13537 * codegen.cs (CodeGen.TrimExt): Removed unused.
13539 * cs-parser.jay (output): Removed unused.
13541 * cs-tokenizer.cs (hex_digits): Removed unused.
13543 * enum.cs (MapToInternalType, GetEnumeratorName): Removed unused.
13545 * expression.cs (Indirection.LoadExprValue): Removed unused.
13546 (ArrayCreation.ExpressionToArrayArgument): Removed unused.
13548 * iterators.cs (Iterator.param_types): Removed unused.
13550 * statement.cs (Goto.block): Removed unused.
13551 (ToplevelBlock.did): Removed unused.
13552 (Switch.ResolveConstantSwitch): Removed unused.
13554 2005-04-01 Ben Maurer <bmaurer@ximian.com>
13556 * rootcontext.cs: Allow mcs to bootstrap with the compilation
13559 2005-04-01 Raja R Harinath <rharinath@novell.com>
13561 Fix #74232 and cs0208-3.cs.
13562 * expression.cs (ComposedCast.DoResolveAsTypeStep): Add CS0208 check.
13563 * typemanager.cs (IsUnmanagedType): Don't allow 'object' as an
13564 unmanaged type. Don't use FieldBuilders when 't' is a
13565 TypeBuilder. Use ModFlags and MemberType fields.
13566 * class.cs (MemberBase.member_type): Rename from MemberType.
13567 (MemberBase.MemberType): New property. Determines member_type on
13569 (MemberBase.DoDefine): Don't initialize MemberType here.
13570 (FieldMember.Define): Likewise.
13572 2005-04-01 Marek Safar <marek.safar@seznam.cz>
13575 * class.cs (Event.Emit): Call Add/Remove emit even for interfaces.
13576 Attributes are emitted there.
13578 2005-04-01 Raja R Harinath <rharinath@novell.com>
13580 * cs-tokenizer.cs (consume_identifier): Treat 'partial' as a
13581 keyword in 'partial enum' too.
13582 * cs-parser.jay (enum_declaration): Add CS0267 check ('partial enum'
13584 Report from Kamil Skalski <nazgul@omega.pl>.
13587 * rootcontext.cs (ResolveTree): The 'root.Interfaces' list can
13588 have partial containers too.
13590 * ecore.cs (SimpleName.SimpleNameResolve): Move 'invariant meaning
13591 in block' checks to Block.CheckInvariantMeaningInBlock.
13592 * statement.cs (Block.GetKnownVariableInfo): Make private.
13593 (Block.IsVariableUsedInChildBlock): Remove.
13594 (Block.IsVariableUsedInBlock): Likewise.
13595 (Block.CheckInvariantMeaningInBlock): New. Show location of
13596 conflicting declaration.
13597 (Block.AddVariable): Make error messages less long-winded and more
13598 specific. Show location of conflicting declaration.
13599 * parameter.cs (Parameters.Location): New readonly property.
13601 2005-03-31 Raja R Harinath <rharinath@novell.com>
13603 Clean up semantics of invoking ResolveMemberAccess.
13604 * ecore.cs (SimpleName.DoSimpleNameResolve): If a MemberExpression
13605 can have an instance, ensure that we pass in a non-TypeExpression
13606 to ResolveMemberAccess. Tighten up IdenticalNameAndTypeName checks.
13607 (MemberExpr.DoSimpleNameResolve): Remove type_is_inferred
13608 argument. Update to changes and simplify.
13609 (FieldExpr.Emitinstance): Remove CS0120 check.
13610 (PropertyExpr.EmitInstance): Likewise.
13611 * expression.cs (Argument.Resolve): Likewise.
13612 (Invocation.DoResolve): Update to changes in semantics of
13613 InstanceExpression.
13615 2005-03-31 Marek Safar <marek.safar@seznam.cz>
13618 * class.cs (AbstractPropertyEventMethod.EmitMethod): Enable emit method
13621 * decl.cs (MemberCache.AddMethods): Fix infinite loop.
13623 2005-03-31 Raja R Harinath <rharinath@novell.com>
13625 Fix difference in behaviour with commandline invocation.
13626 * driver.cs (Driver.Reset): New.
13627 (CompilerCallableEntryPoint): Call it.
13629 * statement.cs (If.Resolve): Avoid spurious "uninitialized
13630 variable" warnings if the boolean expression failed to resolve.
13632 2005-03-30 Sebastien Pouliot <sebastien@ximian.com>
13634 * attribute.cs: Fix the union of several permissions when some of them
13635 are unrestricted (so the result isn't an unrestricted permission set).
13638 2005-03-30 Raja R Harinath <rharinath@novell.com>
13640 * ecore.cs (MemberExpr): New class. Convert from interface
13642 (MemberExpr.ResolveMemberAccess): Refactor and move here from
13643 MemberAccess.ResolveMemberAccess. Tighten up pre-conditions and
13645 (MethodGroupExpr, FieldExpr, PropertyExpr, EventExpr): Update.
13646 (MethodGroupExpr.IsExplicitImpl): Remove.
13647 (Expression.GetFieldFromEvent): Remove.
13648 (SimpleName.MemberStaticCheck): Remove.
13649 (SimpleName.DoSimpleNameResolve): Update to changes.
13650 * expression.cs (MemberAccess.ResolveMemberAccess): Refactor.
13651 (MemberAccess.IdenticalNameAndTypeName): Remove.
13652 (MemberAccess.error176): Move to MemberExpr.
13653 (MemberAccess.DoResolve): Update to changes.
13654 (BaseAccess.DoResolve): Likewise.
13656 2005-03-30 Marek Safar <marek.safar@seznam.cz>
13658 C# 2.0 Conditional attribute class implementation
13660 * attribute.cs (AttributeTester.IsAttributeExcluded): New method.
13661 Analyzes class whether it has attribute which has ConditionalAttribute
13662 and its condition is not defined.
13664 * class.cs (Class.ApplyAttributeBuilder): Add IsAttributeExcluded check.
13665 (Class.IsExcluded): New method. Search for at least one defined
13666 condition in ConditionalAttribute of attribute class.
13668 2005-03-30 Raja R Harinath <rharinath@novell.com>
13670 * ecore.cs (PropertyExpr): Derive from Expression, not
13671 ExpressionStatement.
13672 (PropertyExpr.EmitStatement): Remove.
13674 2005-03-29 Raja R Harinath <rharinath@novell.com>
13677 * expression.cs (MemberAccess.ResolveMemberAccess): Allow the
13678 internal field "value__" of an enum be private. The examples for
13679 "value__" that I found on MSDN all used FieldAttributes.Private.
13681 * decl.cs (MemberCache.AddMethods): Use C# terminology in warning.
13682 Don't mention IL method attribute names.
13684 Fix #47991. Remove a TODO.
13685 * statement.cs (Block.Toplevel): Make into a field.
13686 (Block.Parameters): Move into ToplevelBlock.
13687 (Block.known_variables): Rename from child_variable_names.
13688 (Block.Block): Remove variants that take Parameters. Initialize
13689 'Toplevel' with the immediately surrounding toplevel block.
13690 (Block.AddKnownVariable): Rename from AddChildVariableName. Add a
13691 LocalInfo parameter.
13692 (Block.GetKnownVariableInfo): New.
13693 (Block.IsVariableNameUsedInChildBlock): Update.
13694 (Block.IsVariableNameUsedInBlock): New. Checks if a name is used in
13695 the block, even though it may not be in scope.
13696 (Block.AddVariable): Remove Parameters parameter. Use
13697 Toplevel.Parameters instead.
13698 (Block.AddConstant): Remove Parameters parameter.
13699 (Block.GetParameterReference): Update to use Toplevel.Parameters.
13700 (Block.IsParamaterReference): Likewise.
13701 (Block.IsLocalParameter): Likewise. Simplify a lot.
13702 (ToplevelBlock.Parameters): New. Moved from Block.
13703 (ToplevelBlock.ToplevelBlock): Update to changes. Always
13704 initialize Parameters to a non-null value.
13705 * cs-parser.jay: Update to changes.
13706 * ecore.cs (SimpleName.SimpleNameResolve): Emit cs0136 error for
13707 simple names that mean different things in the same block. Use
13708 Block.IsVariableNameUsedInBlock.
13710 2005-03-28 Raja R Harinath <rharinath@novell.com>
13712 * typemanager.cs (TypeHandle.BaseType): Make into an IMemberContainer.
13713 (TypeHandle.TypeHandle): Use LookupMemberCache rather than
13714 GetTypeHandle. It is possible for a reflected type to derive from
13715 a TypeBuilder (e.g., int[] derives from the TypeBuilder
13716 System.Array during mscorlib compilation).
13717 * decl.cs (MemberCache.MemberCache): If the base cache doesn't
13718 contain a method_hash, don't create one either. Don't create a
13719 deep copy of the base cache's method_hash.
13720 (MemberCache.SetupCache): Rename back from DeepCopy.
13721 (MemberCache.AddMethods): Rewrite, now that method_hash isn't
13722 already initialized. If we see an override function, add its
13723 underlying base virtual function to the member_hash too.
13725 * enum.cs (Enum.LookupEnumValue): Remove debugging code.
13727 2005-03-26 Raja R Harinath <harinath@acm.org>
13730 * assign.cs (Assign.DoResolve): When the RHS of an assignment
13731 fails to resolve, ensure that the LHS is still resolved as an
13734 2005-03-25 Raja R Harinath <harinath@acm.org>
13736 * enum.cs (Enum.DefineType): Set ec.InEnumContext and
13738 (Enum.current_ec): Remove.
13739 (Enum.LookupEnumValue): Remove EmitContext argument.
13740 Just uses the one created during DefineType.
13741 (Enum.FindMembers): Update.
13742 * expression.cs (MemberAccess.DoResolve): Update.
13744 2005-03-22 Marek Safar <marek.safar@seznam.cz>
13746 * assign.cs (Assign.DoResolve): Check for CS1717 when
13747 source and target are same (uses Equals).
13749 * expression.cs (LocalVariableReference, ParameterReference,
13750 This): Implemented Equals, GetHashCode.
13752 * statement.cs (Block.GetParameterReference): Removed useless
13755 2005-03-22 Raja R Harinath <rharinath@novell.com>
13758 * statement.cs (Block.AddVariable): Ensure that we skip implicit
13759 blocks before deciding whether the error is cs0136 or cs0128.
13761 * cs-parser.jay: Pass MemberName to RootContext.Tree.RecordDecl.
13762 (using_alias_directive, using_namespace_directive): Pass
13763 MemberName, not an expression to Namespace.UsingAlias and
13765 (MakeName): Use the MemberName of the namespace.
13766 * namespace.cs (Namespace.MemberName): New.
13767 (UsingEntry.UsingEntry): Take a MemberName, not an expression.
13768 (AliasEntry.AliasEntry, Namespace.Using, Namespace.UsingAlias):
13770 * decl.cs (MemberName.Name): Make readonly.
13771 (MemberName.FromDotted): New "constructor".
13772 (MemberName.Equals, MemberName.GetHashCode): Implement overrides.
13773 (MemberCore.Name): Compute from MemberName on demand.
13774 (MemberCore.SetMemberName): Provide a way to change the
13776 (MemberCore.AddToContainer): Don't take a fullname parameter.
13777 * class.cs (TypeContainer.AddToMemberContainer): Don't add the
13778 fully qualified name of the container to the member name.
13779 (TypeContainer.AddToTypeContainer): Use a fully qualified name
13780 only if the type is a member of the root container.
13781 (TypeContainer.AddMethod, TypeContainer.AddProperty): Use
13782 MemberName.Left rather than searching for an embedded ".".
13783 (PartialContainer.CreatePart): Update to changes in RootContext.
13784 (MemberBase.ShortName): Turn into a property. Use
13785 MemberCore.SetMemberName.
13786 (MemberBase.ExplicitInterfaceName): Remove.
13787 (MemberBase.UpdateMemberName): Remove.
13788 (AbstractPropertyEventMethod.UpdateName): Use SetMemberName.
13789 (PropertyBase.SetMemberName): New override.
13790 * tree.cs (Tree.RecordDecl): Take a MemberName and use it as hash key.
13791 (Tree.GetDecl): New.
13792 (Tree.AllDecls): Rename from Decls.
13793 * attribute.cs, enum.cs, report.cs: Update to changes.
13794 * driver.cs (MainDriver): Use MemberName.FromDotted on
13795 RootContext.MainClass.
13797 2005-03-21 Marek Safar <marek.safar@seznam.cz>
13799 * class.cs (FixedField.Define): Check for CS1664 and more sanity
13802 * expression.cs (ElementAccess.DoResolveLValue): Check for CS1708.
13804 2005-03-18 Marek Safar <marek.safar@seznam.cz>
13806 * modifiers.cs (Modifiers.PROPERTY_CUSTOM): New constant for
13807 property accessor modifiers.
13809 * class.cs (FieldMember.ApplyAttributeBuilder): Don't allow apply
13810 fixed buffer attribute (CS1716).
13811 (PropertyMethod.HasCustomAccessModifier): When property accessor
13812 has custom modifier.
13814 * ecore (PropertyExpr.DoResolve): Add CS0271 for custom accessor
13816 (PropertyExpr.DoResolveLValue): Add CS0272.
13818 2005-03-17 Miguel de Icaza <miguel@novell.com>
13820 * convert.cs: When converting to a pointer, use the proper Conv.U
13821 or Conv.I depending on the source data type.
13823 * cs-tokenizer.cs: Make the size for large decimal constants,
13826 2005-03-17 Martin Baulig <martin@ximian.com>
13828 * anonymous.cs (AnonymousMethod.method_modifiers): Change default
13829 from `Modifiers.INTERNAL' to `Modifiers.PRIVATE'. Fixes #73260.
13831 2005-03-17 Martin Baulig <martin@ximian.com>
13833 * anonymous.cs (AnonymousMethod.EmitMethod): Changed return type
13834 to bool so we can return an error condition.
13835 (AnonymousDelegate.Emit): Check whether AnonymousMethod.EmitMethod()
13838 2005-03-16 Zoltan Varga <vargaz@freemail.hu>
13840 * attribute.cs: Encode ThrowOnUnmappableChar and BestFitMapping
13843 2005-03-16 Raja R Harinath <rharinath@novell.com>
13845 Remove TypeManager.LookupType and TypeManager.LookupTypeDirect.
13846 Refactor to avoid traversing the list of assemblies, and to avoid
13847 string concatenation.
13848 * typemanager.cs (guid_attr_type): Remove.
13849 (negative_hits, pointers, references): Remove hashes.
13851 (GetConstructedType): New. Uses type_hash to handle constructed
13852 types (arrays, references, pointers).
13853 (GetReferenceType, GetPointerType): Use it.
13854 (GetNestedType): New. Uses type_hash to handle nested types of
13856 (LookupType, LookupTypeDirect): Remove.
13857 (CoreLookupType): Inline parts of old LookupTypeDirect code. Use
13858 'types' hash and LookupTypeReflection directly.
13859 (params_string, params_object): Use GetConstructedType.
13860 * namespace.cs (Namespace.cached_types): New. Cache of reflected
13862 (Namespace.Lookup): Use cached_types.
13863 (NamespaceEntry.LookupNamespaceOrType): Inline the functionality
13864 provided by old TypeManager.LookupType.
13865 * rootcontext.cs (MakeFQN): Remove.
13866 * decl.cs (DeclSpace.MakeFQN): Likewise.
13867 (DeclSpace.LookupType): Use TypeManager.GetNestedType.
13868 * expression.cs (ComposedCast.DoResolveAsTypeStep): Use
13869 TypeManager.GetConstructedType.
13870 * tree.cs (decl_ns_hash, LookupByNamespace): Remove.
13872 2005-03-15 Marek Safar <marek.safar@seznam.cz>
13874 * class.cs (MethodCore.CheckBase): Report CS1715 for properties and
13877 * cs-parser.jay: Reports CS1527 for any namespace element.
13879 * delegate.cs (DelegateCreation.Error_NoMatchingMethodForDelegate):
13882 * expression.cs (ParameterReference.IsAssigned): Changed error to
13884 (Error_WrongNumArguments): Moved CS0245 detection here.
13886 * statement.cs (Return.Resolve): Add CS1622 report.
13888 2005-03-11 Marek Safar <marek.safar@seznam.cz>
13890 * class.cs (StaticClass.DefineContainerMembers): Added CS0720.
13892 2005-03-11 Zoltan Varga <vargaz@freemail.hu>
13894 * attribute.cs expression.cs: Get rid of some allocations.
13896 2004-03-11 Atsushi Enomoto <atsushi@ximian.com>
13898 * doc.cs : just eliminate the latest change.
13900 2004-03-10 Atsushi Enomoto <atsushi@ximian.com>
13902 * doc.cs : commented out the latest change. It breaks xml-030.cs
13904 2004-03-10 Atsushi Enomoto <atsushi@ximian.com>
13906 * doc.cs : When TypeBuilder did not create Type yet, GetEvents() will
13907 fail. So invoke CreateType() in FindDocumentedType().
13909 2004-03-10 Atsushi Enomoto <atsushi@ximian.com>
13911 * cs-tokenizer.cs : added IsKeyword().
13912 * doc.cs : Detect keyword incorrectly used as identifier.
13913 Allow identifiers prefixed by @.
13915 2005-03-10 Marek Safar <marek.safar@seznam.cz>
13917 * attributes.cs (Attributes.Emit): Continue after CheckTargets.
13918 It caused exception in namespace resolving (again!).
13920 * class.cs (Class.ctor): Removed exit.
13921 (PropertyMethod.ctor): ditto.
13923 * codegen.cs (Codegen.Reset): Reset static data.
13924 (Codegen.ResolveTopBlock): Forward error status from ResolveMeta.
13926 * cs-tokenizer.cs (Cleanup): Removed.
13928 * driver.cs (GetSystemDir): Rewrote to one line command.
13929 It caused problem with unloaded dynamic modules.
13930 (UnixParseOption): Removed Exit.
13931 (CompilerCallableEntryPoint.InvokeCompiler): Make static.
13932 (CompilerCallableEntryPoint.Reset): Reset suitable static data.
13933 Now can be mcs used as library.
13935 * ecore.cs (Expression.ResolveBoolean): Use Location.Null for
13938 * location.cs (Reset): Reset static data.
13940 * namespace.cs (Reset): Reset static data.
13942 * report.cs (Report.Reset): Reset static data.
13944 * rootcontext.cs (RootContext.Reset): Reset static data.
13946 * tree.cs (RootTypes.ctor): Use Location.Null
13948 * typemanager.cs (TypeManager.Reset): Reset static data.
13949 (CoreLookupType): Removed Exit.
13950 (TypeHandle.Reset): Reset static data.
13952 2005-03-10 Raja R Harinath <rharinath@novell.com>
13955 * typemanager.cs (ComputeNamespaces): Import namespaces from
13956 referenced modules too.
13958 2005-03-09 Raja R Harinath <rharinath@novell.com>
13960 * class.cs (TypeContainer.AddToMemberContainer): Use "." rather
13963 2005-03-09 Raja R Harinath <rharinath@novell.com>
13965 * decl.cs (DeclSpace.LookupType): Don't loop but recurse into
13966 enclosing DeclSpace. This ensures that a name-lookup populates
13967 more caches and there are fewer 'TypeExpression's. Carve out
13968 nested type lookup into ...
13969 (LookupNestedTypeInHierarchy): ... this.
13971 2005-03-09 Raja R Harinath <rharinath@novell.com>
13973 Clean up a few partial-class semantics.
13974 Fixes test-357.cs and cs1618-2.cs.
13975 * cs-parser.jay (struct_declaration): Use 'current_class' as
13976 parent of newly-created struct. Remove call to Register ().
13977 Use 'pop_current_class' to complete handing the current struct.
13978 (interface_declaration): Likewise.
13979 (class_declaration): Likewise.
13980 (enum_declaration): Use 'current_class' as parent of newly created
13982 (delegate_declaration): Likewise.
13983 (pop_current_class): New function. This is used to handle closing
13984 up the 'current_class' and 'current_container', and pointing them
13985 to the enclosing class/container.
13986 (CSharpParser): Initialize 'current_class' too.
13987 * decl.cs (MemberCore): Add check for invariant: a partial
13988 container is not a parsed entity, and thus does not enclose any
13990 (DeclSpace.TypeResolveEmitContext): Expose 'type_resolve_ec'.
13991 (DeclSpace.BaseTypeExpr): Use it.
13992 (DeclSpace.LookupType): Add check for invariant.
13993 * class.cs (TypeContainer): Add check for invariant: a nested
13994 class should have the same NamespaceEntry as its enclosing class.
13995 (TypeContainer.EmitFieldInitializers): Make virtual.
13996 (TypeContainer.DefineDefaultConstructor): Adhere to invariant in
13998 (TypeContainer.Register): Remove.
13999 (TypeContainer.DefineType): Set the 'ec' of a PartialContainer to
14000 null. Use TypeResolveEmitContext for resolving base types and
14001 interfaces. Move initialization of Parts.TypeBuilder here from
14003 (TypeContainer.DefineNestedTypes): ... here.
14004 (PartialContainer): Take a Namespace not a NamespaceEntry.
14005 (PartialContainer.Create): Don't use Register. Call the
14006 appropriate Add... function directly.
14007 (ClassPart): Take both the PartialContainer and the enclosing
14008 class as constructor arguments.
14009 (ClassPart.EmitFieldInitializers): Override.
14010 (ClassPart.PartFindNestedTypes): Remove.
14011 (FieldBase.GetInitializerExpression): Resolve the initializer
14012 expression in the emit context of the enclosing class.
14013 * tree.cs (RootTypes): Remove Register ().
14015 2005-03-08 Marek Safar <marek.safar@seznam.cz>
14017 * cs-parser.jay: Removed CS0134.
14019 * driver.cs: Removed CS1901.
14021 * expression.cs (SizeOf.DoResolve): Don't report CS0233
14022 for predefined types.
14024 2005-03-07 Duncan Mak <duncan@novell.com>
14026 * codegen.cs (Save): Catch UnauthorizedAccessException as
14027 well. Fixes bug #73454.
14029 2005-03-07 Marek Safar <marek.safar@seznam.cz>
14031 * cs-tokenizer.cs (xtoken): Add CS1035.
14033 * class.cs (MethodData.Define): Add CS0683.
14034 (FieldMember.ctor): Add CS0681.
14036 2005-03-07 Raja R Harinath <rharinath@novell.com>
14038 * ecore.cs (SimpleName.DoResolve): Rename from
14039 SimpleName.DoResolveAllowStatic.
14040 (SimpleName.DoSimpleNameResolve): Remove 'allow_static' argument.
14041 Pass 'intermediate' flag to MemberStaticCheck.
14042 (SimpleName.MemberStaticCheck): Skip "static check" only in case
14043 of "intermediate" lookups via MemberAccess.
14044 (SimpleName.IdenticalNameAndTypeName): New. Carved out of ...
14045 * expression.cs (MemberAccess.IdenticalNameAndTypeName): ... this.
14047 2005-03-07 Raja R Harinath <rharinath@novell.com>
14050 * ecore.cs (FieldExpr.EmitInstance): Catch cases of CS0120 that
14051 slipped in because of variable names that are identical to a
14052 builtin type's BCL equivalent ('string String;', 'int Int32;').
14053 (PropertyExpr.EmitInstance): Likewise.
14055 2005-03-04 Marek Safar <marek.safar@seznam.cz>
14057 * cs-tokenizer.cs (PreProcessPragma): Add warning 1633, 1635.
14059 * report.cs (warning_ignore_table): Made public.
14061 2005-03-04 Raja R Harinath <rharinath@novell.com>
14064 * class.cs (MethodData.Emit): Pass 'container' to
14065 container.GetObsoleteAttribute instead of 'container.Parent'.
14067 2005-03-03 Marek Safar <marek.safar@seznam.cz>
14069 * cs-parser.jay: Add 1534 error test.
14071 * iterators.cs (Yield.CheckContext): Add error 1629.
14072 (Iterator.ctor): Save unsafe modifier.
14073 (MoveNextMethod.DoEmit): Restore unsafe context.
14075 * namespace.cs (UsingAlias): Better error message.
14077 2005-03-03 Dan Winship <danw@novell.com>
14079 * convert.cs (Error_CannotImplicitConversion): fix two bugs in
14080 the warning message [#73219]
14082 2005-03-03 Raja R Harinath <rharinath@novell.com>
14084 Fix compile with MCS 1.0.0.0.
14085 * cs-tokenizer.cs (PreProcessPragma): Simplify w_disable and
14086 w_restore to not depend on string constant folding.
14088 2005-03-03 Raja R Harinath <rharinath@novell.com>
14090 * decl.cs (DeclSpace.LookupType): Remove 'silent' argument. Move
14091 CS0246 check to users who passed 'silent = false'.
14092 * ecore.cs (TypeLookupExpression.DoResolveAsTypeStep): Add CS0246
14094 (SimpleName.SimpleNameResolve): Update.
14095 * expression.cs (ComposedCast.DoResolveAsTypeStep): Add CS0246 check.
14096 (MemberAccess.IdenticalNameAndTypeName): Update.
14097 * doc.cs (FindDocumentedTypeNonArray): Update.
14099 2005-03-03 Raja R Harinath <rharinath@novell.com>
14101 * codegen.cs (EmitContext): Remove ResolvingTypeTree.
14102 * parameters.cs (ComputeAndDefineParameters): Remove.
14103 * decl.cs (ResolveBaseTypeExpr): Don't set ResolvingTypeTree.
14104 * delegate.cs (Define): Don't invoke ComputeAndDefineParameters.
14105 Use GetParameterInfo.
14107 2005-03-02 Marek Safar <marek.safar@seznam.cz>
14109 * report.cs (StaticClass.DefineContainerMembers): Add warning 628.
14111 2005-03-02 Raja R Harinath <rharinath@novell.com>
14113 Unify DeclSpace.LookupType and DeclSpace.FindType.
14114 * decl.cs (DeclSpace.FindNestedType): New virtual function. This
14115 is in charge of defining nested types on demand.
14116 (DeclSpace.LookupType): Use it when the current_type is a
14117 TypeBuilder. Use LookupTypeDirect for reflected types.
14118 (DeclSpace.FindType): Remove.
14119 (DeclSpace.LookupInterfaceOrClass): Likewise.
14120 (DeclSpace.DefineTypeAndParents): Likewise.
14121 * ecore.cs (SimpleName.ResolveAsTypeStep): Just call
14122 DeclSpace.LookupType.
14123 * doc.cs (FindDocumentedTypeNonArray): Use DeclSpace.LookupType.
14124 * typemanager.cs (LookupType): Simplify.
14125 (AddUserType): Remove type from negative_hits.
14126 * namespace.cs (Namespace.Lookup): Use TypeManager.LookupTypeDirect.
14127 * class.cs (TypeContainer.FindMembers): Move handling of nested
14129 (TypeContainer.FindMembers_NestedTypes): ... here.
14130 (TypeContainer.FindNestedType): Implement override.
14131 (ClassPart.FindNestedType): Delegate to PartialContainer.
14132 (ClassPart.PartFindNestedType): Looks up the nested types of the
14135 2005-03-02 Martin Baulig <martin@ximian.com>
14137 * class.cs (TypeContainer.DoDefineMembers): We also need a default
14138 static constructor in static classes.
14140 2005-03-01 Zoltan Varga <vargaz@freemail.hu>
14142 * attribute.cs: Pass -1 to DefineLPArrayInternal if sizeConst or
14143 sizeParamIndex is not specified.
14145 2005-03-01 Marek Safar <marek.safar@seznam.cz>
14148 * report.cs (WarningMessage.IsEnabled): Missing null check.
14150 2005-02-28 Marek Safar <marek.safar@seznam.cz>
14152 * attribute.cs (DefinePInvokeMethod): Fix, all data are stored
14153 in the fields and not in the properties.
14155 2005-02-28 Zoltan Varga <vargaz@freemail.hu>
14157 * attribute.cs (GetMarshal): Marshal SizeConst and SizeParamIndex
14160 2005-02-28 Marek Safar <marek.safar@seznam.cz>
14162 * attribute.cs: Small refactoring (improved robustness).
14163 (ImplOptions, UnmanagedType, UsageAttribute): Removed members.
14164 (ValidateGuid): Removed.
14165 (Resolve): Removed referenced to above mentioned.
14166 (GetAttributeUsage): Made private and changed to work without
14168 (GetIndexerAttributeValue): Don't crash.
14169 (GetConditionalAttributeValue): Ditto.
14170 (GetClsCompliantAttributeValue): Ditto.
14171 (ExtractSecurityPermissionSet): All attributes exceptions are
14173 (GetPropertyValue): New helper.
14174 (GetMethodImplOptions): New method.
14175 (DefinePInvokeMethod): Reuse common code. Implemented handling of
14176 some missing properties.
14178 * class.cs (ClassOrStruct.ApplyAttributeBuilder): Updated.
14179 (Method.ApplyAttributeBuilder): Updated.
14181 * decl.cs (DeclSpace.ApplyAttributeBuilder): Don't catch shared
14184 2005-02-28 Raja R Harinath <rharinath@novell.com>
14187 * report.cs (Report.SymbolRelatedToPreviousError): Handle
14188 non-simple types (array, pointer, reference).
14190 2005-02-28 Marek Safar <marek.safar@seznam.cz>
14192 * cs-parser.jay: Add errors 1617, 650, 1007, 531, 547, 548
14194 * class.cs (MethodCore.IsDuplicateImplementation): Special error
14196 (Method.CheckBase): Catch wrong destructor here.
14197 (MethodData.Define): Add errors 550, 668.
14199 * cs-tokenizer.cs (PreProcessPragma): Add warning 1634.
14201 * ecore.cs (PropertyExpr.DoResolveLValue): Fixed wrong error code.
14203 * pending.cs (VerifyPendingMethods): Add error 551.
14205 * typemanager.cs (CSharpName): Next error report helper.
14207 2005-02-25 Marek Safar <marek.safar@seznam.cz>
14209 * attribute.cs (Atttribute.Resolve): Add cache for parameter-less
14210 attributes. Removed useless attribute double check.
14211 It saves almost 2MBs for corlib.
14213 2005-02-25 Raja R Harinath <rharinath@novell.com>
14216 * statement.cs (ExpressionStatement.Resolve): Make robust to being
14217 called twice in case of error.
14219 2005-02-23 Chris Toshok <toshok@ximian.com>
14221 Fix compiler portions of #72827.
14222 * statement.cs (Block.Emit): call Begin/EndScope on the
14223 EmitContext instead of the ILGenerator.
14225 * codegen.cs (EmitContext.BeginScope): new method, call
14226 ILGenerator.BeginScope as well as the SymbolWriter's OpenScope (if
14228 (EmitContext.BeginScope): same, but EndScope and CloseScope
14230 * symbolwriter.cs (SymbolWriter.OpenScope): get the current il
14231 offset and call the superclass's OpenScope(int) with it.
14232 (SymbolWriter.CloseScope): get the current il
14233 offset and call superclass's CloseScope(int) with it.
14235 2005-02-23 Marek Safar <marek.safar@seznam.cz>
14237 * anonymous.cs (AnonymousMethod.Compatible): Fixed to report
14238 CS1677 for out and ref as well.
14240 * class.cs (Method.Define): Add error CS1599 detection.
14242 * cs-parser.jay: Add CS1609, CS1670, CS1627 detection.
14244 * cs-tokenizer.cs (xtoken): Add error CS1646 detection.
14246 * delegate.cs (Delegate.Define): Add error CS1599 detection.
14248 * support.cs.cs (ModifierDesc): New helper method.
14250 2005-02-23 Raja R Harinath <rharinath@novell.com>
14251 Abin Thomas <projectmonokochi@rediffmail.com>
14252 Anoob V E <projectmonokochi@rediffmail.com>
14253 Harilal P R <projectmonokochi@rediffmail.com>
14255 Fix #57851, #72718.
14256 * class.cs (ConstructorBuilder.Resolve): Make sure that the second
14257 MemberLookup (used for error reporting) actually returns a result.
14258 Fix error report number (122, not 112).
14260 2005-02-22 Abin Thomas <projectmonokochi@rediffmail.com>
14261 Anoob V E <projectmonokochi@rediffmail.com>
14262 Harilal P R <projectmonokochi@rediffmail.com>
14265 * pending.cs (PendingImplementation.GetAbstractMethods):
14266 Find NonPublic members too.
14268 2005-02-22 Marek Safar <marek.safar@seznam.cz>
14270 * expression.cs.cs (ConditionalLogicalOperator.DoResolve):
14273 * class.cs (MethodCore.CheckMethodAgainstBase):
14274 Add error 239 report.
14276 2005-02-21 Raja R Harinath <rharinath@novell.com>
14279 * expression.cs (Invocation.IsApplicable): Make public.
14280 (Invocation.IsParamsMethodApplicable): Likewise.
14281 * delegate.cs (Delegate.VerifyApplicability): Don't use
14282 Invocation.VerifyArgumentCompat for parameter applicability
14283 testing. Use Invocation.IsApplicable and
14284 Invocation.IsParamsMethodApplicable.
14286 2005-02-21 Marek Safar <marek.safar@seznam.cz>
14288 * ecore.cs (PropertyExpr.DoResolve): Add error 214 report.
14290 * class.cs (Operator.Define): Add error 217 report.
14292 2005-02-21 Raja R Harinath <rharinath@novell.com>
14294 * namespace.cs (UsingEntry.Resolve): Undo change below.
14296 2005-02-21 Raja R Harinath <rharinath@novell.com>
14299 * ecore.cs (Expression.MemberLookupFailed): Add argument to
14300 disable the error message when the extended MemberLookup also
14302 (Expression.MemberLookupFinal): Update.
14303 (SimpleName.DoSimpleNameResolve): Update.
14304 * expression.cs (MemberAccess.ResolveNamespaceOrType):
14305 Don't use MemberLookupFinal.
14306 (New.DoResolve): Update.
14307 (BaseAccess.CommonResolve): Update.
14309 2005-02-21 Raja R Harinath <rharinath@novell.com>
14312 * attribute.cs (Attribute.ResolveType): If a 'resolve_error' had
14313 occured previously, don't resolve again.
14315 2005-02-21 Marek Safar <marek.safar@seznam.cz>
14318 * attribute.cs (Attribute.GetAttributeUsage): Add EmitContext
14319 argument. Call ResolveAttributeUsage for unresolved.
14320 when types doesn't match ctor arguments.
14322 * class.cs (DoDefineMembers.TypeContainer): Removed safety check
14323 for nested attribute classes.
14324 (Class.attribute_usage): Removed.
14325 (Class.ResolveAttributeUsage): Resolves AttributeUsageAttribute
14326 for attribute class.
14328 * ecore.cs (IsAttribute): Removed.
14330 * namespace.cs (UsingEntry.Resolve): Don't destroy NamespaceEntry.
14332 * rootcontext.cs (RegisterAttribute): Removed, attributes are
14334 (attribute_types): Removed.
14335 (EmitCode): Global attributes are emited as the latest.
14337 2005-02-18 Marek Safar <marek.safar@seznam.cz>
14339 * class.cs (EmitFieldInitializers): Don't emit field initializer
14340 for default values when optimilization is on.
14342 * constant.cs (Constant.IsDefaultValue): New property.
14344 * driver.cs: Add /optimize handling.
14348 * literal.cs: Implement new IsDefaultValue property.
14350 * rootcontext.cs (Optimize): New field, holds /optimize option.
14352 2005-02-18 Raja R Harinath <rharinath@novell.com>
14354 Fix crasher in re-opened #72347.
14355 * namespace.cs (Namespace.Lookup): Return null if
14356 DeclSpace.DefineType returns null.
14359 * expression.cs (Argument.Resolve): Handle a case of CS0120 here.
14361 2005-02-18 Raja R Harinath <rharinath@novell.com>
14363 Fix remainder of #63202. Change semantics of DoResolveLValue: it
14364 now returns null if it cannot resolve to an lvalue.
14365 * ecore.cs (Expression.DoResolveLValue): Return 'null' by default.
14366 (Expression.ResolveLValue): Emit CS0131 error if DoResolveLValue
14367 returned null. Remove check for SimpleName.
14368 (EventExpr.DoResolveLValue): New.
14369 * iterators.cs (Iterator.FieldExpression.DoResolveLValue): New.
14370 * expression.cs (Argument.Error_LValueRequired): New. Move CS1510
14372 (Argument.Resolve): ... here. Use it. Use DoResolveLValue to
14373 avoid CS0131 error.
14374 (Unary.ResolveOperator): Move CS0211 check ...
14375 (Unary.DoResolve): ... here. Use DoResolveLValue to avoid
14377 (Unary.DoResolveLValue): Simplify.
14378 (AddressOf.DoResolveLValue): New.
14379 (ArrayAccess.DoResolveLValue): New.
14381 2005-02-16 Marek Safar <marek.safar@seznam.cz>
14383 * attribute.cs (Attribute.Resolve): Add arguments casting for
14384 when types doesn't match ctor arguments.
14386 2005-02-16 Raja R Harinath <rharinath@novell.com>
14388 Fix parts of #63202.
14389 * expression.cs (UnaryMutator.ResolveOperator): Remove redundant
14390 lookup of operator in base type. Ensure that all checks happen
14391 when the operator resolves to an "op_..." method.
14393 2005-02-15 Raja R Harinath <rharinath@novell.com>
14396 * namespace.cs (NamespaceEntry.LookupNamespaceOrType): Add
14397 'ignore_cs0104' parameter. Pass it to ...
14398 (NamespaceEntry.Lookup): ... this.
14399 * decl.cs (DeclSpace.LookupType): Add 'ignore_cs0104' parameter.
14400 * ecore.cs (SimpleName.ResolveAsTypeStep): Update.
14401 (TypeLookupExpression.DoResolveAsTypeStep): Update.
14402 * expression.cs (MemberAccess.IdenticalNameAndTypeName):
14403 Update. Request that cs0104 errors be ignored.
14404 (ComposedCast.ResolveAsTypeStep): Update.
14406 2005-02-14 Raja R Harinath <rharinath@novell.com>
14409 * expression.cs (Invocation.BetterFunction): Remove support for
14410 comparing virtual functions and their overrides.
14411 (Invocation.IsOverride): New.
14412 (Invocation.OverloadResolve): Don't consider 'override' functions
14413 during candidate selection. Store them in a lookaside list.
14414 If the selected method is a 'virtual' function, use the list to
14415 find any overrides that are closer to the LHS type.
14417 2005-02-14 Marek Safar <marek.safar@seznam.cz>
14419 * expression.cs (New.DoResolve): Add complex core type reduction.
14420 (New.Constantify): Converts complex core type syntax like 'new int ()'
14421 to simple constant.
14423 2005-02-14 Raja R Harinath <rharinath@novell.com>
14425 * decl.cs (EntryType.EntryType): New constructor to create an
14426 updated copy of a cache entry.
14427 (MemberCache.AddMethods): Use it.
14428 (MemberCache.ClearDeclaredOnly): Remove.
14429 (MemberCache.MemberCache): Update.
14431 2005-02-11 Miguel de Icaza <miguel@novell.com>
14433 * codegen.cs (EmitContext): Introduce the `MethodIsStatic'
14434 variable. This one is represents the actual low-level declaration
14435 of the method, as opposed to the semantic level `IsStatic'.
14437 An anonymous method which is hosted into a static method might be
14438 actually an instance method. IsStatic would reflect the
14439 container, while MethodIsStatic represents the actual code
14442 * expression.cs (ParameterReference): Use the new MethodIsStatic
14443 instead of IsStatic.
14445 * anonymous.cs (AnonymousMethod.Compatible): Pass the
14446 Modifiers.STATIC to the Anonymous' Method EmitContext if static is
14447 set on the current EmitContext.
14449 * expression.cs (Cast): Overload DoResolveLValue so we can pass
14450 resolve our casted expression as an LValue. This triggers the
14451 proper LValue processing that is later required by Assign.
14455 * cs-tokenizer.cs (pp_and): recurse on pp_and, fixes #61903.
14457 2005-02-11 Marek Safar <marek.safar@seznam.cz>
14459 C# 2.0 Fixed buffer implementation
14461 * anonymous.cs: Update after RegisterHelperClass renaming.
14463 * attribute.cs (AttributeTester.fixed_buffer_cache):
14464 Cache of external fixed buffers.
14465 (AttributeTester.GetFixedBuffer): Returns IFixedBuffer
14466 implementation if field is fixed buffer else null.
14469 (TypeContainer.AddField): Accept FieldMember instead of Field.
14470 (FieldBase.IsFieldClsCompliant): Extracted code from
14471 VerifyClsCompliance descendant customization.
14472 (FixedField): New class handles fixed buffer fields.
14473 (FixedFieldExternal): Keeps information about imported fixed
14475 (IFixedField): Make access to internal or external fixed buffer
14478 * cs-parser.jay: Add fixed buffer parsing.
14480 * ecore.cs (FieldExpr.Emit): Add special emit case for fixed
14483 * expression.cs (Indirection): Extended implementation to accept
14484 fixed buffer field.
14485 (PointerArithmetic.Emit): Get element from fixed buffer as well.
14486 (ElementAccess.MakePointerAccess): Get type as parameter.
14487 (DoResolve): Add fixed buffer field expression conversion.
14488 (DoResolveLValue): Ditto.
14489 (FixedBufferPtr): New class. Moved most of original ArrayPtr.
14490 (ArrayPtr): Derives from FixedBufferPtr.
14491 (ArrayPtr.Emit): Add extra emit for array elements.
14493 * flowanalysis.cs.cs (StructInfo): Use FieldMember.
14495 * rootcontext.cs (CloseTypes): Emit CompilerGenerated attribute
14496 for compiler generated types.
14497 (RegisterCompilerGeneratedType): Renamed from RegisterHelperClass.
14499 * statement.cs (Fixed): Refactored to be easier add fixed buffer
14500 and consume less memory.
14501 (Fixed.Resolve): Add fixed buffer case.
14503 * typemanager.cs (compiler_generated_attr_ctor,
14504 fixed_buffer_attr_ctor): Add new 2.0 compiler attributes.
14505 (HasElementType): Add our own implementation to work on every
14508 2005-02-11 Miguel de Icaza <miguel@novell.com>
14510 * anonymous.cs (CaptureContext): Track whether `this' has been
14513 * expression.cs (This.ResolveBase): Call CaptureThis. Before we
14514 only captured `this' if it was implicitly done (instance
14515 methods/variables were used).
14517 * codegen.cs (EmitContext.CaptureThis): New method to flag that
14518 `this' must be captured.
14520 2005-01-30 Miguel de Icaza <miguel@novell.com>
14522 * anonymous.cs (CreateMethodHost): If there Scope.ScopeTypeBuilder
14523 is null it means that there has been no need to capture anything,
14524 so we just create a sibling.
14526 Renamed `EmitHelperClasses' to `EmitAnonymousHelperClasses'
14528 Just a partial fix. The other half is fairly elusive.
14530 2005-02-10 Raja R Harinath <rharinath@novell.com>
14532 Fix #52586, cs0121-4.cs.
14533 * decl.cs (MemberCache.DeepCopy): Rename from SetupCache. Take
14534 and return a hashtable.
14535 (MemberCache.ClearDeclaredOnly): New.
14536 (MemberCache.MemberCache): Update to change. Make a deep copy of
14537 the method_hash of a base type too.
14538 (MemberCache.AddMethods): Adapt to having a deep copy of the base
14539 type methods. Overwrite entries with the same MethodHandle so
14540 that the ReflectedType is correct. The process leaves in base
14541 virtual functions and their overrides as distinct entries.
14542 (CacheEntry): Now a class instead of a struct. It shouldn't alter
14543 matters since it was boxed in a ArrayList before.
14544 (CacheEntry.Member, CacheEntry.EntryType): Remove 'readonly'
14546 * expression.cs (Invocation.BetterFunction): Simplify. Handle the
14547 case of a virtual function and its override (choose the overload
14549 (Invocation.OverloadResolve): Avoid 'override' members during
14550 'applicable_type' calculation.
14552 2005-02-09 Raja R Harinath <rharinath@novell.com>
14554 Combine two near-redundant caches.
14555 * typemanager.cs (method_params): Rename from method_internal_params.
14556 (TypeManager.GetParameterData): New. Replace
14557 Invocation.GetParameterData.
14558 (TypeManager.LookupParametersByBuilder): Remove.
14559 * expression.cs (Invocation.method_parameter_cache): Remove.
14560 (Invocation.GetParameterData): Remove.
14562 * anonymous.cs, attribute.cs, convert.cs, delegate.cs:
14565 2005-02-08 Raja R Harinath <rharinath@novell.com>
14568 * delegate.cs (Delegate.DefineType): When bootstrapping corlib, if
14569 TypeManager.multicast_delegate_type is null, resolve it by looking
14570 up "System.MulticastDelegate".
14571 * rootcontext.cs (RootContext.ResolveCore): Simplify.
14573 2005-02-07 Abin Thomas (NOSIP) <projectmonokochi@rediffmail.com>
14574 Anoob V.E (NOSIP) <projectmonokochi@rediffmail.com>
14575 Harilal P.R (NOSIP) <projectmonokochi@rediffmail.com>
14578 * statement.cs (LabeledStatement.Resolve): Don't set 'referenced'.
14579 (LabeledStatement.AddReference): New. Set 'referenced'.
14580 (Goto.Resolve): Use it.
14582 2005-02-05 John Luke <john.luke@gmail.com>
14584 * driver.cs: remove duplicate -doc line in Usage ()
14586 2005-02-04 Raja R Harinath <rharinath@novell.com>
14588 * location.cs (Location.AddFile): Fix CS2002 error report.
14590 2005-02-02 Martin Baulig <martin@ximian.com>
14592 * delegate.cs (Delegate.DefineType): Report an internal error if
14593 TypeManager.multicast_delegate_type is null. See bug #72015 for
14596 2005-02-02 Raja R Harinath <rharinath@novell.com>
14598 Fix a crasher in a variant of #31984.
14599 * const.cs (Constant.CheckBase): New override that defers the
14600 new-or-override check in case the base type hasn't been populated
14602 (Constant.Define): Ensure the new-or-override check is performed.
14604 2005-02-01 Duncan Mak <duncan@ximian.com>
14606 * const.cs (LookupConstantValue): Check that `ce' is not null
14607 before calling GetValue ().
14609 2005-02-01 Raja R Harinath <rharinath@novell.com>
14611 Fix test-334.cs (#69519).
14612 * cs-parser.jay (using_alias_directive): Pass in an expression to
14613 NamespaceEntry.UsingAlias.
14614 (using_namespace_directive): Pass in an expression to
14615 NamespaceEntry.Using.
14616 (namespace_name): Don't flatten to a string.
14617 * namespace.cs (NamespaceEntry.AliasEntry): Store an expression.
14618 (NamespaceEntry.AliasEntry.Resolve): Lookup using
14620 (NamespaceEntry.UsingEntry): Likewise.
14621 (NamespaceEntry.Using,NamespaceEntry.UsingAlias): Update to
14623 (NamespaceEntry.LookupForUsing): Remove.
14624 (NamespaceEntry.LookupNamespaceOrType): Add support for dotted
14626 (NamespaceEntry.Lookup): Remove support for dotted names.
14628 2005-02-01 Raja R Harinath <rharinath@novell.com>
14630 * namespace.cs (NamespaceEntry.NamespaceEntry): Simplify, and
14632 (NamespaceEntry.ImplicitParent): Compute on demand.
14633 (NamespaceEntry.Doppelganger): New implicit namespace-entry that
14634 parallels the current.
14635 (NamespaceEntry.LookupForUsing): Use it.
14636 (NamespaceEntry.Lookup): If the current namespace-entry is
14637 implicit, don't search aliases and using tables.
14639 2005-02-01 Raja R Harinath <rharinath@novell.com>
14642 * class.cs (TypeContainer.DoDefineMembers): Don't initialize
14644 (TypeContainer.BaseCache): Compute on demand.
14645 (TypeContainer.FindMembers): Define constants and types if they're
14646 not already created.
14647 (FieldMember.Define): Move resetting of ec.InUnsafe before error
14649 * const.cs (Constant.Define): Make idempotent.
14651 2005-01-29 Miguel de Icaza <miguel@novell.com>
14653 * pending.cs: Produce better code (no nops produced by using Ldarg
14656 * pending.cs (PendingImplementation.DefineProxy): It was not `arg
14657 i - 1' it should be arg + 1.
14661 2005-01-28 Raja R Harinath <rharinath@novell.com>
14663 * attribute.cs (Attribute.CheckAttributeType): Make private
14665 (Attribute.ResolveType): Make virtual.
14666 (GlobalAttribute.ResolveType,GlobalAttribute.Resolve): Simplify
14667 handling of RootContext.Tree.Types.
14669 2005-01-27 Raja R Harinath <rharinath@novell.com>
14671 Update attribute-handling to use the SimpleName/MemberAccess
14673 * cs-parser.jay (attribute): Pass in an expression to the
14674 constructors of Attribute and GlobalAttribute.
14675 * attribute.cs (Attribute): Take an expression for the name.
14676 (Attribute.ResolvePossibleAttributeTypes): New. Resolves the
14677 passed in attribute name expression.
14678 (Attribute.CheckAttributeType): Use it.
14679 * ecore.cs (FullNamedExpression.ResolveAsTypeStep): New.
14680 * expression.cs (MemberAccess.ResolveAsTypeStep): Move body to ...
14681 (MemberAccess.ResolveNamespaceOrType): ... here. Add 'silent'
14682 argument to prevent error messages if the lookup fails.
14684 2005-01-27 Marek Safar <marek.safar@seznam.cz>
14686 * expression.cs (Indirection): Implemented IVariable interface
14687 to support indirection in AddressOf operator.
14688 (PointerArithmetic.Emit): Add optimalization for case where
14689 result can be precomputed.
14691 2005-01-26 Martin Baulig <martin@ximian.com>
14693 * class.cs (TypeContainer.AttributeTargets): Return the correct
14694 AttributeTargets depending on our `Kind' instead of throwing an
14695 exception; fixes #71632.
14697 2005-01-26 Marek Safar <marek.safar@seznam.cz>
14700 * expression.cs (MemberAccess.ResolveMemberAccess): Add CS0176 test for
14703 2005-01-25 Raja R Harinath <rharinath@novell.com>
14706 * expression.cs (MemberAccess.DoResolve): Don't complain with
14707 cs0572 when the LHS of a member access has identical name and type
14710 2005-01-25 Marek Safar <marek.safar@seznam.cz>
14713 * attribute.cs (ExtractSecurityPermissionSet): Catch exceptions from
14715 Create custom PermissionSet only for PermissionSetAttribute.
14717 2005-01-24 Marek Safar <marek.safar@seznam.cz>
14720 * class.cs (StaticClass.DefineContainerMembers): Enable enums and
14721 delegates in static class.
14723 2005-01-24 Martin Baulig <martin@ximian.com>
14725 * flowanalysis.cs (FlowBranching.UsageVector.MergeChild): If we're
14726 merging an implicit block, just use its reachability.
14728 * statement.cs (Block.Resolve): Make the unreachable code check
14729 work wrt. implicit blocks; see test-337 from #63842.
14731 2005-01-21 Alp Toker <alp@atoker.com>
14733 * cs-parser.jay: destructor_declaration's container is PartialContainer
14734 not Class when partial types are used, so use Kind prop instead of
14737 2005-01-22 Miguel de Icaza <miguel@ximian.com>
14739 * cs-parser.jay: Improve error reporting when an interface
14740 declares new types.
14742 2005-01-20 Dick Porter <dick@ximian.com>
14744 * support.cs: SeekableStreamReader fix from Sandor Dobos
14745 (dobos_s@ibcnet.hu) to cope with Position setting when multibyte
14746 chars are read. Fixes bug 70369.
14748 2005-01-20 Raja R Harinath <rharinath@novell.com>
14750 * cs-parser.jay (catch_clause): Simplify current_block handling
14753 2005-01-17 Miguel de Icaza <miguel@ximian.com>
14755 * convert.cs (ImplicitStandardConversionExists): Synchronize the
14756 code with ImplicitStandardConversion to handle the implicit
14757 conversion of method groups into valid delegate invocations.
14759 The problem is that in parameter handling we were using this code
14760 path. Fixes bug #64698
14762 2005-01-19 Raja R Harinath <rharinath@novell.com>
14764 * cs-parser.jay: Fix several infelicities.
14765 - Avoid assigning to the parser value stack. Code like
14766 '$3 = null' is unclean. Synthesize a value for the code block
14768 - Avoid using oob_stack for storing location information. Use ...
14769 (_mark_): ... this. New (empty) rule. Saves the current location
14771 (foreach_statement): Avoid using oob_stack for current_block
14772 handling. Use technique used in for_statement and
14773 using_statement. Synthesize a value for the code block to store
14774 additional intermediate information.
14776 2005-01-13 Miguel de Icaza <miguel@ximian.com>
14778 * ecore.cs (IsAccessorAccessible): Accessibility to private fields
14779 of a different type is only allowed to private fields of a
14780 containing type, not on fields of a base class.
14782 See test-174.cs and error cs0122-9.cs
14784 2005-01-13 Raja R Harinath <rharinath@novell.com>
14786 Fix test-335.cs (bug #58126).
14787 * cs-parser.jay (argument): Split out non-expression parts of the
14788 rule into 'non_simple_argument'.
14789 (invocation_expression): Support parenthesized invocations with
14790 multiple arguments, and with single non-simple arguments.
14792 2005-01-13 Raja R Harinath <rharinath@novell.com>
14794 * cs-tokenizer.cs (xtoken): Reset 'comments_seen' in a couple more
14797 2005-01-12 Raja R Harinath <rharinath@novell.com>
14799 Fix cs0038-1.cs, cs1640-6.cs.
14800 * ecore.cs (Expression.Resolve): Remove special-case for
14801 SimpleName in error-handling.
14802 (Expression.almostMatchedMembers): Relax access permission to
14804 (Expression.MemberLookupFailed): Handle duplicates in
14805 almostMatchedMembers list.
14806 (SimpleName.DoSimpleNameResolve): Catch CS0038 errors earlier.
14807 * expression.cs (New.DoResolve): Report CS1540 for more cases.
14808 * typemanager.cs (GetFullNameSignature): Use the MethodBase
14809 overload if the passed in MemberInfo is a MethodBase.
14811 2005-01-12 Marek Safar <marek.safar@seznam.cz>
14814 * attribute.cs (ExtractSecurityPermissionSet): Don't report error
14815 for non-CAS & merge permission sets properly.
14817 2005-01-11 Raja R Harinath <rharinath@novell.com>
14819 Improve standard-compliance of simple name and member access
14820 resolution. Fixes bugs #52697, #57200, #67520, #69519.
14821 * ecore.cs (FullNamedExpression): New abstract base class
14822 for Namespaces and TypeExpressions.
14823 (ResolveFlags.SimpleName): Remove.
14824 (SimpleName): Remove support for dotted names.
14825 (SimpleName.ResolveAsTypeStep): Simplify. Now just a wrapper to
14826 DeclSpace.FindType and DeclSpace.LookupType.
14827 (SimpleName.DoSimpleNameResolve): Remove support for dotted names.
14828 (Expression.ExprClassName): Make member function.
14829 * expression.cs (MemberAccess.ResolveAsTypeStep): Support LHS being
14830 a namespace. Remove creation of dotted "SimpleName"s.
14831 (MemberAccess.DoResolve): Likewise.
14832 * decl.cs (DeclSpace.Cache): Make private.
14833 (DeclSpace.LookupInterfaceOrClass): Return a FullNamedExpression.
14834 (DeclSpace.FindType): Update.
14835 (DeclSpace.LookupType): Move here from RootContext. Return a
14836 FullNamedExpression.
14837 * namespace.cs (Namespace): Derive from FullNamedExpression
14838 so that it can be part of expression resolution.
14839 (Namespace.Lookup): Return an FullNamedExpression.
14840 (NamespaceEntry.LookupAlias): Lookup aliases only in current
14842 * rootcontext.cs (NamespaceLookup): Remove.
14843 (LookupType): Move to DeclSpace.
14844 * attribute.cs (CheckAttributeType): Update.
14845 * doc.cs (FindDocumentedType): Remove allowAlias argument.
14846 (FindDocumentedTypeNonArray): Likewise.
14848 2005-01-11 Raja R Harinath <rharinath@novell.com>
14850 Fix cs0509.cs, cs1632.cs.
14851 * class.cs (TypeContainer.GetNormalBases): Don't assume !IsClass
14852 is the same as IsInterface.
14853 (TypeContainer.GetClassBases): Likewise.
14854 * statement.cs (LabeledStatement.ig): New field.
14855 (LabeledStatement.LabelTarget): Save ILGenerator which created the
14857 (LabeledStatement.DoEmit): Check that the label was created with
14858 the same ILGenerator.
14860 2005-01-10 Marek Safar <marek.safar@seznam.cz>
14863 * attribute.cs (GetMethodObsoleteAttribute): Need to transform
14864 accessors to its properties.
14866 * ecore.cs (PropertyExpr): Add AccessorTable to help track back
14867 from accessors to property.
14869 2005-01-10 Marek Safar <marek.safar@seznam.cz>
14872 * class.cs (MethodCore.CheckBase): Test base method obsoleteness
14873 only for overrides.
14875 2005-01-08 Miguel de Icaza <miguel@ximian.com>
14877 * attribute.cs: Check for null and empty strings.
14879 I have lost another battle to Paolo.
14881 2005-01-07 Marek Safar <marek.safar@seznam.cz>
14884 * class.cs (PropertyMethod): Set Parent field in ctors.
14885 (SetMethod.InternalParameters): Add unsafe switch hack.
14886 Override MarkForDuplicationCheck where it is appropriate.
14888 * decl.cs (MemberCore.MarkForDuplicationCheck): New method.
14889 It says whether container allows members with the same name.
14890 Base default is no.
14891 (DeclSpace.AddToContainer): Use MarkForDuplicationCheck.
14892 Removed is_method parameter.
14894 2005-01-06 Duncan Mak <duncan@ximian.com>
14896 * cs-tokenizer.cs (xtoken): Redo the work for signaling CS1040
14897 because the previous change led to incorrect reporting of CS1032
14898 ("Cannot define/undefine preprocessor symbols after first token in
14899 file"). Instead of using `tokens_seen' as the only flag that
14900 triggers CS1040, introduce `comments_seen'. This new flag is used
14901 to signify having seen comments on the current line, so it is
14902 unset after a newline.
14904 2005-01-06 Atsushi Enomoto <atsushi@ximian.com>
14906 * doc.cs : When searching for a type, find nested type too.
14907 This fixes bug #71040.
14909 2005-01-06 Atsushi Enomoto <atsushi@ximian.com>
14912 - Warn missing member comment on those classes which also does not
14913 have doc comments. Fixed bug #71041.
14914 - Don't warn missing doc comment on default constructor.
14917 2005-01-06 Duncan Mak <duncan@ximian.com>
14919 * cs-tokenizer.cs (xtoken): After handling traditional C-style
14920 comments, set `tokens_seen' to true. This allows us to detect
14921 misplaced preprocessor directives (i.e. not at the beginning of
14922 the a line, nor after whitespaces). In that case, report error
14923 CS1040. This fixes bug #56460.
14925 * cs-parser.jay (interface_member_declaration): Add checks for
14926 IsExplicitImpl, and report CS0541 error if an interface member is
14927 defined as an explicit interface declaration.
14929 2005-01-06 Marek Safar <marek.safar@seznam.cz>
14932 * class.cs (PropertyMethod): Set Parent field in ctors.
14933 (SetMethod.InternalParameters): Add unsafe switch hack.
14935 * decl.cs (MemberCore.Parent): Cannot be readonly.
14937 2005-01-06 Raja R Harinath <rharinath@novell.com>
14939 * decl.cs (DeclSpace.ResolveType): Remove.
14940 (DeclSpace.ResolveBaseTypeExpr): Rename from ResolveTypeExpr.
14941 Merge in code from ...
14942 (DeclSpace.GetTypeResolvingEmitContext): ... here. Remove.
14943 * class.cs, enum.cs: Update to changes.
14945 2005-01-06 Miguel de Icaza <miguel@ximian.com>
14947 * anonymous.cs: Ensure that we init the scope of our parent if it
14948 has not been initialized yet.
14950 2004-12-30 Duncan Mak <duncan@ximian.com>
14952 * typemanager.cs (TypeManager.CheckStructCycles): Don't crash here
14953 if field.FieldBuilder is null. Fixes #70758.
14955 * convert.cs: Fixed some typos and updated some of the comments.
14956 (ImplicitStandardConversionExists):
14957 (TryImplicitIntConversion): If `target_type' is an interface and
14958 the type of `ic' implements this interface, return true or a new
14959 BoxedCast instead of null. This fixes #70468.
14961 2004-12-29 Duncan Mak <duncan@ximian.com>
14963 * expression.cs (Argument.Emit): Check that Expr is
14964 IMemoryLocation before casting to it, and report CS1510 otherwise.
14968 2004-12-21 Ben Maurer <bmaurer@ximian.com>
14970 * statement.cs (Block.ThisVariable): remove the recursion here, to
14971 make the --profile more sane.
14973 2004-12-17 Carlos Cortez <calberto.cortez@gmail.com>
14975 * driver.cs: Patch to handle a xsp bug that prevents to reference an .exe
14976 assembly, by JB Evain.
14978 2004-12-17 Raja R Harinath <rharinath@novell.com>
14980 * class.cs, decl.cs, ecore.cs, iterators.cs, pending.cs,
14981 rootcontext.cs, typemanager.cs: Make nomenclature consistent.
14982 "parent" refers to enclosing type/class. "base" refers to superclass.
14984 2004-12-17 Raja R Harinath <rharinath@novell.com>
14986 * codegen.cs (CommonAssemblyModulClass.GetClsCompliantAttribute):
14987 Ensure that we only have GlobalAttributes.
14988 * attribute.cs (Attribute.Emit): Make non-virtual.
14989 (GlobalAttribute.Emit): Remove.
14990 (Attribute.Resolve): Make virtual.
14991 (GlobalAttribute.Resolve): New. Set Rootcontext.Tree.Types.NamespaceEntry.
14992 (Attribute.GetConditionalAttributeValue): Take an EmitContext as
14993 the argument. Don't create one.
14994 (Attribute.GetObsoleteAttribute): Likewise.
14995 (Attribute.GetClsCompliantAttributeValue): Likewise.
14996 * class.cs, decl.cs: Update to changes.
14998 2004-12-17 Marek Safar <marek.safar@seznam.cz>
15000 * delegate.cs (NewDelegate.DoResolve): Add error 149 report.
15002 * ecore.cs (Expression.MemberLookupFailed): Fixed error 143.
15004 * statement.cs (Foreach.Resolve): Add error 186 report.
15006 2004-12-16 Marek Safar <marek.safar@seznam.cz>
15008 * expression.cs (Conditional.DoResolve): Add warning 429.
15010 * statement.cs (If.Resolve): Add warning 665.
15012 2004-12-16 Raja R Harinath <rharinath@novell.com>
15014 New invariant: RootContext.Tree.Types.NamespaceEntry == null
15015 except when in the parser, and in GlobalAttribute.
15016 * driver.cs (MainDriver): Reset RootContext.Tree.Types.NamespaceEntry.
15017 * attribute.cs (GlobalAttribute.CheckAttributeType): Reset
15018 RootContext.Tree.Types.NamespaceEntry once work is done.
15019 (GlobalAttribute.Emit): New. Wrapper for Attribute.Emit, but sets
15020 and resets RootContext.Tree.Types.NamespaceEntry.
15022 2004-12-15 Marek Safar <marek.safar@seznam.cz>
15024 * cs-parser.jay: Don't create a block for every variable.
15026 2004-12-14 Miguel de Icaza <miguel@ximian.com>
15028 * location.cs: Provide extra information.
15030 * statement.cs: The instance is not `ldarg_0.THIS' when accessing
15031 variables from the captured environment, it is the ldarg_0.
15033 2004-12-14 Marek Safar <marek.safar@seznam.cz>
15035 * cs-parser.jay: Changed warning level for 642 to 4 until Miguel
15038 * class.cs: Changed warning level for 169 to avoid developer
15039 displeasure from warning flooding. It will be changed back when they
15040 fix most of current BCL warnings.
15042 * RootContext.cs: Pushed default WarningLevel to 3.
15044 * statement.cs: Removed unused variable.
15046 2004-12-14 Marek Safar <marek.safar@seznam.cz>
15048 * class.cs (TypeContainer.GetClassBases): Add error 1521 report.
15049 (TypeContainer.MethodModifiersValid): Refactored to use MemberCore.
15050 Add error 502 report.
15051 (StaticClass.DefineType): Add error 441 report.
15052 (Class.AllowedModifiersProp): New virtual property as temporary
15053 extension to AllowedModifiers.
15054 (Class.DefineType): Add error 418 report. Moved ModFlags check here
15055 to share implementation with StaticClass and don't call virtual
15058 * driver.cs (MainDriver): Add error 1558 test.
15060 * parameter.cs (Parameter.ApplyAttributeBuilder): Add error 662
15061 report. Moved error 36 test here.
15063 * statement.cs (Throw.Resolve): Add error 724 report.
15065 * typemanager.cs: Add out_attribute_type core type.
15067 2004-12-13 Marek Safar <marek.safar@seznam.cz>
15069 * class.cs (TypeContainer.VerifyClsCompliance): Add error
15071 (PropertyBase.VerifyClsCompliance): Add errror 3025 report.
15073 * codegen.cs (ModuleClass.ApplyAttributeBuilder): Add error
15076 * decl.cs (MemberCore.VerifyClsCompliance): Add warning 3021.
15078 * parameter.cs (ReturnParameter.ApplyAttributeBuilder):
15079 Add error 3023 report.
15080 (Parameter.ApplyAttributeBuilder): Add error 3022 report.
15082 * tree.cs (RootTypes.IsClsCompliaceRequired): Add fake
15085 2004-12-12 John Luke <john.luke@gmail.com>
15087 * driver.cs (AddArgs): take -- into account when
15088 adding arguments, fixes bug 65710
15090 2004-12-12 Martin Baulig <martin@ximian.com>
15092 * expression.cs (Unary.TryReduceNegative): Added support for
15093 SByteConstant and ByteConstant.
15094 (Unary.Reduce): Check error values from TryReduceNegative().
15096 2004-12-10 Marek Safar <marek.safar@seznam.cz>
15098 * attributes.cs (Attribute.Resolve): Avoid multiple error report
15099 and report exception as error 182.
15101 2004-12-10 Raja R Harinath <rharinath@novell.com>
15103 * driver.cs (Main): Fix message when there are warnings.
15105 2004-12-09 Miguel de Icaza <miguel@ximian.com>
15107 * delegate.cs: Fixed my fix from yesterday, sorry about that.
15109 2004-12-09 Marek Safar <marek.safar@seznam.cz>
15111 * anonymous.cs, class.cs, convert.cs, doc.cs, support.cs:
15112 Reduced number of warnings.
15114 * class.cs (TypeContainer.VerifyClsCompliance): One if is enough.
15116 2004-12-08 Miguel de Icaza <miguel@ximian.com>
15118 * driver.cs: Removed message.
15120 * delegate.cs: Fix bug introduced in 1.1.x: 70219.
15122 2004-12-08 <vargaz@freemail.hu>
15124 * cs-tokenizer.cs: Add workaround for NET 2.0 beta 1 csc bug.
15126 2004-12-08 Martin Baulig <martin@ximian.com>
15128 * class.cs (TypeContainer.VerifyClsCompliance): Report a CS3003
15129 instead of a CS3002 for properties and indexer.
15131 2004-12-08 Martin Baulig <martin@ximian.com>
15133 * decl.cs (MemberName.ToString): Make this work again.
15135 2004-12-08 Marek Safar <marek.safar@seznam.cz>
15137 * attribute.cs (Resolve): Add error 591 detection.
15139 * class.cs (FieldMember.Define): Add error 1547 detection.
15140 (Indexer.Define): Add error 620 detection.
15141 (Operator.Define): Add error 590 detection.
15143 * ecore.cs: Missing argument for error 79.
15145 * expression.cs (ComposedCast.DoResolveAsTypeStep): Add error 611
15148 2004-12-07 Marek Safar <marek.safar@seznam.cz>
15151 * assign.cs.cs (Assign.DoResolve): Reports error 1648 for value types
15154 2004-12-07 Atsushi Enomoto <atsushi@ximian.com>
15156 * cs-parser.jay : handle doc comments on implicit/explicit operators.
15157 Some operator comments were suppressed.
15158 * doc.cs : Implicit/explicit operator name in doc comments are like
15159 "op_Explicit(type)~returnType", so added suffix handling.
15161 2004-12-07 Martin Baulig <martin@ximian.com>
15164 (MemberCore.GetObsoleteAttribute): Don't create a new EmitContext.
15165 (MemberCore.GetClsCompliantAttributeValue): Likewise.
15166 (DeclSpace.ec): New protected field; store the EmitContext here.
15167 (DeclSpace.EmitContext): New public property; moved here from
15169 (DeclSpace.GetClsCompliantAttributeValue): Don't create a new
15172 * enum.cs (Enum.Define): Store the EmitContext in the `ec' field.
15173 (Enum.Emit): Don't create a new EmitContext.
15175 * delegate.cs (Delegate.DefineType): Always create the
15178 * iterators.cs (Iterators.DefineIterator): Create a new
15179 EmitContext and store it in `ec'.
15181 2004-08-24 Martin Baulig <martin@ximian.com>
15184 (TypeManager.IsSubclassOf): Renamed to IsFamilyAccessible; use
15185 this for accessibility checks.
15186 (TypeManager.IsSubclassOrNestedChildOf): Renamed to
15187 IsNestedFamilyAccessible.
15188 (TypeManager.IsSubclassOf): New method, do what the name actually
15191 2004-12-06 Raja R Harinath <rharinath@novell.com>
15193 Fix crash on cs0657-17.cs.
15194 * codegen.cs (CommonAssemblyModulClass.GetClsCompliantAttribute):
15195 Use RootContext.Tree.Types, not 'new RootTypes ()'.
15196 * attribute.cs (GlobalAttribute.CheckAttributeType): Narrow down
15197 the case where the NamespaceEntry gets overwritten.
15199 2004-12-06 Marek Safar <marek.safar@seznam.cz>
15201 Fixed #69195, #56821
15202 * ecore.cs (ResolveBoolean): Tiny refactoring.
15204 * expression.cs (Binary.DoResolve): Add warning 429 and skipping
15205 of right expression resolving when left is false constant and
15206 operator is LogicalAnd OR true constant and operator is LogicalOr.
15208 * statement.cs (ResolveUnreachable): Always reports warning.
15210 2004-12-05 Miguel de Icaza <miguel@ximian.com>
15212 * class.cs: Distinguish between 1721 and 1722 (just a little help
15213 for the programmer).
15215 2004-12-03 Miguel de Icaza <miguel@ximian.com>
15217 * delegate.cs: Only allow this on new versions of the language.
15219 2004-12-02 Duncan Mak <duncan@ximian.com>
15221 * ecore.cs (PropertyExpr.IsAccessorAccessible): Moved to
15223 (Expression.IsAccessorAccessible): Moved from the PropertyExpr to
15224 here as a static method. Take an additional bool out parameter
15225 `must_do_cs1540_check' for signaling to InstanceResolve.
15226 (PropertyExpr.InstanceResolve): Removed the `must_do_cs1540_check'
15227 member field from PropertyExpr class and made it an argument of
15228 the method instead.
15229 (EventExpr.InstanceResolve): Copied from PropertyExpr, removed the
15230 check for MarshalByRefObject, and report CS0122 instead of CS1540.
15231 (EventExpr.DoResolve): Call IsAccessorAccessible on `add_accessor'
15232 and `remove_accessor' as well as InstanceResolve: report CS0122
15237 2004-12-03 Raja R Harinath <rharinath@novell.com>
15239 Fix test-327.cs, test-328.cs, and put in early infrastructure
15240 for eventually fixing #52697.
15241 * namespace.cs (NamespaceEntry.LookupForUsing): New method.
15242 (NamespaceEntry.LookupNamespaceOrType): New method, refactored
15243 from other methods.
15244 (NamespaceEntry.Lookup): Remove 'ignore_using' flag.
15245 (AliasEntry.Resolve, UsingEntry.Resolve): Use 'LookupForUsing'.
15246 (VerifyUsing, error246): Update.
15247 * rootcontext.cs (RootContext.NamespaceLookup): Just use
15248 'NamespaceEntry.LookupNamespaceOrType'.
15250 2004-12-03 Martin Baulig <martin@ximian.com>
15252 * delegate.cs (NewDelegate.DoResolve): If we have an anonymous
15253 method as our child, call AnonymousMethod.Compatible() on it.
15255 2004-12-03 Raja R Harinath <rharinath@novell.com>
15257 Disable XML documentation support in 'basic' profile.
15258 * decl.cs, class.cs [BOOTSTRAP_WITH_OLDLIB]: Don't import System.Xml.
15259 Redirect XmlElement to System.Object.
15260 * driver.cs, enum.cs, rootcontext.cs: Don't reference System.Xml.
15261 * doc.cs [BOOTSTRAP_WITH_OLDLIB]: Disable compile.
15262 * mcs.exe.sources: Add doc-bootstrap.cs.
15263 * doc-bootstrap.cs: New file. Contains empty stub implementation
15266 2004-12-03 Atsushi Enomoto <atsushi@ximian.com>
15268 * cs-tokenizer.cs : Only '////' is rejected. Other non-whitespace
15269 comments are allowed.
15271 2004-12-03 Carlos Alberto Cortez <calberto.cortez@gmail.com>
15273 * delegate.cs: Add checks for subtypes in paramaters and return values
15274 in VerifyMethod () to add support for Covariance/Contravariance
15277 2004-12-02 Miguel de Icaza <miguel@ximian.com>
15279 * report.cs: Remove extra closing parenthesis.
15281 * convert.cs (Error_CannotImplicitConversion): If the name of the
15282 types are the same, provide some extra information.
15284 * class.cs (FieldBase): Use an unused bit field from the field to
15285 encode the `has_offset' property from the FieldMember. This saves
15286 a couple of Ks on bootstrap compilation.
15288 * delegate.cs (NewDelegate.DoResolve): If we have an anonymous
15289 method as our child, return the AnonymousMethod resolved
15292 * expression.cs (New.DoResolve): Allow return values from
15293 NewDelegate to also include AnonymousMethods.
15297 2004-12-02 Marek Safar <marek.safar@seznam.cz>
15300 * attribute.cs (Resolve): Improved implementation of params
15301 attribute arguments.
15303 * support.cs (ParameterData): Add HasParams to be faster.
15305 2004-12-02 Atsushi Enomoto <atsushi@ximian.com>
15307 all things are for /doc support:
15309 * doc.cs: new file that supports XML documentation generation.
15310 * mcs.exe.sources: added doc.cs.
15312 Handle /doc command line option.
15313 Report error 2006 instead of 5 for missing file name for /doc.
15314 Generate XML documentation when required, after type resolution.
15316 Added support for picking up documentation (/// and /** ... */),
15317 including a new XmlCommentState enumeration.
15319 Added lines to fill Documentation element for field, constant,
15320 property, indexer, method, constructor, destructor, operator, event
15321 and class, struct, interface, delegate, enum.
15322 Added lines to warn incorrect comment.
15324 Added Documentation field (passed only when /doc was specified).
15326 Added DocComment, DocCommentHeader, GenerateDocComment() and
15327 OnGenerateDocComment() and some supporting private members for
15328 /doc feature to MemberCore.
15330 Added GenerateDocComment() on TypeContainer, MethodCore and Operator.
15332 Added overriden DocCommentHeader.
15334 Added overriden DocCommentHeader and GenerateDocComment().
15336 2004-12-01 Miguel de Icaza <miguel@ximian.com>
15338 * cfold.cs (ConstantFold.DoConstantNumericPromotions): After
15339 unwrapping the enumeration values, chain to
15340 DoConstantNumericPromotions again, so we can promote things to the
15341 fundamental types (takes care of enums that are bytes, sbytes).
15345 2004-12-01 Raja R Harinath <rharinath@novell.com>
15347 * attribute.cs (Attribute.CheckAttributeType): Remove complain flag.
15348 Fix long-standing bug in type-lookup. Use FindType instead of
15349 LookupType when ec.ResolvingTypeTree.
15350 (Attribute.ResolveType, Attribute.Resolve)
15351 (Attribute.DefinePInvokeMethod,GlobalAttribute.CheckAttributeType):
15353 (Attributes.Search): Remove internal version. Update.
15354 (Attributes.SearchMulti): Update.
15355 (Attributes.GetClsCompliantAttribute): Remove.
15356 (Attributes.GetIndexerNameAttribute): Remove.
15357 * decl.cs (MemberCore.GetClsCompliantAttributeValue): Update to changes.
15358 (DeclSpace.GetClsCompliantAttributeValue): Likewise.
15359 * class.cs (Indexer.Define): Likewise.
15361 2004-12-01 Marek Safar <marek.safar@seznam.cz>
15364 * ecore.cs: CheckMarshallByRefAccess new virtual method for testing
15365 MarshallByReference members access.
15367 * expression.cs: Use CheckMarshallByRefAccess;
15368 Better error CS0197 message.
15370 * report.cs: Print whole related error message.
15372 2004-11-30 Raja R Harinath <rharinath@novell.com>
15374 * Makefile (mcs.exe) [PROFILE=default]: Keep a copy of mcs.exe in
15375 the current directory to help debugging.
15377 2004-11-29 Marek Safar <marek.safar@seznam.cz>
15379 * class (GetClassBases): Better error 60 report.
15380 (EventProperty): Disabled warning 67 detection.
15382 2004-11-29 Marek Safar <marek.safar@seznam.cz>
15385 * cfold.cs (Assign.DoResolve): Add subtraction for DecimalConstant.
15387 * constant.cs (DecimalConstant.Emit): Don't use int ctor for
15390 2004-11-29 Marek Safar <marek.safar@seznam.cz>
15393 * assign.cs (Assign.DoResolve): Add error 1648, 1650 report.
15395 * decl.cs (MemberCore.MemberName): Error 1648 in compiler.
15397 2004-11-26 Miguel de Icaza <miguel@ximian.com>
15399 * attribute.cs (Attribute.Resolve): Refine error reporting and
15400 report a cs0117 if the identifier does not exist, to distinguish
15401 from 0617 which is a miss-use of the actual identifier.
15403 * ecore.cs (EventExpr.Emit): Refine error report and distinguish
15404 between cs0070 and cs0079.
15406 * class.cs (MemberBase.DoDefine): When reporting a wrong
15407 accessibility level, we use MethodCore to compare instead of
15408 Method (this was a regression in some refactoring effort).
15410 So now we correctly report cs0056 again.
15412 * convert.cs (ImplicitReferenceConversion): Corrected typo, I was
15413 testing the target_type (which was known to be object_type) and
15414 not the source type (which is anonymous_method).
15416 Fixed reporting of error cs1660.
15418 * expression.cs (UserCast.Source): Expose the underlying cast.
15420 * statement.cs (Switch.SwitchGoverningType): Sort the list of
15421 allowed types to find a match to int32 first (most common).
15423 In addition, it ignores any ImplicitUserConversions that did an
15424 internal implicit conversion (as the switch statement allows only
15425 one integral conversion to exist).
15427 * class.cs (PartialContainer.Create): rename `name' to
15428 `member_name' for clarity. Then replace the string calls with a
15429 call to MemberName.GetPartialName, as now using
15430 MemberName.ToString is an error (this is due to the side effects
15431 it had, that were fixed in the past).
15433 This will restore the error reporting on a number of partial class
15434 errors that were missusing this (and getting an exception as a
15435 results, which is now just a plain textual warning, because
15436 yyparse debug output would crash otherwise).
15438 2004-11-26 Raja R Harinath <rharinath@novell.com>
15440 * Makefile (PROGRAM_INSTALL_DIR): Remove.
15442 2004-11-25 Ben Maurer <bmaurer@ximian.com>
15444 * rootcontext.cs (LookupType): Make sure to cache lookups that
15445 don't give us a negative result. This saves about 5% of corlib
15448 2004-11-25 Miguel de Icaza <miguel@ximian.com>
15450 * report.cs (AbstractMessage.Print): messages are sent to stderr
15452 * class.cs (TypeContainer.GetClassBases): It is an error to have a
15453 non-interface in the list of interfaces (at this point, either
15454 parent was properly set, or a base class is being listed in the
15455 interfaces section).
15457 This flags error 1722, and resolves the crash from bug 69259.
15459 2004-11-25 Ben Maurer <bmaurer@ximian.com>
15461 * statement.cs (Using.EmitExpressionFinally): make this work right
15462 for valuetypes. Fixes 69926.
15464 2004-11-25 Miguel de Icaza <miguel@ximian.com>
15466 * const.cs (Const.ChangeType): Cope with the "0 literal can be
15467 converted to an enum" here, before we try to change the underlying
15468 type. This code exists, but it is a different code path than the
15469 one used while encoding constants.
15471 * convert.cs (ImplicitReferenceConversionExists): A surprisingly
15472 old bug: when converting from the null literal to a pointer,
15473 return an EmptyCast, not the NullLiteral.
15475 This fixes #69921, the recent null_type changes probably made this
15476 bug more prominent.
15478 (ImplicitReferenceConversionExists): In addition, resynchronized
15479 the code here, so it matches the same code in
15480 ImplicitReferenceConversionExists for the `from any class-type S
15481 to any interface-type T'.
15484 2004-11-25 Marek Safar <marek.safar@seznam.cz>
15486 * cfold.cs (BinaryFold): Add addition for DecimalConstant.
15488 2004-11-24 Miguel de Icaza <miguel@ximian.com>
15490 * cs-parser.jay: Use verbosity accordingly.
15492 2004-11-24 Marek Safar <marek.safar@seznam.cz>
15494 * expression.cs (Unary.ResolveOperator): Do not report warning;
15495 AddressOf reads from variable.
15497 (LocalVariableReferences.DoResolveBase): Improved my previous fix.
15499 2004-11-24 Marek Safar <marek.safar@seznam.cz>
15503 * attribute.cs (Attributable): Removed CheckTargets.
15504 (Attributes.Emit): Explicit attribute targets are tested here.
15506 * class.cs (EventField.ValidAttributeTargets): Explicit target "field" is
15507 not enabled for interfaces.
15509 * codegen.cs (CommonAssemblyModulClass.AddAttributes): Removed CheckTargets.
15510 (GetAssemblyName): Ouch next bug there.
15512 2004-11-23 Carlos Alberto Cortez <calberto.cortez@gmail.com>
15514 * expression.cs: Error 275 added.
15516 2004-11-23 Marek Safar <marek.safar@seznam.cz>
15518 Fix bug #69177 (Implemented decimal constant support)
15520 * cfold.cs (DoConstantNumericPromotions: Add DecimalConstant.
15521 (BinaryFold): Add DecimalConstant.
15523 * const.cs (Define): Decimal constant
15525 (ChangeType): Add decimal type handling.
15526 (LookupConstantValue): Don't set value for decimal type but
15527 emit DecimalConstantAttribute. Needed for constant optimization.
15529 * constant.cs (ToDecimal): New method.
15530 (ConvertToDecimal): New method.
15531 (IntConstant): Implemented ConvertToDecimal.
15532 (DecimalConstant.Emit): Emit optimized version for decimals in
15535 * expression.cs (ResolveOperator): Changed order of constant
15536 reduction to work correctly with native types which have
15537 overloaded operators.
15538 (ResolveMemberAccess): Extract constant value from attribute
15541 * rootcontext.cs (ResolveCore): Add DecimalConstantAttribute.
15543 * typemanager.cs (TypeManager): Add decimal_constant_attribute_type,
15544 void_decimal_ctor_int_arg, decimal_constant_attribute_ctor.
15545 (ChangeType): Decimal is special.
15546 (TypeToCoreType): Add decimal type.
15548 2004-11-22 Marek Safar <marek.safar@seznam.cz>
15550 * convert.cs (ImplicitConversionRequired): Add error cs0642 for
15553 2004-11-22 Marek Safar <marek.safar@seznam.cz>
15555 * class.cs (EventField.ApplyAttributeBuilder): Fix error
15558 2004-11-19 Marek Safar <marek.safar@seznam.cz>
15560 * class.cs (MemberBase.DoDefine): Fix error cs0508 report.
15562 * pending.cs (PendingImplementation): Grab only interfaces.
15564 2004-11-19 Marek Safar <marek.safar@seznam.cz>
15566 * statement.cs (ForeachHelperMethods): Add location member and
15567 error 202 detection.
15569 2004-11-19 Raja R Harinath <rharinath@novell.com>
15571 * Makefile (EXTRA_DISTFILES): Remove mcs.exe.config. It's
15572 automatically handled by executable.make.
15573 (PROGRAM): Make profile-specific.
15575 2004-11-18 Marek Safar <marek.safar@seznam.cz>
15577 * expression.cs (DoResolveBase): Fixed wrong warning for out
15580 2004-11-18 Martin Baulig <martin@ximian.com>
15582 Merged latest changes into gmcs. Please keep this comment in
15583 here, it makes it easier for me to see what changed in MCS since
15584 the last time I merged.
15586 2004-11-17 Raja R Harinath <rharinath@novell.com>
15588 * typemanager.cs (TypeHandle.GetTypeHandle): Make private.
15589 (TypeHandle.GetMemberCache): New.
15590 (TypeHandle.TypeHandle): Update.
15591 (TypeManager.LookupMemberCache): Rewritten from LookupMemberContainer.
15592 (TypeManager.LookupParentInterfacesCache):
15593 Rename from LookupInterfaceCache. Optimize slightly.
15594 (TypeManager.MemberLookup_FindMembers): Update.
15595 * decl.cs (MemberCache.MemberCache): Set Container to null in the
15596 multi-type variant.
15597 (AddCacheContents): Rename from AddHashtable.
15598 * class.cs (TypeContainer.parent_container): Remove.
15599 (TypeContainer.VerifyClsCompliance): Don't use parent_container.
15600 (TypeContainer.DoDefineMembers): Don't initialize it.
15601 Update to name changes.
15603 2004-11-17 Miguel de Icaza <miguel@ximian.com>
15605 * class.cs (MethodCore.CheckAccessModifiers): New helper routine
15606 that factors the code to check access modifiers on override.
15608 (PropertyBase): Use the code here.
15610 Patch from Lluis S'anchez, fixes bug #69361.
15612 2004-11-15 Miguel de Icaza <miguel@ximian.com>
15614 * anonymous.cs (AnonymousMethod.Error_AddressOfCapturedVar): New
15615 routine that is used to report the use of a captured variable
15616 whose address has been taken.
15618 There are two checks: one when variables are being captured and
15619 the other check is when the address of a variable is taken.
15621 (because an anonymous methods might be resolved before *or* after
15622 the address has been taken) and
15624 * expression.cs (Conditional.DoResolve): Remove the special
15625 casing that Martin added to trueExpr and falseExpr being both
15626 NullLiteral. We get the right behavior now just by introducing
15627 the null_type into the compiler.
15629 * convert.cs (ExplicitConversion): Change the code to use
15630 null_type instead of testing `expr is NullLiteral'.
15631 (ImplicitConversionStandard): use null_type too.
15632 (ImplicitReferenceConversionExists): use null_type too.
15633 (ImplicitReferenceConversion): use null_type too.
15635 * literal.cs: The type of `NullLiteral' is now null_type instead
15637 (Resolve): Set the type here.
15639 * typemanager.cs: Introduce null_type.
15641 2004-11-17 Martin Baulig <martin@ximian.com>
15643 * decl.cs (MemberCache.AddHashtable): Add entries in the opposite
15644 direction, like FindMembers() does. Fixes #69546, testcase is in
15647 2004-11-16 Martin Baulig <martin@ximian.com>
15649 This is based on a patch from Marek Safar, see bug #69082.
15650 Fixes bugs #63705 and #67130.
15652 * typemanager.cs (TypeManager.LookupInterfaceCache): New public
15653 method; create a MemberCache for an interface type and cache the
15656 * decl.cs (IMemberContainer.ParentContainer): Removed.
15657 (IMemberContainer.ParentCache): New property.
15658 (MemberCache.SetupCacheForInterface): Removed.
15659 (MemberCache..ctor): Added .ctor which takes a `Type[]'; use this
15660 to create a cache for an interface's "parent".
15662 * class.cs (TypeContainer.DoDefineMembers): Setup cache for
15665 2004-11-16 Martin Baulig <martin@ximian.com>
15667 Merged back from gmcs; these changes already went into gmcs a
15668 couple of weeks ago.
15671 (TypeManager.AddUserType): Removed the `ifaces' argument.
15672 (TypeManager.RegisterBuilder): Take a `Type []' instead of a
15674 (TypeManager.AddUserInterface): Removed.
15675 (TypeManager.ExpandInterfaces): Return a `Type []' instead of a
15677 (TypeManager.GetInterfaces): Likewise.
15678 (TypeManager.GetExplicitInterfaces): Likewise.
15680 * ecore.cs (TypeExpr.GetInterfaces): Removed.
15682 * class.cs (TypeContainer.base_class_type): Replaced with `ptype'.
15683 (TypeContainer.base_inteface_types): Replaced with `ifaces'.
15685 2004-11-14 Ben Maurer <bmaurer@ximian.com>
15687 * statement.cs: Avoid adding bools to a hashtable.
15689 2004-11-07 Miguel de Icaza <miguel@ximian.com>
15691 * expression.cs (Invocation.OverloadResolve): Flag error if we are
15692 calling an unsafe method from a safe location.
15694 2004-11-06 Marek Safar <marek.safar@seznam.cz>
15697 * codegen.cs (ApplyAttributeBuilder): Do not return; it is only warning.
15699 2004-11-06 Miguel de Icaza <miguel@ximian.com>
15701 * namespace.cs (VerifyUsing): use GetPartialName instead of
15704 2004-11-05 Miguel de Icaza <miguel@ximian.com>
15706 * statement.cs (Return.Resolve): Fix regression in typo: if
15707 `in_exc', we have to request a NeedReturnLabel, this was a typo
15708 introduced in the anonymous method check-in. Fixes #69131.
15710 * Indexers were using the ShortName when defining themselves,
15711 causing a regression in the compiler bootstrap when applying the
15712 patch from 2004-11-02 (first part), now they use their full name
15713 and the bug is gone.
15715 2004-11-04 Zoltan Varga <vargaz@freemail.hu>
15717 * driver.cs: Strip the path from the names of embedded resources. Fixes
15720 2004-11-04 Raja R Harinath <rharinath@novell.com>
15722 Fix error message regression: cs0104-2.cs.
15723 * namespace.cs (NamespaceEntry.Lookup): Remove 'silent' flag.
15724 (AliasEntry.Resolve): Update.
15725 * rootcontext.cs (RootContext.NamespaceLookup): Update. Remove
15727 (RootContext.LookupType): Update.
15729 2004-11-03 Carlos Alberto Cortez <carlos@unixmexico.org>
15731 * cs-parser.jay: Add support for handling accessor modifiers
15732 * class: Add support port accessor modifiers and error checking,
15733 define PropertyMethod.Define as virtual (not abstract anymore)
15734 * ecore.cs: Add checking for proeprties access with access modifiers
15735 * iterators.cs: Modify Accessor constructor call based in the modified
15737 2004-11-02 Ben Maurer <bmaurer@ximian.com>
15739 * expression.cs (StringConcat): Handle being called twice,
15740 as when we have a concat in a field init with more than two
15743 2004-11-02 Miguel de Icaza <miguel@ximian.com>
15745 * class.cs (Event.Define, Indexer.Define, Property.Define): Do not
15746 special case explicit implementations, we should always produce
15747 the .property or .event declaration.
15749 * decl.cs (MemberName): Renamed GetFullName to GetPartialName
15750 since it will not return correct data if people use this
15751 unresolved in the presence of using statements (see test-313).
15753 * class.cs (MethodData.Define): If we are an explicit interface
15754 implementation, set the method name to the full name of the
15755 interface plus the name of the method.
15757 Notice that using the method.MethodName.GetFullName() does not
15758 work, as it will only contain the name as declared on the source
15759 file (it can be a shorthand in the presence of using statements)
15760 and not the fully qualifed type name, for example:
15764 class D : ICloneable {
15765 object ICloneable.Clone () {
15769 Would produce a method called `ICloneable.Clone' instead of
15770 `System.ICloneable.Clone'.
15772 * namespace.cs (Alias.Resolve): Use GetPartialName.
15774 2004-11-01 Marek Safar <marek.safar@seznam.cz>
15776 * cs-parser.jay: Add error 1055 report.
15778 2004-11-01 Miguel de Icaza <miguel@ximian.com>
15780 * assign.cs (Assign.DoResolve): Only do the transform of
15781 assignment into a New if the types are compatible, if not, fall
15782 through and let the implicit code deal with the errors and with
15783 the necessary conversions.
15785 2004-11-01 Marek Safar <marek.safar@seznam.cz>
15787 * cs-parser.jay: Add error 1031 report.
15789 * cs-tokenizer.cs: Add location for error 1038.
15791 2004-10-31 Marek Safar <marek.safar@seznam.cz>
15793 * cs-parser.jay: Add error 1016 report.
15795 2004-10-31 Marek Safar <marek.safar@seznam.cz>
15797 * cs-parser.jay: Add errors 1575,1611 report.
15799 2004-10-31 Marek Safar <marek.safar@seznam.cz>
15801 * cs-parser.jay: Add error 1001 report.
15803 2004-10-31 Marek Safar <marek.safar@seznam.cz>
15806 * attribute.cs (GetMarshal): Add method argument for
15807 caller identification.
15809 * class.cs, codegen.cs, enum.cs, parameter.cs: Added
15810 agument for GetMarshal and RuntimeMissingSupport.
15812 2004-10-31 Marek Safar <marek.safar@seznam.cz>
15814 * attribute.cs (ExtractSecurityPermissionSet): Removed
15815 TypeManager.code_access_permission_type.
15817 * typemanager.cs: Removed TypeManager.code_access_permission_type.
15819 2004-10-27 Miguel de Icaza <miguel@ximian.com>
15821 * expression.cs (LocalVariableReference.DoResolveLValue): Check
15822 for obsolete use of a variable here. Fixes regression on errors
15823 cs0619-25 and cs0619-26.
15825 2004-10-27 Marek Safar <marek.safar@seznam.cz>
15827 Fix #62358, implemented security attribute encoding.
15829 * attribute.cs (Attribute.CheckSecurityActionValididy): New method.
15830 Tests permitted SecurityAction for assembly or other types.
15831 (Assembly.ExtractSecurityPermissionSet): New method. Transforms
15832 data from SecurityPermissionAttribute to PermisionSet class.
15834 * class.cs (ApplyAttributeBuilder): Added special handling
15835 for System.Security.Permissions.SecurityAttribute based types.
15837 * codegen.cs (AssemblyClass.ApplyAttributeBuilder): Added
15838 special handling for System.Security.Permissions.SecurityAttribute
15841 * enum.cs (ApplyAttributeBuilder): Added special handling
15842 for System.Security.Permissions.SecurityAttribute based types.
15844 * parameter.cs (ApplyAttributeBuilder): Added special handling
15845 for System.Security.Permissions.SecurityAttribute based types.
15847 * rootcontext.cs: Next 2 core types.
15849 * typemanager.cs (TypeManager.security_permission_attr_type):
15850 Built in type for the SecurityPermission Attribute.
15851 (code_access_permission_type): Build in type.
15853 2004-10-17 Miguel de Icaza <miguel@ximian.com>
15855 * expression.cs (LocalVariableReference.DoResolveBase, Emit):
15856 Remove the tests for `ec.RemapToProxy' from here, and encapsulate
15857 all of this information into
15858 EmitContext.EmitCapturedVariableInstance.
15860 * codegen.cs (EmitCapturedVariableInstance): move here the
15861 funcionality of emitting an ldarg.0 in the presence of a
15862 remapping. This centralizes the instance emit code.
15864 (EmitContext.EmitThis): If the ScopeInfo contains a THIS field,
15865 then emit a load of this: it means that we have reached the
15866 topmost ScopeInfo: the one that contains the pointer to the
15867 instance of the class hosting the anonymous method.
15869 * anonymous.cs (AddField, HaveCapturedFields): Propagate field
15870 captures to the topmost CaptureContext.
15872 2004-10-12 Miguel de Icaza <miguel@ximian.com>
15874 * expression.cs (LocalVariableReference): Move the knowledge about
15875 the iterators into codegen's EmitCapturedVariableInstance.
15877 2004-10-11 Miguel de Icaza <miguel@ximian.com>
15879 * codegen.cs (EmitContext.ResolveTopBlock): Emit a 1643 when not
15880 all code paths return a value from an anonymous method (it is the
15881 same as the 161 error, but for anonymous methods).
15883 2004-10-08 Miguel de Icaza <miguel@ximian.com>
15885 The introduction of anonymous methods in the compiler changed
15886 various ways of doing things in the compiler. The most
15887 significant one is the hard split between the resolution phase
15888 and the emission phases of the compiler.
15890 For instance, routines that referenced local variables no
15891 longer can safely create temporary variables during the
15892 resolution phase: they must do so from the emission phase,
15893 since the variable might have been "captured", hence access to
15894 it can not be done with the local-variable operations from the runtime.
15898 (Block.Flags): New flag `IsTopLevel' to indicate that this block
15899 is a toplevel block.
15901 (ToplevelBlock): A new kind of Block, these are the blocks that
15902 are created by the parser for all toplevel method bodies. These
15903 include methods, accessors and anonymous methods.
15905 These contain some extra information not found in regular blocks:
15906 A pointer to an optional CaptureContext (for tracking captured
15907 local variables and parameters). A pointer to the parent
15910 (Return.Resolve): Catch missmatches when returning a value from an
15911 anonymous method (error 1662).
15912 Invoke NeedReturnLabel from the Resolve phase instead of the emit
15915 (Break.Resolve): ditto.
15917 (SwitchLabel): instead of defining the labels during the
15918 resolution phase, we now turned the public ILLabel and ILLabelCode
15919 labels into methods called GetILLabelCode() and GetILLabel() that
15920 only define the label during the Emit phase.
15922 (GotoCase): Track the SwitchLabel instead of the computed label
15923 (its contained therein). Emit the code by using
15924 SwitchLabel.GetILLabelCode ().
15926 (LocalInfo.Flags.Captured): A new flag has been introduce to track
15927 whether the Local has been captured or not.
15929 (LocalInfo.IsCaptured): New property, used to tell whether the
15930 local has been captured.
15932 * anonymous.cs: Vastly updated to contain the anonymous method
15935 The main classes here are: CaptureContext which tracks any
15936 captured information for a toplevel block and ScopeInfo used to
15937 track the activation frames for various local variables.
15939 Each toplevel block has an optional capture context associated
15940 with it. When a method contains an anonymous method both the
15941 toplevel method and the anonymous method will create a capture
15942 context. When variables or parameters are captured, they are
15943 recorded on the CaptureContext that owns them, for example:
15947 MyDelegate d = delegate {
15952 Here `a' will be recorded as captured on the toplevel
15953 CapturedContext, the inner captured context will not have anything
15954 (it will only have data if local variables or parameters from it
15955 are captured in a nested anonymous method.
15957 The ScopeInfo is used to track the activation frames for local
15958 variables, for example:
15960 for (int i = 0; i < 10; i++)
15961 for (int j = 0; j < 10; j++){
15962 MyDelegate d = delegate {
15967 At runtime this captures a single captured variable `i', but it
15968 captures 10 different versions of the variable `j'. The variable
15969 `i' will be recorded on the toplevel ScopeInfo, while `j' will be
15970 recorded on a child.
15972 The toplevel ScopeInfo will also track information like the `this'
15973 pointer if instance variables were referenced (this is necessary
15974 as the anonymous method lives inside a nested class in the host
15975 type of the method).
15977 (AnonymousMethod): Expanded to track the Toplevel, implement
15978 `AnonymousMethod.Compatible' to tell whether an anonymous method
15979 can be converted to a target delegate type.
15981 The routine now also produces the anonymous method content
15983 (AnonymousDelegate): A helper class that derives from
15984 DelegateCreation, this is used to generate the code necessary to
15985 produce the delegate for the anonymous method that was created.
15987 * assign.cs: API adjustments for new changes in
15988 Convert.ImplicitStandardConversionExists.
15990 * class.cs: Adjustments to cope with the fact that now toplevel
15991 blocks are of type `ToplevelBlock'.
15993 * cs-parser.jay: Now we produce ToplevelBlocks for toplevel blocks
15994 insteda of standard blocks.
15996 Flag errors if params arguments are passed to anonymous methods.
15998 * codegen.cs (EmitContext): Replace `InAnonymousMethod' with
15999 `CurrentAnonymousMethod' which points to the current Anonymous
16000 Method. The variable points to the AnonymousMethod class that
16001 holds the code being compiled. It is set in the new EmitContext
16002 created for the anonymous method.
16004 (EmitContext.Phase): Introduce a variable and an enumeration to
16005 assist in enforcing some rules about when and where we are allowed
16006 to invoke certain methods (EmitContext.NeedsReturnLabel is the
16007 only one that enfonces this right now).
16009 (EmitContext.HaveCaptureInfo): new helper method that returns
16010 whether we have a CapturedContext initialized.
16012 (EmitContext.CaptureVariable): New method used to register that a
16013 LocalInfo must be flagged for capturing.
16015 (EmitContext.CapturedParameter): New method used to register that a
16016 parameters must be flagged for capturing.
16018 (EmitContext.CapturedField): New method used to register that a
16019 field must be flagged for capturing.
16021 (EmitContext.HaveCapturedVariables,
16022 EmitContext.HaveCapturedFields): Return whether there are captured
16023 variables or fields.
16025 (EmitContext.EmitMethodHostInstance): This is used to emit the
16026 instance for the anonymous method. The instance might be null
16027 (static methods), this (for anonymous methods that capture nothing
16028 and happen to live side-by-side with the current method body) or a
16029 more complicated expression if the method has a CaptureContext.
16031 (EmitContext.EmitTopBlock): Routine that drives the emission of
16032 code: it will first resolve the top block, then emit any metadata
16033 and then emit the code. The split is done so that we can extract
16034 any anonymous methods and flag any captured variables/parameters.
16036 (EmitContext.ResolveTopBlock): Triggers the resolution phase,
16037 during this phase, the ILGenerator should not be used as labels
16038 and local variables declared here might not be accessible to any
16039 code that is part of an anonymous method.
16041 Exceptions to this include the temporary variables that are
16042 created by some statements internally for holding temporary
16045 (EmitContext.EmitMeta): New routine, in charge of emitting all the
16048 (EmitContext.TemporaryReturn): This method is typically called
16049 from the Emit phase, and its the only place where we allow the
16050 ReturnLabel to be defined other than the EmitMeta. The reason is
16051 that otherwise we would have to duplicate a lot of logic in the
16052 Resolve phases of various methods that today is on the Emit
16055 (EmitContext.NeedReturnLabel): This no longer creates the label,
16056 as the ILGenerator is not valid during the resolve phase.
16058 (EmitContext.EmitThis): Extended the knowledge in this class to
16059 work in anonymous methods in addition to iterators.
16061 (EmitContext.EmitCapturedVariableInstance): This emits whatever
16062 code is necessary on the stack to access the instance to a local
16063 variable (the variable will be accessed as a field).
16065 (EmitContext.EmitParameter, EmitContext.EmitAssignParameter,
16066 EmitContext.EmitAddressOfParameter): Routines to support
16067 parameters (not completed at this point).
16069 Removals: Removed RemapLocal and RemapLocalLValue. We probably
16070 will also remove the parameters.
16072 * convert.cs (Convert): Define a `ConstantEC' which points to a
16073 null. This is just to prefity some code that uses
16074 ImplicitStandardConversion code and do not have an EmitContext
16077 The idea is to flag explicitly that at that point in time, it is
16078 known that the conversion will not trigger the delegate checking
16079 code in implicit conversions (which requires a valid
16082 Everywhere: pass new EmitContext parameter since
16083 ImplicitStandardConversionExists now requires it to check for
16084 anonymous method conversions.
16086 (Convert.ImplicitStandardConversionExists): If the type of an
16087 expression is the anonymous_method_type, and the type is a
16088 delegate, we invoke the AnonymousMethod.Compatible method to check
16089 whether an implicit conversion is possible.
16091 (Convert.ImplicitConversionStandard): Only do implicit method
16092 group conversions if the language level is not ISO_1.
16094 * delegate.cs (Delegate.GetInvokeMethod): Common method to get the
16095 MethodInfo for the Invoke method. used by Delegate and
16098 * expression.cs (Binary.DoNumericPromotions): only allow anonymous
16099 method conversions if the target type is a delegate.
16101 Removed extra debugging nops.
16103 (LocalVariableReference): Turn the `local_info' into a public
16106 Add `prepared' field, the same hack used for FieldExprs to cope
16107 with composed assignments, as Local variables do not necessarily
16108 operate purely on the stack as they used to: they can be captured
16111 Add `temp' for a temporary result, like fields.
16113 Refactor DoResolve and DoResolveLValue into DoResolveBase.
16115 It now copes with Local variables that are captured and emits the
16116 proper instance variable to load it from a field in the captured
16119 (ParameterReference.DoResolveBase): During the resolve phase,
16120 capture parameters if we are in an anonymous method.
16122 (ParameterReference.Emit, ParameterReference.AddressOf): If in an
16123 anonymous method, use the EmitContext helper routines to emit the
16124 parameter reference.
16126 * iterators.cs: Set RemapToProxy to true/false during the
16129 * parameters.cs (GetParameterByName): New helper method.
16131 * typemanager.cs (anonymous_method_type) a new type that
16132 represents an anonyous method. This is always an internal type,
16133 used as a fencepost to test against the anonymous-methodness of an
16136 2004-10-20 Marek Safar <marek.safar@seznam.cz>
16138 * class.cs (MethodCore.CheckBase): Add errors 505, 533, 544,
16140 (PropertyBase.FindOutParentMethod): Add errors 545, 546 report.
16142 2004-10-18 Martin Baulig <martin@ximian.com>
16144 * statement.cs (Fixed.Resolve): Don't access the TypeExpr's
16145 `Type' directly, but call ResolveType() on it.
16146 (Catch.Resolve): Likewise.
16147 (Foreach.Resolve): Likewise.
16149 2004-10-18 Martin Baulig <martin@ximian.com>
16151 * expression.cs (Cast.DoResolve): Don't access the TypeExpr's
16152 `Type' directly, but call ResolveType() on it.
16153 (Probe.DoResolve): Likewise.
16154 (ArrayCreation.LookupType): Likewise.
16155 (TypeOf.DoResolve): Likewise.
16156 (SizeOf.DoResolve): Likewise.
16158 2004-10-18 Martin Baulig <martin@ximian.com>
16160 * expression.cs (Invocation.BetterFunction): Put back
16161 TypeManager.TypeToCoreType().
16163 2004-10-18 Raja R Harinath <rharinath@novell.com>
16165 * class.cs (FieldMember.DoDefine): Reset ec.InUnsafe after doing
16168 2004-10-18 Martin Baulig <martin@ximian.com>
16170 * parameter.cs (Parameter.Resolve): Don't access the TypeExpr's
16171 `Type' directly, but call ResolveType() on it.
16173 2004-10-18 Martin Baulig <martin@ximian.com>
16175 * class.cs (FieldMember.Define): Don't access the TypeExpr's
16176 `Type' directly, but call ResolveType() on it.
16177 (MemberBase.DoDefine): Likewise.
16179 * expression.cs (New.DoResolve): Don't access the TypeExpr's
16180 `Type' directly, but call ResolveType() on it.
16181 (ComposedCast.DoResolveAsTypeStep): Likewise.
16183 * statement.cs (LocalInfo.Resolve): Don't access the TypeExpr's
16184 `Type' directly, but call ResolveType() on it.
16186 2004-10-17 John Luke <john.luke@gmail.com>
16188 * class.cs (Operator.GetSignatureForError): use CSharpName
16190 * parameter.cs (Parameter.GetSignatureForError): Returns
16191 correct name even if was not defined.
16193 2004-10-13 Raja R Harinath <rharinath@novell.com>
16196 * class.cs (TypeContainer.EmitContext): New property.
16197 (DefineNestedTypes): Create an emitcontext for each part.
16198 (MethodCore.DoDefineParameters): Use container's emitcontext.
16199 Pass type array to InternalParameters.
16200 (MemberBase.DoDefine): Use container's emitcontext.
16201 (FieldMember.Define): Likewise.
16202 (Event.Define): Likewise.
16203 (SetMethod.GetParameterInfo): Change argument to EmitContext.
16204 Pass type array to InternalParameters.
16205 (SetIndexerMethod.GetParameterInfo): Likewise.
16206 (SetMethod.Define): Pass emitcontext to GetParameterInfo.
16207 * delegate.cs (Define): Pass emitcontext to
16208 ComputeAndDefineParameterTypes and GetParameterInfo. Pass type
16209 array to InternalParameters.
16210 * expression.cs (ParameterReference.DoResolveBase): Pass
16211 emitcontext to GetParameterInfo.
16212 (ComposedCast.DoResolveAsTypeStep): Remove check on
16213 ec.ResolvingTypeTree.
16214 * parameter.cs (Parameter.Resolve): Change argument to
16215 EmitContext. Use ResolveAsTypeTerminal.
16216 (Parameter.GetSignature): Change argument to EmitContext.
16217 (Parameters.ComputeSignature): Likewise.
16218 (Parameters.ComputeParameterTypes): Likewise.
16219 (Parameters.GetParameterInfo): Likewise.
16220 (Parameters.ComputeAndDefineParameterTypes): Likewise.
16221 Re-use ComputeParameterTypes. Set ec.ResolvingTypeTree.
16222 * support.cs (InternalParameters..ctor): Remove variant that takes
16224 * typemanager.cs (system_intptr_expr): New.
16225 (InitExpressionTypes): Initialize it.
16227 2004-10-12 Chris Toshok <toshok@ximian.com>
16229 * cs-parser.jay: fix location for try_statement and catch_clause.
16231 2004-10-11 Martin Baulig <martin@ximian.com>
16233 * report.cs: Don't make --fatal abort on warnings, we have
16234 -warnaserror for that.
16236 2004-10-07 Raja R Harinath <rharinath@novell.com>
16238 More DeclSpace.ResolveType avoidance.
16239 * decl.cs (MemberCore.InUnsafe): New property.
16240 * class.cs (MemberBase.DoDefine): Use ResolveAsTypeTerminal
16241 with newly created EmitContext.
16242 (FieldMember.Define): Likewise.
16243 * delegate.cs (Delegate.Define): Likewise.
16244 * ecore.cs (SimpleName.ResolveAsTypeStep): Lookup with alias
16245 only if normal name-lookup fails.
16246 (TypeExpr.DoResolve): Enable error-checking.
16247 * expression.cs (ArrayCreation.DoResolve): Use ResolveAsTypeTerminal.
16248 (SizeOf.DoResolve): Likewise.
16249 (ComposedCast.DoResolveAsTypeStep): Likewise.
16250 (StackAlloc.DoResolve): Likewise.
16251 * statement.cs (Block.Flags): Add new flag 'Unsafe'.
16252 (Block.Unsafe): New property.
16253 (Block.EmitMeta): Set ec.InUnsafe as appropriate.
16254 (Unsafe): Set 'unsafe' flag of contained block.
16255 (LocalInfo.Resolve): Use ResolveAsTypeTerminal.
16256 (Fixed.Resolve): Likewise.
16257 (Catch.Resolve): Likewise.
16258 (Using.ResolveLocalVariableDecls): Likewise.
16259 (Foreach.Resolve): Likewise.
16261 2004-10-05 John Luke <john.luke@gmail.com>
16263 * cs-parser.jay: add location to error CS0175
16265 2004-10-04 Miguel de Icaza <miguel@ximian.com>
16267 * ecore.cs (Expression.Constantity): Add support for turning null
16270 * const.cs (Const.Define): Allow constants to be reference types
16271 as long as the value is Null.
16273 2004-10-04 Juraj Skripsky <js@hotfeet.ch>
16275 * namespace.cs (NamespaceEntry.Using): No matter which warning
16276 level is set, check if this namespace name has already been added.
16278 2004-10-03 Ben Maurer <bmaurer@ximian.com>
16280 * expression.cs: reftype [!=]= null should always use br[true,false].
16283 2004-10-03 Marek Safar <marek.safar@seznam.cz>
16286 * attribute.cs: Enum conversion moved to
16287 GetAttributeArgumentExpression to be applied to the all
16290 2004-10-01 Raja R Harinath <rharinath@novell.com>
16292 Fix #65833, test-300.cs, cs0122-5.cs, cs0122-6.cs.
16293 * class.c (TypeContainer.DefineType): Flag error if
16294 base types aren't accessible due to access permissions.
16295 * decl.cs (DeclSpace.ResolveType): Move logic to
16296 Expression.ResolveAsTypeTerminal.
16297 (DeclSpace.ResolveTypeExpr): Thin layer over
16298 Expression.ResolveAsTypeTerminal.
16299 (DeclSpace.CheckAccessLevel, DeclSpace.FamilyAccess):
16300 Refactor code into NestedAccess. Use it.
16301 (DeclSpace.NestedAccess): New.
16302 * ecore.cs (Expression.ResolveAsTypeTerminal): Add new
16303 argument to silence errors. Check access permissions.
16304 (TypeExpr.DoResolve, TypeExpr.ResolveType): Update.
16305 * expression.cs (ProbeExpr.DoResolve): Use ResolveAsTypeTerminal.
16306 (Cast.DoResolve): Likewise.
16307 (New.DoResolve): Likewise.
16308 (InvocationOrCast.DoResolve,ResolveStatement): Likewise.
16309 (TypeOf.DoResolve): Likewise.
16311 * expression.cs (Invocation.BetterConversion): Return the Type of
16312 the better conversion. Implement section 14.4.2.3 more faithfully.
16313 (Invocation.BetterFunction): Make boolean. Make correspondence to
16314 section 14.4.2.2 explicit.
16315 (Invocation.OverloadResolve): Update.
16316 (Invocation): Remove is_base field.
16317 (Invocation.DoResolve): Don't use is_base. Use mg.IsBase.
16318 (Invocation.Emit): Likewise.
16320 2004-09-27 Raja R Harinath <rharinath@novell.com>
16322 * README: Update to changes.
16324 2004-09-24 Marek Safar <marek.safar@seznam.cz>
16326 * cs-parser.jay: Reverted 642 warning fix.
16328 2004-09-23 Marek Safar <marek.safar@seznam.cz>
16331 * decl.cs (FindMemberWithSameName): Indexer can have more than
16334 2004-09-23 Marek Safar <marek.safar@seznam.cz>
16336 * expression.cs (LocalVariableReference.DoResolveLValue):
16337 Do not report warning 219 for out values.
16338 (EmptyExpression.Null): New member to avoid extra allocations.
16340 2004-09-23 Marek Safar <marek.safar@seznam.cz>
16342 * cs-parser.jay: Fix wrong warning 642 report.
16344 * cs-tokenizer.cs (CheckNextToken): New helper;
16345 Inspect next character if is same as expected.
16347 2004-09-23 Martin Baulig <martin@ximian.com>
16349 * convert.cs (Convert.ImplicitReferenceConversion): Some code cleanup.
16350 (Convert.ImplicitReferenceConversionExists): Likewise.
16352 2004-09-23 Marek Safar <marek.safar@seznam.cz>
16354 * class.cs (Operator.Define): Add error 448 and 559 report.
16356 2004-09-22 Marek Safar <marek.safar@seznam.cz>
16358 * class.cs (MemberBase.IsTypePermitted): New protected
16359 method for checking error CS0610.
16361 2004-09-22 Marek Safar <marek.safar@seznam.cz>
16363 * class.cs (TypeContainer.HasExplicitLayout): New property
16364 Returns whether container has StructLayout attribute set Explicit.
16365 (FieldMember): New abstract class for consts and fields.
16366 (FieldMember.ApplyAttributeBuilder): Add error 636 and 637 report.
16367 (Field): Reuse FieldMember.
16369 * const.cs (Const): Reuse FieldMember.
16371 * rootcontext.cs: EmitConstants call moved to class.
16373 2004-09-22 Martin Baulig <martin@ximian.com>
16375 Thanks to Peter Sestoft for this bug report.
16377 * expression.cs (Conditional): If both the `trueExpr' and the
16378 `falseExpr' is a NullLiteral, return a NullLiteral.
16380 2004-09-22 Martin Baulig <martin@ximian.com>
16382 * statement.cs (Foreach.EmitCollectionForeach): If we're in an
16383 iterator, use `enumerator.EmitThis()' instead of `ec.EmitThis()'
16384 for the "get_Current" call.
16386 2004-09-22 Martin Baulig <martin@ximian.com>
16388 Marek and me just fixed one of our oldest bugs: #28562 :-)
16390 * ecore.cs (EnumConstant.GetValueAsEnumType): New public method.
16392 * attribute.cs (Attribute.GetAttributeArgumentExpression): If
16393 we're an EnumConstant, just return that.
16394 (Attribute.Resolve): GetAttributeArgumentExpression() may give us
16395 an EnumConstant. In this case, we need to use GetValueAsEnumType()
16396 to get the value which'll actually be written into the attribute.
16397 However, we have to use GetValue() to access the attribute's value
16400 2004-09-22 Marek Safar <marek.safar@seznam.cz>
16402 * constant.cs (Constant.IsNegative): New abstract property
16405 * expression.cs (ArrayAccess.DoResolve): Add warning 251.
16406 (StackAlloc.DoResolve): Reused IsNegative.
16408 2004-09-21 Martin Baulig <martin@ximian.com>
16410 * codegen.cs (VariableStorage): Don't store the ILGenerator here;
16411 if we're used in an iterator, we may be called from different
16414 * statement.cs (Foreach.EmitFinally): Only emit an `Endfinally' if
16415 we actually have an exception block.
16417 2004-09-20 John Luke <jluke@cfl.rr.com>
16419 * class.cs, cs-parser.jay: Improve the error report for 1520:
16420 report the actual line where the error happens, not where the
16421 class was declared.
16423 * assign.cs, delegate.cs, ecore.cs, expression.cs, statement.cs:
16424 Pass location information that was available elsewhere.
16426 2004-09-19 Sebastien Pouliot <sebastien@ximian.com>
16428 * codegen.cs: Fix bug #56621. It is now possible to use MCS on the MS
16429 runtime to delay sign assemblies.
16431 2004-09-19 Miguel de Icaza <miguel@ximian.com>
16433 * cs-parser.jay: Do not report the stack trace, this is barely
16436 2004-08-22 John Luke <john.luke@gmail.com>
16438 * driver.cs : check that a resource id is not already used
16439 before adding it, report CS1508 if it is, bug #63637
16441 2004-09-19 Miguel de Icaza <miguel@ximian.com>
16443 * ecore.cs: Removed dead code.
16445 2004-09-18 Marek Safar <marek.safar@seznam.cz>
16447 * class.cs: Do not report warning CS0067 on the interfaces.
16449 2004-09-16 Marek Safar <marek.safar@seznam.cz>
16451 * cs-parser.jay: Add error 504 report.
16453 2004-09-16 Marek Safar <marek.safar@seznam.cz>
16455 * rootcontext.cs: WarningLevel is 4 by default now.
16457 * statement.cs (Fixed.Resolve): Do not null
16460 2004-09-16 Marek Safar <marek.safar@seznam.cz>
16463 * ecore.cs (PropertyExpr.FindAccessors): Do not perform
16464 deep search when property is not virtual.
16465 (PropertyExpr.ResolveAccessors): Make one call for both
16468 2004-09-15 Marek Safar <marek.safar@seznam.cz>
16471 * statement.cs: Error 152 report constains also location.
16473 2004-09-15 Marek Safar <marek.safar@seznam.cz>
16476 * const.cs: Explicitly set constant as static.
16478 2004-09-15 Marek Safar <marek.safar@seznam.cz>
16481 * cs-parser.jay: Add error 1017 report.
16483 2004-09-15 Marek Safar <marek.safar@seznam.cz>
16485 Fixed bug #59980, #64224
16486 * expression.cs (Invocation.DoResolve): Fixed error CS0571 test.
16488 * typemanager.cs (IsSpecialMethod): Simplified
16490 2004-09-14 Marek Safar <marek.safar@seznam.cz>
16492 * decl.cs (MemberCore.Emit): Resuscitated VerifyObsoleteAttribute
16493 condition with better params.
16495 2004-09-14 Marek Safar <marek.safar@seznam.cz>
16498 * attribute.cs (Resolve): Property has to have both
16501 2004-09-14 Martin Baulig <martin@ximian.com>
16503 * decl.cs (MemberCore.Emit): Always call VerifyObsoleteAttribute().
16505 2004-09-14 Marek Safar <marek.safar@seznam.cz>
16508 * codegen.cs (TestObsoleteMethodUsage): Trace when method is
16509 called and is obsolete then this member suppress message
16510 when call is inside next [Obsolete] method or type.
16512 * expression.cs: Use TestObsoleteMethodUsage member.
16514 2004-09-14 Martin Baulig <martin@ximian.com>
16516 * cs-parser.jay: Sync a bit with the GMCS version.
16518 2004-09-14 Martin Baulig <martin@ximian.com>
16520 * cs-parser.jay (CSharpParser): Don't derive from GenericsParser.
16521 (CSharpParser.yacc_verbose_flag): New public field.
16523 * genericparser.cs: Removed.
16525 2004-09-14 Raja R Harinath <rharinath@novell.com>
16527 * cs-parser.jay (event_declaration): Re-enable cs0071 error.
16529 2004-09-13 Marek Safar <marek.safar@seznam.cz>
16531 * class.cs (MethodCore.CheckBase): Fix bug #65757.
16533 2004-09-10 Martin Baulig <martin@ximian.com>
16535 Backported my MemberName changes from GMCS into MCS.
16537 - we are now using a special `MemberName' class instead of using
16538 strings; in GMCS, the `MemberName' also contains the type
16541 - changed the grammar rules a bit:
16542 * the old `member_name' is now a `namespace_or_type_name':
16543 The rule is that we use `namespace_or_type_name' everywhere
16544 where we expect either a "member name" (GetEnumerator) or a
16545 "member name" with an explicit interface name
16546 (IEnumerable.GetEnumerator).
16547 In GMCS, the explicit interface name may include type arguments
16548 (IEnumerable<T>.GetEnumerator).
16549 * we use `member_name' instead of just `IDENTIFIER' for
16551 The rule is that we use `member_name' wherever a member may
16552 have type parameters in GMCS.
16554 * decl.cs (MemberName): New public class.
16555 (MemberCore.MemberName): New public readonly field.
16556 (MemberCore.ctor): Take a `MemberName' argument, not a string.
16557 (DeclSpace): Likewise.
16559 * delegate.cs (Delegate.ctor): Take a MemberName, not a string.
16560 * enum.cs (Enum.ctor): Likewise.
16562 * namespace.cs (AliasEntry.Alias): Changed type from Expression to
16564 (AliasEntry.ctor): Take a MemberName, not an Expression.
16565 (AliasEntry.UsingAlias): Likewise.
16567 * class.cs (TypeContainer.ctor): Take a MemberName, not a string.
16568 (IMethodData.MemberName): Changed type from string to MemberName.
16569 (MemberBase.ExplicitInterfaceName): Likewise.
16570 (AbstractPropertyEventMethod.SetupName): Make this private.
16571 (AbstractPropertyEventMethod.ctor): Added `string prefix'
16572 argument; compute the member name here.
16573 (AbstractPropertyEventMethod.UpdateName): Recompute the name based
16574 on the `member.MemberName' and the `prefix'.
16576 * cs-parser.jay (attribute_name): Use `namespace_or_type_name',
16578 (struct_declaration): Use `member_name' instead of `IDENTIFIER';
16579 thus, we get a `MemberName' instead of a `string'. These
16580 declarations may have type parameters in GMCS.
16581 (interface_method_declaration, delegate_declaration): Likewise.
16582 (class_declaration, interface_declaration): Likewise.
16583 (method_header): Use `namespace_or_type_name' instead of
16584 `member_name'. We may be an explicit interface implementation.
16585 (property_declaration, event_declaration): Likewise.
16586 (member_name): This is now just an `IDENTIFIER', not a
16587 `namespace_or_type_name'.
16588 (type_name, interface_type): Removed.
16589 (namespace_or_type_name): Return a MemberName, not an Expression.
16590 (primary_expression): Use `member_name' instead of `IDENTIFIER';
16591 call GetTypeExpression() on the MemberName to get an expression.
16592 (IndexerDeclaration.interface_type): Changed type from string to
16594 (MakeName): Operate on MemberName's instead of string's.
16596 2004-09-13 Raja R Harinath <rharinath@novell.com>
16599 * namespace.cs (AliasEntry.Resolve): Implement section 16.3.1.
16600 (NamespaceEntry.Lookup): Add new argument to flag if we want the
16601 lookup to avoid symbols introduced by 'using'.
16602 * rootcontext.cs (NamespaceLookup): Update.
16604 2004-09-12 Marek Safar <marek.safar@seznam.cz>
16606 * class.cs (TypeContainer.DoDefineMembers): Do not call
16607 DefineDefaultConstructor for static classes.
16609 2004-09-12 Marek Safar <marek.safar@seznam.cz>
16611 * attribute.cs (Attribute.Resolve): Add error 653 report.
16613 * class.cs (Class.ApplyAttributeBuilder): Add error 641
16615 (Method.ApplyAttributeBuilder): Add error 685 report.
16616 (Operator.Define): Add error 564 report.
16618 * cs-tokenizer.cs (handle_hex): Add error 1013 report.
16620 * expression.cs (Invocation.DoResolve): Add error
16621 245 and 250 report.
16623 * parameter.cs (Parameter.ApplyAttributeBuilder): Add
16626 2004-09-11 Marek Safar <marek.safar@seznam.cz>
16628 * class.cs (ConstructorInitializer.Resolve):
16629 Wrong error number (515->516).
16631 2004-09-11 Marek Safar <marek.safar@seznam.cz>
16633 * class.cs (Indexer.Define): Add error 631 report.
16635 2004-09-11 Marek Safar <marek.safar@seznam.cz>
16637 * ecore.cs (Error_NegativeArrayIndex): Fix 248 error.
16639 2004-09-11 Marek Safar <marek.safar@seznam.cz>
16641 * expression.cs (Probe.DoResolve): Add error CS0241 report.
16643 2004-09-10 Marek Safar <marek.safar@seznam.cz>
16645 * cs-parser.jay: Added error CS0241 report.
16647 2004-09-10 Raja R Harinath <rharinath@novell.com>
16649 * cs-parser.jay (fixed_statement): Introduce a scope for the
16650 declaration in the 'fixed' statement.
16652 2004-09-09 Marek Safar <marek.safar@seznam.cz>
16654 * cs-parser.jay: Added CS0230 error report.
16656 2004-09-09 Marek Safar <marek.safar@seznam.cz>
16658 * cs-parser.jay: Added errors CS0231 and CS0257 report.
16660 2004-09-09 Marek Safar <marek.safar@seznam.cz>
16662 * expression.cs (Argument.Resolve): Added error CS0192 and
16665 2004-09-09 Marek Safar <marek.safar@seznam.cz>
16667 C# 2.0 #pragma warning feature
16669 * cs-tokenizer.cs (PreProcessPragma): New method;
16670 Handles #pragma directive.
16672 * report.cs (WarningRegions): New class; Support
16673 class for #pragma warning directive. It tests whether
16674 warning is enabled for a given line.
16676 2004-09-08 Miguel de Icaza <miguel@ximian.com>
16678 * const.cs: Add more descriptive error report, tahnks to
16681 2004-09-08 Marek Safar <marek.safar@seznam.cz>
16683 * ecore.cs (FieldExpr.DoResolveLValue): Fixed CS0198 report.
16685 2004-09-07 Miguel de Icaza <miguel@ximian.com>
16687 * expression.cs: Apply patch from Ben: Remove dead code from
16688 ArrayCreation, and remove the TurnintoConstant call in const.cs,
16689 as that code just threw an exception anwyays.
16691 * const.cs: Remove the call to the turnintoconstant, for details
16694 * literal.cs: The type of the null-literal is the null type; So
16695 we use a placeholder type (literal.cs:System.Null, defined here)
16698 * expression.cs (Conditional.DoResolve): Remove some old code that
16699 is no longer needed, conversions have been fixed.
16701 (ArrayCreationExpression.DoResolve): Return false if we fail to
16702 resolve the inner expression.
16704 2004-09-07 Raja R Harinath <rharinath@novell.com>
16707 * cs-parser.jay (delegate_declaration): Record a delegate
16708 declaration as a type declaration.
16709 Reported by Jo Vermeulen <jo@lumumba.luc.ac.be>.
16711 2004-09-06 Miguel de Icaza <miguel@ximian.com>
16713 * parameter.cs: Do not crash if the type can not be resolved.
16715 * expression.cs: Report errors with unsafe pointers, fixes #64896
16717 2004-09-06 Ben Maurer <bmaurer@users.sourceforge.net>
16719 * expression.cs: Pointer arith always needs to do a conv.i
16720 if the operand is a long. fix 65320
16722 2004-09-04 Marek Safar <marek.safar@seznam.cz>
16724 Fixed cs0619-37.cs, cs0619-38.cs
16726 * enum.cs (GetObsoleteAttribute): Removed.
16728 * expression.cs (MemberAccess.DoResolve): Test for [Obsolete]
16729 on Enum member is double staged. The first is tested member
16732 2004-09-04 Marek Safar <marek.safar@seznam.cz>
16734 Fixed #56986, #63631, #65231
16736 * class.cs: (TypeContainer.AddToMemberContainer): New method,
16737 adds member to name container.
16738 (TypeContainer.AddToTypeContainer): New method, adds type to
16740 (AddConstant, AddEnum, AddClassOrStruct, AddDelegate, AddMethod,
16741 AddConstructor, AddInterface, AddField, AddProperty, AddEvent,
16742 AddOperator): Simplified by reusing AddToMemberContainer.
16743 (TypeContainer.UserDefinedStaticConstructor): Changed to property
16745 (Method.CheckForDuplications): Fixed implementation to test all
16747 (MemberBase): Detection whether member is explicit interface
16748 implementation is now in constructor.
16749 (MemberBase.UpdateMemberName): Handles IndexerName.
16750 (Accessor): Changed to keep also location information.
16751 (AbstractPropertyEventMethod): Is derived from MemberCore.
16752 (AbstractPropertyEventMethod.IsDummy): Says whether accessor
16753 will be emited or not.
16754 (PropertyBase.AreAccessorsDuplicateImplementation):
16755 Tests whether accessors are not in collision with some method.
16756 (Operator): Is derived from MethodCore to simplify common
16759 * decl.cs (Flags.TestMethodDuplication): Test for duplication
16761 (DeclSpace.AddToContainer): Adds the member to defined_names
16762 table. It tests for duplications and enclosing name conflicts.
16764 * enum.cs (EnumMember): Clean up to reuse the base structures
16766 2004-09-03 Martin Baulig <martin@ximian.com>
16768 * class.cs (TypeContainer.DefineDefaultConstructor): Put this back
16769 into TypeContainer, to make partial classes work again.
16771 2004-09-03 Martin Baulig <martin@ximian.com>
16773 * rootcontext.cs (RootContext.V2): Removed.
16775 2004-03-23 Martin Baulig <martin@ximian.com>
16777 * expression.cs (Invocation.OverloadResolve): Added `bool
16778 may_fail' argument and use it instead of the Location.IsNull() hack.
16780 2004-09-03 Martin Baulig <martin@ximian.com>
16782 Merged latest changes into gmcs. Please keep this comment in
16783 here, it makes it easier for me to see what changed in MCS since
16784 the last time I merged.
16786 2004-09-03 Raja R Harinath <rharinath@novell.com>
16789 * expression.cs (BetterConversion): Don't allow either conversion
16790 to be null. Remove redundant implicit conversion test when 'q ==
16791 null' -- when this function is invoked, we already know that the
16792 implicit conversion exists.
16793 (BetterFunction): Assume that 'best' is non-null. Remove
16794 redundant reimplementation of IsApplicable when 'best' is null.
16795 (IsParamsMethodApplicable, IsApplicable): Add new parameter for
16796 number of arguments.
16797 (IsAncestralType): Extract from OverloadResolve.
16798 (OverloadResolve): Make robust to the MethodGroupExpr being
16799 unsorted. Implement all the logic of Section 14.5.5.1, and
16800 support overloading of methods from multiple applicable types.
16801 Clean up logic somewhat. Don't pass null methods to BetterFunction.
16803 * report.cs (SymbolRelatedToPreviousError): Cleanup output.
16804 (RealError, Warning): Append type of report to related symbol.
16806 2004-09-03 Marek Safar <marek.safar@seznam.cz>
16808 * enum.cs: Fixed CLS-Compliance checks for enum members.
16809 Error tests cs3008-8.cs, cs3014-8.cs
16811 2004-09-02 Marek Safar <marek.safar@seznam.cz>
16813 Fixed bug #62342, #63102
16814 * class.cs: ImplementIndexer uses member.IsExplicitImpl
16815 like ImplementMethod.
16817 2004-09-02 Marek Safar <marek.safar@seznam.cz>
16819 * attribute.cs (Attribute.GetAttributeArgumentExpression):
16822 2004-09-02 Martin Baulig <martin@ximian.com>
16824 * statement.cs (Using.EmitLocalVariableDeclFinally): Use
16825 TypeManager.GetArgumentTypes() rather than calling GetParameters()
16828 2004-09-01 Marek Safar <marek.safar@seznam.cz>
16830 C# 2.0 Static classes implemented
16832 * class.cs (TypeContainer): instance_constructors,
16833 initialized_fields, initialized_static_fields,
16834 default_constructor, base_inteface_types are protected to be
16835 accessible from StaticClass.
16836 (TypeContainer.DefineDefaultConstructor): New virtual method
16837 for custom default constructor generating
16838 (StaticClass): New class to handle "Static classes" feature.
16840 * cs-parser.jay: Handle static keyword on class like instance
16843 * driver.cs: Added "/langversion" command line switch with two
16844 options (iso-1, default).
16846 2004-08-31 Marek Safar <marek.safar@seznam.cz>
16848 * ecore.cs (FieldExpr.Resolve): Fixed bug #64689.
16850 2004-08-31 Miguel de Icaza <miguel@ximian.com>
16852 * delegate.cs: Style.
16854 2004-08-31 Ben Maurer <bmaurer@users.sourceforge.net>
16856 * delegate.cs: Add seperate instance expr field for miguel.
16858 2004-08-29 Ben Maurer <bmaurer@users.sourceforge.net>
16860 * PointerArithmetic (Resolve): make sure we are not doing
16861 pointer arith on void*. Also, make sure we are resolved
16862 by not setting eclass until resolve.
16864 All callers: Make sure that PointerArithmetic gets resolved.
16866 2004-08-29 Ben Maurer <bmaurer@users.sourceforge.net>
16868 * ArrayCreation (LookupType): If the type does not resolve
16869 to an array, give an error.
16871 2004-08-27 Marek Safar <marek.safar@seznam.cz>
16873 * statement.cs (Try.Resolve): Fixed bug #64222
16875 2004-08-27 Martin Baulig <martin@ximian.com>
16878 (TC.OperatorArrayList.OperatorEntry.CheckPairedOperators): Don't
16881 2004-08-26 Marek Safar <marek.safar@seznam.cz>
16883 * ecore.cs (Constantify): Get underlying type via
16884 System.Enum.GetUnderlyingType to avoid StackOverflow on the
16885 Windows in special cases.
16887 2004-08-26 Marek Safar <marek.safar@seznam.cz>
16889 * typemanager.cs (GetAddMethod): Used GetAddMethod (true)
16890 for obtaining also private methods.
16891 (GetRemoveMethod): Used GetRemoveMethod (true)
16892 for obtaining also private methods.
16894 2004-08-24 Martin Baulig <martin@ximian.com>
16896 * class.cs (Method.Define): Set MethodAttributes.SpecialName and
16897 MethodAttributes.HideBySig for operators.
16899 2004-08-23 Martin Baulig <martin@ximian.com>
16901 Back to the old error reporting system :-)
16903 * report.cs (Message): Removed.
16904 (Report.MessageData, ErrorData, WarningData): Removed.
16905 (Report.Error, Warning): Back to the old system.
16907 2004-08-23 Martin Baulig <martin@ximian.com>
16909 * decl.cs (IMemberContainer.Parent): Renamed to ParentContainer.
16911 * class.cs (TypeContainer.ParentContainer): New public virtual
16912 method; replaces the explicit interface implementation.
16913 (ClassPart.ParentContainer): Override.
16915 2004-08-23 Martin Baulig <martin@ximian.com>
16917 * statement.cs (Switch): Added support for constant switches; see
16918 #59428 or test-285.cs.
16920 2004-08-22 Marek Safar <marek.safar@seznam.cz>
16923 * statement.cs (GetEnumeratorFilter): Removed useless
16924 logic because C# specs is strict. GetEnumerator must be
16927 2004-08-22 Martin Baulig <martin@ximian.com>
16929 * flowanalysis.cs (FlowBranching.UsageVector.MergeChild): If we're
16930 a switch and may break, reset the barrier. Fixes #59867.
16932 2004-08-22 Marek Safar <marek.safar@seznam.cz>
16934 CLS-Compliance speed up (~5% for corlib)
16936 * attribute.cs (AttributeTester.VerifyTopLevelNameClsCompliance):
16937 New method. Tests container for CLS-Compliant names
16939 * class.cs (TypeContainer.VerifyClsName): New method.
16940 Checks whether container name is CLS Compliant.
16941 (Constructor): Implements IMethodData.
16943 * decl.cs (MemberCache.GetPublicMembers ): New method. Builds
16944 low-case table for CLS Compliance test.
16945 (MemberCache.VerifyClsParameterConflict): New method.
16946 Checks method parameters for CS3006 error.
16948 * enum.cs (EnumMember): Is derived from MemberCore.
16949 (Enum.VerifyClsName): Optimized for better performance.
16951 2004-08-06 Marek Safar <marek.safar@seznam.cz>
16953 * report.cs: Renamed Error_T to Error and changed all
16956 2004-08-06 Marek Safar <marek.safar@seznam.cz>
16958 * class.cs (TypeContainer.IndexerArrayList): New inner class
16959 container for indexers.
16960 (TypeContainer.DefaultIndexerName): New constant for default
16961 indexer name. Replaced all "Item" with this constant.
16962 (TypeContainer.DefineIndexers): Moved to IndexerArrayList class.
16964 * typemanager.cs (TypeManager.default_member_ctor): Cache here
16965 DefaultMemberAttribute constructor.
16967 2004-08-05 Martin Baulig <martin@ximian.com>
16969 * flowanalysis.cs (FlowBranching.UsageVector.MergeJumpOrigins):
16972 2004-08-05 Marek Safar <marek.safar@seznam.cz>
16974 * mcs.exe.sources: $(EXTRA_SOURCES) are now here to avoid
16975 multi platforms problem.
16977 * compiler.csproj: Included shared files.
16979 2004-08-04 Marek Safar <marek.safar@seznam.cz>
16981 Fix bug 60333, 55971 in the more general way
16982 * attribute.cs (Attribute.GetAttributeArgumentExpression):
16983 Added arg_type argument for constant conversion.
16984 (Attribute.Resolve): Reuse GetAttributeArgumentExpression.
16986 2004-08-04 Marek Safar <marek.safar@seznam.cz>
16989 * class.cs (TypeContainer ): New inner classes MethodArrayList,
16990 OperatorArrayList, MethodCoreArrayList for typecontainer
16991 containers. Changed class member types to these new types.
16992 (MethodArrayList.DefineMembers): Added test for CS0659.
16994 2004-08-04 Miguel de Icaza <miguel@ximian.com>
16996 * cfold.cs: Synchronize the folding with the code in expression.cs
16997 Binary.DoNumericPromotions for uint operands.
16999 * attribute.cs: Revert patch from Raja, it introduced a regression
17000 while building Blam-1.2.1 (hard to isolate a test case).
17002 2004-08-04 Marek Safar <marek.safar@seznam.cz>
17006 (TypeContainer.Define): Renamed to DefineContainerMembers because of
17008 (MethodCore.parent_method): New member. The method we're overriding
17009 if this is an override method.
17010 (MethodCore.CheckBase): Moved from Method class and made common.
17011 (MethodCore.CheckMethodAgainstBase): Moved from MemberBase and made
17013 (MethodCore.CheckForDuplications): New abstract method. For custom
17014 member duplication search in a container
17015 (MethodCore.FindOutParentMethod): New abstract method. Gets parent
17016 method and its return type.
17017 (Event.conflict_symbol): New member. Symbol with same name in the
17021 (MemberCache.FindMemberWithSameName): New method. The method
17022 is looking for conflict with inherited symbols.
17024 2004-08-04 Martin Baulig <martin@ximian.com>
17026 * codegen.cs (VariableStorage.EmitLoadAddress): New public method.
17028 * statement.cs (Foreach.EmitFinally): Make this work for valuetypes.
17030 2004-08-03 Marek Safar <marek.safar@seznam.cz>
17032 * report.cs (Message): New enum for better error, warning reference in
17034 (MessageData): New inner abstract class. It generally handles printing of
17035 error and warning messages.
17036 Removed unused Error, Warning, Message methods.
17038 2004-08-03 Marek Safar <marek.safar@seznam.cz>
17040 Fix for cs0592-8.cs test
17042 (Attributable.ValidAttributeTargets): Made public.
17043 (Attribute.ExplicitTarget): New member for explicit target value.
17044 (Attribute.CheckTargets): Now we translate explicit attribute
17045 target to Target here.
17047 2004-08-03 Ben Maurer <bmaurer@ximian.com>
17049 * ecore.cs (MethodGroupExpr): new IsBase property.
17051 * expression.cs (BaseAccess): Set IsBase on MethodGroupExpr.
17053 * delegate.cs (DelegateCreation): store a MethodGroupExpr
17054 rather than an instance expr.
17056 (DelegateCreation.Emit): Use the method group rather than
17057 the instance expression. Also, if you have base.Foo as the
17058 method for a delegate, make sure to emit ldftn, not ldftnvirt.
17060 (ResolveMethodGroupExpr): Use the MethodGroupExpr.
17062 (NewDelegate.DoResolve): Only check for the existance of Invoke
17063 if the method is going to be needed. Use MethodGroupExpr.
17065 (NewDelegate.Emit): Remove, DelegateCreation implements this.
17067 * expression.cs: For pointer arith., make sure to use
17068 the size of the type, not the size of the pointer to
17071 2004-08-03 Marek Safar <marek.safar@seznam.cz>
17074 * class.cs (Class): Added error CS0502 test.
17076 2004-08-03 John Luke <jluke@cfl.rr.com>
17077 Raja R Harinath <rharinath@novell.com>
17080 * attribute.cs (Attribute.complained_before): New flag.
17081 (Attribute.ResolveType, Attribute.Resolve),
17082 (Attribute.DefinePInvokeMethod): Set it.
17083 (Attributes.Search): Pass 'complain' to Attribute.ResolveType.
17085 2004-08-03 Martin Baulig <martin@ximian.com>
17087 * expression.cs (Binary.ResolveOperator): Don't abort if we can't
17088 use a user-defined operator; we still need to do numeric
17089 promotions in case one argument is a builtin type and the other
17090 one has an implicit conversion to that type. Fixes #62322.
17092 2004-08-02 Martin Baulig <martin@ximian.com>
17094 * statement.cs (LocalInfo.Flags): Added `IsThis'.
17095 (LocalInfo.IsThis): New public property.
17096 (Block.EmitMeta): Don't create a LocalBuilder for `this'.
17098 2004-08-01 Martin Baulig <martin@ximian.com>
17100 * class.cs (TypeContainer.GetClassBases): Don't set the default
17101 here since we may get called from GetPartialBases().
17102 (TypeContainer.DefineType): If GetClassBases() didn't return a
17103 parent, use the default one.
17105 2004-07-30 Duncan Mak <duncan@ximian.com>
17107 * Makefile (mcs2.exe, mcs3.exe): add $(EXTRA_SOURCES).
17109 2004-07-30 Martin Baulig <martin@ximian.com>
17111 * Makefile (EXTRA_SOURCES): List the symbol writer's sources here.
17113 * class.cs (SourceMethod): New public class, derive from the
17114 symbol writer's ISourceMethod.
17115 (Method): Use the new symbol writer API.
17117 * codegen.cs (CodeGen.InitializeSymbolWriter): Take the filename
17118 as argument and use the new symbol writer.
17121 (SourceFile): Implement the symbol writer's ISourceFile.
17122 (Location.SymbolDocument): Removed.
17123 (Location.SourceFile): New public property.
17125 * symbolwriter.cs: Use the new symbol writer API.
17127 2004-07-30 Raja R Harinath <rharinath@novell.com>
17129 * Makefile (install-local): Remove. Functionality moved to
17132 2004-07-28 Lluis Sanchez Gual <lluis@novell.com>
17134 * Makefile: Install mcs.exe.config file together with mcs.exe.
17135 * mcs.exe.config: Added supportedRuntime entry to make sure it runs in the
17136 correct runtime version.
17138 2004-07-25 Martin Baulig <martin@ximian.com>
17141 (TypeContainer.RegisterOrder): Removed, this was unused.
17142 (TypeContainer, interface_order): Removed.
17143 (TypeContainer.AddClass, AddStruct, AddInterface): Take a
17144 TypeContainer as argument since we can also be called with a
17145 `PartialContainer' for a partial class/struct/interface.
17146 (TypeContainer.IsInterface): Use `Kind == Kind.Interface' instead
17147 of checking whether we're an `Interface' - we could be a
17148 `PartialContainer'.
17149 (PartialContainer.Register): Override; call
17150 AddClass()/AddStruct()/AddInterface() on our parent.
17152 * cs-parser.jay (interface_member_declaration): Add things to the
17153 `current_container', not the `current_class'.
17155 * rootcontext.cs (RegisterOrder): The overloaded version which
17156 takes an `Interface' was unused, removed.
17158 * typemanager.cs (TypeManager.LookupInterface): Return a
17159 `TypeContainer', not an `Interface'.
17160 (TypeManager.IsInterfaceType): The `builder_to_declspace' may
17161 contain a `PartialContainer' for an interface, so check it's
17162 `Kind' to figure out what it is.
17164 2004-07-25 Martin Baulig <martin@ximian.com>
17166 * class.cs (Class.DefaultTypeAttributes): New public constant.
17167 (Struct.DefaultTypeAttributes): Likewise.
17168 (Interface.DefaultTypeAttributes): Likewise.
17169 (PartialContainer.TypeAttr): Override this and add the
17170 DefaultTypeAttributes.
17172 2004-07-25 Martin Baulig <martin@ximian.com>
17174 * decl.cs (DeclSpace.Emit): Removed the `TypeContainer' argument,
17175 we can just use the `Parent' field instead.
17177 2004-07-25 Martin Baulig <martin@ximian.com>
17179 * class.cs (TypeContainer.Emit): Renamed to EmitType().
17181 2004-07-25 Martin Baulig <martin@ximian.com>
17183 * class.cs (TypeContainer.DefineMembers): Call DefineMembers() on
17184 our parts before defining any methods.
17185 (TypeContainer.VerifyImplements): Make this virtual.
17186 (ClassPart.VerifyImplements): Override and call VerifyImplements()
17187 on our PartialContainer.
17189 2004-07-25 Martin Baulig <martin@ximian.com>
17191 * iterators.cs (Iterator.Define): Renamed to DefineIterator().
17193 * decl.cs (DeclSpace.Define): Removed the `TypeContainer'
17194 argument, we can just use the `Parent' field instead.
17197 (MemberBase.CheckBase): Removed the `TypeContainer' argument.
17198 (MemberBase.DoDefine): Likewise.
17200 2004-07-24 Martin Baulig <martin@ximian.com>
17202 * decl.cs (MemberCore.Parent): New public field.
17203 (DeclSpace.Parent): Moved to MemberCore.
17205 * class.cs (MethodCore.ds): Removed; use `Parent' instead.
17206 (MemberBase.ctor): Added TypeContainer argument, pass it to our
17208 (FieldBase, Field, Operator): Likewise.
17209 (EventProperty.ctor): Take a TypeContainer instead of a DeclSpace.
17210 (EventField, Event): Likewise.
17212 2004-07-23 Martin Baulig <martin@ximian.com>
17214 * class.cs (PartialContainer): New public class.
17215 (ClassPart): New public class.
17216 (TypeContainer): Added support for partial classes.
17217 (TypeContainer.GetClassBases): Splitted some of the functionality
17218 out into GetNormalBases() and GetPartialBases().
17220 * cs-tokenizer.cs (Token.PARTIAL): New token.
17221 (Tokenizer.consume_identifier): Added some hacks to recognize
17222 `partial', but only if it's immediately followed by `class',
17223 `struct' or `interface'.
17225 * cs-parser.jay: Added support for partial clases.
17227 2004-07-23 Martin Baulig <martin@ximian.com>
17229 * class.cs (MethodCore.ds): Made this a `TypeContainer' instead of
17230 a `DeclSpace' and also made it readonly.
17231 (MethodCore.ctor): Take a TypeContainer instead of a DeclSpace.
17232 (Method.ctor, Constructor.ctor, Destruktor.ctor): Likewise.
17233 (PropertyBase.ctor, Property.ctor, Indexer.ctor): Likewise.
17235 * cs-parser.jay: Pass the `current_class', not the
17236 `current_container' (at the moment, this is still the same thing)
17237 to a new Method, Property, Event, Indexer or Constructor.
17239 2004-07-23 Martin Baulig <martin@ximian.com>
17241 * cs-parser.jay (CSharpParser): Added a new `current_class' field
17242 and removed the `current_interface' one.
17243 (struct_declaration, class_declaration, interface_declaration):
17244 Set `current_class' to the newly created class/struct/interface;
17245 set their `Bases' and call Register() before parsing their body.
17247 2004-07-23 Martin Baulig <martin@ximian.com>
17249 * class.cs (Kind): New public enum.
17250 (TypeContainer): Made this class abstract.
17251 (TypeContainer.Kind): New public readonly field.
17252 (TypeContainer.CheckDef): New public method; moved here from
17254 (TypeContainer.Register): New public abstract method.
17255 (TypeContainer.GetPendingImplementations): New public abstract
17257 (TypeContainer.GetClassBases): Removed the `is_class' and
17258 `is_iface' parameters.
17259 (TypeContainer.DefineNestedTypes): Formerly known as
17261 (ClassOrStruct): Made this class abstract.
17263 * tree.cs (RootTypes): New public type.
17265 2004-07-20 Martin Baulig <martin@ximian.com>
17267 * tree.cs (Tree.RecordNamespace): Removed.
17268 (Tree.Namespaces): Removed.
17270 * rootcontext.cs (RootContext.IsNamespace): Removed.
17272 * cs-parser.jay (namespace_declaration): Just create a new
17273 NamespaceEntry here.
17275 2004-07-20 Martin Baulig <martin@ximian.com>
17277 * statement.cs (ExceptionStatement): New abstract class. This is
17278 now used as a base class for everyone who's using `finally'.
17279 (Using.ResolveLocalVariableDecls): Actually ResolveLValue() all
17280 our local variables before using them.
17282 * flowanalysis.cs (FlowBranching.StealFinallyClauses): New public
17283 virtual method. This is used by Yield.Resolve() to "steal" an
17284 outer block's `finally' clauses.
17285 (FlowBranchingException): The .ctor now takes an ExceptionStatement
17288 * codegen.cs (EmitContext.StartFlowBranching): Added overloaded
17289 version which takes an ExceptionStatement. This version must be
17290 used to create exception branchings.
17293 (Yield.Resolve): "Steal" all `finally' clauses from containing blocks.
17294 (Iterator.EmitMoveNext): Added exception support; protect the
17295 block with a `fault' clause, properly handle 'finally' clauses.
17296 (Iterator.EmitDispose): Run all the `finally' clauses here.
17298 2004-07-20 Martin Baulig <martin@ximian.com>
17300 * iterator.cs: This is the first of a set of changes in the
17301 iterator code. Match the spec more closely: if we're an
17302 IEnumerable, then GetEnumerator() must be called. The first time
17303 GetEnumerator() is called, it returns the current instance; all
17304 subsequent invocations (if any) must create a copy.
17306 2004-07-19 Miguel de Icaza <miguel@ximian.com>
17308 * expression.cs: Resolve the constant expression before returning
17311 2004-07-19 Martin Baulig <martin@ximian.com>
17313 * iterators.cs (Iterator.MapVariable): Don't define fields twice.
17314 (Iterator.MoveNextMethod.DoEmit): Use `TypeManager.int32_type' as
17315 the return type of the new EmitContext.
17317 2004-07-18 Martin Baulig <martin@ximian.com>
17319 * class.cs (Property.Define): Fix iterators.
17321 * iterators.cs (Iterator.Define): Moved the
17322 `container.AddInterator (this)' call here from the .ctor; only do
17323 it if we resolved successfully.
17325 2004-07-17 Miguel de Icaza <miguel@ximian.com>
17327 * cs-tokenizer.cs (handle_preprocessing_directive): Do not return
17328 `true' for preprocessing directives that we parse. The return
17329 value indicates whether we should return to regular tokenizing or
17330 not, not whether it was parsed successfully.
17332 In the past if we were in: #if false ... #line #endif, we would
17333 resume parsing after `#line'. See bug 61604.
17335 * typemanager.cs: Removed an old hack from Gonzalo to get corlib
17336 building: IsEnumType should return true only for enums, not for
17337 enums or System.Enum itself. This fixes #61593.
17339 Likely what happened is that corlib was wrong: mcs depended on
17340 this bug in some places. The bug got fixed, we had to add the
17341 hack, which caused bug 61593.
17343 * expression.cs (ArrayAccess.GetStoreOpCode): Remove an old hack
17344 that was a workaround for the older conditions.
17346 2004-07-16 Ben Maurer <bmaurer@ximian.com>
17348 * assign.cs: IAssignMethod has a new interface, as documented
17349 inline. All assignment code now uses this new api.
17351 * ecore.cs, expression.cs: All classes which implement
17352 IAssignMethod now use the new interface.
17354 * expression.cs (Invocation): add a hack to EmitCall so that
17355 IndexerAccess can be the target of a compound assignment without
17356 evaluating its arguments twice.
17358 * statement.cs: Handle changes in Invocation api.
17360 2004-07-16 Martin Baulig <martin@ximian.com>
17362 * iterators.cs: Rewrote this. We're now using one single Proxy
17363 class for both the IEnumerable and the IEnumerator interface and
17364 `Iterator' derives from Class so we can use the high-level API.
17366 * class.cs (TypeContainer.AddIterator): New method.
17367 (TypeContainer.DoDefineType): New protected virtual method, which
17368 is called from DefineType().
17369 (TypeContainer.DoDefineMembers): Call DefineType() and
17370 DefineMembers() on all our iterators.
17371 (TypeContainer.Emit): Call Emit() on all our iterators.
17372 (TypeContainer.CloseType): Call CloseType() on all our iterators.
17374 * codegen.cs (EmitContext.CurrentIterator): New public field.
17376 2004-07-15 Martin Baulig <martin@ximian.com>
17379 (TypeManager.not_supported_exception_type): New type.
17381 2004-07-14 Martin Baulig <martin@ximian.com>
17383 * iterators.cs: Use real error numbers.
17385 2004-07-14 Martin Baulig <martin@ximian.com>
17387 * iterator.cs (IteratorHandle.IsIEnumerable): The spec explicitly
17388 requires this to be a System.Collection.IEnumerable and not a
17389 class implementing that interface.
17390 (IteratorHandle.IsIEnumerator): Likewise, for IEnumerator.
17392 2004-07-13 Marek Safar <marek.safar@seznam.cz>
17394 * class.cs: Fixed previous fix, it broke some error tests.
17396 2004-07-12 Martin Baulig <martin@ximian.com>
17398 * enum.cs (Enum.Define): Call Emit() to emit the attributes.
17401 2004-07-09 Miguel de Icaza <miguel@ximian.com>
17403 * assign.cs (LocalTemporary): Add new argument: is_address,If
17404 `is_address' is true, then the value that we store is the address
17405 to the real value, and not the value itself.
17407 * ecore.cs (PropertyExpr): use the new local temporary
17408 stuff to allow us to handle X.Y += z (where X is a struct)
17410 2004-07-08 Martin Baulig <martin@ximian.com>
17412 * statement.cs (Lock.Resolve): Set ec.NeedReturnLabel() if we do
17413 not always return, just like we're doing in Using.Resolve().
17415 2004-07-07 Miguel de Icaza <miguel@ximian.com>
17417 * cs-parser.jay (fixed_statement): flag this as Pinned.
17419 2004-07-06 Miguel de Icaza <miguel@ximian.com>
17421 * typemanager.cs (TypeManager): Removed MakePinned method, this
17422 mechanism is replaced with the .NET 2.x compatible mechanism of
17423 calling `ILGenerator.DeclareLocal (Type t, bool pinned)'.
17425 * statement.cs (LocalInfo): Remove MakePinned, add Pinned property
17426 Rename `Fixed' to `Pinned' as a flag, to distinguish from the
17427 `IsFixed' property which has a different meaning.
17429 2004-07-02 Raja R Harinath <rharinath@novell.com>
17431 * ecore.cs (DoSimpleNameResolve): Expand CS0038 check to all names
17432 visible from inside a nested class, not just the names of the
17433 immediately enclosing class.
17434 Fix for bug #60730.
17436 2004-06-24 Raja R Harinath <rharinath@novell.com>
17438 * expression.cs (BetterConversion): Remove buggy special-case
17439 handling of "implicit constant expression conversions". At this
17440 point, we already know that the conversion is possible -- we're
17441 only checking to see which is better.
17443 2004-06-24 Marek Safar <marek.safar@seznam.cz>
17445 * cs-parser.jay: Added error CS0210 test.
17447 2004-06-24 Marek Safar <marek.safar@seznam.cz>
17449 * cs-parser.jay: Added error CS0134 test.
17451 2004-06-24 Marek Safar <marek.safar@seznam.cz>
17454 * cs-parser.jay: Added error CS0145 test.
17456 2004-06-24 Marek Safar <marek.safar@seznam.cz>
17458 * class.cs (Operator.Define): Added test for errors CS0553, CS0554.
17460 2004-06-23 Ben Maurer <bmaurer@ximian.com>
17462 * expression.cs (StackAlloc.Resolve): The argument may not
17463 be a constant; deal with this case.
17465 2004-06-23 Marek Safar <marek.safar@seznam.cz>
17467 * attribute.cs (IndexerName_GetIndexerName): Renamed to
17468 GetIndexerAttributeValue.
17469 (ScanForIndexerName): Renamed to GetIndexerNameAttribute.
17471 * class.cs (Indexer.Define): Added error tests for CS0415,
17474 2004-06-23 Miguel de Icaza <miguel@ximian.com>
17476 * attribute.cs (Attribute.Resolve): Keep field code in sync with
17479 2004-06-23 Martin Baulig <martin@ximian.com>
17481 * flowanalysis.cs (UsageVector.MergeChild): If we're a loop and we
17482 neither return nor throw, reset the barrier as well. Fixes #60457.
17484 2004-06-22 Atsushi Enomoto <atsushi@ximian.com>
17486 * class.cs : EventAttributes is now set to None by default.
17487 This fixes bug #60459.
17489 2004-06-18 Marek Safar <marek.safar@seznam.cz>
17492 * class.cs (ConstructorInitializer.GetOverloadedConstructor):
17493 Don't throw exception but return null (it's sufficient now).
17495 2004-06-18 Marek Safar <marek.safar@seznam.cz>
17497 * typemanager.cs (GetArgumentTypes): Faster implementation.
17499 2004-06-18 Martin Baulig <martin@ximian.com>
17501 * attribute.cs (Attribute.Resolve): Check whether we're an
17502 EmptyCast which a Constant child. Fixes #60333.
17504 2004-06-17 Ben Maurer <bmaurer@ximian.com>
17506 * statement.cs (EmitCollectionForeach): Account for the fact that
17507 not all valuetypes are in areas which we can take the address of.
17508 For these variables, we store to a temporary variable. Also, make
17509 sure that we dont emit a `callvirt' on a valuetype method.
17511 2004-06-15 Marek Safar <marek.safar@seznam.cz>
17513 * expression.cs (StackAlloc.DoReSolve): Added test for
17514 negative parameter (CS0247).
17516 2004-06-15 Marek Safar <marek.safar@seznam.cz>
17519 * class.cs: (Event.DelegateMethod.Emit): Added synchronization flag.
17521 2004-06-15 Marek Safar <marek.safar@seznam.cz>
17524 * expression.cs: (Binary.DoNumericPromotions): Added conversion for
17527 2004-06-14 Marek Safar <marek.safar@seznam.cz>
17529 Fix bug #58254 & cs1555.cs, cs1556.cs
17530 * driver.cs (MainDriver): Added tests for errors CS1555, CS1556.
17532 2004-06-14 Marek Safar <marek.safar@seznam.cz>
17534 * cs-parser.jay: Added error CS1669 test for indexers.
17536 2004-06-11 Martin Baulig <martin@ximian.com>
17538 * expression.cs (Invocation.IsParamsMethodApplicable): We need to
17539 call this twice: for params and varargs methods.
17541 2004-06-11 Marek Safar <marek.safar@seznam.cz>
17544 (FieldBase.DoDefine, PropertyBase.DoDefine): Added error test CS0610.
17546 2004-06-11 Marek Safar <marek.safar@seznam.cz>
17548 * attribute.cs (Attribute.GetValidTargets): Made public.
17551 (AbstractPropertyEventMethod): New class for better code sharing.
17552 (AbstractPropertyEventMethod.ApplyAttributeBuilder): Add error
17554 (PropertyMethod, DelegateMethod): Derived from AbstractPropertyEventMethod
17556 2004-06-11 Raja R Harinath <rharinath@novell.com>
17559 * ecore.cs (ResolveFlags): Add new 'Intermediate' flag to tell
17560 that the call to Resolve is part of a MemberAccess.
17561 (Expression.Resolve): Use it for SimpleName resolution.
17562 (SimpleName.SimpleNameResolve, SimpleName.DoResolveAllowStatic):
17563 Add 'intermediate' boolean argument.
17564 (SimpleName.DoSimpleNameResolve): Likewise. Use it to disable an
17565 error message when the SimpleName can be resolved ambiguously
17566 between an expression and a type.
17567 * expression.cs (MemberAccess.IdenticalNameAndTypeName): Make
17569 (MemberAccess.Resolve): Pass 'Intermediate' flag to the Resolve()
17570 call on the left-side.
17572 2004-06-11 Marek Safar <marek.safar@seznam.cz>
17575 (MethodCore.VerifyClsCompliance): Added test for error CS3000.
17577 2004-06-11 Marek Safar <marek.safar@seznam.cz>
17579 * attribute.cs (Attribute.Emit): Fixed error CS0579 reporting.
17581 2004-06-11 Martin Baulig <martin@ximian.com>
17583 * expression.cs (Invocation.EmitCall): Use OpCodes.Callvirt for
17584 varargs methods if applicable.
17586 2004-06-11 Martin Baulig <martin@ximian.com>
17588 * expression.cs (Invocation.EmitCall): Don't use
17589 `method.CallingConvention == CallingConventions.VarArgs' since the
17590 method could also have `CallingConventions.HasThis'.
17592 2004-06-11 Marek Safar <marek.safar@seznam.cz>
17594 * class.cs (Event.GetSignatureForError): Implemented.
17595 Fixed crash in error test cs3010.cs
17597 2004-06-10 Miguel de Icaza <miguel@ximian.com>
17599 * cs-tokenizer.cs: Change the way we track __arglist to be
17600 consistent with the other keywords.
17602 2004-06-09 Miguel de Icaza <miguel@ximian.com>
17604 * codegen.cs: FAQ avoider: turn 1577 into a warning for now until
17607 2004-06-09 Sebastien Pouliot <sebastien@ximian.com>
17609 * codegen.cs: Check that all referenced assemblies have a strongname
17610 before strongnaming the compiled assembly. If not report error CS1577.
17611 Fix bug #56563. Patch by Jackson Harper.
17612 * typemanager.cs: Added a method to return all referenced assemblies.
17613 Fix bug #56563. Patch by Jackson Harper.
17615 2004-06-08 Marek Safar <marek.safar@seznam.cz>
17618 (Method.ApplyAttributeBuilder): Moved and added conditional
17619 attribute error tests (CS0577, CS0578, CS0243, CS0582, CS0629).
17622 (DelegateCreation.ResolveMethodGroupExpr): Added error CS1618 test.
17624 2004-06-08 Marek Safar <marek.safar@seznam.cz>
17627 * class.cs: (EventField.attribute_targets): Changed default target.
17629 2004-06-08 Martin Baulig <martin@ximian.com>
17631 * expression.cs (Invocation.EmitCall): Enable varargs methods.
17633 2004-06-08 Martin Baulig <martin@ximian.com>
17635 * rootcontext.cs (ResolveCore): Added "System.RuntimeArgumentHandle".
17637 2004-06-07 Martin Baulig <martin@ximian.com>
17639 Added support for varargs methods.
17641 * cs-tokenizer.cs (Token.ARGLIST): New token for the `__arglist'
17644 * cs-parser.jay: Added support for `__arglist'.
17646 * decl.cs (MemberCache.AddMethods): Don't ignore varargs methods.
17648 * expression.cs (Argument.AType): Added `ArgList'.
17649 (Invocation): Added support for varargs methods.
17650 (ArglistAccess): New public class.
17651 (Arglist): New public class.
17653 * parameter.cs (Parameter.Modifier): Added `ARGLIST'.
17655 * statement.cs (Block.Flags): Added `HasVarargs'. We set this on
17656 a method's top-level block if the method has varargs.
17658 * support.cs (ReflectionParameters, InternalParameters): Added
17659 support for varargs methods.
17661 2004-06-07 Miguel de Icaza <miguel@ximian.com>
17663 * class.cs: Provide location in indexer error report.
17665 * driver.cs: Use standard names.
17667 * namespace.cs: Catch the use of using after a namespace has been
17668 declared also on using aliases.
17670 2004-06-03 Raja R Harinath <rharinath@novell.com>
17673 * typemanager.cs (closure_private_ok, closure_invocation_type)
17674 (closure_qualifier_type, closure_invocation_assembly)
17675 (FilterWithClosure): Move to ...
17676 (Closure): New internal nested class.
17677 (Closure.CheckValidFamilyAccess): Split out from Closure.Filter.
17678 (MemberLookup, RealMemberLookup): Add new almost_match parameter.
17679 * ecore.cs (almostMatchedMembers): New variable to help report CS1540.
17680 (MemberLookup, MemberLookupFailed): Use it.
17681 * expression.cs (New.DoResolve): Treat the lookup for the
17682 constructor as being qualified by the 'new'ed type.
17683 (Indexers.GetIndexersForTypeOrInterface): Update.
17685 2004-06-03 Marek Safar <marek.safar@seznam.cz>
17688 (GetConditionalAttributeValue): New method. Returns
17689 condition of ConditionalAttribute.
17690 (SearchMulti): New method. Returns all attributes of type 't'.
17691 Use it when attribute is AllowMultiple = true.
17692 (IsConditionalMethodExcluded): New method.
17695 (Method.IsExcluded): Implemented. Returns true if method has conditional
17696 attribute and the conditions is not defined (method is excluded).
17697 (IMethodData): Extended interface for ConditionalAttribute support.
17698 (PropertyMethod.IsExcluded): Implemented.
17701 (MemberCore.Flags): Excluded_Undetected, Excluded new caching flags.
17704 (Invocation.IsMethodExcluded): Checks the ConditionalAttribute
17707 2004-06-02 Ben Maurer <bmaurer@users.sourceforge.net>
17709 * expression.cs (ArrayCreationExpression): Make this just an
17710 `expression'. It can't be a statement, so the code here was
17713 2004-06-02 Marek Safar <marek.safar@seznam.cz>
17716 * typemanager.cs (GetFullNameSignature): New method for
17719 2004-06-02 Marek Safar <marek.safar@seznam.cz>
17722 * class.cs (MemberBase.GetSignatureForError): New virtual method.
17723 Use this method when MethodBuilder is null.
17724 (MethodData.DefineMethodBuilder): Encapsulated code to the new method.
17725 Added test for error CS0626 (MONO reports error for this situation).
17726 (IMethodData.GetSignatureForError): Extended interface.
17728 2004-06-01 Marek Safar <marek.safar@seznam.cz>
17731 (AttributeTester.GetObsoleteAttribute): Returns instance of
17732 ObsoleteAttribute when type is obsolete.
17735 (TypeContainer.VerifyObsoleteAttribute): Override.
17736 (Method.GetSignatureForError): New method for usage when MethodBuilder is null.
17737 (MethodCode.VerifyObsoleteAttribute): Override.
17738 (MemberBase.VerifyObsoleteAttribute): Override.
17741 (MemberCore.CheckUsageOfObsoleteAttribute): Tests presence of ObsoleteAttribute
17742 and report proper error.
17745 Delegate.VerifyObsoleteAttribute): Override.
17748 (Expression.CheckObsoleteAttribute): Tests presence of ObsoleteAttribute
17749 and report proper error.
17750 (FieldExpr.DoResolve): Added tests for ObsoleteAttribute.
17753 (Enum.GetObsoleteAttribute): Returns ObsoleteAttribute for both enum type
17757 (Probe.DoResolve, Cast.DoResolve, LocalVariableReference.DoResolve,
17758 New.DoResolve, SizeOf.DoResolve, TypeOf.DoResolce, MemberAccess.DoResolve):
17759 Added test for ObsoleteAttribute.
17762 (Catch): Derived from Statement.
17764 2004-06-01 Marek Safar <marek.safar@seznam.cz>
17766 Fixed bug #59071 & cs0160.cs
17768 * statement.cs (Try.Resolve): Check here whether order of catch
17769 clauses matches their dependencies.
17771 2004-05-31 Miguel de Icaza <miguel@ximian.com>
17773 * Reverted patch to namespace.cs (Use lookuptypedirect). This
17774 caused a regression: #59343. Referencing nested classes from an
17775 assembly stopped working.
17777 2004-05-31 Martin Baulig <martin@ximian.com>
17779 MCS is now frozen for beta 2.
17781 2004-05-30 Ben Maurer <bmaurer@users.sourceforge.net>
17783 * convert.cs: add a trivial cache for overload operator resolution.
17785 2004-05-30 Ben Maurer <bmaurer@users.sourceforge.net>
17787 * decl.cs: If possible, use lookuptypedirect here. We can only do
17788 this if there is no `.' after the namespace. Avoids using
17789 LookupType, which does lots of slow processing.
17790 (FindNestedType) New method, does what it says :-).
17791 * namespace.cs: use LookupTypeDirect.
17792 * rootcontext.cs: use membercache, if possible.
17793 * typemanager.cs (LookupTypeDirect): Cache negative hits too.
17795 2004-05-30 Ben Maurer <bmaurer@users.sourceforge.net>
17798 According to the spec,
17800 In a member access of the form E.I, if E is a single identifier,
17801 and if the meaning of E as a simple-name (§7.5.2) is a constant,
17802 field, property, localvariable, or parameter with the same type as
17803 the meaning of E as a type-name (§3.8), then both possible
17804 meanings of E are permitted.
17806 We did not check that E as a simple-name had the same type as E as
17809 This trivial check gives us 5-7% on bootstrap time.
17811 2004-05-30 Ben Maurer <bmaurer@users.sourceforge.net>
17813 * expression.cs (Invocation.OverloadResolve): Avoid the
17814 use of hashtables and boxing here by allocating on demand.
17816 2004-05-30 Martin Baulig <martin@ximian.com>
17818 * rootcontext.cs (RootContext.LookupType): Don't cache things if
17819 we're doing a silent lookup. Don't try to lookup nested types in
17820 TypeManager.object_type (thanks to Ben Maurer).
17822 2004-05-30 Martin Baulig <martin@ximian.com>
17824 Committing a patch from Ben Maurer.
17826 * rootcontext.cs (RootContext.LookupType): Cache negative results.
17828 2004-05-29 Martin Baulig <martin@ximian.com>
17830 * class.cs (IMethodData.ShouldIgnore): New method.
17832 * typemanager.cs (TypeManager.MethodFlags): Don't take a
17833 `Location' argument, we don't need it anywhere. Use
17834 `IMethodData.ShouldIgnore ()' instead of
17835 `MethodData.GetMethodFlags ()'.
17836 (TypeManager.AddMethod): Removed.
17837 (TypeManager.AddMethod2): Renamed to AddMethod.
17839 2004-05-29 Martin Baulig <martin@ximian.com>
17841 Committing a patch from Benjamin Jemlich <pcgod@gmx.net>.
17843 * convert.cs (Convert.ImplicitReferenceConversion): If we're
17844 converting from a class type S to an interface type and we already
17845 have an object on the stack, don't box it again. Fixes #52578.
17847 2004-05-29 Martin Baulig <martin@ximian.com>
17849 * class.cs (ConstructorInitializer.GetOverloadedConstructor):
17850 Added support for `params' parameters. Fixes #59267.
17852 2004-05-29 Martin Baulig <martin@ximian.com>
17854 * literal.cs (NullPointer): Provide a private .ctor which sets
17855 `type' to TypeManager.object_type. Fixes #59048.
17857 2004-05-29 Martin Baulig <martin@ximian.com>
17859 * expression.cs (MemberAccess.ResolveMemberAccess): If we're an
17860 EventExpr, set `ee.InstanceExpression = left'. Fixes #59188.
17862 * ecore.cs (EventExpr.instance_expr): Make the field private.
17864 2004-05-26 Marek Safar <marek.safar@seznam.cz>
17866 Fixed bug #50080 & cs0214-2.cs
17867 * expression.cs (Cast.DoResolve): Check unsafe context here.
17869 * statement.cs (Resolve.DoResolve): Likewise.
17871 2004-05-26 Martin Baulig <martin@ximian.com>
17873 * namespace.cs (NamespaceEntry.Lookup): Added `bool silent'.
17875 * rootcontext.cs (RootContext.NamespaceLookup): Added `bool silent'.
17876 (RootContext.LookupType): Pass down the `silent' flag.
17878 2004-05-25 Martin Baulig <martin@ximian.com>
17881 (MethodGroupExpr.IdenticalTypeName): New public property.
17882 (Invocation.DoResolve): Don't report a CS0176 if the "instance"
17883 expression actually refers to a type.
17885 2004-05-25 Martin Baulig <martin@ximian.com>
17887 * expression.cs (Invocation.DoResolve): Applied Ben Maurer's patch
17888 for #56176 and made it actually work.
17890 2004-05-25 Martin Baulig <martin@ximian.com>
17892 * ecore.cs (Expression.CacheTemporaries): Make this virtual.
17893 (FieldExpr, PropertyExpr): Override and implement
17894 CacheTemporaries. Fixes #52279.
17896 2004-05-25 Miguel de Icaza <miguel@ximian.com>
17898 * location.cs: In the new compiler listing a file twice is a
17899 warning, not an error.
17901 2004-05-24 Martin Baulig <martin@ximian.com>
17903 * enum.cs (Enum.DefineType): For the `BaseType' to be a
17904 TypeLookupExpression; otherwise, report a CS1008. Fixes #58571.
17906 2004-05-24 Martin Baulig <martin@ximian.com>
17908 * decl.cs (DeclSpace.FindType): Try doing an alias lookup before
17909 walking the `using' list. Fixes #53921.
17911 2004-05-24 Martin Baulig <martin@ximian.com>
17913 * const.cs (Const.LookupConstantValue): Added support for
17914 EmptyCast's; fixes #55251.
17916 2004-05-24 Martin Baulig <martin@ximian.com>
17918 * ecore.cs (SimpleName.SimpleNameResolve): Renamed to
17919 DoSimpleNameResolve() and provide a SimpleNameResolve() wrapper
17920 which does the CS0135 check. The reason is that we first need to
17921 check whether the variable actually exists.
17923 2004-05-24 Martin Baulig <martin@ximian.com>
17925 * class.cs (MemberBase.DoDefine): Use DeclSpace.FindType() rather
17926 than RootContext.LookupType() to find the explicit interface
17927 type. Fixes #58584.
17929 2004-05-24 Raja R Harinath <rharinath@novell.com>
17931 * Makefile: Simplify. Use executable.make.
17932 * mcs.exe.sources: New file. List of sources of mcs.exe.
17934 2004-05-24 Anders Carlsson <andersca@gnome.org>
17938 Use the invariant culture when doing String.Compare for CLS case
17941 2004-05-23 Martin Baulig <martin@ximian.com>
17943 * decl.cs (DeclSpace.FindType): Only check the `using' list if we
17944 don't have any dots. Fixes #52622, added cs0246-8.cs.
17946 * namespace.cs (NamespaceEntry.Lookup): Likewise.
17948 2004-05-23 Marek Safar <marek.safar@seznam.cz>
17950 * class.cs (MemberBase.Define): Reuse MemberType member for
17951 resolved type. Other methods can use it too.
17953 2004-05-23 Martin Baulig <martin@ximian.com>
17955 * ecore.cs (SimpleName.SimpleNameResolve): Only report a CS0135 if
17956 the variable also exists in the current block (otherwise, we need
17957 to report a CS0103). Fixes #58670.
17959 2004-05-23 Martin Baulig <martin@ximian.com>
17961 * flowanalysis.cs (Reachability.Reachable): Compute this
17962 on-the-fly rather than storing it as a field.
17964 2004-05-23 Martin Baulig <martin@ximian.com>
17966 * flowanalysis.cs (Reachability.And): Manually compute the
17967 resulting `barrier' from the reachability.
17969 2004-05-23 Marek Safar <marek.safar@seznam.cz>
17972 * attribute.cs (AttributeTester.GetMethodObsoleteAttribute): Returns
17973 instance of ObsoleteAttribute when symbol is obsolete.
17976 (IMethodData): Extended interface for ObsoleteAttribute support.
17978 2004-05-22 Marek Safar <marek.safar@seznam.cz>
17980 * attribute.cs: Fix bug #55970
17982 2004-05-22 Marek Safar <marek.safar@seznam.cz>
17986 (GetObsoleteAttribute): New method. Creates the instance of
17988 (AttributeTester.GetMemberObsoleteAttribute): Returns instance of
17989 ObsoleteAttribute when member is obsolete.
17990 (AttributeTester.Report_ObsoleteMessage): Common method for
17991 Obsolete error/warning reporting.
17994 (TypeContainer.base_classs_type): New member for storing parent type.
17997 (MemberCore.GetObsoleteAttribute): Returns instance of ObsoleteAttribute
17998 for this MemberCore.
18000 2004-05-21 Marek Safar <marek.safar@seznam.cz>
18002 * attribute.cs, const.cs: Fix bug #58590
18004 2004-05-21 Martin Baulig <martin@ximian.com>
18006 * flowanalysis.cs (FlowBranching.MergeTopBlock): Don't check for
18007 out parameters if the end of the method is unreachable. Fixes
18010 2004-05-21 Marek Safar <marek.safar@seznam.cz>
18012 * codegen.cs, cs-parser.jay: Removed SetAttributes method.
18013 Hari was right, why extra method.
18015 2004-05-21 Marek Safar <marek.safar@seznam.cz>
18017 * attribute.cs, cs-parser.jay: Fix errors/cs0579-7.cs.
18019 2004-05-20 Martin Baulig <martin@ximian.com>
18021 Merged this back from gmcs to keep the differences to a minumum.
18023 * attribute.cs (Attribute.CheckAttributeType): Take an EmitContext
18024 instead of a Declspace.
18025 (Attribute.ResolveType): Likewise.
18026 (Attributes.Search): Likewise.
18027 (Attributes.Contains): Likewise.
18028 (Attributes.GetClsCompliantAttribute): Likewise.
18030 * class.cs (TypeContainer.VerifyMembers): Added EmitContext
18032 (MethodData.ApplyAttributes): Take an EmitContext instead of a
18035 2004-05-19 Marek Safar <marek.safar@seznam.cz>
18037 Fix bug #58688 (MCS does not report error when the same attribute
18040 * attribute.cs (Attribute.Emit): Distinction between null and default.
18042 2004-05-19 Raja R Harinath <rharinath@novell.com>
18044 * cs-parser.jay (attribute): Create a GlobalAttribute for the case
18045 of a top-level attribute without an attribute target.
18046 * attribute.cs (Attribute.Error_AttributeConstructorMismatch):
18048 (Attribute.Conditional_GetConditionName),
18049 (Attribute.Obsolete_GetObsoleteMessage): Update.
18050 (Attribute.IndexerName_GetIndexerName): New. Attribute-specific
18051 part of ScanForIndexerName.
18052 (Attribute.CanIgnoreInvalidAttribute): New function.
18053 (Attribute.ScanForIndexerName): Move to ...
18054 (Attributes.ScanForIndexerName): ... here.
18055 (Attributes.Attrs): Rename from now-misnamed AttributeSections.
18056 (Attributes.Search): New internal variant that can choose not to
18057 complain if types aren't resolved. The original signature now
18059 (Attributes.GetClsCompliantAttribute): Use internal variant, with
18060 complaints suppressed.
18061 (GlobalAttribute.CheckAttributeType): Overwrite ds.NamespaceEntry
18062 only if it not useful.
18063 (CanIgnoreInvalidAttribute): Ignore assembly attribute errors at
18064 top-level for attributes that are shared between the assembly
18065 and a top-level class.
18066 * parameter.cs (ImplicitParameter): Rename from ParameterAtribute.
18067 * class.cs: Update to reflect changes.
18068 (DefineIndexers): Fuse loops.
18069 * codegen.cs (GetAssemblyName): Update to reflect changes. Accept
18070 a couple more variants of attribute names.
18072 2004-05-18 Marek Safar <marek.safar@seznam.cz>
18074 Fix bug #52585 (Implemented explicit attribute declaration)
18077 (Attributable.ValidAttributeTargets): New abstract method. It gets
18078 list of valid attribute targets for explicit target declaration.
18079 (Attribute.Target): It holds target itself.
18080 (AttributeSection): Removed.
18081 (Attribute.CheckTargets): New method. It checks whether attribute
18082 target is valid for the current element.
18085 (EventProperty): New class. For events that are declared like
18086 property (with add and remove accessors).
18087 (EventField): New class. For events that are declared like field.
18090 * cs-parser.jay: Implemented explicit attribute target declaration.
18092 * class.cs, decl.cs, delegate.cs, enum.cs, parameter.cs:
18093 Override ValidAttributeTargets.
18096 (ReturnParameter): Class for applying custom attributes on
18098 (ParameterAtribute): New class. Class for applying custom
18099 attributes on the parameter type.
18101 2004-05-17 Miguel de Icaza <miguel@ximian.com>
18103 * class.cs (MemberBase.DoDefine): Pass UNSAFE on interface
18106 (Method): Allow UNSAFE here.
18108 * modifiers.cs: Support unsafe reporting.
18110 2004-05-17 Marek Safar <marek.safar@seznam.cz>
18112 * decl.cs: Fix bug #58478.
18114 2004-05-17 Gonzalo Paniagua Javier <gonzalo@ximian.com>
18116 * statement.cs: When checking for unreachable code on an EmptyStatement,
18117 set the location. Fixes bug #58488.
18119 2004-05-13 Miguel de Icaza <miguel@ximian.com>
18121 * driver.cs: Add -pkg handling.
18123 From Gonzalo: UseShelLExecute=false
18125 2004-05-12 Marek Safar <marek.safar@seznam.cz>
18128 (Attribute.GetAttributeTargets): New method. Gets AttributeTargets
18130 (Attribute.IsClsCompliaceRequired): Moved to base for better
18132 (Attribute.UsageAttribute): New property for AttributeUsageAttribute
18133 when attribute is AttributeUsageAttribute.
18134 (Attribute.GetValidTargets): Simplified.
18135 (Attribute.GetAttributeUsage): New method returns AttributeUsage
18136 attribute for this type.
18137 (Attribute.ApplyAttributes): Method renamed to Emit and make
18139 (GlobalAttributeSection): New class for special handling of global
18140 attributes (assembly, module).
18141 (AttributeSection.Emit): New method.
18143 * class.cs: Implemented Attributable abstract methods.
18144 (MethodCore.LabelParameters): Moved to Parameter class.
18145 (Accessor): Is back simple class.
18146 (PropertyMethod): Implemented Attributable abstract class.
18147 (DelegateMethod): Implemented Attributable abstract class.
18148 (Event): New constructor for disctintion between normal Event
18149 and Event with accessors.
18151 * cs-parser.jay: Used new Event ctor and GlobalAttributeSection.
18153 * codegen.cs, const.cs, decl.cs, delegate.cs:
18154 (CommonAssemblyModulClass): Implemented Attributable abstract class
18157 * enum.cs: Implement IAttributeSupport interface.
18158 (EnumMember): New class for emum members. Implemented Attributable
18162 (ParameterBase): Is abstract.
18163 (ReturnParameter): New class for easier [return:] attribute handling.
18165 * typemanager.cs: Removed builder_to_attr.
18167 2004-05-11 Raja R Harinath <rharinath@novell.com>
18170 * attribute.cs (Attribute.GetPositionalValue): New function.
18171 * class.cs (TypeContainer.VerifyMembers): New function.
18172 (TypeContainer.Emit): Use it.
18173 (ClassOrStruct): New base class for Class and Struct.
18174 (ClassOrStruct.ApplyAttributeBuilder): New function. Note if
18175 StructLayout(LayoutKind.Explicit) was ascribed to the struct or
18177 (ClassOrStruct.VerifyMembers): If the struct is explicitly laid out,
18178 then each non-static field should have a FieldOffset attribute.
18179 Otherwise, none of the fields should have a FieldOffset attribute.
18180 * rootcontext.cs (RootContext.ResolveCore): Resolve StructLayout
18181 and FieldOffset attributes.
18182 * typemanager.cs (TypeManager.struct_layout_attribute_type)
18183 (TypeManager.field_offset_attribute_type): New core types.
18184 (TypeManager.InitCoreTypes): Initialize them.
18186 2004-05-11 Michal Moskal <malekith@pld-linux.org>
18188 * class.cs (Event.RemoveDelegateMethod.DelegateMethodInfo):
18189 Return correct type.
18192 2004-05-09 Miguel de Icaza <miguel@ximian.com>
18194 * expression.cs (Binary.DoNumericPromotions): 0 long constant can
18195 be implicitly converted to ulong.
18197 * expression.cs: The logic for allowing operator &, | and ^ worked
18198 was wrong, it worked before because we did not report an error in
18199 an else branch. Fixes 57895.
18201 * class.cs: Applied patch from iain@mccoy.id.au Iain McCoy to
18202 allow volatile fields to be reference types.
18204 2004-05-07 Miguel de Icaza <miguel@ximian.com>
18206 * driver.cs: Add support for /debug-
18208 2004-05-07 Raja R Harinath <rharinath@novell.com>
18210 * attribute.cs (Attribute.CheckAttributeType, Attribute.ResolveType):
18211 Add a 'complain' parameter to silence errors.
18212 (Attribute.Resolve): Update to changes. Put in sanity check to catch
18213 silently overlooked type-resolutions.
18214 (Attribute.ScanForIndexerName, Attribute.DefinePInvokeMethod): Update
18215 to reflect changes.
18216 (Attributes.Search): New function.
18217 (Attributes.Contains, Attributes.GetClsCompliantAttribute): Use Search.
18218 (Attributes.GetAttributeFullName): Remove hack.
18219 * class.cs (MethodCore.LabelParameters, MethodData.ApplyAttributes):
18220 Update to reflect changes.
18221 * codegen.cs (CommonAssemblyModulClass.GetClsCompliantAttribute):
18222 Use Attributes.Search instead of nested loops.
18224 2004-05-07 Marek Safar <marek.safar@seznam.cz>
18227 (MemberCore.Flags): Extended for caching presence of CLSCompliantAttribute.
18228 (MemberCore.VerifyClsCompliance): Implemented CS3019 error report.
18229 (DeclSpace.GetClsCompliantAttributeValue): Returns simple bool.
18231 * report.cs: (Report.Warning): Renamed to Warning_T because of
18232 parameter collision.
18234 2004-05-05 Raja R Harinath <rharinath@novell.com>
18236 * expression.cs (MemberAccess.ResolveMemberAccess):
18237 Exit with non-zero status after Report.Error.
18238 * rootcontext.cs (RootContext.BootstrapCorlib_ResolveDelegate):
18240 * typemanager.cs (TypeManager.CoreLookupType): Likewise.
18242 2004-05-04 Lluis Sanchez Gual <lluis@ximian.com>
18244 * support.cs: Don't hang when the file is empty.
18246 2004-05-04 Lluis Sanchez Gual <lluis@ximian.com>
18248 * support.cs: In SeekableStreamReader, compute the preamble size of the
18249 underlying stream. Position changes should take into account that initial
18252 2004-05-03 Todd Berman <tberman@sevenl.net>
18254 * driver.cs: remove unused GetSysVersion function.
18256 2004-05-03 Todd Berman <tberman@sevenl.net>
18258 * driver.cs: Remove the hack from saturday, as well as the hack
18259 from jackson (LoadAssemblyFromGac), also adds the CWD to the
18260 link_paths to get that bit proper.
18262 2004-05-01 Todd Berman <tberman@sevenl.net>
18264 * driver.cs: Try a LoadFrom before a Load, this checks the current
18265 path. This is currently a bug in mono that is be fixed, however, this
18266 provides a workaround for now. This will be removed when the bug
18269 2004-05-01 Sebastien Pouliot <sebastien@ximian.com>
18271 * CryptoConvert.cs: Updated to latest version. Fix issue with
18272 incomplete key pairs (#57941).
18274 2004-05-01 Todd Berman <tberman@sevenl.net>
18276 * driver.cs: Remove '.' from path_chars, now System.* loads properly
18279 2004-04-30 Jackson Harper <jackson@ximian.com>
18281 * codegen.cs: Open keys readonly.
18283 2004-04-30 Gonzalo Paniagua Javier <gonzalo@ximian.com>
18285 * typemanager.cs: don't report cyclic struct layout when a struct
18286 contains 2 or more fields of the same type. Failed for Pango.AttrShape
18287 which has 2 Pango.Rectangle fields.
18289 2004-04-29 Ben Maurer <bmaurer@users.sourceforge.net>
18291 * expression.cs: Handle IntPtr comparisons with IL code
18292 rather than a method call.
18294 2004-04-29 Martin Baulig <martin@ximian.com>
18296 * ecore.cs (PropertyExpr.FindAccessor): New private method. Walk
18297 the list of PropertyInfo's in class hierarchy and find the
18298 accessor. Fixes #56013.
18300 2004-04-29 Martin Baulig <martin@ximian.com>
18302 * typemanager.cs (TypeManager.CheckStructCycles): Fixed.
18304 2004-04-29 Martin Baulig <martin@ximian.com>
18306 Applying a patch from Benjamin Jemlich <pcgod@gmx.net>.
18308 * ecore.cs (FieldExpr.AddressOf): Make this work for valuetypes.
18310 2004-04-29 Martin Baulig <martin@ximian.com>
18312 * class.cs (ConstructorInitializer.Resolve): Check whether the
18313 parent .ctor is accessible. Fixes #52146.
18315 2004-04-29 Martin Baulig <martin@ximian.com>
18317 Applying a patch from Benjamin Jemlich <pcgod@gmx.net>.
18319 * statement.cs (Using.EmitLocalVariableDecls): Use
18320 TypeManager.idisposable_type, not typeof (IDisposable).
18321 (Foreach.EmitCollectionForeach): Added support for valuetypes.
18323 2004-04-29 Martin Baulig <martin@ximian.com>
18325 * class.cs (Event.Define): Don't emit the field and don't set
18326 RTSpecialName and SpecialName for events on interfaces. Fixes
18329 2004-04-29 Raja R Harinath <rharinath@novell.com>
18331 Refactor Attribute.ApplyAttributes.
18332 * attribute.cs (Attributable): New base class for objects that can
18333 have Attributes applied on them.
18334 (Attribute): Make AttributeUsage fields public.
18335 (Attribute.GetFieldValue, Attribute.GetMarshal): Make non-static.
18336 (Attribute.IsInternalCall): New property.
18337 (Attribute.UsageAttr): Convert to a public read-only property.
18338 (Attribute.CheckAttributeType): Use a DeclSpace, not an EmitContext.
18339 (Attribute.ResolveType, Attribute.Resolve)
18340 (Attribute.ScanForIndexerName): Update to reflect changes.
18341 (Attribute.CheckAttributeTarget): Re-format.
18342 (Attribute.ApplyAttributes): Refactor, to various
18343 Attributable.ApplyAttributeBuilder methods.
18344 * decl.cs (MemberCore): Make Attributable.
18345 * class.cs (Accessor): Make Attributable.
18346 (MethodData.ApplyAttributes): Use proper attribute types, not
18348 (TypeContainer.LabelParameters): Pass Parameter to ApplyAttributes.
18349 (TypeContainer.ApplyAttributeBuilder)
18350 (Method.ApplyAttributeBuilder, Constructor.ApplyAttributeBuilder)
18351 (Field.ApplyAttributeBuilder, Accessor.ApplyAttributeBuilder)
18352 (PropertyBase.ApplyAttributeBuilder, Event.ApplyAttributeBuilder)
18353 (Operator.ApplyAttributeBuilder): New factored-out methods.
18354 * const.cs (Const.ApplyAttributeBuilder): Likewise.
18355 * delegate.cs (Delegate.ApplyAttributeBuilder): Likewise.
18356 * enum.cs (Enum.ApplyAttributeBuilder): Likewise.
18357 * parameter.cs (ParameterBase): New Attributable base class
18358 that can also represent Return types.
18359 (Parameter): Update to the changes.
18361 2004-04-29 Jackson Harper <jackson@ximian.com>
18363 * driver.cs: Prefer the corlib system version when looking for
18364 assemblies in the GAC. This is still a hack, but its a better hack
18367 2004-04-29 Marek Safar <marek.safar@seznam.cz>
18369 * decl.cs, enum.cs: Improved error 3005 reporting.
18371 * report.cs (SymbolRelatedToPreviousError): New method for error reporting.
18372 (related_symbols): New private member for list of symbols
18373 related to reported error/warning.
18375 * tree.cs: Do not use now obsolete Report.LocationOfPreviousError.
18377 2004-04-29 Martin Baulig <martin@ximian.com>
18379 * ecore.cs (Expression.Constantify): If we're an enum and
18380 TypeManager.TypeToCoreType() doesn't give us another type, use
18381 t.UnderlyingSystemType. Fixes #56178.
18383 2004-04-29 Martin Baulig <martin@ximian.com>
18385 * decl.cs (MemberCache.SetupCacheForInterface): Look over all our
18386 interfaces and for each interface, only add members directly
18387 declared in that interface. Fixes #53255.
18389 2004-04-28 Martin Baulig <martin@ximian.com>
18391 * expression.cs (ConditionalLogicalOperator): Use a temporary
18392 variable for `left' to avoid that we evaluate it more than once;
18395 2004-04-28 Martin Baulig <martin@ximian.com>
18397 * expression.cs (ComposedCast.DoResolveAsTypeStep): Don't allow
18400 2004-04-28 Martin Baulig <martin@ximian.com>
18402 * statement.cs (LocalInfo.Resolve): Check whether the type is not
18405 * class.cs (MemberBase.CheckParameters, FieldBase.DoDefine): Check
18406 whether the type is not void (CS1547).
18408 2004-04-28 Martin Baulig <martin@ximian.com>
18410 * expression.cs (Unary.DoResolveLValue): Override this and report
18411 CS0131 for anything but Operator.Indirection.
18413 2004-04-28 Martin Baulig <martin@ximian.com>
18415 Committing a patch from Ben Maurer; see bug #50820.
18417 * typemanager.cs (TypeManager.FilterWithClosure): Added CS1540
18420 * ecore.cs (Expression.MemberLookupFailed): Added CS1540 check for
18423 2004-04-28 Martin Baulig <martin@ximian.com>
18425 Committing a patch from Ben Maurer; see bug #50820.
18427 * typemanager.cs (TypeManager.FilterWithClosure): Added CS1540
18430 * ecore.cs (Expression.MemberLookupFailed): Added CS1540 check for
18433 2004-04-28 Martin Baulig <martin@ximian.com>
18435 * statement.cs (Block.LookupLabel): Also lookup in implicit child blocks.
18436 (Block.AddLabel): Call DoLookupLabel() to only search in the
18439 2004-04-28 Martin Baulig <martin@ximian.com>
18441 * cfold.cs (ConstantFold.BinaryFold): Added special support for
18442 comparing StringConstants and NullLiterals in Equality and Inequality.
18444 2004-04-28 Jackson Harper <jackson@ximian.com>
18446 * driver.cs: Attempt to load referenced assemblies from the
18447 GAC. This is the quick and dirty version of this method that
18448 doesnt take into account versions and just takes the first
18449 canidate found. Will be good enough for now as we will not have more
18450 then one version installed into the GAC until I update this method.
18452 2004-04-28 Martin Baulig <martin@ximian.com>
18454 * typemanager.cs (TypeManager.CheckStructCycles): New public
18455 static method to check for cycles in the struct layout.
18457 * rootcontext.cs (RootContext.PopulateTypes): Call
18458 TypeManager.CheckStructCycles() for each TypeContainer.
18459 [Note: We only need to visit each type once.]
18461 2004-04-28 Martin Baulig <martin@ximian.com>
18463 * constant.cs (StringConstant.Emit): Emit Ldnull if we're null.
18465 * const.cs (Const.LookupConstantValue): Return a `bool' signalling
18466 success and added `out object value'. Use a `bool resolved' field
18467 to check whether we've already been called rather than
18468 `ConstantValue != null' since this breaks for NullLiterals.
18470 2004-04-28 Raja R Harinath <rharinath@novell.com>
18472 * driver.cs (Driver.MainDriver) [IsModuleOnly]: Open code the
18473 setting of this flag, since the 'set' method may be non-public.
18475 2004-04-28 Raja R Harinath <rharinath@novell.com>
18477 * flowanalysis.cs (FlowBranchingException.LookupLabel): Add a null
18478 check on current_vector.Block.
18480 2004-04-27 Martin Baulig <martin@ximian.com>
18482 * expression.cs (BaseAccess.CommonResolve): Don't allow `base' in
18483 a field initializer. Fixes #56459.
18485 2004-04-27 Martin Baulig <martin@ximian.com>
18487 * ecore.cs (PropertyExpr.DoResolve/DoResolveLValue): Check whether
18488 we're not attempting to use an indexer. Fixes #52154.
18490 2004-04-27 Martin Baulig <martin@ximian.com>
18492 * statement.cs (Return): Don't create a return label if we don't
18493 need it; reverts my change from January 20th. Thanks to Ben
18496 2004-04-27 Martin Baulig <martin@ximian.com>
18498 According to the spec, `goto' can only leave a nested scope, but
18501 * statement.cs (Block.LookupLabel): Only lookup in the current
18502 block, don't recurse into parent or child blocks.
18503 (Block.AddLabel): Check in parent and child blocks, report
18504 CS0140/CS0158 if we find a duplicate.
18505 (Block): Removed this indexer for label lookups.
18506 (Goto.Resolve): Call LookupLabel() on our current FlowBranching;
18507 this already does the error reporting for us.
18510 (FlowBranching.UsageVector.Block): New public variable; may be null.
18511 (FlowBranching.CreateSibling): Added `Block' argument.
18512 (FlowBranching.LookupLabel): New public virtual method. Lookup a
18513 label for the target of a `goto' and check whether we're not
18514 leaving a `finally'.
18516 2004-04-27 Martin Baulig <martin@ximian.com>
18518 * flowanalysis.cs (FlowBranching.UsageVector.MergeChild): If we're
18519 a finite loop block, also do the ALWAYS->SOMETIMES for throws (not
18522 2004-04-27 Martin Baulig <martin@ximian.com>
18524 * statement.cs (Block.AddLabel): Also check for implicit blocks
18525 and added a CS0158 check.
18527 2004-04-27 Martin Baulig <martin@ximian.com>
18529 * flowanalysis.cs (FlowBranchingLoop): New class.
18530 (FlowBranching.UsageVector.MergeJumpOrigins): Take a list of
18531 UsageVector's instead of an ArrayList.
18532 (FlowBranching.Label): Likewise.
18533 (FlowBranching.UsageVector.MergeBreakOrigins): New method.
18534 (FlowBranching.AddBreakVector): New method.
18536 2004-04-27 Miguel de Icaza <miguel@ximian.com>
18538 * attribute.cs: Small regression fix: only convert the type if we
18539 the type is different, fixes System.Drawing build.
18541 2004-04-27 Martin Baulig <martin@ximian.com>
18543 * attribute.cs (Attribute.Resolve): If we have a constant value
18544 for a named field or property, implicity convert it to the correct
18547 2004-04-27 Raja R Harinath <rharinath@novell.com>
18549 * statement.cs (Block.Block): Implicit blocks share
18550 'child_variable_names' fields with parent blocks.
18551 (Block.AddChildVariableNames): Remove.
18552 (Block.AddVariable): Mark variable as "used by a child block" in
18553 every surrounding block.
18554 * ecore.cs (SimpleName.SimpleNameResolve): If the name has already
18555 been used in a child block, complain about violation of "Invariant
18556 meaning in blocks" rule.
18557 * cs-parser.jay (declare_local_variables): Don't use
18558 AddChildVariableNames.
18559 (foreach_statement): Don't create an implicit block: 'foreach'
18560 introduces a scope.
18562 2004-04-23 Miguel de Icaza <miguel@ximian.com>
18564 * convert.cs (ImplicitNumericConversion): 0 is also positive when
18565 converting from 0L to ulong. Fixes 57522.
18567 2004-04-22 Marek Safar <marek.safar@seznam.cz>
18569 * decl.cs (FindMemberToOverride): Fix wrong warning for case when
18570 derived class hides via 'new' keyword field from base class (test-242.cs).
18571 TODO: Handle this in the more general way.
18573 * class.cs (CheckBase): Ditto.
18575 2004-04-22 Marek Safar <marek.safar@seznam.cz>
18577 * decl.cs (caching_flags): New member for storing cached values
18579 (MemberCore.Flags): New enum where bit flags for caching_flags
18581 (MemberCore.cls_compliance): Moved to caching_flags.
18582 (DeclSpace.Created): Moved to caching_flags.
18584 * class.cs: Use caching_flags instead of DeclSpace.Created
18586 2004-04-21 Miguel de Icaza <miguel@ximian.com>
18588 * ecore.cs (PropertyExpr.GetAccesor): Only perform the 1540 check
18589 if we are only a derived class, not a nested class.
18591 * typemanager.cs: Same as above, but do this at the MemberLookup
18592 level (used by field and methods, properties are handled in
18593 PropertyExpr). Allow for the qualified access if we are a nested
18596 2004-04-21 Marek Safar <marek.safar@seznam.cz>
18598 * class.cs: Refactoring.
18599 (IMethodData): New inteface; Holds links to parent members
18600 to avoid member duplication (reduced memory allocation).
18601 (Method): Implemented IMethodData interface.
18602 (PropertyBase): New inner classes for get/set methods.
18603 (PropertyBase.PropertyMethod): Implemented IMethodData interface
18604 (Event): New inner classes for add/remove methods.
18605 (Event.DelegateMethod): Implemented IMethodData interface.
18607 * cs-parser.jay: Pass DeclSpace to Event class for creation of valid
18608 EmitContext (related to class.cs refactoring).
18610 2004-04-21 Raja R Harinath <rharinath@novell.com>
18612 * delegate.cs (Delegate.VerifyApplicability): If the number of
18613 arguments are the same as the number of parameters, first try to
18614 verify applicability ignoring any 'params' modifier on the last
18618 2004-04-16 Raja R Harinath <rharinath@novell.com>
18620 * class.cs (TypeContainer.AddIndexer): Use
18621 'ExplicitInterfaceName' to determine if interface name was
18622 explicitly specified. 'InterfaceType' is not initialized at this time.
18623 (TypeContainer.DefineIndexers): Remove use of temporary list. The
18624 Indexers array is already in the required order. Initialize
18625 'IndexerName' only if there are normal indexers.
18626 (TypeContainer.DoDefineMembers): Don't initialize IndexerName.
18627 (TypeContainer.Emit): Emit DefaultMember attribute only if
18628 IndexerName is initialized.
18631 2004-04-15 Benjamin Jemlich <pcgod@gmx.net>
18633 * enum.cs (Enum.DefineType): Don't allow char as type for enum.
18636 2004-04-15 Raja R Harinath <rharinath@novell.com>
18638 * attribute.cs (Attribute.CheckAttributeType): Check for ambiguous
18642 * attribute.cs (Attribute.Resolve): Check for duplicate named
18646 2004-04-15 Miguel de Icaza <miguel@ximian.com>
18648 * iterators.cs (MarkYield): track whether we are in an exception,
18649 and generate code accordingly. Use a temporary value to store the
18650 result for our state.
18652 I had ignored a bit the interaction of try/catch with iterators
18653 since their behavior was not entirely obvious, but now it is
18654 possible to verify that our behavior is the same as MS .NET 2.0
18658 2004-04-14 Miguel de Icaza <miguel@ximian.com>
18660 * iterators.cs: Avoid creating temporaries if there is no work to
18663 * expression.cs (ArrayAccess.EmitLoadOpcode): If dealing with
18664 Enumerations, use TypeManager.EnumToUnderlying and call
18667 Based on the patch from Benjamin Jemlich (pcgod@gmx.net), fixes
18670 (This.Emit): Use EmitContext.EmitThis to emit our
18673 (This.EmitAssign): Ditto.
18675 * ecore.cs (FieldExpr.Emit): Remove RemapToProxy special
18676 codepaths, we will move all the functionality into
18679 (FieldExpr.EmitAssign): Ditto.
18681 This fixes several hidden bugs that I uncovered while doing a code
18682 review of this today.
18684 * codegen.cs (EmitThis): reworked so the semantics are more clear
18685 and also support value types "this" instances.
18687 * iterators.cs: Changed so that for iterators in value types, we
18688 do not pass the value type as a parameter.
18690 Initialization of the enumerator helpers is now done in the caller
18691 instead of passing the parameters to the constructors and having
18692 the constructor set the fields.
18694 The fields have now `assembly' visibility instead of private.
18696 2004-04-11 Miguel de Icaza <miguel@ximian.com>
18698 * expression.cs (Argument.Resolve): Check if fields passed as ref
18699 or out are contained in a MarshalByRefObject.
18701 * typemanager.cs, rootcontext.cs: Add System.Marshalbyrefobject as
18702 another compiler type.
18704 2004-04-06 Ben Maurer <bmaurer@users.sourceforge.net>
18706 * class.cs (Indexer.Define): use the new name checking method.
18707 Also, return false on an error.
18708 * cs-tokenizer.cs (IsValidIdentifier): Checks for a valid identifier.
18709 (is_identifier_[start/part]_character): make static.
18711 2004-04-10 Miguel de Icaza <miguel@ximian.com>
18713 * expression.cs (Binary.ResolveOperator): Do no append strings
18714 twice: since we can be invoked more than once (array evaluation)
18715 on the same concatenation, take care of this here. Based on a fix
18716 from Ben (bug #56454)
18718 2004-04-08 Sebastien Pouliot <sebastien@ximian.com>
18720 * codegen.cs: Fix another case where CS1548 must be reported (when
18721 delay-sign isn't specified and no private is available #56564). Fix
18722 loading the ECMA "key" to delay-sign an assembly. Report a CS1548
18723 error when MCS is used on the MS runtime and we need to delay-sign
18724 (which seems unsupported by AssemblyBuilder - see #56621).
18726 2004-04-08 Marek Safar <marek.safar@seznam.cz>
18728 * typemanager.cs (TypeManager.TypeToCoreType): Handle IntPtr too.
18729 (TypeManager.ComputeNamespaces): Faster implementation for
18732 * compiler.csproj: Updated AssemblyName to mcs.
18734 2004-04-07 Miguel de Icaza <miguel@ximian.com>
18736 * rootcontext.cs: Add new types to the boot resolution.
18738 * ecore.cs (TypeExpr.CanInheritFrom): Inheriting from
18739 MulticastDelegate is not allowed.
18741 * typemanager.cs: Add new types to lookup: System.TypedReference
18744 * paramter.cs (Parameter.Resolve): if we are an out/ref parameter,
18745 check for TypedReference or ArgIterator, they are not allowed.
18747 * ecore.cs (BoxedCast): Set the eclass to ExprClass.Value, this
18748 makes us properly catch 1510 in some conditions (see bug 56016 for
18751 2004-04-06 Bernie Solomon <bernard@ugsolutions.com>
18753 * CryptoConvert.cs: update from corlib version
18756 2004-04-05 Miguel de Icaza <miguel@ximian.com>
18758 * class.cs (Indexer.Define): Check indexername declaration
18760 2004-04-05 Marek Safar <marek.safar@seznam.cz>
18762 * attribute.cs (IsClsCompliant): Fixed problem with handling
18763 all three states (compliant, not-compliant, undetected).
18765 2004-03-30 Marek Safar <marek.safar@seznam.cz>
18767 * attribute.cs (Attribute): Location is now public.
18768 (Resolve): Store resolved arguments (pos_values) in attribute class.
18769 Attribute extractors (now GetClsCompliantAttributeValue) can reuse them.
18770 (GetClsCompliantAttributeValue): New method that gets
18771 CLSCompliantAttribute value.
18772 (GetClsCompliantAttribute): Returns CLSCompliantAttribute for DeclSpace
18773 if exists else null.
18774 (AttributeTester): New class for CLS-Compliant verification routines.
18776 * class.cs (Emit): Add CLS-Compliant verification.
18777 (Method.GetSignatureForError): Implemented.
18778 (Constructor.GetSignatureForError): Implemented
18779 (Constructor.HasCompliantArgs): Returns if constructor has
18780 CLS-Compliant arguments.
18781 (Constructor.Emit): Override.
18782 (Construcor.IsIdentifierClsCompliant): New method; For constructors
18783 is needed to test only parameters.
18784 (FieldBase.GetSignatureForError): Implemented.
18785 (TypeContainer): New member for storing base interfaces.
18786 (TypeContainer.FindMembers): Search in base interfaces too.
18788 * codegen.cs (GetClsComplianceAttribute): New method that gets
18789 assembly or module CLSCompliantAttribute value.
18790 (ResolveClsCompliance): New method that resolve CLSCompliantAttribute
18792 (ModuleClass.Emit): Add error 3012 test.
18794 * const.cs (Emit): Override and call base for CLS-Compliant tests.
18796 * decl.cs (ClsComplianceValue): New enum that holds CLS-Compliant
18797 state for all decl types.
18798 (MemberCore.Emit): Emit is now virtual and call VerifyClsCompliance
18799 if CLS-Compliant tests are required.
18800 (IsClsCompliaceRequired): New method. Analyze whether code
18801 must be CLS-Compliant.
18802 (IsExposedFromAssembly): New method. Returns true when MemberCore
18803 is exposed from assembly.
18804 (GetClsCompliantAttributeValue): New method. Resolve CLSCompliantAttribute
18805 value or gets cached value.
18806 (HasClsCompliantAttribute): New method. Returns true if MemberCore
18807 is explicitly marked with CLSCompliantAttribute.
18808 (IsIdentifierClsCompliant): New abstract method. This method is
18809 used to testing error 3005.
18810 (IsIdentifierAndParamClsCompliant): New method. Common helper method
18811 for identifier and parameters CLS-Compliant testing.
18812 (VerifyClsCompliance): New method. The main virtual method for
18813 CLS-Compliant verifications.
18814 (CheckAccessLevel): In one special case (System.Drawing) was TypeBuilder
18815 null. I don't know why is null (too many public members !).
18816 (GetClsCompliantAttributeValue). New method. Goes through class hierarchy
18817 and get value of first CLSCompliantAttribute that found.
18819 * delegate.cs (Emit): Override and call base for CLS-Compliant tests.
18820 (VerifyClsCompliance): Override and add extra tests.
18822 * driver.cs (CSCParseOption): New command line options (clscheck[+|-]).
18823 clscheck- disable CLS-Compliant verification event if assembly is has
18824 CLSCompliantAttribute(true).
18826 * enum.cs (Emit): Override and call base for CLS-Compliant tests.
18827 ApllyAttribute is now called in emit section as in the other cases.
18828 Possible future Emit integration.
18829 (IsIdentifierClsCompliant): New override.
18830 (VerifyClsCompliance): New override.
18831 (GetEnumeratorName): Returns full enum name.
18833 * parameter.cs (GetSignatureForError): Implemented.
18835 * report.cs (WarningData): New struct for Warning message information.
18836 (LocationOfPreviousError): New method.
18837 (Warning): New method. Reports warning based on the warning table.
18838 (Error_T): New method. Reports error based on the error table.
18840 * rootcontext.cs (EmitCode): Added new Emit(s) because CLS-Compliant
18841 verifications are done here.
18843 * tree.cs (RecordDecl): Used new LocationOfPreviousError method.
18845 * typemanager.cs (cls_compliant_attribute_type): New member thath holds
18846 CLSCompliantAttribute.
18847 (all_imported_types): New member holds all imported types from other
18849 (LoadAllImportedTypes): New method fills static table with exported types
18850 from all referenced assemblies.
18851 (Modules): New property returns all assembly modules.
18853 2004-03-30 Miguel de Icaza <miguel@ximian.com>
18855 * cs-parser.jay: Add a rule to catch wrong event syntax instead of
18856 throwing a parser error.
18858 * ecore.cs (PropertyExpr.GetAccessor): Apply patch from Patrik Reali
18859 which removes the hardcoded get_/set_ prefixes for properties, as
18860 IL allows for the properties to be named something else.
18864 * expression.cs: Do not override operand before we know if it is
18865 non-null. Fix 56207
18867 2004-03-29 Ben Maurer <bmaurer@users.sourceforge.net>
18869 * typemanager.cs: support for pinned variables.
18871 2004-03-29 Ben Maurer <bmaurer@users.sourceforge.net>
18873 * decl.cs, typemanager.cs: Avoid using an arraylist
18874 as a buffer if there is only one result set.
18876 2004-03-29 Ben Maurer <bmaurer@users.sourceforge.net>
18878 * expression.cs: Make sure you cant call a static method
18879 with an instance expression, bug #56174.
18881 2004-03-29 Miguel de Icaza <miguel@ximian.com>
18883 * class.cs (IsDuplicateImplementation): Improve error reporting to
18884 flag 663 (method only differs in parameter modifier).
18886 * cs-tokenizer.cs: Do not require whitespace when a ( or " will do
18887 in preprocessor directives.
18889 * location.cs (LookupFile): Allow for the empty path.
18891 * attribute.cs (DefinePInvokeMethod): Fix 56148; I would like a
18892 better approach for some of that patch, but its failing with the
18893 CharSet enumeration. For now try/catch will do.
18895 * typemanager.cs: Do not crash if a struct does not have fields.
18898 2004-03-28 Ben Maurer <bmaurer@users.sourceforge.net>
18900 * expression.cs: cs0213, cant fix a fixed expression.
18903 2004-03-28 Ben Maurer <bmaurer@users.sourceforge.net>
18905 * cs-parser.jay: detect invalid embeded statements gracefully.
18908 2004-03-28 Ben Maurer <bmaurer@users.sourceforge.net>
18910 * ecore.cs, typemanager.cs: Correct impl of cs1540 check.
18913 the invocation type may not be a subclass of the tye of the item/
18914 The type of the item must be a subclass of the invocation item.
18919 2004-03-25 Sebastien Pouliot <sebastien@ximian.com>
18921 * attribute.cs: Added methods to get a string and a bool from an
18922 attribute. Required to information from AssemblyKeyFileAttribute,
18923 AttributeKeyNameAttribute (string) and AssemblyDelaySign (bool).
18924 * codegen.cs: Modified AssemblyName creation to include support for
18925 strongnames. Catch additional exceptions to report them as CS1548.
18926 * compiler.csproj: Updated include CryptoConvert.cs.
18927 * compiler.csproj.user: Removed file - user specific configuration.
18928 * CryptoConvert.cs: New. A COPY of the class CryptoConvert from
18929 Mono.Security assembly. The original class is maintained and tested in
18930 /mcs/class/Mono.Security/Mono.Security.Cryptography/CryptoConvert.cs.
18931 * drivers.cs: Added support for /keyfile, /keycontainer and /delaysign
18932 like CSC 8.0 (C# v2) supports.
18933 * Makefile: Added CryptoConvert.cs to mcs sources.
18934 * rootcontext.cs: Added new options for strongnames.
18936 2004-03-24 Ben Maurer <bmaurer@users.sourceforge.net>
18938 * driver.cs: For --expect-error, report error code `2'
18939 if the program compiled with no errors, error code `1' if
18940 it compiled with an error other than the one expected.
18942 2004-03-24 Sebastien Pouliot <sebastien@ximian.com>
18944 * compiler.csproj: Updated for Visual Studio .NET 2003.
18945 * compiler.csproj.user: Updated for Visual Studio .NET 2003.
18946 * compiler.sln: Updated for Visual Studio .NET 2003.
18948 2004-03-24 Ravi Pratap M <ravi@ximian.com>
18950 * expression.cs: Fix bug #47234. We basically need to apply the
18951 rule that we prefer the conversion of null to a reference type
18952 when faced with a conversion to 'object' (csc behaviour).
18954 2004-03-23 Ben Maurer <bmaurer@users.sourceforge.net>
18956 * statement.cs: Shorter form for foreach, eliminates
18957 a local variable. r=Martin.
18959 2004-03-23 Ben Maurer <bmaurer@users.sourceforge.net>
18961 * constant.cs, ecore.cs, literal.cs: New prop IsZeroInteger that
18962 checks if we can use brtrue/brfalse to test for 0.
18963 * expression.cs: use the above in the test for using brtrue/brfalse.
18964 cleanup code a bit.
18966 2004-03-23 Ben Maurer <bmaurer@users.sourceforge.net>
18968 * expression.cs: Rewrite string concat stuff. Benefits:
18970 - "a" + foo + "b" + "c" becomes "a" + foo + "bc"
18971 - "a" + foo + "b" + bar + "c" + baz ... uses concat (string []).
18972 rather than a concat chain.
18974 * typemanager.cs: Add lookups for more concat overloads.
18976 2004-03-23 Ben Maurer <bmaurer@users.sourceforge.net>
18978 * expression.cs: Emit shorter il code for array init.
18995 2004-03-22 Ben Maurer <bmaurer@users.sourceforge.net>
18997 * statement.cs: Before, two switch blocks would be merged if the
18998 total size of the blocks (end_item - begin_item + 1) was less than
18999 two times the combined sizes of the blocks.
19001 Now, it will only merge if after the merge at least half of the
19006 2004-03-20 Atsushi Enomoto <atsushi@ximian.com>
19008 * class.cs : csc build fix for GetMethods(). See bug #52503.
19010 2004-03-20 Ben Maurer <bmaurer@users.sourceforge.net>
19012 * expression.cs: Make sure fp comparisons work with NaN.
19013 This fixes bug #54303. Mig approved this patch a long
19014 time ago, but we were not able to test b/c the runtime
19017 2004-03-19 Miguel de Icaza <miguel@ximian.com>
19019 * ecore.cs (TypExpr.GetHashCode): implement this overload.
19021 2004-03-19 Martin Baulig <martin@ximian.com>
19023 * class.cs (MemberCore.IsDuplicateImplementation): Report the
19024 error here and not in our caller.
19026 2004-03-19 Martin Baulig <martin@ximian.com>
19028 * interface.cs: Completely killed this file.
19029 (Interface): We're now a TypeContainer and live in class.cs.
19031 * class.cs (TypeContainer.GetClassBases): Added `bool is_iface'
19032 argument; we're now also called for interfaces.
19033 (TypeContainer.DefineMembers): Allow this method being called
19035 (TypeContainer.GetMethods): New public method; formerly known as
19036 Interface.GetMethod(). This is used by PendingImplementation.
19037 (TypeContainer.EmitDefaultMemberAttr): Moved here from Interface;
19038 it's now private and non-static.
19039 (Interface): Moved this here; it's now implemented similar to
19041 (Method, Property, Event, Indexer): Added `bool is_interface'
19042 argument to their .ctor's.
19043 (MemberBase.IsInterface): New public field.
19045 * cs-parser.jay: Create normal Method, Property, Event, Indexer
19046 instances instead of InterfaceMethod, InterfaceProperty, etc.
19047 (opt_interface_base): Removed; we now use `opt_class_base' instead.
19048 (InterfaceAccessorInfo): Create `Get' and `Set' Accessor's.
19050 2004-03-19 Martin Baulig <martin@ximian.com>
19052 * class.cs (MethodCore.IsDuplicateImplementation): New private
19053 method which does the CS0111 checking.
19054 (Method.CheckBase, Constructor.CheckBase, PropertyBase.CheckBase):
19055 Use IsDuplicateImplementation().
19057 2004-03-17 Ben Maurer <bmaurer@users.sourceforge.net>
19059 * decl.cs (FindMemberToOverride): New method to find the correct
19060 method or property to override in the base class.
19062 - Make Method/Property use the above method to find the
19063 version in the base class.
19064 - Remove the InheritableMemberSignatureCompare as it is now
19067 This patch makes large code bases much faster to compile, as it is
19068 O(n) rather than O(n^2) to do this validation.
19070 Also, it fixes bug 52458 which is that nested classes are not
19071 taken into account when finding the base class member.
19073 Reviewed/Approved by Martin.
19075 2004-03-17 Marek Safar <marek.safar@seznam.cz>
19077 * interface.cs: In all interface classes removed redundant
19078 member initialization.
19080 2004-03-16 Martin Baulig <martin@ximian.com>
19082 * class.cs (TypeContainer.GetClassBases): Fix the CS0528 check.
19084 2004-03-15 Miguel de Icaza <miguel@ximian.com>
19086 * decl.cs (DefineTypeAndParents): New helper method to define a
19087 type's containers before the type itself is defined; This is a
19088 bug exposed by the recent changes to Windows.Forms when an
19089 implemented interface was defined inside a class that had not been
19092 * modifiers.cs (MethodAttr): All methods in C# are HideBySig.
19094 (Check): Loop correctly to report errors modifiers
19095 (UNSAFE was not in the loop, since it was the same as TOP).
19097 * interface.cs: Every interface member now takes a ModFlags,
19098 instead of a "is_new" bool, which we set on the base MemberCore.
19100 Every place where we called "UnsafeOk" in the interface, now we
19101 call the proper member (InterfaceMethod.UnsafeOK) instead to get
19102 the unsafe settings from the member declaration instead of the
19103 container interface.
19105 * cs-parser.jay (opt_new): Allow unsafe here per the spec.
19107 * pending.cs (TypeAndMethods): Add `get_indexer_name' and
19108 `set_indexer_name' to the pending bits (one per type).
19110 We fixed a bug today that was picking the wrong method to
19111 override, since for properties the existing InterfaceMethod code
19112 basically ignored the method name. Now we make sure that the
19113 method name is one of the valid indexer names.
19115 2004-03-14 Gustavo Giráldez <gustavo.giraldez@gmx.net>
19117 * support.cs (SeekableStreamReader): Keep track of stream byte
19118 positions and don't mix them with character offsets to the buffer.
19120 Patch from Gustavo Giráldez
19122 2004-03-15 Marek Safar <marek.safar@seznam.cz>
19124 * interface.cs (InterfaceSetGetBase): Removed double member
19125 initialization, base class does it as well.
19127 2004-03-13 Martin Baulig <martin@ximian.com>
19129 * class.cs: Reverted Miguel's latest commit; it makes mcs crash
19130 when compiling corlib.
19132 2004-03-13 Miguel de Icaza <miguel@ximian.com>
19134 * convert.cs (ExplicitConversion): We were reporting an error on
19135 certain conversions (object_type source to a value type, when the
19136 expression was `null') before we had a chance to pass it through
19137 the user defined conversions.
19139 * driver.cs: Replace / and \ in resource specifications to dots.
19142 * class.cs: Add check for duplicate operators. Fixes 52477
19144 2004-03-11 Miguel de Icaza <miguel@ximian.com>
19146 * statement.cs (Switch.SimpleSwitchEmit): Deal with default labels
19147 that are in the middle of the statements, not only at the end.
19150 * class.cs (TypeContainer.AddField): No longer set the
19151 `HaveStaticConstructor' flag, now we call it
19152 `UserDefineStaticConstructor' to diferentiate the slightly
19153 semantic difference.
19155 The situation is that we were not adding BeforeFieldInit (from
19156 Modifiers.TypeAttr) to classes that could have it.
19157 BeforeFieldInit should be set to classes that have no static
19162 http://www.yoda.arachsys.com/csharp/beforefieldinit.html
19164 And most importantly Zoltan's comment:
19166 http://bugzilla.ximian.com/show_bug.cgi?id=44229
19168 "I think beforefieldinit means 'it's ok to initialize the type sometime
19169 before its static fields are used', i.e. initialization does not need
19170 to be triggered by the first access to the type. Setting this flag
19171 helps the JIT to compile better code, since it can run the static
19172 constructor at JIT time, and does not need to generate code to call it
19173 (possibly lots of times) at runtime. Unfortunately, mcs does not set
19174 this flag for lots of classes like String.
19176 csc sets this flag if the type does not have an explicit static
19177 constructor. The reasoning seems to be that if there are only static
19178 initalizers for a type, and no static constructor, then the programmer
19179 does not care when this initialization happens, so beforefieldinit
19182 This bug prevents the AOT compiler from being usable, since it
19183 generates so many calls to mono_runtime_class_init that the AOT code
19184 is much slower than the JITted code. The JITted code is faster,
19185 because it does not generate these calls if the vtable is type is
19186 already initialized, which is true in the majority of cases. But the
19187 AOT compiler can't do this."
19189 2004-03-10 Miguel de Icaza <miguel@ximian.com>
19191 * class.cs (MethodData.Emit): Refactor the code so symbolic
19192 information is generated for destructors; For some reasons we
19193 were taking a code path that did not generate symbolic information
19196 2004-03-11 Ben Maurer <bmaurer@users.sourceforge.net>
19198 * class.cs: Create a Constructor.CheckBase method that
19199 takes care of all validation type code. The method
19200 contains some code that was moved from Define.
19202 It also includes new code that checks for duplicate ctors.
19203 This fixes bug #55148.
19205 2004-03-09 Joshua Tauberer <tauberer@for.net>
19207 * expression.cs (ArrayCreation): Fix: More than 6 nulls in
19208 a { ... }-style array creation invokes EmitStaticInitializers
19209 which is not good for reference-type arrays. String, decimal
19210 and now null constants (NullCast) are not counted toward
19211 static initializers.
19213 2004-03-05 Martin Baulig <martin@ximian.com>
19215 * location.cs (SourceFile.HasLineDirective): New public field;
19216 specifies whether the file contains or is referenced by a "#line"
19218 (Location.DefineSymbolDocuments): Ignore source files which
19219 either contain or are referenced by a "#line" directive.
19221 2004-02-29 Ben Maurer <bmaurer@users.sourceforge.net>
19223 * class.cs (Method.CheckBase): Avoid using FindMembers, we have
19224 direct access to our parent, so check the method inline there.
19226 2004-02-27 Ben Maurer <bmaurer@users.sourceforge.net>
19228 * expression.cs (Invocation.EmitCall): Miguel's last commit
19229 caused a regression. If you had:
19234 In Foo the implict this would be null.
19236 2004-02-27 Miguel de Icaza <miguel@ximian.com>
19238 * expression.cs (Invocation.EmitCall): If the method is not
19239 virtual, do not emit a CallVirt to it, use Call.
19241 * typemanager.cs (GetFullNameSignature): Improve the method to
19242 cope with ".ctor" and replace it with the type name.
19244 * class.cs (ConstructorInitializer.Resolve): Now the method takes
19245 as an argument the ConstructorBuilder where it is being defined,
19246 to catch the recursive constructor invocations.
19248 2004-02-26 Miguel de Icaza <miguel@ximian.com>
19250 * iterators.cs (IteratorHandler.IsIEnumerator, IsIEnumerable): New
19251 routines to check if a type is an enumerable/enumerator allow
19252 classes that implement the IEnumerable or IEnumerator interfaces.
19254 * class.cs (Property, Operator): Implement IIteratorContainer, and
19255 implement SetYields.
19257 (Property.Define): Do the block swapping for get_methods in the
19258 context of iterators. We need to check if Properties also
19259 include indexers or not.
19261 (Operator): Assign the Block before invoking the
19262 OperatorMethod.Define, so we can trigger the Iterator code
19265 * cs-parser.jay (SimpleIteratorContainer): new helper class. Both
19266 Property and Operator classes are not created when we parse the
19267 declarator but until we have the block completed, so we use a
19268 singleton SimpleIteratorContainer.Simple to flag whether the
19269 SetYields has been invoked.
19271 We propagate this setting then to the Property or the Operator to
19272 allow the `yield' to function.
19274 2004-02-25 Marek Safar <marek.safar@seznam.cz>
19276 * codegen.cs: Implemented attribute support for modules.
19277 New AssemblyClass, ModuleClass and CommonAssemblyModulClass for
19278 Assembly/Module functionality.
19280 * attribute.cs, class.cs, cs-parser.jay, delegate.cs, driver.cs, enum.cs
19281 interface.cs, rootcontext.cs, statement.cs, typemanager.cs:
19282 Updated dependencies on CodeGen.ModuleBuilder and CodeGen.AssemblyBuilder.
19284 2004-02-16 Marek Safar <marek.safar@seznam.cz>
19286 * interface.cs (FindMembers): The operation is performed on all base
19287 interfaces and not only on the first. It is required for future CLS Compliance patch.
19289 2004-02-12 Ben Maurer <bmaurer@users.sourceforge.net>
19291 * statement.cs, codegen.cs:
19292 This patch deals with patterns such as:
19294 public class List : IEnumerable {
19296 public MyEnumerator GetEnumerator () {
19297 return new MyEnumerator(this);
19300 IEnumerator IEnumerable.GetEnumerator () {
19304 public struct MyEnumerator : IEnumerator {
19309 Before, there were a few things we did wrong:
19310 1) we would emit callvirt on a struct, which is illegal
19311 2) we emited ldarg when we needed to emit ldarga
19312 3) we would mistakenly call the interface methods on an enumerator
19313 type that derived from IEnumerator and was in another assembly. For example:
19315 public class MyEnumerator : IEnumerator
19317 Would have the interface methods called, even if there were public impls of the
19318 method. In a struct, this lead to invalid IL code.
19320 2004-02-11 Marek Safar <marek.safar@seznam.cz>
19322 * const.cs: Const is now derived from FieldBase. Method EmitConstant name
19325 * delegate.cs (Define): Fixed crash when delegate type is undefined.
19327 2004-02-11 Miguel de Icaza <miguel@ximian.com>
19329 * cs-parser.jay: Fix small regression: we were not testing V2
19330 compiler features correctly.
19332 * interface.cs: If the emit context is null, then create one
19334 2004-02-09 Marek Safar <marek.safar@seznam.cz>
19336 * decl.cs (GetSignatureForError): New virtual method to get full name
19337 for error messages.
19339 * attribute.cs (IAttributeSupport): New interface for attribute setting.
19340 Now it is possible to rewrite ApplyAttributes method to be less if/else.
19342 * interface.cs : All InterfaceXXX classes are now derived from MemberCore.
19343 Duplicated members and code in these classes has been removed.
19344 Better encapsulation in these classes.
19346 2004-02-07 Miguel de Icaza <miguel@ximian.com>
19348 * assign.cs (Assign.DoResolve): When dealing with compound
19349 assignments, there is a new rule in ECMA C# 2.4 (might have been
19350 there before, but it is documented here) that states that in:
19354 If b is of type int, and the `op' is a shift-operator, then the
19355 above is evaluated as:
19359 * expression.cs (Binary.ResolveOperator): Instead of testing for
19360 int/uint/long/ulong, try to implicitly convert to any of those
19361 types and use that in pointer arithmetic.
19363 * delegate.cs (Error_NoMatchingMethodForDelegate): Compute the
19364 method to print information for from the type, not from the
19365 null-method we were given.
19367 2004-02-01 Duncan Mak <duncan@ximian.com>
19369 * cs-tokenizer.cs (get_cmd_arg): Skip over whitespace before
19370 parsing for cmd, fixes bug #53694.
19372 2004-02-04 Marek Safar <marek.safar@seznam.cz>
19374 * class.cs, decl.cs: Fixed problem where IndexerName attribute was ignored
19375 in the member name duplication tests. Property and operator name duplication
19376 was missing too (error tests cs0102-{2,3,4,5}.cs, cs0111-{3,4}.cs).
19378 2004-02-03 Marek Safar <marek.safar@seznam.cz>
19380 * interface.cs (PopulateMethod): Fixed crash when interface method
19381 returns not existing type (error test cs0246-3.cs).
19383 2004-02-02 Ravi Pratap M <ravi@ximian.com>
19385 * cs-parser.jay (interface_accessors): Re-write actions to also
19386 store attributes attached to get and set methods. Fix spelling
19389 (inteface_property_declaration): Modify accordingly.
19391 (InterfaceAccessorInfo): New helper class to store information to pass
19392 around between rules that use interface_accessors.
19394 * interface.cs (Emit): Apply attributes on the get and set
19395 accessors of properties and indexers too.
19397 * attribute.cs (ApplyAttributes): Modify accordingly to use the
19398 right MethodBuilder when applying attributes to the get and set accessors.
19400 2004-01-31 Miguel de Icaza <miguel@ximian.com>
19402 * cs-tokenizer.cs: Applied patch from Marek Safar to fix bug 53386
19404 2004-01-26 Miguel de Icaza <miguel@ximian.com>
19406 * cs-tokenizer.cs: Handle #line hidden from PDC bits.
19408 2004-01-25 Miguel de Icaza <miguel@ximian.com>
19410 * cs-parser.jay: Remove YIELD token, instead use the new grammar
19411 changes that treat `yield' specially when present before `break'
19412 or `return' tokens.
19414 * cs-tokenizer.cs: yield is no longer a keyword.
19416 2004-01-23 Marek Safar <marek.safar@seznam.cz>
19418 * cs-parser.jay, class.cs (DefineDefaultConstructor): Fixed ModFlags
19419 setting for default constructors.
19420 For default constructors are almost every time set wrong Modifier. The
19421 generated IL code has been alright. But inside mcs this values was
19422 wrong and this was reason why several of my CLS Compliance tests
19425 2004-01-22 Martin Baulig <martin@ximian.com>
19427 * cs-parser.jay (namespace_or_type_name): Return an Expression,
19428 not a QualifiedIdentifier. This is what `type_name_expression'
19429 was previously doing.
19430 (type_name_expression): Removed; the code is now in
19431 `namespace_or_type_name'.
19432 (qualified_identifier): Removed, use `namespace_or_type_name'
19434 (QualifiedIdentifier): Removed this class.
19436 2004-01-22 Martin Baulig <martin@ximian.com>
19438 * namespace.cs (NamespaceEntry.UsingAlias): Take an Expression,
19439 not a string as alias name.
19441 2004-01-21 Miguel de Icaza <miguel@ximian.com>
19443 * ecore.cs (FieldInfo.AddressOf): Revert patch from previous
19444 #52730 bug, and instead compute correctly the need to use a
19445 temporary variable when requesting an address based on the
19446 static/instace modified of the field and the constructor.
19448 2004-01-21 Martin Baulig <martin@ximian.com>
19450 * ecore.cs (SimpleName.ResolveAsTypeStep): Lookup in the current
19451 class and namespace before looking up aliases. Fixes #52517.
19453 2004-01-21 Martin Baulig <martin@ximian.com>
19455 * flowanalysis.cs (UsageVector.Merge): Allow variables being
19456 assinged in a 'try'; fixes exception4.cs.
19458 2004-01-21 Marek Safar <marek.safar@seznam.cz>
19459 * class.cs : Implemented parameter-less constructor for TypeContainer
19461 * decl.cs: Attributes are now stored here. New property OptAttributes
19463 * delegate.cs, enum.cs, interface.cs: Removed attribute member.
19465 * rootcontext.cs, tree.cs: Now use parameter-less constructor of TypeContainer
19467 2004-01-21 Marek Safar <marek.safar@seznam.cz>
19469 * typemanager.cs (CSharpSignature): Now reports also inner class name.
19470 (CSharpSignature): New method for indexer and property signature.
19472 2004-01-21 Marek Safar <marek.safar@seznam.cz>
19474 * pending.cs (IsVirtualFilter): Faster implementation.
19476 2004-01-21 Marek Safar <marek.safar@seznam.cz>
19478 * typemanager.cs: Avoid inclusion of same assembly more than once.
19480 2004-01-21 Marek Safar <marek.safar@seznam.cz>
19482 * cs-parser.jay: Fixed problem where the last assembly attribute
19483 has been applied also to following declaration (class, struct, etc.)
19485 2004-01-21 Marek Safar <marek.safar@seznam.cz>
19487 * class.cs: Added error CS0538, CS0539 reporting.
19488 Fixed crash on Microsoft runtime when field type is void.
19490 * cs-parser.jay: Added error CS0537 reporting.
19492 * pending.cs: Added error CS0535 reporting.
19493 Improved error report for errors CS0536, CS0534.
19495 2004-01-20 Miguel de Icaza <miguel@ximian.com>
19497 Merge a few bits from the Anonymous Method MCS tree.
19499 * statement.cs (ToplevelBlock): New class for toplevel methods,
19500 will hold anonymous methods, lifted variables.
19502 * cs-parser.jay: Create toplevel blocks for delegates and for
19503 regular blocks of code.
19505 2004-01-20 Martin Baulig <martin@ximian.com>
19507 * codegen.cs (EmitContext): Removed `InTry', `InCatch',
19508 `InFinally', `InLoop', `TryCatchLevel', `LoopBeginTryCatchLevel'
19509 and `NeedExplicitReturn'; added `IsLastStatement'.
19510 (EmitContext.EmitTopBlock): Emit the explicit "ret" if we either
19511 have a `ReturnLabel' or we're not unreachable.
19513 * flowanalysis.cs (FlowBranching.MergeChild): Actually merge the
19514 child's reachability; don't just override ours with it. Fixes
19515 #58058 (lluis's example).
19516 (FlowBranching): Added public InTryOrCatch(), InCatch(),
19517 InFinally(), InLoop(), InSwitch() and
19518 BreakCrossesTryCatchBoundary() methods.
19520 * statement.cs (Return): Do all error checking in Resolve().
19521 Unless we are the last statement in a top-level block, always
19522 create a return label and jump to it.
19523 (Break, Continue): Do all error checking in Resolve(); also make
19524 sure we aren't leaving a `finally'.
19525 (Block.DoEmit): Set `ec.IsLastStatement' when emitting the last
19526 statement in a top-level block.
19527 (Block.Flags): Added `IsDestructor'.
19528 (Block.IsDestructor): New public property.
19530 2004-01-20 Martin Baulig <martin@ximian.com>
19532 * statement.cs (Break.DoEmit): Set ec.NeedExplicitReturn; fixes #52427.
19534 2004-01-20 Martin Baulig <martin@ximian.com>
19536 * statement.cs (Statement.ResolveUnreachable): New public method.
19537 (If, While): Do the dead-code elimination in Resolve(), not in Emit().
19538 (Block.Resolve): Resolve unreachable statements.
19540 2004-01-19 Ben Maurer <bmaurer@users.sourceforge.net>
19542 * expression.cs: We need to fix the case where we do
19543 not have a temp variable here.
19545 * assign.cs: Only expression compound assignments need
19546 temporary variables.
19548 2004-01-19 Ben Maurer <bmaurer@users.sourceforge.net>
19550 * flowanalysis.cs: Reduce memory allocation in a few ways:
19551 - A block with no variables should not allocate a bit
19553 - A method with no out parameters does not need any tracking
19554 for assignment of the parameters, so we need not allocate
19557 public readonly Type[] VariableTypes;
19558 public readonly string[] VariableNames;
19559 Are redundant. The data is already stored in the variable
19560 map, so we need not allocate another array for it.
19561 - We need to add alot of checks for if (params | locals) == null
19562 due to the first two changes.
19564 2004-01-18 Miguel de Icaza <miguel@ximian.com>
19566 * ecore.cs (FieldExpr.AddressOf): For ValueTypes that do not
19567 implement IMemoryLocation, we store a copy on a local variable and
19568 take the address of it. Patch from Benjamin Jemlich
19570 * cs-parser.jay: Applied patch from Ben Maurer to the "type" rule
19571 to use a special "type_name_expression" rule which reduces the
19572 number of "QualifiedIdentifier" classes created, and instead
19573 directly creates MemberAccess expressions.
19575 2004-01-17 Miguel de Icaza <miguel@ximian.com>
19577 * convert.cs: Applied patch from Benjamin Jemlich (pcgod@gmx.net)
19578 that fixes #52853. Null literal assignment to ValueType
19580 * class.cs (MethodData.Emit): Instead of checking the name of the
19581 method to determine if its a destructor, create a new derived
19582 class from Method called Destructor, and test for that.
19584 * cs-parser.jay: Create a Destructor object instead of a Method.
19586 Based on a fix from Benjamin Jemlich (pcgod@gmx.net)
19590 2004-01-16 Miguel de Icaza <miguel@ximian.com>
19592 * expression.cs (Binary.ResolveOperator): Perform an implicit
19593 conversion from MethodGroups to their delegate types on the
19594 Addition operation.
19596 * delegate.cs: Introduce a new class DelegateCreation that is the
19597 base class for `NewDelegate' and `ImplicitDelegateCreation',
19598 factor some code in here.
19600 * convert.cs (Convert.ImplicitConversionStandard): Add an implicit
19601 conversion from MethodGroups to compatible delegate types.
19603 * ecore.cs (Expression.Resolve): Do not flag error 654
19604 (Methodgroupd needs parenthesis) if running on the V2 compiler, as
19605 we allow conversions from MethodGroups to delegate types now.
19607 * assign.cs (Assign.DoResolve): Do not flag errors on methodgroup
19608 assignments in v2 either.
19610 2004-01-10 Miguel de Icaza <miguel@ximian.com>
19612 * ecore.cs (FieldExpr.AddressOf): Fix generated IL for accessing
19613 static read-only fields in ctors.
19615 Applied patch from Benjamin Jemlich
19617 * expression.cs (UnaryMutator): Avoid leaking local variables.
19619 2004-01-09 Miguel de Icaza <miguel@ximian.com>
19621 * cs-tokenizer.cs (IsCastToken): Allow the various native types
19622 here to return true, as they can be used like this:
19624 (XXX) int.MEMBER ()
19626 Fixed 49836 and all the other dups
19628 2004-01-09 Zoltan Varga <vargaz@freemail.hu>
19630 * driver.cs: Implement /win32res and /win32icon.
19632 2004-01-08 Miguel de Icaza <miguel@ximian.com>
19634 * cs-parser.jay: Add a rule to improve error handling for the
19635 common mistake of placing modifiers after the type.
19637 2004-01-07 Miguel de Icaza <miguel@ximian.com>
19639 * cs-parser.jay (interface_event_declaration): Catch
19640 initialization of events on interfaces, and report cs0068
19642 * cs-parser.jay (interface_event_declaration): Catch
19643 initialization of events.
19645 * ecore.cs: Better report missing constructors.
19647 * expression.cs (Binary.ResolveOperator): My previous bug fix had
19648 the error reporting done in the wrong place. Fix.
19650 * expression.cs (Binary.ResolveOperator): Catch the
19651 operator + (E x, E y) error earlier, and later allow for implicit
19652 conversions in operator +/- (E e, U x) from U to the underlying
19655 * class.cs (TypeContainer.DefineDefaultConstructor): Fix bug
19656 52596, if the container class is abstract, the default constructor
19657 is protected otherwise its public (before, we were always public).
19659 * statement.cs (Fixed.Resolve): Catch a couple more errors in the
19662 (Using.EmitLocalVariableDecls): Applied patch from Benjamin
19663 Jemlich that fixes bug #52597, MCS was generating invalid code for
19664 idisposable structs. Thanks to Ben for following up with this
19667 2004-01-06 Miguel de Icaza <miguel@ximian.com>
19669 * driver.cs: Allow assemblies without code to be generated, fixes
19672 2004-01-07 Nick Drochak <ndrochak@gol.com>
19674 * attribute.cs: Remove unneeded catch variables. Eliminates a warning.
19676 2004-01-05 Miguel de Icaza <miguel@ximian.com>
19678 * cs-parser.jay: Add rules to improve error reporting if fields or
19679 methods are declared at the namespace level (error 116)
19681 * Add rules to catch event add/remove
19683 2004-01-04 David Sheldon <dave-mono@earth.li>
19685 * expression.cs: Added matching ")" to error message for
19688 2004-01-03 Todd Berman <tberman@gentoo.org>
19690 * ecore.cs, attribute.cs:
19691 Applying fix from #52429.
19693 2004-01-03 Ben Maurer <bmaurer@users.sourceforge.net>
19695 * ecore.cs, expression.cs, statement.cs:
19696 Total rewrite of how we handle branching. We
19697 now handle complex boolean expressions with fewer
19698 jumps. As well if (x == 0) no longer emits a ceq.
19700 if (x is Foo) is much faster now, because we generate
19703 Overall, we get a pretty big improvement on our benchmark
19704 tests. The code we generate is smaller and more readable.
19706 I did a full two-stage bootstrap. The patch was reviewed
19707 by Martin and Miguel.
19709 2004-01-03 Ben Maurer <bmaurer@users.sourceforge.net>
19711 * cs-parser.jay: Make primary_expression not take a QI.
19712 we dont need this because the member_access rule covers
19713 us here. So we replace the rule with just IDENTIFIER.
19715 This has two good effects. First, we remove a s/r conflict.
19716 Second, we allocate many fewer QualifiedIdentifier objects.
19718 2004-01-03 Ben Maurer <bmaurer@users.sourceforge.net>
19720 * attribute.cs: Handle MarshalAs attributes as pseudo, and
19721 set the correct information via SRE. This prevents
19722 hanging on the MS runtime. Fixes #29374.
19724 2004-01-03 Ben Maurer <bmaurer@users.sourceforge.net>
19726 * convert.cs: correctly handle conversions to value types
19727 from Enum and ValueType as unboxing conversions.
19729 Fixes bug #52569. Patch by Benjamin Jemlich.
19731 2004-01-02 Ravi Pratap <ravi@ximian.com>
19733 * expression.cs (BetterConversion): Prefer int -> uint
19734 over int -> ulong (csc's behaviour). This fixed bug #52046.
19736 2004-01-02 Ben Maurer <bmaurer@users.sourceforge.net>
19738 * decl.cs (MemberCache.FindMembers): now returns a
19741 * typemanager.cs: In general, go with with ^^.
19742 (CopyNewMethods): take an IList.
19743 (RealMemberLookup): Only allocate an arraylist
19744 if we copy from two sets of methods.
19746 This change basically does two things:
19747 1) Fewer array lists allocated due to CopyNewMethods.
19748 2) the explicit cast in MemberList costed ALOT.
19750 2004-01-02 Zoltan Varga <vargaz@freemail.hu>
19752 * cs-tokenizer.cs (consume_identifier) driver.cs: Cache identifiers in
19753 a hashtable to avoid needless string allocations when an identifier is
19754 used more than once (the common case).
19756 2004-01-01 Ben Maurer <bmaurer@users.sourceforge.net>
19758 * pending.cs: MS's TypeBuilder.GetInterfaces ()
19759 is broken, it will not return anything. So, we
19760 have to use the information we have in mcs to
19763 * typemanager.cs: Add a cache for GetInterfaces,
19764 since this will now be used more often (due to ^^)
19766 (GetExplicitInterfaces) New method that gets the
19767 declared, not effective, interfaces on a type
19768 builder (eg, if you have interface IFoo, interface
19769 IBar, Foo : IFoo, Bar : Foo, IBar, GetExplInt (Bar) ==
19772 This patch makes MCS able to bootstrap itself on
19775 2004-01-01 Ben Maurer <bmaurer@users.sourceforge.net>
19777 * expression.cs: Remove the Nop's that Miguel put
19780 2003-12-31 Ben Maurer <bmaurer@users.sourceforge.net>
19782 * report.cs, codegen.cs: Give the real stack trace to
19783 the error when an exception is thrown.
19785 2003-12-31 Ben Maurer <bmaurer@users.sourceforge.net>
19787 * decl.cs: only allocate hashtables for ifaces if
19790 2003-12-31 Ben Maurer <bmaurer@users.sourceforge.net>
19792 * expression.cs: fix the error from cs0121-2.cs
19793 (a parent interface has two child interfaces that
19794 have a function with the same name and 0 params
19795 and the function is called through the parent).
19797 2003-12-30 Ben Maurer <bmaurer@users.sourceforge.net>
19799 * class.cs, rootcontext.cs, typmanager.cs: do not
19802 2003-12-28 Ben Maurer <bmaurer@users.sourceforge.net>
19804 * codegen.cs: remove stack for the ec flow branching.
19805 It is already a linked list, so no need.
19807 2003-12-27 Ben Maurer <bmaurer@users.sourceforge.net>
19809 * Makefile: Allow custom profiler here.
19811 2003-12-26 Ben Maurer <bmaurer@users.sourceforge.net>
19813 * typemanager.cs (LookupType):
19814 - Use a static char [], because split takes
19815 a param array for args, so it was allocating
19817 - Do not store true in a hashtable, it boxes.
19819 2003-12-26 Ben Maurer <bmaurer@users.sourceforge.net>
19821 * flowanalysis.cs: bytify common enums.
19823 2003-12-25 Ben Maurer <bmaurer@users.sourceforge.net>
19825 * modifiers.cs: Add a new set of flags for the
19826 flags allowed on explicit interface impls.
19827 * cs-parser.jay: catch the use of modifiers in
19828 interfaces correctly.
19829 * class.cs: catch private void IFoo.Blah ().
19831 All related to bug #50572.
19833 2003-12-25 Ben Maurer <bmaurer@users.sourceforge.net>
19835 * decl.cs: Rewrite the consistant accessability checking.
19836 Accessability is not linear, it must be implemented in
19837 a tableish way. Fixes #49704.
19839 2003-12-25 Ben Maurer <bmaurer@users.sourceforge.net>
19841 * expression.cs: Handle negation in a checked context.
19842 We must use subtraction from zero. Fixes #38674.
19844 2003-12-23 Ben Maurer <bmaurer@users.sourceforge.net>
19846 * class.cs: Ignore static void main in DLLs.
19847 * rootcontext.cs: Handle the target type here,
19848 since we are have to access it from class.cs
19849 * driver.cs: account for the above.
19851 2003-12-23 Ben Maurer <bmaurer@users.sourceforge.net>
19853 * report.cs: Give line numbers and files if available.
19855 2003-12-20 Zoltan Varga <vargaz@freemail.hu>
19857 * driver.cs: Implement /addmodule.
19859 * typemanager.cs: Change 'modules' field so it now contains Modules not
19862 2003-12-20 Martin Baulig <martin@ximian.com>
19864 * class.cs (TypeContainer.DefineMembers): Don't do the CS0649 check here.
19865 (FieldBase.IsAssigned): Removed this field.
19866 (FieldBase.SetAssigned): New public method.
19867 (TypeContainer.Emit): Make the CS0169/CS0649 checks actually work.
19869 2003-12-20 Martin Baulig <martin@ximian.com>
19871 * expression.cs (LocalVariableReference.DoResolve): Don't set
19872 `vi.Used' if we're called from DoResolveLValue().
19874 * statement.cs (Block.DoResolve): `ec.DoEndFlowBranching()' now
19875 returns the usage vector it just merged into the current one -
19876 pass this one to UsageWarning().
19877 (Block.UsageWarning): Take the `FlowBranching.UsageVector' instead
19878 of the `EmitContext', don't call this recursively on our children.
19880 2003-12-19 Zoltan Varga <vargaz@freemail.hu>
19882 * driver.cs: Implement /target:module.
19884 2003-12-18 Zoltan Varga <vargaz@freemail.hu>
19886 * support.cs (CharArrayHashtable): New helper class.
19888 * cs-tokenizer.cs: Store keywords in a hashtable indexed by
19889 char arrays, not strings, so we can avoid creating a string in
19890 consume_identifier if the identifier is a keyword.
19892 2003-12-16 Martin Baulig <martin@ximian.com>
19894 * statement.cs (LocalInfo.Assigned): Removed this property.
19895 (LocalInfo.Flags): Removed `Assigned'.
19896 (LocalInfo.IsAssigned): New public method; takes the EmitContext
19897 and uses flow analysis.
19898 (Block.UsageWarning): Made this method private.
19899 (Block.Resolve): Call UsageWarning() if appropriate.
19901 * expression.cs (LocalVariableReference.DoResolve): Always set
19902 LocalInfo.Used here.
19904 2003-12-13 Martin Baulig <martin@ximian.com>
19906 * statement.cs (Statement.DoEmit, Statement.Emit): Don't return
19907 any value here; we're now using flow analysis to figure out
19908 whether a statement/block returns a value.
19910 2003-12-13 Martin Baulig <martin@ximian.com>
19912 * flowanalysis.cs (UsageVector.MergeFinallyOrigins): Made this
19914 (FlowBranching.MergeFinally): Don't call
19915 `branching.CheckOutParameters()' here, this is called in
19917 (FlowBranchingException.AddSibling): Call MergeFinallyOrigins()
19918 when adding the `finally' vector.
19920 2003-12-13 Martin Baulig <martin@ximian.com>
19923 (UsageVector.MergeJumpOrigins, FlowBranching.Label): Make this
19924 actually work and also fix #48962.
19926 2003-12-12 Ben Maurer <bmaurer@users.sourceforge.net>
19928 * decl.cs: Do not check System.Object for nested types,
19929 since we know it does not have any. Big bang for buck:
19932 Run 1: 8.35 seconds
19933 Run 2: 8.32 seconds
19934 corlib: 17.99 seconds
19936 Run 1: 8.17 seconds
19937 Run 2: 8.17 seconds
19938 corlib: 17.39 seconds
19940 2003-12-11 Ben Maurer <bmaurer@users.sourceforge.net>
19942 * class.cs (FindMembers): Allocate arraylists on demand. Most of the
19943 time we are returning 0 members, so we save alot here.
19945 2003-12-11 Martin Baulig <martin@ximian.com>
19947 * flowanalysis.cs (UsageVector.MergeResult): Renamed this back to
19948 `MergeChild()', also just take the `FlowBranching' as argument;
19949 call Merge() on it and return the result.
19950 (FlowBranching.Merge): We don't need to do anything if we just
19953 2003-12-11 Martin Baulig <martin@ximian.com>
19955 * flowanalysis.cs: Use a list of `UsageVector's instead of storing
19956 them in an `ArrayList' to reduce memory usage. Thanks to Ben
19957 Maurer for this idea.
19959 2003-12-11 Martin Baulig <martin@ximian.com>
19961 * flowanalysis.cs (MergeResult): This class is now gone; we now
19962 use the `UsageVector' for this. The reason for this is that if a
19963 branching just has one sibling, we don't need to "merge" them at
19964 all - that's the next step to do.
19965 (FlowBranching.Merge): We now return a `UsageVector' instead of a
19968 2003-12-11 Martin Baulig <martin@ximian.com>
19970 Reworked flow analyis and made it more precise and bug-free. The
19971 most important change is that we're now using a special `Reachability'
19972 class instead of having "magic" meanings of `FlowReturns'. I'll
19973 do some more cleanups and optimizations and also add some more
19974 documentation this week.
19976 * flowanalysis.cs (Reachability): Added `Throws' and `Barrier';
19977 largely reworked this class.
19978 (FlowReturns): Removed `Unreachable' and `Exception'; we now use
19979 the new `Reachability' class instead of having "magic" values here.
19980 (FlowBranching): We're now using an instance of `Reachability'
19981 instead of having separate `Returns', `Breaks' etc. fields.
19983 * codegen.cs (EmitContext.EmitTopBlock): Set `has_ret' solely
19984 based on flow analysis; ignore the return value of block.Emit ().
19986 2003-12-10 Zoltan Varga <vargaz@freemail.hu>
19988 * driver.cs typemanager.cs: Find the mono extensions to corlib even
19989 if they are private.
19991 2003-12-09 Martin Baulig <martin@ximian.com>
19993 * flowanalyis.cs (FlowBranching.Return, Goto, Throw): Removed;
19994 call them directly on the UsageVector.
19996 2003-12-09 Martin Baulig <martin@ximian.com>
19998 * flowanalysis.cs (FlowBranching.MergeChild, MergeTopBlock):
19999 Changed return type from `FlowReturns' to `Reachability'.
20001 2003-12-09 Martin Baulig <martin@ximian.com>
20003 * flowanalysis.cs (FlowBranching.Reachability): New sealed class.
20004 (FlowBranching.MergeResult): Replaced the `Returns', `Breaks' and
20005 `Reachable' fields with a single `Reachability' one.
20007 2003-12-08 Ben Maurer <bmaurer@users.sourceforge.net>
20009 * class.cs (FindMembers): Remove foreach's.
20014 Run 1: 8.74 seconds
20015 Run 2: 8.71 seconds
20018 Run 1: 8.64 seconds
20019 Run 2: 8.58 seconds
20022 2003-12-08 Ben Maurer <bmaurer@users.sourceforge.net>
20027 This patch does a few things:
20028 1. EmptyStatement is now a singleton, so it is never reallocated.
20029 2. All blah is EmptyStatement constructs have been changed to
20030 blah == EmptyStatement.Value, which is much faster and valid
20031 now that EmptyStatement is a singleton.
20032 3. When resolving a block, rather than allocating a new array for
20033 the non-empty statements, empty statements are replaced with
20034 EmptyStatement.Value
20035 4. Some recursive functions have been made non-recursive.
20036 Mainly the performance impact is from (3), however (1) and (2) are needed for
20037 this to work. (4) does not make a big difference in normal situations, however
20038 it makes the profile look saner.
20043 9.25user 0.23system 0:10.28elapsed 92%CPU (0avgtext+0avgdata 0maxresident)k
20044 9.34user 0.13system 0:10.23elapsed 92%CPU (0avgtext+0avgdata 0maxresident)k
20045 Total memory allocated: 56397 KB
20048 9.13user 0.09system 0:09.64elapsed 95%CPU (0avgtext+0avgdata 0maxresident)k
20049 8.96user 0.24system 0:10.13elapsed 90%CPU (0avgtext+0avgdata 0maxresident)k
20050 Total memory allocated: 55666 KB
20052 2003-12-08 Ben Maurer <bmaurer@users.sourceforge.net>
20054 * support.cs: Rewrite DoubleHash to use its own impl. Is faster
20055 than the hashtable in a hashtable version
20057 * decl.cs: Right now, whenever we try to lookup a type inside a namespace,
20058 we always end up concating a string. This results in a huge perf
20059 loss, because many strings have to be tracked by the GC. In this
20060 patch, we first use a hashtable that works with two keys, so that
20061 the strings do not need to be concat'ed.
20065 Run 1: 8.74 seconds
20066 Run 2: 8.71 seconds
20069 Run 1: 8.65 seconds
20070 Run 2: 8.56 seconds
20072 2003-12-08 Ben Maurer <bmaurer@users.sourceforge.net>
20074 * Makefile: Add a new target `do-time' that does a quick and simple
20075 profile, leaving easy to parse output.
20077 2003-12-08 Zoltan Varga <vargaz@freemail.hu>
20079 * codegen.cs (Init): Create the dynamic assembly with
20080 AssemblyBuilderAccess.Save, to enable some optimizations in the runtime.
20082 2003-12-02 Ben Maurer <bmaurer@users.sourceforge.net>
20084 * support.cs: Make the PtrHashtable use only one
20085 instance of its comparer.
20087 2003-11-30 Zoltan Varga <vargaz@freemail.hu>
20089 * typemanager.cs: Fix lookup of GetNamespaces.
20091 2003-11-29 Miguel de Icaza <miguel@ximian.com>
20093 * expression.cs: Removed redundant line.
20095 * statement.cs (Block.Resolve, Block.Emit): Avoid foreach on
20096 ArrayLists, use for loops with bounds.
20098 * flowanalysis.cs (FlowBranching.Merge): Avoid foreach on
20101 * expression.cs (Invocation.OverloadResolve): Avoid foreach on
20102 arraylists, use for loop with bounds.
20104 The above three changes give us a 0.071 second performance
20105 improvement out of 3.294 seconds down to 3.223. On my machine
20106 the above changes reduced the memory usage by 1,387 KB during
20107 compiler bootstrap.
20109 * cs-parser.jay (QualifiedIdentifier): New class used to represent
20110 QualifiedIdentifiers. Before we created a new string through
20111 concatenation, and mostly later on, the result would be
20112 manipulated by DecomposeQI through string manipulation.
20114 This reduced the compiler memory usage for bootstrapping from
20115 59380 KB to 59007 KB on my machine, 373 KB, and also reduced the
20116 compile times in 0.05 seconds.
20118 2003-11-28 Dick Porter <dick@ximian.com>
20120 * support.cs: Do string compares with the Invariant culture.
20128 * class.cs: Use the char forms of IndexOf and LastIndexOf, so that
20129 the comparison is done with the Invariant culture.
20131 2003-11-27 Miguel de Icaza <miguel@ximian.com>
20133 * statement.cs (Foreach.TryType): Use DeclaredOnly to find the
20134 GetEnumerator method.
20136 (ProbeCollectionType): Iterate starting at the most specific type
20137 upwards looking for a GetEnumerator
20139 * expression.cs: Shift count can be up to 31 for int/uint and 63
20142 2003-11-26 Miguel de Icaza <miguel@ximian.com>
20144 * statement.cs (Block.LookupLabel): Also look for the label on the
20145 children blocks. Use a hash table to keep track of visited
20148 * cfold.cs (IntConstant to UIntConstant mapping): Only return if
20149 we actually did transform the other operand, otherwise fall back
20150 to the common codepath that casts to long.
20152 * cs-tokenizer.cs: Use the same code pattern as the int case.
20153 Maybe I should do the parsing myself, and avoid depending on the
20154 Parse routines to get this done.
20156 2003-11-25 Miguel de Icaza <miguel@ximian.com>
20158 * expression.cs: Apply fix from l_m@pacbell.net (Laurent Morichetti),
20159 which fixes bug 51347. This time test it.
20161 * expression.cs: Make TypeOfVoid derive from TypeOf, so code in
20162 attributes for example can not tell the difference between these.
20163 The difference was only a syntax feature of the language.
20165 * attribute.cs: Apply attributes to delegates.
20167 * delegate.cs: Call the apply attributes method.
20169 2003-11-24 Miguel de Icaza <miguel@ximian.com>
20171 * convert.cs (TryImplicitIntConversion): One line bug fix: we were
20172 comparing 0 vs Byte.MinValue, not the value
20174 (ImplicitConversionRequired): When reporting a conversion error,
20175 use error 31 to print out the constant error instead of the
20178 * expression.cs: Apply fix from l_m@pacbell.net (Laurent Morichetti),
20179 which fixes bug 51347.
20181 2003-11-22 Miguel de Icaza <miguel@ximian.com>
20183 * driver.cs: Applied patch from gert.driesen@pandora.be (Gert Driesen)
20184 which fixes the -warnaserror command line option.
20186 2003-11-21 Miguel de Icaza <miguel@ximian.com>
20188 * cfold.cs (DoNumericPromotions): During constant folding of
20189 additions on UIntConstant, special case intconstants with
20190 IntConstants like we do on the expression binary operator.
20192 2003-11-12 Miguel de Icaza <miguel@ximian.com>
20194 * convert.cs (ImplicitReferenceConversion): We were missing a case
20195 (System.Enum are not value types or class types, so we need to
20196 classify them separatedly).
20198 * driver.cs: We do not support error 2007.
20200 2003-11-12 Jackson Harper <jackson@ximian.com>
20202 * driver.cs: Use corlib.dll or mscorlib.dll when looking up the
20203 system directory. Also use the full file name so users can
20204 libraries names mscorlib-o-tron.dll in a non system dir.
20206 2003-11-10 Martin Baulig <martin@ximian.com>
20208 * typemanager.cs (TypeManager.ResolveExpressionTypes): Removed.
20209 (TypeManager.InitCoreTypes): Initialize them here, but instead of
20210 calling `ResolveType()' on them, directly assign their `Type'.
20212 2003-11-08 Martin Baulig <martin@ximian.com>
20214 * class.cs (TypeContainer.GetClassBases): Use TypeExpr's for the
20215 return value and the `out parent' parameter.
20216 (TypeContainer.DefineType): Moved the CS0644 check into
20217 GetClassBases(). Don't pass the interface types to the
20218 `builder.DefineType()'/`builder.DefineNestedType()', but resolve
20219 them later and then call `TypeBuilder.AddInterfaceImplementation()'.
20221 * ecore.cs (TypeExpr.IsAttribute): New property.
20222 (TypeExpr.GetInterfaces): New method.
20224 * interface.cs (Interface.GetInterfaceTypeByName): Return a
20225 TypeExpr instead of a Type.
20226 (Interface.GetInterfaceBases): Return TypeExpr's instead of Type's.
20227 (Interface.DefineType): Don't pass the interface types to the
20228 `builder.Definetype()'/`builder.DefineNestedType()', but resolve
20229 them later and then call `TypeBulider.AddInterfaceImplementation()'.
20231 * typemanager.cs (TypeManager.AddUserType): Take a `TypeExpr[]'
20232 instead of a `Type[]'.
20233 (TypeManager.RegisterBuilder): Likewise.
20234 (TypeManager.AddUserInterface): Likewise.
20235 (TypeManager.ExpandInterfaces): Take a `Type[]' instead of a
20236 `Type[]' and also return a `TypeExpr[]'.
20237 (TypeManager.GetInterfaces): Return a `TypeExpr[]'.
20239 2003-11-08 Martin Baulig <martin@ximian.com>
20241 * decl.cs (DeclSpace.ResolveTypeExpr): Return a TypeExpr, not an
20244 2003-11-08 Martin Baulig <martin@ximian.com>
20246 * decl.cs (DeclSpace.GetTypeResolveEmitContext): Call
20247 TypeManager.ResolveExpressionTypes().
20249 * ecore.cs (Expression.ResolveAsTypeTerminal): Return a TypeExpr
20250 instead of an Expression.
20251 (TypeExpr): This is now an abstract base class for `TypeExpression'.
20252 (TypeExpression): New public class; formerly known as `TypeExpr'.
20254 * expression.cs (ComposedCast): Derive from TypeExpr.
20256 * typemanager.cs (TypeManager.system_*_expr): These are now
20257 TypExpr's instead of Expression's.
20258 (TypeManager.ResolveExpressionTypes): New public static function;
20259 called from DeclSpace.GetTypeResolveEmitContext() to resolve all
20262 2003-11-06 Miguel de Icaza <miguel@ximian.com>
20264 * expression.cs (New.DoResolve): Do not dereference value that
20265 might be a null return.
20267 * statement.cs (Block.EmitMeta): Use the Const.ChangeType to make
20268 sure that the constant value has the right type. Fixes an
20269 unreported bug, similar to 50425.
20271 * const.cs (Const.LookupConstantValue): Call
20272 ImplicitStandardConversionExists before doing a conversion to
20273 avoid havng the TypeManager.ChangeType do conversions.
20275 Reduced the number of casts used
20277 (Const.ChangeType): New routine to enable reuse of the constant
20278 type changing code from statement.
20280 * typemanager.cs (ChangeType): Move common initialization to
20281 static global variables.
20285 * convert.cs (ImplicitReferenceConversion): Somehow we allowed
20286 every value type to go through, even if it was void. Fix that.
20288 * cs-tokenizer.cs: Use is_identifier_start_character on the start
20289 character of the define, and the is_identifier_part_character for
20290 the rest of the string.
20292 2003-11-05 Miguel de Icaza <miguel@ximian.com>
20294 * expression.cs (UnaryMutator.EmitCode): When I updated
20295 LocalVariableReference.DoResolve, I overdid it, and dropped an
20296 optimization done on local variable references.
20298 2003-11-04 Miguel de Icaza <miguel@ximian.com>
20300 * ecore.cs: Convert the return from Ldlen into an int.
20302 2003-10-20 Miguel de Icaza <miguel@ximian.com>
20304 * decl.cs (DeclSpace.GetAccessLevel): Handle NotPublic case for
20305 the accessibility, this is a special case for toplevel non-public
20306 classes (internal for instance).
20308 2003-10-20 Nick Drochak <ndrochak@gol.com>
20310 * ecore.cs: Fix typo and build. Needed another right paren.
20312 2003-10-19 Miguel de Icaza <miguel@ximian.com>
20314 * ecore.cs: Applied fix from Ben Maurer. We were handling in the
20315 `internal' case regular and protected, but not allowing protected
20316 to be evaluated later. Bug 49840
20318 2003-10-15 Miguel de Icaza <miguel@ximian.com>
20320 * statement.cs (Switch.TableSwitchEmit): Compare the upper bound
20321 to kb.Nlast, and not the kb.nFirst to isolate the switch
20324 Extract the underlying type, so enumerations of long/ulong are
20325 treated like long/ulong.
20327 2003-10-14 Miguel de Icaza <miguel@ximian.com>
20329 * expression.cs (New): Overload the meaning of RequestedType to
20330 track the possible creation of the NewDelegate type, since
20331 DoResolve is invoked more than once for new constructors on field
20334 See bugs: #48800 and #37014
20336 * cs-parser.jay (declare_local_constants): Take an arraylist
20337 instead of a single constant.
20339 (local_constant_declaration): It should take a
20340 constant_declarators, not a constant_declarator. Fixes 49487
20342 * convert.cs: Fix error report.
20344 2003-10-13 Jackson Harper <jackson@ximian.com>
20346 * typemanager.cs (TypeToCoreType): Add float and double this fixes
20349 2003-10-09 Martin Baulig <martin@ximian.com>
20351 * class.cs (MethodCore): Added additional `DeclSpace ds' argument
20353 (MethodCore.DoDefineParameters): Removed the TypeContainer
20354 argument; use the DeclSpace which was passed to the .ctor instead.
20355 (MethodCore.CheckParameter): Take a DeclSpace instead of a
20356 TypeContainer; we only need a DeclSpace here.
20358 2003-10-09 Martin Baulig <martin@ximian.com>
20360 * class.cs (MethodData): Added additional `DeclSpace ds' argument
20362 (MethodData.Define, MethodData.Emit): Pass the `ds' to the
20363 EmitContext's .ctor.
20365 2003-10-09 Martin Baulig <martin@ximian.com>
20367 * decl.cs (DeclSpace.AsAccessible): Moved here from TypeContainer.
20368 (AccessLevel, CheckAccessLevel, GetAccessLevel): They're used by
20369 AsAccessible(), moved them as well.
20371 * class.cs (TypeContainer.AsAccessible): Moved to DeclSpace.
20373 2003-10-08 Atsushi Enomoto <ginga@kit.hi-ho.ne.jp>
20375 * cs-parser.jay : Renamed yyName to yyNames related to jay.
20377 2003-10-07 Miguel de Icaza <miguel@ximian.com>
20379 * expression.cs (Binary.Emit.GreatherThanOrEqual): Fix the code
20380 generation for >=, as spotted by Paolo, bug 48679.
20381 Patch from David Waite.
20383 * cs-tokenizer.cs: Add handling for #pragma.
20385 * cs-parser.jay: Allow for both yield and yield return in the
20386 syntax. The anti-cobolization of C# fight will go on!
20388 * class.cs (TypeBuilder.DefineType): Catch error condition here
20389 (Parent.DefineType erroring out and returning null).
20391 * expression.cs (ArrayCreation.EmitDynamicInitializers): When
20392 coping with enumerations variables, we were mistakenly processing
20393 them as a regular value type instead of built-in types. Fixes the
20396 * typemanager.cs (IsBuiltinOrEnum): New method.
20398 2003-09-30 Miguel de Icaza <miguel@ximian.com>
20400 * cs-parser.jay: Upgrade: yield now needs the return clause.
20402 2003-09-19 Martin Baulig <martin@ximian.com>
20404 * decl.cs (MemberCache.SetupCacheForInterface): Take a
20405 `MemberCache parent' argument. Normally, an interface doesn't
20406 have a parent type except System.Object, but we use this in gmcs
20407 for generic type parameters.
20409 2003-09-18 Martin Baulig <martin@ximian.com>
20411 * typemanager.cs (TypeHandle.ctor): Set `IsInterface' solely based
20412 on `type.IsInterface'; don't check whether the type has a parent
20413 to determine whether it's an interface.
20415 2003-09-15 Martin Baulig <martin@ximian.com>
20417 * class.cs (TypeContainer.DefineType): Added an error flag to
20418 avoid reporting duplicate CS0146's ("class definition is
20421 * driver.cs (Driver.MainDriver): Abort if
20422 RootContext.ResolveTree() reported any errors.
20424 2003-09-07 Martin Baulig <martin@ximian.com>
20426 * report.cs (Error, Warning): Added overloaded versions which take
20427 a `params object[] args' and call String.Format().
20429 2003-09-07 Martin Baulig <martin@ximian.com>
20431 * decl.cs (DeclSpace..ctor): Don't call
20432 NamespaceEntry.DefineName() here; do it in RecordDecl() which is
20433 called from Tree.RecordDecl(). Fixes the CS0101 reporting.
20434 (DeclSpace.RecordDecl): New method.
20436 * tree.cs (Tree.RecordDecl): Call ds.RecordDecl().
20438 2003-09-02 Ravi Pratap <ravi@ximian.com>
20440 * attribute.cs (CheckAttributeTarget): Ensure that we allow return
20441 value attributes to be applied to ParameterBuilders.
20443 * class.cs (MethodCore.LabelParameters): Make static and more
20444 generic so that it can be used from other places - like interface
20445 methods, for instance.
20447 * interface.cs (Interface.Emit): Call LabelParameters before
20448 emitting attributes on the InterfaceMethod.
20450 2003-08-26 Martin Baulig <martin@ximian.com>
20452 * ecore.cs (SimpleName.SimpleNameResolve): Look for members before
20453 resolving aliases; fixes #47927.
20455 2003-08-26 Martin Baulig <martin@ximian.com>
20457 * statement.cs (Using.DoResolve): This is internally emitting a
20458 try/finally clause, so we need to set ec.NeedExplicitReturn if we
20459 do not always return. Fixes #47681.
20461 2003-08-26 Martin Baulig <martin@ximian.com>
20463 * decl.cs (MemberCore): Moved WarningNotHiding(),
20464 Error_CannotChangeAccessModifiers() and CheckMethodAgainstBase()
20466 (AdditionResult): Make this nested in DeclSpace.
20467 (DeclSpace.ctor): The .ctor now takes an additional NamespaceEntry
20468 argument; call NamespaceEntry.Define() unless we're nested in a
20471 * namespace.cs (Namespace.DefineName): New public function. This
20472 is called from DeclSpace's .ctor to add
20473 (Namespace.Lookup): Include DeclSpaces in the lookup.
20475 * class.cs (Operator): Derive from MemberBase, not MemberCore.
20477 * const.cs (Const): Derive from MemberBase, not MemberCore.
20479 2003-08-25 Martin Baulig <martin@ximian.com>
20481 * convert.cs (Convert.ExplicitReferenceConversion): When
20482 converting from an interface type to a class, unbox if the target
20483 type is a struct type. Fixes #47822.
20485 2003-08-24 Gonzalo Paniagua Javier <gonzalo@ximian.com>
20487 * typemanager.cs: fixed the values of MethodFlags. Closes #47855 and
20490 2003-08-22 Martin Baulig <martin@ximian.com>
20492 * class.cs (TypeManager.DefineType): When defining a nested type,
20493 call DefineType() on our parent; fixes #47801.
20495 2003-08-22 Martin Baulig <martin@ximian.com>
20497 * class.cs (MethodData.Define): While checking if a method is an
20498 interface implementation, improve the test a bit more to fix #47654.
20500 2003-08-22 Martin Baulig <martin@ximian.com>
20502 * expression.cs (Probe.DoResolve): Check whether `expr' resolved
20503 correctly; fixes #47722.
20505 2003-08-22 Martin Baulig <martin@ximian.com>
20507 * expression.cs (UnaryMutator.ResolveVariable): If the target is a
20508 LocalVariableReference, ensure it's not read-only. Fixes #47536.
20510 * statement.cs (Fixed.DoResolve): Make all variables read-only.
20512 2003-08-22 Martin Baulig <martin@ximian.com>
20514 * ecore.cs (FieldExpr.DoResolveLValue): Static read-only fields
20515 can only be assigned in static constructors. Fixes #47161.
20517 2003-08-22 Martin Baulig <martin@ximian.com>
20519 Rewrote and improved the flow analysis code.
20521 * flowbranching.cs (FlowBranching): Make this class abstract.
20522 (FlowBranching.CreateBranching): New static function to create a
20523 new flow branching.
20524 (FlowBranchingBlock, FlowBranchingException): New classes.
20525 (FlowBranching.UsageVector.Type): New public readonly field.
20526 (FlowBranching.UsageVector.Breaks): Removed the setter.
20527 (FlowBranching.UsageVector.Returns): Removed the setter.
20528 (FlowBranching.UsageVector): Added Break(), Return(),
20529 NeverReachable() and Throw() methods to modify the reachability.
20530 (FlowBranching.UsageVector.MergeChildren): Removed, this is now
20531 done by FlowBranching.Merge().
20532 (FlowBranching.UsageVector.MergeChild): New method; merges the
20533 merge result into the current vector.
20534 (FlowBranching.Merge): New abstract method to merge a branching.
20536 2003-08-12 Martin Baulig <martin@ximian.com>
20538 * expression.cs (Indirection.CacheTemporaries): Create the
20539 LocalTemporary with the pointer type, not its element type.
20541 2003-08-10 Miguel de Icaza <miguel@ximian.com>
20543 * cs-parser.jay: FIRST_KEYWORD, LAST_KEYWORD: used to know if a
20544 token was a keyword or not.
20546 Add `error' options where an IDENTIFIER was expected; Provide
20547 CheckToken and CheckIdentifierToken convenience error reporting
20550 Do not use `DeclSpace.Namespace', use `DeclSpace.NamespaceEntry'.
20552 * decl.cs: Rename `NamespaceEntry Namespace' public field into
20553 NameSpaceEntry NameSpaceEntry.
20555 (LookupInterfaceOrClass): Avoid creating a full qualified name
20556 from namespace and name: avoid doing lookups when we know the
20557 namespace is non-existant. Use new Tree.LookupByNamespace which
20558 looks up DeclSpaces based on their namespace, name pair.
20560 * driver.cs: Provide a new `parser verbose' to display the
20561 exception thrown during parsing. This is turned off by default
20562 now, so the output of a failure from mcs is more graceful.
20564 * namespace.cs: Track all the namespaces defined in a hashtable
20567 (IsNamespace): New method
20569 2003-08-09 Miguel de Icaza <miguel@ximian.com>
20571 * namespace.cs: Remove redundant call; Avoid using MakeFQN when
20572 we know that we need to concatenate (full typename can never be
20577 * statement.cs: Use a bitfield; Do not initialize to null things
20578 which are done by the constructor by default.
20580 * cs-parser.jay: bug fix, parameter was 4, not 3.
20582 * expression.cs: Just use the property;
20584 * statement.cs: No need for GetVariableInfo method.
20586 2003-08-08 Martin Baulig <martin@ximian.com>
20588 * flowanalysis.cs (FlowReturns): This is now nested in the
20589 `FlowBranching' class.
20590 (MyBitVector): Moved this here from statement.cs.
20591 (FlowBranching.SiblingType): New enum type.
20592 (FlowBranching.CreateSibling): Added `SiblingType' argument.
20594 2003-08-07 Martin Baulig <martin@ximian.com>
20596 * flowanalysis.cs (FlowBranchingType): This is now nested in the
20597 `FlowBranching' class and called `BranchingType'.
20599 2003-08-07 Martin Baulig <martin@ximian.com>
20601 * flowanalysis.cs: Moved all the control flow analysis code into
20604 2003-08-07 Martin Baulig <martin@ximian.com>
20606 * assign.cs (Assign.DoResolve): `target' must either be an
20607 IAssignMethod or an EventAccess; report a CS0131 otherwise. Fixes
20610 2003-08-07 Miguel de Icaza <miguel@ximian.com>
20612 * expression.cs (BinaryMethod): This kind of expression is created by the
20613 Binary class if it determines that the operator has to be handled
20616 (BinaryDelegate): This kind of expression is created if we are
20617 dealing with a + or - operator on delegates.
20619 (Binary): remove method, argumetns, and DelegateOperator: when
20620 dealing with methods,
20622 * ecore.cs (EventExpr.EmitAddOrRemove): Update to new layout.
20624 * statement.cs (Block): use bitfields for the three extra booleans
20625 we had in use. Remove unused topblock parameter.
20627 * codegen.cs: Remove unecessary argument to Block.EmitTopBlock
20629 * assign.cs: Drop extra unneeded tests.
20631 2003-08-06 Miguel de Icaza <miguel@ximian.com>
20633 * iterators.cs (Mapvariable): provide a mechanism to use prefixes.
20635 * statement.cs (Foreach): Use VariableStorage instead of
20638 * codegen.cs (VariableStorage): New class used by clients that
20639 require a variable stored: locals or fields for variables that
20640 need to live across yield.
20642 Maybe provide a convenience api for EmitThis+EmitLoad?
20644 (GetTemporaryLocal, FreeTemporaryLocal): Recycle
20647 2003-08-05 Miguel de Icaza <miguel@ximian.com>
20649 * codegen.cs (RemapLocal, RemapLocalLValue, RemapParameter,
20650 RemapParameterLValue): New methods that are used to turn a
20651 precomputed FieldInfo into an expression like this:
20655 The idea is to use this instead of making LocalVariableReference
20656 have more than one meaning.
20658 * cs-parser.jay: Add error production to BASE.
20660 * ecore.cs: Deal with TypeManager.GetField returning null, which
20661 is now a valid return value.
20663 (FieldExprNoAddress): New expression for Fields whose address can
20666 * expression.cs (LocalVariableReference): During the resolve
20667 phases, create new expressions if we are in a remapping context.
20668 Remove code that dealt with remapping here.
20670 (ParameterReference): same.
20672 (ProxyInstance): New expression, like the `This' expression, but
20673 it is born fully resolved. We know what we are doing, so remove
20674 the errors that are targeted to user-provided uses of `this'.
20676 * statement.cs (Foreach): our variable is now stored as an
20677 Expression; During resolution, follow the protocol, dont just
20678 assume it will return this.
20680 2003-08-06 Martin Baulig <martin@ximian.com>
20682 * support.cs (SeekableStreamReader.cs): New public class.
20684 * cs-tokenizer.cs, cs-parser.jay, driver.cs: Use the new
20685 SeekableStreamReader instead of the normal StreamReader.
20687 2003-08-04 Martin Baulig <martin@ximian.com>
20689 * cs-parser.jay (CLOSE_PARENS_CAST, CLOSE_PARENS_NO_CAST,
20690 CLOSE_PARENS_OPEN_PARENS, CLOSE_PARENS_MINUS): New tokens to
20691 deambiguate casts and delegate invocations.
20692 (parenthesized_expression): Use the new tokens to ensure this is
20693 not a cast of method invocation.
20695 * cs-tokenizer.cs (is_punct): Return one of the new special tokens
20696 when reading a `)' and Deambiguate_CloseParens () was previously
20699 * expression.cs (ParenthesizedExpression): New class. This is
20700 just used for the CS0075 test.
20701 (Binary.DoResolve): Check for CS0075.
20703 2003-07-29 Ravi Pratap <ravi@ximian.com>
20705 * expression.cs (Invocation.MakeUnionSet): Patch from Lluis
20706 Sanchez : use TypeManager.ArrayContainsMethod instead of a direct
20707 reference comparison.
20709 (TypeManager.ArrayContainsMethod): When we have a MethodInfo, also
20710 examine the ReturnType for equality - this is necessary in the
20711 cases of implicit and explicit operators whose signature also
20712 includes the return type.
20714 2003-07-26 Miguel de Icaza <miguel@ximian.com>
20716 * namespace.cs: Cache the result of the namespace computation,
20717 instead of computing it every time.
20719 2003-07-24 Miguel de Icaza <miguel@ximian.com>
20721 * decl.cs: Use a global arraylist that we reuse over invocations
20722 to avoid excesive memory consumption. Reduces memory usage on an
20723 mcs compile by one meg (45 average).
20725 * typemanager.cs (LookupTypeReflection): In .NET pointers are
20726 private, work around that.
20728 2003-07-23 Miguel de Icaza <miguel@ximian.com>
20730 * literal.cs (IntLiteral): Define Zero and One static literals.
20732 * cs-parser.jay (integer_literal): use static literals to reduce
20733 memory usage for the most used literals (0, 1 and -1). 211kb
20734 reduced in memory usage.
20736 Replace all calls to `new ArrayList' with `new
20737 ArrayList(4)' which is a good average number for most allocations,
20738 and also requires only 16 bytes of memory for its buffer by
20741 This reduced MCS memory usage in seven megabytes for the RSS after
20744 2003-07-28 Ravi Pratap <ravi@ximian.com>
20746 * expression.cs (Invocation.OverloadResolve): Fix the algorithm to
20747 handle params methods the correct way by forming only one
20748 applicable set with params and normal methods in them. Earlier we
20749 were looking at params methods only if we found no normal methods
20750 which was not the correct thing to do.
20752 (Invocation.BetterFunction): Take separate arguments indicating
20753 when candidate and the best method are params methods in their
20756 This fixes bugs #43367 and #46199.
20758 * attribute.cs: Documentation updates.
20760 (CheckAttribute): Rename to CheckAttributeTarget.
20761 (GetValidPlaces): Rename to GetValidTargets.
20763 * expression.cs (Invocation.IsParamsMethodApplicable): Fix trivial
20764 bug - use Convert.ImplicitConversion, not ImplicitUserConversion!
20768 2003-07-28 Martin Baulig <martin@ximian.com>
20770 * class.cs (TypeContainer.DefineMembers): Use the base type's full
20771 name when looking up the base class of a nested class. Fixes #46977.
20773 2003-07-26 Martin Baulig <martin@ximian.com>
20775 * expression.cs (Indexers.Indexer): New nested struct; contains
20776 getter, setter and the indexer's type.
20777 (Indexers.Properties): This is now an ArrayList of
20778 Indexers.Indexer's.
20779 (IndexerAccess.DoResolveLValue): Correctly set the type if the
20780 indexer doesn't have any getters.
20782 * assign.cs (Assign.DoResolve): Also do the implicit conversions
20783 for embedded property and indexer assignments.
20785 2003-07-26 Martin Baulig <martin@ximian.com>
20787 * cs-tokenizer.cs (Tokenizer.xtoken): Report a CS1040 if a
20788 preprocessor directive is not the first non-whitespace character
20791 2003-07-26 Martin Baulig <martin@ximian.com>
20793 * namespace.cs (NamespaceEntry.Lookup): New method; rewrote the
20794 namespace parsing, follow the spec more closely.
20796 * rootcontext.cs (RootContext.NamespaceLookup): Use the new
20797 NamespaceEntry.Lookup().
20799 2003-07-25 Martin Baulig <martin@ximian.com>
20801 * MethodCore.cs (OverridesSomething): New public field; it's set
20802 from TypeContainer.DefineMembers if this method overrides
20803 something (which doesn't need to be a method). Fix #39462.
20805 2003-07-25 Ravi Pratap <ravi@ximian.com>
20807 * typemanager.cs (GetMembers): Ensure that the list of members is
20808 reversed. This keeps things in sync.
20810 * attribute.cs (Attribute.CheckAttribute): Break as soon as we
20811 find an AttributeUsage attribute.
20813 * expression.cs (Invocation.OverloadResolve): Perform the check
20814 which disallows Invoke to be directly called on a Delegate.
20816 (Error_InvokeOnDelegate): Report error cs1533.
20818 2003-07-25 Martin Baulig <martin@ximian.com>
20820 * expression.cs (Indexers.GetIndexersForType): Only look in the
20821 interface hierarchy if the requested type is already an
20822 interface. Fixes #46788 while keeping #46502 fixed.
20824 2003-07-25 Martin Baulig <martin@ximian.com>
20826 * class.cs (TypeContainer.DefineMembers): Check whether all
20827 readonly fields have been assigned and report warning CS0649 if
20830 * statement.cs (LocalInfo.IsFixed): Always return true if this is
20833 2003-07-24 Ravi Pratap <ravi@ximian.com>
20835 * decl.cs (MemberCache.AddMethods): Reverse the order of the array
20836 returned from GetMethods to make things consistent with the
20837 assumptions MCS makes about ordering of methods.
20839 This should comprehensively fix bug #45127 and it does :-)
20841 * ecore.cs (MethodGroupExpr.DeclaringType): Correct bug - the
20842 ordering is actually reverse.
20844 * Clean up some debug messages I left lying around.
20846 * interface.cs (Populate*): Get rid of code which emits attributes
20847 since the stage in which we emit attributes is the 'Emit' stage,
20848 not the define stage.
20850 (Emit): Move attribute emission for interface members here.
20852 2003-07-22 Ravi Pratap <ravi@ximian.com>
20854 * expression.cs (Invocation.OverloadResolve): Follow the spec more
20855 closely: we eliminate methods in base types when we have an
20856 applicable method in a top-level type.
20858 Please see section 14.5.5.1 for an exact description of what goes
20861 This fixes bug #45127 and a host of other related to corlib compilation.
20863 * ecore.cs (MethodGroupExpr.DeclaringType): The element in the
20864 array is the method corresponding to the top-level type (this is
20865 because of the changes made to icall.c) so we change this
20868 (MethodGroupExpr.Name): This too.
20870 * typemanager.cs (GetElementType): New method which does the right
20871 thing when compiling corlib.
20873 * everywhere: Make use of the above in the relevant places.
20875 2003-07-22 Martin Baulig <martin@ximian.com>
20877 * cs-parser.jay (invocation_expression): Moved
20878 `OPEN_PARENS expression CLOSE_PARENS unary_expression' here from
20879 `cast_expression', but create a InvocationOrCast which later
20880 resolves to either an Invocation or a Cast.
20882 * ecore.cs (ExpressionStatement.ResolveStatement): New virtual
20883 method; call this before EmitStatement() to make sure that this
20884 expression can be used as a statement.
20886 * expression.cs (InvocationOrCast): New class; resolves to either
20887 an Invocation or a Cast.
20889 * statement.cs (StatementExpression): Call ResolveStatement() on
20890 the ExpressionStatement before emitting it.
20892 2003-07-21 Martin Baulig <martin@ximian.com>
20894 * expression.cs (Invocation.VerifyArgumentsCompat): Check whether
20895 `ref' and `out' attributes match; fixes #46220.
20896 (MemberAccess.ResolveMemberAccess): You can't reference a type
20897 through an expression; fixes #33180.
20898 (Indexers.GetIndexersForType): Don't return the indexers from
20899 interfaces the class implements; fixes #46502.
20901 2003-07-21 Martin Baulig <martin@ximian.com>
20903 * class.cs (TypeContainer.CheckPairedOperators): Added CS0660 and
20904 CS0661 checks; fixes bug #30442.
20906 2003-07-21 Martin Baulig <martin@ximian.com>
20908 * decl.cs (AdditionResult): Added `Error'.
20910 * enum.cs (AddEnumMember): Report a CS0076 if name is `value__'.
20912 * typemanager.cs (TypeManager.ChangeType): Catch exceptions;
20913 makes cs0031.cs actually work.
20915 2003-07-20 Martin Baulig <martin@ximian.com>
20917 * namespace.cs: Fixed that bug which caused a crash when compiling
20918 the debugger's GUI.
20920 2003-07-20 Miguel de Icaza <miguel@ximian.com>
20922 * typemanager.cs (LookupTypeReflection): Never expose types which
20923 are NotPublic, NestedPrivate, NestedAssembly, or
20924 NestedFamANDAssem. We used to return these, and later do a check
20925 that would report a meaningful error, but the problem is that we
20926 would not get the real match, if there was a name override.
20928 2003-07-18 Miguel de Icaza <miguel@ximian.com>
20930 * namespace.cs (Namespace, Name): Do not compute the namespace
20931 name dynamically, compute it in the constructor. This reduced
20932 memory usage by 1697 KB.
20934 * driver.cs: Use --pause to pause at the end.
20936 2003-07-17 Peter Williams <peter@newton.cx>
20938 * Makefile: Change the name of the test target so that it doesn't
20939 conflict with the recursive test target.
20941 2003-07-17 Miguel de Icaza <miguel@ximian.com>
20943 * expression.cs (LocalVariableReference.Emit, EmitAssign,
20944 AddressOf): Do not use EmitThis, that was wrong, use the actual
20947 2003-07-15 Miguel de Icaza <miguel@ximian.com>
20949 * class.cs (MethodData.Define): While checking if a method is an
20950 interface implementation, improve the test: If we are not public
20951 (use new test here: use the computed MethodAttributes directly,
20952 instead of the parsed modifier flags) check if the `implementing'
20953 method comes from an interface or not.
20955 * pending.cs (VerifyPendingMethods): Slightly better error
20958 * makefile: add test target that does the mcs bootstrap.
20960 2003-07-16 Ravi Pratap <ravi@ximian.com>
20962 * interface.cs (Define): Do nothing here since there are no
20963 members to populate etc. Move the attribute emission out of here
20964 since this was just totally the wrong place to put it. Attribute
20965 application happens during the 'Emit' phase, not in the 'Define'
20968 (Emit): Add this method and move the attribute emission here
20970 * rootcontext.cs (EmitCode): Call the Emit method on interface
20973 2003-07-14 Ravi Pratap M <ravi@ximian.com>
20975 * expression.cs (OverloadResolve): Report error only if Location
20976 is not 'Null' which means that there was a probe going on.
20978 2003-07-14 Martin Baulig <martin@ximian.com>
20980 * expression.cs (ConditionalLogicalOperator): New public class to
20981 implement user defined conditional logical operators.
20982 This is section 14.11.2 in the spec and bug #40505.
20984 2003-07-14 Martin Baulig <martin@ximian.com>
20986 * ecore.cs (FieldExpr.DoResolveLValue): Fixed bug #46198.
20988 2003-07-14 Martin Baulig <martin@ximian.com>
20990 * codegen.cs (EmitContext.InFixedInitializer): New public field.
20992 * ecore.cs (IVariable.VerifyFixed): New interface method.
20994 * expression.cs (Unary.ResolveOperator): When resolving the `&'
20995 operator, check whether the variable is actually fixed. Fixes bug
20996 #36055. Set a variable definitely assigned when taking its
20997 address as required by the spec.
20999 * statement.cs (LocalInfo.IsFixed): New field.
21000 (LocalInfo.MakePinned): Set `IsFixed' to true.
21002 2003-07-14 Ravi Pratap M <ravi@ximian.com>
21004 * attribute.cs (Attribute.Resolve): While doing a Member lookup
21005 for .ctors, ensure that we only ask for members declared in the
21006 attribute type (BindingFlags.DeclaredOnly).
21010 * expression.cs (Error_WrongNumArguments): Report error 1501
21011 correctly the way CSC does.
21013 2003-07-13 Martin Baulig <martin@ximian.com>
21015 * expression.cs (MemberAccess.ResolveAsTypeStep): Try to do a type
21016 lookup on the fully qualified name, to make things like "X.X" work
21017 where "X.X" is a fully qualified type name, but we also have a
21018 namespace "X" in the using list. Fixes #41975.
21020 2003-07-13 Martin Baulig <martin@ximian.com>
21022 * assign.cs (Assign.GetEmbeddedAssign): New protected virtual
21023 function. If we're a CompoundAssign, we need to create an embedded
21024 CompoundAssign, not an embedded Assign.
21025 (Assign.DoResolve): Make this work for embedded CompoundAssign's.
21028 2003-07-13 Martin Baulig <martin@ximian.com>
21030 * typemanager.cs (TypeManager.IsNestedChildOf): Make this actually
21031 work to fix bug #46088.
21033 2003-07-13 Ravi Pratap <ravi@ximian.com>
21035 * class.cs (Operator.Emit): Do not emit attributes here - it is
21036 taken care of by the Method class that we delegate too. This takes
21037 care of bug #45876.
21039 2003-07-10 Martin Baulig <martin@ximian.com>
21041 * expression.cs (TypeOfVoid): New class.
21042 (TypeOf): Report a CS0673 if it's System.Void. Fixes #42264.
21044 2003-07-10 Martin Baulig <martin@ximian.com>
21046 * class.cs (MethodCore.DoDefineParameters): Added CS0225 check;
21049 2003-07-10 Martin Baulig <martin@ximian.com>
21051 * rootcontext.cs (RootContext.NamespaceLookup): Take a DeclSpace,
21052 not a NamespaceEntry, so we can use DeclSpace.CheckAccessLevel().
21054 * decl.cs (DeclSpace.FindType): Use DeclSpace.CheckAccessLevel().
21056 * typemanager.cs (TypeManager.IsAccessibleFrom): Removed.
21058 2003-07-10 Martin Baulig <martin@ximian.com>
21060 * expression.cs (ArrayCreation): Don't use a byte blob for arrays
21061 of decimal. Fixes #42850.
21063 NOTE: I also fixed the created byte blob, but this doesn't work on
21064 the MS runtime and csc never produces any byte blobs for decimal
21067 2003-07-10 Martin Baulig <martin@ximian.com>
21069 * statement.cs (StructInfo.GetStructInfo): Catch deep cycles in
21070 structs; fixes #32068.
21071 (Block.AddChildVariableNames): Fixed #44302.
21073 2003-07-07 Gonzalo Paniagua Javier <gonzalo@ximian.com>
21075 * namespace.cs: fixed compilation with csc. It's bugzilla #44302.
21077 2003-07-07 Miguel de Icaza <miguel@ximian.com>
21079 * attribute.cs: And this test is onger needed.
21081 2003-07-08 Martin Baulig <martin@ximian.com>
21083 * rootcontext.cs (RootContext.NamespaceLookup): Ignore
21084 inaccessible types. Fixes #36313.
21086 * decl.cs (DeclSpace.FindType): Ignore inaccessible types.
21088 * namespace.cs (NamespaceEntry): Create implicit entries for all
21089 namespaces; ie. if we have `namespace N1.N2.N3 { ... }', we create
21090 implicit entries for N1.N2 and N1.
21092 2003-07-08 Martin Baulig <martin@ximian.com>
21094 Rewrote the handling of namespaces to fix a lot of the issues
21095 wrt. `using' aliases etc.
21097 * namespace.cs (Namespace): Splitted this class into a
21098 per-assembly `Namespace' and a per-file `NamespaceEntry'.
21100 * typemanager.cs (TypeManager.IsNamespace): Removed.
21101 (TypeManager.ComputeNamespaces): Only compute namespaces from
21102 loaded assemblies here, not the namespaces from the assembly we're
21103 currently compiling.
21105 2003-07-08 Martin Baulig <martin@ximian.com>
21107 * rootcontext.cs, class.cs: Fixed the CS1530 reporting.
21109 2003-07-07 Miguel de Icaza <miguel@ximian.com>
21111 * typemanager.cs: Reverted patch from Gonzalo, my previous patch
21114 I thought about the memory savings here, but LookupTypeReflection
21115 is used under already very constrained scenarios. Compiling
21116 corlib or mcs only exposes one hit, so it would not really reduce
21117 any memory consumption.
21119 2003-07-07 Gonzalo Paniagua Javier <gonzalo@ximian.com>
21121 * typemanager.cs: fixes bug #45889 by only adding public types from
21122 other assemblies to the list of known types.
21124 2003-07-07 Miguel de Icaza <miguel@ximian.com>
21126 * attribute.cs (Attribute.Resolve): Add call to CheckAccessLevel
21127 on the type we resolved.
21129 2003-07-05 Martin Baulig <martin@ximian.com>
21131 * pending.cs (PendingImplementation.ParentImplements): Don't
21132 create the proxy if the parent is abstract.
21134 * class.cs (TypeContainer.DefineIndexers): Process explicit
21135 interface implementations first. Fixes #37714.
21137 2003-07-04 Miguel de Icaza <miguel@ximian.com>
21139 * expression.cs (MemberAccess.ResolveMemberAccess): Events are
21140 defined recursively; but since we modify the input parameters
21141 (left is set to `this' temporarily), we reset this value if the
21142 left_is_explicit is false, which gives the original semantics to
21145 * literal.cs (NullPointer): new class used to represent a null
21146 literal in a pointer context.
21148 * convert.cs (Convert.ImplicitReferenceConversion): Is the target
21149 type is a pointer, use a NullPointer object instead of a
21150 NullLiteral. Closes 43687
21152 (ExplicitConversion): Convert pointer values using
21153 the conv opcode to the proper type.
21155 * ecore.cs (New): change ValueTypeVariable property into a method,
21156 that returns whether the valuetype is suitable for being used.
21158 * expression.cs (Binary.DoNumericPromotions): Only return if we
21159 the int constant was a valid uint, and we can return both left and
21160 right as uints. If not, we continue processing, to trigger the
21161 type conversion. This fixes 39018.
21163 * statement.cs (Block.EmitMeta): During constant resolution, set
21164 the CurrentBlock property on the emitcontext, so that we resolve
21165 constants propertly.
21167 2003-07-02 Martin Baulig <martin@ximian.com>
21169 * codegen.cs (EmitContext.NeedExplicitReturn): New public variable.
21170 (EmitContext.EmitTopBlock): Emit an explicit return if it's set.
21172 * statement.cs (Try.Resolve): Set ec.NeedExplicitReturn rather
21173 than emitting it here.
21175 * statement.cs: Fixed some more flow analysis bugs.
21177 2003-07-02 Martin Baulig <martin@ximian.com>
21179 * class.cs (MethodData.Define): When implementing interface
21180 methods, set Final unless we're Virtual.
21182 * decl.cs (MemberCore.CheckMethodAgainstBase): Make the CS0506
21183 check work for interface methods.
21185 2003-07-01 Martin Baulig <martin@ximian.com>
21187 * ecore.cs (EmitContext.This): Replaced this property with a
21188 GetThis() method which takes a Location argument. This ensures
21189 that we get the correct error location for a CS0188.
21191 2003-07-01 Miguel de Icaza <miguel@ximian.com>
21193 * ecore.cs: (Convert.ConvertIntLiteral): Add test for
21194 ImplicitStandardConversion.
21196 * class.cs (TypeContainer.GetClassBases): Small bug fix for 45649.
21198 2003-07-01 Zoltan Varga <vargaz@freemail.hu>
21200 * expression.cs (ResolveOperator): Fix Concat (string, string, string)
21203 2003-06-30 Miguel de Icaza <miguel@ximian.com>
21205 * class.cs (Constructor.Define): Turn off initlocals for unsafe
21208 (MethodData.Define): Turn off initlocals for unsafe methods.
21210 2003-06-29 Miguel de Icaza <miguel@ximian.com>
21212 * decl.cs (DeclSpace.CheckAccessLevel): Make this routine
21213 complete; Fixes #37521.
21215 * delegate.cs: Use Modifiers.TypeAttr to compute the
21216 TypeAttributes, instead of rolling our own. This makes the flags
21217 correct for the delegates.
21219 2003-06-28 Miguel de Icaza <miguel@ximian.com>
21221 * class.cs (Constructor.Define): Set the private flag for static
21222 constructors as well.
21224 * cs-parser.jay (statement_expression): Set the return value to
21225 null, to avoid a crash when we catch an error.
21227 2003-06-24 Miguel de Icaza <miguel@ximian.com>
21229 * cs-parser.jay: Applied patch from Jackson that adds support for
21230 extern and unsafe modifiers to destructor declarations.
21232 * expression.cs: Report error 21 if the user is trying to index a
21235 * driver.cs: Add an error message, suggested by the bug report.
21237 * class.cs (TypeContainer.Emit): Only call EmitFieldInitializers
21238 if we do not have a ": this ()" constructor initializer. Fixes 45149
21240 2003-06-14 Miguel de Icaza <miguel@ximian.com>
21242 * namespace.cs: Add some information to reduce FAQs.
21244 2003-06-13 Miguel de Icaza <miguel@ximian.com>
21246 * cfold.cs (BinaryFold): BitwiseAnd, BitwiseOr: handle other
21247 underlying enumeration types. Fixes #43915.
21249 * expression.cs: Treat ushort/short as legal values to be used in
21250 bitwise operations.
21252 Wed Jun 4 13:19:04 CEST 2003 Paolo Molaro <lupus@ximian.com>
21254 * delegate.cs: transfer custom attributes for paramenters from
21255 the delegate declaration to Invoke and BeginInvoke.
21257 Tue Jun 3 11:11:08 CEST 2003 Paolo Molaro <lupus@ximian.com>
21259 * attribute.cs: handle custom marshalers and emit marshal info
21262 2003-05-28 Hector E. Gomez Morales <hgomez_36@flashmail.com>
21264 * makefile.gnu: Added anonymous.cs to the compiler sources.
21266 2003-05-28 Miguel de Icaza <miguel@ximian.com>
21268 * iterators.cs: Change the name of the proxy class to include two
21271 * cs-parser.jay: Update grammar to include anonymous methods.
21273 * anonymous.cs: new file.
21275 2003-05-27 Miguel de Icaza <miguel@ximian.com>
21277 * class.cs (Field.Define): Add missing test for pointers and
21280 2003-05-27 Ravi Pratap <ravi@ximian.com>
21282 * expression.cs (ArrayAccess.GetStoreOpCode): For System.IntPtr,
21283 we use the stobj opcode.
21285 (ArrayCreation.EmitDynamicInitializers): Revert Miguel's patch
21286 since it wasn't the correct fix.
21288 It still is puzzling that we are required to use stobj for IntPtr
21289 which seems to be a ValueType.
21291 2003-05-26 Miguel de Icaza <miguel@ximian.com>
21293 * ecore.cs (SimpleName.SimpleNameResolve): Consider using aliases
21294 during regular simple name resolution. Now, the trick is that
21295 instead of returning for processing the simplename, we do a
21296 TypeManager.LookupType (ie, a rooted lookup as opposed to a
21297 contextual lookup type). If a match is found, return that, if
21298 not, return for further composition.
21300 This fixes long-standing 30485.
21302 * expression.cs (ArrayCreation.EmitDynamicInitializers): When
21303 using the address to initialize an object, do an Stobj instead of
21304 using the regular Stelem.
21306 (IndexerAccess.Emit, IndexerAccess.EmitAssign):
21307 Pass `is_base_indexer' to Invocation.EmitCall instead of false.
21308 Because if we are a BaseIndexerAccess that value will be true.
21311 * statement.cs (GotoCase.Resolve): Return after reporting an
21312 error, do not attempt to continue.
21314 * expression.cs (PointerArithmetic.Emit): If our operand is a
21315 long, convert our constants to match the operand before
21316 multiplying. Convert to I type before adding. Fixes 43670.
21318 2003-05-14 Ravi Pratap <ravi@ximian.com>
21320 * enum.cs (ImplicitConversionExists) : Rename to
21321 ImplicitEnumConversionExists to remove ambiguity.
21323 * ecore.cs (NullCast): New type of cast expression class which
21324 basically is very similar to EmptyCast with the difference being
21325 it still is a constant since it is used only to cast a null to
21327 (eg. (string) null)
21329 * convert.cs (ImplicitReferenceConversion): When casting a null
21330 literal, we return a NullCast.
21332 * literal.cs (NullLiteralTyped): Remove - I don't see why this
21333 should be around anymore.
21335 The renaming (reported was slightly wrong). Corrections:
21337 ConvertImplicitStandard -> ImplicitConversionStandard
21338 ConvertExplicitStandard -> ExplicitConversionStandard
21340 * expression.cs (StaticCallExpr.MakeSimpleCall): Resolve arguments
21341 before passing them in !
21343 * convert.cs (ImplicitConversionStandard): When comparing for
21344 equal expr and target types, ensure that expr is not a
21347 In general, we must not be checking (expr_type ==
21348 target_type) in the top level conversion methods
21349 (ImplicitConversion, ExplicitConversion etc). This checking is
21350 done in the methods that they delegate to.
21352 2003-05-20 Miguel de Icaza <miguel@ximian.com>
21354 * convert.cs: Move Error_CannotConvertType,
21355 ImplicitReferenceConversion, ImplicitReferenceConversionExists,
21356 ImplicitNumericConversion, ImplicitConversionExists,
21357 ImplicitUserConversionExists, StandardConversionExists,
21358 FindMostEncompassedType, FindMostSpecificSource,
21359 FindMostSpecificTarget, ImplicitUserConversion,
21360 ExplicitUserConversion, GetConversionOperators,
21361 UserDefinedConversion, ConvertImplicit, ConvertImplicitStandard,
21362 TryImplicitIntConversion, Error_CannotConvertImplicit,
21363 ConvertImplicitRequired, ConvertNumericExplicit,
21364 ExplicitReferenceConversionExists, ConvertReferenceExplicit,
21365 ConvertExplicit, ConvertExplicitStandard from the ecore.cs into
21368 Perform the following renames:
21370 StandardConversionExists -> ImplicitStandardConversionExists
21371 ConvertImplicit -> ImplicitConversion
21372 ConvertImplicitStandard -> ImplicitStandardConversion
21373 TryImplicitIntConversion -> ImplicitIntConversion
21374 ConvertImplicitRequired -> ImplicitConversionRequired
21375 ConvertNumericExplicit -> ExplicitNumericConversion
21376 ConvertReferenceExplicit -> ExplicitReferenceConversion
21377 ConvertExplicit -> ExplicitConversion
21378 ConvertExplicitStandard -> ExplicitStandardConversion
21380 2003-05-19 Martin Baulig <martin@ximian.com>
21382 * statement.cs (TypeInfo.StructInfo): Made this type protected.
21383 (TypeInfo): Added support for structs having structs as fields.
21385 * ecore.cs (FieldExpr): Implement IVariable.
21386 (FieldExpr.DoResolve): Call VariableInfo.GetSubStruct() to get the
21387 VariableInfo for the field.
21389 2003-05-18 Martin Baulig <martin@ximian.com>
21391 * expression.cs (This.DoResolve): Report a CS0027 if we're
21392 emitting a field initializer.
21394 2003-05-18 Martin Baulig <martin@ximian.com>
21396 * expression.cs (This.ResolveBase): New public function.
21397 (This.DoResolve): Check for CS0188.
21399 * codegen.cs (EmitContext.This): Just call This.ResolveBase(), not
21402 * ecore.cs (MethodGroupExpr.DoResolve): Set the
21403 `instance_expression' to null if we don't have any non-static
21406 2003-05-18 Martin Baulig <martin@ximian.com>
21408 Reworked the way how local variables and parameters are handled by
21409 the flow analysis code.
21411 * statement.cs (TypeInfo, VariableMap): New public classes.
21412 (VariableInfo): New public class. This is now responsible for
21413 checking whether a variable has been assigned. It is used for
21414 parameters and local variables.
21415 (Block.EmitMeta): Take the InternalParameters as argument; compute
21416 the layout of the flow vectors here.
21417 (Block.LocalMap, Block.ParameterMap): New public properties.
21418 (FlowBranching): The .ctor doesn't get the InternalParameters
21419 anymore since Block.EmitMeta() now computes the layout of the flow
21421 (MyStructInfo): This class is now known as `StructInfo' and nested
21422 in `TypeInfo'; we don't access this directly anymore.
21424 * ecore.cs (IVariable): Added `VariableInfo VariableInfo'
21425 property and removed IsAssigned(), IsFieldAssigned(),
21426 SetAssigned() and SetFieldAssigned(); we now call them on the
21427 VariableInfo so we don't need to duplicate this code everywhere.
21429 * expression.cs (ParameterReference): Added `Block block' argument
21431 (LocalVariableReference, ParameterReference, This): The new
21432 VariableInfo class is now responsible for all the definite
21435 * codegen.cs (EmitContext.IsVariableAssigned, SetVariableAssigned,
21436 IsParameterAssigned, SetParameterAssigned): Removed.
21438 2003-05-18 Martin Baulig <martin@ximian.com>
21440 * typemanager.cs (InitCoreTypes): Try calling
21441 SetCorlibTypeBuilders() with 4 args; if that fails, fall back to
21442 the 3-args-version. Corlib now also needs our `void_type'.
21443 (GetMethod): Added overloaded version which takes an optional
21444 `bool report_errors' to allow lookups of optional methods.
21446 2003-05-12 Martin Baulig <martin@ximian.com>
21448 * statement.cs (VariableInfo): Renamed to LocalInfo since it's
21449 only used for locals and not for parameters.
21451 2003-05-12 Miguel de Icaza <miguel@ximian.com>
21453 * support.cs (InternalParameters.ParameterType): Return the
21454 ExternalType of the parameter.
21456 * parameter.cs (Parameter.ExternalType): drop the two arguments,
21459 2003-05-11 Miguel de Icaza <miguel@ximian.com>
21461 * class.cs (MethodData.Define): Do not set the `newslot' on
21462 interface members, if they are also flagged as "override".
21464 * expression.cs (UnaryMutator.EmitCode): Simple workaround to emit
21465 better code for ++i and i++. This only works for static fields
21466 and local variables.
21468 * typemanager.cs (LookupDeclSpace): Add new method, sometimes we
21469 want to pull the DeclSpace out of the builder_to_declspace instead
21470 of the TypeBuilder (like in TypeContainer.FindMembers).
21472 * class.cs (TypeContainer.FindMembers): Use LookupDeclSpace
21473 instead of LookupTypeContainer. Fixes the crash on .NET for
21474 looking up interface members.
21476 * const.cs: Create our own emit context during the Definition
21477 stage, so that constants are evaluated in the proper context, when
21478 a recursive definition happens.
21480 2003-05-11 Martin Baulig <martin@ximian.com>
21482 * statement.cs (Block.CreateSwitchBlock): New method. Creates a
21483 new block for a switch section.
21484 (Block.AddLabel, Block.LookupLabel): If we're a switch section, do
21485 the adding/lookup in the switch block. Fixes #39828.
21487 2003-05-09 Miguel de Icaza <miguel@ximian.com>
21489 * expression.cs (UnaryMutator.LoadOneAndEmitOp): Missing
21490 functionality: I needed to convert the data after I had performed
21491 the add/sub operation into the operands type size.
21493 * ecore.cs (ImplicitReferenceConversion): When boxing an interface
21494 pass the type for the box operation, otherwise the resulting
21495 object would have been of type object.
21497 (BoxedCast): Add constructor to specify the type to box as.
21499 2003-05-07 Miguel de Icaza <miguel@ximian.com>
21501 * iterators.cs: I was reusing the `count' variable inadvertently,
21502 take steps to not allow this to happen.
21504 2003-05-06 Miguel de Icaza <miguel@ximian.com>
21506 * attribute.cs (Attribute.Resolve): Params attributes are encoded
21507 by creating an array at the point where the params starts and
21508 putting all those arguments there, then adjusting the size of the
21511 2003-05-05 Miguel de Icaza <miguel@ximian.com>
21513 * expression.cs (New.AddressOf): Implement interface
21514 IMemoryLocation. This is used when the `new' operator is used in
21515 the context of an invocation to a method on a value type.
21517 See http://bugzilla.ximian.com/show_bug.cgi?id=#42390 for an
21520 * namespace.cs: Also check the using aliases here.
21522 * driver.cs: Move the test for using validity after the types have
21523 been entered, so we do a single pass that also includes the using
21526 * statement.cs (Try.Resolve): Avoid crashing if there is a failure
21527 in the regular case. CreateSiblingForFinally is doing extra
21530 * attribute.cs (GetAttributeArgumentExpression): Store the result
21531 on an out value, and use the return value to indicate failure
21532 instead of using null (which is a valid return for Constant.GetValue).
21534 * statement.cs: Perform the analysis flow for the increment
21535 portion after the statement, because this will be the real flow of
21536 execution. Fixes #42385
21538 * codegen.cs (EmitContext.EmitArgument,
21539 EmitContext.EmitStoreArgument): New helper functions when the
21540 RemapToProxy flag is set.
21542 * expression.cs (ParameterReference.EmitLdarg): Expose this useful
21545 Add support for remapping parameters.
21547 * iterators.cs: Propagate parameter values; Store parameter
21548 values in the proxy classes.
21550 2003-05-04 Miguel de Icaza <miguel@ximian.com>
21552 * ecore.cs (FieldExpr): Fix an obvious bug. static fields do not
21553 need a proxy reference; I do not know what I was thinking
21555 * cs-parser.jay (constructor_initializer): catch another error,
21556 and display nice message.
21558 (field_declaration): catch void field declaration
21559 to flag a better error.
21561 * class.cs (MemberBase.CheckBase): Report an error instead of a
21562 warning if a new protected member is declared in a struct.
21563 (Field.Define): catch the error of readonly/volatile.
21565 * ecore.cs (FieldExpr.EmitAssign): reuse the field lookup.
21567 (FieldExpr.AddressOf): ditto. Catch error where the address of a
21568 volatile variable is taken
21570 2003-05-02 Miguel de Icaza <miguel@ximian.com>
21572 * statement.cs (Fixed.Resolve): Report an error if we are not in
21575 2003-05-01 Miguel de Icaza <miguel@ximian.com>
21577 * typemanager.cs: reuse the code that handles type clashes for
21578 delegates and enumerations.
21580 * class.cs (Report28): Always report.
21582 * expression.cs (EncodeAsAttribute): Allow nulls here.
21584 2003-04-28 Miguel de Icaza <miguel@ximian.com>
21586 * attribute.cs (Attribute.GetAttributeArgumentExpression): Moved
21587 the functionality for testing whether an expression is valid for
21588 an attribute here. Also handle the case of arrays of elements
21591 * expression.cs (ArrayCreation.EncodeAsAttribute): Add support for
21592 encoding a linear array into an array of objects that are suitable
21593 to be passed to an CustomAttributeBuilder.
21595 * delegate.cs: Check unsafe types being used outside of an Unsafe context.
21597 * ecore.cs: (FieldExpr): Handle field remapping here.
21599 * iteratators.cs: Pass the instance variable (if the method is an
21600 instance method) to the constructors, so we can access the field
21601 variables on the class.
21603 TODO: Test this with structs. I think the THIS variable on
21604 structs might have to be a pointer, and not a refenrece
21606 2003-04-27 Miguel de Icaza <miguel@ximian.com>
21608 * codegen.cs (EmitContext.Mapvariable): Adds a mechanism to map
21609 local variables to fields in a proxy class.
21611 * iterators.cs (PopulateProxy): Rename our internal fields to
21613 Create a <THIS> field if we are an instance method, so we can
21614 reference our parent container variables.
21615 (MapVariable): Called back from the EmitContext code to enter a
21616 new variable to field mapping into the proxy class (we just create
21620 (LocalVariableReference.{Emit,EmitAssign,AddressOf}): Add support
21621 for using the remapped locals to fields.
21623 I placed the code here, because that gives the same semantics to
21624 local variables, and only changes the Emit code.
21626 * statement.cs (Fixed.Resolve): it is not allowed to have fixed
21627 statements inside iterators.
21628 (VariableInfo): Add a FieldBuilder for the cases when we are
21629 remapping local variables to fields in a proxy class
21631 * ecore.cs (SimpleNameResolve): Avoid testing two times for
21632 current_block != null.
21634 * statement.cs (Swithc.SimpleSwitchEmit): Removed code that did
21635 not cope with strings, as it has been moved to the
21636 TableSwitchEmit. Fixed bug in switch generation.
21638 * expression.cs (New.DoResolve): Provide more context for the user
21639 when reporting an error.
21641 * ecore.cs (Expression.LoadFromPtr): Use ldind_i when loading
21644 * expression.cs (MemberAccess.DoResolve): When we get a type back,
21645 check the permissions for it. Note than in a type-resolution
21646 context the check was already present in DeclSpace.ResolveType,
21647 but was missing from the MemberAccess.
21649 (ArrayCreation.CheckIndices): warn if the user has
21650 more nested levels of expressions, but there are no more
21651 dimensions specified. Avoids crash on bug 41906.
21653 2003-04-26 Miguel de Icaza <miguel@ximian.com>
21655 * statement.cs (Block): replace Implicit bool, for a generic
21657 New flag: `Unchecked'. This is used during the EmitMeta phase
21658 (which is out-of-line with the regular Resolve/Emit process for a
21659 statement, as this is done ahead of time, but still gets a chance
21660 to call constant resolve).
21662 (Block.Flags): new enum for adding a new flag.
21664 (Block.EmitMeta): track the state of unchecked.
21666 (Unchecked): Set the "UnChecked" flags on any blocks we enclose,
21667 to enable constant resolution to work there as well.
21669 2003-04-22 Miguel de Icaza <miguel@ximian.com>
21671 * typemanager.cs (ienumerable_type): Also look up
21672 System.Collections.IEnumerable.
21674 2003-04-21 Miguel de Icaza <miguel@ximian.com>
21676 TODO: Test more than one conditional per method.
21678 * class.cs (Indexer.Define): Report the location where the user is
21679 referencing the unsupported feature.
21681 (MethodData): Overload the use of `conditionals' to
21682 minimize the creation of needless ArrayLists. This saves roughly
21683 212kb on my machine.
21685 (Method): Implement the new IIteratorContainer interface.
21686 (Method.SetYields): Implement the method by setting the ModFlags
21687 to contain METHOD_YIELDS.
21689 * expression.cs (Unary.ResolveOperator): Use expr_type, not Expr,
21690 which just got set to null.
21692 * iterators.cs: New file.
21694 (Yield, YieldBreak): New statements.
21696 * statement.cs (Return.Resolve): Flag an error if we are used in
21697 an iterator method.
21699 * codegen.cs (InIterator): New flag set if the code is being
21700 compiled in an iterator method.
21702 * modifiers.cs: New flag METHOD_YIELDS. This modifier is an
21703 internal modifier, and we just use it to avoid adding extra
21704 fields, as this is seldom used.
21706 * cs-parser.jay: Add yield_statement (yield and yield break).
21708 * driver.cs: New flag -v2 to turn on version 2 features.
21710 * cs-tokenizer.cs (Tokenizer): Add yield and __yield to the
21711 hashtable when v2 is enabled.
21713 2003-04-20 Miguel de Icaza <miguel@ximian.com>
21715 * typemanager.cs (TypeManager.NamespaceClash): Use to check if
21716 there is already a namespace defined with this name.
21718 (TypeManager.InitCoreTypes): Remove the temporary workaround, as
21719 people upgraded their corlibs.
21721 (TypeManager.CoreLookupType): Use LookupTypeDirect, as we
21722 always use fully qualified types, no need to use the compiler
21725 (TypeManager.IsNamespace): Use binarysearch.
21727 * class.cs (AddClass, AddStruct, AddInterface, AddEvent,
21728 AddDelegate): I did not quite use the new IsValid API properly: I
21729 have to pass the short-name and the fullname. I was passing only
21730 the basename instead of the fullname sometimes.
21732 (TypeContainer.DefineType): call NamespaceClash.
21734 * interface.cs (Interface.DefineType): use NamespaceClash before
21737 * delegate.cs (Delegate.DefineType): use NamespaceClash before
21740 * enum.cs: (Enum.DefineType): use NamespaceClash before
21743 * typemanager.cs (: 3-line patch that gives us some tasty 11%
21744 speed increase. First, use the negative_hits cache when we get a
21745 negative. Second, add the type with its full original name
21746 instead of the new . and + encoded name (reflection uses + to
21747 separate type from a nested type). Use LookupTypeReflection
21748 directly which bypasses the type->name hashtable (that we already
21749 know does not contain the type.
21751 * decl.cs (DeclSpace.ResolveTypeExpr): track the
21752 location/container type.
21754 * driver.cs: When passing utf8, use directly the UTF8Encoding.
21756 2003-04-19 Miguel de Icaza <miguel@ximian.com>
21758 * decl.cs (ResolveTypeExpr): Mirror check acess here too.
21760 * delegate.cs (NewDelegate.Resolve): Test whether an instance
21761 method is being referenced in the method group from a static
21762 context, and report error 120 if so.
21764 * expression.cs, ecore.cs (Error_UnexpectedKind): New name for
21767 * typemanager.cs: Add intermediate namespaces (if a namespace A.B
21768 is created, we create the A namespace).
21770 * cs-parser.jay: A namespace also introduces a DeclarationFound.
21773 2003-04-18 Miguel de Icaza <miguel@ximian.com>
21775 * typemanager.cs (GetReferenceType, GetPointerType): In .NET each
21776 invocation to ModuleBuilder.GetType with the same values will
21777 return a new type instance, so we need to cache its return
21780 * expression.cs (Binary.ResolveOperator): Only allow the compare
21781 operators on enums if they are of the same type.
21783 * ecore.cs (Expression.ImplicitReferenceConversion): handle target
21784 types of ValueType on their own case. Before we were giving them
21785 the same treatment as objects.
21787 * decl.cs (DeclSpace.IsValid): IsValid takes the short name and
21788 fullname. Short name is used to compare against container name.
21789 Fullname is used to check against defined namespace names.
21791 * class.cs (AddProperty, AddField, AddClass, AddStruct, AddEnum,
21792 AddDelegate, AddEvent): Pass new parameter to DeclSpace.IsValid
21794 (Method.CheckBase): Call parent.
21795 (MemberBase.CheckBase): Check for protected members on sealed
21797 (PropertyBase.CheckBase): Call parent.
21798 (Field.Define): Call parent.
21800 * report.cs: Negative error codes are now mapped to 8000 - code,
21801 so that the display is render more nicely.
21803 * typemanager.cs: Do not use try/catch, instead report a regular
21806 (GetPointerType, GetReferenceType): These methods provide
21807 mechanisms to obtain the T* and T& from a T. We had the code
21808 previously scattered around the code base, and it also used
21809 TypeManager.LookupType that would go through plenty of caches.
21810 This one goes directly to the type source.
21812 In some places we did the Type.GetType followed by
21813 ModuleBuilder.GetType, but not in others, so this unifies the
21814 processing as well.
21816 * namespace.cs (VerifyUsing): Perform a non-lazy approach to using
21817 statements now that we have namespace information.
21819 * typemanager.cs (IsNamespace): New method, returns whether the
21820 string presented is a namespace or not.
21822 (ComputeNamespaces): New public entry point, computes the list of
21823 available namespaces, using the GetNamespaces API call in Mono, or
21824 the slower version in MS.NET.
21826 Now before we start the semantic analysis phase, we have a
21827 complete list of namespaces including everything that the user has
21830 Deleted old code to cache namespaces in .nsc files.
21832 2003-04-17 Miguel de Icaza <miguel@ximian.com>
21834 * class.cs: (TypeContainer.DefineDefaultConstructor): Use the
21835 class/struct location definition Location for the implicit
21836 constructor location.
21838 (Operator.Define): Use the location of the operator for the
21839 implicit Method definition.
21841 (Constructor.Emit): use the constructor location for the implicit
21842 base initializer constructor.
21844 * ecore.cs: Remove ITypeExpression. This interface is now gone,
21845 and the Expression class now contains two new methods:
21847 ResolveAsTypeStep and ResolveAsTypeTerminal. This is used to
21848 isolate type lookup from the rest of the resolution process.
21850 Since we use Expressions to hold type definitions due to the way
21851 we parse the input we have historically overloaded Resolve to
21852 perform the Type lookups if a special flag is passed. Now this is
21853 eliminated and two methods take their place.
21855 The differences in the two methods between xStep and xTerminal is
21856 that xStep is involved in our current lookup system that uses
21857 SimpleNames to compose a name, while xTerminal is used just to
21858 catch the case where the simplename lookup failed.
21860 2003-04-16 Miguel de Icaza <miguel@ximian.com>
21862 * expression.cs (ResolveMemberAccess): Remove redundant code.
21863 TypeExpr expressions are always born fully resolved.
21865 * interface.cs (PopulateMethod): Do not lookup the types twice.
21866 We were doing it once during SemanticAnalysis and once during
21869 * cs-parser.jay: Due to our hack in the grammar, things like A.B[]
21870 in local variable type definitions, were being returned as a
21871 SimpleName (we decomposed everything into a string), that is
21872 because primary_expression was being used instead of a type in the
21873 grammar (reduce/reduce conflicts).
21875 The part that was wrong is that we converted the expression into a
21876 string (an oversimplification in one hand, compounded with primary
21877 expressions doing string concatenation).
21883 Would return "A.B.C[]" as a SimpleName. This stopped things like
21884 using clauses from working on this particular context. And a type
21885 was being matched directly against "A.B.C[]".
21887 We now use the correct approach, and allow for ComposedCast to be
21888 part of the unary expression. So the "A.B.C []" become a composed
21889 cast of "A.B.C" (as a nested group of MemberAccess with a
21890 SimpleName at the end) plus the rank composition "[]".
21894 2003-04-10 Miguel de Icaza <miguel@ximian.com>
21896 * decl.cs (CheckAccessLevel): Implement the NestedPrivate rules
21897 for the access level checking.
21899 * class.cs: Cosmetic changes. Renamed `TypeContainer parent' to
21900 `TypeContainer container', because I kept getting confused when I
21901 was debugging this code.
21903 * expression.cs (Indexers): Instead of tracking getters/setters,
21904 we now track them in parallel. We create one arraylist less, but
21905 most importantly it is possible now for the LValue code to find a
21906 matching get for a set.
21908 (IndexerAccess.DoResolveLValue): Update the code.
21909 GetIndexersForType has been modified already to extract all the
21910 indexers from a type. The code assumed it did not.
21912 Also make the code set the correct return type for the indexer.
21913 This was fixed a long time ago for properties, but was missing for
21914 indexers. It used to be void_type.
21916 (Binary.Emit): Test first for doubles instead of
21917 floats, as they are more common.
21919 (Binary.EmitBranchable): Use the .un version of the branch opcodes
21920 when dealing with floats and the <=, >= operators. This fixes bug
21923 * statement.cs (Foreach.EmitArrayForeach): bug fix: The code used
21924 to load the array value by emitting a load on the foreach variable
21925 type. This was incorrect.
21927 We now emit the code to load an element using the the array
21928 variable type, and then we emit the conversion operator.
21932 2003-04-10 Zoltan Varga <vargaz@freemail.hu>
21934 * attribute.cs: Avoid allocation of ArrayLists in the common case.
21936 2003-04-09 Miguel de Icaza <miguel@ximian.com>
21938 * class.cs (MethodSignature.InheritableMemberSignatureCompare):
21939 test for protection before we test for signatures.
21941 (MethodSignature.ToString): implement.
21943 * expression.cs (Unary.TryReduceNegative): Add missing minus sign
21944 to the case where we reduced into a LongConstant.
21946 * decl.cs (CheckAccessLevel): If the type is an array, we can not
21947 depend on whether the information is acurrate, because the
21948 Microsoft runtime will always claim that the array type is public,
21949 regardless of the real state.
21951 If the type is a pointer, another problem happens: the type is
21952 reported as non-public in Microsoft.
21954 In both cases we have to call CheckAccessLevel recursively with
21955 the underlying type as the argument to be tested.
21957 2003-04-08 Miguel de Icaza <miguel@ximian.com>
21959 * assign.cs (Assign.Emit): If we are dealing with a compound
21960 assignment expression, we should use the code path that stores the
21961 intermediate result in a temporary value. This fixes #40903.
21963 *expression.cs (Indirection.ToString): Provide ToString method for
21966 2003-04-08 Zoltan Varga <vargaz@freemail.hu>
21968 * class.cs: Null out fields holding references to Block objects so
21969 they can be garbage collected.
21971 * expression.cs (OverloadResolve): Remove unused local.
21973 2003-04-07 Martin Baulig <martin@ximian.com>
21975 * codegen.cs (EmitContext.CurrentFile): New public field.
21976 (EmitContext.Mark): Use the CurrentFile to check whether the
21977 location is in the correct file.
21978 (EmitContext.EmitTopBlock): Initialize CurrentFile here.
21980 2003-04-07 Martin Baulig <martin@ximian.com>
21982 * ecore.cs (Expression.ResolveBoolean): Don't call ec.Mark().
21984 * codegen.cs (EmitContext.EmitTopBlock): Don't call Mark() on the
21985 location. [FIXME: The location argument which gets passed to this
21986 method is sometimes wrong!]
21988 2003-04-07 Nick Drochak <ndrochak@gol.com>
21990 * codegen.cs: Be more verbose when we can't find the symbol writer dll.
21992 2003-04-07 Miguel de Icaza <miguel@ximian.com>
21994 * expression.cs (Indirection.EmitAssign): We were using the
21995 temporary, but returning immediately instead of continuing the
21998 2003-04-06 Martin Baulig <martin@ximian.com>
22000 * ecore.cs (SimpleName.SimpleNameResolve): Don't report an error
22001 if it's a nested child, but also deriving from the outer class.
22004 * typemanager.cs (IsNestedChildOf): Make this work if it's a
22005 nested child, but also deriving from the outer class. See
22007 (FilterWithClosure): We may access private members of the outer
22008 class if we're a nested child and deriving from the outer class.
22009 (RealMemberLookup): Only set `closure_private_ok' if the
22010 `original_bf' contained BindingFlags.NonPublic.
22012 2003-04-05 Martin Baulig <martin@ximian.com>
22014 * statement.cs (FlowBranching.UsageVector.MergeChildren): Fix bug #40670.
22016 2003-04-02 Miguel de Icaza <miguel@ximian.com>
22018 * class.cs (Event.Define): Do not allow abstract events to have
22021 2003-04-01 Miguel de Icaza <miguel@ximian.com>
22023 * cs-parser.jay: Add error productions for ADD/REMOVE missing a
22024 block in event declarations.
22026 * ecore.cs (FieldExpr.AddressOf): If our instance expression is a
22027 value type, get its address.
22029 * expression.cs (Is.Emit): For action `LeaveOnStack' we were
22030 leaving a class on the stack instead of a boolean value (int
22031 0/1). Change the code so we compare against null, and then the
22032 result against zero.
22034 * class.cs (TypeContainer.GetClassBases): We were checking for the
22035 parent class being sealed too late.
22037 * expression.cs (Binary.Emit): For <= and >= when dealing with
22038 floating point values, use cgt.un and clt.un instead of cgt and
22041 2003-04-01 Zoltan Varga <vargaz@freemail.hu>
22043 * statement.cs: Apply the same optimization as MS: skip the
22044 GetEnumerator returning an IEnumerator, and use the one returning a
22045 CharEnumerator instead. This allows us to avoid the try-finally block
22048 2003-03-31 Gaurav Vaish <gvaish_mono@lycos.com>
22050 * cs-parser.jay: Attributes cannot be applied to
22051 namespaces. Fixes #40473
22053 2003-03-31 Gonzalo Paniagua Javier <gonzalo@ximian.com>
22056 (Add*): check if the name is valid using the full name for constants,
22057 fields, properties and events.
22059 2003-03-28 Miguel de Icaza <miguel@ximian.com>
22061 * enum.cs (Enum.DefineType, Enum.IsValidEnumConstant): Also allow
22062 char constants to be part of the enumeration.
22064 * expression.cs (Conditional.DoResolve): Add support for operator
22065 true. Implements the missing functionality from 14.12
22067 * class.cs (TypeContainer.CheckPairedOperators): Report error for missmatch on
22068 operator true/false as required by the spec.
22070 * expression.cs (Unary.ResolveOperator): In LogicalNot, do an
22071 implicit conversion to boolean.
22073 * statement.cs (Statement.ResolveBoolean): A boolean expression is
22074 also one where the type implements `operator true'.
22076 * ecore.cs (Expression.GetOperatorTrue): New helper routine to
22077 get an expression that will invoke operator true based on an
22080 (GetConversionOperators): Removed the hack that called op_True
22083 (Expression.ResolveBoolean): Move this from Statement.
22085 2003-03-17 Miguel de Icaza <miguel@ximian.com>
22087 * ecore.cs (FieldExpr): do not allow initialization of initonly
22088 fields on derived classes
22090 2003-03-13 Martin Baulig <martin@ximian.com>
22092 * statement.cs (Block.Emit): Call ig.BeginScope() and
22093 ig.EndScope() when compiling with debugging info; call
22094 LocalBuilder.SetLocalSymInfo _after_ opening the scope.
22096 2003-03-08 Miguel de Icaza <miguel@ximian.com>
22098 * expression.cs (Indexers): Do not construct immediately, allow
22099 for new members to be appended as we go. Fixes 38143
22101 2003-03-07 Gonzalo Paniagua Javier <gonzalo@ximian.com>
22103 * expression.cs: save/restore context when resolving an unchecked
22106 2003-03-05 Miguel de Icaza <miguel@ximian.com>
22108 * cfold.cs: Catch division by zero in modulus operator during
22111 2003-03-03 Miguel de Icaza <miguel@ximian.com>
22113 * interface.cs (Interface.DefineMembers): Avoid defining members
22116 2003-02-27 Miguel de Icaza <miguel@ximian.com>
22118 * driver.cs: handle the +/- options for -noconfig
22120 * statement.cs (Unckeched.Resolve): Also track the state of
22121 unchecked in the Resolve phase.
22123 2003-02-27 Martin Baulig <martin@ximian.com>
22125 * ecore.cs (Expression.MemberLookup): Don't create a
22126 MethodGroupExpr for something which is not a method. Fixes #38291.
22128 2003-02-25 Miguel de Icaza <miguel@ximian.com>
22130 * class.cs (MemberBase.CheckParameters): Also check that the type
22131 is unmanaged if it is a pointer.
22133 * expression.cs (SizeOf.Resolve): Add location information.
22135 * statement.cs (Block.EmitMeta): Flag error (208) if a pointer to
22136 a managed type is declared.
22138 * expression.cs (Invocation.VerifyArgumentsCompat): Check for the
22139 parameter modifiers as well. Fixes bug 38606
22141 * class.cs: Very sad. Am backing out the speed up changes
22142 introduced by the ArrayList -> Array in the TypeContainer, as they
22143 were not actually that much faster, and introduced a bug (no error
22144 reports on duplicated methods).
22146 * assign.cs (CompoundAssign.DoLResolve): Resolve the original
22147 source first, this will guarantee that we have a valid expression
22148 before calling in lower levels functions that will require a
22149 resolved object. Then use this original_source in the
22150 target.ResolveLValue instead of the original source that was
22153 Another change. Use target.Resolve instead of LValueResolve.
22154 Although we are resolving for LValues, we will let the Assign code
22155 take care of that (it will be called again from Resolve). This
22156 basically allows code like this:
22158 class X { X operator + (X x, object o) {} X this [int idx] { get; set; } }
22159 class Y { void A (X x) { x [0] += o; }
22161 The problem was that the indexer was trying to resolve for
22162 set_Item (idx, object o) and never finding one. The real set_Item
22163 was set_Item (idx, X). By delaying the process we get the right
22168 2003-02-23 Martin Baulig <martin@ximian.com>
22170 * statement.cs (Block.Emit): Override this and set ec.CurrentBlock
22171 while calling DoEmit ().
22173 * codegen.cs (EmitContext.Mark): Don't mark locations in other
22174 source files; if you use the #line directive inside a method, the
22175 compiler stops emitting line numbers for the debugger until it
22176 reaches the end of the method or another #line directive which
22177 restores the original file.
22179 2003-02-23 Martin Baulig <martin@ximian.com>
22181 * statement.cs (FlowBranching.UsageVector.MergeChildren): Fix bug #37708.
22183 2003-02-23 Martin Baulig <martin@ximian.com>
22185 * statement.cs (Block.AddChildVariableNames): We need to call this
22186 recursively, not just for our immediate children.
22188 2003-02-23 Martin Baulig <martin@ximian.com>
22190 * class.cs (Event.Define): Always make the field private, like csc does.
22192 * typemanager.cs (TypeManager.RealMemberLookup): Make events
22193 actually work, fixes bug #37521.
22195 2003-02-23 Miguel de Icaza <miguel@ximian.com>
22197 * delegate.cs: When creating the various temporary "Parameters"
22198 classes, make sure that we call the ComputeAndDefineParameterTypes
22199 on those new parameters (just like we do with the formal ones), to
22200 allow them to be resolved in the context of the DeclSpace.
22202 This fixes the bug that Dick observed in Bugzilla #38530.
22204 2003-02-22 Miguel de Icaza <miguel@ximian.com>
22206 * expression.cs (ResolveMemberAccess): When resolving a constant,
22207 do not attempt to pull a constant if the value was not able to
22208 generate a valid constant.
22210 * const.cs (LookupConstantValue): Do not report more errors than required.
22212 2003-02-19 Gonzalo Paniagua Javier <gonzalo@ximian.com>
22214 * expression.cs: fixes bug #38328.
22216 2003-02-18 Miguel de Icaza <miguel@ximian.com>
22218 * class.cs: Changed all the various members that can be part of a
22219 class from being an ArrayList to be an Array of the right type.
22220 During the DefineType type_list, interface_list, delegate_list and
22221 enum_list are turned into types, interfaces, delegates and enums
22224 And during the member population, indexer_list, event_list,
22225 constant_list, field_list, instance_constructor_list, method_list,
22226 operator_list and property_list are turned into their real arrays.
22228 Although we could probably perform this operation earlier, for
22229 good error reporting we need to keep the lists and remove the
22230 lists for longer than required.
22232 This optimization was triggered by Paolo profiling the compiler
22233 speed on the output of `gen-sample-program.pl' perl script.
22235 * decl.cs (DeclSpace.ResolveType): Set the ContainerType, so we do
22236 not crash in methods like MemberLookupFailed that use this field.
22238 This problem arises when the compiler fails to resolve a type
22239 during interface type definition for example.
22241 2003-02-18 Miguel de Icaza <miguel@ximian.com>
22243 * expression.cs (Indexers.GetIndexersForType): Interfaces do not
22244 inherit from System.Object, so we have to stop at null, not only
22245 when reaching System.Object.
22247 2003-02-17 Miguel de Icaza <miguel@ximian.com>
22249 * expression.cs: (Indexers.GetIndexersForType): Martin's fix used
22250 DeclaredOnly because the parent indexer might have had a different
22251 name, but did not loop until the top of the hierarchy was reached.
22253 The problem this one fixes is 35492: when a class implemented an
22254 indexer from an interface, we were getting the interface method
22255 (which was abstract) and we were flagging an error (can not invoke
22258 This also keeps bug 33089 functioning, and test-148 functioning.
22260 * typemanager.cs (IsSpecialMethod): The correct way of figuring
22261 out if a method is special is to see if it is declared in a
22262 property or event, or whether it is one of the predefined operator
22263 names. This should fix correctly #36804.
22265 2003-02-15 Miguel de Icaza <miguel@ximian.com>
22267 The goal here is to remove the dependency on EmptyCast.Peel ().
22268 Killing it completely.
22270 The problem is that currently in a number of places where
22271 constants are expected, we have to "probe" for an EmptyCast, and
22272 Peel, which is not the correct thing to do, as this will be
22273 repetitive and will likely lead to errors.
22275 The idea is to remove any EmptyCasts that are used in casts that
22276 can be reduced to constants, so we only have to cope with
22279 This bug hunt was triggered by Bug 37363 and the desire to remove
22280 the duplicate pattern where we were "peeling" emptycasts to check
22281 whether they were constants. Now constants will always be
22284 * ecore.cs: Use an enumconstant here instead of wrapping with
22287 * expression.cs (Cast.TryReduce): Ah, the tricky EnumConstant was
22288 throwing me off. By handling this we can get rid of a few hacks.
22290 * statement.cs (Switch): Removed Peel() code.
22292 2003-02-14 Miguel de Icaza <miguel@ximian.com>
22294 * class.cs: Location information for error 508
22296 * expression.cs (New.DoResolve): Add a guard against double
22297 resolution of an expression.
22299 The New DoResolve might be called twice when initializing field
22300 expressions (see EmitFieldInitializers, the call to
22301 GetInitializerExpression will perform a resolve on the expression,
22302 and later the assign will trigger another resolution
22304 This leads to bugs (#37014)
22306 * delegate.cs: The signature for EndInvoke should contain any ref
22307 or out parameters as well. We were not doing this in the past.
22309 * class.cs (Field.Define): Do not overwrite the type definition
22310 inside the `volatile' group. Turns out that volatile enumerations
22311 were changing the type here to perform a validity test, which
22314 2003-02-12 Miguel de Icaza <miguel@ximian.com>
22316 * ecore.cs (FieldExpr.AddressOf): In the particular case of This
22317 and structs, we do not want to load the instance variable
22319 (ImplicitReferenceConversion, ImplicitReferenceConversionExists):
22320 enum_type has to be handled like an object reference (implicit
22321 conversions exists from this to object), but the regular IsClass
22322 and IsValueType tests will never return true for this one.
22324 Also we use TypeManager.IsValueType instead of type.IsValueType,
22325 just for consistency with the rest of the code (this is only
22326 needed if we ever use the construct exposed by test-180.cs inside
22327 corlib, which we dont today).
22329 2003-02-12 Zoltan Varga <vargaz@freemail.hu>
22331 * attribute.cs (ApplyAttributes): apply all MethodImplAttributes, not
22334 2003-02-09 Martin Baulig <martin@ximian.com>
22336 * namespace.cs (Namespace..ctor): Added SourceFile argument.
22337 (Namespace.DefineNamespaces): New static public method; this is
22338 called when we're compiling with debugging to add all namespaces
22339 to the symbol file.
22341 * tree.cs (Tree.RecordNamespace): Added SourceFile argument and
22342 pass it to the Namespace's .ctor.
22344 * symbolwriter.cs (SymbolWriter.OpenMethod): Added TypeContainer
22345 and MethodBase arguments; pass the namespace ID to the symwriter;
22346 pass the MethodBase instead of the token to the symwriter.
22347 (SymbolWriter.DefineNamespace): New method to add a namespace to
22350 2003-02-09 Martin Baulig <martin@ximian.com>
22352 * symbolwriter.cs: New file. This is a wrapper around
22353 ISymbolWriter with a cleaner API. We'll dynamically Invoke()
22354 methods here in near future.
22356 2003-02-09 Martin Baulig <martin@ximian.com>
22358 * codegen.cs (EmitContext.Mark): Just pass the arguments to
22359 ILGenerator.MarkSequencePoint() which are actually used by the
22362 2003-02-09 Martin Baulig <martin@ximian.com>
22364 * location.cs (SourceFile): New public sealed class. This
22365 contains the name and an index which is used in the location's token.
22366 (Location): Reserve an appropriate number of bits in the token for
22367 the source file instead of walking over that list, this gives us a
22368 really huge performance improvement when compiling with debugging.
22370 * driver.cs (Driver.parse, Driver.tokenize_file): Take a
22371 `SourceFile' argument instead of a string.
22372 (Driver.ProcessFile): Add all the files via Location.AddFile(),
22373 but don't parse/tokenize here, we need to generate the list of all
22374 source files before we do that.
22375 (Driver.ProcessFiles): New static function. Parses/tokenizes all
22378 * cs-parser.jay (CSharpParser): Take a `SourceFile' argument
22379 instead of a string.
22381 * cs-tokenizer.cs (Tokenizer): Take `SourceFile' argument instead
22384 2003-02-09 Martin Baulig <martin@ximian.com>
22386 * cs-tokenizer.cs (Tokenizer.PreProcessLine): Also reset the
22387 filename on `#line default'.
22389 Sat Feb 8 17:03:16 CET 2003 Paolo Molaro <lupus@ximian.com>
22391 * statement.cs: don't clear the pinned var when the fixed statement
22392 returns from the method (fixes bug#37752).
22394 Sat Feb 8 12:58:06 CET 2003 Paolo Molaro <lupus@ximian.com>
22396 * typemanager.cs: fix from mathpup@mylinuxisp.com (Marcus Urban)
22399 2003-02-07 Martin Baulig <martin@ximian.com>
22401 * driver.cs: Removed the `--debug-args' command line argument.
22403 * codegen.cs (CodeGen.SaveSymbols): Removed, this is now done
22404 automatically by the AsssemblyBuilder.
22405 (CodeGen.InitializeSymbolWriter): We don't need to call any
22406 initialization function on the symbol writer anymore. This method
22407 doesn't take any arguments.
22409 2003-02-03 Miguel de Icaza <miguel@ximian.com>
22411 * driver.cs: (AddAssemblyAndDeps, LoadAssembly): Enter the types
22412 from referenced assemblies as well.
22414 2003-02-02 Martin Baulig <martin@ximian.com>
22416 * class.cs (MethodData.Emit): Generate debugging info for external methods.
22418 2003-02-02 Martin Baulig <martin@ximian.com>
22420 * class.cs (Constructor.Emit): Open the symbol writer before
22421 emitting the constructor initializer.
22422 (ConstructorInitializer.Emit): Call ec.Mark() to allow
22423 single-stepping through constructor initializers.
22425 2003-01-30 Miguel de Icaza <miguel@ximian.com>
22427 * class.cs: Handle error 549: do not allow virtual methods in
22430 2003-02-01 Jackson Harper <jackson@latitudegeo.com>
22432 * decl.cs: Check access levels when resolving types
22434 2003-01-31 Jackson Harper <jackson@latitudegeo.com>
22436 * statement.cs: Add parameters and locals set in catch blocks that might
22437 return to set vector
22439 2003-01-29 Miguel de Icaza <miguel@ximian.com>
22441 * class.cs (Operator): Set the SpecialName flags for operators.
22443 * expression.cs (Invocation.DoResolve): Only block calls to
22444 accessors and operators on SpecialName methods.
22446 (Cast.TryReduce): Handle conversions from char constants.
22449 Tue Jan 28 17:30:57 CET 2003 Paolo Molaro <lupus@ximian.com>
22451 * statement.cs: small memory and time optimization in FlowBranching.
22453 2003-01-28 Pedro Mart <yoros@wanadoo.es>
22455 * expression.cs (IndexerAccess.DoResolveLValue): Resolve the same
22456 problem that the last fix but in the other sid (Set).
22458 * expression.cs (IndexerAccess.DoResolve): Fix a problem with a null
22459 access when there is no indexer in the hierarchy.
22461 2003-01-27 Jackson Harper <jackson@latitudegeo.com>
22463 * class.cs: Combine some if statements.
22465 2003-01-27 Gonzalo Paniagua Javier <gonzalo@ximian.com>
22467 * driver.cs: fixed bug #37187.
22469 2003-01-27 Pedro Martinez Juliá <yoros@wanadoo.es>
22471 * expression.cs (IndexerAccess.DoResolve): Before trying to resolve
22472 any indexer, it's needed to build a list with all the indexers in the
22473 hierarchy (AllGetters), else we have problems. Fixes #35653.
22475 2003-01-23 Miguel de Icaza <miguel@ximian.com>
22477 * class.cs (MethodData.Define): It is wrong for an interface
22478 implementation to be static in both cases: explicit and implicit.
22479 We were only handling this in one case.
22481 Improve the if situation there to not have negations.
22483 * class.cs (Field.Define): Turns out that we do not need to check
22484 the unsafe bit on field definition, only on usage. Remove the test.
22486 2003-01-22 Gonzalo Paniagua Javier <gonzalo@ximian.com>
22488 * driver.cs: use assembly.Location instead of Codebase (the latest
22489 patch made mcs fail when using MS assemblies).
22491 2003-01-21 Tim Haynes <thaynes@openlinksw.com>
22493 * driver.cs: use DirectorySeparatorChar instead of a hardcoded "/" to
22494 get the path to *corlib.dll.
22496 2003-01-21 Nick Drochak <ndrochak@gol.com>
22500 * typemanager.cs: Remove compiler warnings
22502 2003-01-20 Duncan Mak <duncan@ximian.com>
22504 * AssemblyInfo.cs: Bump the version number to 0.19.
22506 2003-01-20 Gonzalo Paniagua Javier <gonzalo@ximian.com>
22508 * cs-tokenizer.cs: little fixes to line numbering when #line is used.
22510 2003-01-18 Zoltan Varga <vargaz@freemail.hu>
22512 * class.cs (Constructor::Emit): Emit debugging info for constructors.
22514 2003-01-17 Miguel de Icaza <miguel@ximian.com>
22516 * cs-parser.jay: Small fix: we were not comparing the constructor
22517 name correctly. Thanks to Zoltan for the initial pointer.
22519 2003-01-16 Jackson Harper <jackson@latitudegeo.com>
22521 * cs-tokenizer.cs: Set file name when specified with #line
22523 2003-01-15 Miguel de Icaza <miguel@ximian.com>
22525 * cs-parser.jay: Only perform the constructor checks here if we
22526 are named like the class; This will help provider a better
22527 error. The constructor path is taken when a type definition is
22528 not found, but most likely the user forgot to add the type, so
22529 report that rather than the constructor error.
22531 Tue Jan 14 10:36:49 CET 2003 Paolo Molaro <lupus@ximian.com>
22533 * class.cs, rootcontext.cs: small changes to avoid unnecessary memory
22536 2003-01-13 Jackson Harper <jackson@latitudegeo.com>
22538 * cs-parser.jay: Add cleanup call.
22540 2003-01-13 Duncan Mak <duncan@ximian.com>
22542 * cs-tokenizer.cs (Cleanup): Rename to 'cleanup' to make it more
22543 consistent with other methods.
22545 2003-01-13 Jackson Harper <jackson@latitudegeo.com>
22547 * cs-tokenizer.cs: Add Cleanup method, also fix #region error messages.
22549 Sun Jan 12 19:58:42 CET 2003 Paolo Molaro <lupus@ximian.com>
22551 * attribute.cs: only set GuidAttr to true when we have a
22554 2003-01-09 Gonzalo Paniagua Javier <gonzalo@ximian.com>
22558 * typemanager.cs: fixes to allow mcs compile corlib with the new
22559 Type.IsSubclassOf fix.
22561 2003-01-08 Miguel de Icaza <miguel@ximian.com>
22563 * expression.cs (LocalVariableReference.DoResolve): Classify a
22564 constant as a value, not as a variable. Also, set the type for
22567 * cs-parser.jay (fixed_statement): take a type instead of a
22568 pointer_type, so we can produce a better error message later.
22570 * statement.cs (Fixed.Resolve): Flag types that are not pointers
22573 (For.DoEmit): Make inifinite loops have a
22574 non-conditional branch back.
22576 (Fixed.DoEmit): First populate the pinned variables, then emit the
22577 statement, then clear the variables. Before I was emitting the
22578 code once for each fixed piece.
22581 2003-01-08 Martin Baulig <martin@ximian.com>
22583 * statement.cs (FlowBranching.MergeChild): A break in a
22584 SWITCH_SECTION does not leave a loop. Fixes #36155.
22586 2003-01-08 Martin Baulig <martin@ximian.com>
22588 * statement.cs (FlowBranching.CheckOutParameters): `struct_params'
22589 lives in the same number space than `param_map'. Fixes #36154.
22591 2003-01-07 Miguel de Icaza <miguel@ximian.com>
22593 * cs-parser.jay (constructor_declaration): Set the
22594 Constructor.ModFlags before probing for it. This makes the
22595 compiler report 514, 515 and 132 (the code was there, but got
22598 * statement.cs (Goto.Resolve): Set `Returns' to ALWAYS.
22599 (GotoDefault.Resolve): Set `Returns' to ALWAYS.
22600 (GotoCase.Resolve): Set `Returns' to ALWAYS.
22602 Tue Jan 7 18:32:24 CET 2003 Paolo Molaro <lupus@ximian.com>
22604 * enum.cs: create the enum static fields using the enum type.
22606 Tue Jan 7 18:23:44 CET 2003 Paolo Molaro <lupus@ximian.com>
22608 * class.cs: don't try to create the ParamBuilder for the return
22609 type if it's not needed (and handle it breaking for the ms runtime
22612 2003-01-06 Jackson Harper <jackson@latitudegeo.com>
22614 * cs-tokenizer.cs: Add REGION flag to #region directives, and add checks to make sure that regions are being poped correctly
22616 2002-12-29 Miguel de Icaza <miguel@ximian.com>
22618 * cs-tokenizer.cs (get_cmd_arg): Fixups to allow \r to terminate
22619 the command. This showed up while compiling the JANET source
22620 code, which used \r as its only newline separator.
22622 2002-12-28 Miguel de Icaza <miguel@ximian.com>
22624 * class.cs (Method.Define): If we are an operator (because it
22625 reuses our code), then set the SpecialName and HideBySig. #36128
22627 2002-12-22 Miguel de Icaza <miguel@ximian.com>
22629 * ecore.cs (FieldExpr.DoResolve): Instead of throwing an
22630 exception, report error 120 `object reference required'.
22632 * driver.cs: Add --pause option, used during to measure the size
22633 of the process as it goes with --timestamp.
22635 * expression.cs (Invocation.DoResolve): Do not allow methods with
22636 SpecialName to be invoked.
22638 2002-12-21 Miguel de Icaza <miguel@ximian.com>
22640 * cs-tokenizer.cs: Small fix to the parser: compute the ascii
22641 number before adding it.
22643 2002-12-21 Ravi Pratap <ravi@ximian.com>
22645 * ecore.cs (StandardImplicitConversion): When in an unsafe
22646 context, we allow conversion between void * to any other pointer
22647 type. This fixes bug #35973.
22649 2002-12-20 Jackson Harper <jackson@latitudegeo.com>
22651 * codegen.cs: Use Path.GetFileNameWithoutExtension so an exception
22652 is not thrown when extensionless outputs are used
22654 2002-12-20 Gonzalo Paniagua Javier <gonzalo@ximian.com>
22656 * rootcontext.cs: fixed compilation of corlib.
22658 2002-12-19 Miguel de Icaza <miguel@ximian.com>
22660 * attribute.cs (Attributes.Contains): Add new method.
22662 * class.cs (MethodCore.LabelParameters): if the parameter is an
22663 `out' parameter, check that no attribute `[In]' has been passed.
22665 * enum.cs: Handle the `value__' name in an enumeration.
22667 2002-12-14 Jaroslaw Kowalski <jarek@atm.com.pl>
22669 * decl.cs: Added special case to allow overrides on "protected
22672 2002-12-18 Ravi Pratap <ravi@ximian.com>
22674 * attribute.cs (Attributes.AddAttributeSection): Rename to this
22675 since it makes much more sense.
22677 (Attributes.ctor): Don't require a Location parameter.
22679 * rootcontext.cs (AddGlobalAttributeSection): Rename again.
22681 * attribute.cs (ApplyAttributes): Remove extra Location parameters
22682 since we already have that information per attribute.
22684 * everywhere : make appropriate changes.
22686 * class.cs (LabelParameters): Write the code which actually
22687 applies attributes to the return type. We can't do this on the MS
22688 .NET runtime so we flag a warning in the case an exception is
22691 2002-12-18 Miguel de Icaza <miguel@ximian.com>
22693 * const.cs: Handle implicit null conversions here too.
22695 2002-12-17 Ravi Pratap <ravi@ximian.com>
22697 * class.cs (MethodCore.LabelParameters): Remove the extra
22698 Type [] parameter since it is completely unnecessary. Instead
22699 pass in the method's attributes so that we can extract
22700 the "return" attribute.
22702 2002-12-17 Miguel de Icaza <miguel@ximian.com>
22704 * cs-parser.jay (parse): Use Report.Error to flag errors instead
22705 of ignoring it and letting the compile continue.
22707 * typemanager.cs (ChangeType): use an extra argument to return an
22708 error condition instead of throwing an exception.
22710 2002-12-15 Miguel de Icaza <miguel@ximian.com>
22712 * expression.cs (Unary.TryReduce): mimic the code for the regular
22713 code path. Perform an implicit cast in the cases where we can
22714 implicitly convert to one of the integral types, and then reduce
22715 based on that constant. This fixes bug #35483.
22717 2002-12-14 Gonzalo Paniagua Javier <gonzalo@ximian.com>
22719 * typemanager.cs: fixed cut & paste error in GetRemoveMethod.
22721 2002-12-13 Gonzalo Paniagua Javier <gonzalo@ximian.com>
22723 * namespace.cs: fixed bug #35489.
22725 2002-12-12 Miguel de Icaza <miguel@ximian.com>
22727 * class.cs: Remove some dead code.
22729 * cs-parser.jay: Estimate the number of methods needed
22730 (RootContext.MethodCount);
22732 * cs-tokenizer.cs: Use char arrays for parsing identifiers and
22733 numbers instead of StringBuilders.
22735 * support.cs (PtrHashtable): Add constructor with initial size;
22736 We can now reduce reallocations of the method table.
22738 2002-12-10 Ravi Pratap <ravi@ximian.com>
22740 * attribute.cs (ApplyAttributes): Keep track of the emitted
22741 attributes on a per-target basis. This fixes bug #35413.
22743 2002-12-10 Miguel de Icaza <miguel@ximian.com>
22745 * driver.cs (MainDriver): On rotor encoding 28591 does not exist,
22746 default to the Windows 1252 encoding.
22748 (UnixParseOption): Support version, thanks to Alp for the missing
22751 * AssemblyInfo.cs: Add nice assembly information.
22753 * cs-tokenizer.cs: Add fix from Felix to the #if/#else handler
22756 * cs-parser.jay: Allow a trailing comma before the close bracked
22757 in the attribute_section production.
22759 * ecore.cs (FieldExpr.AddressOf): Until I figure out why the
22760 address of the instance was being taken, I will take this out,
22761 because we take the address of the object immediately here.
22763 2002-12-09 Ravi Pratap <ravi@ximian.com>
22765 * typemanager.cs (AreMultipleAllowed): Take care of the most
22766 obvious case where attribute type is not in the current assembly -
22769 2002-12-08 Miguel de Icaza <miguel@ximian.com>
22771 * ecore.cs (SimpleName.DoResolve): First perform lookups on using
22772 definitions, instead of doing that afterwards.
22774 Also we use a nice little hack, depending on the constructor, we
22775 know if we are a "composed" name or a simple name. Hence, we
22776 avoid the IndexOf test, and we avoid
22778 * codegen.cs: Add code to assist in a bug reporter to track down
22779 the source of a compiler crash.
22781 2002-12-07 Ravi Pratap <ravi@ximian.com>
22783 * attribute.cs (Attribute.ApplyAttributes) : Keep track of which attribute
22784 types have been emitted for a given element and flag an error
22785 if something which does not have AllowMultiple set is used more
22788 * typemanager.cs (RegisterAttributeAllowMultiple): Keep track of
22789 attribute types and their corresponding AllowMultiple properties
22791 (AreMultipleAllowed): Check the property for a given type.
22793 * attribute.cs (Attribute.ApplyAttributes): Register the AllowMultiple
22794 property in the case we have a TypeContainer.
22796 (Attributes.AddAttribute): Detect duplicates and just skip on
22797 adding them. This trivial fix catches a pretty gross error in our
22798 attribute emission - global attributes were being emitted twice!
22800 Bugzilla bug #33187 is now fixed.
22802 2002-12-06 Miguel de Icaza <miguel@ximian.com>
22804 * cs-tokenizer.cs (pp_expr): Properly recurse here (use pp_expr
22805 instead of pp_and).
22807 * expression.cs (Binary.ResolveOperator): I can only use the
22808 Concat (string, string, string) and Concat (string, string,
22809 string, string) if the child is actually a concatenation of
22812 2002-12-04 Miguel de Icaza <miguel@ximian.com>
22814 * cs-tokenizer.cs: Small fix, because decimal_digits is used in a
22815 context where we need a 2-character lookahead.
22817 * pending.cs (PendingImplementation): Rework so we can keep track
22818 of interface types all the time, and flag those which were
22819 implemented by parents as optional.
22821 2002-12-03 Miguel de Icaza <miguel@ximian.com>
22823 * expression.cs (Binary.ResolveOperator): Use
22824 String.Concat(string,string,string) or
22825 String.Concat(string,string,string,string) when possible.
22827 * typemanager: More helper methods.
22830 Tue Dec 3 19:32:04 CET 2002 Paolo Molaro <lupus@ximian.com>
22832 * pending.cs: remove the bogus return from GetMissingInterfaces()
22833 (see the 2002-11-06 entry: the mono runtime is now fixed in cvs).
22835 2002-12-02 Gonzalo Paniagua Javier <gonzalo@ximian.com>
22837 * namespace.cs: avoid duplicated 'using xxx' being added to
22838 using_clauses. This prevents mcs from issuing and 'ambiguous type' error
22839 when we get more than one 'using' statement for the same namespace.
22840 Report a CS0105 warning for it.
22842 2002-11-30 Miguel de Icaza <miguel@ximian.com>
22844 * cs-tokenizer.cs (consume_identifier): use read directly, instead
22845 of calling getChar/putback, uses internal knowledge of it.
22847 (xtoken): Reorder tokenizer so most common patterns are checked
22848 first. This reduces the compilation time in another 5% (from 8.11s
22849 average to 7.73s for bootstrapping mcs on my Mobile p4/1.8ghz).
22851 The parsing time is 22% of the compilation in mcs, and from that
22852 64% is spent on the tokenization process.
22854 I tried using a binary search for keywords, but this is slower
22855 than the hashtable. Another option would be to do a couple of
22858 * Not use a StringBuilder, instead use an array of chars,
22859 with a set value. Notice that this way we could catch
22860 the 645 error without having to do it *afterwards*.
22862 * We could write a hand-parser to avoid the hashtable
22863 compares altogether.
22865 The identifier consumption process takes 37% of the tokenization
22866 time. Another 15% is spent on is_number. 56% of the time spent
22867 on is_number is spent on Int64.Parse:
22869 * We could probably choose based on the string length to
22870 use Int32.Parse or Int64.Parse and avoid all the 64-bit
22873 Another 3% is spend on wrapping `xtoken' in the `token' function.
22875 Handle 0xa0 as whitespace (#34752)
22877 2002-11-26 Miguel de Icaza <miguel@ximian.com>
22879 * typemanager.cs (IsCLRType): New routine to tell whether a type
22880 is one of the builtin types.
22882 Maybe it needs to use TypeCodes to be faster. Maybe we could use
22883 typecode in more places instead of doing pointer comparissions.
22884 We could leverage some knowledge about the way the typecodes are
22887 New code to cache namespaces in assemblies, it is currently not
22888 invoked, to be used soon.
22890 * decl.cs (DeclSpace.MakeFQN): Simple optimization.
22892 * expression.cs (Binary.ResolveOperator): specially handle
22893 strings, and do not perform user-defined operator overloading for
22896 2002-11-24 Miguel de Icaza <miguel@ximian.com>
22898 * cs-tokenizer.cs: Avoid calling Char.IsDigit which is an
22899 internalcall as it is a pretty simple operation; Avoid whenever
22900 possible to call Char.IsLetter.
22902 (consume_identifier): Cut by half the number of
22903 hashtable calls by merging the is_keyword and GetKeyword behavior.
22905 Do not short-circuit, because if we do, we
22906 report errors (ie, #if false && true would produce an invalid
22910 2002-11-24 Martin Baulig <martin@ximian.com>
22912 * expression.cs (Cast.TryReduce): If we're in checked syntax,
22913 check constant ranges and report a CS0221. Fixes #33186.
22915 2002-11-24 Martin Baulig <martin@ximian.com>
22917 * cs-parser.jay: Make this work for uninitialized variable
22918 declarations in the `for' initializer. Fixes #32416.
22920 2002-11-24 Martin Baulig <martin@ximian.com>
22922 * ecore.cs (Expression.ConvertExplicit): Make casting from/to
22923 System.Enum actually work. Fixes bug #32269, added verify-6.cs.
22925 2002-11-24 Martin Baulig <martin@ximian.com>
22927 * expression.cs (Binary.DoNumericPromotions): Added `check_user_conv'
22928 argument; if true, we also check for user-defined conversions.
22929 This is only needed if both arguments are of a user-defined type.
22930 Fixes #30443, added test-175.cs.
22931 (Binary.ForceConversion): Pass the location argument to ConvertImplicit.
22933 * ecore.cs (Expression.ImplicitUserConversionExists): New method.
22935 2002-11-24 Martin Baulig <martin@ximian.com>
22937 * expression.cs (ArrayAccess.GetStoreOpcode): New public static
22938 function to get the store opcode.
22939 (Invocation.EmitParams): Call ArrayAccess.GetStoreOpcode() and
22940 only emit the Ldelema if the store opcode is Stobj. You must run
22941 both test-34 and test-167 to test this. Fixes #34529.
22943 2002-11-23 Martin Baulig <martin@ximian.com>
22945 * ecore.cs (Expression.MemberLookup): Added additional
22946 `qualifier_type' argument which is used when we're being called
22947 from MemberAccess.DoResolve() and null if we're called from a
22949 (Expression.MemberLookupFailed): New method to report errors; this
22950 does the CS1540 check and reports the correct error message.
22952 * typemanager.cs (MemberLookup): Added additional `qualifier_type'
22953 argument for the CS1540 check and redone the way how we're dealing
22954 with private members. See the comment in the source code for details.
22955 (FilterWithClosure): Reverted this back to revision 1.197; renamed
22956 `closure_start_type' to `closure_qualifier_type' and check whether
22957 it's not null. It was not this filter being broken, it was just
22958 being called with the wrong arguments.
22960 * expression.cs (MemberAccess.DoResolve): use MemberLookupFinal()
22961 and pass it the correct `qualifier_type'; this also does the error
22964 2002-11-22 Miguel de Icaza <miguel@ximian.com>
22966 * expression.cs (Invocation.EmitParams): If the we are dealing
22967 with a non-built-in value type, load its address as well.
22969 (ArrayCreation): Use a a pretty constant instead
22970 of the hardcoded value 2. Use 6 instead of 2 for the number of
22971 static initializers.
22973 (ArrayCreation.EmitDynamicInitializers): Peel enumerations,
22974 because they are not really value types, just glorified integers.
22976 * driver.cs: Do not append .exe, the CSC compiler does not do it.
22978 * ecore.cs: Remove redundant code for enumerations, make them use
22979 the same code path as everything else, fixes the casting issue
22980 with enumerations in Windows.Forms.
22982 * attribute.cs: Do only cast to string if it is a string, the
22983 validation happens later.
22985 * typemanager.cs: Temproary hack to avoid a bootstrap issue until
22986 people upgrade their corlibs.
22988 * ecore.cs: Oops, enumerations were not following the entire code path
22990 2002-11-21 Miguel de Icaza <miguel@ximian.com>
22992 * typemanager.cs (FilterWithClosure): Commented out the test for
22993 1540 in typemanager.cs, as it has problems when accessing
22994 protected methods from a parent class (see test-174.cs).
22996 * attribute.cs (Attribute.ValidateGuid): new method.
22997 (Attribute.Resolve): Use above.
22999 2002-11-19 Miguel de Icaza <miguel@ximian.com>
23001 * enum.cs: In FindMembers, perform a recursive lookup for values. (34308)
23003 * ecore.cs (SimpleName.SimpleNameResolve): Remove the special
23004 handling for enumerations, as we only needed the TypeContainer
23005 functionality to begin with (this is required for the fix below to
23006 work for enums that reference constants in a container class for
23009 * codegen.cs (EmitContext): Make TypeContainer a DeclSpace.
23011 * enum.cs (Enum.Define): Use `this' instead of parent, so we have
23012 a valid TypeBuilder to perform lookups on.o
23014 * class.cs (InheritableMemberSignatureCompare): Use true in the
23015 call to GetGetMethod and GetSetMethod, because we are comparing
23016 the signature, and we need to get the methods *even* if they are
23019 (PropertyBase.CheckBase): ditto.
23021 * statement.cs (Switch.ResolveAndReduce, Block.EmitMeta,
23022 GotoCase.Resolve): Use Peel on EmpytCasts.
23024 * ecore.cs (EmptyCast): drop child, add Peel method.
23026 2002-11-17 Martin Baulig <martin@ximian.com>
23028 * ecore.cs (EmptyCast.Child): New public property.
23030 * statement.cs (SwitchLabel.ResolveAndReduce): Check whether the
23031 label resolved to an EmptyCast. Fixes #34162.
23032 (GotoCase.Resolve): Likewise.
23033 (Block.EmitMeta): Likewise.
23035 2002-11-17 Martin Baulig <martin@ximian.com>
23037 * expression.cs (Invocation.BetterConversion): Prefer int over
23038 uint; short over ushort; long over ulong for integer literals.
23039 Use ImplicitConversionExists instead of StandardConversionExists
23040 since we also need to check for user-defined implicit conversions.
23041 Fixes #34165. Added test-173.cs.
23043 2002-11-16 Martin Baulig <martin@ximian.com>
23045 * expression.cs (Binary.EmitBranchable): Eliminate comparisions
23046 with the `true' and `false' literals. Fixes #33151.
23048 2002-11-16 Martin Baulig <martin@ximian.com>
23050 * typemanager.cs (RealMemberLookup): Reverted Miguel's patch from
23051 October 22nd; don't do the cs1540 check for static members.
23053 * ecore.cs (PropertyExpr.ResolveAccessors): Rewrote this; we're
23054 now using our own filter here and doing the cs1540 check again.
23056 2002-11-16 Martin Baulig <martin@ximian.com>
23058 * support.cs (InternalParameters): Don't crash if we don't have
23059 any fixed parameters. Fixes #33532.
23061 2002-11-16 Martin Baulig <martin@ximian.com>
23063 * decl.cs (MemberCache.AddMethods): Use BindingFlags.FlattenHierarchy
23064 when looking up static methods to make this work on Windows.
23067 2002-11-16 Martin Baulig <martin@ximian.com>
23069 * ecore.cs (PropertyExpr.VerifyAssignable): Check whether we have
23070 a setter rather than using PropertyInfo.CanWrite.
23072 2002-11-15 Nick Drochak <ndrochak@gol.com>
23074 * class.cs: Allow acces to block member by subclasses. Fixes build
23077 2002-11-14 Martin Baulig <martin@ximian.com>
23079 * class.cs (Constructor.Emit): Added the extern/block check.
23082 2002-11-14 Martin Baulig <martin@ximian.com>
23084 * expression.cs (IndexerAccess.DoResolve): Do a DeclaredOnly
23085 iteration while looking for indexers, this is needed because the
23086 indexer may have a different name in our base classes. Fixed the
23087 error reporting (no indexers at all, not get accessor, no
23088 overloaded match). Fixes bug #33089.
23089 (IndexerAccess.DoResolveLValue): Likewise.
23091 2002-11-14 Martin Baulig <martin@ximian.com>
23093 * class.cs (PropertyBase.CheckBase): Make this work for multiple
23094 indexers. Fixes the first part of bug #33089.
23095 (MethodSignature.InheritableMemberSignatureCompare): Added support
23098 2002-11-13 Ravi Pratap <ravi@ximian.com>
23100 * attribute.cs (Attribute.Resolve): Catch the
23101 NullReferenceException and report it since it isn't supposed to
23104 2002-11-12 Miguel de Icaza <miguel@ximian.com>
23106 * expression.cs (Binary.EmitBranchable): Also handle the cases for
23107 LogicalOr and LogicalAnd that can benefit from recursively
23108 handling EmitBranchable. The code now should be nice for Paolo.
23110 2002-11-08 Miguel de Icaza <miguel@ximian.com>
23112 * typemanager.cs (LookupType): Added a negative-hit hashtable for
23113 the Type lookups, as we perform quite a number of lookups on
23114 non-Types. This can be removed once we can deterministically tell
23115 whether we have a type or a namespace in advance.
23117 But this might require special hacks from our corlib.
23121 * ecore.cs (TryImplicitIntConversion): Handle conversions to float
23122 and double which avoids a conversion from an integer to a double.
23124 * expression.cs: tiny optimization, avoid calling IsConstant,
23125 because it effectively performs the lookup twice.
23127 2002-11-06 Miguel de Icaza <miguel@ximian.com>
23129 But a bogus return here to keep the semantics of the old code
23130 until the Mono runtime is fixed.
23132 * pending.cs (GetMissingInterfaces): New method used to remove all
23133 the interfaces that are already implemented by our parent
23134 classes from the list of pending methods.
23136 * interface.cs: Add checks for calls after ResolveTypeExpr.
23138 2002-11-05 Miguel de Icaza <miguel@ximian.com>
23140 * class.cs (Class.Emit): Report warning 67: event not used if the
23141 warning level is beyond 3.
23143 * ecore.cs (Expression.ConvertExplicit): Missed a check for expr
23144 being a NullLiteral.
23146 * cs-parser.jay: Fix, Gonzalo reverted the order of the rank
23149 * class.cs (TypeContainer.GetClassBases): Cover a missing code
23150 path that might fail if a type can not be resolved.
23152 * expression.cs (Binary.Emit): Emit unsigned versions of the
23155 * driver.cs: use error 5.
23157 2002-11-02 Gonzalo Paniagua Javier <gonzalo@gnome-db.org>
23159 * cs-parser.jay: simplified a rule and 5 SR conflicts dissapeared.
23161 2002-11-01 Miguel de Icaza <miguel@ximian.com>
23163 * cs-parser.jay (switch_section): A beautiful patch from Martin
23164 Baulig that fixed 33094.
23166 2002-10-31 Miguel de Icaza <miguel@ximian.com>
23168 * ecore.cs (PropertyExpr.DoResolveLValue, PropertyExpr.DoResolve):
23169 Check whether the base is abstract and report an error if so.
23171 * expression.cs (IndexerAccess.DoResolveLValue,
23172 IndexerAccess.DoResolve): ditto.
23174 (Invocation.DoResolve): ditto.
23176 (Invocation.FullMethodDesc): Improve the report string.
23178 * statement.cs (Block): Eliminate IsVariableDefined as it is
23179 basically just a wrapper for GetVariableInfo.
23181 * ecore.cs (SimpleName): Use new
23183 * support.cs (ReflectionParamter.ParameterType): We unwrap the
23184 type, as we return the actual parameter ref/unref state on a
23187 2002-10-30 Miguel de Icaza <miguel@ximian.com>
23189 * support.cs: Return proper flags REF/OUT fixing the previous
23192 * expression.cs: Reverted last patch, that was wrong. Is_ref is
23193 not used to mean `ref' but `ref or out' in ParameterReference
23195 * delegate.cs (FullDelegateDesc): use ParameterDesc to get the
23196 full type signature instead of calling TypeManger.CSharpName
23199 * support.cs (InternalParameters.ParameterDesc): Do not compare
23200 directly to the modflags, because REF/OUT will actually be bitsets
23203 * delegate.cs (VerifyMethod): Check also the modifiers.
23205 * cs-tokenizer.cs: Fix bug where floating point values with an
23206 exponent where a sign was missing was ignored.
23208 * driver.cs: Allow multiple assemblies to be specified in a single
23211 2002-10-28 Miguel de Icaza <miguel@ximian.com>
23213 * cs-parser.jay: Ugly. We had to add a multiplicative_expression,
23214 because identifiers after a parenthesis would end up in this kind
23215 of production, and we needed to desamiguate it for having casts
23218 (UserDefinedType *) xxx
23220 2002-10-24 Miguel de Icaza <miguel@ximian.com>
23222 * typemanager.cs (RealMemberLookup): when we deal with a subclass,
23223 we should set on the Bindingflags.NonPublic, but not turn on
23224 private_ok. private_ok controls whether a Private member is
23225 returned (this is chekced on the filter routine), while the
23226 BindingFlags.NonPublic just controls whether private/protected
23227 will be allowed. This fixes the problem part of the problem of
23228 private properties being allowed to be used in derived classes.
23230 * expression.cs (BaseAccess): Provide an DoResolveLValue method,
23231 so we can call the children DoResolveLValue method (this will
23232 properly signal errors on lvalue assignments to base properties)
23234 * ecore.cs (PropertyExpr.ResolveAccessors): If both setter and
23235 getter are null, and we have a property info, we know that this
23236 happened because the lookup failed, so we report an error 122 for
23237 protection level violation.
23239 We also silently return if setter and getter are null in the
23240 resolve functions, this condition only happens if we have flagged
23241 the error before. This is the other half of the problem.
23243 (PropertyExpr.ResolveAccessors): Turns out that PropertyInfo does
23244 not have accessibility information, that is why we were returning
23245 true in the filter function in typemanager.cs.
23247 To properly report 122 (property is inaccessible because of its
23248 protection level) correctly, we report this error in ResolveAccess
23249 by failing if both the setter and the getter are lacking (ie, the
23252 DoResolve and DoLResolve have been modified to check for both
23253 setter/getter being null and returning silently, the reason being
23254 that I did not want to put the knowledge about this error in upper
23257 int old = Report.Errors;
23258 x = new PropertyExpr (...);
23259 if (old != Report.Errors)
23264 So the property expr is returned, but it is invalid, so the error
23265 will be flagged during the resolve process.
23267 * class.cs: Remove InheritablePropertySignatureCompare from the
23268 class, as we no longer depend on the property signature to compute
23269 whether it is possible to implement a method or not.
23271 The reason is that calling PropertyInfo.GetGetMethod will return
23272 null (in .NET, in Mono it works, and we should change this), in
23273 cases where the Get Method does not exist in that particular
23278 class X { public virtual int A { get { return 1; } } }
23280 class Z : Y { public override int A { get { return 2; } } }
23282 Would fail in Z because the parent (Y) would not have the property
23283 defined. So we avoid this completely now (because the alternative
23284 fix was ugly and slow), and we now depend exclusively on the
23287 (PropertyBase.CheckBase): Use a method-base mechanism to find our
23288 reference method, instead of using the property.
23290 * typemanager.cs (GetPropertyGetter, GetPropertySetter): These
23291 routines are gone now.
23293 * typemanager.cs (GetPropertyGetter, GetPropertySetter): swap the
23294 names, they were incorrectly named.
23296 * cs-tokenizer.cs: Return are more gentle token on failure.
23298 * pending.cs (PendingImplementation.InterfaceMethod): This routine
23299 had an out-of-sync index variable, which caused it to remove from
23300 the list of pending methods the wrong method sometimes.
23302 2002-10-22 Miguel de Icaza <miguel@ximian.com>
23304 * ecore.cs (PropertyExpr): Do not use PropertyInfo.CanRead,
23305 CanWrite, because those refer to this particular instance of the
23306 property, and do not take into account the fact that we can
23307 override single members of a property.
23309 Constructor requires an EmitContext. The resolution process does
23310 not happen here, but we need to compute the accessors before,
23311 because the resolution does not always happen for properties.
23313 * typemanager.cs (RealMemberLookup): Set private_ok if we are a
23314 subclass, before we did not update this flag, but we did update
23317 (GetAccessors): Drop this routine, as it did not work in the
23318 presence of partially overwritten set/get methods.
23320 Notice that this broke the cs1540 detection, but that will require
23323 2002-10-22 Gonzalo Paniagua Javier <gonzalo@ximian.com>
23327 * driver.cs: issue a warning instead of an error if we don't support
23328 debugging for the platform. Also ignore a couple of errors that may
23329 arise when trying to write the symbols. Undo my previous patch.
23331 2002-10-22 Gonzalo Paniagua Javier <gonzalo@ximian.com>
23333 * driver.cs: ignore /debug switch except for Unix platforms.
23335 2002-10-23 Nick Drochak <ndrochak@gol.com>
23337 * makefile: Remove mcs2.exe and mcs3.exe on 'make clean'
23339 2002-10-21 Miguel de Icaza <miguel@ximian.com>
23341 * driver.cs: Do not make mcs-debug conditional, so we do not break
23342 builds that use it.
23344 * statement.cs (UsageVector.MergeChildren): I would like Martin to
23345 review this patch. But basically after all the children variables
23346 have been merged, the value of "Breaks" was not being set to
23347 new_breaks for Switch blocks. I think that it should be set after
23348 it has executed. Currently I set this to the value of new_breaks,
23349 but only if new_breaks is FlowReturn.ALWAYS, which is a bit
23350 conservative, but I do not understand this code very well.
23352 I did not break anything in the build, so that is good ;-)
23354 * cs-tokenizer.cs: Also allow \r in comments as a line separator.
23356 2002-10-20 Mark Crichton <crichton@gimp.org>
23358 * cfold.cs: Fixed compile blocker. Really fixed it this time.
23360 2002-10-20 Nick Drochak <ndrochak@gol.com>
23362 * cfold.cs: Fixed compile blocker.
23364 2002-10-20 Miguel de Icaza <miguel@ximian.com>
23366 * driver.cs: I was chekcing the key, not the file.
23368 2002-10-19 Ravi Pratap <ravi@ximian.com>
23370 * ecore.cs (UserDefinedConversion): Get rid of the bogus error
23371 message that we were generating - we just need to silently return
23374 2002-10-19 Miguel de Icaza <miguel@ximian.com>
23376 * class.cs (Event.Define): Change my previous commit, as this
23377 breaks the debugger. This is a temporary hack, as it seems like
23378 the compiler is generating events incorrectly to begin with.
23380 * expression.cs (Binary.ResolveOperator): Added support for
23381 "U operator - (E x, E y)"
23383 * cfold.cs (BinaryFold): Added support for "U operator - (E x, E
23386 * ecore.cs (FieldExpr.AddressOf): We had a special code path for
23387 init-only variables, but this path did not take into account that
23388 there might be also instance readonly variables. Correct this
23391 This fixes bug 32253
23393 * delegate.cs (NewDelegate.DoResolve): Catch creation of unsafe
23396 * driver.cs: Change the extension for modules to `netmodule'
23398 * cs-parser.jay: Improved slightly the location tracking for
23399 the debugger symbols.
23401 * class.cs (Event.Define): Use Modifiers.FieldAttr on the
23402 modifiers that were specified instead of the hardcoded value
23403 (FamAndAssem). This was basically ignoring the static modifier,
23404 and others. Fixes 32429.
23406 * statement.cs (Switch.SimpleSwitchEmit): Simplified the code, and
23407 fixed a bug in the process (32476)
23409 * expression.cs (ArrayAccess.EmitAssign): Patch from
23410 hwang_rob@yahoo.ca that fixes bug 31834.3
23412 2002-10-18 Miguel de Icaza <miguel@ximian.com>
23414 * driver.cs: Make the module extension .netmodule.
23416 2002-10-16 Miguel de Icaza <miguel@ximian.com>
23418 * driver.cs: Report an error if the resource file is not found
23419 instead of crashing.
23421 * ecore.cs (PropertyExpr.EmitAssign): Pass IsBase instead of
23422 false, like Emit does.
23424 2002-10-16 Nick Drochak <ndrochak@gol.com>
23426 * typemanager.cs: Remove unused private member. Also reported mcs
23427 bug to report this as a warning like csc.
23429 2002-10-15 Martin Baulig <martin@gnome.org>
23431 * statement.cs (Statement.Emit): Made this a virtual method; emits
23432 the line number info and calls DoEmit().
23433 (Statement.DoEmit): New protected abstract method, formerly knows
23434 as Statement.Emit().
23436 * codegen.cs (EmitContext.Mark): Check whether we have a symbol writer.
23438 2002-10-11 Miguel de Icaza <miguel@ximian.com>
23440 * class.cs: Following the comment from 2002-09-26 to AddMethod, I
23441 have fixed a remaining problem: not every AddXXXX was adding a
23442 fully qualified name.
23444 Now everyone registers a fully qualified name in the DeclSpace as
23445 being defined instead of the partial name.
23447 Downsides: we are slower than we need to be due to the excess
23448 copies and the names being registered this way.
23450 The reason for this is that we currently depend (on the corlib
23451 bootstrap for instance) that types are fully qualified, because
23452 we dump all the types in the namespace, and we should really have
23453 types inserted into the proper namespace, so we can only store the
23454 basenames in the defined_names array.
23456 2002-10-10 Martin Baulig <martin@gnome.org>
23458 * expression.cs (ArrayAccess.EmitStoreOpcode): Reverted the patch
23459 from bug #31834, see the bug report for a testcase which is
23462 2002-10-10 Martin Baulig <martin@gnome.org>
23464 * codegen.cs (EmitContext.Breaks): Removed, we're now using the
23465 flow analysis code for this.
23467 * statement.cs (Do, While, For): Tell the flow analysis code about
23469 (FlowBranching.UsageVector): Added support for infinite loops.
23470 (Block.Resolve): Moved the dead code elimination here and use flow
23473 2002-10-09 Miguel de Icaza <miguel@ximian.com>
23475 * class.cs (Field.Define): Catch cycles on struct type
23478 * typemanager.cs (IsUnmanagedtype): Do not recursively check
23479 fields if the fields are static. We only need to check instance
23482 * expression.cs (As.DoResolve): Test for reference type.
23484 * statement.cs (Using.ResolveExpression): Use
23485 ConvertImplicitRequired, not ConvertImplicit which reports an
23487 (Using.ResolveLocalVariableDecls): ditto.
23489 * expression.cs (Binary.ResolveOperator): Report errors in a few
23490 places where we had to.
23492 * typemanager.cs (IsUnmanagedtype): Finish implementation.
23494 2002-10-08 Miguel de Icaza <miguel@ximian.com>
23496 * expression.cs: Use StoreFromPtr instead of extracting the type
23497 and then trying to use Stelem. Patch is from hwang_rob@yahoo.ca
23499 * ecore.cs (ImplicitReferenceConversion): It is possible to assign
23500 an enumeration value to a System.Enum, but System.Enum is not a
23501 value type, but an class type, so we need to box.
23503 (Expression.ConvertExplicit): One codepath could return
23504 errors but not flag them. Fix this. Fixes #31853
23506 * parameter.cs (Resolve): Do not allow void as a parameter type.
23508 2002-10-06 Martin Baulig <martin@gnome.org>
23510 * statemenc.cs (FlowBranching.SetParameterAssigned): Don't crash
23511 if it's a class type and not a struct. Fixes #31815.
23513 2002-10-06 Martin Baulig <martin@gnome.org>
23515 * statement.cs: Reworked the flow analysis code a bit to make it
23516 usable for dead code elimination.
23518 2002-10-06 Gonzalo Paniagua Javier <gonzalo@ximian.com>
23520 * cs-parser.jay: allow empty source files. Fixes bug #31781.
23522 2002-10-04 Miguel de Icaza <miguel@ximian.com>
23524 * expression.cs (ComposedCast.DoResolveType): A quick workaround
23525 to fix the test 165, will investigate deeper.
23527 2002-10-04 Martin Baulig <martin@gnome.org>
23529 * statement.cs (FlowBranching.UsageVector.MergeChildren): Make
23530 finally blocks actually work.
23531 (Try.Resolve): We don't need to create a sibling for `finally' if
23532 there is no finally block.
23534 2002-10-04 Martin Baulig <martin@gnome.org>
23536 * class.cs (Constructor.Define): The default accessibility for a
23537 non-default constructor is private, not public.
23539 2002-10-04 Miguel de Icaza <miguel@ximian.com>
23541 * class.cs (Constructor): Make AllowedModifiers public, add
23544 * cs-parser.jay: Perform the modifiers test here, as the
23545 constructor for the Constructor class usually receives a zero
23546 because of the way we create it (first we create, later we
23547 customize, and we were never checking the modifiers).
23549 * typemanager.cs (Typemanager.LookupTypeDirect): This new function
23550 is a version of LookupTypeReflection that includes the type-name
23551 cache. This can be used as a fast path for functions that know
23552 the fully qualified name and are only calling into *.GetType() to
23553 obtain a composed type.
23555 This is also used by TypeManager.LookupType during its type
23558 (LookupType): We now also track the real type name, as sometimes
23559 we can get a quey for the real type name from things like
23560 ComposedCast. This fixes bug 31422.
23562 * expression.cs (ComposedCast.Resolve): Since we are obtaining a
23563 complete type fullname, it does not have to go through the type
23564 resolution system to obtain the composed version of the type (for
23565 obtaining arrays or pointers).
23567 (Conditional.Emit): Use the EmitBoolExpression to
23568 generate nicer code, as requested by Paolo.
23570 (ArrayCreation.CheckIndices): Use the patch from
23571 hwang_rob@yahoo.ca to validate the array initializers.
23573 2002-10-03 Miguel de Icaza <miguel@ximian.com>
23575 * class.cs (ConstructorInitializer.Emit): simplify code by using
23576 Invocation.EmitCall, and at the same time, fix the bugs in calling
23577 parent constructors that took variable arguments.
23579 * ecore.cs (Expression.ConvertNumericExplicit,
23580 Expression.ImplicitNumericConversion): Remove the code that
23581 manually wrapped decimal (InternalTypeConstructor call is now gone
23584 * expression.cs (Cast.TryReduce): Also handle decimal types when
23585 trying to perform a constant fold on the type.
23587 * typemanager.cs (IsUnmanagedtype): Partially implemented.
23589 * parameter.cs: Removed ResolveAndDefine, as it was not needed, as
23590 that only turned off an error report, and did nothing else.
23592 2002-10-02 Miguel de Icaza <miguel@ximian.com>
23594 * driver.cs: Handle and ignore /fullpaths
23596 2002-10-01 Miguel de Icaza <miguel@ximian.com>
23598 * expression.cs (Binary.ResolveOperator): Catch the case where
23599 DoNumericPromotions returns true,
23601 (Binary.DoNumericPromotions): Simplify the code, and the tests.
23603 2002-09-27 Miguel de Icaza <miguel@ximian.com>
23605 * ecore.cs (EventExpr.Emit): Instead of emitting an exception,
23608 2002-09-26 Miguel de Icaza <miguel@ximian.com>
23610 * ecore.cs (ConvertNumericExplicit): It is not enough that the
23611 conversion exists, but it is also required that the conversion be
23612 performed. This manifested in "(Type64Enum) 2".
23614 * class.cs (TypeManager.AddMethod): The fix is not to change
23615 AddEnum, because that one was using a fully qualified name (every
23616 DeclSpace derivative does), but to change the AddMethod routine
23617 that was using an un-namespaced name. This now correctly reports
23618 the duplicated name.
23620 Revert patch until I can properly fix it. The issue
23621 is that we have a shared Type space across all namespaces
23622 currently, which is wrong.
23624 Options include making the Namespace a DeclSpace, and merge
23625 current_namespace/current_container in the parser.
23627 2002-09-25 Miguel de Icaza <miguel@ximian.com>
23629 * cs-parser.jay: Improve error reporting when we get a different
23630 kind of expression in local_variable_type and
23631 local_variable_pointer_type.
23633 Propagate this to avoid missleading errors being reported.
23635 * ecore.cs (ImplicitReferenceConversion): treat
23636 TypeManager.value_type as a target just like object_type. As
23641 Is valid, and needs to result in the int 1 being boxed before it
23642 is assigned to the value type v.
23644 * class.cs (TypeContainer.AddEnum): Use the basename, not the name
23645 to validate the enumeration name.
23647 * expression.cs (ArrayAccess.EmitAssign): Mimic the same test from
23648 EmitDynamicInitializers for the criteria to use Ldelema. Thanks
23649 to hwang_rob@yahoo.ca for finding the bug and providing a patch.
23651 * ecore.cs (TryImplicitIntConversion): When doing an
23652 implicit-enumeration-conversion, check if the type is 64-bits and
23653 perform a conversion before passing to EnumConstant.
23655 2002-09-23 Miguel de Icaza <miguel@ximian.com>
23657 * decl.cs (Error_AmbiguousTypeReference); New routine used to
23658 report ambiguous type references. Unlike the MS version, we
23659 report what the ambiguity is. Innovation at work ;-)
23661 (DeclSpace.FindType): Require a location argument to
23662 display when we display an ambiguous error.
23664 * ecore.cs: (SimpleName.DoResolveType): Pass location to FindType.
23666 * interface.cs (GetInterfaceTypeByName): Pass location to FindType.
23668 * expression.cs (EmitDynamicInitializers): Apply patch from
23669 hwang_rob@yahoo.ca that fixes the order in which we emit our
23672 2002-09-21 Martin Baulig <martin@gnome.org>
23674 * delegate.cs (Delegate.VerifyApplicability): Make this work if the
23675 delegate takes no arguments.
23677 2002-09-20 Miguel de Icaza <miguel@ximian.com>
23679 * constant.cs: Use Conv_U8 instead of Conv_I8 when loading longs
23682 * expression.cs: Extract the underlying type.
23684 * ecore.cs (StoreFromPtr): Use TypeManager.IsEnumType instad of IsEnum
23686 * decl.cs (FindType): Sorry about this, fixed the type lookup bug.
23688 2002-09-19 Miguel de Icaza <miguel@ximian.com>
23690 * class.cs (TypeContainer.DefineType): We can not use the nice
23691 PackingSize with the size set to 1 DefineType method, because it
23692 will not allow us to define the interfaces that the struct
23695 This completes the fixing of bug 27287
23697 * ecore.cs (Expresion.ImplicitReferenceConversion): `class-type S'
23698 means also structs. This fixes part of the problem.
23699 (Expresion.ImplicitReferenceConversionExists): ditto.
23701 * decl.cs (DeclSparce.ResolveType): Only report the type-not-found
23702 error if there were no errors reported during the type lookup
23703 process, to avoid duplicates or redundant errors. Without this
23704 you would get an ambiguous errors plus a type not found. We have
23705 beaten the user enough with the first error.
23707 (DeclSparce.FindType): Emit a warning if we have an ambiguous
23710 * ecore.cs (SimpleName.DoResolveType): If an error is emitted
23711 during the resolution process, stop the lookup, this avoids
23712 repeated error reports (same error twice).
23714 * rootcontext.cs: Emit a warning if we have an ambiguous reference.
23716 * typemanager.cs (LookupType): Redo the type lookup code to match
23717 the needs of System.Reflection.
23719 The issue is that System.Reflection requires references to nested
23720 types to begin with a "+" sign instead of a dot. So toplevel
23721 types look like: "NameSpace.TopLevelClass", and nested ones look
23722 like "Namespace.TopLevelClass+Nested", with arbitrary nesting
23725 2002-09-19 Martin Baulig <martin@gnome.org>
23727 * codegen.cs (EmitContext.EmitTopBlock): If control flow analysis
23728 says that a method always returns or always throws an exception,
23729 don't report the CS0161.
23731 * statement.cs (FlowBranching.UsageVector.MergeChildren): Always
23732 set `Returns = new_returns'.
23734 2002-09-19 Martin Baulig <martin@gnome.org>
23736 * expression.cs (MemberAccess.ResolveMemberAccess): When resolving
23737 to an enum constant, check for a CS0176.
23739 2002-09-18 Miguel de Icaza <miguel@ximian.com>
23741 * class.cs (TypeContainer.CheckPairedOperators): Now we check
23742 for operators that must be in pairs and report errors.
23744 * ecore.cs (SimpleName.DoResolveType): During the initial type
23745 resolution process, when we define types recursively, we must
23746 check first for types in our current scope before we perform
23747 lookups in the enclosing scopes.
23749 * expression.cs (MakeByteBlob): Handle Decimal blobs.
23751 (Invocation.VerifyArgumentsCompat): Call
23752 TypeManager.TypeToCoreType on the parameter_type.GetElementType.
23753 I thought we were supposed to always call this, but there are a
23754 few places in the code where we dont do it.
23756 2002-09-17 Miguel de Icaza <miguel@ximian.com>
23758 * driver.cs: Add support in -linkres and -resource to specify the
23759 name of the identifier.
23761 2002-09-16 Miguel de Icaza <miguel@ximian.com>
23763 * ecore.cs (StandardConversionExists): Sync with the conversion
23764 code: allow anything-* to void* conversions.
23766 (FindMostSpecificSource): Use an Expression argument
23767 instead of a Type, because we might be handed over a Literal which
23768 gets a few more implicit conversions that plain types do not. So
23769 this information was being lost.
23771 Also, we drop the temporary type-holder expression when not
23774 2002-09-17 Martin Baulig <martin@gnome.org>
23776 * class.cs (PropertyBase.CheckBase): Don't check the base class if
23777 this is an explicit interface implementation.
23779 2002-09-17 Martin Baulig <martin@gnome.org>
23781 * class.cs (PropertyBase.CheckBase): Make this work for indexers with
23782 different `IndexerName' attributes.
23784 * expression.cs (BaseIndexerAccess): Rewrote this class to use IndexerAccess.
23785 (IndexerAccess): Added special protected ctor for BaseIndexerAccess and
23786 virtual CommonResolve().
23788 2002-09-16 Miguel de Icaza <miguel@ximian.com>
23790 * enum.cs (LookupEnumValue): Use the EnumConstant declared type,
23791 and convert that to the UnderlyingType.
23793 * statement.cs (Foreach.Resolve): Indexers are just like variables
23794 or PropertyAccesses.
23796 * cs-tokenizer.cs (consume_string): Track line numbers and columns
23797 inside quoted strings, we were not doing this before.
23799 2002-09-16 Martin Baulig <martin@gnome.org>
23801 * ecore.cs (MethodGroupExpr.DoResolve): If we have an instance expression,
23802 resolve it. This is needed for the definite assignment check of the
23803 instance expression, fixes bug #29846.
23804 (PropertyExpr.DoResolve, EventExpr.DoResolve): Likewise.
23806 2002-09-16 Nick Drochak <ndrochak@gol.com>
23808 * parameter.cs: Fix compile error. Cannot reference static member
23809 from an instance object. Is this an mcs bug?
23811 2002-09-14 Martin Baulig <martin@gnome.org>
23813 * decl.cs (MemberCache.SetupCacheForInterface): Don't add an interface
23814 multiple times. Fixes bug #30295, added test-166.cs.
23816 2002-09-14 Martin Baulig <martin@gnome.org>
23818 * statement.cs (Block.Emit): Don't emit unreachable code.
23819 (Switch.SimpleSwitchEmit, Switch.TableSwitchEmit): Check for missing
23820 `break' statements.
23821 (Goto.Emit, Continue.Emit): Set ec.Breaks = true.
23823 2002-09-14 Martin Baulig <martin@gnome.org>
23825 * parameter.cs (Parameter.Attributes): Make this work if Modifier.ISBYREF
23828 2002-09-14 Martin Baulig <martin@gnome.org>
23830 * typemanager.cs (TypeManager.IsNestedChildOf): This must return false
23831 if `type == parent' since in this case `type.IsSubclassOf (parent)' will
23832 be false on the ms runtime.
23834 2002-09-13 Martin Baulig <martin@gnome.org>
23836 * ecore.cs (SimpleName.SimpleNameResolve): Include the member name in
23837 the CS0038 error message.
23839 2002-09-12 Miguel de Icaza <miguel@ximian.com>
23841 * expression.cs (CheckedExpr, UnCheckedExpr): If we have a
23842 constant inside, return it.
23844 2002-09-12 Martin Baulig <martin@gnome.org>
23846 * cfold.cs (ConstantFold.DoConstantNumericPromotions): Check whether an
23847 implicit conversion can be done between enum types.
23849 * enum.cs (Enum.LookupEnumValue): If the value is an EnumConstant,
23850 check whether an implicit conversion to the current enum's UnderlyingType
23851 exists and report an error if not.
23853 * codegen.cs (CodeGen.Init): Delete the symbol file when compiling
23854 without debugging support.
23856 * delegate.cs (Delegate.CloseDelegate): Removed, use CloseType instead.
23857 Fixes bug #30235. Thanks to Ricardo Fernández Pascual.
23859 2002-09-12 Martin Baulig <martin@gnome.org>
23861 * typemanager.cs (TypeManager.IsNestedChildOf): New method.
23863 * ecore.cs (IMemberExpr.DeclaringType): New property.
23864 (SimpleName.SimpleNameResolve): Check whether we're accessing a
23865 nonstatic member of an outer type (CS0038).
23867 2002-09-11 Miguel de Icaza <miguel@ximian.com>
23869 * driver.cs: Activate the using-error detector at warning level
23870 4 (at least for MS-compatible APIs).
23872 * namespace.cs (VerifyUsing): Small buglett fix.
23874 * pending.cs (PendingImplementation): pass the container pointer.
23876 * interface.cs (GetMethods): Allow for recursive definition. Long
23877 term, I would like to move every type to support recursive
23878 definitions, not the current ordering mechanism that we have right
23881 The situation is this: Attributes are handled before interfaces,
23882 so we can apply attributes to interfaces. But some attributes
23883 implement interfaces, we will now handle the simple cases
23884 (recursive definitions will just get an error).
23886 * parameter.cs: Only invalidate types at the end if we fail to
23889 2002-09-09 Martin Baulig <martin@gnome.org>
23891 * ecore.cs (PropertyExpr.Emit): Also check for
23892 TypeManager.system_int_array_get_length so this'll also work when
23893 compiling corlib. Fixes #30003.
23895 2002-09-09 Martin Baulig <martin@gnome.org>
23897 * expression.cs (ArrayCreation.MakeByteBlob): Added support for enums
23898 and throw an exception if we can't get the type's size. Fixed #30040,
23901 2002-09-09 Martin Baulig <martin@gnome.org>
23903 * ecore.cs (PropertyExpr.DoResolve): Added check for static properies.
23905 * expression.cs (SizeOf.DoResolve): Sizeof is only allowed in unsafe
23906 context. Fixes bug #30027.
23908 * delegate.cs (NewDelegate.Emit): Use OpCodes.Ldvirtftn for
23909 virtual functions. Fixes bug #30043, added test-164.cs.
23911 2002-09-08 Ravi Pratap <ravi@ximian.com>
23913 * attribute.cs : Fix a small NullRef crash thanks to my stupidity.
23915 2002-09-08 Nick Drochak <ndrochak@gol.com>
23917 * driver.cs: Use an object to get the windows codepage since it's not a
23920 2002-09-08 Miguel de Icaza <miguel@ximian.com>
23922 * statement.cs (For.Emit): for infinite loops (test == null)
23923 return whether there is a break inside, not always "true".
23925 * namespace.cs (UsingEntry): New struct to hold the name of the
23926 using definition, the location where it is defined, and whether it
23927 has been used in a successful type lookup.
23929 * rootcontext.cs (NamespaceLookup): Use UsingEntries instead of
23934 2002-09-06 Ravi Pratap <ravi@ximian.com>
23936 * attribute.cs : Fix incorrect code which relied on catching
23937 a NullReferenceException to detect a null being passed in
23938 where an object was expected.
23940 2002-09-06 Miguel de Icaza <miguel@ximian.com>
23942 * statement.cs (Try): flag the catch variable as assigned
23944 * expression.cs (Cast): Simplified by using ResolveType instead of
23945 manually resolving.
23947 * statement.cs (Catch): Fix bug by using ResolveType.
23949 2002-09-06 Ravi Pratap <ravi@ximian.com>
23951 * expression.cs (BetterConversion): Special case for when we have
23952 a NullLiteral as the argument and we have to choose between string
23953 and object types - we choose string the way csc does.
23955 * attribute.cs (Attribute.Resolve): Catch the
23956 NullReferenceException and report error #182 since the Mono
23957 runtime no more has the bug and having this exception raised means
23958 we tried to select a constructor which takes an object and is
23961 2002-09-05 Ravi Pratap <ravi@ximian.com>
23963 * expression.cs (Invocation.OverloadResolve): Flag a nicer error
23964 message (1502, 1503) when we can't locate a method after overload
23965 resolution. This is much more informative and closes the bug
23968 * interface.cs (PopulateMethod): Return if there are no argument
23969 types. Fixes a NullReferenceException bug.
23971 * attribute.cs (Attribute.Resolve): Ensure we allow TypeOf
23972 expressions too. Previously we were checking only in one place for
23973 positional arguments leaving out named arguments.
23975 * ecore.cs (ImplicitNumericConversion): Conversion from underlying
23976 type to the enum type is not allowed. Remove code corresponding to
23979 (ConvertNumericExplicit): Allow explicit conversions from
23980 the underlying type to enum type. This precisely follows the spec
23981 and closes a bug filed by Gonzalo.
23983 2002-09-04 Gonzalo Paniagua Javier <gonzalo@ximian.com>
23986 * compiler.csproj.user: patch from Adam Chester (achester@bigpond.com).
23988 2002-09-03 Miguel de Icaza <miguel@ximian.com>
23990 * statement.cs (SwitchLabel.ResolveAndReduce): In the string case,
23991 it was important that we stored the right value after the
23992 reduction in `converted'.
23994 2002-09-04 Martin Baulig <martin@gnome.org>
23996 * location.cs (Location.SymbolDocument): Use full pathnames for the
23999 2002-08-30 Miguel de Icaza <miguel@ximian.com>
24001 * expression.cs (ComposedCast): Use DeclSparce.ResolveType instead
24002 of the expression resolve mechanism, because that will catch the
24003 SimpleName error failures.
24005 (Conditional): If we can not resolve the
24006 expression, return, do not crash.
24008 2002-08-29 Gonzalo Paniagua Javier <gonzalo@ximian.com>
24011 (location): display token name instead of its number.
24013 2002-08-28 Martin Baulig <martin@gnome.org>
24015 * expression.cs (Binary.ResolveOperator): Don't silently return
24016 but return an error if an operator cannot be applied between two
24019 2002-08-28 Martin Baulig <martin@gnome.org>
24021 * class.cs (Constructor.Define): Set the permission attributes
24022 correctly instead of making all constructors public.
24024 2002-08-28 Martin Baulig <martin@gnome.org>
24026 * ecore.cs (Expression.DoResolve): Do a TypeManager.MemberLook
24027 for private members before reporting a CS0103; if we find anything,
24030 2002-08-28 Martin Baulig <martin@gnome.org>
24032 * typemanager.cs (TypeManager.FilterWithClosure): It's not enough
24033 to check whether `closure_start_type == closure_invocation_type',
24034 we also need to check whether `m.DeclaringType == closure_invocation_type'
24035 before bypassing the permission checks. We might be accessing
24036 protected/private members from the base class.
24037 (TypeManager.RealMemberLookup): Only set private_ok if private
24038 members were requested via BindingFlags.NonPublic.
24040 * ecore.cs (MethodGroupExpr.IsExplicitImpl): New property.
24042 * expression.cs (MemberAccess.ResolveMemberAccess): Set
24043 MethodGroupExpr.IsExplicitImpl if appropriate.
24044 (Invocation.DoResolve): Don't report the CS0120 for explicit
24045 interface implementations.
24047 2002-08-27 Martin Baulig <martin@gnome.org>
24049 * expression.cs (Invocation.DoResolve): If this is a static
24050 method and we don't have an InstanceExpression, we must report
24053 2002-08-25 Martin Baulig <martin@gnome.org>
24055 * expression.cs (Binary.ResolveOperator): Don't allow `!=' and
24056 `==' between a valuetype and an object.
24058 2002-08-25 Miguel de Icaza <miguel@ximian.com>
24060 * ecore.cs (TypeExpr): Provide a ToString method.
24062 2002-08-24 Martin Baulig <martin@gnome.org>
24064 * codegen.cs (CodeGen.InitMonoSymbolWriter): The symbol file is
24065 now called proggie.dbg and it's a binary file.
24067 2002-08-23 Martin Baulig <martin@gnome.org>
24069 * decl.cs (MemberCache.AddMethods): Ignore varargs methods.
24071 2002-08-23 Martin Baulig <martin@gnome.org>
24073 * struct.cs (MyStructInfo.ctor): Make this work with empty
24074 structs; it's not allowed to use foreach() on null.
24076 2002-08-23 Martin Baulig <martin@gnome.org>
24078 * codegen.cs (CodeGen.InitMonoSymbolWriter): Tell the symbol
24079 writer the full pathname of the generated assembly.
24081 2002-08-23 Martin Baulig <martin@gnome.org>
24083 * statements.cs (FlowBranching.UsageVector.MergeChildren):
24084 A `finally' block never returns or breaks; improved handling of
24087 2002-08-23 Martin Baulig <martin@gnome.org>
24089 * statement.cs (Throw.Resolve): Allow `throw null'.
24091 2002-08-23 Martin Baulig <martin@gnome.org>
24093 * expression.cs (MemberAccess.ResolveMemberAccess): If this is an
24094 EventExpr, don't do a DeclaredOnly MemberLookup, but check whether
24095 `ee.EventInfo.DeclaringType == ec.ContainerType'. The
24096 MemberLookup would return a wrong event if this is an explicit
24097 interface implementation and the class has an event with the same
24100 2002-08-23 Martin Baulig <martin@gnome.org>
24102 * statement.cs (Block.AddChildVariableNames): New public method.
24103 (Block.AddChildVariableName): Likewise.
24104 (Block.IsVariableNameUsedInChildBlock): Likewise.
24105 (Block.AddVariable): Check whether a variable name has already
24106 been used in a child block.
24108 * cs-parser.jay (declare_local_variables): Mark all variable names
24109 from the current block as being used in a child block in the
24112 2002-08-23 Martin Baulig <martin@gnome.org>
24114 * codegen.cs (CodeGen.InitializeSymbolWriter): Abort if we can't
24115 find the symbol writer.
24117 * driver.cs: csc also allows the arguments to /define being
24118 separated by commas, not only by semicolons.
24120 2002-08-23 Martin Baulig <martin@gnome.org>
24122 * interface.cs (Interface.GetMembers): Added static check for events.
24124 2002-08-15 Martin Baulig <martin@gnome.org>
24126 * class.cs (MethodData.EmitDestructor): In the Expression.MemberLookup
24127 call, use ec.ContainerType.BaseType as queried_type and invocation_type.
24129 * ecore.cs (Expression.MemberLookup): Added documentation and explained
24130 why the MethodData.EmitDestructor() change was necessary.
24132 2002-08-20 Martin Baulig <martin@gnome.org>
24134 * class.cs (TypeContainer.FindMembers): Added static check for events.
24136 * decl.cs (MemberCache.AddMembers): Handle events like normal members.
24138 * typemanager.cs (TypeHandle.GetMembers): When queried for events only,
24139 use Type.GetEvents(), not Type.FindMembers().
24141 2002-08-20 Martin Baulig <martin@gnome.org>
24143 * decl.cs (MemberCache): Added a special method cache which will
24144 be used for method-only searched. This ensures that a method
24145 search will return a MethodInfo with the correct ReflectedType for
24148 2002-08-20 Martin Baulig <martin@gnome.org>
24150 * decl.cs (DeclSpace.FindMembers): Made this public.
24152 2002-08-20 Gonzalo Paniagua Javier <gonzalo@ximian.com>
24154 * delegate.cs: fixed build on windows.
24155 [FIXME: Filed as bug #29150: MCS must report these errors.]
24157 2002-08-19 Ravi Pratap <ravi@ximian.com>
24159 * ecore.cs (StandardConversionExists): Return a false
24160 if we are trying to convert the void type to anything else
24161 since that is not allowed.
24163 * delegate.cs (DelegateInvocation.DoResolve): Ensure that
24164 we flag error 70 in the event an event is trying to be accessed
24165 directly from outside the declaring type.
24167 2002-08-20 Martin Baulig <martin@gnome.org>
24169 * typemanager.cs, decl.cs: Moved MemberList, IMemberContainer and
24170 MemberCache from typemanager.cs to decl.cs.
24172 2002-08-19 Martin Baulig <martin@gnome.org>
24174 * class.cs (TypeContainer): Implement IMemberContainer.
24175 (TypeContainer.DefineMembers): Create the MemberCache.
24176 (TypeContainer.FindMembers): Do better BindingFlags checking; only
24177 return public members if BindingFlags.Public was given, check
24178 whether members are static.
24180 2002-08-16 Martin Baulig <martin@gnome.org>
24182 * decl.cs (DeclSpace.Define): Splitted this in Define and
24183 DefineMembers. DefineMembers is called first and initializes the
24186 * rootcontext.cs (RootContext.DefineMembers): New function. Calls
24187 DefineMembers() on all our DeclSpaces.
24189 * class.cs (TypeContainer.Define): Moved all code to DefineMembers(),
24190 but call DefineMembers() on all nested interfaces. We call their
24191 Define() in our new Define() function.
24193 * interface.cs (Interface): Implement IMemberContainer.
24194 (Interface.Define): Moved all code except the attribute stuf to
24196 (Interface.DefineMembers): Initialize the member cache.
24198 * typemanager.cs (IMemberFinder): Removed this interface, we don't
24199 need this anymore since we can use MemberCache.FindMembers directly.
24201 2002-08-19 Martin Baulig <martin@gnome.org>
24203 * typemanager.cs (MemberCache): When creating the cache for an
24204 interface type, add all inherited members.
24205 (TypeManager.MemberLookup_FindMembers): Changed `ref bool searching'
24206 to `out bool used_cache' and documented it.
24207 (TypeManager.MemberLookup): If we already used the cache in the first
24208 iteration, we don't need to do the interfaces check.
24210 2002-08-19 Martin Baulig <martin@gnome.org>
24212 * decl.cs (DeclSpace.FindMembers): New abstract method. Moved this
24213 here from IMemberFinder and don't implement this interface anymore.
24214 (DeclSpace.MemberCache): Moved here from IMemberFinder.
24216 * typemanager.cs (IMemberFinder): This interface is now only used by
24217 classes which actually support the member cache.
24218 (TypeManager.builder_to_member_finder): Renamed to builder_to_declspace
24219 since we only put DeclSpaces into this Hashtable.
24220 (MemberLookup_FindMembers): Use `builder_to_declspace' if the type is
24221 a dynamic type and TypeHandle.GetTypeHandle() otherwise.
24223 2002-08-16 Martin Baulig <martin@gnome.org>
24225 * typemanager.cs (ICachingMemberFinder): Removed.
24226 (IMemberFinder.MemberCache): New property.
24227 (TypeManager.FindMembers): Merged this with RealFindMembers().
24228 This function will never be called from TypeManager.MemberLookup()
24229 so we can't use the cache here, just the IMemberFinder.
24230 (TypeManager.MemberLookup_FindMembers): Check whether the
24231 IMemberFinder has a MemberCache and call the cache's FindMembers
24233 (MemberCache): Rewrote larger parts of this yet another time and
24234 cleaned it up a bit.
24236 2002-08-15 Miguel de Icaza <miguel@ximian.com>
24238 * driver.cs (LoadArgs): Support quoting.
24240 (Usage): Show the CSC-like command line arguments.
24242 Improved a few error messages.
24244 2002-08-15 Martin Baulig <martin@gnome.org>
24246 * typemanager.cs (IMemberContainer.Type): New property.
24247 (IMemberContainer.IsInterface): New property.
24249 The following changes are conditional to BROKEN_RUNTIME, which is
24250 defined at the top of the file.
24252 * typemanager.cs (MemberCache.MemberCache): Don't add the base
24253 class'es members, but add all members from TypeHandle.ObjectType
24254 if we're an interface.
24255 (MemberCache.AddMembers): Set the Declared flag if member.DeclaringType
24256 is the current type.
24257 (MemberCache.CacheEntry.Container): Removed this field.
24258 (TypeHandle.GetMembers): Include inherited members.
24260 2002-08-14 Gonzalo Paniagua Javier <gonzalo@ximian.com>
24262 * typemanager.cs: fixed compilation and added a comment on a field that
24265 2002-08-15 Martin Baulig <martin@gnome.org>
24267 * class.cs (ConstructorInitializer.Resolve): In the
24268 Expression.MemberLookup call, use the queried_type as
24271 * typemanager.cs (IMemberContainer.GetMembers): Removed the `bool
24272 declared' attribute, it's always true.
24273 (IMemberContainer.Parent, IMemberContainer.Name): New properties.
24274 (TypeManager.MemberLookup_FindMembers): [FIXME FIXME FIXME] Added
24275 temporary wrapper for FindMembers which tells MemberLookup whether
24276 members from the base classes are included in the return value.
24277 This will go away soon.
24278 (TypeManager.MemberLookup): Use this temporary hack here; once the
24279 new MemberCache is completed, we don't need to do the DeclaredOnly
24280 looping here anymore since the MemberCache will take care of this.
24281 (TypeManager.IsSubclassOrNestedChildOf): Allow `type == parent'.
24282 (MemberCache): When creating the MemberCache for a class, get
24283 members from the current class and all its base classes.
24284 (MemberCache.CacheEntry.Container): New field. This is a
24285 temporary hack until the Mono runtime is fixed to distinguish
24286 between ReflectedType and DeclaringType. It allows us to use MCS
24287 with both the MS runtime and the unfixed Mono runtime without
24288 problems and without accecting performance.
24289 (MemberCache.SearchMembers): The DeclaredOnly looping from
24290 TypeManager.MemberLookup is now done here.
24292 2002-08-14 Martin Baulig <martin@gnome.org>
24294 * statement.cs (MyStructInfo.MyStructInfo): Don't call
24295 Type.GetFields on dynamic types but get the fields from the
24296 corresponding TypeContainer.
24297 (MyStructInfo.GetStructInfo): Added check for enum types.
24299 * typemanager.cs (MemberList.IsSynchronized): Implemented.
24300 (MemberList.SyncRoot): Implemented.
24301 (TypeManager.FilterWithClosure): No need to check permissions if
24302 closure_start_type == closure_invocation_type, don't crash if
24303 closure_invocation_type is null.
24305 2002-08-13 Martin Baulig <martin@gnome.org>
24307 Rewrote TypeContainer.FindMembers to use a member cache. This
24308 gives us a speed increase of about 35% for the self-hosting MCS
24309 build and of about 15-20% for the class libs (both on GNU/Linux).
24311 * report.cs (Timer): New class to get enhanced profiling. This
24312 whole class is "TIMER" conditional since it remarkably slows down
24315 * class.cs (MemberList): New class. This is an IList wrapper
24316 which we're now using instead of passing MemberInfo[]'s around to
24317 avoid copying this array unnecessarily.
24318 (IMemberFinder.FindMember): Return a MemberList, not a MemberInfo [].
24319 (ICachingMemberFinder, IMemberContainer): New interface.
24320 (TypeManager.FilterWithClosure): If `criteria' is null, the name
24321 has already been checked, otherwise use it for the name comparision.
24322 (TypeManager.FindMembers): Renamed to RealMemberFinder and
24323 provided wrapper which tries to use ICachingMemberFinder.FindMembers
24324 if possible. Returns a MemberList, not a MemberInfo [].
24325 (TypeHandle): New class, implements IMemberContainer. We create
24326 one instance of this class per type, it contains a MemberCache
24327 which is used to do the member lookups.
24328 (MemberCache): New class. Each instance of this class contains
24329 all members of a type and a name-based hash table.
24330 (MemberCache.FindMembers): This is our new member lookup
24331 function. First, it looks up all members of the requested name in
24332 the hash table. Then, it walks this list and sorts out all
24333 applicable members and returns them.
24335 2002-08-13 Martin Baulig <martin@gnome.org>
24337 In addition to a nice code cleanup, this gives us a performance
24338 increase of about 1.4% on GNU/Linux - not much, but it's already
24339 half a second for the self-hosting MCS compilation.
24341 * typemanager.cs (IMemberFinder): New interface. It is used by
24342 TypeManager.FindMembers to call FindMembers on a TypeContainer,
24343 Enum, Delegate or Interface.
24344 (TypeManager.finder_to_member_finder): New PtrHashtable.
24345 (TypeManager.finder_to_container): Removed.
24346 (TypeManager.finder_to_delegate): Removed.
24347 (TypeManager.finder_to_interface): Removed.
24348 (TypeManager.finder_to_enum): Removed.
24350 * interface.cs (Interface): Implement IMemberFinder.
24352 * delegate.cs (Delegate): Implement IMemberFinder.
24354 * enum.cs (Enum): Implement IMemberFinder.
24356 * class.cs (TypeContainer): Implement IMemberFinder.
24358 2002-08-12 Martin Baulig <martin@gnome.org>
24360 * ecore.cs (TypeExpr.DoResolveType): Mark this as virtual.
24362 2002-08-12 Martin Baulig <martin@gnome.org>
24364 * ecore.cs (ITypeExpression): New interface for expressions which
24366 (TypeExpression): Renamed to TypeLookupExpression.
24367 (Expression.DoResolve): If we're doing a types-only lookup, the
24368 expression must implement the ITypeExpression interface and we
24369 call DoResolveType() on it.
24370 (SimpleName): Implement the new ITypeExpression interface.
24371 (SimpleName.SimpleNameResolve): Removed the ec.OnlyLookupTypes
24372 hack, the situation that we're only looking up types can't happen
24373 anymore when this method is called. Moved the type lookup code to
24374 DoResolveType() and call it.
24375 (SimpleName.DoResolveType): This ITypeExpression interface method
24376 is now doing the types-only lookup.
24377 (TypeExpr, TypeLookupExpression): Implement ITypeExpression.
24378 (ResolveFlags): Added MaskExprClass.
24380 * expression.cs (MemberAccess): Implement the ITypeExpression
24382 (MemberAccess.DoResolve): Added support for a types-only lookup
24383 when we're called via ITypeExpression.DoResolveType().
24384 (ComposedCast): Implement the ITypeExpression interface.
24386 * codegen.cs (EmitContext.OnlyLookupTypes): Removed. Call
24387 Expression.Resolve() with ResolveFlags.Type instead.
24389 2002-08-12 Martin Baulig <martin@gnome.org>
24391 * interface.cs (Interface.Define): Apply attributes.
24393 * attribute.cs (Attribute.ApplyAttributes): Added support for
24394 interface attributes.
24396 2002-08-11 Martin Baulig <martin@gnome.org>
24398 * statement.cs (Block.Emit): Only check the "this" variable if we
24399 do not always throw an exception.
24401 * ecore.cs (PropertyExpr.DoResolveLValue): Implemented, check
24402 whether the property has a set accessor.
24404 2002-08-11 Martin Baulig <martin@gnome.org>
24406 Added control flow analysis support for structs.
24408 * ecore.cs (ResolveFlags): Added `DisableFlowAnalysis' to resolve
24409 with control flow analysis turned off.
24410 (IVariable): New interface.
24411 (SimpleName.SimpleNameResolve): If MemberAccess.ResolveMemberAccess
24412 returns an IMemberExpr, call DoResolve/DoResolveLValue on it.
24413 (FieldExpr.DoResolve): Resolve the instance expression with flow
24414 analysis turned off and do the definite assignment check after the
24415 resolving when we know what the expression will resolve to.
24417 * expression.cs (LocalVariableReference, ParameterReference):
24418 Implement the new IVariable interface, only call the flow analysis
24419 code if ec.DoFlowAnalysis is true.
24420 (This): Added constructor which takes a Block argument. Implement
24421 the new IVariable interface.
24422 (MemberAccess.DoResolve, MemberAccess.DoResolveLValue): Call
24423 DoResolve/DoResolveLValue on the result of ResolveMemberLookup().
24424 This does the definite assignment checks for struct members.
24426 * class.cs (Constructor.Emit): If this is a non-static `struct'
24427 constructor which doesn't have any initializer, call
24428 Block.AddThisVariable() to tell the flow analysis code that all
24429 struct elements must be initialized before control returns from
24432 * statement.cs (MyStructInfo): New public class.
24433 (UsageVector.this [VariableInfo vi]): Added `int field_idx'
24434 argument to this indexer. If non-zero, check an individual struct
24435 member, not the whole struct.
24436 (FlowBranching.CheckOutParameters): Check struct members.
24437 (FlowBranching.IsVariableAssigned, SetVariableAssigned): Added
24438 overloaded versions of these methods which take an additional
24439 `int field_idx' argument to check struct members.
24440 (FlowBranching.IsParameterAssigned, SetParameterAssigned): Added
24441 overloaded versions of these methods which take an additional
24442 `string field_name' argument to check struct member.s
24443 (VariableInfo): Implement the IVariable interface.
24444 (VariableInfo.StructInfo): New public property. Returns the
24445 MyStructInfo instance of the variable if it's a struct or null.
24446 (Block.AddThisVariable): New public method. This is called from
24447 Constructor.Emit() for non-static `struct' constructor which do
24448 not have any initializer. It creates a special variable for the
24449 "this" instance variable which will be checked by the flow
24450 analysis code to ensure that all of the struct's fields are
24451 initialized before control returns from the constructor.
24452 (UsageVector): Added support for struct members. If a
24453 variable/parameter is a struct with N members, we reserve a slot
24454 in the usage vector for each member. A struct is considered fully
24455 initialized if either the struct itself (slot 0) or all its
24456 members are initialized.
24458 2002-08-08 Martin Baulig <martin@gnome.org>
24460 * driver.cs (Driver.MainDriver): Only report an error CS5001
24461 if there were no compilation errors.
24463 * codegen.cs (EmitContext.EmitContext): Use the DeclSpace's
24464 `UnsafeContext' property to determine whether the parent is in
24465 unsafe context rather than checking the parent's ModFlags:
24466 classes nested in an unsafe class are unsafe as well.
24468 2002-08-08 Martin Baulig <martin@gnome.org>
24470 * statement.cs (UsageVector.MergeChildren): Distinguish between
24471 `Breaks' and `Returns' everywhere, don't set `Breaks' anymore if
24472 we return. Added test17() and test18() to test-154.cs.
24474 2002-08-08 Martin Baulig <martin@gnome.org>
24476 * typemanager.cs (TypeManager.FilterWithClosure): If we have
24477 Family access, make sure the invoking type isn't a subclass of the
24478 queried type (that'd be a CS1540).
24480 * ecore.cs (Expression.MemberLookup): Added overloaded version of
24481 this method which takes an additional `Type invocation_type'.
24483 * expression.cs (BaseAccess.DoResolve): Use the base type as
24484 invocation and query type.
24485 (MemberAccess.DoResolve): If the lookup failed and we're about to
24486 report a CS0122, try a lookup with the ec.ContainerType - if this
24487 succeeds, we must report a CS1540.
24489 2002-08-08 Martin Baulig <martin@gnome.org>
24491 * ecore.cs (IMemberExpr): Added `bool IsInstance' property.
24492 (MethodGroupExpr): Implement the IMemberExpr interface.
24494 * expression (MemberAccess.ResolveMemberAccess): No need to have
24495 any special code for MethodGroupExprs anymore, they're now
24498 2002-08-08 Martin Baulig <martin@gnome.org>
24500 * typemanager.cs (TypeManager.FilterWithClosure): Check Assembly,
24501 Family, FamANDAssem and FamORAssem permissions.
24502 (TypeManager.IsSubclassOrNestedChildOf): New public method.
24504 2002-08-08 Martin Baulig <martin@gnome.org>
24506 * statement.cs (FlowBranchingType): Added LOOP_BLOCK.
24507 (UsageVector.MergeChildren): `break' breaks unless we're in a switch
24510 Thu Aug 8 10:28:07 CEST 2002 Paolo Molaro <lupus@ximian.com>
24512 * driver.cs: implemented /resource option to embed managed resources.
24514 2002-08-07 Martin Baulig <martin@gnome.org>
24516 * class.cs (FieldBase.Initializer): Renamed to `init' and made private.
24517 (FieldBase.HasFieldInitializer): New public property.
24518 (FieldBase.GetInitializerExpression): New public method. Resolves and
24519 returns the field initializer and makes sure it is only resolved once.
24520 (TypeContainer.EmitFieldInitializers): Call
24521 FieldBase.GetInitializerExpression to get the initializer, this ensures
24522 that it isn't resolved multiple times.
24524 * codegen.cs (EmitContext): Added `bool IsFieldInitialier'. This tells
24525 the resolving process (SimpleName/MemberLookup) that we're currently
24526 emitting a field initializer (which must not access any instance members,
24527 this is an error CS0236).
24529 * ecore.cs (SimpleName.Error_ObjectRefRequired): Added EmitContext
24530 argument, if the `IsFieldInitializer' flag is set, we must report and
24531 error CS0236 and not an error CS0120.
24533 2002-08-07 Martin Baulig <martin@gnome.org>
24535 * ecore.cs (IMemberExpr): New public interface.
24536 (FieldExpr, PropertyExpr, EventExpr): Implement IMemberExpr.
24537 (SimpleName.SimpleNameResolve): Call MemberAccess.ResolveMemberAccess
24538 if the expression is an IMemberExpr.
24540 * expression.cs (MemberAccess.ResolveMemberAccess): Allow `left'
24541 to be null, implicitly default to `this' if we're non-static in
24542 this case. Simplified the code a lot by using the new IMemberExpr
24543 interface. Also fixed bug #28176 here.
24545 2002-08-06 Martin Baulig <martin@gnome.org>
24547 * cs-parser.jay (SimpleLookup): Removed. We need to create
24548 ParameterReferences during semantic analysis so that we can do a
24549 type-only search when resolving Cast, TypeOf and SizeOf.
24550 (block): Pass the `current_local_parameters' to the Block's
24553 * class.cs (ConstructorInitializer): Added `Parameters parameters'
24554 argument to the constructor.
24555 (ConstructorInitializer.Resolve): Create a temporary implicit
24556 block with the parameters.
24558 * ecore.cs (SimpleName.SimpleNameResolve): Resolve parameter
24559 references here if we aren't doing a type-only search.
24561 * statement.cs (Block): Added constructor which takes a
24562 `Parameters parameters' argument.
24563 (Block.Parameters): New public property.
24565 * support.cs (InternalParameters.Parameters): Renamed `parameters'
24566 to `Parameters' and made it public readonly.
24568 2002-08-06 Martin Baulig <martin@gnome.org>
24570 * ecore.cs (Expression.Warning): Made this public as well.
24572 * report.cs (Report.Debug): Print the contents of collections.
24574 2002-08-06 Martin Baulig <martin@gnome.org>
24576 * ecore.cs (Expression.ResolveFlags): New [Flags] enum. This is
24577 used to tell Resolve() which kinds of expressions it may return.
24578 (Expression.Resolve): Added overloaded version of this method which
24579 takes a `ResolveFlags flags' argument. This can be used to tell
24580 Resolve() which kinds of expressions it may return. Reports a
24582 (Expression.ResolveWithSimpleName): Removed, use Resolve() with
24583 ResolveFlags.SimpleName.
24584 (Expression.Error118): Added overloaded version of this method which
24585 takes a `ResolveFlags flags' argument. It uses the flags to determine
24586 which kinds of expressions are allowed.
24588 * expression.cs (Argument.ResolveMethodGroup): New public method.
24589 Resolves an argument, but allows a MethodGroup to be returned.
24590 This is used when invoking a delegate.
24592 * TODO: Updated a bit.
24594 2002-08-06 Gonzalo Paniagua Javier <gonzalo@ximian.com>
24596 Fixed compilation with csc.
24598 * ecore.cs: Expression.Error made public. Is this correct? Should
24599 Warning be made public too?
24601 * expression.cs: use ea.Location instead of ea.loc.
24602 [FIXME: Filed as bug #28607: MCS must report these errors.]
24604 2002-08-06 Martin Baulig <martin@gnome.org>
24606 * ecore.cs (Expression.loc): Moved the location here instead of
24607 duplicating it in all derived classes.
24608 (Expression.Location): New public property.
24609 (Expression.Error, Expression.Warning): Made them non-static and
24610 removed the location argument.
24611 (Expression.Warning): Added overloaded version which takes an
24612 `int level' argument.
24613 (Expression.Error118): Make this non-static and removed the
24614 expression and location arguments.
24615 (TypeExpr): Added location argument to the constructor.
24617 * expression.cs (StaticCallExpr): Added location argument to
24619 (Indirection, PointerArithmetic): Likewise.
24620 (CheckedExpr, UnCheckedExpr): Likewise.
24621 (ArrayAccess, IndexerAccess, UserCast, ArrayPtr): Likewise.
24622 (StringPtr): Likewise.
24625 2002-08-05 Martin Baulig <martin@gnome.org>
24627 * expression.cs (BaseAccess.DoResolve): Actually report errors.
24629 * assign.cs (Assign.DoResolve): Check whether the source
24630 expression is a value or variable.
24632 * statement.cs (Try.Resolve): Set ec.InTry/InCatch/InFinally
24633 while resolving the corresponding blocks.
24635 * interface.cs (Interface.GetInterfaceTypeByName): Actually report
24636 an error, don't silently return null.
24638 * statement.cs (Block.AddVariable): Do the error reporting here
24639 and distinguish between CS0128 and CS0136.
24640 (Block.DoResolve): Report all unused labels (warning CS0164).
24641 (LabeledStatement): Pass the location to the constructor.
24642 (LabeledStatement.HasBeenReferenced): New property.
24643 (LabeledStatement.Resolve): Set it to true here.
24645 * statement.cs (Return.Emit): Return success even after reporting
24646 a type mismatch error (CS0126 or CS0127), this is what csc does and
24647 it avoids confusing the users with any consecutive errors.
24649 2002-08-05 Martin Baulig <martin@gnome.org>
24651 * enum.cs (Enum.LookupEnumValue): Catch circular definitions.
24653 * const.cs (Const.LookupConstantValue): Catch circular definitions.
24655 * expression.cs (MemberAccess.DoResolve): Silently return if an
24656 error has already been reported.
24658 * ecore.cs (Expression.MemberLookupFinal): Silently return if an
24659 error has already been reported.
24661 2002-08-05 Martin Baulig <martin@gnome.org>
24663 * statement.cs (UsageVector): Only initialize the `parameters'
24664 vector if we actually have any "out" parameters.
24666 2002-08-05 Martin Baulig <martin@gnome.org>
24668 * expression.cs (Binary.ResolveOperator): When combining delegates,
24669 they must have the same type.
24671 2002-08-05 Martin Baulig <martin@gnome.org>
24673 * typemanager.cs (TypeManager.GetArgumentTypes): Don't call
24674 PropertyInfo.GetIndexParameters() on dynamic types, this doesn't
24675 work with the ms runtime and we also don't need it: if we're a
24676 PropertyBuilder and not in the `indexer_arguments' hash, then we
24677 are a property and not an indexer.
24679 * class.cs (TypeContainer.AsAccessible): Use Type.IsArray,
24680 Type.IsPointer and Type.IsByRef instead of Type.HasElementType
24681 since the latter one doesn't work with the ms runtime.
24683 2002-08-03 Martin Baulig <martin@gnome.org>
24685 Fixed bugs #27998 and #22735.
24687 * class.cs (Method.IsOperator): New public field.
24688 (Method.CheckBase): Report CS0111 if there's already a method
24689 with the same parameters in the current class. Report CS0508 when
24690 attempting to change the return type of an inherited method.
24691 (MethodData.Emit): Report CS0179 if a method doesn't have a body
24692 and it's not marked abstract or extern.
24693 (PropertyBase): New abstract base class for Property and Indexer.
24694 (PropertyBase.CheckBase): Moved here from Property and made it work
24696 (PropertyBase.Emit): Moved here from Property.Emit, Indexer.Emit is
24697 the same so we can reuse it there.
24698 (Property, Indexer): Derive from PropertyBase.
24699 (MethodSignature.inheritable_property_signature_filter): New delegate
24700 to find properties and indexers.
24702 * decl.cs (MemberCore.CheckMethodAgainstBase): Added `string name'
24703 argument and improved error reporting.
24705 * parameter.cs (Parameters.GetEmptyReadOnlyParameters): Renamed to
24706 EmptyReadOnlyParameters and made it a property.
24708 * typemanager.cs (TypeManager.GetArgumentTypes): Added overloaded
24709 version of this method which takes a `PropertyInfo indexer'.
24710 (TypeManager.RegisterIndexer): New method.
24712 * class.cs: Added myself as author of this file :-)
24714 2002-08-03 Gonzalo Paniagua Javier <gonzalo@ximian.com>
24716 * class.cs: fixed compilation on windoze.
24718 2002-08-03 Martin Baulig <martin@gnome.org>
24720 * interface.cs (Interface.GetInterfaceBases): Check whether all
24721 base interfaces are at least as accessible than the current one.
24723 * class.cs (TypeContainer.GetClassBases): Check whether base types
24724 are at least as accessible than the current type.
24725 (TypeContainer.AsAccessible): Implemented and made non-static.
24726 (MemberBase.CheckParameters): Report errors if the accessibility
24729 * delegate.cs (Delegate.Delegate): The default visibility is
24730 internal for top-level types and private for nested types.
24731 (Delegate.Define): Report errors if the accessibility checks fail.
24733 * enum.cs (Enum.Enum): The default visibility is internal for
24734 top-level types and private for nested types.
24735 (Enum.DefineType): Compute the correct visibility.
24737 * modifiers.cs (Modifiers.TypeAttr): Added a version of this
24738 function which takes a `bool is_toplevel' instead of a TypeContainer.
24740 * typemanager.cs (TypeManager.IsBuiltinType): `void' is also a
24743 2002-08-02 Martin Baulig <martin@gnome.org>
24745 * expression.cs (LocalVariableReferenc): Added constructor which
24746 takes additional `VariableInfo vi' and `bool is_readonly' arguments.
24747 (LocalVariableReference.IsReadOnly): New property.
24748 (LocalVariableReference.DoResolveLValue): Report a CS1604 if the
24749 variable is readonly, use our own readonly flag to do this; you can
24750 use the new constructor to get a writable reference to a read-only
24753 * cs-parser.jay (foreach_statement, using_statement): Get a writable
24754 reference to the local variable.
24756 2002-08-01 Miguel de Icaza <miguel@ximian.com>
24758 * rootcontext.cs (ResolveCore): Also include System.Exception
24760 * statement.cs (Block.Emit): Do not emit the dead-code warnings if
24761 we reach an EmptyStatement.
24763 (Catch.DoResolve, Throw.DoResolve): Throwing the System.Exception
24766 * expression.cs (Binary.ResolveOperator): Check error result in
24769 use brtrue/brfalse directly and avoid compares to null.
24771 2002-08-02 Martin Baulig <martin@gnome.org>
24773 * class.cs (TypeContainer.Define): Define all nested interfaces here.
24774 Fixes bug #28407, added test-155.cs.
24776 2002-08-01 Martin Baulig <martin@gnome.org>
24778 * class.cs (Event.EmitDefaultMethod): Make this work with static
24779 events. Fixes #28311, added verify-3.cs.
24781 2002-08-01 Martin Baulig <martin@gnome.org>
24783 * statement.cs (ForeachHelperMethods): Added `enumerator_type' and
24784 `is_disposable' fields.
24785 (Foreach.GetEnumeratorFilter): Set `hm.enumerator_type' and
24786 `hm.is_disposable' if we're using the collection pattern.
24787 (Foreach.EmitCollectionForeach): Use the correct type for the
24788 enumerator's local variable, only emit the try/finally block if
24789 necessary (fixes #27713).
24791 2002-08-01 Martin Baulig <martin@gnome.org>
24793 * ecore.cs (Expression.report118): Renamed to Error118 and made
24796 * statement.cs (Throw.Resolve): Check whether the expression is of
24797 the correct type (CS0118) and whether the type derives from
24798 System.Exception (CS0155).
24799 (Catch.Resolve): New method. Do the type lookup here and check
24800 whether it derives from System.Exception (CS0155).
24801 (Catch.CatchType, Catch.IsGeneral): New public properties.
24803 * typemanager.cs (TypeManager.exception_type): Added.
24805 2002-07-31 Miguel de Icaza <miguel@ximian.com>
24807 * driver.cs: Updated About function.
24809 2002-07-31 Martin Baulig <martin@gnome.org>
24811 Implemented Control Flow Analysis.
24813 * codegen.cs (EmitContext.DoFlowAnalysis): New public variable.
24814 (EmitContext.CurrentBranching): Added.
24815 (EmitContext.StartFlowBranching): Added.
24816 (EmitContext.EndFlowBranching): Added.
24817 (EmitContext.KillFlowBranching): Added.
24818 (EmitContext.IsVariableAssigned): Added.
24819 (EmitContext.SetVariableAssigned): Added.
24820 (EmitContext.IsParameterAssigned): Added.
24821 (EmitContext.SetParameterAssigned): Added.
24822 (EmitContext.EmitTopBlock): Added `InternalParameters ip' argument.
24823 Added control flow analysis stuff here.
24825 * expression.cs (Unary.DoResolve): If the operator is Oper.AddressOf,
24826 resolve the expression as lvalue.
24827 (LocalVariableReference.DoResolve): Check whether the variable has
24828 already been assigned.
24829 (ParameterReference.DoResolveLValue): Override lvalue resolve to mark
24830 the parameter as assigned here.
24831 (ParameterReference.DoResolve): Check whether the parameter has already
24833 (Argument.Resolve): If it's a `ref' or `out' argument, resolve the
24834 expression as lvalue.
24836 * statement.cs (FlowBranching): New class for the flow analysis code.
24837 (Goto): Resolve the label in Resolve, not in Emit; added flow analysis.
24838 (LabeledStatement.IsDefined): New public property.
24839 (LabeledStatement.AddUsageVector): New public method to tell flow
24840 analyis that the label may be reached via a forward jump.
24841 (GotoCase): Lookup and resolve the label in Resolve, not in Emit; added
24843 (VariableInfo.Number): New public field. This is used by flow analysis
24844 to number all locals of a block.
24845 (Block.CountVariables): New public property. This is the number of
24846 local variables in this block (including the locals from all parent
24848 (Block.EmitMeta): Number all the variables.
24850 * statement.cs: Added flow analysis support to all classes.
24852 2002-07-31 Martin Baulig <martin@gnome.org>
24854 * driver.cs: Added "--mcs-debug" argument if MCS_DEBUG is defined.
24855 To get debugging messages, compile mcs with /define:MCS_DEBUG and
24856 then use this argument.
24858 * report.cs (Report.Debug): Renamed to conditional to "MCS_DEBUG".
24860 * makefile.gnu (MCS_FLAGS): Include $(MCS_DEFINES), the user may
24861 use this to specify /define options.
24863 2002-07-29 Martin Baulig <martin@gnome.org>
24865 * statement.cs (Fixed): Moved all code that does variable lookups
24866 and resolvings from Emit to Resolve.
24868 * statement.cs (For): Moved all code that does variable lookups
24869 and resolvings from Emit to Resolve.
24871 * statement.cs (Using): Moved all code that does variable lookups
24872 and resolvings from Emit to Resolve.
24874 2002-07-29 Martin Baulig <martin@gnome.org>
24876 * attribute.cs (Attribute.Resolve): Explicitly catch a
24877 System.NullReferenceException when creating the
24878 CustromAttributeBuilder and report a different warning message.
24880 2002-07-29 Martin Baulig <martin@gnome.org>
24882 * support.cs (ParameterData.ParameterName): Added method to
24883 get the name of a parameter.
24885 * typemanager.cs (TypeManager.IsValueType): New public method.
24887 2002-07-29 Martin Baulig <martin@gnome.org>
24889 * parameter.cs (Parameter.Modifier): Added `ISBYREF = 8'. This
24890 is a flag which specifies that it's either ref or out.
24891 (Parameter.GetParameterInfo (DeclSpace, int, out bool)): Changed
24892 the out parameter to `out Parameter.Modifier mod', also set the
24893 Parameter.Modifier.ISBYREF flag on it if it's either ref or out.
24895 * support.cs (InternalParameters.ParameterModifier): Distinguish
24896 between Parameter.Modifier.OUT and Parameter.Modifier.REF, set the
24897 Parameter.Modifier.ISBYREF flag if it's either ref or out.
24899 * expression.cs (Argument.GetParameterModifier): Distinguish
24900 between Parameter.Modifier.OUT and Parameter.Modifier.REF, set the
24901 Parameter.Modifier.ISBYREF flag if it's either ref or out.
24903 2002-07-29 Martin Baulig <martin@gnome.org>
24905 * expression.cs (ParameterReference.ParameterReference): Added
24906 `Location loc' argument to the constructor.
24908 * cs-parser.jay: Pass location to ParameterReference.
24910 2002-07-28 Miguel de Icaza <miguel@ximian.com>
24912 * statement.cs (Try): Initialize the location.
24914 * cs-parser.jay: pass location to Try.
24916 * expression.cs (Unary.Reduce): Change the prototype to return
24917 whether a constant fold could be performed or not. The result is
24918 returned in an out parameters. In the case of Indirection and
24919 AddressOf, we want to perform the full tests.
24921 2002-07-26 Miguel de Icaza <miguel@ximian.com>
24923 * statement.cs (Statement.Emit): Flag dead code.
24925 2002-07-27 Andrew Birkett <andy@nobugs.org>
24927 * expression.cs (Unary.Reduce): Handle AddressOf and Indirection.
24929 2002-07-27 Martin Baulig <martin@gnome.org>
24931 * class.cs (MethodData.Define): Put back call to
24932 TypeManager.AddMethod(), accidentally commented this out.
24934 * report.cs (Debug): New public method to print debugging information,
24935 this is `[Conditional ("DEBUG")]'.
24937 2002-07-26 Martin Baulig <martin@gnome.org>
24939 * cs-parser.jay (CSharpParser): Added `Stack switch_stack'.
24940 (switch_statement): Push the current_block to the switch_stack and
24941 pop it again when we're done with the switch.
24942 (switch_section): The new block is a child of the current_block.
24943 Fixes bug #24007, added test-152.cs.
24945 2002-07-27 Martin Baulig <martin@gnome.org>
24947 * expression.cs (Invocation.EmitArguments): When calling a varargs
24948 function with only its fixed arguments, we need to pass an empty
24951 2002-07-27 Martin Baulig <martin@gnome.org>
24953 Mono 0.13 has been released.
24955 2002-07-25 Miguel de Icaza <miguel@ximian.com>
24957 * driver.cs: Rename --resource to --linkres, because that is what
24958 we do currently, we dont support --resource yet.
24960 * cs-tokenizer.cs: Fix test for reporting endif mismatches.
24962 2002-07-25 Martin Baulig <martin@gnome.org>
24964 * class.cs (MethodData): New public class. This is a `method builder'
24965 class for a method or one accessor of a Property/Indexer/Event.
24966 (MethodData.GetMethodFlags): Moved here from MemberBase.
24967 (MethodData.ApplyAttributes): Likewise.
24968 (MethodData.ApplyObsoleteAttribute): Likewise.
24969 (MethodData.ApplyConditionalAttribute): Likewise.
24970 (MethodData.ApplyDllImportAttribute): Likewise.
24971 (MethodData.CheckAbstractAndExternal): Likewise.
24972 (MethodData.Define): Formerly knows as MemberBase.DefineMethod().
24973 (MethodData.Emit): Formerly known as Method.Emit().
24974 (MemberBase): Moved everything which was specific to a single
24975 accessor/method to MethodData.
24976 (Method): Create a new MethodData and call Define() and Emit() on it.
24977 (Property, Indexer, Event): Create a new MethodData objects for each
24978 accessor and call Define() and Emit() on them.
24980 2002-07-25 Martin Baulig <martin@gnome.org>
24982 Made MethodCore derive from MemberBase to reuse the code from there.
24983 MemberBase now also checks for attributes.
24985 * class.cs (MethodCore): Derive from MemberBase, not MemberCore.
24986 (MemberBase.GetMethodFlags): Moved here from class Method and marked
24988 (MemberBase.DefineAccessor): Renamed to DefineMethod(), added
24989 `CallingConventions cc' and `Attributes opt_attrs' arguments.
24990 (MemberBase.ApplyAttributes): New virtual method; applies the
24991 attributes to a method or accessor.
24992 (MemberBase.ApplyObsoleteAttribute): New protected virtual method.
24993 (MemberBase.ApplyConditionalAttribute): Likewise.
24994 (MemberBase.ApplyDllImportAttribute): Likewise.
24995 (MemberBase.CheckAbstractAndExternal): Likewise.
24996 (MethodCore.ParameterTypes): This is now a property instead of a
24997 method, it's initialized from DoDefineParameters().
24998 (MethodCore.ParameterInfo): Removed the set accessor.
24999 (MethodCore.DoDefineParameters): New protected virtual method to
25000 initialize ParameterTypes and ParameterInfo.
25001 (Method.GetReturnType): We can now simply return the MemberType.
25002 (Method.GetMethodFlags): Override the MemberBase version and add
25003 the conditional flags.
25004 (Method.CheckBase): Moved some code from Define() here, call
25005 DoDefineParameters() here.
25006 (Method.Define): Use DoDefine() and DefineMethod() from MemberBase
25007 here to avoid some larger code duplication.
25008 (Property.Emit, Indexer.Emit): Call CheckAbstractAndExternal() to
25009 ensure that abstract and external accessors don't declare a body.
25011 * attribute.cs (Attribute.GetValidPieces): Make this actually work:
25012 `System.Attribute.GetCustomAttributes (attr.Type)' does a recursive
25013 lookup in the attribute's parent classes, so we need to abort as soon
25014 as we found the first match.
25015 (Attribute.Obsolete_GetObsoleteMessage): Return the empty string if
25016 the attribute has no arguments.
25018 * typemanager.cs (TypeManager.AddMethod): Now takes a MemberBase instead
25021 2002-07-24 Gonzalo Paniagua Javier <gonzalo@ximian.com>
25023 * cs-parser.jay: reverted previous patch.
25025 2002-07-24 Gonzalo Paniagua Javier <gonzalo@ximian.com>
25027 * cs-parser.jay: fixed bug #22119.
25029 2002-07-24 Gonzalo Paniagua Javier <gonzalo@ximian.com>
25031 * attribute.cs: fixed compilation. The error was:
25032 "attribute.cs(571,17): error CS0177: The out parameter 'is_error' must
25033 be assigned to before control leaves the current method."
25034 [FIXME: Filed as bug #28186: MCS must report this error.]
25036 2002-07-25 Martin Baulig <martin@gnome.org>
25038 * attribute.cs (Attribute.Conditional_GetConditionName): New static
25039 method to pull the condition name ouf of a Conditional attribute.
25040 (Attribute.Obsolete_GetObsoleteMessage): New static method to pull
25041 the obsolete message and error flag out of an Obsolete attribute.
25043 * class.cs (Method.GetMethodFlags): New public method to get the
25044 TypeManager.MethodFlags for this method.
25045 (Method.ApplyConditionalAttribute, Method.ApplyObsoleteAttribute): New
25047 (Method.Define): Get and apply the Obsolete and Conditional attributes;
25048 if we're overriding a virtual function, set the new private variable
25049 `parent_method'; call the new TypeManager.AddMethod().
25051 * typemanager.cs (TypeManager.AddMethod): New static method. Stores
25052 the MethodBuilder and the Method in a PtrHashtable.
25053 (TypeManager.builder_to_method): Added for this purpose.
25054 (TypeManager.MethodFlags): Added IsObsoleteError.
25055 (TypeManager.GetMethodFlags): Added `Location loc' argument. Lookup
25056 Obsolete and Conditional arguments in MethodBuilders. If we discover
25057 an Obsolete attribute, emit an appropriate warning 618 / error 619 with
25058 the message from the attribute.
25060 2002-07-24 Martin Baulig <martin@gnome.org>
25062 * cs-tokenizer.cs: Eat up trailing whitespaces and one-line comments in
25063 preprocessor directives, ensure that the argument to #define/#undef is
25064 exactly one identifier and that it's actually an identifier.
25066 Some weeks ago I did a `#define DEBUG 1' myself and wondered why this
25069 2002-07-24 Martin Baulig <martin@gnome.org>
25071 * statement.cs (Foreach.ForeachHelperMethods): Added `Type element_type',
25072 initialize it to TypeManager.object_type in the constructor.
25073 (Foreach.GetEnumeratorFilter): Set `hm.element_type' to the return type
25074 of the `hm.get_current' method if we're using the collection pattern.
25075 (Foreach.EmitCollectionForeach): Use `hm.element_type' as the source type
25076 for the explicit conversion to make it work when we're using the collection
25077 pattern and the `Current' property has a different return type than `object'.
25080 2002-07-24 Martin Baulig <martin@gnome.org>
25082 * delegate.cs (Delegate.VerifyMethod): Simply return null if the method
25083 does not match, but don't report any errors. This method is called in
25084 order for all methods in a MethodGroupExpr until a matching method is
25085 found, so we don't want to bail out if the first method doesn't match.
25086 (NewDelegate.DoResolve): If none of the methods in the MethodGroupExpr
25087 matches, report the 123. Fixes #28070.
25089 2002-07-24 Martin Baulig <martin@gnome.org>
25091 * expression.cs (ArrayAccess.EmitStoreOpcode): Moved the
25092 TypeManager.TypeToCoreType() to the top of the method so the
25093 following equality checks will work. Fixes #28107.
25095 2002-07-24 Martin Baulig <martin@gnome.org>
25097 * cfold.cs (ConstantFold.DoConstantNumericPromotions): "If either
25098 operand is of type uint, and the other operand is of type sbyte,
25099 short or int, the operands are converted to type long." -
25100 Actually do what this comment already told us. Fixes bug #28106,
25103 2002-07-24 Martin Baulig <martin@gnome.org>
25105 * class.cs (MethodBase): New abstract class. This is now a base
25106 class for Property, Indexer and Event to avoid some code duplication
25107 in their Define() and DefineMethods() methods.
25108 (MethodBase.DoDefine, MethodBase.DefineAccessor): Provide virtual
25109 generic methods for Define() and DefineMethods().
25110 (FieldBase): Derive from MemberBase, not MemberCore.
25111 (Property): Derive from MemberBase, not MemberCore.
25112 (Property.DefineMethod): Moved all the code from this method to the
25113 new MethodBase.DefineAccessor(), just call it with appropriate
25115 (Property.Define): Call the new Property.DoDefine(), this does some
25116 sanity checks and we don't need to duplicate the code everywhere.
25117 (Event): Derive from MemberBase, not MemberCore.
25118 (Event.Define): Use the new MethodBase.DefineAccessor() to define the
25119 accessors, this will also make them work with interface events.
25120 (Indexer): Derive from MemberBase, not MemberCore.
25121 (Indexer.DefineMethod): Removed, call MethodBase.DefineAccessor() insstead.
25122 (Indexer.Define): Use the new MethodBase functions.
25124 * interface.cs (InterfaceEvent.InterfaceEvent): Added `Location loc'
25125 argument to the constructor.
25126 (Interface.FindMembers): Added support for interface events.
25127 (Interface.PopluateEvent): Implemented.
25129 Added test-149.cs for this. This also fixes bugs #26067 and #24256.
25131 2002-07-22 Miguel de Icaza <miguel@ximian.com>
25133 * class.cs (TypeContainer.AddMethod): Adding methods do not use IsValid,
25134 but this is required to check for a method name being the same as
25135 the containing class.
25139 2002-07-22 Gonzalo Paniagua Javier <gonzalo@ximian.com>
25141 * interface.cs: initialize variable.
25143 2002-07-23 Martin Baulig <martin@gnome.org>
25145 Implemented the IndexerName attribute in interfaces.
25147 * class.cs (TypeContainer.DefineIndexers): Don't set the indexer
25148 name if this is an explicit interface implementation.
25149 (Indexer.InterfaceIndexerName): New public variable. If we're
25150 implementing an interface indexer, this is the IndexerName in that
25151 interface. Otherwise, it's the IndexerName.
25152 (Indexer.DefineMethod): If we're implementing interface indexer,
25153 set InterfaceIndexerName. Use the new Pending.IsInterfaceIndexer
25154 and Pending.ImplementIndexer methods.
25155 (Indexer.Define): Also define the PropertyBuilder if we're
25156 implementing an interface indexer and this is neither an explicit
25157 interface implementation nor do the IndexerName match the one in
25160 * pending.cs (TypeAndMethods): Added `MethodInfo [] need_proxy'.
25161 If a method is defined here, then we always need to create a proxy
25162 for it. This is used when implementing interface indexers.
25163 (Pending.IsInterfaceIndexer): New public method.
25164 (Pending.ImplementIndexer): New public method.
25165 (Pending.InterfaceMethod): Added `MethodInfo need_proxy' argument.
25166 This is used when implementing interface indexers to define a proxy
25168 (Pending.VerifyPendingMethods): Look in the `need_proxy' array and
25169 define a proxy if necessary.
25171 * interface.cs (Interface.IndexerName): New public variable.
25172 (Interface.PopulateIndexer): Set the IndexerName.
25173 (Interface.DefineIndexers): New private method. Populate all the
25174 indexers and make sure their IndexerNames match.
25176 * typemanager.cs (IndexerPropertyName): Added support for interface
25179 2002-07-22 Martin Baulig <martin@gnome.org>
25181 * codegen.cs (EmitContext.HasReturnLabel): New public variable.
25182 (EmitContext.EmitTopBlock): Always mark the ReturnLabel and emit a
25183 ret if HasReturnLabel.
25184 (EmitContext.TryCatchLevel, LoopBeginTryCatchLevel): New public
25187 * statement.cs (Do.Emit, While.Emit, For.Emit, Foreach.Emit): Save
25188 and set the ec.LoopBeginTryCatchLevel.
25189 (Try.Emit): Increment the ec.TryCatchLevel while emitting the block.
25190 (Continue.Emit): If the ec.LoopBeginTryCatchLevel is smaller than
25191 the current ec.TryCatchLevel, the branch goes out of an exception
25192 block. In this case, we need to use Leave and not Br.
25194 2002-07-22 Martin Baulig <martin@gnome.org>
25196 * statement.cs (Try.Emit): Emit an explicit ret after the end of the
25197 block unless the block does not always return or it is contained in
25198 another try { ... } catch { ... } block. Fixes bug #26506.
25199 Added verify-1.cs to the test suite.
25201 2002-07-22 Martin Baulig <martin@gnome.org>
25203 * statement.cs (Switch.TableSwitchEmit): If we don't have a default,
25204 then we do not always return. Fixes bug #24985.
25206 2002-07-22 Martin Baulig <martin@gnome.org>
25208 * expression.cs (Invocation.OverloadedResolve): Do the BetterFunction()
25209 lookup on a per-class level; ie. walk up the class hierarchy until we
25210 found at least one applicable method, then choose the best among them.
25211 Fixes bug #24463 and test-29.cs.
25213 2002-07-22 Martin Baulig <martin@gnome.org>
25215 * typemanager.cs (TypeManager.ArrayContainsMethod): Don't check the
25216 return types of the methods. The return type is not part of the
25217 signature and we must not check it to make the `new' modifier work.
25218 Fixes bug #27999, also added test-147.cs.
25219 (TypeManager.TypeToCoreType): Added TypeManager.type_type.
25221 * expression.cs (Invocation.DoResolve): Call TypeManager.TypeToCoreType()
25222 on the method's return type.
25224 2002-07-21 Martin Baulig <martin@gnome.org>
25226 * assign.cs: Make this work if the rightmost source is a constant and
25227 we need to do an implicit type conversion. Also adding a few more tests
25228 to test-38.cs which should have caught this.
25230 * makefile.gnu: Disable debugging, there's already the mcs-mono2.exe
25231 target in the makefile for this. The makefile.gnu is primarily intended
25232 for end-users who don't want to debug the compiler.
25234 2002-07-21 Martin Baulig <martin@gnome.org>
25236 * assign.cs: Improved the Assign class so it can now handle embedded
25237 assignments (X = Y = Z = something). As a side-effect this'll now also
25238 consume less local variables. test-38.cs now passes with MCS, added
25239 a few new test cases to that test.
25241 2002-07-20 Martin Baulig <martin@gnome.org>
25243 * expression.cs (Binary.EmitBranchable): Emit correct unsigned branch
25244 instructions. Fixes bug #27977, also added test-146.cs.
25246 2002-07-19 Gonzalo Paniagua Javier <gonzalo@ximian.com>
25248 * cs-tokenizer.cs: fixed getHex ().
25250 2002-07-19 Martin Baulig <martin@gnome.org>
25252 * expression.cs (Invocation.EmitParams): Use TypeManager.LookupType(),
25253 not Type.GetType() to lookup the array type. This is needed when
25254 we're constructing an array of a user-defined type.
25255 (ArrayAccess.EmitDynamicInitializers): Only emit the Ldelema for
25256 single-dimensional arrays, but also for single-dimensial arrays of
25259 2002-07-19 Martin Baulig <martin@gnome.org>
25261 * expression.cs (New.DoEmit): Create a new LocalTemporary each time
25262 this function is called, it's not allowed to share LocalBuilders
25263 among ILGenerators.
25265 2002-07-19 Martin Baulig <martin@gnome.org>
25267 * expression.cs (Argument.Resolve): Report an error 118 when trying
25268 to pass a type as argument.
25270 2002-07-18 Martin Baulig <martin@gnome.org>
25272 * ecore.cs (Expression.ImplicitNumericConversion): Don't emit a
25273 Conv_R_Un for the signed `long' type.
25275 2002-07-15 Miguel de Icaza <miguel@ximian.com>
25277 * expression.cs (MemberAccess.DoResolve): Do not reuse the field
25278 `expr' for the temporary result, as that will fail if we do
25279 multiple resolves on the same expression.
25281 2002-07-05 Miguel de Icaza <miguel@ximian.com>
25283 * ecore.cs (SimpleNameResolve): Use ec.DeclSpace instead of
25284 ec.TypeContainer for looking up aliases.
25286 * class.cs (TypeContainer): Remove LookupAlias from here.
25288 * decl.cs (DeclSpace); Move here.
25290 2002-07-01 Miguel de Icaza <miguel@ximian.com>
25292 * class.cs (FindMembers): Only call filter if the constructor
25293 bulider is not null.
25295 Also handle delegates in `NestedTypes' now. Now we will perform
25296 type lookups using the standard resolution process. This also
25299 * decl.cs (DeclSpace.ResolveType): New type resolution routine.
25300 This uses Expressions (the limited kind that can be parsed by the
25301 tree) instead of strings.
25303 * expression.cs (ComposedCast.ToString): Implement, used to flag
25304 errors since now we have to render expressions.
25306 (ArrayCreation): Kill FormElementType. Use ComposedCasts in
25309 * ecore.cs (SimpleName.ToString): ditto.
25311 * cs-parser.jay: Instead of using strings to assemble types, use
25312 Expressions to assemble the type (using SimpleName, ComposedCast,
25313 MemberAccess). This should fix the type lookups in declarations,
25314 because we were using a different code path for this.
25316 * statement.cs (Block.Resolve): Continue processing statements
25317 even when there is an error.
25319 2002-07-17 Miguel de Icaza <miguel@ximian.com>
25321 * class.cs (Event.Define): Also remove the `remove' method from
25322 the list of pending items.
25324 * expression.cs (ParameterReference): Use ldarg.N (0..3) to
25325 generate more compact code.
25327 2002-07-17 Martin Baulig <martin@gnome.org>
25329 * const.cs (Const.LookupConstantValue): Add support for constant
25330 `unchecked' and `checked' expressions.
25331 Also adding test case test-140.cs for this.
25333 2002-07-17 Martin Baulig <martin@gnome.org>
25335 * statement.cs (Foreach.GetEnumeratorFilter): When compiling corlib,
25336 check whether mi.ReturnType implements the IEnumerator interface; the
25337 `==' and the IsAssignableFrom() will fail in this situation.
25339 2002-07-16 Ravi Pratap <ravi@ximian.com>
25341 * ecore.cs (SimpleName.SimpleNameResolve) : Apply Gonzalo's fix
25344 2002-07-16 Gonzalo Paniagua Javier <gonzalo@ximian.com>
25346 * expression.cs: fixed bug #27811.
25348 2002-07-14 Miguel de Icaza <miguel@ximian.com>
25350 * expression.cs (ParameterReference.AddressOf): Patch from Paolo
25351 Molaro: when we are a ref, the value already contains a pointer
25352 value, do not take the address of it.
25354 2002-07-14 Rafael Teixeira <rafaelteixeirabr@hotmail.com>
25355 * removed mb-parser.jay and mb-tokenizer.cs
25357 Sat Jul 13 19:38:03 CEST 2002 Paolo Molaro <lupus@ximian.com>
25359 * expression.cs: check against the building corlib void type.
25361 Sat Jul 13 19:35:58 CEST 2002 Paolo Molaro <lupus@ximian.com>
25363 * ecore.cs: fix for valuetype static readonly fields: when
25364 initializing them, we need their address, not the address of a copy.
25366 Sat Jul 13 17:32:53 CEST 2002 Paolo Molaro <lupus@ximian.com>
25368 * typemanager.cs: register also enum_type in corlib.
25370 Sat Jul 13 15:59:47 CEST 2002 Paolo Molaro <lupus@ximian.com>
25372 * class.cs: allow calling this (but not base) initializers in structs.
25374 Sat Jul 13 15:12:06 CEST 2002 Paolo Molaro <lupus@ximian.com>
25376 * ecore.cs: make sure we compare against the building base types
25379 Sat Jul 13 15:10:32 CEST 2002 Paolo Molaro <lupus@ximian.com>
25381 * typemanager.cs: fix TypeToCoreType() to handle void and object
25382 (corlib gets no more typerefs after this change).
25384 2002-07-12 Miguel de Icaza <miguel@ximian.com>
25386 * expression.cs (ArrayCreation.EmitArrayArguments): use
25387 Conv.Ovf.U4 for unsigned and Conv.Ovf.I4 for signed.
25389 (ArrayAccess.LoadArrayAndArguments): Use Conv_Ovf_I and
25390 Conv_Ovf_I_Un for the array arguments. Even if C# allows longs as
25391 array indexes, the runtime actually forbids them.
25393 * ecore.cs (ExpressionToArrayArgument): Move the conversion code
25394 for array arguments here.
25396 * expression.cs (EmitLoadOpcode): System.Char is a U2, use that
25397 instead of the default for ValueTypes.
25399 (New.DoEmit): Use IsValueType instead of
25400 IsSubclassOf (value_type)
25401 (New.DoResolve): ditto.
25402 (Invocation.EmitCall): ditto.
25404 * assign.cs (Assign): ditto.
25406 * statement.cs (Unsafe): Ok, so I got the semantics wrong.
25407 Statements *are* currently doing part of their resolution during
25410 Expressions do always resolve during resolve, but statements are
25411 only required to propagate resolution to their children.
25413 2002-07-11 Miguel de Icaza <miguel@ximian.com>
25415 * driver.cs (CSCParseOption): Finish the /r: and /lib: support.
25417 (LoadAssembly): Do not add the dll if it is already specified
25419 (MainDriver): Add the System directory to the link path at the end,
25420 after all the other -L arguments.
25422 * expression.cs (ArrayAccess.EmitLoadOpcode): I was using the
25423 wrong opcode for loading bytes and bools (ldelem.i1 instead of
25424 ldelem.u1) and using the opposite for sbytes.
25426 This fixes Digger, and we can finally run it.
25428 * driver.cs (UnixParseOption): Move the option parsing here.
25429 (CSCParseOption): Implement CSC-like parsing of options.
25431 We now support both modes of operation, the old Unix way, and the
25432 new CSC-like way. This should help those who wanted to make cross
25433 platform makefiles.
25435 The only thing broken is that /r:, /reference: and /lib: are not
25436 implemented, because I want to make those have the same semantics
25437 as the CSC compiler has, and kill once and for all the confussion
25438 around this. Will be doing this tomorrow.
25440 * statement.cs (Unsafe.Resolve): The state is checked during
25441 resolve, not emit, so we have to set the flags for IsUnsfe here.
25443 2002-07-10 Miguel de Icaza <miguel@ximian.com>
25445 * expression.cs (MemberAccess.ResolveMemberAccess): Since we can
25446 not catch the Error_ObjectRefRequired in SimpleName (as it is
25447 possible to have a class/instance variable name that later gets
25448 deambiguated), we have to check this here.
25450 2002-07-10 Ravi Pratap <ravi@ximian.com>
25452 * class.cs (TypeContainer.GetFieldFromEvent): Move away from here,
25453 make static and put into Expression.
25455 (Event.Define): Register the private field of the event with the
25456 TypeManager so that GetFieldFromEvent can get at it.
25458 (TypeManager.RegisterPrivateFieldOfEvent): Implement to
25459 keep track of the private field associated with an event which
25462 (TypeManager.GetPrivateFieldOfEvent): Implement to get at the
25465 * ecore.cs (GetFieldFromEvent): RE-write to use the above methods.
25467 2002-07-10 Miguel de Icaza <miguel@ximian.com>
25469 * expression.cs (Binary.EmitBranchable): this routine emits the
25470 Binary expression in a branchable context. This basically means:
25471 we need to branch somewhere, not just get the value on the stack.
25473 This works together with Statement.EmitBoolExpression.
25475 * statement.cs (Statement.EmitBoolExpression): Use
25478 2002-07-09 Miguel de Icaza <miguel@ximian.com>
25480 * statement.cs (For): Reduce the number of jumps in loops.
25482 (For): Implement loop inversion for the For statement.
25484 (Break): We can be breaking out of a Try/Catch controlled section
25485 (foreach might have an implicit try/catch clause), so we need to
25486 use Leave instead of Br.
25488 * ecore.cs (FieldExpr.AddressOf): Fix for test-139 (augmented
25489 now). If the instace expression supports IMemoryLocation, we use
25490 the AddressOf method from the IMemoryLocation to extract the
25491 address instead of emitting the instance.
25493 This showed up with `This', as we were emitting the instance
25494 always (Emit) instead of the Address of This. Particularly
25495 interesting when This is a value type, as we dont want the Emit
25496 effect (which was to load the object).
25498 2002-07-08 Miguel de Icaza <miguel@ximian.com>
25500 * attribute.cs: Pass the entry point to the DefinePInvokeMethod
25502 * statement.cs (Checked): Set the CheckedState during the resolve
25503 process too, as the ConvCast operations track the checked state on
25504 the resolve process, and not emit.
25506 * cs-parser.jay (namespace_member_declaration): Flag that we have
25507 found a declaration when we do. This is used to flag error 1529
25509 * driver.cs: Report ok when we display the help only.
25511 2002-07-06 Andrew Birkett <adb@tardis.ed.ac.uk>
25513 * cs-tokenizer.cs (xtoken): Improve handling of string literals.
25515 2002-07-04 Miguel de Icaza <miguel@ximian.com>
25517 * cs-tokenizer.cs (define): We also have to track locally the
25518 defines. AllDefines is just used for the Conditional Attribute,
25519 but we also need the local defines for the current source code.
25521 2002-07-03 Miguel de Icaza <miguel@ximian.com>
25523 * statement.cs (While, For, Do): These loops can exit through a
25524 Break statement, use this information to tell whether the
25525 statement is the last piece of code.
25527 (Break): Flag that we break.
25529 * codegen.cs (EmitContexts): New `Breaks' state variable.
25531 2002-07-03 Martin Baulig <martin@gnome.org>
25533 * class.cs (TypeContainer.MethodModifiersValid): Allow override
25534 modifiers in method declarations in structs. Otherwise, you won't
25535 be able to override things like Object.Equals().
25537 2002-07-02 Miguel de Icaza <miguel@ximian.com>
25539 * class.cs (Method, Property, Indexer): Do not allow the public
25540 modifier to be used in explicit interface implementations.
25542 (TypeContainer.MethodModifiersValid): Catch virtual, abstract and
25543 override modifiers in method declarations in structs
25545 2002-07-02 Andrew Birkett <adb@tardis.ed.ac.uk>
25547 * cs-tokenizer.cs (adjust_int, adjust_real): Do not abort on
25548 integer or real overflow, report an error
25550 2002-07-02 Martin Baulig <martin@gnome.org>
25552 * typemanager.cs (TypeManager.InitCoreTypes): When compiling
25553 corlib, dynamically call AssemblyBuilder.SetCorlibTypeBuilders()
25554 to tell the runtime about our newly created System.Object and
25555 System.ValueType types.
25557 2002-07-02 Miguel de Icaza <miguel@ximian.com>
25559 * expression.cs (This): Use Stobj/Ldobj when we are a member of a
25560 struct instead of Ldarg/Starg.
25562 2002-07-02 Martin Baulig <martin@gnome.org>
25564 * expression.cs (Indirection.Indirection): Call
25565 TypeManager.TypeToCoreType() on `expr.Type.GetElementType ()'.
25567 2002-07-02 Martin Baulig <martin@gnome.org>
25569 * expression.cs (ArrayAccess.EmitStoreOpcode): If the type is a
25570 ValueType, call TypeManager.TypeToCoreType() on it.
25571 (Invocations.EmitParams): Call TypeManager.TypeToCoreType() on
25572 the OpCodes.Newarr argument.
25574 2002-07-02 Martin Baulig <martin@gnome.org>
25576 * expression.cs (Invocation.EmitCall): When compiling corlib,
25577 replace all calls to the system's System.Array type to calls to
25578 the newly created one.
25580 * typemanager.cs (TypeManager.InitCodeHelpers): Added a few more
25581 System.Array methods.
25582 (TypeManager.InitCoreTypes): When compiling corlib, get the methods
25583 from the system's System.Array type which must be replaced.
25585 Tue Jul 2 19:05:05 CEST 2002 Paolo Molaro <lupus@ximian.com>
25587 * typemanager.cs: load unverifiable_code_ctor so we can build
25588 corlib using the correct type. Avoid using GetTypeCode() with
25590 * rootcontext.cs: uses TypeManager.unverifiable_code_ctor and
25591 TypeManager.object_type to allow building corlib.
25593 Tue Jul 2 19:03:19 CEST 2002 Paolo Molaro <lupus@ximian.com>
25595 * ecore.cs: handle System.Enum separately in LoadFromPtr().
25597 2002-07-01 Martin Baulig <martin@gnome.org>
25599 * class.cs: Make the last change actually work, we need to check
25600 whether `ifaces != null' to avoid a crash.
25602 Mon Jul 1 16:15:03 CEST 2002 Paolo Molaro <lupus@ximian.com>
25604 * class.cs: when we build structs without fields that implement
25605 interfaces, we need to add the interfaces separately, since there is
25606 no API to both set the size and add the interfaces at type creation
25609 Mon Jul 1 14:50:47 CEST 2002 Paolo Molaro <lupus@ximian.com>
25611 * expression.cs: the dimension arguments to the array constructors
25612 need to be converted if they are a long.
25614 Mon Jul 1 12:26:12 CEST 2002 Paolo Molaro <lupus@ximian.com>
25616 * class.cs: don't emit ldarg.0 if there is no parent constructor
25617 (fixes showstopper for corlib).
25619 2002-06-29 Martin Baulig <martin@gnome.org>
25621 MCS now compiles corlib on GNU/Linux :-)
25623 * attribute.cs (Attribute.ApplyAttributes): Treat Accessors like Method,
25624 ie. check for MethodImplOptions.InternalCall.
25626 * class.cs (TypeContainer.DefineType): When compiling corlib, both parent
25627 and TypeManager.attribute_type are null, so we must explicitly check
25628 whether parent is not null to find out whether it's an attribute type.
25629 (Property.Emit): Always call Attribute.ApplyAttributes() on the GetBuilder
25630 and SetBuilder, not only if the property is neither abstract nor external.
25631 This is necessary to set the MethodImplOptions on the accessor methods.
25632 (Indexer.Emit): Call Attribute.ApplyAttributes() on the GetBuilder and
25633 SetBuilder, see Property.Emit().
25635 * rootcontext.cs (RootContext.PopulateTypes): When compiling corlib, don't
25636 populate "System.Object", "System.ValueType" and "System.Attribute" since
25637 they've already been populated from BootCorlib_PopulateCoreTypes().
25639 2002-06-29 Martin Baulig <martin@gnome.org>
25641 * ecore.cs (Expression.ImplicitReferenceConversionExists): If expr
25642 is the NullLiteral, we also need to make sure that target_type is not
25645 2002-06-29 Martin Baulig <martin@gnome.org>
25647 * rootcontext.cs (RootContext.ResolveCore): We must initialize
25648 `TypeManager.multicast_delegate_type' and `TypeManager.delegate_type'
25649 before calling BootstrapCorlib_ResolveDelegate ().
25651 2002-06-27 Gonzalo Paniagua Javier <gonzalo@ximian.com>
25653 * statement.cs: fixed build-breaker. All tests passed ok.
25655 2002-06-27 Martin Baulig <martin@gnome.org>
25657 * typemanager.cs (TypeManager.VerifyUnManaged): Added explicit check
25658 for System.Decimal when compiling corlib.
25660 2002-06-27 Martin Baulig <martin@gnome.org>
25662 * statement.cs (Switch.TableSwitchEmit): Make this work with empty
25663 switch blocks which contain nothing but a default clause.
25665 2002-06-26 Andrew <adb@tardis.ed.ac.uk>
25667 * ../errors/cs1501-3.cs: Added new test for struct ctr typechecks.
25669 2002-06-27 Martin Baulig <martin@gnome.org>
25671 * ecore.cs (PropertyExpr.PropertyExpr): Call
25672 TypeManager.TypeToCoreType() on the `pi.PropertyType'.
25674 * typemanager.cs (TypeManager.TypeToCoreType): Return if the type
25675 is already a TypeBuilder.
25677 2002-06-27 Martin Baulig <martin@gnome.org>
25679 * ecore.cs (Expression.ImplicitReferenceConversionExists): Use
25680 `target_type == TypeManager.array_type', not IsAssignableFrom() in
25681 the "from an array-type to System.Array" case. This makes it work
25682 when compiling corlib.
25684 2002-06-27 Martin Baulig <martin@gnome.org>
25686 * ecore.cs (Expression.SimpleNameResolve): If the expression is a
25687 non-static PropertyExpr, set its InstanceExpression. This makes
25688 the `ICollection.Count' property work in System/Array.cs.
25690 2002-06-25 Andrew Birkett <adb@tardis.ed.ac.uk>
25692 * driver.cs: Made error handling more consistent. Errors now
25693 tracked by Report class, so many methods which used to return int
25694 now return void. Main() now prints success/failure and
25695 errors/warnings message.
25697 Renamed '--probe' compiler argument to '--expect-error'. Removed
25698 the magic number return values (123 and 124). Now, if the
25699 expected error occurs, the compiler exits with success (exit value
25700 0). If the compilation completes without seeing that particular
25701 error, the compiler exits with failure (exit value 1). The
25702 makefile in mcs/errors has been changed to handle the new behaviour.
25704 * report.cs: Made 'expected error' number a property and renamed
25705 it from 'Probe' to 'ExpectedError'.
25707 * genericparser.cs: Removed error handling support, since it is
25708 now all done by Report class.
25710 * cs-parser.jay, mb-parser.jay: Errors are tracked by Report
25711 class, so parse() no longer returns an int.
25713 * namespace.cs: Use Report.Error instead of GenericParser.error
25715 2002-06-22 Miguel de Icaza <miguel@ximian.com>
25717 * class.cs (TypeContainer.AddMethod, TypeContainer.AddIndexer,
25718 TypeContainer.AddOperator): At the front of the list put the
25719 explicit implementations, so they get resolved/defined first.
25721 2002-06-21 Miguel de Icaza <miguel@ximian.com>
25723 * class.cs (TypeContainer.VerifyImplements): Verifies that a given
25724 interface type is implemented by this TypeContainer. Used during
25725 explicit interface implementation.
25727 (Property.Define, Indexer.Define, Method.Define): Validate that
25728 the given interface in the explicit implementation is one of the
25729 base classes for the containing type.
25731 Also if we are explicitly implementing an interface, but there is
25732 no match in the pending implementation table, report an error.
25734 (Property.Define): Only define the property if we are
25735 not explicitly implementing a property from an interface. Use the
25736 correct name also for those properties (the same CSC uses,
25737 although that is really not needed).
25739 (Property.Emit): Do not emit attributes for explicitly implemented
25740 properties, as there is no TypeBuilder.
25742 (Indexer.Emit): ditto.
25744 Hiding then means that we do not really *implement* a pending
25745 implementation, which makes code fail.
25747 2002-06-22 Martin Baulig <martin@gnome.org>
25749 * ecore.cs (Expression.Constantify): Call TypeManager.TypeToCoreType() on
25750 the return value of Object.GetType(). [FIXME: we need to do this whenever
25751 we get a type back from the reflection library].
25753 Fri Jun 21 13:37:57 CEST 2002 Paolo Molaro <lupus@ximian.com>
25755 * typemanager.cs: make ExpandInterfaces() slip duplicated interfaces.
25757 2002-06-20 Miguel de Icaza <miguel@ximian.com>
25759 * attribute.cs: Return null if we can not look up the type.
25761 * class.cs (TypeContainer.GetClassBases): Use ExpandInterfaces on
25762 the interface types found.
25764 * interface.cs (Interface.GetInterfaceBases): Use ExpandInterfaces on the
25765 interface types found.
25767 * typemanager.cs (GetInterfaces): Make this routine returns alll
25768 the interfaces and work around the lame differences between
25769 System.Type and System.Reflection.Emit.TypeBuilder in the results
25770 result for GetInterfaces.
25772 (ExpandInterfaces): Given an array of interface types, expand and
25773 eliminate repeated ocurrences of an interface. This expands in
25774 context like: IA; IB : IA; IC : IA, IB; the interface "IC" to
25777 2002-06-21 Martin Baulig <martin@gnome.org>
25779 * typemanager.cs (TypeManager.EnumToUnderlying): It's now safe to call this function
25782 2002-06-21 Martin Baulig <martin@gnome.org>
25784 * typemanager.cs (TypeManager.TypeToCoreType): New function. When compiling corlib
25785 and called with one of the core types, return the corresponding typebuilder for
25788 * expression.cs (ArrayAccess.DoResolve): Call TypeManager.TypeToCoreType() on the
25791 2002-06-21 Martin Baulig <martin@gnome.org>
25793 * ecore.cs (Expression.ExplicitReferenceConversionExists): Use
25794 `target_type.IsArray' instead of `target_type.IsSubclassOf (TypeManager.array_type)'.
25795 (Expression.ConvertReferenceExplicit): Likewise.
25797 * expression.cs (ElementAccess.DoResolve): Likewise.
25798 (ElementAccess.DoResolveLValue): Likewise.
25800 2002-06-10 Martin Baulig <martin@gnome.org>
25802 * interface.cs (Interface.PopulateIndexer): When creating the setter, we need to
25803 add the "value" parameter to the parameter list.
25805 * statement.cs (Fixed.Emit): Pass the return value of the child block's Emit()
25808 2002-06-19 Miguel de Icaza <miguel@ximian.com>
25810 * expression.cs (ArrayCreation.ExpressionToArrayArgument): Convert
25811 the argument to an int, uint, long or ulong, per the spec. Also
25812 catch negative constants in array creation.
25814 Thu Jun 20 17:56:48 CEST 2002 Paolo Molaro <lupus@ximian.com>
25816 * class.cs: do not allow the same interface to appear twice in
25817 the definition list.
25819 Wed Jun 19 22:33:37 CEST 2002 Paolo Molaro <lupus@ximian.com>
25821 * ecore.cs: don't use ldlen with System.Array.
25823 Wed Jun 19 20:57:40 CEST 2002 Paolo Molaro <lupus@ximian.com>
25825 * ecore.cs: stobj requires a type argument. Handle indirect stores on enums.
25827 Wed Jun 19 20:17:59 CEST 2002 Paolo Molaro <lupus@ximian.com>
25829 * modifiers.cs: produce correct field attributes for protected
25830 internal. Easy fix so miguel can work on ther harder stuff:-)
25832 2002-06-18 Miguel de Icaza <miguel@ximian.com>
25834 * pending.cs: New file. Move the code from class.cs here.
25835 Support clearning the pending flag for all methods (when not doing
25836 explicit interface implementation).
25838 Tue Jun 18 10:36:22 CEST 2002 Paolo Molaro <lupus@ximian.com>
25840 * rootcontext.cs: added a couple more types needed to bootstrap.
25842 2002-06-17 Miguel de Icaza <miguel@ximian.com>
25844 * typemanager.cs (GetConstructor): Use DeclaredOnly to look the
25845 constructor in the type, instead of any constructor in the type
25846 hierarchy. Thanks to Paolo for finding this bug (it showed up as
25847 a bug in the Mono runtime when applying the params attribute).
25849 2002-06-16 Rafael Teixeira <rafaelteixeirabr@hotmail.com>
25850 * changed namespace.cs to use "GenericParser.error(...)" instead of "CSharpParser.error(...)"
25852 2002-06-14 Rachel Hestilow <hestilow@ximian.com>
25854 * expression.cs (Unary.ResolveOperator): Use TypeManager
25855 to resolve the type.
25857 2002-06-13 Ravi Pratap <ravi@ximian.com>
25859 * cs-parser.jay (enum_member_declaration): Pass in the attributes
25862 * enum.cs (AddEnumMember): Add support to store the attributes associated
25863 with each member too.
25865 * attribute.cs (CheckAttribute, ApplyAttributes): Update to handle
25866 field builders too - this takes care of the enum member case.
25868 2002-06-10 Rachel Hestilow <hestilow@ximian.com>
25870 * typemanager.cs (TypeManager.VerifyUnManaged): Allow
25871 address-of operator on both value types and pointers.
25873 2002-06-10 Martin Baulig <martin@gnome.org>
25875 * interface.cs (Interface.PopulateIndexer): Add the indexer's
25876 PropertyBuilder to the `property_builders' list.
25878 * expression.cs (Indexers.GetIndexersForTypeOrInterface): New private method.
25879 (Indexers.GetIndexersForType): Call GetIndexersForTypeOrInterface() on the
25880 `lookup_type' and all its interfaces. Unfortunately, Type.FindMembers() won't
25881 find any indexers which are inherited from an interface.
25883 2002-06-09 Martin Baulig <martin@gnome.org>
25885 * const.cs (Const.LookupConstantValue): Convert `Expr' to a literal of
25886 the same type as the constant if necessary. There's also a test-130.cs
25889 * enum.cs (Enum.ChangeEnumType): Moved to typemanager.cs and made public.
25891 * typemanager.cs (TypeManager.ChangeType): Previously known as
25892 Enum.ChangeEnumType().
25894 2002-06-09 Martin Baulig <martin@gnome.org>
25896 * expression.cs (Cast.TryReduce): Added support for consts.
25898 2002-06-08 Ravi Pratap <ravi@ximian.com>
25900 * class.cs (Accessor): Hold attributes information so we can pass
25903 * cs-parser.jay (get_accessor_declaration, set_accessor_declaration):
25904 Modify to pass in attributes attached to the methods.
25906 (add_accessor_declaration, remove_accessor_declaration): Ditto.
25908 * attribute.cs (ApplyAttributes, CheckAttribute): Update accordingly
25909 to handle the Accessor kind :-)
25911 * class.cs (Property.Emit, Event.Emit): Apply attributes to the accessors
25913 2002-06-08 Martin Baulig <martin@gnome.org>
25915 * expression.cs (Unary.TryReduceNegative): Added support for
25918 2002-06-08 Martin Baulig <martin@gnome.org>
25920 * enum.cs (Enum.LookupEnumValue): Don't report an error if the
25921 name can't be found in the `defined_names' - the caller will do a
25922 MemberLookup in this case and thus find methods in System.Enum
25923 such as Enum.IsDefined().
25925 2002-06-08 Martin Baulig <martin@gnome.org>
25927 * enum.cs (Enum.ChangeEnumType): This is a custom version of
25928 Convert.ChangeType() which works with TypeBuilder created types.
25929 (Enum.LookupEnumValue, Enum.Define): Use it here.
25931 * class.cs (TypeContainer.RegisterRequiredImplementations): Added
25932 `TypeBuilder.BaseType != null' check.
25933 (TypeContainer.FindMembers): Only lookup parent members if we
25934 actually have a parent.
25935 (Method.EmitDestructor): Added `ec.ContainerType.BaseType != null' check.
25936 (ConstructorInitializer.Resolve): Likewise.
25938 * interface.cs (Interface.FindMembers): Added
25939 `TypeBuilder.BaseType != null' check.
25941 * rootcontext.cs (RootContext.ResolveCore): Added
25942 "System.Runtime.CompilerServices.IndexerNameAttribute" to
25943 classes_second_stage.
25945 * typemanager.cs (TypeManager.InitCoreTypes): Don't initialize
25946 debug_type and trace_type when compiling with --nostdlib.
25948 2002-06-07 Martin Baulig <martin@gnome.org>
25950 * class.cs (TypeContainer): Added `have_nonstatic_fields' field.
25951 (AddField): Set it to true when adding a non-static field.
25952 (DefineType): Use `have_nonstatic_fields' to find out whether we
25953 have non-static fields, not `Fields != null'.
25955 2002-06-02 Miguel de Icaza <miguel@ximian.com>
25957 * ecore.cs (SimpleNameResolve): Removed simple bug (we were
25958 dereferencing a null on the static-field code path)
25960 2002-05-30 Martin Baulig <martin@gnome.org>
25962 * codegen.cs (InitMonoSymbolWriter): Added `string[] args' argument
25963 to take command line arguments. Use reflection to call the new
25964 custom `Initialize' function on the symbol writer and pass it the
25965 command line arguments.
25967 * driver.cs (--debug-args): New command line argument to pass command
25968 line arguments to the symbol writer.
25970 2002-05-28 Miguel de Icaza <miguel@ximian.com>
25972 * assign.cs (DoResolve): Forgot to do the implicit conversion to
25973 the target type for indexers and properties. Thanks to Joe for
25976 2002-05-27 Miguel de Icaza <miguel@ximian.com>
25978 * typemanager.cs (MethodFlags): returns the method flags
25979 (Obsolete/ShouldIgnore) that control warning emission and whether
25980 the invocation should be made, or ignored.
25982 * expression.cs (Invocation.Emit): Remove previous hack, we should
25983 not do this on matching a base type, we should do this based on an attribute
25985 Only emit calls to System.Diagnostics.Debug and
25986 System.Diagnostics.Trace if the TRACE and DEBUG defines are passed
25987 on the command line.
25989 * rootcontext.cs: Global settings for tracing and debugging.
25991 * cs-tokenizer.cs (define): New utility function to track
25992 defines. Set the global settings for TRACE and DEBUG if found.
25994 2002-05-25 Ravi Pratap <ravi@ximian.com>
25996 * interface.cs (Populate*): Pass in the TypeContainer as well as
25997 the DeclSpace as parameters so that we can create EmitContexts and
25998 then use that to apply attributes etc.
26000 (PopulateMethod, PopulateEvent, PopulateProperty)
26001 (PopulateIndexer): Apply attributes everywhere.
26003 * attribute.cs (CheckAttribute): Include InterfaceMethod, InterfaceEvent
26006 (ApplyAttributes): Update accordingly.
26008 We now apply interface attributes for all members too.
26010 2002-05-26 Miguel de Icaza <miguel@ximian.com>
26012 * class.cs (Indexer.Define); Correctly check if we are explicit
26013 implementation (instead of checking the Name for a ".", we
26014 directly look up if the InterfaceType was specified).
26016 Delay the creation of the PropertyBuilder.
26018 Only create the PropertyBuilder if we are not an explicit
26019 interface implementation. This means that explicit interface
26020 implementation members do not participate in regular function
26021 lookups, and hence fixes another major ambiguity problem in
26022 overload resolution (that was the visible effect).
26024 (DefineMethod): Return whether we are doing an interface
26027 * typemanager.cs: Temporary hack until we get attributes in
26028 interfaces (Ravi is working on that) and we get IndexerName
26029 support in interfaces.
26031 * interface.cs: Register the indexers as properties.
26033 * attribute.cs (Attribute.Resolve): Catch the error, and emit a
26034 warning, I have verified that this is a bug in the .NET runtime
26035 (JavaScript suffers of the same problem).
26037 * typemanager.cs (MemberLookup): When looking up members for
26038 interfaces, the parent of an interface is the implicit
26039 System.Object (so we succeed in searches of Object methods in an
26040 interface method invocation. Example: IEnumerable x; x.ToString
26043 2002-05-25 Miguel de Icaza <miguel@ximian.com>
26045 * class.cs (Event): Events should also register if they do
26046 implement the methods that an interface requires.
26048 * typemanager.cs (MemberLookup); use the new GetInterfaces
26051 (GetInterfaces): The code used to lookup interfaces for a type is
26052 used in more than one place, factor it here.
26054 * driver.cs: Track the errors at the bottom of the file, we kept
26057 * delegate.cs (NewDelegate.Emit): We have to emit a null as the
26058 instance if the method we are calling is static!
26060 2002-05-24 Miguel de Icaza <miguel@ximian.com>
26062 * attribute.cs (ApplyAttributes): Make this function filter out
26063 the IndexerName attribute (as that attribute in reality is never
26064 applied) and return the string constant for the IndexerName
26067 * class.cs (TypeContainer.Emit): Validate that all the indexers
26068 have the same IndexerName attribute, and if so, set the
26069 DefaultName attribute on the class.
26071 * typemanager.cs: The return value might contain other stuff (not
26072 only methods). For instance, consider a method with an "Item"
26073 property and an Item method.
26075 * class.cs: If there is a problem with the parameter types,
26078 2002-05-24 Ravi Pratap <ravi@ximian.com>
26080 * ecore.cs (ImplicitConversionExists): Wrapper function which also
26081 looks at user defined conversion after making a call to
26082 StandardConversionExists - we need this for overload resolution.
26084 * expression.cs : Update accordingly the various method calls.
26086 This fixes 2 bugs filed against implicit user defined conversions
26088 2002-05-22 Miguel de Icaza <miguel@ximian.com>
26090 * statement.cs: Track the result of the assignment.
26092 2002-05-21 Miguel de Icaza <miguel@ximian.com>
26094 * expression.cs (MemberAccess): Improved error reporting for
26095 inaccessible members.
26097 2002-05-22 Martin Baulig <martin@gnome.org>
26099 * makefile (mcs-mono2.exe): New target. This is mcs compiled with
26100 itself with debugging support.
26102 2002-05-22 Martin Baulig <martin@gnome.org>
26104 * typemanager.cs ("System.Runtime.InteropServices.StructLayoutAttribute"):
26105 Removed, this isn't needed anymore.
26107 2002-05-20 Martin Baulig <martin@gnome.org>
26109 * typemanager.cs (InitEnumUnderlyingTypes): "System.Char" can't
26110 be underlying type for an enum.
26112 2002-05-20 Miguel de Icaza <miguel@ximian.com>
26114 * typemanager.cs (InitEnumUnderlyingTypes): New helper function
26115 that splits out the loading of just the core types.
26117 * rootcontext.cs (ResolveCore): Split the struct resolution in
26118 two, so we can load the enumeration underlying types before any
26121 * expression.cs (Is): Bandaid until we fix properly Switch (see
26122 bug #24985 for details).
26124 * typemanager.cs (ImplementsInterface): The hashtable will contain
26125 a null if there are no interfaces implemented.
26127 2002-05-18 Miguel de Icaza <miguel@ximian.com>
26129 * cs-parser.jay (indexer_declarator): It is fine to have array
26132 2002-05-17 Miguel de Icaza <miguel@ximian.com>
26134 * typemanager.cs: (RegisterBuilder): New function used to register
26135 TypeBuilders that implement interfaces. Since
26136 TypeBuilder.GetInterfaces (as usual) does not work with lame
26138 (AddUserType): register interfaces.
26140 (ImplementsInterface): Use the builder_to_ifaces hash if we are
26141 dealing with TypeBuilder. Also, arrays are showing up as
26142 SymbolTypes, which are not TypeBuilders, but whose GetInterfaces
26143 methods can not be invoked on them!
26145 * ecore.cs (ExplicitReferenceConversionExists): Made public.
26146 (ImplicitReferenceConversionExists): Split out from
26147 StandardConversionExists.
26149 * expression.cs (As): We were only implementing one of the three
26150 cases for the as operator. We now implement them all.
26151 (Is): Implement the various other cases for Is as well.
26153 * typemanager.cs (CACHE): New define used to control if we want or
26154 not the FindMembers cache. Seems to have a negative impact on
26155 performance currently
26157 (MemberLookup): Nested types have full acess to
26158 enclosing type members
26160 Remove code that coped with instance/static returns for events, we
26161 now catch this in RealFindMembers.
26163 (RealFindMembers): only perform static lookup if the instance
26164 lookup did not return a type or an event.
26166 2002-05-17 Miguel de Icaza <miguel@ximian.com>
26168 * assign.cs (CompoundAssign): We pass more semantic information
26169 now to Compound Assignments than we did before: now we have all
26170 the information at hand, and now we resolve the target *before* we
26171 do the expression expansion, which allows the "CacheValue" method
26172 to have the effect we intended (before, a [x] += 1 would generate
26173 two differen ArrayAccess expressions from the ElementAccess,
26174 during the resolution process).
26176 (CompoundAssign.DoResolve): Resolve target and original_source here.
26178 2002-05-16 Miguel de Icaza <miguel@ximian.com>
26180 * expression.cs (ArrayAccess): dropped debugging information.
26182 * typemanager.cs: Small bug fix: I was always returning i_members,
26183 instead of one of i_members or s_members (depending on which had
26186 * assign.cs (IAssignMethod.CacheTemporaries): New method. This
26187 method is invoked before any code generation takes place, and it
26188 is a mechanism to inform that the expression will be invoked more
26189 than once, and that the method should use temporary values to
26190 avoid having side effects
26192 (Assign.Emit): Call CacheTemporaries in the IAssignMethod.
26194 * ecore.cs (Expression.CacheTemporaries): Provide empty default
26197 * expression.cs (Indirection, ArrayAccess): Add support for
26198 CacheTemporaries in these two bad boys.
26200 * ecore.cs (LoadFromPtr): figure out on our own if we need to use
26201 ldobj or ldind_ref.
26202 (StoreFromPtr): Handle stobj as well.
26204 * expression.cs (UnaryMutator): Share more code.
26206 * typemanager.cs (FindMembers): Thanks to Paolo for tracking this
26207 down: I was not tracking the Filter function as well, which
26208 was affecting the results of the cache.
26210 2002-05-15 Miguel de Icaza <miguel@ximian.com>
26212 * attribute.cs: Remove the hack to handle the CharSet property on
26215 2002-05-14 Miguel de Icaza <miguel@ximian.com>
26217 * attribute.cs (DoResolve): More uglyness, we now only try to
26218 resolve the attribute partially, to extract the CharSet
26219 information (only if we are a StructLayout attribute). Otherwise
26221 (GetExtraTypeInfo): Add some code to conditionally kill in the
26222 future this. I am more and more convinced that the .NET
26223 framework has special code to handle the attribute setting on
26226 * expression.cs (IsParamsMethodApplicable): Revert my previous
26227 foreach change here, it was wrong.
26229 2002-05-13 Miguel de Icaza <miguel@ximian.com>
26231 * cs-tokenizer.cs: (pp_primary): Eat the ')' at the end.
26232 (pp_expr): do not abort on unknown input, just return.
26233 (eval): abort if there are pending chars.
26235 * attribute.cs (Attribute.Resolve): Positional parameters are
26236 optional. Deal with that case.
26238 * class.cs (DefineType): Call Attribute.GetExtraTypeInfo to fetch
26239 the Ansi/Unicode/Auto information for the type.
26241 (TypeContainer.DefineType): instantiate the EmitContext here, as
26242 we will be using it during the type definition (to resolve
26243 attributes) and during the emit phase.
26245 * attribute.cs (Attribute.GetExtraTypeInfo): This routine is used
26246 to pull type information out of the attributes
26248 (Attribute.Resolve): track the constructor builder, and allow for
26249 multiple invocations (structs and classes will use this).
26251 * ecore.cs (MemberLookupFinal): new version with all the
26252 parameters customizable.
26254 * expression.cs (New.DoResolve): Use MemberLookupFinal to locate
26255 constructors. Return if the result value is null (as the error
26256 would have been flagged already by MemberLookupFinal)
26258 Do not allow instances of abstract classes or interfaces to be
26261 * class.cs: (MethodSignature.InheritableMemberSignatureCompare):
26262 We have to compare the assembly property here when dealing with
26263 FamANDAssem and Assembly access modifiers, because we might be
26264 creating an assembly from *modules* (that means that we are not
26265 getting TypeBuilders for types defined in other modules that are
26266 part of this assembly).
26268 (Method.Emit): If the method is marked abstract and has a body,
26271 (TypeContainer.DefineMembers): If both the defined member and the
26272 parent name match are methods, then do not emit any warnings: let
26273 the Method.Define routine take care of flagging warnings. But if
26274 there is a mismatch (method overrides something else, or method is
26275 overriwritten by something, then emit warning).
26277 (MethodSignature.MemberSignatureCompare): If the sig.ret_type is
26278 set to null, this means `do not check for the return type on the
26281 (Method.Define): set the return type for the method signature to
26282 null, so that we get methods with the same name and parameters and
26283 different return types. This is used to flag warning 114 (you are
26284 hiding a method, and you probably want to use the new/override
26287 * typemanager.cs (MemberLookup): Implemented proper access
26288 control, closing a long standing set of bug reports. The problem
26289 was that the Framework only has two bits: Public and NonPublic,
26290 and NonPublic includes private and protected methods, but we need
26291 to enforce the FamANDAssem, FamOrAssem and Family.
26293 2002-05-11 Miguel de Icaza <miguel@ximian.com>
26295 * statement.cs (GotoCase): Return true: Ammounts to giving up
26296 knowledge on whether we return or not, and letting the other case
26297 be responsible for it.
26299 2002-05-10 Miguel de Icaza <miguel@ximian.com>
26301 * driver.cs: Do not load directories for each file processed, only
26302 do it if there is a pattern.
26304 * ecore.cs: Report readonly assigns here as well, as we might have
26305 been resolved only by MemberAccess.
26307 (SimpleName.SimpleNameResolve): Also be useful for LValue
26308 resolution. We need this to propagate assign to local readonly variables
26310 * typemanager.cs: Use a ptrhashtable for the criteria, because we
26311 do not want to reuse potential criteria memory.
26313 * class.cs (MyEventBuilder): Set reflected_type;
26315 * ecore.cs (Constantify): Added support for constifying bools.
26317 (RootContext.LookupType): Added a cache for values looked up in
26318 the declaration space.
26320 * typemanager.cs (FindMembers): Now is a front-end to
26321 RealFindMembers, and provides a two-level hashtable-based cache to
26324 15% performance improvement: from 22.5 to 19.2 seconds.
26326 * expression.cs (IsParamsMethodApplicable): use foreach.
26327 (Invocation.DoResolve): ditto.
26328 (New.DoResolve): ditto.
26329 (ArrayCreation.DoResolve): ditto.
26331 * ecore.cs (FindMostEncompassingType): use foreach.
26333 * delegate.cs (NewDelegate.DoResolve): Use foreach
26335 * ecore.cs (Expression.FindMostSpecificSource): Use foreach.
26336 (RemoveMethods): use foreach.
26338 * expression.cs (Invocation.MakeUnionSet): Optimization: Use two
26339 nested foreach statements instead of for, and also break out of
26340 the inner loop once a match is found.
26342 (Invocation.OverloadResolve): Use foreach, simplify the code.
26344 2002-05-08 Miguel de Icaza <miguel@ximian.com>
26346 * cfold.cs (BinaryFold): During an enumeration evaluation context,
26347 we actually unwrap the expression to allow for extra information
26350 * expression.cs: Use Shr_Un on unsigned operations.
26352 2002-05-08 Ravi Pratap <ravi@ximian.com>
26354 * ecore.cs (FindMostEncompass*): Fix trivial bug where the set of
26355 applicable operators was not being considered correctly. This closes
26356 the bug Miguel reported.
26358 Wed May 8 16:40:50 CEST 2002 Paolo Molaro <lupus@ximian.com>
26360 * attribute.cs: check that the type derives from System.Attribute
26361 and report the correct error in that case (moved the duplicate code to
26362 its own method, too).
26364 Wed May 8 11:50:31 CEST 2002 Paolo Molaro <lupus@ximian.com>
26366 * attribute.cs: lookup attribute type name as the spec says: first the
26367 bare attribute name and then name + "Attribute" (nant compiles with
26368 mcs after this fix).
26370 2002-05-07 Miguel de Icaza <miguel@ximian.com>
26372 * expression.cs (Unary.TryReduceNegative): Ah! Tricky! Tricky!
26373 Because of the way we parse things, we should try to see if a
26374 UIntConstant can fit in an integer.
26376 2002-05-07 Ravi Pratap <ravi@ximian.com>
26378 * ecore.cs (GetConversionOperators): Do not pick up op_True operators
26379 when we are in an explicit context.
26381 (ConvertReferenceExplicit): When converting from Iface type S to Class
26382 T make sure the rules are implemented as an OR.
26384 * parameter.cs (ParameterType): Make it a property for now although the
26385 purpose really isn't anything immediate.
26387 * expression.cs (Is*Applicable): Do better checking on the parameter type
26388 of a ref/out parameter. The ones from the system assemblies are already
26389 marked with the correct type so we don't need to do any correction.
26391 * ecore.cs (StandardConversionExists): Conversion from Interface types to
26392 the object type is standard too so include that.
26394 2002-05-06 Miguel de Icaza <miguel@ximian.com>
26396 * ecore.cs (StandardConversionExists): Augment with missing code:
26397 deal with IntConstant, LongConstants and Enumerations.
26399 * assign.cs: Report the error, instead of failing silently
26401 * rootcontext.cs (AddGlobalAttributes): Track attributes on the
26402 typecontainer that they are declared, because the
26403 typecontainer/namespace will have the list of using clauses that
26404 need to be applied.
26406 Assembly Attributes were escaping the normal registration
26409 (EmitCode): Apply attributes within an EmitContext that represents
26410 the container they were declared on.
26412 * cs-parser.jay: Track bases for structs. How did I get this wrong?
26414 2002-05-06 Ravi Pratap <ravi@ximian.com>
26416 * ecore.cs (FindMostEncompassingType, FindMostEncompassedType):
26417 Revamp completely - make much cleaner as we now operate only
26420 (FindMostSpecificSource, FindMostSpecificTarget): New methods
26421 to implement the logic detailed in the spec more correctly.
26423 (UserDefinedConversion): Update accordingly.
26425 2002-05-06 Miguel de Icaza <miguel@ximian.com>
26427 * statement.cs: Return flow analysis information up.
26429 * cs-tokenizer.cs (adjust_real): Share code between LITERAL_DOUBLE
26432 (token): Do not consume an extra character before calling
26435 2002-05-06 Piers Haken <piersh@friskit.com>
26437 * cs-parser.jay: add 'override' attribute to System.Object.Finalize
26439 2002-05-06 Miguel de Icaza <miguel@ximian.com>
26441 * class.cs (Constructor.Emit): Set the IsStatic flag in the
26442 EmitContext during the instance constructor initializer
26443 resolution, to stop access to instance variables.
26445 This is mandated by the spec, last paragraph of the `constructor
26446 initializers' section.
26448 2002-05-05 Miguel de Icaza <miguel@ximian.com>
26450 * cs-parser.jay, class.cs (Accessor): new class used to represent
26451 an accessor (get or set). In the past we used `null' to represent
26452 a missing accessor. But this is ambiguous because there was no
26453 way to tell in abstract indexers/properties if one of them was
26456 Now there is a way of addressing that.
26458 * expression.cs (Indexers.GetIndexersForType): Use TypeManager.MemberLookup
26459 instead of FindMembers.
26461 * class.cs (TypeContainer.EmitFieldInitializer): Do not typecast
26462 the result of Assign.Resolve as Assign, but rather as ExpressionStatement.
26464 * attribute.cs: Treat indexers and properties as the same in terms
26465 of applying attributes
26467 * ecore.cs (FindMostEncompassedType): Use statically initialized
26468 EmptyExpressions()s like we do elsewhere to avoid creating useless
26469 objects (and we take this out of the tight loop).
26471 (GetConversionOperators): Move the code to extract the actual
26472 operators to a separate routine to clean things up.
26474 2002-05-04 Miguel de Icaza <miguel@ximian.com>
26476 * ecore.cs (FieldExpr): Remove un-needed tests for null, since now
26477 events are always registered FieldBuilders.
26479 * class.cs (FieldBase): New class shared by Fields
26481 * delegate.cs: If we are a toplevel delegate, use our full name.
26482 If we are a nested delegate, then only use our tail name.
26484 2002-05-02 Ravi Pratap <ravi@ximian.com>
26486 * expression.cs (IsApplicable): Ensure that we add the "&" to
26487 ref/out types before comparing it with the type of the argument.
26489 (IsParamsMethodApplicable): Ditto.
26491 (Argument.Type): Use TypeManager.LookupType instead of Type.GetType -
26494 * delegate.cs : Handle the case when we have more than one applicable
26495 method. Flag an error only when we finish checking all.
26497 2002-05-02 Miguel de Icaza <miguel@ximian.com>
26499 * expression.cs: Add support for boolean static initializers.
26501 2002-05-01 Miguel de Icaza <miguel@ximian.com>
26503 * attribute.cs: Use proper cast for Events, since we use a MyEventBuilder.
26505 * parameter.cs (ComputeParameterTypes,
26506 ComputeAndDefineParameterTypes): Better error handling: now we
26507 clear the `types' cache if we fail during any of the type lookups.
26508 We also return the status code correctly to our caller
26510 * delegate.cs: If we fail to define a delegate, abort the extra
26513 * expression.cs (Binary.ResolveOperator): for
26514 operator==(object,object) and operator !=(object, object) we also
26515 have to verify that there is an implicit conversion from one to
26518 (ArrayAccess.DoResolve): Array Access can operate on
26521 2002-04-30 Miguel de Icaza <miguel@ximian.com>
26523 * assign.cs (CompoundAssign): A new class used as a "flag" that
26524 the assignment actually is happening as part of a compound
26525 assignment operator.
26527 During compound assignment, a few new rules exist to enable things
26534 x op= y can be evaluated as x = (T) (x op y) (ie, an explicit cast
26535 to the type of x) if y is implicitly convertible to the type of x,
26536 and the operator is a builtin operator and the return type of the
26537 operator is explicitly convertible to the type of x.
26539 * rootcontext.cs: Reset warning level to 2. 4 catches various
26540 "interesting" features in mcs, we must clean this up at some
26541 point, but currently am trying to kill other bugs ;-)
26543 * ecore.cs (SimpleName.SimpleNameResolve): Perform member lookups
26544 in container classes as well.
26546 * expression.cs (Binary.ResolveOperator): Handle string case
26547 before anything else (as operator overloading does emit an error
26548 before doing anything else).
26550 This code could go away when we move to a table driven model, but
26551 i could not come up with a good plan last night.
26553 2002-04-30 Lawrence Pit <loz@cable.a2000.nl>
26555 * typemanager.cs (CSharpName): reimplementation using regex.
26556 * class.cs: added null check for fields in Emit
26557 * rootcontext.cs: set warninglevel to 4
26559 2002-04-29 Miguel de Icaza <miguel@ximian.com>
26561 * typemanager.cs (CSharpName): reimplemented with Lupus
26564 2002-04-28 Miguel de Icaza <miguel@ximian.com>
26566 * statement.cs (If): correclty implement Resolve, because we were
26567 not catching sem errors in there. The same process is needed
26569 (Return, StatementExpression, For, While, Do, Throw, Lock): Implement Resolve
26572 (Statement.Warning_DeadCodeFound): Factorize code.
26573 (While): Report dead code here too.
26575 (Statement): Added Resolve virtual method to allow
26576 for resolution split from the emit code.
26578 2002-04-26 Miguel de Icaza <miguel@ximian.com>
26580 * statement.cs (EmitBoolExpression): No longer try to resolve the
26582 (MakeBoolean): New utility function that resolve, implicitly
26583 converts to boolean and tags the expression.
26586 (If, Do): Implement dead code elimination.
26587 (While): Implement loop inversion
26589 (Do, While, For, If): Resolve the expression prior to calling our
26592 2002-04-22 Lawrence Pit <loz@cable.a2000.nl>
26595 - added method Report28 (warning: program has more than one entry point)
26596 - added method IsEntryPoint, implements paragraph 10.1 of the spec
26597 - modified method Method.Define, the part at the end of the method
26599 * rootcontext.cs: added static public Location EntryPointLocation;
26601 * ../errors/cs0028.cs : Add test case for the above warning.
26604 - modified method CSharpName to allow arrays of primitive type to
26605 be printed nicely (e.g. instead of System.Int32[][] it now prints
26607 - added method CSharpSignature: returns the signature of a method
26608 in string format to be used in reporting errors, warnings, etc.
26610 * support.cs: InternalParameters.ParameterDesc variable tmp initialized
26613 2002-04-26 Ravi Pratap <ravi@ximian.com>
26615 * delegate.cs (Define): Fix extremely silly bug where I was
26616 setting the type of the 'object' parameter of the BeginInvoke
26617 method to System.IAsyncResult instead of System.Object ;-)
26619 2002-04-26 Miguel de Icaza <miguel@ximian.com>
26621 * class.cs (ConstructorInitializer.Resolve): Also use DeclaredOnly
26624 (Constructor.Emit): return if we fail to initialize the
26625 constructor. Another door closed!
26627 * expression.cs (New.DoResolve): Improve error message (from -6 to
26628 1501). Use DeclaredOnly lookup to find the exact constructor.
26630 * typemanager.cs (MemberLookup): If DeclaredOnly is set, do not
26631 loop. This is useful.
26633 * cs-parser.jay: Adjust the default parameters so that destructors
26634 have the proper signature.
26636 2002-04-26 Martin Baulig <martin@gnome.org>
26638 * driver.cs (LoadAssembly): If `assembly' contains any characters
26639 which are only valid in path names and not in assembly names
26640 (currently slash, backslash and point), use Assembly.LoadFrom ()
26641 instead of Assembly.Load () on the `assembly' (before iteration
26642 over the link_paths).
26644 2002-04-26 Martin Baulig <martin@gnome.org>
26646 * cs-tokenizer.cs (is_hex): Correctly handle lowercase chars.
26648 2002-04-25 Miguel de Icaza <miguel@ximian.com>
26650 * class.cs (Property): use the new typemanager.MemberLookup
26652 (TypeContainer.MemberLookup): Implement using the
26653 TypeManager.MemberLookup now.
26655 * typemanager.cs: Make MemberLookup a function of the TypeManager,
26656 and return MemberInfos, so that these can be used without an
26657 EmitContext (what we had before).
26659 2002-04-24 Miguel de Icaza <miguel@ximian.com>
26661 * expression.cs: Fix the case where the argument to params if the
26662 type of the params. I omitted handling this before. Fixed
26664 2002-04-22 Miguel de Icaza <miguel@ximian.com>
26666 * driver.cs: Call BootCorlib_PopulateCoreType
26668 * class.cs (Property.CheckBase): Check for properties only, not
26671 * interface.cs: Temporary hack: try/catch around the
26672 CustomAttributeBuilder, because I am getting an exception that I
26675 * rootcontext.cs (BootCorlib_PopulateCoreType): Populate some
26676 types whose definitions are required to be there (attributes are
26677 defined before standard types).
26679 Compute definitions as we boot the various types, as they are used
26680 immediately (value_type class will need object_type, but if we do
26681 not initialize object_type, we will pass a null, which will let
26682 the runtime pick the System.Object from the existing corlib, which
26683 is not what we want).
26685 2002-04-22 Patrik Torstensson <totte@labs2.com>
26687 * cs-tokenizer.cs: fixed a number of trim() issues.
26689 2002-04-22 Ravi Pratap <ravi@ximian.com>
26691 * expression.cs (Argument.Type): Ensure that we return the correct
26692 type when we have out or ref parameters [in which case we
26695 2002-04-22 Miguel de Icaza <miguel@ximian.com>
26697 * class.cs (Property, Indexer): Allow extern modifier in there.
26699 * typemanager.cs (InitBaseTypes): Initializes object_type and
26700 value_type, since those will be used early on during the bootstrap
26701 process to compile corlib.
26703 (InitCoreTypes): Move code from here to InitBaseTypes.
26705 2002-04-21 Miguel de Icaza <miguel@ximian.com>
26707 * ecore.cs (PropertyExpr): Optimize calls to Array::get_Length on
26708 single-dimension arrays as using the ldlen opcode.
26710 Daniel Lewis discovered this optimization.
26712 * typemanager.cs: Add signature for System.Array::get_Length
26714 2002-04-20 Gonzalo Paniagua Javier <gonzalo@ximian.com>
26716 * statement.cs: report the error when the foreach does not apply to an
26717 array nor a collection.
26719 2002-04-19 Miguel de Icaza <miguel@ximian.com>
26721 * expression.cs: Add implicit conversions to the operator ~.
26723 * constant.cs (DecimalConstant.Emit): Emit decimal value.
26725 * typemanager.cs: Locate the decimal constructor.
26727 2002-04-17 Gonzalo Paniagua Javier <gonzalo@ximian.com>
26729 * attribute.cs: use the new property of TypeOf.
26730 * expression.cs: added 'get' property around typearg.
26732 These changes fix a build breaker reported by NickD. Is this the
26733 correct way to fix? If not, please, revert my changes and make it
26736 2002-04-17 Miguel de Icaza <miguel@ximian.com>
26738 * attribute.cs: Add support for typeof in attribute invocations.
26739 I am not sure that this is right though.
26741 2002-04-14 Duncan Mak <duncan@ximian.com>
26743 * cfold.cs (BinaryFold): Catch DivideByZeroException in the
26744 Binary.Operator.Division case.
26746 2002-04-13 Ravi Pratap <ravi@ximian.com>
26748 * class.cs (DefineType): Ensure that we do a proper check on
26749 attribute types and also register it with the TypeManager.
26751 (TypeContainer.Targets): The default for attribute types is
26752 AttributeTargets.All.
26754 * attribute.cs (ApplyAttributes): Registering the attribute type
26755 is done elsewhere, not when we discover we have a Usage attribute.
26757 2002-04-12 Ravi Pratap <ravi@ximian.com>
26759 * expression.cs (VerifyArgumentsCompat): Implement Miguel's suggestion
26760 and get rid of is_delegate parameter.
26762 * everywhere : update.
26764 2002-04-12 Ravi Pratap <ravi@ximian.com>
26766 * cs-parser.jay (compilation_unit): Revamp completely to use
26767 some new ideas that I got from Rhys' grammar to solve the problems
26768 with assembly level attributes.
26770 (outer_declaration): New grammar production.
26772 (attribute_sections): Add.
26774 (opt_attributes): Base on attribute_sections
26776 (namespace_declaration): Allow opt_attributes to tackle the case
26777 when we have assembly level attributes - we are clever in this
26780 * attribute.cs (ApplyAttributes): Do not worry about assembly
26781 attributes in the non-global context.
26783 * rootcontext.cs (AddGlobalAttributes): Go back to using this
26784 instead of SetGlobalAttributes.
26786 * class.cs, rootcontext.cs : Ensure we define and generate
26787 attribute types before anything else.
26789 * attribute.cs (CheckAttribute and GetValidPlaces): Handle the exception
26790 and flag the new error -20 for the case when the attribute type
26791 does not have valid targets specified. csc does not catch this.
26793 * ../errors/errors.txt : update for error # -20
26795 2002-04-11 Ravi Pratap <ravi@ximian.com>
26797 * support.cs (InternalParameters.ParameterModifier): Do some null
26798 checking and return sane values.
26800 * class.cs (Method.Define): If we are a PInvoke method, ensure
26801 that we are static and extern. Report error # 601
26803 * ../errors/cs0601.cs : Add test case for the above error.
26805 2002-04-07 Ravi Pratap <ravi@ximian.com>
26807 * rootcontext.cs (attribute_types): We need to keep type of
26808 all attribute types separately and emit code for them first.
26810 (RegisterAttribute) : Implement.
26812 * class.cs (DefineType): Check if the current Type is a custom
26813 attribute type and register it accordingly.
26815 * rootcontext.cs (AddGlobalAttributes): Fix silly bug where we were
26816 adding the first attribute twice and rename to
26818 (SetGlobalAttributes): this.
26820 * rootcontext.cs (NamespaceLookup): Run through the aliases too and perform
26823 * attribute.cs (ApplyAttributes): Take an additional argument telling us
26824 if we are processing global arguments. Hmm, I am unsure of this.
26826 2002-04-12 Gonzalo Paniagua Javier <gonzalo@ximian.com>
26828 * expression.cs: added static array of strings to avoid calling
26829 Enum.ToString () for Operator in Binary. Significant recover of
26832 2002-04-10 Miguel de Icaza <miguel@ximian.com>
26834 * class.cs (FindMembers): Allow the Builders of the various
26835 members to be null. If they are skip them. This only happens
26836 during the PInvoke declaration.
26838 2002-04-09 Miguel de Icaza <miguel@ximian.com>
26840 * parameter.cs (Parameters.ComputeParameterTypes): Flag the
26841 failure, so we do not keep going afterwards.
26843 * expression.cs: (Invocation.OverloadResolve): I believe Ravi
26844 wanted to pass `false' as the `is_delegate' argument. If this is
26845 the case, why not use delegate_type == null to mean `is_delegate =
26846 false' and anything else as is_delegate = true.
26848 Tue Apr 9 05:40:12 2002 Piers Haken <piersh@friskit.com>
26850 * statement.cs: fixed SimpleSwitchEmit to make 'goto case' goto the
26851 code for the section, not the beginning of the tests.
26853 2002-04-08 Miguel de Icaza <miguel@ximian.com>
26855 * cfold.cs: Handle operator + (Enum x, Underlying x)
26857 * expression.cs (Binary): same. Warn about errors where we have
26858 Enum/Enum in operator + as well.
26860 Mon Apr 8 06:29:03 2002 Piers Haken <piersh@friskit.com>
26863 - added support for switch(bool)
26864 - optimize loading of I8/U8 constants (ldc.i4, iconv_i8)
26865 - add TableSwitchEmit() to handle table-based switch statements
26867 2002-04-05 Ravi Pratap <ravi@ximian.com>
26869 * expression.cs (Invocation.OverloadResolve): Factor out code which
26870 does parameter compatibility checking with arguments so that we can
26871 re-use the code even from Delegate.VerifyApplicability
26873 (VerifyArgumentsCompat): Move above code here.
26875 * delegate.cs (VerifyApplicability): Get rid of duplicate code
26876 and instead make a call to the above method.
26878 2002-03-31 Ravi Pratap <ravi@ximian.com>
26880 * typemanager.cs (attribute_type): Corresponds to System.Attribute.
26881 We use it to keep track of classes which are attribute types.
26883 2002-04-02 Miguel de Icaza <miguel@ximian.com>
26885 * delegate.cs (Delegate.Define): Correctly define the types in the
26886 presence of fixed and array parameters.
26888 * class.cs (TypeContainers.FindMembers): Use NonPublic flag while
26891 * ecore.cs (Expression.MemberLookup): Reset binding flags to not
26892 include NonPublic after the first iteration.
26894 * class.cs (Indexer.CheckBase): Only check if both parents are
26897 * cs-parser.jay (accessor_body): If empty, set to null.
26899 * ecore.cs (SimpleName.SimpleNameResolve): We did not have the
26900 same code path here to resolve constants names that we did have in
26901 MemberAccess.DoResolve. There is too much code duplicated here.
26903 2002-04-01 Miguel de Icaza <miguel@ximian.com>
26905 * statement.cs, makefile: Drop Statementcollection and just use ArrayLists
26907 * ecore.cs: Optimize UserDefinedConversion by minimizing the calls
26910 * cs-tokenizer.cs: Reuse a single StringBuilder for assembling
26911 tokens, numbers and strings.
26913 * ecore.cs (MethodGroupExpr): Make Emit warn about missing
26916 * delegate.cs: Use ComputeAndDefineParameterTypes for both the
26917 asyncronous parameters and the regular parameters.
26919 * codegen.cs (CodeGen.Init): Use the constructor that allows us to
26920 specify the target directory.
26922 * expression.cs: (This.DoResolve): Simplify
26923 (As.Emit): Optimize, do not generate IsInst if the expression is
26924 always of the given type.
26926 (Is.DoResolve): Bug fix, we were reporting both always/never for
26929 * (Invocation.MakeUnionSet): Simplify vastly and optimize, we were
26930 creating too many unnecessary arrays.
26932 2002-03-31 Miguel de Icaza <miguel@ximian.com>
26934 * class.cs (EmitFieldInitializer): Use Assign expression to assign
26935 fields instead of rolling our own initializer. Takes care of all
26936 implicit conversions, and drops unnecessary static checks/argument.
26938 2002-03-31 Dick Porter <dick@ximian.com>
26940 * driver.cs: use the GetDirectories() return values properly, and
26941 use "/" as path separator.
26943 2002-03-30 Miguel de Icaza <miguel@ximian.com>
26945 * expression.cs (Unary): Optimize - - expr into expr.
26946 (Binary): Optimize a + (-b) into a -b.
26948 * codegen.cs (CodeGen): Made all methods static.
26950 2002-03-29 Miguel de Icaza <miguel@ximian.com>
26954 * decl.cs: Rename `definition' into `TypeBuilder' and drop the
26955 TypeBuilder property.
26957 * cs-parser.jay: Drop the use of RecordXXX and use RecordDecl
26960 * tree.cs: Removed the various RecordXXXX, and replaced with a
26961 single RecordDecl. Removed all the accessor methods, and just
26962 left a single access point Type
26964 * enum.cs: Rename DefineEnum to DefineType.
26966 * decl.cs: New abstract method `DefineType' used to unify the
26967 Defines for Enumerations, Interfaces, TypeContainers and
26970 (FindType): Moved LookupInterfaceOrClass here. Moved the
26971 LookupBaseClasses method that used to live in class.cs and
26972 interface.cs here, and renamed to FindType.
26974 * delegate.cs: Implement DefineType. Take advantage of the
26975 refactored pattern for locating the parent builder without taking
26976 the parent_builder argument (which we know does not work if we are
26977 nested, and triggering a toplevel definition).
26979 2002-03-28 Miguel de Icaza <miguel@ximian.com>
26981 * decl.cs (MemberCore.CheckMethodAgainstBase): Test if the
26982 accessibility of a member has changed during override and report
26985 * class.cs (Method.Define, Property.Define): Only complain on
26986 overrides if the method is private, any other accessibility is
26987 fine (and since we just checked the permission is the same, we are
26990 * cs-tokenizer.cs: only line, region, endregion, if, endif, else
26991 and elif are processed always. The other pre-processing
26992 directives are only processed if we are "taking" the path
26994 2002-03-29 Martin Baulig <martin@gnome.org>
26996 * class.cs (Method.Emit): Only emit symbolic debugging info if the
26997 current location is not Null.
26999 * codegen.cs (CodeGen.SaveSymbols): Split out symbol writing code into
27000 a separate method so we can profile it.
27002 * driver.cs (ShowTime): We need to use `(int) span.TotalSeconds' since
27003 `span.Seconds' are just seconds, but no minutes or hours.
27004 (MainDriver): Profile the CodeGen.SaveSymbols calls.
27006 2002-03-28 Miguel de Icaza <miguel@ximian.com>
27008 * class.cs (Method.Define), (Property.Define), (Indexer.Define):
27009 Remove the gratuitous set of Final:
27011 // If an interface implementation, then we can set Final.
27012 if (((flags & MethodAttributes.Abstract) == 0) &&
27013 implementing.DeclaringType.IsInterface)
27014 flags |= MethodAttributes.Final;
27016 I do not know what I was smoking when I used that.
27019 * cs-parser.jay, delegate.cs: Make Delegate be a DeclSpace, first
27020 step into fixing the name resolution issues for delegates and
27021 unifying the toplevel name resolution.
27023 2002-03-28 Martin Baulig <martin@gnome.org>
27025 * class.cs (Method.Emit): If we have a symbol writer, call its
27026 OpenMethod(), CloseMethod() and SetMethodSourceRange() methods to
27027 tell it about the current method.
27029 * codegen.cs (EmitContext.Mark): New public method. Tell the symbol
27030 writer that we're going to emit the first byte of IL code for a new
27031 statement (a new source line).
27032 (EmitContext.EmitTopBlock): If we have a symbol writer, call
27033 EmitContext.Mark() before emitting any code.
27035 * location.cs (SymbolDocument): Return null when we're Null.
27037 * statement.cs (Statement): Moved the `Location loc' variable here.
27038 (Statement.EmitBoolExpression): If we have a symbol writer, call
27039 ec.Mark() before emitting any code to tell it that we're at the
27040 beginning of a new statement.
27041 (StatementExpression): Added `Location' argument to the constructor.
27042 (Block): Added public readonly variable `StartLocation' and public
27043 variable `EndLocation'. The latter is to be set using SetEndLocation().
27044 (Block): Added constructor which takes a start and end location.
27045 (Block.SetEndLocation): New method. This sets the end location.
27046 (Block.EmitMeta): If we have a symbol writer, tell it the names of the
27047 local variables we create.
27048 (Block.Emit): If we have a symbol writer, call ec.Mark() before emitting
27049 each statement and do also mark the begin and end of the block.
27051 * cs-parser.jay (block : OPEN_BRACE): Use the new `Block' constructor to
27052 tell it the current lexer.Location, use Location.Null for the end of the
27054 (block : OPEN_BRACE opt_statement_list CLOSE_BRACE): When closing the
27055 current block, set its end location using SetEndLocation().
27056 (statement_expression): StatementExpression constructor now takes the
27057 lexer.Location as additional argument.
27058 (for_statement, declare_local_variables): Likewise.
27059 (declare_local_variables): When creating a new implicit block, use the
27060 new Block constructor and pass it the lexer.Location.
27062 2002-03-28 Miguel de Icaza <miguel@ximian.com>
27064 * ecore.cs (Expression.MemberLookup): On interfaces, lookup
27065 members also on the parent interfaces recursively.
27067 2002-03-27 Miguel de Icaza <miguel@ximian.com>
27069 * report.cs: Use new formats, since Gonzalo finished the missing
27072 * expression.cs (Binary.ResolveOperator): added missing operator|
27073 operator& and operator^ for bool/bool.
27075 * cs-parser.jay: CheckDef now takes a Location argument that is
27076 used to report errors more precisly (instead of reporting the end
27077 of a definition, we try to track something which is a lot closer
27078 to the source of the problem).
27080 * cs-tokenizer.cs: Track global token use, so we can properly flag
27081 the use of #define/#undef after the first token has been seen.
27083 Also, rename the reportXXXX to Error_DescriptiveName
27085 * decl.cs (DeclSpace.IsTopLevel): Move property here from
27086 TypeContainer, so that Enum and Interface can use this too.
27088 * class.cs (TypeContainer.LookupInterfaceOrClass,
27089 GetInterfaceOrClass, GetClassBases, DefineType): Drop the
27090 `builder' argument. Typically this was used to pass the parent
27091 builder (a ModuleBuilder or a TypeBuilder from whoever triggered
27094 The problem is that a nested class could trigger the definition of
27095 a toplevel class, and the builder would be obviously wrong in that
27098 So we drop this argument, and we compute dynamically the
27099 TypeBuilder/ModuleBuilder (the correct information was available
27100 to us anyways from DeclSpace.Parent)
27102 * interface.cs (Interface.DefineInterface): Drop builder
27103 parameter cleanup like class.cs
27105 * enum.cs (Enum.DefineEnum): Drop builder parameter. Clean up
27108 * statement.cs (Switch.EmitObjectInteger): Emit short/ushort
27111 (Try.Emit): Propagate the returns value from the statement.
27113 (Return.Emit): Even if we are leavning
27115 * driver.cs: Catch IOExpcetion for Directory.GetFiles as well.
27117 * modifiers.cs: Fix the computation of MethodAttributes flags.
27119 Tue Mar 26 21:14:36 CET 2002 Paolo Molaro <lupus@ximian.com>
27121 * driver.cs: allow compilation of files that start with '/'.
27122 Add a default case when checking the argument of --target.
27124 2002-03-25 Miguel de Icaza <miguel@ximian.com>
27126 * interface.cs: Implement the same search algorithm for types in
27127 the interface code.
27129 * delegate.cs: Do not allow multiple definition.
27131 * Recovered ChangeLog that got accidentally amputated
27133 * interface.cs (Interface.DefineInterface): Prevent from double definitions.
27135 * rootcontext.cs: Load manually enum to allow core classes to
27136 contain enumerations.
27138 * enum.cs, ecore.cs, driver.cs, attribute.cs, class.cs, expression.cs:
27139 Update to new static methods in TypeManager.
27141 * typemanager.cs (GetMethod, GetConstructor): Use our
27142 implementation of FindMembers to find the members, since during
27143 corlib compilation, the types are TypeBuilders and GetMethod and
27144 GetConstructor do not work.
27146 Make all methods in TypeManager static.
27148 (InitCodeHelpers): Split the functionality from
27149 the InitCodeTypes function.
27151 * driver.cs: Call InitCodeHelpers after we have populated the
27154 * cs-parser.jay (delegate_declaration): we did not used to compute
27155 the delegate name correctly for void delegates.
27157 2002-03-24 Miguel de Icaza <miguel@ximian.com>
27159 * rootcontext.cs (RootContext): Init the interface_resolve_order
27160 and type_container_resolve_order always.
27162 (ResolveCore, BootstrapCorlib_ResolveClass,
27163 BootstrapCorlib_ResolveStruct): New functions to bootstrap the
27164 compiler when compiling with --nostdlib
27166 * class.cs (TypeContainer.DefineType): Check that our parent is
27167 not null. This test is most important when we are bootstraping
27170 * codegen.cs: Split out the symbol writing code.
27172 2002-03-25 Martin Baulig <martin@gnome.org>
27174 * driver.cs (-g): Made -g an alias for --debug.
27176 2002-03-24 Martin Baulig <martin@gnome.org>
27178 * codegen.cs (SymbolWriter): New public variable. Returns the
27179 current symbol writer.
27180 (CodeGen): Added `bool want_debugging_support' argument to the
27181 constructor. If true, tell the ModuleBuild that we want debugging
27182 support and ask it for the ISymbolWriter.
27183 (Save): If we have a symbol writer, call it's Close() method after
27184 saving the assembly.
27186 * driver.c (--debug): New command line argument to create a
27187 debugger information file.
27189 * location.cs (SymbolDocument): New public property. Returns an
27190 ISymbolDocumentWriter object for the current source file or null
27191 if we don't have a symbol writer.
27193 2002-03-21 Miguel de Icaza <miguel@ximian.com>
27195 * driver.cs (LoadAssembly): Correctly return when all the paths
27196 have been tried and not before.
27198 * statement.cs (Switch.Emit): return the actual coverage for this
27199 statement (returns/not-returns)
27201 (Switch.SimpleSwitchEmit): Do not generate jumps to the end of the
27202 switch of the statement if we are the last switch section. That
27203 kills two problems: try/catch problems (we used to emit an empty
27204 nop at the end) and switch statements where all branches would
27207 2002-03-19 Miguel de Icaza <miguel@ximian.com>
27209 * driver.cs: Add default assemblies (the equivalent to the
27210 Microsoft CSC.RSP file)
27212 * cs-tokenizer.cs: When updating `cols and setting it to zero,
27213 also update tokens_seen and set it to false.
27215 * driver.cs: Implement --recurse for Mike.
27217 * driver.cs (SplitPathAndPattern): Small bug fix, I was not
27218 correctly splitting out the paths.
27220 2002-03-18 Miguel de Icaza <miguel@ximian.com>
27222 * interface.cs (Interface.PopulateProperty): Instead of using
27223 `parent' as the declaration space for the set parameters, use
27226 * support.cs (InternalParameters): InternalParameters constructor
27227 takes a DeclSpace instead of a TypeContainer.
27229 * expression.cs (ArrayCreation.EmitDynamicInitializers): If value
27230 types are being initialized, load the address of it before calling
27233 (New): Provide a mechanism to disable the generation of local
27234 value type temporaries when the caller will be providing us with
27235 an address to store it.
27237 (ArrayCreation.EmitDynamicInitializers): Use it.
27239 2002-03-17 Miguel de Icaza <miguel@ximian.com>
27241 * expression.cs (Invocation.EmitArguments): Only probe for array
27242 property if there is more than one argument. Sorry about that.
27244 * class.cs (Invocation.EmitArguments): Fix to emit arguments for
27245 empty param arrays.
27247 * class.cs (Method.LabelParameters): Fix incorrect code path that
27248 prevented the `ParamArrayAttribute' from being applied to the
27251 2002-03-16 Miguel de Icaza <miguel@ximian.com>
27253 * support.cs (ReflectionParameters): Correctly compute whether the
27254 last argument is a params array. Fixes the problem with
27257 * typemanager.cs: Make the assemblies array always be non-null
27258 (empty, but non-null)
27260 * tree.cs (RecordDecl): New function that abstracts the recording
27261 of names. This reports error 101, and provides a pointer to the
27262 previous declaration. Fixes a crash in the compiler.
27264 * cs-parser.jay (constructor_declaration): Update to new grammar,
27265 and provide a constructor_body that can be empty.
27267 2002-03-15 Miguel de Icaza <miguel@ximian.com>
27269 * driver.cs: Add support for --resources.
27271 * expression.cs: (FetchGetMethod, FetchAddressMethod, EmitAssign):
27272 Make all types for the various array helper methods be integer.
27274 * ecore.cs (Expression.ConvertNumericExplicit): Pass the
27275 CheckState to ConvCast.
27277 (ConvCast): Now it takes a `checked' state argument, to avoid
27278 depending on the emit context for the conversion, and just using
27279 the resolve time setting.
27281 * expression.cs (ArrayCreation.EmitArrayArguments): New function,
27282 instead of Invocation.EmitArguments. We do not emit the original
27283 arguments, instead we emit those which have been converted to
27284 unsigned int expressions.
27286 * statement.cs (Block.EmitMeta): Drop tracking of indexes.
27288 * codegen.cs: ditto.
27290 * expression.cs (LocalVariableReference): Drop the use of the
27291 Store function that depended on the variable index.
27293 * statement.cs (VariableInfo): Drop the `Idx' property from this
27294 class, as this is not taking into account the indexes for
27295 temporaries tat we generate during the execution, getting the
27298 * class.cs: First emit class initializers, then call the parent
27301 * expression.cs (Binary): Fix opcode emision.
27302 (UnaryMutator.EmitCode): Support checked code generation
27304 * ecore.cs (MemberLookup): TypeManager.FindMembers will return
27305 matches for events for both the Static and Instance scans,
27306 pointing to the same element. Fix that.
27308 2002-03-14 Miguel de Icaza <miguel@ximian.com>
27310 * rootcontext.cs (ResolveTree): Always set the
27311 interface_resolve_order, because nested interfaces will be calling
27314 * class.cs (GetInterfaceOrClass): Track the same resolution
27315 process used by TypeManager.LookupType. This fixes the nested
27316 type lookups in class declarations (separate path from
27319 (TypeContainer.DefineType): Also define nested interfaces.
27320 (TypeContainer.RegisterOrder): New public function used to
27321 register the order in which child interfaces need to be closed.
27323 Nested interfaces need to be closed after their parents have been
27326 * interface.cs (InterfaceAttr): Put all the logic for computing
27327 the interface attribute here.
27329 (DefineInterface): Register our interface order with the
27330 RootContext or with the TypeContainer depending on the case.
27332 2002-03-12 Miguel de Icaza <miguel@ximian.com>
27334 * cs-parser.jay: rework foreach statement to work with the new
27335 changes to the policy on SimpleNames.
27337 * report.cs: support Stacktrace on warnings as well.
27339 * makefile: drop --unsafe and /unsafe from the compile.
27341 2002-03-13 Ravi Pratap <ravi@ximian.com>
27343 * ecore.cs (StandardConversionExists): Modify to take an Expression
27344 as the first parameter. Ensure we do null -> reference type conversion
27347 * Everywhere : update calls accordingly, making use of MyEmptyExpr to store
27348 temporary Expression objects.
27350 Wed Mar 13 12:32:40 CET 2002 Paolo Molaro <lupus@ximian.com>
27352 * interface.cs: workaround bug in method overloading resolution
27353 (there is already a bugzilla bug for it).
27355 2002-03-12 Miguel de Icaza <miguel@ximian.com>
27357 We could also solve this problem by having a separate path for
27358 performing type lookups, instead of DoResolve, we could have a
27359 ResolveType entry point, and only participating pieces of the
27360 production (simplename, deref, array) would implement this.
27362 * codegen.cs (EmitContext): New field OnlyLookupTypes used to
27363 signal SimpleName to only resolve type names and not attempt to
27364 resolve anything else.
27366 * expression.cs (Cast): Set the flag.
27368 * ecore.cs (SimpleName): Use the OnlyLookupTypes flag
27370 * class.cs: Only report 108 if there is no `new' modifier.
27372 * cs-parser.jay: rework foreach statement to work with the new
27373 changes to the policy on SimpleNames.
27375 * report.cs: support Stacktrace on warnings as well.
27377 * makefile: drop --unsafe and /unsafe from the compile.
27379 2002-03-11 Miguel de Icaza <miguel@ximian.com>
27381 * ecore.cs (SimpleName.SimpleNameResolve): Perform local variable
27382 lookups here, instead of doing that at parse time. This means
27383 that our grammar will not introduce `LocalVariableReferences' as
27384 expressions at this point. That solves the problem of code like
27388 static void Main ()
27392 This is only half the fix. The full fix requires parameters to
27393 also be handled in this way.
27395 * Everywhere: Use ec.DeclSpace on calls to LookupType, as this
27396 makes the use more obvious of the DeclSpace. The
27397 ec.TypeContainer.TypeBuilder is now only used to pull the
27398 TypeBuilder for it.
27400 My theory is that I can get rid of the TypeBuilder completely from
27401 the EmitContext, and have typecasts where it is used (from
27402 DeclSpace to where it matters).
27404 The only pending problem is that the code that implements Aliases
27405 is on TypeContainer, and probably should go in DeclSpace.
27407 * ecore.cs (SimpleName.SimpleNameResolve): Perform local variable
27408 lookups here, instead of doing that at parse time. This means
27409 that our grammar will not introduce `LocalVariableReferences' as
27410 expressions at this point. That solves the problem of code like
27414 static void Main ()
27418 This is only half the fix. The full fix requires parameters to
27419 also be handled in this way.
27421 * class.cs (Property.DefineMethod): When implementing an interface
27422 method, set newslot, when implementing an abstract method, do not
27423 set the flag (before we tried never setting it, or always setting
27424 it, which is the difference).
27425 (Indexer.DefineMethod): same.
27426 (Method.DefineMethod): same.
27428 * ecore.cs: Only set the status used flag if we get back a Field.
27430 * attribute.cs: Temporary hack, so Paolo can keep working.
27432 2002-03-08 Ravi Pratap <ravi@ximian.com>
27434 * attribute.cs (Attribute.UnmanagedType): This is to keep track of
27435 the unmanaged type in the case we have a MarshalAs attribute.
27437 (Resolve): Handle the case when we are parsing the special MarshalAs
27438 attribute [we need to store the unmanaged type to use later]
27440 * typemanager.cs (marshal_as_attr_type): Built in type for the
27441 MarshalAs Attribute.
27443 * attribute.cs (ApplyAttributes): Recognize the MarshalAs attribute
27444 on parameters and accordingly set the marshalling info.
27446 2002-03-09 Miguel de Icaza <miguel@ximian.com>
27448 * class.cs: Optimizing slightly by removing redundant code after
27449 we switched to the `NoTypes' return value.
27450 (Property.DefineMethod): use NoTypes here too.
27452 This fixes the bug I introduced in my last batch of changes.
27454 2002-03-05 Ravi Pratap <ravi@ximian.com>
27456 * tree.cs (RecordEnum): Add. We now keep track of enums too.
27458 * class.cs (LookupInterfaceOrClass): Check against the list of recorded
27459 Enums since those are types too.
27461 * cs-parser.jay (enum_declaration): Record enums as we parse them.
27463 * enum.cs (DefineEnum): Return if the TypeBuilder has already been defined
27464 thanks to a call during the lookup process.
27466 2002-03-07 Miguel de Icaza <miguel@ximian.com>
27468 * statement.cs (Foreach): Lots of work to accomodate a particular
27469 kind of foreach statement that I had not kept in mind. It is
27470 possible to have foreachs on classes that provide a GetEnumerator
27471 method that return objects that implement the "pattern" for using
27472 a foreach, there is no need to support GetEnumerator
27475 This is needed to compile nant.
27477 * decl.cs: Only report 114 if the member is not `Finalize' and if
27478 the warning level is at least 2.
27480 * class.cs: Moved the compare function from Method to
27483 (MethodSignature.InheritableMemberSignatureCompare): Add new
27484 filter function that is used to extract inheritable methods from a
27487 (Method.Define): Use the new `inheritable_method_signature_filter'
27490 * cs-tokenizer.cs (get_cmd_arg): Do not add white space to the
27493 2002-03-06 Miguel de Icaza <miguel@ximian.com>
27495 * ecore.cs (Expression.ConvertReferenceExplicit): Removed dead code.
27497 * cs-parser.jay: Add opt_semicolon to the interface declaration.
27499 * expression.cs: Pass location information to
27500 ConvertImplicitStandard.
27502 * class.cs: Added debugging code to track return values from
27505 2002-03-05 Miguel de Icaza <miguel@ximian.com>
27507 * expression.cs (Is.DoResolve): If either side of the `is' is an
27508 interface, do not flag the warning.
27510 * ecore.cs (ImplicitReferenceConversion): We need a separate test
27513 * report.cs: Allow for --fatal to be used with --probe.
27515 * typemanager.cs (NoTypes): Move the definition for the empty Type
27518 * class.cs (TypeContainer.FindMembers): Also look for methods defined by
27520 (TypeContainer.DefineProxy): New function used to proxy to parent
27521 implementations when implementing interfaces.
27522 (TypeContainer.ParentImplements): used to lookup if our parent
27523 implements a public function that is required by an interface.
27524 (TypeContainer.VerifyPendingMethods): Hook this up.
27526 * typemanager.cs (TypeManager, AddModule, AddAssembly): Make the
27527 `modules' and `assemblies' arraylists into arrays. We only grow
27528 these are the very early start up of the program, so this improves
27529 the speedof LookupType (nicely measured).
27531 * expression.cs (MakeByteBlob): Replaced unsafe code with
27532 BitConverter, as suggested by Paolo.
27534 * cfold.cs (ConstantFold.Binary): Special case: perform constant
27535 folding of string concatenation, but if either side is a string,
27536 and the other is not, then return null, and let the runtime use
27537 the concatenation on the string plus the object (using
27538 `Object.ToString').
27540 2002-03-04 Miguel de Icaza <miguel@ximian.com>
27542 Constant Folding has been implemented now.
27544 * expression.cs (Unary.Reduce): Do not throw an exception, catch
27545 the error instead on types that are not supported in one's
27548 * constant.cs (Constant and all children): New set of functions to
27549 perform implict and explicit conversions.
27551 * ecore.cs (EnumConstant): Implement the new functions to perform
27552 conversion by proxying to the child expression.
27554 * codegen.cs: (ConstantCheckState): Constant evaluation has its
27555 own separate setting that can not be turned off from the command
27556 line using --unchecked or --checked and is only controlled using
27557 the checked/unchecked statements and expressions. This setting is
27558 used by the constant folder to flag errors.
27560 * expression.cs (CheckedExpr, UncheckedExpr): Set the
27561 ConstantCheckState as well.
27563 During Resolve, they also have to flag the state, because the
27564 constant folder runs completely in the Resolve phase.
27566 * statement.cs (Checked, Unchecked): Set the ConstantCheckState as
27569 2002-03-01 Miguel de Icaza <miguel@ximian.com>
27571 * cfold.cs: New file, this file contains the constant folder.
27573 * ecore.cs (IMemoryLocation.AddressOf): Now takes an extra
27574 argument to track whether we are using the resulting address to
27575 load or store a value and provide better error messages.
27577 (FieldExpr.Emit, FieldExpr.EmitAssign, FieldExpr.AddressOf): Use
27578 new AddressOf arguments.
27580 * statement.cs (Foreach.EmitCollectionForeach): Update
27582 * expression.cs (Argument.Emit): Call AddressOf with proper
27583 arguments to track usage.
27585 (New.DoEmit): Call AddressOf with new arguments.
27587 (Unary.Emit): Adjust AddressOf call.
27589 2002-03-01 Ravi Pratap <ravi@ximian.com>
27591 * cs-parser.jay (member_access): Change the case for pre-defined types
27592 to use a MemberAccess instead of a SimpleName. Thanks to Felix again for
27595 * class.cs (Operator::Emit): If we are abstract or extern, we don't have
27598 * attribute.cs (CheckAttribute, ApplyAttribute): Ensure that we treat operators
27599 essentially like methods and apply attributes like MethodImplOptions to them too.
27601 * ecore.cs (SimpleName.SimpleNameResolve): Perform a check on ec.TypeContainer.TypeBuilder
27604 * codegen.cs (EmitContext): The constructor now takes in an extra argument specifying the
27605 DeclSpace as the distinction is important. We provide sane defaults as usually the TypeContainer
27608 * Update code everywhere accordingly.
27610 * ecore.cs : Change references to ec.TypeContainer to ec.DeclSpace where appropriate.
27612 * cs-parser.jay (enum_declaration): Set the current namespace of the enum.
27614 2002-02-28 Ravi Pratap <ravi@ximian.com>
27616 * rootcontext.cs (LookupType): As we cycle through the chain of namespaces
27617 try performing lookups against those instead of jumping straight into using
27618 the 'using' clauses.
27620 (ImplicitParent): Add. Thanks to Felix Arrese-Igor for this idea.
27622 (LookupType): Perform lookups in implicit parents too.
27624 * class.cs (GetInterfaceOrClass): Modify to perform the exact same lookup
27625 sequence as RootContext.LookupType.
27627 * rootcontext.cs (NamespaceLookup): Split out code from LookupType which tries
27628 the various cases of namespace lookups into this method.
27630 2002-03-01 Miguel de Icaza <miguel@ximian.com>
27632 * cs-parser.jay: Add support for [Attribute ()] (empty arguments
27633 in positional arguments)
27635 * class.cs (Operator): Update the AllowedModifiers to contain
27638 * cs-parser.jay: Update operator declaration to allow for the
27639 operator body to be empty.
27641 * cs-tokenizer.cs: Added '\u' unicode support in strings and hex
27644 2002-02-27 Miguel de Icaza <miguel@ximian.com>
27646 * class.cs (Method.Emit): Label parameters.
27648 * driver.cs: Return 1 or 0 as the program exit code.
27650 2002-02-26 Miguel de Icaza <miguel@ximian.com>
27652 * expression.cs: Special case the `null' object when trying to
27653 auto-compute the type, as anything can be explicitly converted to
27656 * ecore.cs (Expression.ConvertExplicit): Bug fix, thanks for
27657 spotting this Paolo.
27659 (Expression.ImplicitNumericConversion): Perform comparissions of
27660 the type using the underlying type in the case of an enumeration
27661 rather than using the enumeration type for the compare.
27663 Cope with the underlying == type case, which is not possible to
27666 (Expression.ConvertNumericExplicit): Perform comparissions of
27667 the type using the underlying type in the case of an enumeration
27668 rather than using the enumeration type for the compare.
27670 * driver.cs: If the user does not supply an extension, assume .exe
27672 * cs-parser.jay (if_statement): Rewrote so that we can track the
27673 location for the if statement.
27675 * expression.cs (Binary.ConstantFold): Only concat strings when
27676 the operation is "+", not everything ;-)
27678 * statement.cs (Statement.EmitBoolExpression): Take a location
27680 (If, While, Do): Track location.
27682 * expression.cs (Binary.ResolveOperator): In the object + string
27683 case, I was missing a call to ConvertImplicit
27685 2002-02-25 Ravi Pratap <ravi@ximian.com>
27687 * parameter.cs (Parameter.ExternalType): Take in extra DeclSpace and
27688 Location arguments. Ensure we use RootContext.LookupType to do our work
27689 and not try to do a direct Type.GetType and ModuleBuilder.GetType
27691 * interface.cs (PopulateMethod): Handle the type of the parameter being
27694 * expression.cs (Invocation.BetterFunction): Handle the case when we
27695 have a params method with no fixed arguments and a call is made with no
27698 2002-02-25 Miguel de Icaza <miguel@ximian.com>
27700 * cs-tokenizer.cs: Add support for the quote-escape-sequence in
27701 the verbatim-string-literal
27703 * support.cs (InternalParameters.ParameterModifier): handle null
27705 (InternalParameters.ParameterType): ditto.
27707 * parameter.cs (VerifyArgs): Also check if the fixed parameter is
27708 duplicating the name of the variable parameter.
27709 (GetParameterByName): Fix bug where we were not looking up array
27710 paramters if they were the only present (thanks Paolo!).
27711 (GetParameterInfo): We only have an empty set of types if both
27712 fixed and array are set to null.
27713 (GetParameterInfo-idx): Handle FixedParameter == null
27715 * cs-parser.jay: Handle the case where there is no catch
27716 statements (missing null test).
27718 2002-02-22 Miguel de Icaza <miguel@ximian.com>
27720 * driver.cs (MainDriver): Be conservative on our command line
27723 Catch DirectoryNotFoundException when calling GetFiles.
27725 (SplitPathAndPattern): Used to split the input specification into
27726 a path and a pattern that we can feed to Directory.GetFiles.
27728 2002-02-21 Miguel de Icaza <miguel@ximian.com>
27730 * statement.cs (Fixed): Implement the last case of the Fixed
27731 statement (string handling).
27733 * expression.cs (StringPtr): New class used to return a char * to
27734 a string; Used by the Fixed statement.
27736 * typemanager.cs: Add char_ptr_type. Add get_OffsetToStringData method.
27738 * expression.cs (Binary.ResolveOperator): Remove redundant
27739 MemberLookup pn parent type.
27740 Optimize union call, we do not need a union if the types are the same.
27741 (Unary.ResolveOperator): REmove redundant MemberLookup on parent
27744 Specialize the use of MemberLookup everywhere, instead of using
27745 the default settings.
27747 (StackAlloc): Implement stackalloc keyword.
27749 * cs-parser.jay: Add rule to parse stackalloc.
27751 * driver.cs: Handle /h, /help, /?
27753 * expression.cs (MakeByteBlob): Removed the hacks we had in place
27754 before we supported unsafe code.
27756 * makefile: add --unsafe to the self compilation of mcs.
27758 2002-02-20 Miguel de Icaza <miguel@ximian.com>
27760 * expression.cs (PointerArithmetic): New class that is used to
27761 perform pointer arithmetic.
27762 (Binary.Resolve): Handle pointer arithmetic
27763 Handle pointer comparission.
27764 (ArrayPtr): Utility expression class that is used to take the
27765 address of an array.
27767 (ElementAccess): Implement array access for pointers
27769 * statement.cs (Fixed): Implement fixed statement for arrays, we
27770 are missing one more case before we are done.
27772 * expression.cs (Indirection): Implement EmitAssign and set the
27773 ExprClass to Variable. This allows pointer dereferences to be
27774 treated as variables, and to have values assigned to them.
27776 * ecore.cs (Expression.StoreFromPtr): New utility function to
27777 store values dereferencing.
27779 2002-02-20 Ravi Pratap <ravi@ximian.com>
27781 * expression.cs (Binary.ResolveOperator): Ensure that we are
27782 not trying to operate on a void type - this fixes the reported
27785 * decl.cs (CheckMethodAgainstBase): Do not allow overriding if
27786 the parent implementation is sealed.
27788 * ../errors/cs0239.cs : Add.
27790 * attribute.cs (ApplyAttributes): Handle Modulebuilders too.
27792 * typemanager.cs (unverifiable_code_type): Corresponds to
27793 System.Security.UnverifiableCodeAttribute. We need to emit this for modules
27794 which have unsafe code in them.
27796 * rootcontext.cs (EmitCode): Emit the above attribute when we are in an
27799 2002-02-19 Miguel de Icaza <miguel@ximian.com>
27801 * cs-tokenizer.cs: Add support for @"litreal strings"
27803 Make tokenizer accept pre-processor directives
27804 on any column (remove the old C-like limitation).
27806 * rootcontext.cs (EmitCode): Emit any global attributes.
27807 (AddGlobalAttributes): Used to keep track of assembly attributes.
27809 * attribute.cs (ApplyAttributes): Support AssemblyAttributes.
27811 * cs-parser.jay: Add support for global attributes.
27813 2002-02-17 Miguel de Icaza <miguel@ximian.com>
27815 * expression.cs (Indirection): New helper class. Unary will
27816 create Indirection classes to be able to implement the
27817 IMemoryLocation interface on it.
27819 2002-02-16 Miguel de Icaza <miguel@ximian.com>
27821 * cs-parser.jay (fixed_statement): reference the right statement.
27823 * statement.cs (Fixed.Emit): Finish implementing the fixed
27824 statement for the &x case.
27826 2002-02-14 Miguel de Icaza <miguel@ximian.com>
27828 * class.cs (Property.Define, Method.Define): Remove newslot when
27831 * modifiers.cs: My use of NewSlot when `Abstract' was set was
27832 wrong. NewSlot should only be used if the `new' keyword is present.
27834 * driver.cs (GetSystemDir): Use CodeBase instead of FullName for
27835 locating our system dir. Sorry about this.
27837 2002-02-13 Miguel de Icaza <miguel@ximian.com>
27839 * driver.cs (GetSystemDir): Compute correctly the location of our
27840 system assemblies. I was using the compiler directory instead of
27841 the library directory.
27843 2002-02-13 Ravi Pratap <ravi@ximian.com>
27845 * expression.cs (BetterFunction): Put back in what Miguel commented out
27846 since it is the correct fix. The problem is elsewhere ;-)
27848 (IsParamsMethodApplicable): Fix bug where we were not checking that the fixed
27849 parameters of the parms method are themselves compatible or not !
27851 (StandardConversionExists): Fix very dangerous bug where we were forgetting
27852 to check that a class implements an interface before saying that an implicit
27853 conversion was allowed. Use ImplementsInterface to do the checking.
27855 2002-02-13 Miguel de Icaza <miguel@ximian.com>
27857 * class.cs (Method.Define): Track whether we are an explicit
27858 implementation or not. And only call DefineMethodOverride if we
27859 are an explicit implementation.
27861 (Property.DefineMethod): Ditto.
27863 2002-02-11 Ravi Pratap <ravi@ximian.com>
27865 * expression.cs (BetterFunction): Catch hideous bug which was
27866 preventing us from detecting ambiguous calls due to implicit casts i.e
27869 2002-01-29 Miguel de Icaza <miguel@ximian.com>
27871 * support.cs (Pair): Remove un-needed method. I figured why I was
27872 getting the error in cs-parser.jay, the variable in a foreach loop
27873 is readonly, and the compiler does not really treat this as a variable.
27875 * cs-parser.jay (fixed_statement): Fix grammar. Use ASSIGN
27876 instead of EQUALS in grammar.
27878 * typemanager.cs (VerifyUnmanaged): Report correct error (208)
27880 * expression.cs (Unary.DoResolve): Check whether the argument is
27883 2002-01-28 Miguel de Icaza <miguel@ximian.com>
27885 * support.cs: Api for Pair to set a value. Despite the fact that
27886 the variables are public the MS C# compiler refuses to compile
27887 code that accesses the field if the variable is part of a foreach
27890 * statement.cs (Fixed): Begin implementation of the fixed
27893 (Block.AddVariable): Return the VariableInfo on success and null
27894 on failure instead of true/false.
27896 * cs-parser.jay (foreach): Catch errors on variables already
27897 defined (we were ignoring this value before) and properly unwind
27898 the block hierarchy
27900 (fixed_statement): grammar for the fixed statement.
27902 2002-01-25 Miguel de Icaza <miguel@ximian.com>
27904 * expression.cs (UnaryMutator.IsIncrementableNumber): Allow also
27905 pointer types to be incretemented.
27907 (SizeOf): Implement.
27909 * cs-parser.jay (pointer_member_access): Implement
27910 expr->IDENTIFIER production.
27912 * expression.cs (IndexerAccess.DoResolve, ArrayAccess.DoResolve,
27913 MemberAccess.DoResolve, Invocation.DoResolve): Check for pointers
27916 (Unary): Implement indirection.
27918 * ecore.cs (Expression.UnsafeError): Reports error 214 (pointer
27919 use in non-unsafe context).
27921 (SimpleName.DoResolve): Check for pointers in field access on safe
27924 (Expression.LoadFromPtr): Factor the load-indirect code in this
27925 function. This was duplicated in UnboxCast and ParameterReference
27927 2002-01-24 Miguel de Icaza <miguel@ximian.com>
27929 * expression.cs (ComposedCast): report an error if a pointer cast
27930 is used in a safe region.
27932 * ecore.cs (Expression.ConvertExplicit): Add rules for implicit
27933 pointer type casts in unsafe context.
27935 * codegen.cs (EmitContext): Set up IsUnsafe.
27937 * cs-parser.jay (non_expression_type): Add productions for pointer
27940 * expression.cs (Invocation.EmitCall): Remove chunk of buggy
27941 code. We should not use force into static mode if the method is
27942 not virtual. Fixes bug in MIS
27944 * statement.cs (Do.Emit, While.Emit, For.Emit,
27945 Statement.EmitBoolExpression): Add support to Do and While to
27946 propagate infinite loop as `I do return' semantics.
27948 Improve the For case to also test for boolean constants.
27950 * attribute.cs (Attribute.ApplyAttributes): Add ParameterBuilder
27951 to the list of attributes we can add.
27953 Remove `EmitContext' argument.
27955 * class.cs (Method.Define): Apply parameter attributes.
27956 (Constructor.Define): Apply parameter attributes.
27957 (MethodCore.LabelParameters): Move here the core of labeling
27960 * support.cs (ReflectionParameters.ParameterModifier,
27961 InternalParameters.ParameterModifier): Use IsByRef on the type and
27962 only return the OUT bit for these parameters instead of in/out/ref
27965 This is because I miss-understood things. The ParameterInfo.IsIn
27966 and IsOut represent whether the parameter has the [In] and [Out]
27969 2002-01-22 Miguel de Icaza <miguel@ximian.com>
27971 * ecore.cs (FieldExpr.Emit): Release temporaries.
27973 * assign.cs (LocalTemporary.Release): new function.
27975 * codegen.cs (EmitContext.GetTemporaryStorage,
27976 EmitContext.FreeTemporaryStorage): Rework the way we deal with
27977 temporary storage. Now we can "put back" localbuilders when we
27980 2002-01-21 Miguel de Icaza <miguel@ximian.com>
27982 * ecore.cs (FieldExpr.Emit): Handle initonly fields specially: we
27983 need to make a copy of the variable to generate verifiable code.
27985 2002-01-19 Miguel de Icaza <miguel@ximian.com>
27987 * driver.cs: Compute dynamically the system directory.
27989 * ecore.cs (CopyNewMethods): reworked, exposed, made public.
27990 Slower, but more generally useful. Used by the abstract
27991 registering implementation.
27993 * expression.cs (ResolveMemberAccess): Reorder the way we evaluate
27994 the rules for the special rule on Type/instances. First check if
27995 we have the same name, and if so, try that special static path
27996 rather than the instance path.
27998 2002-01-18 Miguel de Icaza <miguel@ximian.com>
28000 * cs-parser.jay: Emit 642 (warning: possible empty statement) for
28003 * class.cs (TypeBuilder.DefineType): Do not allow inheritance from
28004 Enum, ValueType, Delegate or Array for non-corlib compiles.
28006 * cs-tokenizer.cs: Catch long identifiers (645)
28008 * typemanager.cs (IndexerPropetyName): Ravi never tested this
28011 * class.cs (TypeContainer.RegisterRequiredImplementations): Bug
28012 fix, we were returning too early, so we were not registering
28013 pending methods from abstract classes.
28015 Do not register pending methods if the class is abstract.
28017 * expression.cs (Conditional.DoResolve): Report circular implicit
28018 conversions when we neecd to compute it for conditional
28021 (Is.DoResolve): If the expression is always of the provided type,
28022 flag warning 183. If the expression can not ever be of the
28023 provided type flag warning 184.
28025 * class.cs: Catch 169 as well.
28027 * ecore.cs (FieldExpr): For now in AddressOf mark as assigned and
28030 2002-01-18 Nick Drochak <ndrochak@gol.com>
28032 * makefile: remove path to beta2 csc.exe. path to csc.exe must be in PATH instead.
28034 2002-01-17 Miguel de Icaza <miguel@ximian.com>
28036 * interface.cs: (PopulateMethod): Check for pointers being defined
28037 only if the unsafe context is active.
28038 (PopulateProperty): ditto.
28039 (PopulateIndexer): ditto.
28041 * class.cs (Method, Method.Define): Allow `unsafe' modifier to be
28042 specified. If pointers are present, make sure that they are
28043 present in an unsafe context.
28044 (Constructor, Constructor.Define): ditto.
28045 (Field, Field.Define): ditto.
28046 (Property, Property.Define): ditto.
28047 (Event, Event.Define): ditto.
28049 * interface.cs (Interface.GetInterfaceTypeByName): Only lookup the
28050 hashtable if there are classes or structs defined.
28052 * expression.cs (LocalVariableReference.DoResolve): Simplify this
28053 code, as the constant resolution moved.
28055 * statement.cs (Block.EmitMeta): Resolve all constants as we emit
28056 the metadata, so we can flag error 133.
28058 * decl.cs (MemberCore.UnsafeOK): New function to test that a
28059 pointer is being declared in an unsafe context.
28061 2002-01-16 Miguel de Icaza <miguel@ximian.com>
28063 * modifiers.cs (Modifiers.Check): Require a Location argument.
28064 Report error 227 for Unsafe use.
28066 * typemanager.cs: Remove IsPointerType, we should be using Type.IsPointer
28068 * statement.cs (For.Emit): If the test is null, then report that
28069 we do `return', as we wont reach anything afterwards.
28071 (Switch.SwitchGoverningType): Track the expression that matched
28074 * driver.cs: Allow negative numbers as an error code to flag.
28076 * cs-parser.jay: Handle 1551.
28078 * namespace.cs: Add 1537 checking (repeated using alias namespaces).
28080 2002-01-15 Miguel de Icaza <miguel@ximian.com>
28082 * cs-parser.jay: Report 1518 (type declaration can only contain
28083 class, struct, interface, enum or delegate)
28085 (switch_label): Report 1523 (keywords `case' or `default' must
28088 (opt_switch_sections): Report 1522 (empty switch)
28090 * driver.cs: Report 1515 (response file specified multiple times)
28091 Report 1516 (Source file specified multiple times).
28093 * expression.cs (Argument.Resolve): Signal 1510
28095 (BaseAccess.Resolve, BaseIndexer.Resolve): Signal 1511 (base
28096 access not allowed in static code)
28098 2002-01-11 Ravi Pratap <ravi@ximian.com>
28100 * typemanager.cs (IsPointerType): Utility method which we are going
28103 * ecore.cs (ImplicitReferenceConversion): A pointer type cannot be cast to
28104 the object type, so we take care of that.
28106 * expression.cs (FullMethodDesc): Also include the return type in descriptions.
28108 * support.cs (ParameterDesc): Fix minor bug which was causing params tags to be
28109 added to non-params parameters :-)
28111 * typemanager.cs (CSharpName): Include 'void' type too.
28113 (void_ptr_type): Include in the set of core types.
28115 * ecore.cs (ConvertImplicit): Make use of ConvertImplicitStandard instead of
28118 (ConvertImplicitStandard): Handle standard implicit pointer conversions when we have
28121 * cs-parser.jay (local_variable_pointer_type): Add support for 'void *' as I had
28122 completely forgotten about it.
28124 2002-01-10 Ravi Pratap <ravi@ximian.com>
28126 * cs-parser.jay (pointer_type): Add. This begins our implementation
28127 of parsing rules for unsafe code.
28129 (unsafe_statement): Implement.
28131 (embedded_statement): Modify to include the above.
28133 * statement.cs (Unsafe): Implement new class for unsafe blocks.
28135 * codegen.cs (EmitContext.InUnsafe): Add. This determines
28136 if the current context is an unsafe one.
28138 * cs-parser.jay (local_variable_pointer_type): Since local variable types
28139 are handled differently, we need separate rules for them.
28141 (local_variable_declaration): Update to use local_variable_pointer_type
28142 to allow variable declarations of unmanaged pointer types.
28144 * expression.cs (Unary.ResolveOperator): Ensure that the '&' operator is used only
28145 in unsafe contexts.
28147 * ../errors/cs0214.cs : Add.
28149 2002-01-16 Nick Drochak <ndrochak@gol.com>
28151 * makefile: remove 'response' file when cleaning.
28153 2002-01-15 Miguel de Icaza <miguel@ximian.com>
28155 * cs-parser.jay: Report 1524.
28157 2002-01-14 Miguel de Icaza <miguel@ximian.com>
28159 * typemanager.cs (RegisterMethod): drop checking if we have
28160 registered this from here
28162 2002-01-12 Miguel de Icaza <miguel@ximian.com>
28164 * class.cs (Method.EmitDestructor): Implement calling our base
28167 * statement.cs (Try.Emit): Fix to reset the InFinally to the old
28168 value of InFinally.
28170 * codegen.cs (EmitContext.EmitTopBlock): Destructors will call
28171 this routine and will wrap the call in a try/catch block. Deal
28174 2002-01-11 Miguel de Icaza <miguel@ximian.com>
28176 * ecore.cs (Expression.MemberLookup): instead of taking a
28177 parameter `same_type' that was used to tell whether we could
28178 access private members we compute our containing type from the
28181 (FieldExpr): Added partial support for volatile fields. This does
28182 not work for volatile fields exposed from assemblies, as I can not
28183 figure out how to extract the modreq from it.
28185 Updated all the source files to use this.
28187 * codegen.cs (EmitContext): Compute ContainerType ahead of time,
28188 because it is referenced by MemberLookup very often.
28190 2002-01-09 Ravi Pratap <ravi@ximian.com>
28192 * typemanager.cs (IndexerPropertyName): If we have a TypeBuilder, use
28193 TypeBuilder.GetCustomAttributes to retrieve what we need.
28195 Get rid of redundant default_member_attr_type as this is the same as
28196 default_member_type which already exists.
28198 * interface.cs, attribute.cs : Update accordingly.
28200 2002-01-08 Miguel de Icaza <miguel@ximian.com>
28202 * typemanager.cs: Enable IndexerPropertyName again. It does not
28203 work for TYpeBuilders though. Ravi, can you please fix this?
28205 * cs-tokenizer.cs: Accept _ as a name in pp-expressions.
28207 * expression.cs (Argument.Emit): Handle the case of ref objects
28208 being passed to ref functions;
28210 (ParameterReference.EmitLoad): Loads the content of the pointer
28211 without dereferencing.
28213 2002-01-07 Miguel de Icaza <miguel@ximian.com>
28215 * cs-tokenizer.cs: Implemented the pre-processing expressions.
28217 2002-01-08 Ravi Pratap <ravi@ximian.com>
28219 * class.cs (Indexer.DefineMethod): Incorporate the interface
28220 type in the name of the method if we are doing explicit interface
28223 * expression.cs (ConversionExists): Remove as it is completely obsolete.
28225 (BetterConversion): Fix extremely trivial bug where we were referring to
28226 ConversionExists instead of StandardConversionExists ! Hooray, things are fine
28229 * ../errors/bug16.cs : Add although we have fixed it.
28231 2002-01-07 Miguel de Icaza <miguel@ximian.com>
28233 * expression.cs (BaseIndexer): Begin implementation.
28235 * class.cs (TypeContainer.IsInterfaceMethod): Bug fix.
28237 * cs-parser.jay (indexer_declarator): Use qualified_identifier
28238 production directly to remove a shift/reduce, and implement
28239 explicit interface implementation.
28241 * cs-tokenizer.cs: Fix tokenizer, it was consuming one extra char
28242 after a floating point suffix.
28244 * expression.cs (DoNumericPromotions): Improved the conversion for
28245 uint/uint. If we have a constant, we avoid doing a typecast to a
28248 * class.cs (Indexer): Implement explicit interface implementation
28251 Sat Jan 5 16:08:23 CET 2002 Paolo Molaro <lupus@ximian.com>
28253 * class.cs: make the default instance constructor public and hidebysig.
28255 2001-01-03 Ravi Pratap <ravi@ximian.com>
28257 * interface.cs (EmitDefaultMemberAttr): Make this helper method static
28258 so we can call it from elsewhere.
28260 * class.cs (TypeContainer.Emit): Emit the attribute here too. The rule is that
28261 we emit it internally if the class has a defined indexer; otherwise the user
28262 emits it by decorating the class definition with the DefaultMemberAttribute.
28264 * attribute.cs (ApplyAttributes): Perform checks to see that the DefaultMember
28265 attribute is not used on a type which defines an indexer.
28267 * cs-tokenizer.cs (get_cmd_arg): Ensure we trim whitespace and also include the tab
28268 character when we skip whitespace.
28270 * ../errors/cs0646.cs : Add.
28272 2002-01-03 Miguel de Icaza <miguel@ximian.com>
28274 * ecore.cs (SimpleName.ResolveSimpleName): Report error 120
28277 * makefile: Add practical target `mcs3.exe' which builds the third
28278 generation compiler.
28280 * expression.cs (New): Fix structures constructor calling.
28282 * class.cs (Property, Method, Indexer): Emit Final flag on the
28283 method if we are an interface implementation and we are not
28286 * ecore.cs (PropertyExpr): New public field `IsBase', tells
28287 whether this property is referencing a `base' method.
28289 * expression.cs (Invocation.EmitCall): take an extra argument:
28290 is_base, this is used to determine whether the `call' or
28291 `callvirt' opcode should be used.
28294 * delegate.cs: update EmitCall.
28296 * class.cs (Method.Define): Set NewSlot for the cases where we are
28297 not implementing an interface method.
28299 (Property.Define): ditto.
28301 2002-01-02 Miguel de Icaza <miguel@ximian.com>
28303 * cs-tokenizer.cs: (Tokenizer.escape): Escape '\r' as '\r' not as
28304 'r'. Allows mcs to parse itself fully.
28306 2002-01-02 Ravi Pratap <ravi@ximian.com>
28308 * expression.cs (ArrayCreation.num_automatic_initializers): Keep track
28309 of the number of initializers that require the InitializeArray method.
28311 (CheckIndices): Store the Expression in all cases - not the plain value. Also
28312 update the above field where necessary.
28314 (MakeByteBlob): Update accordingly.
28316 (DoEmit): Call EmitStaticInitializers only if the number of initializers is
28319 (EmitDynamicInitializers): Update in accordance with the new optimization.
28321 (ArrayAccess.EmitStoreOpcode): Include char type along with short and ushort - the
28322 same OpCode applies.
28324 * cs-parser.jay : Fix some glaring errors I introduced.
28326 2002-01-01 Ravi Pratap <ravi@ximian.com>
28328 * parameters.cs (AddVariable, AddConstant): Pass in current_local_parameters
28329 so that we can check for name clashes there too.
28331 * typemanager.cs (default_member_attr_type): The attribute that we need to emit
28332 for interface indexers.
28334 * interfaces.cs (Define): Emit the default member attribute.
28336 * expression.cs (MakeByteBlob): Fix extremely trivial bug where the wrong
28337 variable was being referred to while setting the value ;-)
28339 2002-01-01 Miguel de Icaza <miguel@ximian.com>
28341 * expression.cs (MakeByteBlob): Optimize: we do not need to fill
28342 byte-by-byte information when we know the data is zero.
28344 Make the block always a multiple of 4, because
28345 DefineInitializedData has a bug.
28347 * assign.cs: Fix, we should assign from the temporary, not from
28350 * expression.cs (MakeByteBlob): Fix my incorrect code.
28352 2001-12-31 Miguel de Icaza <miguel@ximian.com>
28354 * typemanager.cs (EnumToUnderlying): This function is used to get
28355 the underlying type from an enumeration, because it does not
28358 * constant.cs: Use the I4_S form for values between -128 and 127.
28360 * statement.cs (Block.LookupLabel): Looks up a label.
28361 (Block): Drop support for labeled blocks.
28363 (LabeledStatement): New kind of statement that represents a label
28366 (Goto): Finally implement this bad boy.
28368 * cs-parser.jay: Update to reflect new mechanism to implement
28371 2001-12-30 Miguel de Icaza <miguel@ximian.com>
28373 * codegen.cs (EmitContext.This): a codegen property that keeps the
28374 a single instance of this instead of creating many different this
28377 * delegate.cs (Delegate.DoResolve): Update to use the property;
28379 * ecore.cs (SimpleName.SimpleNameResolve): Ditto
28381 * expression.cs (BaseAccess.DoResolve): Ditto.
28383 2001-12-29 Ravi Pratap <ravi@ximian.com>
28385 * typemanager.cs (methodimpl_attr_type): Add to hold the type
28386 corresponding to System.Runtime.CompilerServices.MethodImplAttribute.
28388 (InitCoreTypes): Update accordingly.
28390 * attribute.cs (Resolve): Remember if the attribute is a MethodImplAttribute
28391 so we can quickly store the state.
28393 (ApplyAttributes): Set the correct implementation flags
28394 for InternalCall methods.
28396 2001-12-29 Miguel de Icaza <miguel@ximian.com>
28398 * expression.cs (EmitCall): if a method is not virtual, then do
28399 not use callvirt on it.
28401 (ArrayAccess.EmitAssign): storing non-builtin value types (ie,
28402 user defined stuff) requires the use of stobj, which takes an
28403 address on the stack instead of an array and an index. So emit
28404 the Ldelema operation for it.
28406 (EmitStoreOpcode): Use stobj for valuetypes.
28408 (UnaryMutator.EmitCode): Use the right 1 value depending on
28409 whether we are dealing with int64/uint64, float or doubles.
28411 * class.cs (TypeContainer.AddConstructor): Fix the logic to define
28412 constructors that I implemented last night.
28414 (Constructor.IsDefault): Fix to work properly for static
28417 * cs-parser.jay (CheckDef): report method signature errors.
28418 Update error number 103 to be 132.
28420 * decl.cs: New AdditionResult enumeration value: MethodExists.
28421 Although we do this check for methods later on in the semantic
28422 analysis, catching repeated default constructors is so easy that
28423 we catch these here.
28425 * expression.cs (Binary.DoNumericPromotions): Fix the uint64 type
28428 (ParameterReference.EmitAssign, Emit): handle
28431 (ArrayAccess.EmitLoadOpcode): Handle bool type here.
28432 (ArrayAccess.EmitStoreOpcode): ditto.
28434 * cs-tokenizer.cs (is_punct): Eliminated empty computation.
28436 * expression.cs (MakeByteBlob): Complete all the missing types
28437 (uint, short, ushort, byte, sbyte)
28439 * class.cs: Only init instance field initializers on instance
28442 Rename `constructors' to instance_constructors.
28444 (TypeContainer.AddConstructor): Only add constructors to the list
28445 if it is not static.
28447 Make sure that we handle default_static_constructor independently
28448 everywhere where we handle instance_constructors
28450 2001-12-28 Miguel de Icaza <miguel@ximian.com>
28452 * class.cs: Do not lookup or create a base initializer for a
28453 static constructor.
28455 (ConstructorInitializer.Resolve): use the proper type to lookup
28458 * cs-parser.jay: Report error 1585 (modifiers between type and name).
28460 * enum.cs, interface.cs: Remove CloseType, this is taken care by
28463 * decl.cs: CloseType is now an virtual method, the default
28464 implementation just closes this type.
28466 2001-12-28 Ravi Pratap <ravi@ximian.com>
28468 * attribute.cs (DefinePInvokeMethod): Set the implementation flags
28469 to PreserveSig by default. Also emit HideBySig on such methods.
28471 Basically, set the defaults to standard values.
28473 * expression.cs (Invocation.BetterFunction): We need to make sure that for each
28474 argument, if candidate is better, it can't be worse than the best !
28476 (Invocation): Re-write bits to differentiate between methods being
28477 applicable in their expanded form and their normal form - for params
28480 Get rid of use_standard everywhere as only standard conversions are allowed
28481 in overload resolution.
28483 More spec conformance.
28485 2001-12-27 Miguel de Icaza <miguel@ximian.com>
28487 * driver.cs: Add --timestamp, to see where the compiler spends
28490 * ecore.cs (SimpleName.DoResolve): Do not create an implicit
28491 `this' in static code.
28493 (SimpleName.DoResolve): Implement in terms of a helper function
28494 that allows static-references to be passed upstream to
28497 (Expression.ResolveWithSimpleName): Resolve specially simple
28498 names when called by MemberAccess to implement the special
28501 (Expression.ImplicitReferenceConversion): Handle conversions from
28502 Null to reference types before others, as Null's type is
28505 * expression.cs (Invocation.EmitCall): Handle the special case of
28506 calling methods declared on a reference type from a ValueType
28507 (Base classes System.Object and System.Enum)
28509 (MemberAccess.Resolve): Only perform lookups on Enumerations if
28510 the left hand side is a TypeExpr, not on every enumeration.
28512 (Binary.Resolve): If types are reference types, then do a cast to
28513 object on operators != and == of both arguments.
28515 * typemanager.cs (FindMembers): Extract instance and static
28516 members if requested.
28518 * interface.cs (PopulateProperty): Use void_type instead of null
28519 as the return type for the setter method.
28521 (PopulateIndexer): ditto.
28523 2001-12-27 Ravi Pratap <ravi@ximian.com>
28525 * support.cs (ReflectionParameters): Fix minor bug where we
28526 were examining the wrong parameter for the ParamArray attribute.
28528 Cope with requests for the type of the parameter at position
28529 greater than the params parameter's. We now return the element
28530 type of the params array as that makes more sense.
28532 * expression.cs (Invocation.IsParamsMethodApplicable): Update
28533 accordingly as we no longer have to extract the element type
28536 (Invocation.OverloadResolve): Update.
28538 2001-12-27 Miguel de Icaza <miguel@ximian.com>
28540 * statement.cs (Foreach.GetEnumeratorFilter): Do not compare
28541 against IEnumerator, test whether the return value is a descendant
28542 of the IEnumerator interface.
28544 * class.cs (Indexer.Define): Use an auxiliary method to implement
28545 the other bits of the method definition. Begin support for
28546 explicit interface implementation.
28548 (Property.DefineMethod): Use TypeManager.void_type instead of null
28549 for an empty return value.
28551 2001-12-26 Miguel de Icaza <miguel@ximian.com>
28553 * expression.cs (MemberAccess.ResolveMemberAccess): if we are
28554 dealing with a FieldExpr which is composed of a FieldBuilder, in
28555 the code path we did extract the constant, but we should have
28556 obtained the underlying value to be able to cast it (otherwise we
28557 end up in an infinite loop, this is what Ravi was running into).
28559 (ArrayCreation.UpdateIndices): Arrays might be empty.
28561 (MemberAccess.ResolveMemberAccess): Add support for section
28562 14.5.4.1 that deals with the special case of E.I when E is a type
28563 and something else, that I can be a reference to a static member.
28565 (ArrayCreation.MakeByteBlob): It is not an error to not be able to
28566 handle a particular array type to create byte blobs, it is just
28567 something we dont generate byteblobs for.
28569 * cs-tokenizer.cs (get_cmd_arg): Ignore \r in commands and
28572 * location.cs (Push): remove the key from the hashtable that we
28573 are about to add. This happens for empty files.
28575 * driver.cs: Dispose files after we have parsed them.
28577 (tokenize): new function that only runs the tokenizer on its
28578 input, for speed testing.
28580 2001-12-26 Ravi Pratap <ravi@ximian.com>
28582 * class.cs (Event.Define): Define the private field only if there
28583 are no accessors defined.
28585 * expression.cs (ResolveMemberAccess): If there is no associated
28586 field with the event, that means we have an event defined with its
28587 own accessors and we should flag error cs0070 since transforming
28588 ourselves into a field is not valid in that case.
28590 * ecore.cs (SimpleName.DoResolve): Same as above.
28592 * attribute.cs (DefinePInvokeMethod): Set the default calling convention
28593 and charset to sane values.
28595 2001-12-25 Ravi Pratap <ravi@ximian.com>
28597 * assign.cs (DoResolve): Perform check on events only if they
28598 are being accessed outside the declaring type.
28600 * cs-parser.jay (event_declarations): Update rules to correctly
28601 set the type of the implicit parameter etc.
28603 (add_accessor, remove_accessor): Set current local parameters.
28605 * expression.cs (Binary): For delegate addition and subtraction,
28606 cast the return value from the method into the appropriate delegate
28609 2001-12-24 Ravi Pratap <ravi@ximian.com>
28611 * typemanager.cs (RegisterDelegateData, GetDelegateData): Get rid
28612 of these as the workaround is unnecessary.
28614 * delegate.cs (NewDelegate.DoResolve): Get rid of bits which registered
28615 delegate data - none of that is needed at all.
28617 Re-write bits to extract the instance expression and the delegate method
28620 * expression.cs (Binary.ResolveOperator): Handle the '-' binary operator
28623 * attribute.cs (ApplyAttributes): New method to take care of common tasks
28624 of attaching attributes instead of duplicating code everywhere.
28626 * everywhere : Update code to do attribute emission using the above method.
28628 2001-12-23 Miguel de Icaza <miguel@ximian.com>
28630 * expression.cs (IsParamsMethodApplicable): if there are not
28631 parameters, return immediately.
28633 * ecore.cs: The 0 literal can be implicity converted to an enum
28636 (SimpleName.DoResolve): First lookup the type, then lookup the
28639 (FieldExpr.Emit): If the InstanceExpression is a ValueType, we
28640 want to get its address. If the InstanceExpression is not
28641 addressable, store the result in a temporary variable, then get
28644 * codegen.cs: Only display 219 errors on warning level or above.
28646 * expression.cs (ArrayAccess): Make it implement the
28647 IMemoryLocation interface.
28649 (Binary.DoResolve): handle the operator == (object a, object b)
28650 and operator != (object a, object b) without incurring into a
28651 BoxedCast (because 5 != o should never be performed).
28653 Handle binary enumerator operators.
28655 (EmitLoadOpcode): Use Ldelema if the object we are loading is a
28656 value type, otherwise use Ldelem_ref.
28658 Use precomputed names;
28660 (AddressOf): Implement address of
28662 * cs-parser.jay (labeled_statement): Fix recursive block
28663 addition by reworking the production.
28665 * expression.cs (New.DoEmit): New has a special case:
28667 If we are dealing with a ValueType, we have a few
28668 situations to deal with:
28670 * The target of New is a ValueType variable, that is
28671 easy, we just pass this as the variable reference
28673 * The target of New is being passed as an argument,
28674 to a boxing operation or a function that takes a
28677 In this case, we need to create a temporary variable
28678 that is the argument of New.
28681 2001-12-23 Ravi Pratap <ravi@ximian.com>
28683 * rootcontext.cs (LookupType): Check that current_type is not null before
28684 going about looking at nested types.
28686 * ecore.cs (EventExpr.EmitAddOrRemove): Rename from EmitAssign as we do
28687 not implement the IAssignMethod interface any more.
28689 * expression.cs (MemberAccess.ResolveMemberAccess): Handle EventExprs specially
28690 where we tranform them into FieldExprs if they are being resolved from within
28691 the declaring type.
28693 * ecore.cs (SimpleName.DoResolve): Do the same here.
28695 * assign.cs (DoResolve, Emit): Clean up code considerably.
28697 * ../errors/bug10.cs : Add.
28699 * ../errors/cs0070.cs : Add.
28701 * typemanager.cs : Use PtrHashtable for Delegate data hashtable etc.
28703 * assign.cs : Get rid of EventIsLocal everywhere.
28705 2001-12-23 Miguel de Icaza <miguel@ximian.com>
28707 * ecore.cs (ConvertIntLiteral): finished the implementation.
28709 * statement.cs (SwitchLabel): Convert the value we are using as a
28710 key before looking up the table.
28712 2001-12-22 Miguel de Icaza <miguel@ximian.com>
28714 * codegen.cs (EmitTopBlock): Require a Location argument now.
28716 * cs-parser.jay (constructor_declarator): We need to setup
28717 current_local_parameters before we parse the
28718 opt_constructor_initializer, to allow the variables to be bound
28719 to the constructor arguments.
28721 * rootcontext.cs (LookupType): First lookup nested classes in our
28722 class and our parents before we go looking outside our class.
28724 * expression.cs (ConstantFold): Extract/debox the values at the
28727 * rootcontext.cs (EmitCode): Resolve the constants first before we
28728 resolve the types. This is not really needed, but it helps debugging.
28730 * statement.cs: report location.
28732 * cs-parser.jay: pass location to throw statement.
28734 * driver.cs: Small bug fix.
28736 * report.cs: Updated format to be 4-zero filled digits.
28738 2001-12-22 Ravi Pratap <ravi@ximian.com>
28740 * expression.cs (CheckIndices): Fix minor bug where the wrong
28741 variable was being referred to ;-)
28743 (DoEmit): Do not call EmitStaticInitializers when the
28744 underlying type is System.Object.
28746 2001-12-21 Ravi Pratap <ravi@ximian.com>
28748 * ecore.cs (EventExpr.Resolve): Implement to correctly set the type
28749 and do the usual workaround for SRE.
28751 * class.cs (MyEventBuilder.EventType): New member to get at the type
28752 of the event, quickly.
28754 * expression.cs (Binary.ResolveOperator): Handle delegate addition.
28756 * assign.cs (Assign.DoResolve): Handle the case when the target
28757 is an EventExpr and perform the necessary checks.
28759 * ecore.cs (EventExpr.EmitAssign): Implement the IAssignMethod
28762 (SimpleName.MemberStaticCheck): Include check for EventExpr.
28764 (EventExpr): Set the type in the constructor itself since we
28765 are meant to be born fully resolved.
28767 (EventExpr.Define): Revert code I wrote earlier.
28769 * delegate.cs (NewDelegate.Resolve): Handle the case when the MethodGroup's
28770 instance expression is null. The instance expression is a This in that case
28771 or a null, depending on whether it is a static method or not.
28773 Also flag an error if the reference to a method is ambiguous i.e the MethodGroupExpr
28774 refers to more than one method.
28776 * assign.cs (DoResolve): Check whether the event belongs to the same Type container
28777 and accordingly flag errors.
28779 2001-12-21 Miguel de Icaza <miguel@ximian.com>
28781 * statement.cs (Throw.Emit): Add support for re-throwing exceptions.
28783 2001-12-22 Miguel de Icaza <miguel@ximian.com>
28785 * location.cs (ToString): Provide useful rutine.
28787 2001-12-21 Miguel de Icaza <miguel@ximian.com>
28789 * ecore.cs (Expression.ConvertIntLiteral): Do not return Constant
28790 objects, return the actual integral boxed.
28792 * statement.cs (SwitchLabel): define an ILLabel for each
28795 (Switch.CheckSwitch): If the value is a Literal, extract
28796 the underlying literal.
28798 Also in the unused hashtable we had, add the SwitchLabel so we can
28799 quickly look this value up.
28801 * constant.cs: Implement a bunch of new constants. Rewrite
28802 Literal based on this. Made changes everywhere to adapt to this.
28804 * expression.cs (Expression.MakeByteBlob): Optimize routine by
28805 dereferencing array only once, and also copes with enumrations.
28807 bytes are two bytes wide, not one.
28809 (Cast): Perform constant conversions.
28811 * ecore.cs (TryImplicitIntConversion): Return literals instead of
28812 wrappers to the literals here.
28814 * expression.cs (DoNumericPromotions): long literals can converted
28815 to ulong implicity (this is taken care of elsewhere, but I was
28816 missing this spot).
28818 * ecore.cs (Expression.Literalize): Make the return type Literal,
28819 to improve type checking.
28821 * rootcontext.cs: Lookup for nested classes in our class hierarchy.
28823 2001-12-20 Miguel de Icaza <miguel@ximian.com>
28825 * literal.cs: Revert code from ravi that checked the bounds. The
28826 bounds are sane by the definition of the type itself.
28828 * typemanager.cs: Fix implementation of ImplementsInterface. We
28829 need to actually look up in our parent hierarchy for interfaces
28832 * const.cs: Use the underlying type for enumerations
28834 * delegate.cs: Compute the basename for the delegate creation,
28835 that should fix the delegate test case, and restore the correct
28836 Type Lookup semantics in rootcontext
28838 * rootcontext.cs: Revert Ravi's last patch. The correct way of
28839 referencing a nested type with the Reflection API is using the "+"
28842 * cs-parser.jay: Do not require EOF token at the end.
28844 2001-12-20 Ravi Pratap <ravi@ximian.com>
28846 * rootcontext.cs (LookupType): Concatenate type names with
28847 a '.' instead of a '+' The test suite passes again.
28849 * enum.cs (Enum.DefineEnum): Set RTSpecialName on the 'value__'
28850 field of the enumeration.
28852 * expression.cs (MemberAccess.ResolveMemberAccess): Add support for
28853 the case when the member is an EventExpr.
28855 * ecore.cs (EventExpr.InstanceExpression): Every event which is not
28856 static has an associated instance expression.
28858 * typemanager.cs (RegisterEvent): The usual workaround, now for events.
28860 (GetAddMethod, GetRemoveMethod): Workarounds, as usual.
28862 * class.cs (Event.Define): Register event and perform appropriate checks
28865 We define the Add and Remove methods even if the use provides none because
28866 in that case, we provide default implementations ourselves.
28868 Define a private field of the type of the event. This is done by the CSC compiler
28869 and we should be doing it too ;-)
28871 * typemanager.cs (delegate_combine_delegate_delegate, delegate_remove_delegate_delegate):
28872 More methods we use in code we generate.
28874 (multicast_delegate_type, delegate_type): Two separate types since the distinction
28877 (InitCoreTypes): Update accordingly for the above.
28879 * class.cs (Event.Emit): Generate code for default accessors that we provide
28881 (EmitDefaultMethod): Do the job in the above.
28883 * delegate.cs (DefineDelegate): Use TypeManager.multicast_delegate_type in the
28886 2001-12-20 Miguel de Icaza <miguel@ximian.com>
28888 * class.cs (Indexer.Define): Fix bug, we were setting both Get/Set
28889 builders even if we were missing one.
28891 * interface.cs, class.cs, enum.cs: When calling DefineNestedType
28892 pass the Basename as our class name instead of the Name. The
28893 basename will be correctly composed for us.
28895 * parameter.cs (Paramters): Now takes a Location argument.
28897 * decl.cs (DeclSpace.LookupType): Removed convenience function and
28898 make all the code call directly LookupType in RootContext and take
28899 this chance to pass the Location information everywhere.
28901 * Everywhere: pass Location information.
28903 2001-12-19 Miguel de Icaza <miguel@ximian.com>
28905 * class.cs (Constructor.Define): Updated way of detecting the
28906 length of the parameters.
28908 (TypeContainer.DefineType): Use basename as the type name for
28911 (TypeContainer.Define): Do not recursively define types here, as
28912 definition is taken care in order by the RootContext.
28914 * tree.cs: Keep track of namespaces in a per-file basis.
28916 * parameter.cs (Parameter.ComputeSignature): Update to use
28919 (Parameters.GetSignature): ditto.
28921 * interface.cs (InterfaceMethod.GetSignature): Take a DeclSpace
28922 instead of a TypeContainer.
28924 (Interface.SemanticAnalysis): Use `this' instead of our parent to
28925 resolve names. Because we need to be resolve in our context, not
28928 * driver.cs: Implement response files.
28930 * class.cs (TypeContainer.DefineType): If we are defined, do not
28931 redefine ourselves.
28933 (Event.Emit): Emit the code for add/remove handlers.
28934 (Event.Define): Save the MethodBuilders for add/remove.
28936 * typemanager.cs: Use pair here too.
28938 * cs-parser.jay: Replaced use of DictionaryEntry for Pair because
28939 DictionaryEntry requires the first argument to be non-null.
28941 (enum_declaration): Compute full name for registering the
28944 (delegate_declaration): Instead of using
28945 formal_parameter_list, use opt_formal_parameter_list as the list
28948 * cs-tokenizer.cs (PropertyParsing): renamed from `properties'
28949 (EventParsing): New property that controls whether `add' and
28950 `remove' are returned as tokens or identifiers (for events);
28952 2001-12-19 Ravi Pratap <ravi@ximian.com>
28954 * class.cs (Event.Define): Revamp use of EventBuilder completely. We now
28955 use MyEventBuilder only and let it wrap the real builder for us.
28957 (MyEventBuilder): Revamp constructor etc.
28959 Implement all operations that we perform on EventBuilder in precisely the same
28962 (FindMembers): Update to use the EventBuilder member.
28964 (Event.Emit): Update accordingly.
28966 2001-12-18 Ravi Pratap <ravi@ximian.com>
28968 * class.cs (MyEventBuilder.Set*): Chain to the underlying builder
28969 by calling the appropriate methods.
28971 (GetCustomAttributes): Make stubs as they cannot possibly do anything
28974 (Event.Emit): Use MyEventBuilder everywhere - even to set attributes.
28976 2001-12-17 Ravi Pratap <ravi@ximian.com>
28978 * delegate.cs (Delegate.Populate): Check that the return type
28979 and various parameters types are indeed accessible.
28981 * class.cs (Constructor.Define): Same here.
28983 (Field.Define): Ditto.
28985 (Event.Define): Ditto.
28987 (Operator.Define): Check that the underlying Method defined itself
28988 correctly - so it's MethodBuilder should not be null.
28990 * delegate.cs (DelegateInvocation.DoResolve): Bale out if the type of the Instance
28991 expression happens to be null.
28993 * class.cs (MyEventBuilder): Workaround for SRE lameness. Implement various abstract
28994 members but as of now we don't seem to be able to do anything really useful with it.
28996 (FindMembers): Handle events separately by returning the MyEventBuilder of the event,
28997 not the EventBuilder.
28999 2001-12-18 Miguel de Icaza <miguel@ximian.com>
29001 * cs-tokenizer.cs: Add support for defines.
29002 Add support for #if, #elif, #else, #endif
29004 (eval_var): evaluates a variable.
29005 (eval): stubbed for evaluating functions.
29007 * cs-parser.jay: Pass the defines information
29009 * driver.cs: Add --define command line option.
29011 * decl.cs: Move MemberCore here.
29013 Make it the base class for DeclSpace. This allows us to catch and
29014 report 108 and 109 for everything now.
29016 * class.cs (TypeContainer.Define): Extract all the members
29017 before populating and emit the warning 108 (new keyword required
29018 to override) instead of having each member implement this.
29020 (MemberCore.Define): New abstract method, we will be using this in
29021 the warning reporting engine in Populate.
29023 (Operator.Define): Adjust to new MemberCore protocol.
29025 * const.cs (Const): This does not derive from Expression, it is a
29026 temporary object we use to create fields, it is a MemberCore.
29028 * class.cs (Method.Define): Allow the entry point to be in a
29031 * driver.cs: Rewrite the argument handler to clean it up a bit.
29033 * rootcontext.cs: Made it just an auxiliary namespace feature by
29034 making everything static.
29036 * driver.cs: Adapt code to use RootContext type name instead of
29039 * delegate.cs: Remove RootContext argument.
29041 * class.cs: (Struct, TypeContainer, Class): Remove RootContext
29044 * class.cs (Event.Define): The lookup can fail.
29046 * cs-tokenizer.cs: Begin implementation of pre-procesor.
29048 * expression.cs: Resolve the this instance before invoking the code.
29050 2001-12-17 Miguel de Icaza <miguel@ximian.com>
29052 * cs-parser.jay: Add a production in element_access that allows
29053 the thing to become a "type" reference. This way we can parse
29054 things like "(string [])" as a type.
29056 Note that this still does not handle the more complex rules of
29060 * delegate.cs (Delegate.Populate): Register the delegage constructor builder here.
29062 * ecore.cs: (CopyNewMethods): new utility function used to
29063 assemble the list of methods from running FindMembers.
29065 (MemberLookup): Rework FindMembers so that
29067 2001-12-16 Miguel de Icaza <miguel@ximian.com>
29069 * class.cs (TypeContainer): Remove Delegates who fail to be
29072 * delegate.cs (Populate): Verify that we dont get null return
29073 values. TODO: Check for AsAccessible.
29075 * cs-parser.jay: Use basename to emit error 574 (destructor should
29076 have the same name as container class), not the full name.
29078 * cs-tokenizer.cs (adjust_int): Fit the integer in the best
29079 possible representation.
29081 Also implements integer type suffixes U and L.
29083 2001-12-15 Miguel de Icaza <miguel@ximian.com>
29085 * expression.cs (ArrayCreation.DoResolve): We need to do the
29086 argument resolution *always*.
29088 * decl.cs: Make this hold the namespace. Hold the root context as
29090 (LookupType): Move here.
29092 * enum.cs, class.cs, interface.cs: Adapt to new hierarchy.
29094 * location.cs (Row, Name): Fixed the code, it was always returning
29095 references to the first file.
29097 * interface.cs: Register properties defined through interfaces.
29099 * driver.cs: Add support for globbing on the command line
29101 * class.cs (Field): Make it derive from MemberCore as well.
29104 2001-12-15 Ravi Pratap <ravi@ximian.com>
29106 * class.cs (Event::Define): Check that the type of the event is a delegate
29107 type else flag error #66.
29109 Also, re-use TypeContainer.MethodModifiersValid here too as the rules are the
29112 * attribute.cs (DefinePInvokeMethod): Handle named arguments and process
29113 values of EntryPoint, CharSet etc etc.
29115 Pass in the values to TypeBuilder.DefinePInvokeMethod; determine Type etc neatly.
29117 * class.cs (FindMembers): If a method is in transit, its MethodBuilder will
29118 be null and we should ignore this. I am not sure if this is really clean. Apparently,
29119 there's no way of avoiding hitting this because the call is coming from SimpleName.DoResolve,
29120 which needs this to do its work.
29122 * ../errors/cs0066.cs : Add.
29124 2001-12-14 Miguel de Icaza <miguel@ximian.com>
29126 * typemanager.cs: (GetPropertyGetter, GetPropertyGetter): New
29129 * class.cs: (MethodSignature.MethodSignature): Removed hack that
29130 clears out the parameters field.
29131 (MemberSignatureCompare): Cleanup
29133 (MemberCore): New base class used to share code between MethodCore
29136 (RegisterRequiredImplementations) BindingFlags.Public requires
29137 either BindingFlags.Instace or Static. Use instance here.
29139 (Property): Refactored code to cope better with the full spec.
29141 * parameter.cs (GetParameterInfo): Return an empty array instead
29144 * class.cs (Property): Abstract or extern properties have no bodies.
29146 * parameter.cs (GetParameterInfo): return a zero-sized array.
29148 * class.cs (TypeContainer.MethodModifiersValid): Move all the
29149 method modifier validation to the typecontainer so we can reuse
29150 this on properties.
29152 (MethodCore.ParameterTypes): return an empty sized array of types.
29154 (Property.Define): Test property modifier validity.
29156 Add tests for sealed/override too.
29158 (Method.Emit): abstract or extern methods have no bodies.
29160 2001-12-14 Ravi Pratap <ravi@ximian.com>
29162 * class.cs (Method.IsPInvoke): Get rid of it as it is an expensive
29165 (Method::Define, ::Emit): Modify accordingly.
29167 * expression.cs (Invocation::OverloadResolve): Handle error # 121.
29169 (ArrayCreation::MakeByteBlob): Handle floats and doubles.
29171 * makefile: Pass in /unsafe.
29173 2001-12-13 Miguel de Icaza <miguel@ximian.com>
29175 * class.cs (MakeKey): Kill routine.
29177 * class.cs (TypeContainer.Define): Correctly define explicit
29178 method implementations (they require the full interface name plus
29181 * typemanager.cs: Deply the PtrHashtable here and stop using the
29182 lame keys. Things work so much better.
29184 This of course broke everyone who depended on `RegisterMethod' to
29185 do the `test for existance' test. This has to be done elsewhere.
29187 * support.cs (PtrHashtable): A hashtable that avoid comparing with
29188 the object stupid Equals method (because, that like fails all over
29189 the place). We still do not use it.
29191 * class.cs (TypeContainer.SetRequiredInterface,
29192 TypeContainer.RequireMethods): Killed these two routines and moved
29193 all the functionality to RegisterRequiredImplementations.
29195 (TypeContainer.RegisterRequiredImplementations): This routine now
29196 registers all the implementations required in an array for the
29197 interfaces and abstract methods. We use an array of structures
29198 which can be computed ahead of time to reduce memory usage and we
29199 also assume that lookups are cheap as most classes will not
29200 implement too many interfaces.
29202 We also avoid creating too many MethodSignatures.
29204 (TypeContainer.IsInterfaceMethod): Update and optionally does not
29205 clear the "pending" bit if we find that there are problems with
29208 (TypeContainer.VerifyPendingMethods): Update to report errors of
29209 methods that look like implementations but are not.
29211 (TypeContainer.Define): Add support for explicit interface method
29214 2001-12-12 Miguel de Icaza <miguel@ximian.com>
29216 * typemanager.cs: Keep track of the parameters here instead of
29217 being a feature of the TypeContainer.
29219 * class.cs: Drop the registration of parameters here, as
29220 InterfaceMethods are also interface declarations.
29222 * delegate.cs: Register methods with the TypeManager not only with
29223 the TypeContainer. This code was buggy.
29225 * interface.cs: Full registation here.
29227 2001-12-11 Miguel de Icaza <miguel@ximian.com>
29229 * expression.cs: Remove reducer for binary expressions, it can not
29232 * const.cs: Put here the code that used to go into constant.cs
29234 * constant.cs: Put here the code for constants, this is a new base
29235 class for Literals.
29237 * literal.cs: Make Literal derive from Constant.
29239 2001-12-09 Miguel de Icaza <miguel@ximian.com>
29241 * statement.cs (Return.Emit): Report error 157 if the user
29242 attempts to return from a finally block.
29244 (Return.Emit): Instead of emitting a return, jump to the end of
29247 * codegen.cs (EmitContext): ReturnValue, ReturnLabel: new
29248 LocalBuilder to store the result of the function. ReturnLabel is
29249 the target where we jump.
29252 2001-12-09 Radek Doulik <rodo@ximian.com>
29254 * cs-parser.jay: remember alias in current namespace
29256 * ecore.cs (SimpleName::DoResolve): use aliases for types or
29259 * class.cs (LookupAlias): lookup alias in my_namespace
29261 * namespace.cs (UsingAlias): add alias, namespace_or_type pair to
29263 (LookupAlias): lookup alias in this and if needed in parent
29266 2001-12-08 Miguel de Icaza <miguel@ximian.com>
29270 * rootcontext.cs: (ModuleBuilder) Made static, first step into
29271 making things static. I need this to avoid passing the
29272 TypeContainer when calling ParameterType.
29274 * support.cs (InternalParameters.ParameterType): Remove ugly hack
29275 that did string manipulation to compute the type and then call
29276 GetType. Use Parameter.ParameterType instead.
29278 * cs-tokenizer.cs: Consume the suffix for floating values.
29280 * expression.cs (ParameterReference): figure out whether this is a
29281 reference parameter or not. Kill an extra variable by computing
29282 the arg_idx during emission.
29284 * parameter.cs (Parameters.GetParameterInfo): New overloaded
29285 function that returns whether a parameter is an out/ref value or not.
29287 (Parameter.ParameterType): The type of the parameter (base,
29288 without ref/out applied).
29290 (Parameter.Resolve): Perform resolution here.
29291 (Parameter.ExternalType): The full type (with ref/out applied).
29293 * statement.cs (Using.Emit, Using.EmitExpression): Implement
29294 support for expressions on the using statement.
29296 2001-12-07 Miguel de Icaza <miguel@ximian.com>
29298 * statement.cs (Using.EmitLocalVariableDecls): Split the
29299 localvariable handling of the using statement.
29301 (Block.EmitMeta): Keep track of variable count across blocks. We
29302 were reusing slots on separate branches of blocks.
29304 (Try.Emit): Emit the general code block, we were not emitting it.
29306 Check the type of the declaration to be an IDisposable or
29307 something that can be implicity converted to it.
29309 Emit conversions if required.
29311 * ecore.cs (EmptyExpression): New utility class.
29312 (Expression.ImplicitConversionExists): New utility function.
29314 2001-12-06 Miguel de Icaza <miguel@ximian.com>
29316 * statement.cs (Using): Implement.
29318 * expression.cs (LocalVariableReference): Support read only variables.
29320 * statement.cs: Remove the explicit emit for the Leave opcode.
29321 (VariableInfo): Add a readonly field.
29323 2001-12-05 Miguel de Icaza <miguel@ximian.com>
29325 * ecore.cs (ConvCast): new class used to encapsulate the various
29326 explicit integer conversions that works in both checked and
29327 unchecked contexts.
29329 (Expression.ConvertNumericExplicit): Use new ConvCast class to
29330 properly generate the overflow opcodes.
29332 2001-12-04 Miguel de Icaza <miguel@ximian.com>
29334 * statement.cs: The correct type for the EmptyExpression is the
29335 element_type, not the variable type. Ravi pointed this out.
29337 2001-12-04 Ravi Pratap <ravi@ximian.com>
29339 * class.cs (Method::Define): Handle PInvoke methods specially
29340 by using DefinePInvokeMethod instead of the usual one.
29342 * attribute.cs (DefinePInvokeMethod): Implement as this is what is called
29343 above to do the task of extracting information and defining the method.
29345 2001-12-04 Ravi Pratap <ravi@ximian.com>
29347 * expression.cs (ArrayCreation::EmitStaticInitializers): Get rid
29348 of the condition for string type.
29350 (Emit): Move that here.
29352 (ArrayCreation::CheckIndices): Keep string literals in their expression
29355 (EmitDynamicInitializers): Handle strings appropriately.
29357 2001-12-04 Miguel de Icaza <miguel@ximian.com>
29359 * codegen.cs (EmitContext): Replace multiple variables with a
29360 single pointer to the current Switch statement.
29362 * statement.cs (GotoDefault, Switch): Adjust to cleaned up
29365 2001-12-03 Miguel de Icaza <miguel@ximian.com>
29369 * statement.cs (GotoDefault), cs-parser.jay: Implement `goto
29372 (Foreach.Emit): Foreach on arrays was not setting
29373 up the loop variables (for break/continue).
29375 (GotoCase): Semi-implented.
29377 2001-12-03 Ravi Pratap <ravi@ximian.com>
29379 * attribute.cs (CheckAttribute): Handle system attributes by using
29380 Attribute.GetAttributes to examine information we need.
29382 (GetValidPlaces): Same here.
29384 * class.cs (Method::Define): Catch invalid use of extern and abstract together.
29386 * typemanager.cs (dllimport_type): Core type for System.DllImportAttribute.
29388 * class.cs (Method.IsPinvoke): Used to determine if we are a PInvoke method.
29390 (Method::Define): Set appropriate flags if we have a DllImport attribute.
29392 (Method::Emit): Handle the case when we are a PInvoke method.
29394 2001-12-03 Miguel de Icaza <miguel@ximian.com>
29396 * expression.cs: Use ResolveWithSimpleName on compound names.
29398 2001-12-02 Ravi Pratap <ravi@ximian.com>
29400 * constant.cs (EmitConstant): Make sure we resolve the associated expression
29401 before trying to reduce it.
29403 * typemanager.cs (RegisterConstant, LookupConstant): Implement.
29405 * constant.cs (LookupConstantValue): Implement.
29407 (EmitConstant): Use the above in emitting the constant.
29409 * expression.cs (MemberAccess::ResolveMemberAccess): Handle constants
29410 that are user-defined by doing a LookupConstantValue on them.
29412 (SimpleName::DoResolve): When we have a FieldExpr, cope with constants
29415 2001-11-29 Miguel de Icaza <miguel@ximian.com>
29417 * expression.cs (BaseAccess, BaseIndexer): Also split this out.
29419 (BaseAccess.DoResolve): Implement.
29421 (MemberAccess.DoResolve): Split this routine into a
29422 ResolveMemberAccess routine that can be used independently
29424 2001-11-28 Miguel de Icaza <miguel@ximian.com>
29426 * expression.cs (Probe, Is, As): Split Probe in two classes Is and
29427 As that share bits of the implementation. Is returns a boolean,
29428 while As returns the Type that is being probed.
29430 2001-12-01 Ravi Pratap <ravi@ximian.com>
29432 * enum.cs (LookupEnumValue): Re-write various bits, return an object value
29433 instead of a Literal - much easier.
29435 (EnumInTransit): Remove - utterly useless :-)
29437 (Populate): Re-write bits - remove duplicate code etc. The code is much neater now.
29439 * expression.cs (MemberLookup): Cope with user-defined enums when they are in transit.
29441 * enum.cs (LookupEnumValue): Auto-compute next values by going down the dependency
29442 chain when we have no associated expression.
29444 2001-11-30 Ravi Pratap <ravi@ximian.com>
29446 * constant.cs (Define): Use Location while reporting the errror.
29448 Also emit a warning when 'new' is used and there is no inherited
29451 * enum.cs (EnumInTransit): Used to tell if an enum type is in the process of being
29454 (LookupEnumValue): Implement to lookup an enum member's value and define it
29457 (Populate): Re-write accordingly to use the above routine.
29459 2001-11-27 Miguel de Icaza <miguel@ximian.com>
29461 * expression.cs (This): Fix prototype for DoResolveLValue to
29462 override the base class DoResolveLValue.
29464 * cs-parser.cs: Report errors cs574 and cs575 (destructor
29467 * ecore.cs (FieldExpr.EmitAssign): Handle value types specially
29468 (we need to load the address of the field here). This fixes
29471 (FieldExpr.DoResolveLValue): Call the DoResolve
29472 function to initialize the Instance expression.
29474 * statement.cs (Foreach.Emit): Fix the bug where we did not invoke
29475 correctly the GetEnumerator operation on a value type.
29477 * cs-parser.jay: Add more simple parsing error catches.
29479 * statement.cs (Switch): Add support for string switches.
29480 Handle null specially.
29482 * literal.cs (NullLiteral): Make NullLiteral objects singletons.
29484 2001-11-28 Ravi Pratap <ravi@ximian.com>
29486 * cs-parser.jay (local_constant_declaration): Use declare_local_constant.
29488 (declare_local_constant): New helper function.
29490 * statement.cs (AddConstant): Keep a separate record of constants
29492 (IsConstant): Implement to determine if a variable is a constant.
29494 (GetConstantExpression): Implement.
29496 * expression.cs (LocalVariableReference): Handle the case when it is a constant.
29498 * statement.cs (IsVariableDefined): Re-write.
29500 2001-11-27 Ravi Pratap <ravi@ximian.com>
29502 * class.cs (TypeContainer::FindMembers): Look for constants
29503 in the case when we are looking for MemberTypes.Field
29505 * expression.cs (MemberAccess::DoResolve): Check that in the
29506 case we are a FieldExpr and a Literal, we are not being accessed
29507 by an instance reference.
29509 * cs-parser.jay (local_constant_declaration): Implement.
29511 (declaration_statement): Implement for constant declarations.
29513 2001-11-26 Miguel de Icaza <miguel@ximian.com>
29515 * statement.cs (Switch): Catch double defaults.
29517 (Switch): More work on the switch() statement
29518 implementation. It works for integral values now, need to finish
29522 2001-11-24 Miguel de Icaza <miguel@ximian.com>
29524 * ecore.cs (Expression.ConvertIntLiteral): New function to convert
29525 integer literals into other integer literals. To be used by
29528 2001-11-24 Ravi Pratap <ravi@ximian.com>
29530 * expression.cs (ArrayCreation): Get rid of ArrayExprs : we save
29533 (EmitDynamicInitializers): Cope with the above since we extract data
29534 directly from ArrayData now.
29536 (ExpectInitializers): Keep track of whether initializers are mandatory
29539 (Bounds): Make it a hashtable to prevent the same dimension being
29540 recorded for every element in that dimension.
29542 (EmitDynamicInitializers): Fix bug which prevented the Set array method
29545 Also fix bug which was causing the indices to be emitted in the reverse
29548 2001-11-24 Miguel de Icaza <miguel@ximian.com>
29550 * expression.cs (ArrayCreation): Implement the bits that Ravi left
29551 unfinished. They do not work, because the underlying code is
29554 2001-11-22 Miguel de Icaza <miguel@ximian.com>
29556 * cs-parser.jay: Remove bogus fixme.
29558 * statement.cs (Switch, SwitchSection, SwithLabel): Started work
29559 on Switch statement.
29561 2001-11-23 Ravi Pratap <ravi@ximian.com>
29563 * typemanager.cs (IsDelegateType, IsEnumType): Fix logic to determine
29566 * expression.cs (ArrayCreation::CheckIndices): Get rid of the require_constant
29567 parameter. Apparently, any expression is allowed.
29569 (ValidateInitializers): Update accordingly.
29571 (CheckIndices): Fix some tricky bugs thanks to recursion.
29573 * delegate.cs (NewDelegate::DoResolve): Re-write large portions as
29574 I was being completely brain-dead.
29576 (VerifyMethod, VerifyApplicability, VerifyDelegate): Make static
29577 and re-write acordingly.
29579 (DelegateInvocation): Re-write accordingly.
29581 * expression.cs (ArrayCreation::Emit): Handle string initialization separately.
29583 (MakeByteBlob): Handle types more correctly.
29585 * expression.cs (ArrayCreation:Emit): Write preliminary code to do
29586 initialization from expressions but it is incomplete because I am a complete
29589 2001-11-22 Miguel de Icaza <miguel@ximian.com>
29591 * statement.cs (If.Emit): Fix a bug that generated incorrect code
29592 on If. Basically, we have to return `true' (ie, we do return to
29593 our caller) only if both branches of the if return.
29595 * expression.cs (Binary.Emit): LogicalOr and LogicalAnd are
29596 short-circuit operators, handle them as short circuit operators.
29598 (Cast.DoResolve): Resolve type.
29599 (Cast.Cast): Take an expression as the target type.
29601 * cs-parser.jay (cast_expression): Remove old hack that only
29602 allowed a limited set of types to be handled. Now we take a
29603 unary_expression and we resolve to a type during semantic
29606 Use the grammar productions from Rhys to handle casts (this is
29607 not complete like Rhys syntax yet, we fail to handle that corner
29608 case that C# has regarding (-x), but we will get there.
29610 2001-11-22 Ravi Pratap <ravi@ximian.com>
29612 * class.cs (EmitFieldInitializer): Take care of the case when we have a
29613 field which is an array type.
29615 * cs-parser.jay (declare_local_variables): Support array initialization too.
29617 * typemanager.cs (MakeKey): Implement.
29619 (everywhere): Use the above appropriately.
29621 * cs-parser.jay (for_statement): Update for array initialization while
29622 declaring variables.
29624 * ecore.cs : The error message was correct, it's the variable's names that
29625 were misleading ;-) Make the code more readable.
29627 (MemberAccess::DoResolve): Fix the code which handles Enum literals to set
29628 the correct type etc.
29630 (ConvertExplicit): Handle Enum types by examining the underlying type.
29632 2001-11-21 Ravi Pratap <ravi@ximian.com>
29634 * parameter.cs (GetCallingConvention): Always return
29635 CallingConventions.Standard for now.
29637 2001-11-22 Miguel de Icaza <miguel@ximian.com>
29639 * expression.cs (Binary.ResolveOperator): Update the values of `l'
29640 and `r' after calling DoNumericPromotions.
29642 * ecore.cs: Fix error message (the types were in the wrong order).
29644 * statement.cs (Foreach.ProbeCollectionType): Need to pass
29645 BindingFlags.Instance as well
29647 * ecore.cs (Expression.TryImplicitIntConversion): Wrap the result
29648 implicit int literal conversion in an empty cast so that we
29649 propagate the right type upstream.
29651 (UnboxCast): new class used to unbox value types.
29652 (Expression.ConvertExplicit): Add explicit type conversions done
29655 (Expression.ImplicitNumericConversion): Oops, forgot to test for
29656 the target type before applying the implicit LongLiterals to ULong
29659 2001-11-21 Miguel de Icaza <miguel@ximian.com>
29661 * cs-parser.jay (for_statement): Reworked the way For works: now
29662 we declare manually any variables that are introduced in
29663 for_initializer to solve the problem of having out-of-band code
29664 emition (that is what got for broken).
29666 (declaration_statement): Perform the actual variable declaration
29667 that used to be done in local_variable_declaration here.
29669 (local_variable_declaration): Do not declare anything, just pass
29670 the information on a DictionaryEntry
29672 2001-11-20 Ravi Pratap <ravi@ximian.com>
29674 * expression.cs (ArrayCreation::CheckIndices): The story continues :-) Complete
29675 re-write of the logic to now make it recursive.
29677 (UpdateIndices): Re-write accordingly.
29679 Store element data in a separate ArrayData list in the above methods.
29681 (MakeByteBlob): Implement to dump the array data into a byte array.
29683 2001-11-19 Ravi Pratap <ravi@ximian.com>
29685 * expression.cs (ArrayCreation): Factor out some code from ValidateInitializers
29688 * constant.cs (Define): Implement.
29690 (EmitConstant): Re-write fully.
29692 Pass in location info.
29694 * class.cs (Populate, Emit): Call Constant::Define and Constant::EmitConstant
29697 * cs-parser.jay (constant_declarator): Use VariableDeclaration instead of
29698 DictionaryEntry since we need location info too.
29700 (constant_declaration): Update accordingly.
29702 * expression.cs (ArrayCreation): Make ValidateInitializers simpler by factoring
29703 code into another method : UpdateIndices.
29705 2001-11-18 Ravi Pratap <ravi@ximian.com>
29707 * expression.cs (ArrayCreation::ValidateInitializers): Update to perform
29708 some type checking etc.
29710 2001-11-17 Ravi Pratap <ravi@ximian.com>
29712 * expression.cs (ArrayCreation::ValidateInitializers): Implement
29713 bits to provide dimension info if the user skips doing that.
29715 Update second constructor to store the rank correctly.
29717 2001-11-16 Ravi Pratap <ravi@ximian.com>
29719 * expression.cs (ArrayCreation::ValidateInitializers): Poke around
29720 and try to implement.
29722 * ../errors/cs0150.cs : Add.
29724 * ../errors/cs0178.cs : Add.
29726 2001-11-16 Miguel de Icaza <miguel@ximian.com>
29728 * statement.cs: Implement foreach on multi-dimensional arrays.
29730 * parameter.cs (Parameters.GetParameterByName): Also lookup the
29731 name of the params argument.
29733 * expression.cs: Use EmitStoreOpcode to get the right opcode while
29734 initializing the array.
29736 (ArrayAccess.EmitStoreOpcode): move the opcode generation here, so
29737 we can use this elsewhere.
29739 * statement.cs: Finish implementation of foreach for single
29742 * cs-parser.jay: Use an out-of-band stack to pass information
29743 around, I wonder why I need this.
29745 foreach_block: Make the new foreach_block the current_block.
29747 * parameter.cs (Parameters.GetEmptyReadOnlyParameters): New
29748 function used to return a static Parameters structure. Used for
29749 empty parameters, as those are created very frequently.
29751 * cs-parser.jay, class.cs: Use GetEmptyReadOnlyParameters
29753 2001-11-15 Ravi Pratap <ravi@ximian.com>
29755 * interface.cs : Default modifier is private, not public. The
29756 make verify test passes again.
29758 2001-11-15 Ravi Pratap <ravi@ximian.com>
29760 * support.cs (ReflectionParameters): Fix logic to determine
29761 whether the last parameter is a params one. Test 9 passes again.
29763 * delegate.cs (Populate): Register the builders we define with
29764 RegisterParameterForBuilder. Test 19 passes again.
29766 * cs-parser.jay (property_declaration): Reference $6 instead
29767 of $$ to get at the location.
29769 (indexer_declaration): Similar stuff.
29771 (attribute): Ditto.
29773 * class.cs (Property): Register parameters for the Get and Set methods
29774 if they exist. Test 23 passes again.
29776 * expression.cs (ArrayCreation::Emit): Pass null for the method in the
29777 call to EmitArguments as we are sure there aren't any params arguments.
29778 Test 32 passes again.
29780 * suppor.cs (ParameterDesc, ParameterModifier): Fix trivial bug causing
29781 IndexOutOfRangeException.
29783 * class.cs (Property::Define): Register property using TypeManager.RegisterProperty
29784 Test 33 now passes again.
29786 2001-11-15 Miguel de Icaza <miguel@ximian.com>
29788 * cs-parser.jay: Kill horrendous hack ($??? = lexer.Location) that
29789 broke a bunch of things. Will have to come up with a better way
29790 of tracking locations.
29792 * statement.cs: Implemented foreach for single dimension arrays.
29794 2001-11-09 Miguel de Icaza <miguel@ximian.com>
29796 * enum.cs (Enum.Emit): Delay the lookup of loc until we run into
29797 an error. This removes the lookup from the critical path.
29799 * cs-parser.jay: Removed use of temporary_loc, which is completely
29802 2001-11-14 Miguel de Icaza <miguel@ximian.com>
29804 * support.cs (ReflectionParameters.ParameterModifier): Report
29805 whether the argument is a PARAMS argument or not.
29807 * class.cs: Set the attribute `ParamArrayAttribute' on the
29808 parameter argument.
29810 * typemanager.cs: Define param_array_type (ParamArrayAttribute)
29811 and cons_param_array_attribute (ConstructorInfo for
29812 ParamArrayAttribute).,
29814 * codegen.cs: Emit the return using the `Return' statement, that
29815 way we can report the error correctly for missing return values.
29817 * class.cs (Method.Emit): Clean up.
29819 * expression.cs (Argument.Resolve): Take another argument: the
29820 location where this argument is used. Notice that this is not
29821 part of the "Argument" class as to reduce the size of the
29822 structure (we know the approximate location anyways).
29824 Test if the argument is a variable-reference, if not, then
29825 complain with a 206.
29827 (Argument.Emit): Emit addresses of variables.
29829 (Argument.FullDesc): Simplify.
29831 (Invocation.DoResolve): Update for Argument.Resolve.
29833 (ElementAccess.DoResolve): ditto.
29835 * delegate.cs (DelegateInvocation.Emit): Invocation of Invoke
29836 method should be virtual, as this method is always virtual.
29838 (NewDelegate.DoResolve): Update for Argument.Resolve.
29840 * class.cs (ConstructorInitializer.DoResolve): ditto.
29842 * attribute.cs (Attribute.Resolve): ditto.
29844 2001-11-13 Miguel de Icaza <miguel@ximian.com>
29846 * statement.cs (Foreach.Emit): Use EmitAssign instead of Store.
29848 * expression.cs (ParameterReference): Drop IStackStorage and implement
29849 IAssignMethod instead.
29851 (LocalVariableReference): ditto.
29853 * ecore.cs (FieldExpr): Drop IStackStorage and implement
29854 IAssignMethod instead.
29856 2001-11-13 Miguel de Icaza <miguel@ximian.com>
29858 * parameter.cs, expression.cs, class.cs, ecore.cs: Made all
29859 enumerations that are used in heavily used structures derive from
29860 byte in a laughable and pathetic attempt to reduce memory usage.
29861 This is the kind of pre-optimzations that you should not do at
29862 home without adult supervision.
29864 * expression.cs (UnaryMutator): New class, used to handle ++ and
29865 -- separatedly from the other unary operators. Cleans up the
29866 code, and kills the ExpressionStatement dependency in Unary.
29868 (Unary): Removed `method' and `Arguments' from this class, making
29869 it smaller, and moving it all to SimpleCall, so I can reuse this
29870 code in other locations and avoid creating a lot of transient data
29871 strucutres when not required.
29873 * cs-parser.jay: Adjust for new changes.
29875 2001-11-11 Miguel de Icaza <miguel@ximian.com>
29877 * enum.cs (Enum.Populate): If there is a failure during
29880 * cs-parser.jay (opt_enum_base): we used to catch type errors
29881 here, but this is really incorrect. The type error should be
29882 catched during semantic analysis.
29884 2001-12-11 Ravi Pratap <ravi@ximian.com>
29886 * cs-parser.jay (operator_declarator, conversion_operator_declarator): Set
29887 current_local_parameters as expected since I, in my stupidity, had forgotten
29890 * attribute.cs (GetValidPlaces): Fix stupid bug.
29892 * class.cs (Method::Emit): Perform check on applicability of attributes.
29894 (Constructor::Emit): Ditto.
29896 (Field::Emit): Ditto.
29898 (Field.Location): Store location information.
29900 (Property, Event, Indexer, Operator): Ditto.
29902 * cs-parser.jay (field_declaration): Pass in location for each field.
29904 * ../errors/cs0592.cs : Add.
29906 2001-11-12 Ravi Pratap <ravi@ximian.com>
29908 * typemanager.cs (attribute_usage_type): New static member for System.AttributeUsage.
29910 (InitCoreTypes): Update accordingly.
29912 (RegisterAttrType, LookupAttr): Implement.
29914 * attribute.cs (Attribute.Targets, AllowMultiple, Inherited): New fields to hold
29915 info about the same.
29917 (Resolve): Update to populate the above as necessary.
29919 (Error592): Helper.
29921 (GetValidPlaces): Helper to the above.
29923 (CheckAttribute): Implement to perform validity of attributes on declarative elements.
29925 * class.cs (TypeContainer::Emit): Update attribute emission code to perform checking etc.
29927 2001-11-12 Ravi Pratap <ravi@ximian.com>
29929 * attribute.cs (Attribute::Resolve): Expand to handle named arguments too.
29931 * ../errors/cs0617.cs : Add.
29933 2001-11-11 Ravi Pratap <ravi@ximian.com>
29935 * enum.cs (Emit): Rename to Populate to be more consistent with what
29936 we expect it to do and when exactly it is called.
29938 * class.cs, rootcontext.cs : Update accordingly.
29940 * typemanager.cs (RegisterField, GetValue): Workarounds for the fact that
29941 FieldInfo.GetValue does not work on dynamic types ! S.R.E lameness strikes again !
29943 * enum.cs (Populate): Register fields with TypeManager.RegisterField.
29945 * expression.cs (MemberAccess.DoResolve): Adjust code to obtain the value
29946 of a fieldinfo using the above, when dealing with a FieldBuilder.
29948 2001-11-10 Ravi Pratap <ravi@ximian.com>
29950 * ../errors/cs0031.cs : Add.
29952 * ../errors/cs1008.cs : Add.
29954 * ../errrors/cs0543.cs : Add.
29956 * enum.cs (DefineEnum): Check the underlying type and report an error if not a valid
29959 (FindMembers): Implement.
29961 * typemanager.cs (FindMembers): Re-write to call the appropriate methods for
29962 enums and delegates too.
29964 (enum_types): Rename to builder_to_enum.
29966 (delegate_types): Rename to builder_to_delegate.
29968 * delegate.cs (FindMembers): Implement.
29970 2001-11-09 Ravi Pratap <ravi@ximian.com>
29972 * typemanager.cs (IsEnumType): Implement.
29974 * enum.cs (Emit): Re-write parts to account for the underlying type
29975 better and perform checking etc.
29977 (GetNextDefaultValue): Helper to ensure we don't overshoot max value
29978 of the underlying type.
29980 * literal.cs (GetValue methods everywhere): Perform bounds checking and return
29983 * enum.cs (error31): Helper to report error #31.
29985 * cs-parser.jay (enum_declaration): Store location of each member too.
29987 * enum.cs (member_to_location): New hashtable.
29989 (AddEnumMember): Update location hashtable.
29991 (Emit): Use the location of each member while reporting errors.
29993 2001-11-09 Miguel de Icaza <miguel@ximian.com>
29995 * cs-parser.jay: A for_initializer if is a
29996 local_variable_declaration really ammount to have an implicit
29997 block with the variable declaration and no initializer for for.
29999 * statement.cs (For.Emit): Cope with null initializers.
30001 This fixes the infinite loop on for initializers.
30003 2001-11-08 Miguel de Icaza <miguel@ximian.com>
30005 * enum.cs: More cleanup.
30007 * ecore.cs: Remove dead code.
30009 * class.cs (Property.Emit): More simplification.
30010 (Event.Emit): ditto.
30012 Reworked to have less levels of indentation.
30014 2001-11-08 Ravi Pratap <ravi@ximian.com>
30016 * class.cs (Property): Emit attributes.
30026 * enum.cs (Emit): Ditto.
30028 * rootcontext.cs (ResolveTree, EmitCode, CloseTypes): Do the same for
30031 * class.cs (Field, Event, etc.): Move attribute generation into the
30032 Emit method everywhere.
30034 * enum.cs (Enum): Revamp to use the same definition semantics as delegates so
30035 we have a DefineEnum, CloseEnum etc. The previous way of doing things was not right
30036 as we had no way of defining nested enums !
30038 * rootcontext.cs : Adjust code accordingly.
30040 * typemanager.cs (AddEnumType): To keep track of enum types separately.
30042 2001-11-07 Ravi Pratap <ravi@ximian.com>
30044 * expression.cs (EvalConstantExpression): Move into ecore.cs
30046 * enum.cs (Enum): Rename some members and make them public and readonly
30047 according to our convention.
30049 * modifiers.cs (EnumAttr): Implement as we need to set only visibility flags,
30052 * enum.cs (Enum::Define): Use the above instead of TypeAttr.
30054 (Enum::Emit): Write a simple version for now which doesn't try to compute
30055 expressions. I shall modify this to be more robust in just a while.
30057 * class.cs (TypeContainer::Emit): Make sure we include Enums too.
30059 (TypeContainer::CloseType): Create the Enum types too.
30061 * attribute.cs (Resolve): Use the new Reduce method instead of EvalConstantExpression.
30063 * expression.cs (EvalConstantExpression): Get rid of completely.
30065 * enum.cs (Enum::Emit): Use the new expression reducer. Implement assigning
30066 user-defined values and other cases.
30068 (IsValidEnumLiteral): Helper function.
30070 * expression.cs (ExprClassfromMemberInfo): Modify to not do any literalizing
30071 out there in the case we had a literal FieldExpr.
30073 (MemberAccess:DoResolve): Do the literalizing of the FieldExpr here.
30075 (Literalize): Revamp a bit to take two arguments.
30077 (EnumLiteral): New class which derives from Literal to wrap enum literals.
30079 2001-11-06 Ravi Pratap <ravi@ximian.com>
30081 * cs-parser.jay (compilation_unit): Remove extra opt_attributes for now.
30083 * expression.cs (ArrayCreation::ValidateInitializers): Implement.
30085 (Resolve): Use the above to ensure we have proper initializers.
30087 2001-11-05 Ravi Pratap <ravi@ximian.com>
30089 * expression.cs (Expression::EvalConstantExpression): New method to
30090 evaluate constant expressions.
30092 * attribute.cs (Attribute::Resolve): Modify bits to use the above function.
30094 2001-11-07 Miguel de Icaza <miguel@ximian.com>
30096 * expression.cs (ArrayCreation.Emit): Some bits to initialize data
30099 (Binary.ResolveOperator): Handle operator != (object a, object b)
30100 and operator == (object a, object b);
30102 (Binary.DoNumericPromotions): Indicate whether the numeric
30103 promotion was possible.
30105 (ArrayAccess.DoResolve, ArrayAccess.Emit, ArrayAccess.EmitAssign):
30108 Made the ArrayAccess implement interface IAssignMethod instead of
30109 IStackStore as the order in which arguments are passed reflects
30112 * assign.cs: Instead of using expr.ExprClass to select the way of
30113 assinging, probe for the IStackStore/IAssignMethod interfaces.
30115 * typemanager.cs: Load InitializeArray definition.
30117 * rootcontext.cs (RootContext.MakeStaticData): Used to define
30118 static data that can be used to initialize arrays.
30120 2001-11-05 Miguel de Icaza <miguel@ximian.com>
30122 * expression.cs: Handle operator== and operator!= for booleans.
30124 (Conditioal.Reduce): Implement reducer for the ?: operator.
30126 (Conditional.Resolve): Implement dead code elimination.
30128 (Binary.Resolve): Catch string literals and return a new
30129 concatenated string.
30131 (Unary.Reduce): Implement reduction of unary expressions.
30133 * ecore.cs: Split out the expression core handling here.
30135 (Expression.Reduce): New method used to perform constant folding
30136 and CSE. This is needed to support constant-expressions.
30138 * statement.cs (Statement.EmitBoolExpression): Pass true and false
30139 targets, and optimize for !x.
30141 2001-11-04 Ravi Pratap <ravi@ximian.com>
30143 * attribute.cs (Attribute::Resolve): Implement guts. Note that resolution
30144 of an attribute gives us a CustomAttributeBuilder which we use accordingly to
30145 set custom atttributes.
30147 * literal.cs (Literal::GetValue): New abstract method to return the actual
30148 value of the literal, cast as an object.
30150 (*Literal): Implement GetValue method.
30152 * cs-parser.jay (positional_argument_list, named_argument_list): Add not just plain
30153 expressions to the arraylist but objects of type Argument.
30155 * class.cs (TypeContainer::Emit): Emit our attributes too.
30157 (Method::Emit, Constructor::Emit): Ditto.
30159 * cs-parser.jay (constructor_declaration): Set attributes too, which we seemed
30160 to be ignoring earlier.
30162 2001-11-03 Ravi Pratap <ravi@ximian.com>
30164 * attribute.cs (AttributeSection::Define): Implement to do the business
30165 of constructing a CustomAttributeBuilder.
30167 (Attribute): New trivial class. Increases readability of code.
30169 * cs-parser.jay : Update accordingly.
30171 (positional_argument_list, named_argument_list, named_argument): New rules
30173 (attribute_arguments): Use the above so that we are more correct.
30175 2001-11-02 Ravi Pratap <ravi@ximian.com>
30177 * expression.cs (Invocation::IsParamsMethodApplicable): Implement
30178 to perform all checks for a method with a params parameter.
30180 (Invocation::OverloadResolve): Update to use the above method and therefore
30181 cope correctly with params method invocations.
30183 * support.cs (InternalParameters::ParameterDesc): Provide a desc for
30186 * class.cs (ConstructorInitializer::Resolve): Make sure we look for Non-public
30187 constructors in our parent too because we can't afford to miss out on
30190 * attribute.cs (AttributeSection): New name for the class Attribute
30192 Other trivial changes to improve readability.
30194 * cs-parser.jay (opt_attributes, attribute_section etc.): Modify to
30195 use the new class names.
30197 2001-11-01 Ravi Pratap <ravi@ximian.com>
30199 * class.cs (Method::Define): Complete definition for params types too
30201 (Indexer::Define): Ditto.
30203 * support.cs (InternalParameters::ParameterType, ParameterDesc, ParameterModifier):
30204 Cope everywhere with a request for info about the array parameter.
30206 2001-11-01 Ravi Pratap <ravi@ximian.com>
30208 * tree.cs (RecordNamespace): Fix up to check for the correct key.
30210 * cs-parser.jay (GetQualifiedIdentifier): New Helper method used in
30211 local_variable_type to extract the string corresponding to the type.
30213 (local_variable_type): Fixup the action to use the new helper method.
30215 * codegen.cs : Get rid of RefOrOutParameter, it's not the right way to
30218 * expression.cs : Clean out code which uses the above.
30220 2001-10-31 Ravi Pratap <ravi@ximian.com>
30222 * typemanager.cs (RegisterMethod): Check if we already have an existing key
30223 and bale out if necessary by returning a false.
30225 (RegisterProperty): Ditto.
30227 * class.cs (everywhere): Check the return value from TypeManager.RegisterMethod
30228 and print out appropriate error messages.
30230 * interface.cs (everywhere): Ditto.
30232 * cs-parser.jay (property_declaration, event_declaration, indexer_declaration): Pass
30233 location to constructor.
30235 * class.cs (Property, Event, Indexer): Update accordingly.
30237 * ../errors/cs111.cs : Added.
30239 * expression.cs (Invocation::IsApplicable): New static method to determine applicability
30240 of a method, as laid down by the spec.
30242 (Invocation::OverloadResolve): Use the above method.
30244 2001-10-31 Ravi Pratap <ravi@ximian.com>
30246 * support.cs (InternalParameters): Get rid of crap taking in duplicate info. We
30247 now take a TypeContainer and a Parameters object.
30249 (ParameterData): Modify return type of ParameterModifier method to be
30250 Parameter.Modifier and not a string.
30252 (ReflectionParameters, InternalParameters): Update accordingly.
30254 * expression.cs (Argument::GetParameterModifier): Same here.
30256 * support.cs (InternalParameters::ParameterType): Find a better way of determining
30257 if we are a ref/out parameter. Actually, the type shouldn't be holding the '&'
30258 symbol in it at all so maybe this is only for now.
30260 2001-10-30 Ravi Pratap <ravi@ximian.com>
30262 * support.cs (InternalParameters): Constructor now takes an extra argument
30263 which is the actual Parameters class.
30265 (ParameterDesc): Update to provide info on ref/out modifiers.
30267 * class.cs (everywhere): Update call to InternalParameters to pass in
30268 the second argument too.
30270 * support.cs (ParameterData): Add ParameterModifier, which is a method
30271 to return the modifier info [ref/out etc]
30273 (InternalParameters, ReflectionParameters): Implement the above.
30275 * expression.cs (Argument::ParameterModifier): Similar function to return
30276 info about the argument's modifiers.
30278 (Invocation::OverloadResolve): Update to take into account matching modifiers
30281 * class.cs (Indexer::Define): Actually define a Parameter object and put it onto
30282 a new SetFormalParameters object which we pass to InternalParameters.
30284 2001-10-30 Ravi Pratap <ravi@ximian.com>
30286 * expression.cs (NewArray): Merge into the ArrayCreation class.
30288 2001-10-29 Ravi Pratap <ravi@ximian.com>
30290 * expression.cs (NewArray): Merge classes NewBuiltinArray and
30291 NewUserdefinedArray into one as there wasn't much of a use in having
30294 * expression.cs (Argument): Change field's name to ArgType from Type.
30296 (Type): New readonly property which returns the proper type, taking into
30297 account ref/out modifiers.
30299 (everywhere): Adjust code accordingly for the above.
30301 * codegen.cs (EmitContext.RefOrOutParameter): New field to determine
30302 whether we are emitting for a ref or out parameter.
30304 * expression.cs (Argument::Emit): Use the above field to set the state.
30306 (LocalVariableReference::Emit): Update to honour the flag and emit the
30309 * parameter.cs (Attributes): Set the correct flags for ref parameters.
30311 * expression.cs (Argument::FullDesc): New function to provide a full desc.
30313 * support.cs (ParameterData): Add method ParameterDesc to the interface.
30315 (ReflectionParameters, InternalParameters): Implement the above method.
30317 * expression.cs (Invocation::OverloadResolve): Use the new desc methods in
30320 (Invocation::FullMethodDesc): Ditto.
30322 2001-10-29 Miguel de Icaza <miguel@ximian.com>
30324 * cs-parser.jay: Add extra production for the second form of array
30327 * expression.cs (ArrayCreation): Update to reflect the above
30330 * Small changes to prepare for Array initialization.
30332 2001-10-28 Miguel de Icaza <miguel@ximian.com>
30334 * typemanager.cs (ImplementsInterface): interface might be null;
30335 Deal with this problem;
30337 Also, we do store negative hits on the cache (null values), so use
30338 this instead of calling t.GetInterfaces on the type everytime.
30340 2001-10-28 Ravi Pratap <ravi@ximian.com>
30342 * typemanager.cs (IsBuiltinType): New method to help determine the same.
30344 * expression.cs (New::DoResolve): Get rid of array creation code and instead
30345 split functionality out into different classes.
30347 (New::FormArrayType): Move into NewBuiltinArray.
30349 (Invocation::EmitArguments): Get rid of the MethodBase argument. Appears
30352 (NewBuiltinArray): New class to handle creation of built-in arrays.
30354 (NewBuiltinArray::DoResolve): Implement guts of array creation. Also take into
30355 account creation of one-dimensional arrays.
30357 (::Emit): Implement to use Newarr and Newobj opcodes accordingly.
30359 (NewUserdefinedArray::DoResolve): Implement.
30361 * cs-parser.jay (local_variable_type): Fix up to add the rank to the variable too.
30363 * typemanager.cs (AddModule): Used to add a ModuleBuilder to the list of modules
30364 we maintain inside the TypeManager. This is necessary to perform lookups on the
30367 (LookupType): Update to perform GetType on the module builders too.
30369 * driver.cs (Driver): Add the ModuleBuilder to the list maintained by the TypeManager.
30371 * exprssion.cs (NewUserdefinedArray::Emit): Implement.
30373 2001-10-23 Ravi Pratap <ravi@ximian.com>
30375 * expression.cs (New::DoResolve): Implement guts of array creation.
30377 (New::FormLookupType): Rename to FormArrayType and modify ever so slightly.
30379 2001-10-27 Miguel de Icaza <miguel@ximian.com>
30381 * expression.cs: Fix bug I introduced lsat night that broke
30384 (Expression.Resolve): Report a 246 error (can not resolve name)
30385 if we find a SimpleName in the stream.
30387 (Expression.ResolveLValue): Ditto.
30389 (Expression.ResolveWithSimpleName): This function is a variant of
30390 ResolveName, this one allows SimpleNames to be returned without a
30391 warning. The only consumer of SimpleNames is MemberAccess
30393 2001-10-26 Miguel de Icaza <miguel@ximian.com>
30395 * expression.cs (Invocation::DoResolve): Catch SimpleNames that
30396 might arrive here. I have my doubts that this is correct.
30398 * statement.cs (Lock): Implement lock statement.
30400 * cs-parser.jay: Small fixes to support `lock' and `using'
30402 * cs-tokenizer.cs: Remove extra space
30404 * driver.cs: New flag --checked, allows to turn on integer math
30407 * typemanger.cs: Load methodinfos for Threading.Monitor.Enter and
30408 Threading.Monitor.Exit
30410 2001-10-23 Miguel de Icaza <miguel@ximian.com>
30412 * expression.cs (IndexerAccess::DoResolveLValue): Set the
30413 Expression Class to be IndexerAccess.
30415 Notice that Indexer::DoResolve sets the eclass to Value.
30417 2001-10-22 Miguel de Icaza <miguel@ximian.com>
30419 * class.cs (TypeContainer::Emit): Emit code for indexers.
30421 * assign.cs (IAssignMethod): New interface implemented by Indexers
30422 and Properties for handling assignment.
30424 (Assign::Emit): Simplify and reuse code.
30426 * expression.cs (IndexerAccess, PropertyExpr): Implement
30427 IAssignMethod, clean up old code.
30429 2001-10-22 Ravi Pratap <ravi@ximian.com>
30431 * typemanager.cs (ImplementsInterface): New method to determine if a type
30432 implements a given interface. Provides a nice cache too.
30434 * expression.cs (ImplicitReferenceConversion): Update checks to use the above
30437 (ConvertReferenceExplicit): Ditto.
30439 * delegate.cs (Delegate::Populate): Update to define the parameters on the
30440 various methods, with correct names etc.
30442 * class.cs (Operator::OpType): New members Operator.UnaryPlus and
30443 Operator.UnaryNegation.
30445 * cs-parser.jay (operator_declarator): Be a little clever in the case where
30446 we have a unary plus or minus operator.
30448 * expression.cs (Unary): Rename memebers of Operator enum to UnaryPlus and
30451 * everywhere : update accordingly.
30453 * everywhere : Change Negate and BitComplement to LogicalNot and OnesComplement
30456 * class.cs (Method::Define): For the case where we are implementing a method
30457 inherited from an interface, we need to set the MethodAttributes.Final flag too.
30458 Also set MethodAttributes.NewSlot and MethodAttributes.HideBySig.
30460 2001-10-21 Ravi Pratap <ravi@ximian.com>
30462 * interface.cs (FindMembers): Implement to work around S.R.E
30465 * typemanager.cs (IsInterfaceType): Implement.
30467 (FindMembers): Update to handle interface types too.
30469 * expression.cs (ImplicitReferenceConversion): Re-write bits which
30470 use IsAssignableFrom as that is not correct - it doesn't work.
30472 * delegate.cs (DelegateInvocation): Derive from ExpressionStatement
30473 and accordingly override EmitStatement.
30475 * expression.cs (ConvertReferenceExplicit): Re-write similary, this time
30476 using the correct logic :-)
30478 2001-10-19 Ravi Pratap <ravi@ximian.com>
30480 * ../errors/cs-11.cs : Add to demonstrate error -11
30482 2001-10-17 Miguel de Icaza <miguel@ximian.com>
30484 * assign.cs (Assign::Resolve): Resolve right hand side first, and
30485 then pass this as a hint to ResolveLValue.
30487 * expression.cs (FieldExpr): Add Location information
30489 (FieldExpr::LValueResolve): Report assignment to readonly
30492 (Expression::ExprClassFromMemberInfo): Pass location information.
30494 (Expression::ResolveLValue): Add new method that resolves an
30497 (Expression::DoResolveLValue): Default invocation calls
30500 (Indexers): New class used to keep track of indexers in a given
30503 (IStackStore): Renamed from LValue, as it did not really describe
30504 what this did. Also ResolveLValue is gone from this interface and
30505 now is part of Expression.
30507 (ElementAccess): Depending on the element access type
30509 * typemanager.cs: Add `indexer_name_type' as a Core type
30510 (System.Runtime.CompilerServices.IndexerNameAttribute)
30512 * statement.cs (Goto): Take a location.
30514 2001-10-18 Ravi Pratap <ravi@ximian.com>
30516 * delegate.cs (Delegate::VerifyDelegate): New method to verify
30517 if two delegates are compatible.
30519 (NewDelegate::DoResolve): Update to take care of the case when
30520 we instantiate a delegate from another delegate.
30522 * typemanager.cs (FindMembers): Don't even try to look up members
30523 of Delegate types for now.
30525 2001-10-18 Ravi Pratap <ravi@ximian.com>
30527 * delegate.cs (NewDelegate): New class to take care of delegate
30530 * expression.cs (New): Split the delegate related code out into
30531 the NewDelegate class.
30533 * delegate.cs (DelegateInvocation): New class to handle delegate
30536 * expression.cs (Invocation): Split out delegate related code into
30537 the DelegateInvocation class.
30539 2001-10-17 Ravi Pratap <ravi@ximian.com>
30541 * expression.cs (New::DoResolve): Implement delegate creation fully
30542 and according to the spec.
30544 (New::DoEmit): Update to handle delegates differently.
30546 (Invocation::FullMethodDesc): Fix major stupid bug thanks to me
30547 because of which we were printing out arguments in reverse order !
30549 * delegate.cs (VerifyMethod): Implement to check if the given method
30550 matches the delegate.
30552 (FullDelegateDesc): Implement.
30554 (VerifyApplicability): Implement.
30556 * expression.cs (Invocation::DoResolve): Update to accordingly handle
30557 delegate invocations too.
30559 (Invocation::Emit): Ditto.
30561 * ../errors/cs1593.cs : Added.
30563 * ../errors/cs1594.cs : Added.
30565 * delegate.cs (InstanceExpression, TargetMethod): New properties.
30567 2001-10-16 Ravi Pratap <ravi@ximian.com>
30569 * typemanager.cs (intptr_type): Core type for System.IntPtr
30571 (InitCoreTypes): Update for the same.
30573 (iasyncresult_type, asynccallback_type): Ditto.
30575 * delegate.cs (Populate): Fix to use System.Intptr as it is indeed
30578 * typemanager.cs (AddDelegateType): Store a pointer to the Delegate class
30581 * delegate.cs (ConstructorBuilder, InvokeBuilder, ...): New members to hold
30582 the builders for the 4 members of a delegate type :-)
30584 (Populate): Define the BeginInvoke and EndInvoke methods on the delegate
30587 * expression.cs (New::DoResolve): Implement guts for delegate creation.
30589 * ../errors/errors.txt : Update for an error (-11) which only we catch :-)
30591 2001-10-15 Miguel de Icaza <miguel@ximian.com>
30593 * statement.cs (Break::Emit): Implement.
30594 (Continue::Emit): Implement.
30596 (For::Emit): Track old being/end loops; Set Begin loop, ack end loop
30597 (While::Emit): Track old being/end loops; Set Begin loop, ack end loop
30598 (Do::Emit): Track old being/end loops; Set Begin loop, ack end loop
30599 (Foreach::Emit): Track old being/end loops; Set Begin loop, ack
30602 * codegen.cs (EmitContext::LoopEnd, EmitContext::LoopBegin): New
30603 properties that track the label for the current loop (begin of the
30604 loop and end of the loop).
30606 2001-10-15 Ravi Pratap <ravi@ximian.com>
30608 * delegate.cs (Emit): Get rid of it as there doesn't seem to be any ostensible
30609 use of emitting anything at all.
30611 * class.cs, rootcontext.cs : Get rid of calls to the same.
30613 * delegate.cs (DefineDelegate): Make sure the class we define is also sealed.
30615 (Populate): Define the constructor correctly and set the implementation
30618 * typemanager.cs (delegate_types): New hashtable to hold delegates that
30621 (AddDelegateType): Implement.
30623 (IsDelegateType): Implement helper method.
30625 * delegate.cs (DefineDelegate): Use AddDelegateType instead of AddUserType.
30627 * expression.cs (New::DoResolve): Check if we are trying to instantiate a delegate type
30628 and accordingly handle it.
30630 * delegate.cs (Populate): Take TypeContainer argument.
30631 Implement bits to define the Invoke method. However, I still haven't figured out
30632 how to take care of the native int bit :-(
30634 * cs-parser.jay (delegate_declaration): Fixed the bug that I had introduced :-)
30635 Qualify the name of the delegate, not its return type !
30637 * expression.cs (ImplicitReferenceConversion): Implement guts of implicit array
30640 (StandardConversionExists): Checking for array types turns out to be recursive.
30642 (ConvertReferenceExplicit): Implement array conversion.
30644 (ExplicitReferenceConversionExists): New method to determine precisely that :-)
30646 2001-10-12 Ravi Pratap <ravi@ximian.com>
30648 * cs-parser.jay (delegate_declaration): Store the fully qualified
30649 name as it is a type declaration.
30651 * delegate.cs (ReturnType, Name): Rename members to these. Make them
30654 (DefineDelegate): Renamed from Define. Does the same thing essentially,
30655 as TypeContainer::DefineType.
30657 (Populate): Method in which all the definition of the various methods (Invoke)
30660 (Emit): Emit any code, if necessary. I am not sure about this really, but let's
30663 (CloseDelegate): Finally creates the delegate.
30665 * class.cs (TypeContainer::DefineType): Update to define delegates.
30666 (Populate, Emit and CloseType): Do the same thing here too.
30668 * rootcontext.cs (ResolveTree, PopulateTypes, EmitCode, CloseTypes): Include
30669 delegates in all these operations.
30671 2001-10-14 Miguel de Icaza <miguel@ximian.com>
30673 * expression.cs: LocalTemporary: a new expression used to
30674 reference a temporary that has been created.
30676 * assign.cs: Handle PropertyAccess back here, so that we can
30677 provide the proper semantic access to properties.
30679 * expression.cs (Expression::ConvertReferenceExplicit): Implement
30680 a few more explicit conversions.
30682 * modifiers.cs: `NEW' modifier maps to HideBySig.
30684 * expression.cs (PropertyExpr): Make this into an
30685 ExpressionStatement, and support the EmitStatement code path.
30687 Perform get/set error checking, clean up the interface.
30689 * assign.cs: recognize PropertyExprs as targets, and if so, turn
30690 them into toplevel access objects.
30692 2001-10-12 Miguel de Icaza <miguel@ximian.com>
30694 * expression.cs: PropertyExpr::PropertyExpr: use work around the
30697 * typemanager.cs: Keep track here of our PropertyBuilders again to
30698 work around lameness in SRE.
30700 2001-10-11 Miguel de Icaza <miguel@ximian.com>
30702 * expression.cs (LValue::LValueResolve): New method in the
30703 interface, used to perform a second resolution pass for LValues.
30705 (This::DoResolve): Catch the use of this in static methods.
30707 (This::LValueResolve): Implement.
30709 (This::Store): Remove warning, assigning to `this' in structures
30712 (Invocation::Emit): Deal with invocation of
30713 methods on value types. We need to pass the address to structure
30714 methods rather than the object itself. (The equivalent code to
30715 emit "this" for structures leaves the entire structure on the
30716 stack instead of a pointer to it).
30718 (ParameterReference::DoResolve): Compute the real index for the
30719 argument based on whether the method takes or not a `this' pointer
30720 (ie, the method is static).
30722 * codegen.cs (EmitContext::GetTemporaryStorage): Used to store
30723 value types returned from functions when we need to invoke a
30724 method on the sturcture.
30727 2001-10-11 Ravi Pratap <ravi@ximian.com>
30729 * class.cs (TypeContainer::DefineType): Method to actually do the business of
30730 defining the type in the Modulebuilder or Typebuilder. This is to take
30731 care of nested types which need to be defined on the TypeBuilder using
30732 DefineNestedMethod.
30734 (TypeContainer::GetClassBases): Implement. Essentially the code from the
30735 methods in RootContext, only ported to be part of TypeContainer.
30737 (TypeContainer::GetInterfaceOrClass): Ditto.
30739 (TypeContainer::LookupInterfaceOrClass, ::MakeFQN): Ditto.
30741 * interface.cs (Interface::DefineInterface): New method. Does exactly
30742 what RootContext.CreateInterface did earlier, only it takes care of nested types
30745 (Interface::GetInterfaces): Move from RootContext here and port.
30747 (Interface::GetInterfaceByName): Same here.
30749 * rootcontext.cs (ResolveTree): Re-write.
30751 (PopulateTypes): Re-write.
30753 * class.cs (TypeContainer::Populate): Populate nested types too.
30754 (TypeContainer::Emit): Emit nested members too.
30756 * typemanager.cs (AddUserType): Do not make use of the FullName property,
30757 instead just use the name argument passed in as it is already fully
30760 (FindMembers): Check in the Builders to TypeContainer mapping instead of the name
30761 to TypeContainer mapping to see if a type is user-defined.
30763 * class.cs (TypeContainer::CloseType): Implement.
30765 (TypeContainer::DefineDefaultConstructor): Use Basename, not Name while creating
30766 the default constructor.
30768 (TypeContainer::Populate): Fix minor bug which led to creating default constructors
30771 (Constructor::IsDefault): Fix up logic to determine if it is the default constructor
30773 * interface.cs (CloseType): Create the type here.
30775 * rootcontext.cs (CloseTypes): Re-write to recursively close types by running through
30778 Remove all the methods which are now in TypeContainer.
30780 2001-10-10 Ravi Pratap <ravi@ximian.com>
30782 * delegate.cs (Define): Re-write bits to define the delegate
30785 2001-10-10 Miguel de Icaza <miguel@ximian.com>
30787 * makefile: Renamed the compiler to `mcs.exe' instead of compiler.exe
30789 * expression.cs (ImplicitReferenceConversion): handle null as well
30790 as a source to convert to any reference type.
30792 * statement.cs (Return): Perform any implicit conversions to
30793 expected return type.
30795 Validate use of return statement.
30797 * codegen.cs (EmitContext): Pass the expected return type here.
30799 * class.cs (Method, Constructor, Property): Pass expected return
30800 type to EmitContext.
30802 2001-10-09 Miguel de Icaza <miguel@ximian.com>
30804 * expression.cs: Make DoResolve take an EmitContext instead of a
30807 Replaced `l' and `location' for `loc', for consistency.
30809 (Error, Warning): Remove unneeded Tc argument.
30811 * assign.cs, literal.cs, constant.cs: Update to new calling
30814 * codegen.cs: EmitContext now contains a flag indicating whether
30815 code is being generated in a static method or not.
30817 * cs-parser.jay: DecomposeQI, new function that replaces the old
30818 QualifiedIdentifier. Now we always decompose the assembled
30819 strings from qualified_identifier productions into a group of
30822 2001-10-08 Miguel de Icaza <miguel@ximian.com>
30824 * rootcontext.cs: Deal with field-less struct types correctly now
30825 by passing the size option to Define Type.
30827 * class.cs: Removed hack that created one static field.
30829 2001-10-07 Miguel de Icaza <miguel@ximian.com>
30831 * statement.cs: Moved most of the code generation here.
30833 2001-10-09 Ravi Pratap <ravi@ximian.com>
30835 * expression.cs (New::DoResolve): Revert changes for array creation, doesn't
30838 (ElementAccess): Remove useless bits for now - keep checks as the spec
30841 2001-10-08 Ravi Pratap <ravi@ximian.com>
30843 * expression.cs (ElementAccess::DoResolve): Remove my crap code
30844 and start performing checks according to the spec.
30846 2001-10-07 Ravi Pratap <ravi@ximian.com>
30848 * cs-parser.jay (type_suffix*): Remove - they are redundant. Use
30849 rank_specifiers instead.
30851 (rank_specifiers): Change the order in which the rank specifiers are stored
30853 (local_variable_declaration): Use opt_rank_specifier instead of type_suffixes.
30855 * expression.cs (ElementAccess): Implement the LValue interface too.
30857 2001-10-06 Ravi Pratap <ravi@ximian.com>
30859 * expression.cs (ConvertExplicitStandard): Add. Same as ConvertExplicit
30860 except that user defined conversions are not included.
30862 (UserDefinedConversion): Update to use the ConvertExplicitStandard to
30863 perform the conversion of the return type, if necessary.
30865 (New::DoResolve): Check whether we are creating an array or an object
30866 and accordingly do the needful.
30868 (New::Emit): Same here.
30870 (New::DoResolve): Implement guts of array creation.
30872 (New::FormLookupType): Helper function.
30874 2001-10-07 Miguel de Icaza <miguel@ximian.com>
30876 * codegen.cs: Removed most of the code generation here, and move the
30877 corresponding code generation bits to the statement classes.
30879 Added support for try/catch/finalize and throw.
30881 * cs-parser.jay: Added support for try/catch/finalize.
30883 * class.cs: Catch static methods having the flags override,
30884 virtual or abstract.
30886 * expression.cs (UserCast): This user cast was not really doing
30887 what it was supposed to do. Which is to be born in fully resolved
30888 state. Parts of the resolution were being performed at Emit time!
30892 2001-10-05 Miguel de Icaza <miguel@ximian.com>
30894 * expression.cs: Implicity convert the result from UserCast.
30896 2001-10-05 Ravi Pratap <ravi@ximian.com>
30898 * expression.cs (Expression::FindMostEncompassingType): Fix bug which
30899 prevented it from working correctly.
30901 (ConvertExplicit): Make the first try, a call to ConvertImplicitStandard, not
30902 merely ConvertImplicit.
30904 2001-10-05 Miguel de Icaza <miguel@ximian.com>
30906 * typemanager.cs: Make the LookupTypeContainer function static,
30907 and not per-instance.
30909 * class.cs: Make static FindMembers (the one that takes a Type
30912 * codegen.cs: Add EmitForeach here.
30914 * cs-parser.jay: Make foreach a toplevel object instead of the
30915 inline expansion, as we need to perform semantic analysis on it.
30917 2001-10-05 Ravi Pratap <ravi@ximian.com>
30919 * expression.cs (Expression::ImplicitUserConversion): Rename to
30920 UserDefinedConversion.
30922 (Expression::UserDefinedConversion): Take an extra argument specifying
30923 whether we look for explicit user conversions too.
30925 (Expression::ImplicitUserConversion): Make it a call to UserDefinedConversion.
30927 (UserDefinedConversion): Incorporate support for user defined explicit conversions.
30929 (ExplicitUserConversion): Make it a call to UserDefinedConversion
30930 with the appropriate arguments.
30932 * cs-parser.jay (cast_expression): Record location too.
30934 * expression.cs (Cast): Record location info.
30936 (Expression::ConvertExplicit): Take location argument.
30938 (UserImplicitCast): Change name to UserCast. Take an extra constructor argument
30939 to determine if we are doing explicit conversions.
30941 (UserCast::Emit): Update accordingly.
30943 (Expression::ConvertExplicit): Report an error if everything fails.
30945 * ../errors/cs0030.cs : Add.
30947 2001-10-04 Miguel de Icaza <miguel@ximian.com>
30949 * modifiers.cs: If the ABSTRACT keyword is present, also set the
30950 virtual and newslot bits.
30952 * class.cs (TypeContainer::RegisterRequiredImplementations):
30953 Record methods we need.
30955 (TypeContainer::MakeKey): Helper function to make keys for
30956 MethodBases, since the Methodbase key is useless.
30958 (TypeContainer::Populate): Call RegisterRequiredImplementations
30959 before defining the methods.
30961 Create a mapping for method_builders_to_methods ahead of time
30962 instead of inside a tight loop.
30964 (::RequireMethods): Accept an object as the data to set into the
30965 hashtable so we can report interface vs abstract method mismatch.
30967 2001-10-03 Miguel de Icaza <miguel@ximian.com>
30969 * report.cs: Make all of it static.
30971 * rootcontext.cs: Drop object_type and value_type computations, as
30972 we have those in the TypeManager anyways.
30974 Drop report instance variable too, now it is a global.
30976 * driver.cs: Use try/catch on command line handling.
30978 Add --probe option to debug the error reporting system with a test
30981 * report.cs: Add support for exiting program when a probe
30982 condition is reached.
30984 2001-10-03 Ravi Pratap <ravi@ximian.com>
30986 * expression.cs (Binary::DoNumericPromotions): Fix the case when
30987 we do a forcible conversion regardless of type, to check if
30988 ForceConversion returns a null.
30990 (Binary::error19): Use location to report error.
30992 (Unary::error23): Use location here too.
30994 * ../errors/cs0019.cs : Check in.
30996 * ../errors/cs0023.cs : Check in.
30998 * expression.cs (Expression.MemberLookup): Return null for a rather esoteric
30999 case of a non-null MethodInfo object with a length of 0 !
31001 (Binary::ResolveOperator): Flag error if overload resolution fails to find
31002 an applicable member - according to the spec :-)
31003 Also fix logic to find members in base types.
31005 (Unary::ResolveOperator): Same here.
31007 (Unary::report23): Change name to error23 and make first argument a TypeContainer
31008 as I was getting thoroughly confused between this and error19 :-)
31010 * expression.cs (Expression::ImplicitUserConversion): Re-write fully
31011 (::FindMostEncompassedType): Implement.
31012 (::FindMostEncompassingType): Implement.
31013 (::StandardConversionExists): Implement.
31015 (UserImplicitCast): Re-vamp. We now need info about most specific
31016 source and target types so that we can do the necessary conversions.
31018 (Invocation::MakeUnionSet): Completely re-write to make sure we form a proper
31019 mathematical union with no duplicates.
31021 2001-10-03 Miguel de Icaza <miguel@ximian.com>
31023 * rootcontext.cs (RootContext::PopulateTypes): Populate containers
31024 in order from base classes to child classes, so that we can in
31025 child classes look up in our parent for method names and
31026 attributes (required for handling abstract, virtual, new, override
31027 constructs: we need to instrospect our base class, and if we dont
31028 populate the classes in order, the introspection might be
31029 incorrect. For example, a method could query its parent before
31030 the parent has any methods and would determine that the parent has
31031 no abstract methods (while it could have had them)).
31033 (RootContext::CreateType): Record the order in which we define the
31036 2001-10-02 Miguel de Icaza <miguel@ximian.com>
31038 * class.cs (TypeContainer::Populate): Also method definitions can
31039 fail now, keep track of this.
31041 (TypeContainer::FindMembers): Implement support for
31042 DeclaredOnly/noDeclaredOnly flag.
31044 (Constructor::Emit) Return the ConstructorBuilder.
31046 (Method::Emit) Return the MethodBuilder.
31047 Check for abstract or virtual methods to be public.
31049 * rootcontext.cs (RootContext::CreateType): Register all the
31050 abstract methods required for the class to be complete and the
31051 interface methods that must be implemented.
31053 * cs-parser.jay: Report error 501 (method requires body if it is
31054 not marked abstract or extern).
31056 * expression.cs (TypeOf::Emit): Implement.
31058 * typemanager.cs: runtime_handle_type, new global type.
31060 * class.cs (Property::Emit): Generate code for properties.
31062 2001-10-02 Ravi Pratap <ravi@ximian.com>
31064 * expression.cs (Unary::ResolveOperator): Find operators on base type
31065 too - we now conform exactly to the spec.
31067 (Binary::ResolveOperator): Same here.
31069 * class.cs (Operator::Define): Fix minor quirk in the tests.
31071 * ../errors/cs0215.cs : Added.
31073 * ../errors/cs0556.cs : Added.
31075 * ../errors/cs0555.cs : Added.
31077 2001-10-01 Miguel de Icaza <miguel@ximian.com>
31079 * cs-tokenizer.cs: Reimplemented Location to be a struct with a
31080 single integer which is really efficient
31082 2001-10-01 Ravi Pratap <ravi@ximian.com>
31084 * expression.cs (Expression::ImplicitUserConversion): Use location
31085 even in the case when we are examining True operators.
31087 * class.cs (Operator::Define): Perform extensive checks to conform
31088 with the rules for operator overloading in the spec.
31090 * expression.cs (Expression::ImplicitReferenceConversion): Implement
31091 some of the other conversions mentioned in the spec.
31093 * typemanager.cs (array_type): New static member for the System.Array built-in
31096 (cloneable_interface): For System.ICloneable interface.
31098 * driver.cs (Driver::Driver): Initialize TypeManager's core types even before
31099 we start resolving the tree and populating types.
31101 * ../errors/errors.txt : Update for error numbers -7, -8, -9, -10
31103 2001-10-01 Miguel de Icaza <miguel@ximian.com>
31105 * expression.cs (Expression::ExprClassFromMemberInfo,
31106 Expression::Literalize): Create literal expressions from
31107 FieldInfos which are literals.
31109 (ConvertNumericExplicit, ImplicitNumericConversion): Fix a few
31110 type casts, because they were wrong. The test suite in tests
31113 (ImplicitNumericConversion): ushort to ulong requires a widening
31116 Int32 constant to long requires widening cast as well.
31118 * literal.cs (LongLiteral::EmitLong): Do not generate i4 constants
31119 for integers because the type on the stack is not i4.
31121 2001-09-30 Miguel de Icaza <miguel@ximian.com>
31123 * expression.cs (report118): require location argument.
31125 * parameter.cs: Do not dereference potential null value.
31127 * class.cs: Catch methods that lack the `new' keyword when
31128 overriding a name. Report warnings when `new' is used without
31129 anything being there to override.
31131 * modifiers.cs: Handle `NEW' as MethodAttributes.NewSlot.
31133 * class.cs: Only add constructor to hashtable if it is non-null
31134 (as now constructors can fail on define).
31136 (TypeManager, Class, Struct): Take location arguments.
31138 Catch field instance initialization in structs as errors.
31140 accepting_filter: a new filter for FindMembers that is static so
31141 that we dont create an instance per invocation.
31143 (Constructor::Define): Catch errors where a struct constructor is
31146 * cs-parser.jay: Pass location information for various new
31149 * delegate.cs (Delegate): take a location argument.
31151 * driver.cs: Do not call EmitCode if there were problesm in the
31152 Definition of the types, as many Builders wont be there.
31154 * decl.cs (Decl::Decl): Require a location argument.
31156 * cs-tokenizer.cs: Handle properly hex constants that can not fit
31157 into integers, and find the most appropiate integer for it.
31159 * literal.cs: Implement ULongLiteral.
31161 * rootcontext.cs: Provide better information about the location of
31162 failure when CreateType fails.
31164 2001-09-29 Miguel de Icaza <miguel@ximian.com>
31166 * rootcontext.cs (RootContext::PopulateTypes): Populates structs
31169 * expression.cs (Binary::CheckShiftArguments): Add missing type
31171 (Binary::ResolveOperator): Add type to the logical and and logical
31172 or, Bitwise And/Or and Exclusive Or code paths, it was missing
31175 (Binary::DoNumericPromotions): In the case where either argument
31176 is ulong (and most signed types combined with ulong cause an
31177 error) perform implicit integer constant conversions as well.
31179 2001-09-28 Miguel de Icaza <miguel@ximian.com>
31181 * expression.cs (UserImplicitCast): Method should always be
31183 (Invocation::BetterConversion): Simplified test for IntLiteral.
31185 (Expression::ImplicitNumericConversion): Split this routine out.
31186 Put the code that performs implicit constant integer conversions
31189 (Expression::Resolve): Become a wrapper around DoResolve so we can
31190 check eclass and type being set after resolve.
31192 (Invocation::Badness): Remove this dead function
31194 (Binary::ResolveOperator): Do not compute the expensive argumnets
31195 unless we have a union for it.
31197 (Probe::Emit): Is needs to do an isinst and then
31198 compare against null.
31200 (::CanConvert): Added Location argument. If the Location argument
31201 is null (Location.Null), then we do not report errors. This is
31202 used by the `probe' mechanism of the Explicit conversion. We do
31203 not want to generate an error for something that the user
31204 explicitly requested to be casted. But the pipeline for an
31205 explicit cast first tests for potential implicit casts.
31207 So for now, if the Location is null, it means `Probe only' to
31208 avoid adding another argument. Might have to revise this
31211 (ClassCast): New class used to type cast objects into arbitrary
31212 classes (used in Explicit Reference Conversions).
31214 Implement `as' as well.
31216 Reverted all the patches from Ravi below: they were broken:
31218 * The use of `level' as a mechanism to stop recursive
31219 invocations is wrong. That was there just to catch the
31220 bug with a strack trace but not as a way of addressing
31223 To fix the problem we have to *understand* what is going
31224 on and the interactions and come up with a plan, not
31225 just get things going.
31227 * The use of the type conversion cache that I proposed
31228 last night had an open topic: How does this work across
31229 protection domains. A user defined conversion might not
31230 be public in the location where we are applying the
31231 conversion, a different conversion might be selected
31232 (ie, private A->B (better) but public B->A (worse),
31233 inside A, A->B applies, but outside it, B->A will
31236 * On top of that (ie, even if the above is solved),
31237 conversions in a cache need to be abstract. Ie, `To
31238 convert from an Int to a Short use an OpcodeCast', not
31239 `To convert from an Int to a Short use the OpcodeCast on
31240 the variable 5' (which is what this patch was doing).
31242 2001-09-28 Ravi Pratap <ravi@ximian.com>
31244 * expression.cs (Invocation::ConversionExists): Re-write to use
31245 the conversion cache
31247 (Expression::ConvertImplicit): Automatic bailing out if level != 0. Also
31248 cache all conversions done, not just user-defined ones.
31250 (Invocation::BetterConversion): The real culprit. Use ConversionExists
31251 to determine if a conversion exists instead of acutually trying to
31252 perform the conversion. It's faster too.
31254 (Expression::ConvertExplicit): Modify to use ConversionExists to check
31255 and only then attempt the implicit conversion.
31257 2001-09-28 Ravi Pratap <ravi@ximian.com>
31259 * expression.cs (ConvertImplicit): Use a cache for conversions
31260 already found. Check level of recursion and bail out if necessary.
31262 2001-09-28 Miguel de Icaza <miguel@ximian.com>
31264 * typemanager.cs (string_concat_string_string, string_concat_object_object):
31265 Export standard methods that we expect for string operations.
31267 * statement.cs (Block::UsageWarning): Track usage of variables and
31268 report the errors for not used variables.
31270 * expression.cs (Conditional::Resolve, ::Emit): Implement ?:
31273 2001-09-27 Miguel de Icaza <miguel@ximian.com>
31275 * codegen.cs: remove unnneded code
31277 * expression.cs: Removed BuiltinTypeAccess class
31279 Fix the order in which implicit conversions are
31282 The previous fixed dropped support for boxed conversions (adding a
31283 test to the test suite now)
31285 (UserImplicitCast::CanConvert): Remove test for source being null,
31286 that code is broken. We should not feed a null to begin with, if
31287 we do, then we should track the bug where the problem originates
31288 and not try to cover it up here.
31290 Return a resolved expression of type UserImplicitCast on success
31291 rather than true/false. Ravi: this is what I was talking about,
31292 the pattern is to use a static method as a "constructor" for
31295 Also, do not create arguments until the very last minute,
31296 otherwise we always create the arguments even for lookups that
31297 will never be performed.
31299 (UserImplicitCast::Resolve): Eliminate, objects of type
31300 UserImplicitCast are born in a fully resolved state.
31302 * typemanager.cs (InitCoreTypes): Init also value_type
31303 (System.ValueType).
31305 * expression.cs (Cast::Resolve): First resolve the child expression.
31307 (LValue): Add new method AddressOf to be used by
31310 Change the argument of Store to take an EmitContext instead of an
31311 ILGenerator, because things like FieldExpr need to be able to call
31312 their children expression to generate the instance code.
31314 (Expression::Error, Expression::Warning): Sugar functions for
31317 (Expression::MemberLookup): Accept a TypeContainer instead of a
31318 Report as the first argument.
31320 (Expression::ResolvePrimary): Killed. I still want to improve
31321 this as currently the code is just not right.
31323 (Expression::ResolveMemberAccess): Simplify, but it is still
31326 (Unary::Resolve): Catch errors in AddressOf operators.
31328 (LocalVariableReference::Emit, ::Store, ::AddressOf): typecast
31329 index to a byte for the short-version, or the compiler will choose
31330 the wrong Emit call, which generates the wrong data.
31332 (ParameterReference::Emit, ::Store): same.
31334 (FieldExpr::AddressOf): Implement.
31336 * typemanager.cs: TypeManager: made public variable instead of
31339 * driver.cs: document --fatal.
31341 * report.cs (ErrorMessage, WarningMessage): new names for the old
31342 Error and Warning classes.
31344 * cs-parser.jay (member_access): Turn built-in access to types
31345 into a normal simplename
31347 2001-09-27 Ravi Pratap <ravi@ximian.com>
31349 * expression.cs (Invocation::BetterConversion): Fix to cope
31350 with q being null, since this was introducing a bug.
31352 * expression.cs (ConvertImplicit): Do built-in conversions first.
31354 2001-09-27 Ravi Pratap <ravi@ximian.com>
31356 * expression.cs (UserImplicitCast::Resolve): Fix bug.
31358 2001-09-27 Ravi Pratap <ravi@ximian.com>
31360 * class.cs (TypeContainer::AddConstructor): Fix a stupid bug
31361 I had introduced long ago (what's new ?).
31363 * expression.cs (UserImplicitCast::CanConvert): Static method to do
31364 the work of all the checking.
31365 (ConvertImplicit): Call CanConvert and only then create object if necessary.
31366 (UserImplicitCast::CanConvert, ::Resolve): Re-write.
31368 (Unary::Operator): Rename Add and Subtract to Addition and Subtraction because
31369 that is the right way.
31371 (Invocation::MakeUnionSet): Convenience function to make unions of sets for
31372 overloading resolution. Use everywhere instead of cutting and pasting code.
31374 (Binary::ResolveOperator): Use MakeUnionSet.
31376 (UserImplicitCast::CanConvert, ::Resolve): Update to take care of the case when
31377 we have to convert to bool types. Not complete yet.
31379 2001-09-27 Miguel de Icaza <miguel@ximian.com>
31381 * typemanager.cs (TypeManager::CSharpName): support ushort.
31383 * expression.cs (Expression::TryImplicitIntConversion): Attempts
31384 to provide an expression that performsn an implicit constant int
31385 conversion (section 6.1.6).
31386 (Expression::ConvertImplicitRequired): Reworked to include
31387 implicit constant expression conversions.
31389 (Expression::ConvertNumericExplicit): Finished.
31391 (Invocation::Emit): If InstanceExpression is null, then it means
31392 that we perform a call on this.
31394 2001-09-26 Miguel de Icaza <miguel@ximian.com>
31396 * expression.cs (Unary::Emit): Remove some dead code.
31397 (Probe): Implement Resolve and Emit for `is'.
31398 (Expression::ConvertImplicitRequired): Attempt to do constant
31399 expression conversions here. Maybe should be moved to
31400 ConvertImplicit, but I am not sure.
31401 (Expression::ImplicitLongConstantConversionPossible,
31402 Expression::ImplicitIntConstantConversionPossible): New functions
31403 that tell whether is it possible to apply an implicit constant
31404 expression conversion.
31406 (ConvertNumericExplicit): Started work on explicit numeric
31409 * cs-parser.jay: Update operator constants.
31411 * parameter.cs (Parameters::GetParameterInfo): Hook up VerifyArgs
31412 (Parameters::GetSignature): Hook up VerifyArgs here.
31413 (Parameters::VerifyArgs): Verifies that no two arguments have the
31416 * class.cs (Operator): Update the operator names to reflect the
31417 ones that the spec expects (as we are just stringizing the
31420 * expression.cs (Unary::ResolveOperator): Fix bug: Use
31421 MethodInfo's ReturnType instead of LookupMethodByBuilder as the
31422 previous usage did only work for our methods.
31423 (Expression::ConvertImplicit): Handle decimal implicit numeric
31424 conversions as well.
31425 (Expression::InternalTypeConstructor): Used to invoke constructors
31426 on internal types for default promotions.
31428 (Unary::Emit): Implement special handling for the pre/post
31429 increment/decrement for overloaded operators, as they need to have
31430 the same semantics as the other operators.
31432 (Binary::ResolveOperator): ditto.
31433 (Invocation::ConversionExists): ditto.
31434 (UserImplicitCast::Resolve): ditto.
31436 2001-09-26 Ravi Pratap <ravi@ximian.com>
31438 * expression.cs (Unary::Emit and Binary::Emit): If we have an overloaded
31439 operator, return after emitting body. Regression tests pass again !
31441 * expression.cs (ConvertImplicit): Take TypeContainer as first argument
31442 (Unary::ForceConversion, Binary::ForceConversion): Ditto.
31443 (Invocation::OverloadResolve): Ditto.
31444 (Invocation::BetterFunction, BetterConversion, ConversionExists): Ditto.
31446 * everywhere : update calls to the above methods accordingly.
31448 2001-09-26 Miguel de Icaza <miguel@ximian.com>
31450 * assign.cs (Assign): Make it inherit from ExpressionStatement.
31452 * expression.cs (ExpressionStatement): New base class used for
31453 expressions that can appear in statements, so that we can provide
31454 an alternate path to generate expression that do not leave a value
31457 (Expression::Emit, and all the derivatives): We no longer return
31458 whether a value is left on the stack or not. Every expression
31459 after being emitted leaves a single value on the stack.
31461 * codegen.cs (EmitContext::EmitStatementExpression): Use the
31462 facilties of ExpressionStatement if possible.
31464 * cs-parser.jay: Update statement_expression.
31466 2001-09-25 Miguel de Icaza <miguel@ximian.com>
31468 * driver.cs: Change the wording of message
31470 2001-09-25 Ravi Pratap <ravi@ximian.com>
31472 * expression.cs (Binary::ResolveOperator): Had forgottten to set
31473 the type of the expression to the return type of the method if
31474 we have an overloaded operator match ! The regression tests pass again !
31475 (Unary::ResolveOperator): Ditto.
31477 * expression.cs (Invocation::ConversionExists): Correct the member lookup
31478 to find "op_Implicit", not "implicit" ;-)
31479 (UserImplicitCast): New class to take care of user-defined implicit conversions.
31480 (ConvertImplicit, ForceConversion): Take TypeContainer argument
31482 * everywhere : Correct calls to the above accordingly.
31484 * expression.cs (UserImplicitCast::Resolve, ::Emit): Implement.
31485 (ConvertImplicit): Do user-defined conversion if it exists.
31487 2001-09-24 Miguel de Icaza <miguel@ximian.com>
31489 * assign.cs: track location.
31490 (Resolve): Use implicit conversions on assignment.
31492 * literal.cs: Oops. Not good, Emit of short access values should
31493 pass (Bytes) or the wrong argument will be selected.
31495 * expression.cs (Unary::Emit): Emit code for -expr.
31497 (Unary::ResolveOperator): Handle `Substract' for non-constants
31498 (substract from zero from the non-constants).
31499 Deal with Doubles as well.
31501 (Expression::ConvertImplicitRequired): New routine that reports an
31502 error if no implicit conversion exists.
31504 (Invocation::OverloadResolve): Store the converted implicit
31505 expressions if we make them
31507 2001-09-24 Ravi Pratap <ravi@ximian.com>
31509 * class.cs (ConstructorInitializer): Take a Location argument.
31510 (ConstructorBaseInitializer): Same here.
31511 (ConstructorThisInitializer): Same here.
31513 * cs-parser.jay : Update all calls accordingly.
31515 * expression.cs (Unary, Binary, New): Take location argument.
31516 Update accordingly everywhere.
31518 * cs-parser.jay : Update all calls to the above to take a location
31521 * class.cs : Ditto.
31523 2001-09-24 Ravi Pratap <ravi@ximian.com>
31525 * expression.cs (Invocation::BetterFunction): Take TypeContainer argument
31526 (Invocation::BetterConversion): Same here
31527 (Invocation::ConversionExists): Ditto.
31529 (Invocation::ConversionExists): Implement.
31531 2001-09-22 Ravi Pratap <ravi@ximian.com>
31533 * expression.cs (OverloadResolve): Improve some more to catch errors 1502 and 1503
31534 Also take an additional TypeContainer argument.
31536 * All over : Pass in TypeContainer as argument to OverloadResolve.
31538 * typemanager.cs (CSharpName): Update to check for the string type and return
31541 * expression.cs (Invocation::FullMethodDesc): New static method to return a string fully describing
31544 2001-09-21 Ravi Pratap <ravi@ximian.com>
31546 * expression.cs (Invocation::OverloadResolve): Re-write to conform more to the spec.
31547 (Invocation::BetterFunction): Implement.
31548 (Invocation::BetterConversion): Implement.
31549 (Invocation::ConversionExists): Skeleton, no implementation yet.
31551 Okay, things work fine !
31553 2001-09-21 Miguel de Icaza <miguel@ximian.com>
31555 * typemanager.cs: declare and load enum_type, delegate_type and
31558 * expression.cs (Expression::Emit): Now emit returns a value that
31559 tells whether a value is left on the stack or not. This strategy
31560 might be reveted tomorrow with a mechanism that would address
31561 multiple assignments.
31562 (Expression::report118): Utility routine to report mismatches on
31565 (Unary::Report23): Report impossible type/operator combination
31568 (Unary::IsIncrementableNumber): Whether the type can be
31569 incremented or decremented with add.
31570 (Unary::ResolveOperator): Also allow enumerations to be bitwise
31572 (Unary::ResolveOperator): Implement ++, !, ~,
31574 (Invocation::Emit): Deal with new Emit convetion.
31576 * All Expression derivatives: Updated their Emit method to return
31577 whether they leave values on the stack or not.
31579 * codegen.cs (CodeGen::EmitStatement): Pop values left on the
31580 stack for expressions that are statements.
31582 2001-09-20 Miguel de Icaza <miguel@ximian.com>
31584 * expression.cs (LValue): New interface. Must be implemented by
31586 (LocalVariableReference, ParameterReference, FieldExpr): Implement
31589 * assign.cs (Assign::Emit, Assign::Resolve): Use new LValue
31590 interface for generating code, simplifies the code.
31592 2001-09-20 Ravi Pratap <ravi@ximian.com>
31594 * expression.cs (everywhere): Comment out return statements in ::Resolve
31595 methods to avoid the warnings.
31597 2001-09-20 Miguel de Icaza <miguel@ximian.com>
31599 * driver.cs (parse): Report error 2001 if we can not open the
31602 * expression.cs (SimpleName::ResolveSimpleName): Error if we can
31605 * cs-parser.jay (QualifierIdentifier): Pass location to SimpleName
31608 * statement.cs (Block::EmitMeta): Reuse the count across all the variables,
31609 otherwise nested blocks end up with the same index.
31611 * codegen.cs (CodeGen::EmitTopBlock): Pass initial sequence
31613 * expression.cs: Instead of having FIXMEs in the Resolve
31614 functions, throw exceptions so it is obvious that we are facing a
31617 * cs-parser.jay (invocation_expression): Pass Location information.
31619 * codegen.cs (CodeGen::Save, CodeGen::CodeGen, CodeGen::Basename):
31620 Use a basename for those routines because .NET does not like paths
31623 * class.cs (TypeContainer::AddMethod): Do not call DefineName if the name was
31626 2001-09-19 Miguel de Icaza <miguel@ximian.com>
31628 * typemanager.cs (TypeManager::CoreLookupType): A function to make sure that we
31629 are loading the correct data types (throws an exception if not).
31630 (TypeManager::InitCoreTypes): Use CoreLookupType
31632 * expression.cs (Unary::ResolveOperator): return the child
31633 expression for expressions which are just +expr.
31634 (Unary::ResolveOperator): Return negative literals for -LITERAL
31635 expressions (otherwise they are Unary {Literal}).
31636 (Invocation::Badness): Take into account `Implicit constant
31637 expression conversions'.
31639 * literal.cs (LongLiteral): Implement long literal class.
31640 (IntLiteral): export the `Value' of the intliteral.
31642 2001-09-19 Ravi Pratap <ravi@ximian.com>
31644 * expression.cs (Binary::Emit): Finally get the emission right ! Woo!
31646 * class.cs (Operator::Define): Change the methodname prefix to 'op_'
31647 instead of 'Operator'
31649 * expression.cs (Binary::ResolveOperator): Update accordingly.
31650 (Unary::Operator): Change names to 'Add' and 'Subtract' instead 'Plus'
31653 * cs-parser.jay (unary_expression): Update to use the new names.
31655 * gen-treedump.cs (GetUnary): Same here.
31657 * expression.cs (Unary::Resolve): Implement.
31658 (Binary::ResolveOperator): Re-write bits to quietly continue if no overloaded
31659 operators are found instead of making noise ;-)
31660 (Unary::ResolveOperator): New method to do precisely the same thing which
31661 Binary::ResolveOperator does for Binary expressions.
31662 (Unary.method, .Arguments): Add.
31663 (Unary::OperName): Implement.
31664 (Unary::ForceConversion): Copy and Paste !
31666 * class.cs (Operator::Define): Fix a small bug for the case when we have
31669 * expression.cs (Unary::Emit): Implement. Need to find the right Opcodes
31670 for the inbuilt operators. Only overloading works for now ;-)
31672 2001-09-18 Miguel de Icaza <miguel@ximian.com>
31674 * expression.cs (CheckedExpr::Resolve, CheckedExpr::Emit,
31675 UnCheckedExpr::Resolve, UnCheckedExpr::Emit): Implement.
31677 * expression.cs (This::Emit): Implement.
31678 (This::Resolve): Implement.
31679 (TypeOf:Resolve): Implement.
31680 (Expression::ResolveSimpleName): Add an implicit this to instance
31682 (MemberAccess::Resolve): Deal with Parameters and Fields.
31683 Bind instance variable to Field expressions.
31684 (FieldExpr::Instance): New field used to track the expression that
31685 represents the object instance.
31686 (FieldExpr::Resolve): Track potential errors from MemberLookup not
31688 (FieldExpr::Emit): Implement.
31690 * codegen.cs (EmitIf, EmitStatement, EmitBlock): Propagate whether
31691 the last instruction contains a return opcode to avoid generating
31692 the last `ret' instruction (this generates correct code, and it is
31693 nice to pass the peverify output).
31695 * class.cs (TypeContainer::EmitFieldInitializers): Implement field
31696 initializer for static and instance variables.
31697 (Constructor::Emit): Allow initializer to be null in the case of
31698 static constructors. Only emit initializer for instance
31701 (TypeContainer::FindMembers): Return a null array if there are no
31704 Also fix the code for the MemberTypes.Method branch, as it was not
31705 scanning that for operators (or tried to access null variables before).
31707 * assign.cs (Assign::Emit): Handle instance and static fields.
31711 * driver.cs: Stop compilation if there are parse errors.
31713 * cs-parser.jay (constructor_declaration): Provide default base
31714 initializer for non-static constructors.
31715 (constructor_declarator): Do not provide a default base
31716 initializers if none was specified.
31717 Catch the fact that constructors should not have parameters.
31719 * class.cs: Do not emit parent class initializers for static
31720 constructors, that should be flagged as an error.
31722 2001-09-18 Ravi Pratap <ravi@ximian.com>
31724 * class.cs (RegisterMethodBuilder): Remove : it's unnecessary.
31725 Move back code into TypeContainer::Populate.
31727 2001-09-18 Ravi Pratap <ravi@ximian.com>
31729 * class.cs (TypeContainer::AddConstructor): Fix the check to
31730 compare against Name, not Basename.
31731 (Operator::OpType): Change Plus and Minus to Add and Subtract.
31733 * cs-parser.jay : Update accordingly.
31735 * class.cs (TypeContainer::FindMembers): For the case where we are searching
31736 for methods, don't forget to look into the operators too.
31737 (RegisterMethodBuilder): Helper method to take care of this for
31738 methods, constructors and operators.
31739 (Operator::Define): Completely revamp.
31740 (Operator.OperatorMethod, MethodName): New fields.
31741 (TypeContainer::Populate): Move the registering of builders into
31742 RegisterMethodBuilder.
31743 (Operator::Emit): Re-write.
31745 * expression.cs (Binary::Emit): Comment out code path to emit method
31746 invocation stuff for the case when we have a user defined operator. I am
31747 just not able to get it right !
31749 2001-09-17 Miguel de Icaza <miguel@ximian.com>
31751 * expression.cs (Expression::OverloadResolve): Drop TypeContainer
31754 (Expression::MemberLookup): Provide a version that allows to
31755 specify the MemberTypes and BindingFlags.
31757 * statement.cs (Block::GetVariableInfo): Forgot to recurse here,
31758 so it was not fetching variable information from outer blocks.
31760 * modifiers.cs: (Modifiers::TypeAttr): Invert condition on
31761 Beforefieldinit as it was buggy.
31763 * rootcontext.cs (::LookupInterfaceOrClass): Removed an Error -200
31764 that Ravi put here.
31766 * class.cs (Constructor::Emit): Only emit if block is not null.
31767 (TypeContainer::EmitDefaultConstructor): Removed routine, now we
31768 deal with this by semantically definining it as if the user had
31771 (TypeContainer::FindMembers): Removed ad-hoc hack to deal with
31772 constructors as we now "emit" them at a higher level.
31774 (TypeContainer::DefineDefaultConstructor): Used to define the
31775 default constructors if none was provided.
31777 (ConstructorInitializer): Add methods Resolve and Emit.
31779 * expression.cs: Cast to ConstructorInfo instead of MethodInfo
31781 2001-09-17 Ravi Pratap <ravi@ximian.com>
31783 * class.cs (TypeContainer::EmitDefaultConstructor): Register
31784 the default constructor builder with our hashtable for methodbuilders
31787 * expression.cs (Invocation::OverloadResolve): Add a check for pd == null
31788 and argument_count is 0 in which case we have a match.
31789 (Binary::ResolveOperator): More null checking and miscellaneous coding
31792 2001-09-17 Ravi Pratap <ravi@ximian.com>
31794 * rootcontext.cs (IsNameSpace): Compare against null.
31796 * everywhere : Correct spelling to 'Greater' and to 'Subtract'
31798 * class.cs (Operator::OpType): Change names to match the ones in Binary::Operator
31799 and Unary::Operator.
31801 * cs-parser.jay (operator_declaration, CheckBinaryOperator, CheckUnaryOperator): Update
31804 * expression.cs (Binary::method): New member to hold the MethodBase for the case when
31805 we have overloaded operators.
31806 (Binary::ResolveOperator): Implement the part which does the operator overload
31809 * class.cs (Operator::Emit): Implement.
31810 (TypeContainer::Emit): Emit the operators we have too.
31812 * expression.cs (Binary::Emit): Update to emit the appropriate code for
31813 the case when we have a user-defined operator.
31815 2001-09-17 Miguel de Icaza <miguel@ximian.com>
31817 * rootcontext.cs: Fix bug: tree.Namespaces might be null.
31819 2001-09-16 Ravi Pratap <ravi@ximian.com>
31821 * class.cs (EmitStaticFieldInitializers, EmitFieldInitializers): Make public.
31822 (TypeContainer::EmitConstructor): Remove and move code into Contructor::Emit.
31823 (Constructor::Emit): Implement.
31824 (EmitStaticFieldInitializers, EmitFieldInitializers): Ensure we return immediately
31825 if we have no work to do.
31826 (TypeContainer::Emit): Pass in TypeContainer as argument to the constructor's
31829 * interface.cs (Interface::InterfaceAttr): Re-write to be more correct and complete.
31830 (Interface::IsTopLevel): Add. Same as TypeContainer::IsTopLevel.
31832 * class.cs (TypeContainer::IsTopLevel): Modify to use parent.Parent instead
31835 2001-09-15 Ravi Pratap <ravi@ximian.com>
31837 * tree.cs (Tree::namespaces): New hashtable to keep track of namespaces
31839 (Tree::RecordNamespace): Method to do what the name says ;-)
31840 (Tree::Namespaces): Property to get at the namespaces hashtable.
31842 * cs-parser.jay (namespace_declaration): Call RecordNamespace to
31845 * rootcontext.cs (IsNamespace): Fixed it :-)
31847 2001-09-14 Miguel de Icaza <miguel@ximian.com>
31849 * class.cs (TypeContainer::FindMembers): Add support for
31851 (MethodCore): New class that encapsulates both the shared aspects
31852 of a Constructor and a Method.
31853 (Method, Constructor): Factored pieces into MethodCore.
31855 * driver.cs: Added --fatal which makes errors throw exceptions.
31856 Load System assembly as well as part of the standard library.
31858 * report.cs: Allow throwing exceptions on errors for debugging.
31860 * modifiers.cs: Do not use `parent', instead use the real type
31861 container to evaluate permission settings.
31863 * class.cs: Put Ravi's patch back in. He is right, and we will
31864 have to cope with the
31866 2001-09-14 Ravi Pratap <ravi@ximian.com>
31868 * modifiers.cs (TypeAttr, MethodAttr, FieldAttr): Map protected internal to
31869 FamORAssem, not FamANDAssem.
31871 2001-09-14 Miguel de Icaza <miguel@ximian.com>
31873 * driver.cs: Added --parse option that only parses its input files
31876 * class.cs: Reverted last change from Ravi to IsTopLevel. That is
31877 incorrect. IsTopLevel is not used to tell whether an object is
31878 root_types or not (that can be achieved by testing this ==
31879 root_types). But to see if this is a top-level *class* (not
31880 necessarly our "toplevel" container).
31882 2001-09-14 Ravi Pratap <ravi@ximian.com>
31884 * enum.cs (Enum::Define): Modify to call the Lookup method on the
31885 parent instead of a direct call to GetType.
31887 2001-09-14 Ravi Pratap <ravi@ximian.com>
31889 * class.cs (TypeContainer::TypeAttr): Remove property code and move it into
31890 Modifiers.TypeAttr. This should just be a call to that method.
31892 * modifiers.cs (TypeAttr): Re-write and take an extra argument, the TypeContainer
31893 object so that we can determine if we are top-level or not.
31895 * delegate.cs (Delegate::Define): Update call to TypeAttr method to pass in the
31898 * enum.cs (Enum::Define): Ditto.
31900 * modifiers.cs (FieldAttr): Re-write.
31902 * class.cs (TypeContainer::IsTopLevel): Change accessibility to public.
31903 (TypeContainer::HaveStaticConstructor): New property to provide access
31904 to precisely that info.
31906 * modifiers.cs (MethodAttr): Re-write.
31907 (EventAttr): Remove altogether as there seems to be no ostensible use for it.
31909 * class.cs (TypeContainer::IsTopLevel): Re-write. root_types doesn't seem to be the parent
31910 of top-level types as claimed.
31912 2001-09-13 Miguel de Icaza <miguel@ximian.com>
31914 * expression.cs (MemberLookup): Fruitless attempt to lookup
31915 constructors. Maybe I need to emit default constructors? That
31916 might be it (currently .NET emits this for me automatically).
31917 (Invocation::OverloadResolve): Cope with Arguments == null.
31918 (Invocation::EmitArguments): new function, shared by the new
31919 constructor and us.
31920 (Invocation::Emit): Handle static and instance methods. Emit
31921 proper call instruction for virtual or non-virtual invocations.
31922 (New::Emit): Implement.
31923 (New::Resolve): Implement.
31924 (MemberAccess:Resolve): Implement.
31925 (MethodGroupExpr::InstanceExpression): used conforming to the spec
31926 to track instances.
31927 (FieldExpr::Resolve): Set type.
31929 * support.cs: Handle empty arguments.
31931 * cs-parser.jay (CompositeLookup, QualifierIdentifier,
31932 SimpleLookup): Auxiliary routines to help parse a qualifier
31935 Update qualifier_identifier rule.
31937 * codegen.cs: Removed debugging messages.
31939 * class.cs: Make this a global thing, this acts just as a "key" to
31940 objects that we might have around.
31942 (Populate): Only initialize method_builders_to_methods once.
31944 * expression.cs (PropertyExpr): Initialize type from the
31947 * codegen.cs (EmitContext::EmitBoolExpression): Use propper
31948 Resolve pattern. Attempt to implicitly convert value to boolean.
31951 * expression.cs: Set the type for the int32/int32 argument case.
31952 (Binary::ResolveOperator): Set the return type to boolean for
31953 comparission operators
31955 * typemanager.cs: Remove debugging print code.
31957 (Invocation::Resolve): resolve type.
31959 * class.cs: Allocate a MemberInfo of the correct size, as the code
31960 elsewhere depends on the test to reflect the correct contents.
31962 (Method::) Keep track of parameters, due to System.Reflection holes
31964 (TypeContainer::Populate): Keep track of MethodBuilders to Method
31967 (TypeContainer::FindMembers): Use ArrayList and then copy an array
31968 of the exact size and return that.
31970 (Class::LookupMethodByBuilder): New function that maps
31971 MethodBuilders to its methods. Required to locate the information
31972 on methods because System.Reflection bit us again.
31974 * support.cs: New file, contains an interface ParameterData and
31975 two implementations: ReflectionParameters and InternalParameters
31976 used to access Parameter information. We will need to grow this
31979 * expression.cs (Invocation::GetParameterData): implement a cache
31980 and a wrapper around the ParameterData creation for methods.
31981 (Invocation::OverloadResolve): Use new code.
31983 2001-09-13 Ravi Pratap <ravi@ximian.com>
31985 * class.cs (TypeContainer::EmitField): Remove and move into
31986 (Field::Define): here and modify accordingly.
31987 (Field.FieldBuilder): New member.
31988 (TypeContainer::Populate): Update accordingly.
31989 (TypeContainer::FindMembers): Implement.
31991 2001-09-13 Miguel de Icaza <miguel@ximian.com>
31993 * statement.cs: (VariableInfo::VariableType): New field to be
31994 initialized with the full type once it is resolved.
31996 2001-09-12 Miguel de Icaza <miguel@ximian.com>
31998 * parameter.cs (GetParameterInfo): Use a type cache to compute
31999 things only once, and to reuse this information
32001 * expression.cs (LocalVariableReference::Emit): Implement.
32002 (OpcodeCast::Emit): fix.
32004 (ParameterReference::Resolve): Implement.
32005 (ParameterReference::Emit): Implement.
32007 * cs-parser.jay: Fix bug introduced by Ravi, variable initializers
32008 that are expressions need to stay as Expressions.
32010 * typemanager.cs (CSharpName): Returns the C# name of a type if
32013 * expression.cs (Expression::ConvertImplicit): New function that
32014 implements implicit type conversions.
32016 (Expression::ImplicitReferenceConversion): Implements implicit
32017 reference conversions.
32019 (EmptyCast): New type for transparent casts.
32021 (OpcodeCast): New type for casts of types that are performed with
32022 a sequence of bytecodes.
32024 (BoxedCast): New type used for casting value types into reference
32025 types. Emits a box opcode.
32027 (Binary::DoNumericPromotions): Implements numeric promotions of
32028 and computation of the Binary::Type.
32030 (Binary::EmitBranchable): Optimization.
32032 (Binary::Emit): Implement code emission for expressions.
32034 * typemanager.cs (TypeManager): Added two new core types: sbyte
32037 2001-09-12 Ravi Pratap <ravi@ximian.com>
32039 * class.cs (TypeContainer::FindMembers): Method which does exactly
32040 what Type.FindMembers does, only we don't have to use reflection. No
32041 implementation yet.
32043 * typemanager.cs (typecontainers): New hashtable to hold the corresponding
32044 typecontainer objects as we need to get at them.
32045 (TypeManager::AddUserType): Overload to take an extra argument, the TypeContainer.
32047 * rootcontext.cs : Correspondingly modify called to AddUserType to pass the
32048 typecontainer object.
32050 * expression.cs (MemberLookup): Modify signature to take a RootContext object instead
32051 of just a Report object.
32053 2001-09-11 Ravi Pratap <ravi@ximian.com>
32055 * class.cs (Event::Define): Go back to using the prefixes "add_" and
32057 (TypeContainer::Populate): Now define the delegates of the type too.
32058 (TypeContainer.Delegates): Property to access the list of delegates defined
32061 * delegates.cs (Delegate::Define): Implement partially.
32063 * modifiers.cs (TypeAttr): Handle more flags.
32065 2001-09-11 Ravi Pratap <ravi@ximian.com>
32067 * class.cs (Indexer::Define): Fix for loop iteration condition to be just <
32069 (Operator::Define): Re-write logic to get types by using the LookupType method
32070 instead of blindly doing a Type.GetType ! How stupid can I get ;-) ?
32071 (Indexer::Define): Ditto.
32072 (Event::Define): Ditto.
32073 (Property::Define): Ditto.
32075 2001-09-10 Ravi Pratap <ravi@ximian.com>
32077 * class.cs (TypeContainer::Populate): Now define operators too.
32078 (TypeContainer.Operators): New property to access the list of operators
32080 (Operator.OperatorMethodBuilder): New member to hold the method builder
32081 for the operator we are defining.
32082 (Operator::Define): Implement.
32084 2001-09-10 Ravi Pratap <ravi@ximian.com>
32086 * class.cs (Event::Define): Make the prefixes of the accessor methods
32087 addOn_ and removeOn_
32089 * genericparser.cs (GenericParser::error): Overloaded method to handle the case
32090 of the location being passed in too. Ideally, this should go later since all
32091 error reporting should be done through the Report object.
32093 * class.cs (TypeContainer.Indexers): New property to access the list of indexers.
32094 (Populate): Iterate thru the indexers we have and define them too.
32095 (Indexer.GetMethodBuilder, .SetMethodBuilder): New members to hold the method builders
32096 for the get and set accessors.
32097 (Indexer::Define): Implement.
32099 2001-09-09 Miguel de Icaza <miguel@ximian.com>
32101 * expression.cs (Binary::Resolve): Beginning of it. I scratched
32102 my previous implementation, did not work.
32104 * typemanager.cs: Add a couple of missing types (the longs).
32106 * literal.cs: Use TypeManager.bool_type instead of getting it.
32108 * expression.cs (EventExpr): New kind of expressions.
32109 (Expressio::ExprClassFromMemberInfo): finish
32111 2001-09-08 Miguel de Icaza <miguel@ximian.com>
32113 * assign.cs: Emit stores to static fields differently.
32115 2001-09-08 Ravi Pratap <ravi@ximian.com>
32117 * Merge in changes and adjust code to tackle conflicts. Backed out my
32118 code in Assign::Resolve ;-)
32120 2001-09-08 Ravi Pratap <ravi@ximian.com>
32122 * cs-parser.jay (CheckAttributeTarget): Modify call to error to use
32123 instead Report.Error and also pass in the location.
32124 (CSharpParser::Lexer): New readonly property to return the reference
32125 to the Tokenizer object.
32126 (declare_local_variables): Use Report.Error with location instead of plain
32130 * class.cs (Operator::CheckUnaryOperator): Move into cs-parser.jay.
32131 (Operator.CheckBinaryOperator): Ditto.
32133 * cs-parser.jay (operator_declarator): Update accordingly.
32135 * cs-parser.jay (CheckUnaryOperator): Modify to use Report.Error
32136 (CheckBinaryOperator): Same here.
32138 * rootcontext.cs (LookupType): Add an extra lookup which simply does a lookup
32139 on the name without any prefixes of namespace names etc. This is because we
32140 already might have something already fully qualified like
32141 'System.Console.WriteLine'
32143 * assign.cs (Resolve): Begin implementation. Stuck ;-)
32145 2001-09-07 Ravi Pratap <ravi@ximian.com>
32147 * cs-tokenizer.cs (location): Return a string which also contains
32150 * expression.cs (ElementAccess): New class for expressions of the
32151 type 'element access.'
32152 (BaseAccess): New class for expressions of the type 'base access.'
32153 (CheckedExpr, UnCheckedExpr): New classes for Checked and Unchecked expressions
32156 * cs-parser.jay (element_access): Implement action.
32157 (base_access): Implement actions.
32158 (checked_expression, unchecked_expression): Implement.
32160 * cs-parser.jay (local_variable_type): Correct and implement.
32161 (type_suffixes, type_suffix_list, type_suffix): Implement actions.
32163 * cs-tokenizer.cs (real_type_suffix): Comment out the extra getchar.
32165 * cs-parser.jay (rank_specifiers): Remove space while concatenating the type's
32166 name and the specifiers.
32168 * interface.cs (InterfaceAttr): New property to return the corresponding TypeAttributes
32170 * rootcontext.cs (CreateInterface): Use the InterfaceAttr property instead of
32171 making them all public ;-)
32173 * cs-parser.jay (error): Remove entirely as we have an implementation in the base
32176 2001-09-07 Miguel de Icaza <miguel@ximian.com>
32178 * expression.cs (ExprClassFromMemberInfo): Return FieldExpr and
32180 (FieldExpr, PropertyExprs): New resolved expressions.
32181 (SimpleName::MemberStaticCheck): Perform static checks for access
32182 to non-static fields on static methods. Maybe this should be
32183 generalized for MemberAccesses.
32184 (SimpleName::ResolveSimpleName): More work on simple name
32187 * cs-parser.jay (primary_expression/qualified_identifier): track
32188 the parameter index.
32190 * codegen.cs (CodeGen::Save): Catch save exception, report error.
32191 (EmitContext::EmitBoolExpression): Chain to expression generation
32192 instead of temporary hack.
32193 (::EmitStatementExpression): Put generic expression code generation.
32195 * assign.cs (Assign::Emit): Implement variable assignments to
32196 local variables, parameters and fields.
32198 2001-09-06 Miguel de Icaza <miguel@ximian.com>
32200 * statement.cs (Block::GetVariableInfo): New method, returns the
32201 VariableInfo for a variable name in a block.
32202 (Block::GetVariableType): Implement in terms of GetVariableInfo
32204 * literal.cs (IntLiteral::Emit, FloatLiteral::Emit,
32205 DoubleLiteral::Emit, CharLiteral::Emit, BoolLiteral::Emit): Implement
32207 2001-09-06 Ravi Pratap <ravi@ximian.com>
32209 * cs-parser.jay (operator_declaration): Continue on my quest : update
32210 to take attributes argument.
32211 (event_declaration): Ditto.
32212 (enum_declaration): Ditto.
32213 (indexer_declaration): Ditto.
32215 * class.cs (Operator::Operator): Update constructor accordingly.
32216 (Event::Event): Ditto.
32218 * delegate.cs (Delegate::Delegate): Same here.
32220 * enum.cs (Enum::Enum): Same here.
32222 2001-09-05 Ravi Pratap <ravi@ximian.com>
32224 * cs-parser.jay (CheckAttributeTarget): Update to use the right error number.
32226 * ../tests/cs0658.cs : New file to demonstrate error 0658.
32228 * attribute.cs (Attributes): New class to encapsulate all attributes which were
32229 being passed around as an arraylist.
32230 (Attributes::AddAttribute): Method to add attribute sections.
32232 * cs-parser.jay (opt_attributes): Modify actions to use the new Attributes class.
32233 (struct_declaration): Update accordingly.
32234 (constant_declaration): Update.
32235 (field_declaration): Update.
32236 (method_header): Update.
32237 (fixed_parameter): Update.
32238 (parameter_array): Ditto.
32239 (property_declaration): Ditto.
32240 (destructor_declaration): Ditto.
32242 * class.cs (Struct::Struct): Update constructors accordingly.
32243 (Class::Class): Ditto.
32244 (Field::Field): Ditto.
32245 (Method::Method): Ditto.
32246 (Property::Property): Ditto.
32247 (TypeContainer::OptAttribute): update property's return type.
32249 * interface.cs (Interface.opt_attributes): New member.
32250 (Interface::Interface): Update to take the extra Attributes argument.
32252 * parameter.cs (Parameter::Parameter): Ditto.
32254 * constant.cs (Constant::Constant): Ditto.
32256 * interface.cs (InterfaceMemberBase): New OptAttributes field.
32257 (InterfaceMemberBase::InterfaceMemberBase): Update constructor to take
32258 the attributes as a parameter.
32259 (InterfaceProperty): Update constructor call.
32260 (InterfaceEvent): Ditto.
32261 (InterfaceMethod): Ditto.
32262 (InterfaceIndexer): Ditto.
32264 * cs-parser.jay (interface_indexer_declaration): Update call to constructor to
32265 pass the attributes too.
32266 (interface_event_declaration): Ditto.
32267 (interface_property_declaration): Ditto.
32268 (interface_method_declaration): Ditto.
32269 (interface_declaration): Ditto.
32271 2001-09-05 Miguel de Icaza <miguel@ximian.com>
32273 * class.cs (Method::Define): Track the "static Main" definition to
32274 create an entry point.
32276 * rootcontext.cs (RootContext::EntryPoint): MethodInfo that holds the
32277 EntryPoint if we find it.
32279 * codegen.cs (EmitContext::EmitInvocation): Emit invocations.
32280 (EmitContext::ig): Make this variable public.
32282 * driver.cs: Make the default output file be the first file name
32283 with the .exe extension.
32285 Detect empty compilations
32287 Handle various kinds of output targets. Handle --target and
32288 rename -t to --dumper.
32290 * expression.cs, literal.cs, assign.cs, constant.cs: All `Resolve'
32291 methods inherited from Expression return now an Expression. This
32292 will is used during the tree rewriting as we resolve them during
32295 (Expression::MemberLookup): Implements the MemberLookup (7.3) from
32296 the spec. Missing entirely is the information about
32297 accessability of elements of it.
32299 (Expression::ExprClassFromMemberInfo): New constructor for
32300 Expressions that creates a fully initialized Expression based on
32301 a MemberInfo that is one of Eventinfo, FieldINfo, PropertyInfo or
32304 (Invocation::Resolve): Begin implementing resolution of invocations.
32306 * literal.cs (StringLiteral): Implement Emit.
32308 2001-09-05 Ravi Pratap <ravi@ximian.com>
32310 * cs-parser.jay (error): Add new modifier because we are hiding an inherited
32313 2001-09-04 Ravi Pratap <ravi@ximian.com>
32315 * cs-parser.jay (attribute_arguments): Implement actions.
32316 (attribute): Fix bug in production. Implement action.
32317 (attribute_list): Implement.
32318 (attribute_target): Implement.
32319 (attribute_target_specifier, opt_target_specifier): Implement
32320 (CheckAttributeTarget): New method to check if the attribute target
32322 (attribute_section): Implement.
32323 (opt_attributes): Implement.
32325 * attribute.cs : New file to handle attributes.
32326 (Attribute): Class to hold attribute info.
32328 * cs-parser.jay (opt_attribute_target_specifier): Remove production
32329 (attribute_section): Modify production to use 2 different rules to
32330 achieve the same thing. 1 s/r conflict down !
32331 Clean out commented, useless, non-reducing dimension_separator rules.
32333 * class.cs (TypeContainer.attributes): New member to hold list
32334 of attributes for a type.
32335 (Struct::Struct): Modify to take one more argument, the attribute list.
32336 (Class::Class): Ditto.
32337 (Field::Field): Ditto.
32338 (Method::Method): Ditto.
32339 (Property::Property): Ditto.
32341 * cs-parser.jay (struct_declaration): Update constructor call to
32342 pass in the attributes too.
32343 (class_declaration): Ditto.
32344 (constant_declaration): Ditto.
32345 (field_declaration): Ditto.
32346 (method_header): Ditto.
32347 (fixed_parameter): Ditto.
32348 (parameter_array): Ditto.
32349 (property_declaration): Ditto.
32351 * constant.cs (Constant::Constant): Update constructor similarly.
32352 Use System.Collections.
32354 * parameter.cs (Parameter::Parameter): Update as above.
32356 2001-09-02 Ravi Pratap <ravi@ximian.com>
32358 * class.cs (TypeContainer::AddDelegate): New method to add a delegate.
32359 (TypeContainer.delegates): New member to hold list of delegates.
32361 * cs-parser.jay (delegate_declaration): Implement the action correctly
32362 this time as I seem to be on crack ;-)
32364 2001-09-02 Miguel de Icaza <miguel@ximian.com>
32366 * rootcontext.cs (RootContext::IsNamespace): new function, used to
32367 tell whether an identifier represents a namespace.
32369 * expression.cs (NamespaceExpr): A namespace expression, used only
32370 temporarly during expression resolution.
32371 (Expression::ResolveSimpleName, ::ResolvePrimary, ::ResolveName):
32372 utility functions to resolve names on expressions.
32374 2001-09-01 Miguel de Icaza <miguel@ximian.com>
32376 * codegen.cs: Add hook for StatementExpressions.
32378 * class.cs: Fix inverted test for static flag in methods.
32380 2001-09-02 Ravi Pratap <ravi@ximian.com>
32382 * class.cs (Operator::CheckUnaryOperator): Correct error number used
32383 to make it coincide with MS' number.
32384 (Operator::CheckBinaryOperator): Ditto.
32386 * ../errors/errors.txt : Remove error numbers added earlier.
32388 * ../errors/cs1019.cs : Test case for error # 1019
32390 * ../errros/cs1020.cs : Test case for error # 1020
32392 * cs-parser.jay : Clean out commented cruft.
32393 (dimension_separators, dimension_separator): Comment out. Ostensibly not
32394 used anywhere - non-reducing rule.
32395 (namespace_declarations): Non-reducing rule - comment out.
32397 * enum.cs (Enum::AddEnum): Rename to AddEnumMember as I was getting confused
32398 with TypeContainer::AddEnum.
32400 * delegate.cs : New file for delegate handling classes.
32401 (Delegate): Class for declaring delegates.
32403 * makefile : Update.
32405 * cs-parser.jay (delegate_declaration): Implement.
32407 2001-09-01 Ravi Pratap <ravi@che.iitm.ac.in>
32409 * class.cs (Event::Define): Implement.
32410 (Event.EventBuilder): New member.
32412 * class.cs (TypeContainer::Populate): Update to define all enums and events
32414 (Events): New property for the events arraylist we hold. Shouldn't we move to using
32415 readonly fields for all these cases ?
32417 2001-08-31 Ravi Pratap <ravi@che.iitm.ac.in>
32419 * class.cs (Property): Revamp to use the convention of making fields readonly.
32420 Accordingly modify code elsewhere.
32422 * class.cs : Apply patch from Mr. Mandar <go_mono@hotmail.com> for implementing
32423 the Define method of the Property class.
32425 * class.cs : Clean up applied patch and update references to variables etc. Fix
32427 (TypeContainer::Populate): Update to define all the properties we have. Also
32428 define all enumerations.
32430 * enum.cs (Define): Implement.
32432 2001-08-31 Ravi Pratap <ravi@che.iitm.ac.in>
32434 * cs-parser.jay (overloadable_operator): The semantic value is an
32435 enum of the Operator class.
32436 (operator_declarator): Implement actions.
32437 (operator_declaration): Implement.
32439 * class.cs (Operator::CheckUnaryOperator): New static method to help in checking
32440 validity of definitions.
32441 (Operator::CheckBinaryOperator): Static method to check for binary operators
32442 (TypeContainer::AddOperator): New method to add an operator to a type.
32444 * cs-parser.jay (indexer_declaration): Added line to actually call the
32445 AddIndexer method so it gets added ;-)
32447 * ../errors/errors.txt : Update to include new error numbers. Are these numbers
32448 already taken care of by the MS compiler ?
32450 2001-08-29 Ravi Pratap <ravi@che.iitm.ac.in>
32452 * class.cs (Operator): New class for operator declarations.
32453 (Operator::OpType): Enum for the various operators.
32455 2001-08-29 Ravi Pratap <ravi@che.iitm.ac.in>
32457 * class.cs (TypeContainer::AddIndexer): Remove FIXME comment. We
32458 ostensibly handle this in semantic analysis.
32460 * cs-parser.jay (general_catch_clause): Comment out
32461 (specific_catch_clauses, specific_catch_clause): Ditto.
32462 (opt_general_catch_clause, opt_specific_catch_clauses): Ditto
32463 (catch_args, opt_catch_args): New productions.
32464 (catch_clause): Rewrite to use the new productions above
32465 (catch_clauses): Modify accordingly.
32466 (opt_catch_clauses): New production to use in try_statement
32467 (try_statement): Revamp. Basically, we get rid of one unnecessary rule
32468 and re-write the code in the actions to extract the specific and
32469 general catch clauses by being a little smart ;-)
32471 * ../tests/try.cs : Fix. It's not 'finalize' my friend, it's 'finally' !
32472 Hooray, try and catch statements parse fine !
32474 2001-08-28 Ravi Pratap <ravi@che.iitm.ac.in>
32476 * statement.cs (Block::GetVariableType): Fix logic to extract the type
32477 string from the hashtable of variables.
32479 * cs-parser.jay (event_accessor_declarations): Trivial fix. Man, how did
32480 I end up making that mistake ;-)
32481 (catch_clauses): Fixed gross error which made Key and Value of the
32482 DictionaryEntry the same : $1 !!
32484 2001-08-28 Ravi Pratap <ravi@che.iitm.ac.in>
32486 * cs-tokenizer.cs (initTokens): Add keywords 'add' and 'remove'
32488 * cs-parser.jay (event_declaration): Correct to remove the semicolon
32489 when the add and remove accessors are specified.
32491 2001-08-28 Ravi Pratap <ravi@che.iitm.ac.in>
32493 * cs-parser.jay (IndexerDeclaration): New helper class to hold
32494 information about indexer_declarator.
32495 (indexer_declarator): Implement actions.
32496 (parsing_indexer): New local boolean used to keep track of whether
32497 we are parsing indexers or properties. This is necessary because
32498 implicit_parameters come into picture even for the get accessor in the
32499 case of an indexer.
32500 (get_accessor_declaration, set_accessor_declaration): Correspondingly modified.
32502 * class.cs (Indexer): New class for indexer declarations.
32503 (TypeContainer::AddIndexer): New method to add an indexer to a type.
32504 (TypeContainer::indexers): New member to hold list of indexers for the
32507 2001-08-27 Ravi Pratap <ravi@che.iitm.ac.in>
32509 * cs-parser.jay (add_accessor_declaration): Implement action.
32510 (remove_accessor_declaration): Implement action.
32511 (event_accessors_declaration): Implement
32512 (variable_declarators): swap statements for first rule - trivial.
32514 * class.cs (Event): New class to hold information about event
32516 (TypeContainer::AddEvent): New method to add an event to a type
32517 (TypeContainer::events): New member to hold list of events.
32519 * cs-parser.jay (event_declaration): Implement actions.
32521 2001-08-27 Ravi Pratap <ravi@che.iitm.ac.in>
32523 * cs-parser.jay (dim_separators): Implement. Make it a string
32524 concatenating all the commas together, just as they appear.
32525 (opt_dim_separators): Modify accordingly
32526 (rank_specifiers): Update accordingly. Basically do the same
32527 thing - instead, collect the brackets here.
32528 (opt_rank_sepcifiers): Modify accordingly.
32529 (array_type): Modify to actually return the complete type string
32530 instead of ignoring the rank_specifiers.
32531 (expression_list): Implement to collect the expressions
32532 (variable_initializer): Implement. We make it a list of expressions
32533 essentially so that we can handle the array_initializer case neatly too.
32534 (variable_initializer_list): Implement.
32535 (array_initializer): Make it a list of variable_initializers
32536 (opt_array_initializer): Modify accordingly.
32538 * expression.cs (New::NType): Add enumeration to help us
32539 keep track of whether we have an object/delegate creation
32540 or an array creation.
32541 (New:NewType, New::Rank, New::Indices, New::Initializers): New
32542 members to hold data about array creation.
32543 (New:New): Modify to update NewType
32544 (New:New): New Overloaded contructor for the array creation
32547 * cs-parser.jay (array_creation_expression): Implement to call
32548 the overloaded New constructor.
32550 2001-08-26 Ravi Pratap <ravi@che.iitm.ac.in>
32552 * class.cs (TypeContainer::Constructors): Return member
32553 constructors instead of returning null.
32555 2001-08-26 Miguel de Icaza <miguel@ximian.com>
32557 * typemanager.cs (InitCoreTypes): Initialize the various core
32558 types after we have populated the type manager with the user
32559 defined types (this distinction will be important later while
32560 compiling corlib.dll)
32562 * expression.cs, literal.cs, assign.cs, constant.cs: Started work
32563 on Expression Classification. Now all expressions have a method
32564 `Resolve' and a method `Emit'.
32566 * codegen.cs, cs-parser.jay: Fixed the bug that stopped code
32567 generation from working. Also add some temporary debugging
32570 2001-08-24 Miguel de Icaza <miguel@ximian.com>
32572 * codegen.cs: Lots of code generation pieces. This is only the
32573 beginning, will continue tomorrow with more touches of polish. We
32574 handle the fundamentals of if, while, do, for, return. Others are
32575 trickier and I need to start working on invocations soon.
32577 * gen-treedump.cs: Bug fix, use s.Increment here instead of
32580 * codegen.cs (EmitContext): New struct, used during code
32581 emission to keep a context. Most of the code generation will be
32584 * cs-parser.jay: Add embedded blocks to the list of statements of
32585 this block. So code generation proceeds in a top down fashion.
32587 2001-08-23 Miguel de Icaza <miguel@ximian.com>
32589 * statement.cs: Add support for multiple child blocks.
32591 2001-08-22 Miguel de Icaza <miguel@ximian.com>
32593 * codegen.cs (EmitCode): New function, will emit the code for a
32594 Block of code given a TypeContainer and its ILGenerator.
32596 * statement.cs (Block): Standard public readonly optimization.
32597 (Block::Block constructors): Link children.
32598 (Block::Child): Child Linker.
32599 (Block::EmitVariables): Emits IL variable declarations.
32601 * class.cs: Drop support for MethodGroups here, delay until
32603 (Method::): Applied the same simplification that I did before, and
32604 move from Properties to public readonly fields.
32605 (Method::ParameterTypes): Returns the parameter types for the
32606 function, and implements a cache that will be useful later when I
32607 do error checking and the semantic analysis on the methods is
32609 (Constructor::GetCallingConvention): Renamed from CallingConvetion
32610 and made a method, optional argument tells whether this is a class
32611 or a structure to apply the `has-this' bit.
32612 (Method::GetCallingConvention): Implement, returns the calling
32614 (Method::Define): Defines the type, a second pass is performed
32615 later to populate the methods.
32617 (Constructor::ParameterTypes): implement a cache similar to the
32618 one on Method::ParameterTypes, useful later when we do semantic
32621 (TypeContainer::EmitMethod): New method. Emits methods.
32623 * expression.cs: Removed MethodGroup class from here.
32625 * parameter.cs (Parameters::GetCallingConvention): new method.
32627 2001-08-21 Miguel de Icaza <miguel@ximian.com>
32629 * class.cs (TypeContainer::Populate): Drop RootContext from the
32632 (Constructor::CallingConvention): Returns the calling convention.
32633 (Constructor::ParameterTypes): Returns the constructor parameter
32636 (TypeContainer::AddConstructor): Keep track of default constructor
32637 and the default static constructor.
32639 (Constructor::) Another class that starts using `public readonly'
32640 instead of properties.
32642 (Constructor::IsDefault): Whether this is a default constructor.
32644 (Field::) use readonly public fields instead of properties also.
32646 (TypeContainer::TypeAttr, TypeContainer::AddConstructor): Keep
32647 track of static constructors; If none is used, turn on
32648 BeforeFieldInit in the TypeAttributes.
32650 * cs-parser.jay (opt_argument_list): now the return can be null
32651 for the cases where there are no arguments.
32653 (constructor_declarator): If there is no implicit `base' or
32654 `this', then invoke the default parent constructor.
32656 * modifiers.cs (MethodAttr): New static function maps a set of
32657 modifiers flags into a MethodAttributes enum
32658 (FieldAttr): renamed from `Map'. So now we have FieldAttr,
32659 MethodAttr, TypeAttr to represent the various mappings where the
32660 modifiers are used.
32661 (FieldAttr): Map also `readonly' to `FieldAttributes.InitOnly'
32663 2001-08-19 Miguel de Icaza <miguel@ximian.com>
32665 * parameter.cs (GetParameterInfo): Fix bug where there would be no
32668 * interface.cs (PopulateIndexer): Implemented the code generator
32669 for interface indexers.
32671 2001-08-17 Miguel de Icaza <miguel@ximian.com>
32673 * interface.cs (InterfaceMemberBase): Now we track the new status
32676 (PopulateProperty): Implement property population. Woohoo! Got
32677 Methods and Properties going today.
32679 Removed all the properties for interfaces, and replaced them with
32680 `public readonly' fields.
32682 2001-08-16 Miguel de Icaza <miguel@ximian.com>
32684 * interface.cs (AddEvent, AddMethod, AddIndexer, AddProperty):
32685 initialize their hashtables/arraylists only when they are needed
32686 instead of doing this always.
32688 * parameter.cs: Handle refs and out parameters.
32690 * cs-parser.jay: Use an ArrayList to construct the arguments
32691 instead of the ParameterCollection, and then cast that to a
32694 * parameter.cs: Drop the use of ParameterCollection and use
32695 instead arrays of Parameters.
32697 (GetParameterInfo): Use the Type, not the Name when resolving
32700 2001-08-13 Miguel de Icaza <miguel@ximian.com>
32702 * parameter.cs: Eliminate the properties Name, Type and ModFlags,
32703 and instead use public readonly fields.
32705 * class.cs: Put back walking code for type containers.
32707 2001-08-11 Miguel de Icaza <miguel@ximian.com>
32709 * class.cs (MakeConstant): Code to define constants.
32711 * rootcontext.cs (LookupType): New function. Used to locate types
32714 2001-08-08 Miguel de Icaza <miguel@ximian.com>
32716 * rootcontext.cs: OH MY! My trick works! It is amazing how nice
32717 this System.Reflection code is. Kudos to Microsoft
32719 * typemanager.cs: Implement a type cache and avoid loading all
32720 types at boot time. Wrap in LookupType the internals. This made
32721 the compiler so much faster. Wow. I rule!
32723 * driver.cs: Make sure we always load mscorlib first (for
32724 debugging purposes, nothing really important).
32726 * Renamespaced things that were on `CSC' to `CIR'. Maybe I should
32727 have moved to `CSC' rather than `CIR'. Oh man! The confussion!
32729 * rootcontext.cs: Lookup types on their namespace; Lookup types
32730 on namespaces that have been imported using the `using' keyword.
32732 * class.cs (TypeContainer::TypeAttr): Virtualize.
32733 (Class::TypeAttr): Return attributes suitable for this bad boy.
32734 (Struct::TypeAttr): ditto.
32735 Handle nested classes.
32736 (TypeContainer::) Remove all the type visiting code, it is now
32737 replaced with the rootcontext.cs code
32739 * rootcontext.cs (GetClassBases): Added support for structs.
32741 2001-08-06 Miguel de Icaza <miguel@ximian.com>
32743 * interface.cs, statement.cs, class.cs, parameter.cs,
32744 rootcontext.cs, gen-treedump.cs, enum.cs, cs-parse.jay:
32745 Drop use of TypeRefs, and use strings instead.
32747 2001-08-04 Miguel de Icaza <miguel@ximian.com>
32751 * class.cs (Struct::Struct): set the SEALED flags after
32752 checking the modifiers.
32753 (TypeContainer::TypeAttr): new property, returns the
32754 TypeAttributes for a class.
32756 * cs-parser.jay (type_list): Oops, list production was creating a
32757 new list of base types.
32759 * rootcontext.cs (StdLib): New property.
32760 (GetInterfaceTypeByName): returns an interface by type name, and
32761 encapsulates error handling here.
32762 (GetInterfaces): simplified.
32763 (ResolveTree): Encapsulated all the tree resolution here.
32764 (CreateClass, GetClassBases, GetInterfaceOrClass): Create class
32767 * driver.cs: Add support for --nostdlib, to avoid loading the
32768 default assemblies.
32769 (Main): Do not put tree resolution here.
32771 * rootcontext.cs: Beginning of the class resolution.
32773 2001-08-03 Miguel de Icaza <miguel@ximian.com>
32775 * rootcontext.cs: Provide better error reporting.
32777 * cs-parser.jay (interface_base): set our $$ to be interfaces.
32779 * rootcontext.cs (CreateInterface): Handle the case where there
32780 are no parent interfaces.
32782 (CloseTypes): Routine to flush types at the end.
32783 (CreateInterface): Track types.
32784 (GetInterfaces): Returns an array of Types from the list of
32785 defined interfaces.
32787 * typemanager.c (AddUserType): Mechanism to track user types (puts
32788 the type on the global type hash, and allows us to close it at the
32791 2001-08-02 Miguel de Icaza <miguel@ximian.com>
32793 * tree.cs: Removed RecordType, added RecordClass, RecordStruct and
32794 RecordInterface instead.
32796 * cs-parser.jay: Updated to reflect changes above.
32798 * decl.cs (Definition): Keep track of the TypeBuilder type that
32799 represents this type here. Not sure we will use it in the long
32800 run, but wont hurt for now.
32802 * driver.cs: Smaller changes to accomodate the new code.
32804 Call ResolveInterfaceBases, Call ResolveClassBases, Save assembly
32807 * rootcontext.cs (CreateInterface): New method, used to create
32808 the System.TypeBuilder type for interfaces.
32809 (ResolveInterfaces): new entry point to resolve the interface
32811 (CodeGen): Property, used to keep track of the code generator.
32813 2001-07-26 Miguel de Icaza <miguel@ximian.com>
32815 * cs-parser.jay: Add a second production for delegate_declaration
32818 (enum_body): Put an opt_comma here instead of putting it on
32819 enum_body or enum_member_declarations so we can handle trailing
32820 commas on enumeration members. Gets rid of a shift/reduce.
32822 (type_list): Need a COMMA in the middle.
32824 (indexer_declaration): Tell tokenizer to recognize get/set
32826 * Remove old targets.
32828 * Re-add the parser target.
32830 2001-07-13 Simon Cozens <simon@simon-cozens.org>
32832 * cs-parser.jay: Add precendence rules for a number of operators
32833 ot reduce the number of shift/reduce conflicts in the grammar.
32835 2001-07-17 Miguel de Icaza <miguel@ximian.com>
32837 * tree.cs: moved IGenerator interface and renamed it to ITreeDump
32840 Get rid of old crufty code.
32842 * rootcontext.cs: Use this to keep track of the parsed
32843 representation and the defined types available to the program.
32845 * gen-treedump.cs: adjust for new convention.
32847 * type.cs: Split out the type manager, and the assembly builder
32850 * typemanager.cs: the type manager will live here now.
32852 * cil-codegen.cs: And the code generator here.
32854 2001-07-14 Sean MacIsaac <macisaac@ximian.com>
32856 * makefile: Fixed up for easy making.
32858 2001-07-13 Simon Cozens <simon@simon-cozens.org>
32860 * cs-parser.jay (rank_specifier): Remove a conflict by reordering
32863 (unary_expression): Expand pre_increment_expression and
32864 post_decrement_expression to reduce a shift/reduce.
32866 2001-07-11 Simon Cozens
32868 * cs-tokenizer.cs: Hex numbers should begin with a 0.
32870 Improve allow_keyword_as_indent name.
32872 2001-06-19 Miguel de Icaza <miguel@ximian.com>
32874 * Adjustments for Beta2.
32876 2001-06-13 Miguel de Icaza <miguel@ximian.com>
32878 * decl.cs: Added `Define' abstract method.
32879 (InTransit): new property, used to catch recursive definitions.
32881 * interface.cs: Implement `Define'.
32883 * modifiers.cs: Map Modifiers.constants to
32884 System.Reflection.TypeAttribute flags.
32886 * class.cs: Keep track of types and user-defined types.
32887 (BuilderInit): New method for creating an assembly
32888 (ResolveType): New function to launch the resolution process, only
32889 used by interfaces for now.
32891 * cs-parser.jay: Keep track of Classes, Structs and Interfaces
32892 that are inserted into the name space.
32894 2001-06-08 Miguel de Icaza <miguel@ximian.com>
32896 * ARGH. I have screwed up my tree so many times due to the use of
32897 rsync rather than using CVS. Going to fix this at once.
32899 * driver.cs: Objetify driver. Load assemblies, use assemblies to
32902 2001-06-07 Miguel de Icaza <miguel@ximian.com>
32904 * Experiment successful: Use System.Type rather that our own
32907 2001-05-25 Miguel de Icaza <miguel@ximian.com>
32909 * cs-parser.jay: Removed nsAliases from here.
32911 Use new namespaces, handle `using XXX;'
32913 * namespace.cs: Reimplemented namespace handling, use a recursive
32914 definition of the class. Now we can keep track of using clauses
32915 and catch invalid using clauses.
32917 2001-05-24 Miguel de Icaza <miguel@ximian.com>
32919 * gen-treedump.cs: Adapted for all the renaming.
32921 * expression.cs (Expression): this class now has a Type property
32922 which returns an expression Type.
32924 (Probe::, New::, TypeOf::, SizeOf::, Constant::): renamed from
32925 `Type', as this has a different meaning now in the base
32927 2001-05-22 Miguel de Icaza <miguel@ximian.com>
32929 * interface.cs, class.cs: Removed from all the sources the
32930 references to signature computation, as we can not do method
32931 signature computation during the parsing time, as we are not
32932 trying to solve at that point distinguishing:
32936 void a (NS.Blah x) {}
32939 Which depending on the context might be valid or not, as we do not
32940 know if Blah is the same thing as NS.Blah at that point.
32942 * Redid everything so the code uses TypeRefs now instead of
32943 Types. TypeRefs are just temporary type placeholders, that need
32944 to be resolved. They initially have a pointer to a string and the
32945 current scope in which they are used. This is used later by the
32946 compiler to resolve the reference to an actual Type.
32948 * DeclSpace is no longer a CIR.Type, and neither are
32949 TypeContainers (Class and Struct) nor Interfaces nor Enums. They
32950 are all DeclSpaces, but no Types.
32952 * type.cs (TypeRefManager): This implements the TypeRef manager,
32953 which keeps track of all the types that need to be resolved after
32954 the parsing has finished.
32956 2001-05-13 Miguel de Icaza <miguel@ximian.com>
32958 * ARGH. We are going to have to store `foreach' as a class rather
32959 than resolving it, as we need to verify error 1579 after name
32960 resolution. *OR* we could keep a flag that says `This request to
32961 IEnumerator comes from a foreach statement' which we can then use
32962 to generate the error.
32964 2001-05-10 Miguel de Icaza <miguel@ximian.com>
32966 * class.cs (TypeContainer.AddMethod): we now add methods to the
32967 MethodGroup instead of the method hashtable.
32969 * expression.cs: Add MethodGroup abstraction, which gets us one
32970 step closer to the specification in the way we handle method
32973 * cs-parser.jay (primary_expression): qualified_identifier now
32974 tried to match up an identifier to a local variable reference or
32975 to a parameter reference.
32977 current_local_parameters is now a parser global variable that
32978 points to the current parameters for the block, used during name
32981 (property_declaration): Now creates an implicit `value' argument to
32984 2001-05-09 Miguel de Icaza <miguel@ximian.com>
32986 * parameter.cs: Do not use `param' arguments as part of the
32987 signature, per the spec.
32989 2001-05-08 Miguel de Icaza <miguel@ximian.com>
32991 * decl.cs: Base class for classes, structs and interfaces. This
32992 is the "Declaration Space"
32994 * cs-parser.jay: Use CheckDef for checking declaration errors
32995 instead of having one on each function.
32997 * class.cs: Factor out some code for handling error handling in
32998 accordance to the "Declarations" section in the "Basic Concepts"
32999 chapter in the ECMA C# spec.
33001 * interface.cs: Make all interface member classes derive from
33002 InterfaceMemberBase.
33004 2001-05-07 Miguel de Icaza <miguel@ximian.com>
33006 * Many things: all interfaces are parsed and generated in
33007 gen-treedump. Support for member variables, constructors,
33008 destructors, properties, constants is there.
33010 Beginning of the IL backend, but very little done, just there for
33013 2001-04-29 Miguel de Icaza <miguel@ximian.com>
33015 * cs-parser.jay: Fix labeled statement.
33017 * cs-tokenizer.cs (escape): Escape " and ' always.
33018 ref_line, ref_name: keep track of the line/filename as instructed
33019 by #line by the compiler.
33022 2001-04-27 Miguel de Icaza <miguel@ximian.com>
33024 * System.CodeDOM/CodeBinaryOperatorExpression.cs: Rearrange enum
33025 to match the values in System.CodeDOM.
33027 Divid renamed to Divide.
33029 * System.CodeDOM/CodeForLoopStatement.cs: Always have valid
33031 (Statements.set): remove.
33033 * System.CodeDOM/CodeCatchClause.cs: always have a valid
33036 * System.CodeDOM/CodeIfStatement.cs: trueStatements and
33037 falseStatements always have valid values.
33039 * cs-parser.jay: Use System.CodeDOM now.