1 2008-04-01 Marek Safar <marek.safar@gmail.com>
3 * nullable.cs, ecore.cs, expression.cs: Convert null arithmetic to lifted
6 2008-04-01 Marek Safar <marek.safar@gmail.com>
8 * nullable.cs, expression.cs: Use namespace instead heavily nested
9 monster abstract class.
11 2008-04-01 Marek Safar <marek.safar@gmail.com>
13 * ecore.cs, convert.cs, constant.cs, nullable.cs, expression.cs: Implemented
14 lifting of null literal and user operators. Clean up of some temporary
17 2008-03-30 Raja R Harinath <harinath@hurrynot.org>
19 Fix #368224, test-629.cs
20 * flowanalysis.cs (FlowBranching.StealFinallyClauses): Return true
21 if it crossed an unwind-protect boundary.
22 * iterators.cs (Yield.CheckContext): Relax check for 'yield break'.
23 (Yield.Resolve, Yield.DoEmit): Track whether the yield occurs
24 inside an unwind-protected region.
25 (YieldBreak.Resolve, YieldBreak.DoEmit): Likewise.
26 (Iterator.MarkYield): Add 'unwind_protect' parameter. Emit a
27 'leave' instead of a 'br' if unwind-protected.
28 (Iterator.EmitYieldBreak): Likewise.
30 2008-03-29 Gert Driesen <drieseng@users.sourceforge.net>
32 * driver.cs: Only define versioninfo resources if no win32 resource
35 2008-03-28 Marek Safar <marek.safar@gmail.com>
38 * convert.cs: Fixed boxing of nullable types.
40 2008-03-28 Marek Safar <marek.safar@gmail.com>
42 * typemanager.cs: Initialize InternalsVisibleTo as the very first optional
45 2008-03-28 Marek Safar <marek.safar@gmail.com>
48 * nullable.cs: Fixed guarding of EmitBitwiseBoolean.
50 2008-03-27 Marek Safar <marek.safar@gmail.com>
52 * lambda.cs: Check return type only for invocation.
54 2008-03-27 Marek Safar <marek.safar@gmail.com>
57 * ecore.cs: Correctly report argument type mismatch.
59 2008-03-27 Marek Safar <marek.safar@gmail.com>
61 * convert.cs (ImplicitReferenceConversionCore): Correctly compare enum type
62 and not rely on broken IsEnum.
64 2008-03-27 Marek Safar <marek.safar@gmail.com>
66 * nullable.cs: New file, extracted from generic.cs.
68 * generic.cs, generic-mcs.cs, *.csproj, *.sources: Updated.
70 2008-03-27 Marek Safar <marek.safar@gmail.com>
72 * generic.cs, convert.cs, generic-mcs.cs, expression.cs: Added lifting of
73 predefined comparison operators and null literals.
75 * report.cs: New warning ID.
77 2008-03-25 Marek Safar <marek.safar@gmail.com>
80 * lambda.cs: Check return type too.
82 2008-03-25 Marek Safar <marek.safar@gmail.com>
85 * class.cs: Automatic properties can be declared as unsafe.
87 2008-03-20 Marek Safar <marek.safar@gmail.com>
89 * location.cs: Use string based concatenation.
91 * expression.cs: LiftedBinaryOperator is gmcs only.
93 2008-03-20 Marek Safar <marek.safar@gmail.com>
95 * generic.cs, literal.cs, ecore.cs, expression.cs: Ongoing work on nullable
96 conversions rules and expression trees.
98 2008-03-19 Marek Safar <marek.safar@gmail.com>
100 * delegate.cs: Use extension method source as delegate target.
102 2008-03-19 Marek Safar <marek.safar@gmail.com>
104 * generic.cs, generic-mcs.cs, expression.cs, ecore.cs: Rewrote nullable
105 binary operations to be purely based on binary operations and optimized
106 emitted code (30% less in some cases). Introduced ReducedExpression for ETs
107 and other ET refactoring.
109 * typemanager.cs: Fixed warning.
111 2008-03-17 Marek Safar <marek.safar@gmail.com>
113 * class.cs, decl.cs, delegate.cs: Do protected modifier check on each member
115 * symbolwriter.cs: Fixed.
117 2008-03-17 Marek Safar <marek.safar@gmail.com>
119 * anonymous.cs, driver.cs: Reset anonymous types counters.
121 2008-03-17 Marek Safar <marek.safar@gmail.com>
123 * ecore.cs (MethodGroupExpr): Skip first candidate, it's already the best.
125 * class.cs: Use fullname for all type member definitions.
127 2008-02-19 Martin Baulig <martin@ximian.com>
130 (IMethodData.EmitExtraSymbolInfo): New interface method.
131 (MethodData.Emit): Call method.EmitExtraSymbolInfo().
132 (MethodOrOperator.EmitExtraSymbolInfo): Implement this new
133 interface method here as an empty public virtual method.
136 (AnonymousMethodMethod.ctor): Added `string real_name' argument.
137 (AnonymousMethodMethod.EmitExtraSymbolInfo): Override and call
138 CodeGen.SymbolWriter.SetRealMethodName().
140 2008-02-18 Martin Baulig <martin@ximian.com>
143 (ScopeInfo.EmitType): Override this and emit debugging
144 information for captured variables.
145 (RootScopeInfo.EmitType): Override this and emit symbol
146 information for a captured `this'.
148 2008-02-15 Martin Baulig <martin@ximian.com>
150 * iterators.cs: Emit debugging info.
153 (EmitContext.Flags): Add `OmitDebuggingInfo'.
154 (EmitContext.OmitDebuggingInfo): New public property.
157 (While): Override Emit() and don't emit symbol info there; do it
158 inside DoEmit() instead.
159 (Block.Emit): Omit symbol information while emitting the scope
160 initializers; don't ec.Mark() the `EndLocation'. Fix the lexical
162 (ExplicitBlock.IsIterator): Moved here from `ToplevelBlock'.
163 (ToplevelBlock.MakeIterator): Pass the `flags' to `ExplicitBlock's
164 .ctor to make `IsIterator' work.
166 2008-03-14 Martin Baulig <martin@ximian.com>
168 * symbolwriter.cs: Added the new symbol writer function from the
169 debugger's `terrania' branch; temporarily enclose them inside
170 `#if !DISABLE_TERRANIA_CHANGES' conditionals until I'm back from
173 2008-03-14 Martin Baulig <martin@ximian.com>
176 (SymbolWriter): Make this a public static class.
179 (CodeGen.SymbolWriter): Removed; use the new static `SymbolWriter'
180 class instead of using `if (CodeGen.SymbolWriter != null)' everywhere.
182 2008-03-14 Marek Safar <marek.safar@gmail.com>
184 A fix for bug #370577
185 * statement.cs, lambda.cs: Added extra limitations when dealing with void
188 2008-03-14 Marek Safar <marek.safar@gmail.com>
190 * typemanager.cs (CSharpName): Made 250 times faster.
192 2008-03-13 Marek Safar <marek.safar@gmail.com>
194 * ecore.cs, expression.cs: Emit conversion for ET shift argument.
196 2008-03-12 Marek Safar <marek.safar@gmail.com>
198 * generic.cs, typemanager.cs, enum.cs, codegen.cs, statement.cs: Try not to
199 crash when predefined field does not exist.
201 2008-03-12 Marek Safar <marek.safar@gmail.com>
203 * ecore.cs (PropertyExpr): Fixed IsSingleDimensionalArrayLength regression.
205 2008-03-12 Marek Safar <marek.safar@gmail.com>
207 * class.cs (FixedField): Don't crash when contructors are missing.
209 2008-03-11 Marek Safar <marek.safar@gmail.com>
211 * typemanager.cs, namespace.cs, literal.cs, ecore.cs, class.cs, decl.cs,
212 convert.cs, constant.cs, expression.cs, statement.cs: Use same method to
213 check internal types accessibility for internal and external types.
214 Replaced EnumToUnderlying by GetEnumUnderlyingType.
216 2008-03-11 Marek Safar <marek.safar@gmail.com>
218 * support.cs, typemanager.cs, pending.cs, ecore.cs, class.cs, delegate.cs
219 convert.cs, const.cs, anonymous.cs, constant.cs, expression.cs,
220 attribute.cs, statement: Use corect instance of predefined types (work
223 2008-03-07 Marek Safar <marek.safar@gmail.com>
225 * expression.cs (TypeOfVoid): Fixed predefined method initialization.
227 2008-03-07 Marek Safar <marek.safar@gmail.com>
229 * generic.cs, typemanager.cs, parameter.cs, rootcontext.cs, ecore.cs,
230 class.cs, delegate.cs, iterators.cs, const.cs, constant.cs, driver.cs,
231 expression.cs, attribute.cs, codegen.cs, statement.cs: TypeManager optional
232 predefined types clean up, delayed predefined types members initialization
233 (work related to #364674).
235 2008-03-05 Marek Safar <marek.safar@gmail.com>
237 * typemanager.cs (IsFriendAssembly): InternalsVisibleTo is not mandatory.
239 2008-03-05 Marek Safar <marek.safar@gmail.com>
241 * typemanager.cs, parameter.cs, rootcontext.cs, ecore.cs, class.cs, decl.cs,
242 delegate.cs, convert.cs, driver.cs, attribute.cs, codegen.cs: TypeManager
243 predefined types clean up (work related to #364674).
245 2008-03-04 Marek Safar <marek.safar@gmail.com>
247 * ecore.cs: Print an error message instead of throwing exception.
249 2008-03-04 Marek Safar <marek.safar@gmail.com>
251 * generic.cs, typemanager.cs, literal.cs, convert.cs, cfold.cs, constant.cs,
252 expression.cs, statement.cs: Unififed null literal representation.
254 2008-03-03 Marek Safar <marek.safar@gmail.com>
256 * anonymous.cs, cfold.cs, convert.cs, delegate.cs, doc.cs, ecore.cs,
257 expression.cs: Refactored binary operators resolve phase and improved speed.
258 The nullable code is still missing and won't work correctly, more fixes
261 It also fixes #323726, #324312, #324248, and many other unreported issues.
263 2008-02-29 Zoltan Varga <vargaz@gmail.com>
265 * report.cs (FeatureIsNotAvailable): Use 'mcs1' instead of 'mcs', and 'mcs'
268 2008-02-27 Marek Safar <marek.safar@gmail.com>
270 * ecore.cs: Clean-up and split BetterConversion.
272 2008-02-25 Raja R Harinath <harinath@hurrynot.org>
275 * enum.cs (EnumMember.Value): Only access 'value' if
276 ResolveValue says it's ok.
277 (EnumMember.DoResolveValue): Don't set prev_member.value.
278 (Enum.GetDefinition): Reverse arguments of Equals --
279 EnumMember.Value can return 'null'.
281 * statement.cs (Switch.Error_AlreadyOccurs): Fix typo in name.
283 2008-02-22 Marek Safar <marek.safar@gmail.com>
285 * generic.cs, expression.cs: More ongoing work on expression trees.
287 2008-02-21 Marek Safar <marek.safar@gmail.com>
289 * class.cs, typemanager.cs: Rewrote operator matching logic to correctly
290 handle missing matches when mutiple operators exist.
292 2008-02-20 Marek Safar <marek.safar@gmail.com>
294 A fix for bug #363218
295 * expression.cs (ArrayCreation.Clone): Deal with multi-dimensional
298 2008-02-20 Marek Safar <marek.safar@gmail.com>
300 * expression.cs, constant.cs, cfold.cs: Yet another side-effect constant
301 update. This time to deal correctly with SideEffectConstant expression used
302 as an argument for another constant folding.
304 2008-02-20 Raja R Harinath <harinath@hurrynot.org>
306 * typemanager.cs (DropGenericMethodArguments): Ensure we get an underlying
309 2008-02-19 Marek Safar <marek.safar@gmail.com>
311 * constant.cs, cfold.cs: SideEffectConstant results can apply for folding.
313 2008-02-19 Marek Safar <marek.safar@gmail.com>
315 A fix for bug #328136
316 * expression.cs: Do not fold immediately LogicalAnd operators when the left
317 side is a false constant, because we still need to evaluate the right-hand
320 * statement.cs (If): Emit two types of boolean constants (simple constant,
321 side-effect constant).
323 2008-02-19 Marek Safar <marek.safar@gmail.com>
325 * constant.cs (SideEffectConstant): Don't emit boolean constant.
327 * expression.cs: Fold immediately LogicalAnd operators when both sides are
330 2008-02-18 Marek Safar <marek.safar@gmail.com>
332 A fix for bug #361457
333 * ecore.cs (IsApplicable): Params methods have lower priority.
335 * support.cs: Return correct parameter modifier for params types.
337 2008-02-18 Marek Safar <marek.safar@gmail.com>
339 * generic.cs (TypeParameter): Cache attribute target name.
341 * support.cs: Removed unused variable.
343 * typemanager.cs: Removed debugging leftover.
345 * ecore.cs: Use local type instead of a property;
347 * class.cs (VerifyMembers): Consider also parent to test whether type member
350 * expression.cs (FullMethodDesc): Removed.
352 * attribute.cs (IsValidArgumentType): Made static.
354 2008-02-17 Raja R Harinath <harinath@hurrynot.org>
356 Cleanup to be more readable.
357 * Makefile (GMCS_PROFILE): Remove.
358 (COMPILER_NAME): New helper.
360 2008-02-15 Miguel de Icaza <miguel@novell.com>
362 * cs-tokenizer.cs: if a conditional expression happens inside a
363 (...) this also means that we do not need to de-ambiguate between
364 an parenthesized expression and a cast.
368 * constant.cs (SideEffectConstant): a constant value that happens
369 to have a side effect.
371 Fixes the build regressions introduced by the fix for #359789
373 2008-02-14 Rodrigo Kumpera <rkumpera@novell.com>
375 * expression.cs (Conditional.Emit): when emitting the ternary
376 operator, use local variables to generate code verifiable code.
378 The verifier cannot infer that the type on stack before the
379 stloc.0 is executed is of type ParentB. This happens because the
380 stack merge algorithm uses only parent types when deciding which
381 is the common type. This is described in Part III 1.8.1.3 of ECMA
384 This code compiled with mcs is not verifiable under MS. The MS
385 verifier picks the first common interface of Foo and Bar, which is
386 wrong, but doesn't use a full join type of the 2 interfaces.
388 CSC uses a clever hack to compile such code in a verifiable
389 way. It stores the intermediate values in a local variable with
394 2008-02-14 Miguel de Icaza <miguel@novell.com>
396 * expression.cs: Do not fold BitwiseAnd operators when the left
397 side is a false constant, because we still need to evaluate the
402 * support.cs: Instead of throwing an InternalErrorException when
403 the position of the stream is outside the boundary of our buffer,
404 reset the state of the reader, and restart the reading from the
405 beginning of the file.
407 2008-02-14 Marek Safar <marek.safar@gmail.com>
409 * generic.cs (TypeParameter.GetMembers): Is not supported operation.
411 2008-02-14 Marek Safar <marek.safar@gmail.com>
413 A fix for bug #361686
414 * decl.cs: A protected types used inside a private class which parents
415 derives from the protected class are accessible.
417 2008-02-13 Marek Safar <marek.safar@gmail.com>
419 * generic.cs (ConstraintChecker): Use cached member lookup when looking for
420 the parameterless constructor.
422 2008-02-13 Marek Safar <marek.safar@gmail.com>
424 * generic.cs, typemanager.cs, iterators.cs, codegen.cs: Refactored core
425 lookup methods to use standard member cache when doing member lookup.
427 2008-02-12 Marek Safar <marek.safar@gmail.com>
429 * driver.cs: Don't report full path for referenced module as assembly error.
431 2008-02-12 Marek Safar <marek.safar@gmail.com>
433 * Makefile: Fixed `qh' target to work on all machines.
435 * report.cs, typemanager.cs, parameter.cs, ecore.cs, class.cs, anonymous.cs,
436 expression.cs, codegen.cs, statement.cs, doc.cs: Replaced type IsSubclassOf
437 and HasElementType with TypeManager implementation.
439 2008-02-08 Marek Safar <marek.safar@gmail.com>
441 A fix for bugs #325134, #359749
442 * expression.cs, ecore.cs: Try to resolve an extension method even if the
443 first binds point to non-method member expression.
445 2008-02-08 Marek Safar <marek.safar@gmail.com>
447 * cs-parser.jay: Null coalescing operator is not part of ISO-1.
449 2008-02-08 Marek Safar <marek.safar@gmail.com>
451 A fix for bugs #321394, #323028
452 * generic.cs, parameter.cs, ecore.cs, class.cs, decl.cs, delegate.cs:
453 Reworked naive IsAccessibleAs implementation to handle nested types.
455 2008-02-05 Jb Evain <jbevain@novell.com>
457 * class.cs: use generic type comparison for parameters
460 2008-02-05 Marek Safar <marek.safar@gmail.com>
462 A fix for bug #325372
463 * class.cs: Use generic type comparison when testing method signatures.
465 2008-02-05 Marek Safar <marek.safar@gmail.com>
467 A fix for bug #357047
468 * ecore.cs: Applied C# 3.0 changes to better conversion.
470 2008-02-05 Marek Safar <marek.safar@gmail.com>
472 A fix for bug #358374
473 * cs-parser.jay: Correctly set modifiers for all constructor types.
475 2008-02-04 Marek Safar <marek.safar@gmail.com>
477 A fix for bug #355251
478 * generic.cs: Added base class constraint based type inference.
480 2008-02-01 Marek Safar <marek.safar@gmail.com>
482 A fix for bug #357255
483 * decl.cs: One more missing visibility check.
485 2008-02-01 Marek Safar <marek.safar@gmail.com>
487 * support.cs: Fixed broken return.
489 2008-01-25 Marek Safar <marek.safar@gmail.com>
491 * report.cs: Correctly reset warnings count after probing.
493 2008-01-25 Martin Baulig <martin@ximian.com>
496 (NamespaceEntry.SymbolFileID): Make this work again after
497 MemberName.ToString() is gone.
499 2008-01-25 Marek Safar <marek.safar@gmail.com>
501 * expression.cs: Implemented Divide, Equal, ExclusiveOr, GreaterThanOrEqual
504 2008-01-25 Marek Safar <marek.safar@gmail.com>
506 * generic.cs: Use full implicit conversion for type inference fixing.
508 2008-01-24 Marek Safar <marek.safar@gmail.com>
510 * ecore.cs, expression.cs, generic.cs: Implemented Convert, ConvertChecked.
511 Fixed user operator conversions.
513 2008-01-24 Marek Safar <marek.safar@gmail.com>
515 * generic.cs: Do nullable type to null comparison optimization during
518 2008-01-24 Marek Safar <marek.safar@gmail.com>
520 A fix for bug #355163
521 * generic.cs: Enabled l-value resolve on nullable expressions.
523 2008-01-24 Marek Safar <marek.safar@gmail.com>
525 A fix for bug #353986
526 * class.cs: Ingore static ctors with parameters for any further checks.
528 2008-01-24 Marek Safar <marek.safar@gmail.com>
530 A fix for bug #354310
531 * namespace.cs: Removed redundant check.
533 2008-01-24 Marek Safar <marek.safar@gmail.com>
535 A fix for bug #354928
536 * expression.cs: ElementInitializers can be resolved only once.
538 2008-01-24 Marek Safar <marek.safar@gmail.com>
540 * convert.cs, ecore.cs, expression.cs, generic.cs: Implemented Coalesce and
541 Condition expressions.
543 2008-01-23 Marek Safar <marek.safar@gmail.com>
545 * codegen.cs: Fixed AssemblyBuilder initialization on other platforms.
547 2008-01-22 Marek Safar <marek.safar@gmail.com>
549 * ecore.cs, expression.cs, generic.cs: Implicit bool? to bool conversion is
552 * generic.cs: Implemented coalesce expression.
554 2008-01-22 Marek Safar <marek.safar@gmail.com>
556 A fix for bug #355145
557 * anonymous.cs, convert.cs, ecore.cs, generic.cs, lambda.cs: Implemented
558 expression tree type inference.
560 2008-01-22 Raja R Harinath <harinath@hurrynot.org>
563 * expression.cs (Binary.IsUnsignedType): Fix typo.
565 2008-01-22 Marek Safar <marek.safar@gmail.com>
567 * ecore.cs, expression.cs, generic.cs: Implemented NewArrayInit expression.
569 2008-01-22 Marek Safar <marek.safar@gmail.com>
571 A fix for bug #355161
572 * ecore.cs, expression.cs: Wider range of extension method supported
575 2008-01-22 Gert Driesen <drieseng@users.sourceforge.net>
577 * codegen.cs: Use magic value for AssemblyBuilderAccess to instruct
578 AssemblyBuilder to operate in compiler context. Fixes mcs part of
581 2008-01-22 Marek Safar <marek.safar@gmail.com>
583 A fix for bug #355148
584 * ecore.cs, expression.cs: Correctly report misused ref and out modifiers.
586 2008-01-22 Miguel de Icaza <miguel@novell.com>
588 * expression.cs (CreateExpressionTree): Add support for or and
589 logical or, and indent following the coding conventions.
591 * typemanager.cs (LinqExpression): renamed from
592 ExpressionTreeManager, for a shorter name.
594 Use TypeManager.CoreLookupType to lookup types from our core
595 assemblies and turn those into "Type" variables.
597 Consumers that previously used "Namespace" and "Type" from this
598 class should instead use the TypeExpression which is a type that
599 is fully resolved (without involving the regular C# resolution
602 This typically looks like this:
604 TypeExpression texpr = new TypeExpression (LinqExpression.expression_type, loc);
605 new MemberAccess (texpr, name, type_arguments, loc)
607 This avoids the problem in: #355178
609 2008-01-21 Marek Safar <marek.safar@gmail.com>
611 * cs-parser.jay, expression.cs: Check `namespace alias qualifier' language
612 feature in parser only as we do in other cases.
614 2008-01-21 Marek Safar <marek.safar@gmail.com>
616 * attribute.cs, ecore.cs, class.cs, delegate.cs, expression.cs, linq.cs,
617 typemanager.cs: A refactoring of params arguments to reuse existing
618 expressions (params -> array initializer) to emit params argument instead
619 of specialized handling.
620 It was required by expression tree implementation and it has other benefits
621 as well, we now apply same optimization for params arguments as we do for
624 2008-01-18 Marek Safar <marek.safar@gmail.com>
626 A fix for bug #353526
627 * generic.cs: A type inference of params arguments may not required any
628 temporary array creation.
630 2008-01-18 Marek Safar <marek.safar@gmail.com>
632 A fix for bug #353534
633 * generic.cs, ecore.cs, expression.cs: A method group type inference is
634 supported for delegates only.
636 2008-01-18 Marek Safar <marek.safar@gmail.com>
638 * generic.cs: Fixed 3.0 type inference fixing phase to determine a unique
639 type for more than 1 candidates.
641 2008-01-18 Marek Safar <marek.safar@gmail.com>
643 * typemanager.cs, ecore.cs, expression.cs: Implemented ArrayLength and Call
646 2008-01-16 Marek Safar <marek.safar@gmail.com>
648 * generic.cs, typemanager.cs, lambda.cs, parameter.cs, ecore.cs, constant.cs,
649 expression.cs: Implemented Add, And, AndAlso, and ArrayIndex (without unary
650 operator) expressions.
652 2008-01-16 Zoltan Varga <vargaz@gmail.com>
654 * statement.cs: Avoid declaring an IL variable for this_variable since it is
655 not accessed from the generated IL.
657 2008-01-14 Marek Safar <marek.safar@gmail.com>
659 * typemanager.cs, lambda.cs, parameter.cs, ecore.cs, class.cs, delegate.cs,
660 iterators.cs, convert.cs, assign.cs, anonymous.cs, expression.cs,
661 statement.cs: The first expression tree implementation drop, mostly
664 2008-01-14 Marek Safar <marek.safar@gmail.com>
666 * ecore.cs (IsNestedChild): Refactored.
668 2008-01-11 Marek Safar <marek.safar@gmail.com>
670 * lambda.cs: Don't use a cast on unknown expression statement.
672 2008-01-10 Geoff Norton <gnorton@novell.com>
674 * cs-tokenizer.cs: One more token to distinguish between method and lambda
677 2008-01-09 Marek Safar <marek.safar@gmail.com>
679 * doc.cs: Report better /doc crash details.
681 2008-01-09 Marek Safar <marek.safar@gmail.com>
683 A fix for bug #352536
684 * ecore.cs, assign.cs, codegen.cs: Check event assignments.
686 2008-01-08 Marek Safar <marek.safar@gmail.com>
688 A fix for bug #352287
689 * ecore.cs, expression.cs: Do `this' access checking in all member access
692 2008-01-08 Marek Safar <marek.safar@gmail.com>
694 * rootcontext.cs, driver.cs: Switch to linq mode by default.
696 * report.cs: Reset message stacks.
698 2008-01-08 Marek Safar <marek.safar@gmail.com>
700 * generic.cs (InferInPhases): Correctly calculate params position.
702 2008-01-08 Marek Safar <marek.safar@gmail.com>
704 * cs-tokenizer.cs: No need to parse full string when parsing lambda
707 2008-01-07 Marek Safar <marek.safar@gmail.com>
709 * cs-tokenizer.cs: Enabled lambda arguments micro-parser for all profiles.
711 * decl.cs (LookupNamespaceOrType): Don't cache names which caused an error.
713 * driver.cs: Updated --help option.
715 2008-01-07 Marek Safar <marek.safar@gmail.com>
717 * generic.cs (InferParamsTypeArguments): Removed.
718 (InferInPhases): Add params type inference.
719 (LowerBoundInference): Fixed scoring mechanism.
721 * cs-tokenizer.cs (PreProcessPragma): Use Location instead of line.
723 2008-01-06 Gert Driesen <drieseng@users.sourceforge.net>
725 * typemanager.cs: On 2.0 profile, GetPublicKeyToken returns an empty
726 byte array for unsigned "baked" assemblies.
728 2008-01-05 Gert Driesen <drieseng@users.sourceforge.net>
730 * codegen.cs: AssemblyName.GetPublicKey returns a zero-length byte
731 array for assemblies that are not strongnamed.
733 2008-01-04 Marek Safar <marek.safar@gmail.com>
735 A fix for bug #351481
736 * expression.cs (MemberAccess.ResolveNamespaceOrType): Use correct
737 declaring type for nested generic types.
739 2008-01-04 Marek Safar <marek.safar@gmail.com>
741 * namespace.cs, class.cs, decl.cs, cs-parser.jay: Use GetSignatureForError
744 2008-01-03 Marek Safar <marek.safar@gmail.com>
746 A fix for bug #351047
747 * expression.cs (Binary.ResolveOperator): Allow equality operators between
748 null and structs only when equality and inequality operators are defined
749 either as an user-operators or predefined operators.
751 2008-01-03 Marek Safar <marek.safar@gmail.com>
753 A fix for bug #351047
754 * generic.cs, typemanager.cs, class.cs: New IsReferenceType helper method.
756 2008-01-03 Marek Safar <marek.safar@gmail.com>
758 A fix for bug #351257
759 * cs-tokenizer.cs: Advance line number for '\r' correctly.
761 2008-01-03 Marek Safar <marek.safar@gmail.com>
763 A fix for bug #351157
764 * class.cs (Using): Fixed yet another broken cloning.
766 (Block): Put back more sensible default value for statements.
768 2008-01-01 Gert Driesen <drieseng@users.sourceforge.net>
770 * codegen.cs: Allow AssemblyVersion with only major version component.
773 2007-12-29 Marek Safar <marek.safar@gmail.com>
775 A fix for bug #324654
776 * class.cs: Use FullName property as member name.
778 2007-12-28 Marek Safar <marek.safar@gmail.com>
780 A fix for bug #342117
781 * generic.cs (ConstraintChecker): Struct constraint also satisfies default
782 constructor constraint.
784 2007-12-28 Marek Safar <marek.safar@gmail.com>
786 A fix for bug #338273
787 * class.cs (ProbertyBase): Access modifier checks are required for overrides
790 2007-12-28 Marek Safar <marek.safar@gmail.com>
792 A fix for bug #350839
793 * ecore.cs (MethodroupExpr): Probing hacks are no longer required.
795 2007-12-27 AdTsai (http://code.google.com/u/AdTsai/)
797 Reviewed by Ben Maurer, Miguel de Icaza, patches from Google's
800 http://code.google.com/p/google-highly-open-participation-mono/issues/detail?id=4
802 * statement.cs: Changed some Hashtables to use HybridDictionaries
803 instead. It was observed that some HashTables only contained a few
804 items in the vast majority of cases. Since HybridDictionary is
805 more efficient on small sets (<10 elements), "known_variables"
806 from class ExplicitBlock as well as "labels" and "constants " from
807 class Block were changed to HybridDictionaries.
809 Atsai results: (56216kb->54987kb)
811 Miguel results (bootstrap of mcs): 59819kb -> 59290kb
814 2007-12-27 AdTsai (http://code.google.com/u/AdTsai/)
816 Reviewed by Ben Maurer, Miguel de Icaza, patches from Google's
819 http://code.google.com/p/google-highly-open-participation-mono/issues/detail?id=4
821 * expression.cs: foreach loop to for loop, saved on allocation of
822 enumerator (59333kb->59141kb)
824 * statement.cs. Changed foreach loops to for loops, saved on
825 allocation of enumerator (59141kb->59006kb)
827 * decl.cs: ArrayLists in .NET 1.1 allocate 16 elements by default
828 when constructed with no specified capacity. This was causing a
829 few ArrayLists to allocate more memory than they would potentially
830 need in the Block class and MemberCache class. Setting the
831 ArrayLists to construct with a capacity of 1 saves some
832 memory. (56216kb->55585kb)
834 2007-12-27 Marek Safar <marek.safar@gmail.com>
836 A fix for bug #347189 (2nd issue)
837 * expression.cs (MemberAccess): Nested type can be found in base non-generic
840 2007-12-27 Miguel de Icaza <miguel@novell.com>
842 * report.cs: Do not use colors if stdout and stderr are not a
845 2007-12-27 Marek Safar <marek.safar@gmail.com>
847 A fix for bug #346998
848 * ecore.cs (MethodGroupExpr): Implemented override filter for generic
851 2007-12-27 Marek Safar <marek.safar@gmail.com>
853 A fix for bug #343465
854 * class.cs: Explicit method name for nested types uses dots only.
856 2007-12-27 Marek Safar <marek.safar@gmail.com>
858 A fix for bug #343707
859 * cs-tokenizer.cs: Advance line number for mixed CR/LF files correctly.
861 2007-12-27 Marek Safar <marek.safar@gmail.com>
863 * ecore.cs: Report type inference errors only when arguments count matches
866 * generic.cs (NullCoalescingOperator): Cannot be applied to null.
868 * expression.cs, report.cs: New warning.
870 * typemanager.cs: Catch anonymous method type too.
872 2007-12-23 Marek Safar <marek.safar@gmail.com>
874 A fix for bug #346379
875 * expression.cs (UnaryMutator): Emit size of type for pointer mutator.
877 2007-12-23 Marek Safar <marek.safar@gmail.com>
879 A fix for bug #347359
880 * expression.cs (Invocation): Don't resolve already resolved expression.
882 2007-12-23 Marek Safar <marek.safar@gmail.com>
884 A fix for bug #347189
885 * class.cs (FixedField): Use non-dependent code only in the define phase.
887 2007-12-23 Marek Safar <marek.safar@gmail.com>
889 A fix for bug #348076
890 * ecore.cs (FieldExpr.DoResolve): Allow any variable based expression.
892 2007-12-22 Marek Safar <marek.safar@gmail.com>
894 * ecore.cs (MethodGroupExpr.OverloadResolve): Set type arguments for
895 discovered extension methods.
897 2007-12-22 Marek Safar <marek.safar@gmail.com>
899 * ecore.cs, namespace.cs, expression.cs: Removed broken ResolveGeneric
902 2007-12-21 Miguel de Icaza <miguel@novell.com>
904 * report.cs (ErrorMessage): Add support for using colors on
905 terminals that support it.
907 2007-12-21 Marek Safar <marek.safar@gmail.com>
909 * ecore.cs: Use information about expanded params for error reporting.
911 2007-12-21 Marek Safar <marek.safar@gmail.com>
913 * ecore.cs, generic.cs, delegate.cs: Refactoring of method overloading code
914 and logic for params overloads.
916 2007-12-15 Miguel de Icaza <miguel@novell.com>
918 * generic.cs (NullCoalescingOperator.CloneTo): implement this one,
919 as this is also created from the parser. Fixes #349034
921 2007-12-12 Miguel de Icaza <miguel@novell.com>
923 * statement.cs (Throw.CloneTo): it is valid to have empty
924 expressions for throw.
926 2007-12-03 Marek Safar <marek.safar@gmail.com>
928 * cs-parser.jay: Set delegate constraint parsing region correctly.
930 2007-12-03 Marek Safar <marek.safar@gmail.com>
932 A fix for bug #345467
933 * typemanager.cs (IsEqual): Compare generic parameters position only.
935 2007-11-28 Marek Safar <marek.safar@gmail.com>
937 * expression.cs (BaseAccess): Type arguments can be null.
939 2007-11-27 Raja R Harinath <harinath@gmail.com>
941 * statement.cs (Block.Resolve): Ensure flow-branching tree is
942 consistent even when an error has occured.
943 (Switch.Resolve): Likewise.
945 2007-11-22 Marek Safar <marek.safar@gmail.com>
947 A fix for bug #334505
948 * class.cs: Don't ignore InternalsVisibleTo attribute for internal
951 2007-11-22 Marek Safar <marek.safar@gmail.com>
953 * ecore.cs, typemanager.cs, delegate.cs, expression.cs: The first of
954 refactorings required to resolve extension methods correctly when mixing
955 generics and non-generics members.
957 2007-11-20 Marek Safar <marek.safar@gmail.com>
959 A fix for bug #342584
960 * convert.cs: Added not documented explicit IntPtr/UIntPtr to enum
963 2007-11-19 Marek Safar <marek.safar@gmail.com>
965 A fix for bug #342512
966 * delegate.cs: Use delegate argument expression when is available. Don't
967 emit virtual call when class is sealed.
969 2007-11-16 Marek Safar <marek.safar@gmail.com>
971 A fix for bug #325423
972 * assign.cs (FieldInitializer): Use resolved expression for emit.
974 * class.cs: Print less confusing error message.
976 2007-11-16 Marek Safar <marek.safar@gmail.com>
978 * cs-tokenizer.cs: Removed GMCS ifdefs.
980 * rootcontext.cs, report.cs: Report unavailable gmcs features used by
983 * cs-parser.jay: Disabled nullable check.
985 * generic-mcs: Copied more generic stuff.
987 2007-11-16 Marek Safar <marek.safar@gmail.com>
989 * gcs-parser.jay: Merged to cs-parser.jay.
991 * generic.cs, typemanager.cs, cs-tokenizer.cs, linq.cs, Makefile
992 * *.csproj, *.sources: Updated to use only jay parser file.
994 2007-11-16 Marek Safar <marek.safar@gmail.com>
996 * gcs-parser.jay: Added nullable and default expression feature checks.
998 2007-11-16 Marek Safar <marek.safar@gmail.com>
1000 * gcs-parser.jay, cs-parser.jay, class.cs: Unified parameters parsing,
1001 it fixes many TODOs and hidden bugs.
1003 * expression: Removed duplicate error check.
1005 2007-11-15 Marek Safar <marek.safar@gmail.com>
1007 * gcs-parser.jay, statement.cs, decl.cs, ecore.cs: Try to resolve an
1008 implicitly type local variable only when it is used in a declaration.
1010 2007-11-15 Marek Safar <marek.safar@gmail.com>
1012 * attribute.cs: Use CS0612 for empty strings.
1014 2007-11-14 Marek Safar <marek.safar@gmail.com>
1016 * lambda.cs, statement.cs: Contextual return may act as a statement.
1018 2007-11-14 Marek Safar <marek.safar@gmail.com>
1020 A fix for a regression cause by #324222
1021 * class.cs: Don't report unused even when it implements an interface.
1023 2007-11-13 Marek Safar <marek.safar@gmail.com>
1025 A fix for bug #341205
1026 * ecore.cs, expression.cs: Method group expression cannot do static
1027 method access with an instance reference check before overloading takes
1030 2007-11-13 Marek Safar <marek.safar@gmail.com>
1032 A fix for bug #325359
1033 * class.cs: Use predictable name for automatically generated property.
1035 2007-11-12 Marek Safar <marek.safar@gmail.com>
1037 A fix for bug #324996
1038 * expression.cs (Is): Handle case where D is nullable and T is not
1041 * generics.cs (Nullable.HasValue): Nullable HasValue expression.
1043 2007-11-12 Marek Safar <marek.safar@gmail.com>
1045 * generic.cs, literal.cs, ecore.cs, class.cs, delegate.cs, const.cs,
1046 anonymous.cs, expression.cs, attribute.cs, codegen.cs, statement.cs:
1047 Flush small error reporting changes.
1049 2007-11-09 Marek Safar <marek.safar@gmail.com>
1051 A fix for bug #324996
1052 * expression.cs: Rewrote Is expression implementation to work with
1053 generics, nullable types, anonymous method. A const result expression
1054 uses existing infrastructure instead of custom not fully-featured one.
1056 2007-11-08 Marek Safar <marek.safar@gmail.com>
1058 A fix for bug #340202
1059 * class.cs: Consider generics for volatile field.
1061 2007-11-08 Marek Safar <marek.safar@gmail.com>
1063 A fix for bug #335594
1064 * expression.cs: Use conversion rules when handling string addition.
1066 2007-11-07 Marek Safar <marek.safar@gmail.com>
1068 A fix for bug #336651
1069 * expression.cs: Fixed a crash when probing is on.
1071 2007-11-07 Marek Safar <marek.safar@gmail.com>
1073 A fix for bug #324242
1074 * covert.cs: Added a conversion from any nullable-type with an
1075 underlying enum-type to the type System.Enum.
1077 2007-11-07 Marek Safar <marek.safar@gmail.com>
1079 A fix for bug #324222
1080 * class.cs: Report all non-used event fields.
1082 2007-11-07 Marek Safar <marek.safar@gmail.com>
1084 A fix for bug #325161
1085 * cs-parser.jay, gcs-parser.jay, decl.cs: Implemented namespace alias
1086 qualifier for generic types.
1088 2007-11-07 Marek Safar <marek.safar@gmail.com>
1090 A fix for bug #322971
1091 * expression.cs, ecore.cs: Added intermediate result value check for
1094 2007-11-07 Marek Safar <marek.safar@gmail.com>
1096 A fix for bug #324754
1097 * cs-parser.jay, gcs-parser.jay, class.cs: Try to create an interator
1098 when it was requested.
1100 2007-11-07 Marek Safar <marek.safar@gmail.com>
1102 A fix for bug #325101
1103 * expression.cs: Do type not value comparison for `is' expression.
1105 2007-11-07 Marek Safar <marek.safar@gmail.com>
1107 A fix for bug #320236
1108 * convert.cs: Don't apply user conversion on underlying target type.
1110 2007-11-06 Marek Safar <marek.safar@gmail.com>
1112 * expression.cs: Don't use unresolved expression for error reporting.
1114 2007-11-06 Marek Safar <marek.safar@gmail.com>
1116 A fix for bugs #337712, #324490
1117 * ecore.cs (MethodGroupExpr): Refactored to handle delegate method
1118 overloading resolution too.
1120 * delegate.cs: Uses MethodGroupExpr for overloading resolution. It makes
1121 the process consistent and more robust.
1123 * expression.cs, linq.cs, report.cs: Update.
1125 2007-11-02 Marek Safar <marek.safar@gmail.com>
1127 A fix for bug #332909
1128 * attribute.cs: Resolve attributes in correct context using error
1131 * rootcontext.cs: Define Obsolete attribute members as core members.
1133 2007-11-02 Marek Safar <marek.safar@gmail.com>
1135 * statement.cs: Removed unused methods.
1137 2007-10-31 Wade Berrier <wberrier@novell.com>
1139 * Makefile: reenable copy of gmcs.exe.config, but include it in EXTRA
1140 DIST (it doesn't get included because PROGRAM isn't defined to be gmcs
1143 2007-10-31 Marek Safar <marek.safar@gmail.com>
1145 A fix for bug #338102
1146 * decl.cs (CheckExistingMembersOverloads): Workaround issue with generic
1147 methods registered as non-generics.
1149 2007-10-31 Marek Safar <marek.safar@gmail.com>
1151 A fix for bugs #337712, #324490
1152 * delegate.cs: Delegate covariance and contravariance is not allowed for
1155 2007-10-31 Marek Safar <marek.safar@gmail.com>
1157 A fix for bug #337719
1158 * cs-tokenizer.cs: Restore identifier buffer when parsing contextual
1161 2007-10-30 Marek Safar <marek.safar@gmail.com>
1163 * Makefile (net_2_0_bootstrap/mcs.exe.config): Reverted copy gmcs.exe.config.
1165 2007-10-29 Marek Safar <marek.safar@gmail.com>
1167 * cs-tokenizer.cs, gcs-parser.jay, driver.cs: Fixed parsing of nested
1170 2007-10-29 Raja R Harinath <rharinath@novell.com>
1172 * Makefile (net_2_0_bootstrap/mcs.exe.config): Copy gmcs.exe.config.
1174 2007-10-29 Marek Safar <marek.safar@gmail.com>
1176 A fix for bug #334652
1177 * ecore.cs (MethodGroupExpr.OverloadResolve): Do also lookup for
1178 extension methods when we have not found the best candidate in normal
1181 2007-10-27 Marek Safar <marek.safar@gmail.com>
1183 * AssemblyInfo.cs: Keep up-to-date.
1185 2007-10-27 Marek Safar <marek.safar@gmail.com>
1187 * Makefile: Fixed generics compiler name.
1189 2007-10-27 Marek Safar <marek.safar@gmail.com>
1191 * lambda.test: removed, lambda parsing is done differently.
1193 * gen-il.cs, gen-treedump.cs, old-code.cs : Obsolete.
1195 2007-10-27 Gert Driesen <drieseng@users.sourceforge.net>
1197 * Makefile: Removed dependency on gmcs.exe.config. Fixes build.
1199 2007-10-27 Marek Safar <marek.safar@gmail.com>
1201 * Makefile, *.sources : All C# compilers are in mcs folder.
1203 * *.cs: Use existing 2_1 define for smcs.
1205 2007-10-26 Marek Safar <marek.safar@gmail.com>
1207 A fix for bug #335847
1208 * assign.cs, expression.cs: Couple of changes to avoid creating a
1209 temporary variable for each object initializer assignment statement. It
1210 simplifies struct initialization too, otherwise two temporary variables
1212 Implemented optimization of redundant default element initializers.
1214 2007-10-25 Marek Safar <marek.safar@gmail.com>
1216 A fix for bug #336766
1217 * expression.cs (Class.CheckBase): Use generic name when method is
1220 2007-10-25 Marek Safar <marek.safar@gmail.com>
1222 A fix for bug #334737
1223 * expression.cs (IndexerAccess.EmitAssign): Emit local temporary
1224 variable and not variable argument for prepared copies.
1226 2007-10-24 Marek Safar <marek.safar@gmail.com>
1228 A fix for bug #325110
1229 * class.cs, expression.cs, attribute.cs: Use open generic method when
1230 checking conditional attribute.
1232 2007-10-24 Marek Safar <marek.safar@gmail.com>
1234 * report.cs, cs-tokenizer.cs, class.cs, cs-parser.jay, anonymous.cs,
1235 expression.cs, statement.cs: Renamed method FeatureIsNotISO to
1236 FeatureIsNotAvailable.
1238 2007-10-24 Marek Safar <marek.safar@gmail.com>
1240 ** C# 3.0 Partial methods
1242 * cs-tokenizer.cs, support.cs, class.cs, decl.cs: Implemented partial
1243 methods support. Because of member cache issue with generics only
1244 non-generics partial methods are fully supported.
1246 2007-10-23 Marek Safar <marek.safar@gmail.com>
1248 * class.cs, decl.cs: Rewrote member overloads check to cope with
1249 generics and to use member cache for member checking. It also improves
1250 performance and fixes remaining overloads issues.
1252 2007-10-20 Marek Safar <marek.safar@gmail.com>
1254 * class.cs, const.cs, decl.cs, delegate.cs, enum.cs, generic.cs,
1255 roottypes.cs, typemanager.cs:
1257 A member cache creation logic changed to add members immediately and
1258 not rely on fallback. The member cache is now only prefered way
1259 how to access and find type declaration members. It saves 5 MB of memory
1260 during MWF compilation and makes code ready for more optimizations and
1261 clean-ups, it's also a pre-requirement for partial methods.
1263 2007-10-18 Raja R Harinath <harinath@gmail.com>
1265 * ecore.cs (Expression.Error_ValueCannotBeConverted): Add special
1266 handling for generic parameters.
1268 2007-10-15 Marek Safar <marek.safar@gmail.com>
1270 * class.cs (FixedField): Removed redundant volatile check.
1272 2007-10-15 Marek Safar <marek.safar@gmail.com>
1274 * class.cs, decl.cs: Fixed overload members verification to do only one
1275 check per possible collision.
1277 2007-10-13 Marek Safar <marek.safar@gmail.com>
1279 A fix for bug #325478
1280 * anonymous.cs (AnonymousContainer.Compatible): Merge are flags together
1281 and create only one disposable flags container.
1283 2007-10-12 Marek Safar <marek.safar@gmail.com>
1285 A fix for bug #332442 by Alexandre Gomes <alexmipego@gmail.com>
1286 * statement.cs (Fixed): Fixed variables cloning.
1288 2007-10-12 Marek Safar <marek.safar@gmail.com>
1290 A fix for bug #333342
1291 * class.cs (EventField): Don't mark value type event as synchronized.
1293 2007-10-12 Marek Safar <marek.safar@gmail.com>
1295 * ecore.cs, anonymous.cs (MethodGroupExpr): Use score from type
1296 inference to identify best candidate method correctly.
1297 (ProperyExpr): A range variable is read only and cannot be modified.
1299 2007-10-11 Marek Safar <marek.safar@gmail.com>
1301 * ecore.cs, delegate.cs (MethodGroupExpr): Refactored best candidate
1302 logic to identify best candidate method correctly.
1304 2007-10-11 Marek Safar <marek.safar@gmail.com>
1306 * location.cs (Equals, GetHashCode): Removed.
1308 2007-10-11 Marek Safar <marek.safar@gmail.com>
1310 * report.cs: Implemented message recorder. It is used mainly for lambda
1311 expressions to capture otherwise swallowed error messages.
1313 * anonymous.cs, lambda.cs.cs: Do full parameters check.
1315 * ecore.cs (ExtensionMethodGroup): Report binding failure at the botton
1317 (MethodGroupExpr.DoResolve): Use message recorder for error handling.
1319 * expression.cs (MemberAccess): Always report lookup failure.
1321 * location.cs: Implemented Equals, GetHashCode.
1323 * statement.cs (Return.DoResolve): Fixed hardcoded error argument.
1325 2007-10-10 Jb Evain <jbevain@novell.com>
1327 * codegen.cs: re-enable assembly version check.
1329 2007-10-09 Marek Safar <marek.safar@gmail.com>
1331 * report.cs, anonymous.cs, driver.cs, expression.cs: Added few ISO-2
1334 * namespace.cs (UsingAlias): Do correct version check.
1336 2007-10-08 Marek Safar <marek.safar@gmail.com>
1338 * expresison.cs, ecore.cs: Issue extension method error message when
1341 * rootcontext.cs: Added ISO_2 compiler mode option.
1343 2007-10-08 Marek Safar <marek.safar@gmail.com>
1345 * expresison.cs (UnaryMutator.ResolveOperator): Print more useful error
1348 2007-10-08 Marek Safar <marek.safar@gmail.com>
1350 * attribute.cs (GetString, GetBoolean): Work with both literal and
1353 * ecore.cs, expresison.cs, delegate.cs (Invocation, MethodGroupExpr):
1354 Moved method overload specific methods to MethodGroupExpr.
1356 (IndexerAccess): Re-wrote resolving mechanism, fixed many issues and
1357 it should be less memory consuming.
1359 Mon Oct 8 09:29:15 CEST 2007 Paolo Molaro <lupus@ximian.com>
1361 * codegen.cs: remove the assembly version check until the buildbot is
1364 2007-10-07 Jb Evain <jbevain@novell.com>
1366 * attribute.cs (Attribute.GetString): if the value
1367 expression is a StringConstant, return its string value.
1369 2007-10-07 Jb Evain <jbevain@novell.com>
1371 * typemanager.cs: add `assembly_version_attribute_type`.
1372 * codegen.cs: on attribute emission, check that the
1373 AssemblyVersionAttribute doesn't overflow.
1375 2007-10-05 Marek Safar <marek.safar@gmail.com>
1377 A fix for bug #324677
1378 * anonymous.cs, decl.cs: Yes another anonymous container hack. Overwrite
1379 parent container of a scope container with currently resolved one.
1381 2007-10-05 Marek Safar <marek.safar@gmail.com>
1383 A fix for bug #325534
1384 * class.cs (Invocation.DoResolve): Check invocation of object finalizer
1387 2007-10-05 Marek Safar <marek.safar@gmail.com>
1389 A fix for bug #327504
1390 * class.cs (Operator.Define): Refactored implicit and explicit user
1391 operator conversion rules.
1393 2007-10-05 Marek Safar <marek.safar@gmail.com>
1395 A fix for bug #327520
1396 * ecore.cs (ExtensionMethodGroupExpr): Emit resolved extension argument.
1398 2007-10-04 Marek Safar <marek.safar@gmail.com>
1400 A fix for bug #328022
1401 * class.cs (MethodData.Define): Use correct method to check whether
1402 a method implementents an accessor.
1404 2007-10-04 Marek Safar <marek.safar@gmail.com>
1406 A fix for bug #330069
1407 * statement.cs (Fixed.Resolve): Read the first array element only when
1408 an array is instantiated.
1410 2007-10-04 Marek Safar <marek.safar@gmail.com>
1412 * expression.cs, assign.cs, generics.cs: Print correct operator when
1413 compound assignment is used.
1415 2007-10-04 Marek Safar <marek.safar@gmail.com>
1417 A fix for bug #325841
1418 * expression.cs (ArrayAccess): Use full argument cloning only for
1419 string compound concatenation.
1421 2007-10-03 Marek Safar <marek.safar@gmail.com>
1423 A fix for bug #328774
1424 * ecore.cs (FieldExpr.EmitAssign): Fixed string concatenation compound
1426 (PropertyExpr.EmitAssign): Fixed string concatenation compound
1429 2007-10-03 Raja R Harinath <rharinath@novell.com>
1432 * ecore.cs (SimpleName.DoSimpleNameResolve): Handle Property and
1433 Event accessibility checks here. Remove some bogus code that
1434 accidently made GenericMethods work.
1435 (PropertyExpr.IsAccessibleFrom, EventExpr.IsAccessibleFrom): New.
1437 2007-09-25 Marek Safar <marek.safar@gmail.com>
1439 * expression.cs (ArrayCreation): Fixed cloning of an implicit types.
1441 * statement.cs (Block): Refactored AddVariable to allow error handling
1444 * generic.cs: New stub.
1446 2007-09-23 Marek Safar <marek.safar@gmail.com>
1448 * anonymous.cs, codegen.cs: Changed InferReturnType to be EmitContext
1451 2007-09-17 Marek Safar <marek.safar@gmail.com>
1453 * class.cs: Use partial container to record whether any partial part
1454 contains static field initializer and therefore default contructor has
1457 2007-09-14 Marek Safar <marek.safar@gmail.com>
1459 * class.cs (TypeContainer.AddPartial): Fixed an issue reported on
1460 mono-list when only one of two partial parts has defined accessibility
1463 2007-09-14 Marek Safar <marek.safar@gmail.com>
1465 A fix for bug #82845
1467 * class.cs (TypeContainer): Set correct resolve context for all field
1470 2007-09-13 Marek Safar <marek.safar@gmail.com>
1472 * assign.cs: Fixed a crash when field is resolved twice with an error.
1474 * codegen.cs: Changed InFieldInitializer to be flag.
1476 * anonymous.cs, ecore.cs, expression.cs: Update after
1477 IsInFieldInitializer rename.
1479 * const.cs: Removed unused parameter.
1481 * class.cs: Changed the way how we resolve and emit field initializers.
1482 The field initilizers have to have access to contructor block to emit
1483 compiler generated code.
1485 2007-09-13 Marek Safar <marek.safar@gmail.com>
1487 * expression.cs (MemberAccess.DoResolve): DeclSpace is broken by
1488 generics use TypeContainer instead.
1490 2007-09-12 Marek Safar <marek.safar@gmail.com>
1492 * generic.cs (TypeInferenceContext.InflateGenericArgument): Stub.
1494 * lambda.cs (ResolveParameters): Use more powerful
1495 InflateGenericArgument.
1497 * parameters.cs: Better exception message.
1499 2007-09-10 Marek Safar <marek.safar@gmail.com>
1501 * anonymous.cs (AnonymousMethodExpression.CompatibleChecks): Report
1502 correct expression block type.
1504 * ecore.cs (Expression.Error_MemberLookupFailed): Made virtual.
1506 * expression.cs (Invocation): Extracted method group resolve to
1509 2007-09-07 Marek Safar <marek.safar@gmail.com>
1511 * ecore.cs (Expression.MemberLookupFinal): Removed unused loc parameter.
1512 (MethodGroupExpr.ResolveGeneric): Use existing method group instance.
1514 * expression.cs (MemberAccess.DoResolve): Uses generic resolver for
1515 generic extension methods.
1517 2007-09-06 Marek Safar <marek.safar@gmail.com>
1519 A fix for bug #82676 (Do I get it right now?)
1520 * convert.cs (Binary.ResolveOperator): An interface is converted to the
1521 object before a standard conversion is applied.
1523 2007-09-06 Marek Safar <marek.safar@gmail.com>
1525 * convert.cs (ImplicitReferenceConversionCore): Reverted wrong fix of
1528 2007-09-05 Marek Safar <marek.safar@gmail.com>
1530 A fix for bug #82676
1531 * convert.cs (ImplicitReferenceConversionCore): Check both sides for
1532 non-generic interface types.
1534 2007-09-05 Marek Safar <marek.safar@gmail.com>
1536 A fix for bug #82690
1537 * ecore.cs (PropertyExpr.EmitAssign): Leave a copy does just that.
1539 2007-09-05 Marek Safar <marek.safar@gmail.com>
1541 A fix for bug #82571
1542 * anonymous.cs (AnonymousMethod.DoCreateMethodHost): Use internal
1543 modifier for container based methods.
1545 2007-09-05 Marek Safar <marek.safar@gmail.com>
1547 A fix for bug #82676
1548 * convert.cs (ImplicitReferenceConversionCore): From any class-type S to
1549 any interface-type T means to any of interface type T.
1551 2007-09-04 Marek Safar <marek.safar@gmail.com>
1553 * namespace.cs: We have 2 versions of System.Core assembly.
1555 2007-09-04 Marek Safar <marek.safar@gmail.com>
1557 A fix for bug #82652
1558 * class.cs (Class.GetClassBases): Compare types and not expressions.
1560 2007-09-04 Marek Safar <marek.safar@gmail.com>
1562 A fix for bug #82620
1563 * expression.cs (Invocation.EmitArguments): Duplicate params arguments
1564 actually never worked before.
1565 (IndexerAccess): Emit prepared arguments before they are modified.
1567 2007-09-04 Marek Safar <marek.safar@gmail.com>
1569 A fix for bug #82563
1570 * assign.cs: Revert wrong fix.
1572 * expression.cs (VariableReference.EmitAssign): Handle ref reference
1574 (ArrayAccess): Changed the way we emit compound (prepared) assignments.
1575 Instead of ldelema/stdind we have to use temporary variables to handle
1576 cases like String.Concat (params string[]).
1578 2007-08-31 Marek Safar <marek.safar@gmail.com>
1580 * class.cs: EmitAttributes to Emit rename.
1582 * decl.cs (MemberCore.GetClsCompliantAttributeValue): Parent can be
1584 (MemberCore.HasClsCompliantAttribute): Don't depend on
1585 GetClsCompliantAttributeValue execution.
1587 2007-08-31 Marek Safar <marek.safar@gmail.com>
1589 * anonymous.cs: Use shorter type prefix.
1591 * ecore.cs (SimpleName.DoSimpleNameResolve): Use transparent identifiers
1594 * expression.cs (LocalVariableReference.DoResolveBase): Don't capture
1595 variables when probing is on.
1597 * statement.cs (LocaLInfo.Clone): Clone correctly resolved and
1598 unresolved variables.
1599 (TopLevelBlock.GetTransparentIdentifier): Default implementation doesn't
1600 handle transparent identifiers.
1602 2007-08-26 Marek Safar <marek.safar@gmail.com>
1604 * attribute.cs (IsClsCompliant): Add nullable types test.
1606 2007-08-24 Atsushi Enomoto <atsushi@ximian.com>
1608 * doc.cs : catch other types of exception than XmlException to
1609 report CS1570. Fixed bug #82565.
1611 2007-08-23 Marek Safar <marek.safar@gmail.com>
1613 * anonymous.cs (AnonymousMethodExpressin.ExplicitTypeInference):
1614 The number of delegate parameters has to match.
1615 (AnonymousMethodExpressin.VerifyParameterCompatibility): Handles generic
1618 2007-08-21 Marek Safar <marek.safar@gmail.com>
1620 * anonymous.cs (AnonymousMethod): Generate private anonymous method
1621 to fix problem with private arguments.
1623 2007-08-20 Marek Safar <marek.safar@gmail.com>
1625 * anonymous.cs (AnonymousTypeClass): An anonymous type can be empty.
1627 * decl.cs (MemberName): Ignore generic type with no generic arguments.
1629 * expression.cs (AnonymousTypeDeclaration): An anonymous type can be
1630 empty. Add cloning suport.
1632 * roottypes.cs (GetAnonymousType): Fixed argument comparison logic.
1634 2007-08-20 Marek Safar <marek.safar@gmail.com>
1636 * convert.cs, ecore.cs, expression.cs, literal.cs: Use factory method
1637 to create EmptyCast. It handles EmptyConstantCast specialization for
1640 2007-08-18 Marek Safar <marek.safar@gmail.com>
1642 * expression.cs (Binary.is_unsigned): Handle unsafe types too.
1643 (EmitArrayArgument): One routine for array arguments.
1644 (ArrayCreation.MakeByteBlob): Fixed an array alignment.
1646 2007-08-17 Marek Safar <marek.safar@gmail.com>
1648 * cs-tokenizer.cs (GetKeyword): Handle from keyword in a different way.
1650 2007-08-17 Marek Safar <marek.safar@gmail.com>
1652 * anonymous.cs: MemberLookupFinal update.
1654 * class.cs (ConstructorInitializer): Is expression based.
1656 * delegate.cs: MethodGroupExpr update.
1658 * ecore.cs (Error_MemberLookupFailed): Improved to report better error
1660 (Error_MemberLookupFailed): Customizable error override.
1661 (MethodGroupExpr): Keep queried type for later usage.
1662 (MethodGroupExpr.OverloadResolve): Catch errors related to overload
1665 * expression.cs: Error_MemberLookupFailed refactoring.
1666 (New.DoResolve): Resolve as much as possible.
1667 (ElementInitializer.Error_MemberLookupFailed): Object initializer
1668 customization for invalid member types.
1670 * statement.cs: MethodGroupExpr update.
1672 2007-08-16 Marek Safar <marek.safar@gmail.com>
1674 * modifier.cs (Check): Check all modifiers and not only accessibility
1677 2007-08-16 Marek Safar <marek.safar@gmail.com>
1679 * ecore.cs (Expression.Error_ValueCannotBeConverted): Report always a
1680 type and not an expression.
1682 2007-08-16 Marek Safar <marek.safar@gmail.com>
1684 * statement.cs (Catch.Clone): Type and variable can be null.
1686 2007-08-16 Marek Safar <marek.safar@gmail.com>
1688 A fix for bug #81979
1689 * assign.cs (Assign.Emit): Prepare arguments for string concatenation.
1690 I am really not sure whether this is the best fix.
1692 * expression.cs (VariableReference.EmitAssign): Do prepare_load test
1695 2007-08-14 Marek Safar <marek.safar@gmail.com>
1697 ** C# 3.0 Object and collection initializers (major re-write)
1699 * assign.cs (DoResolve): Initializers are not assign related.
1701 * codegen.cs (EmitContext.CurrentInitializerVariable): Holds a varible
1702 used during collection or object initialization.
1704 * expression.cs (Error_InvalidArguments): Add initializers specific
1705 messages. More will come later because it requires some general
1707 (New.DoResolve): Better error handling for unsafe types.
1708 (EmptyExpressionStatement): New class.
1709 (ElementInitializer): An object initializer expression.
1710 (CollectionElementInitializer): A collection initializer expression.
1711 (CollectionOrObjectInitializers): A block of object or collection
1713 (NewInitialize): New expression with element/object initializers.
1715 * statement.cs: Reverted object/collection initializer hacks.
1717 * typemanager.cs (CSharpName): Filter __arglist type.
1719 2007-08-09 Marek Safar <marek.safar@gmail.com>
1721 ** C# 3.0 Anonymous Types (update to the latest standard)
1723 * expression.cs (Binary.ResolveOperator): Threat all null based types
1725 (AnonymousTypeDeclaration): Renamed from AnonymousType and simplified.
1726 (AnonymousTypeParameter): Updated.
1728 * anonymous.cs (CompilerGeneratedClass): Add custom name overload.
1729 (AnonymousTypeClass): New anonymous type container.
1731 * class.cs (AddField): Return operation result.
1733 * generic.cs: Another empty TypeArguments overload.
1735 * roottypes.cs (AddAnonymousType, GetAnonymousType): Anonymous types
1736 are stored at top of normal hierarchy.
1738 * typemanager.cs (CSharpName): Filter anonymous types.
1740 2007-08-09 Marek Safar <marek.safar@gmail.com>
1742 * expression.cs (StringConcat.Append): Handle 3 and more concatenation
1743 as single Concat call. How could we miss that :-(
1745 2007-08-08 Marek Safar <marek.safar@gmail.com>
1747 * expression.cs (ArrayCreation.CloneTo): Allocate exact size.
1749 2007-08-07 Miguel de Icaza <miguel@novell.com>
1751 * expression.cs: Fix the previous commit, the creation of the
1752 arguments array list needs also to be conditional on the arguments
1755 * class.cs: Add a little bit of help to help narrow down problems.
1757 * expression.cs (ArrayCreation.CloneTo): Argument can be null, do
1758 not try to copy in that case.
1760 * driver.cs: When building SMCS, include a new different set of
1761 default assemblies here. Do this here so we can control whether
1762 to include the default assemblies with /noconfig.
1764 2007-08-03 Marek Safar <marek.safar@gmail.com>
1766 A fix for bug #81979
1767 * expression.cs (TypeOf.GetAttributableValue): Check for type arguments
1770 2007-08-03 Marek Safar <marek.safar@gmail.com>
1772 A fix for bug #82300
1774 * anonymous.cs (AnonymousContainer.Define): Don't define anything when
1775 we are in probing scope.
1777 2007-08-03 Marek Safar <marek.safar@gmail.com>
1779 A fix for bug #82301
1781 * statement.cs (Catch.CloneTo): Clone blocks in the right order.
1782 (Statement.CloneTo): Clone and not map children blocks.
1784 2007-08-03 Marek Safar <marek.safar@gmail.com>
1786 A fix for bug #82299
1788 * expression.cs (LocalVariableReference.CloneTo): Remap local info
1791 * statement.cs (Statement.CloneTo): Clone variables before statements
1792 to allow remaping of local variables.
1794 2007-08-03 Marek Safar <marek.safar@gmail.com>
1796 A fix for bug #82296
1799 * report.cs: Log crash details for future clone problems.
1801 * statement.cs (Return.Clone): Don't clone non-existent expression.
1803 2007-08-03 Raja R Harinath <harinath@gmail.com>
1805 * class.cs (TypeContainer.AddBasesForPart): Make virtual.
1806 (Class.AddBasesForPart): Move CS0537 check here from ...
1807 * cs-parser.jay (class_declaration): ... here. Move calling of
1808 'AddBasesForPart' to ...
1809 (class_bases): ... here.
1810 (struct_declaration, interface_declaration): Update to changes.
1812 2007-08-02 Marek Safar <marek.safar@gmail.com>
1814 A fix for bug #81923
1816 * statement.cs (Using.ResolveLocalVariableDecls): Only non-user implicit
1817 conversion is allowed.
1819 2007-08-02 Marek Safar <marek.safar@gmail.com>
1821 A fix for bug #81564
1823 * ecore.cs (EventExpr): Add IsBase handling.
1825 * expression.cs (BaseAccess.CommonResolve): Events can use base accessor
1828 2007-08-02 Raja R Harinath <harinath@gmail.com>
1830 Reduce some differences between cs-parser.jay in mcs/ and gmcs/.
1831 * cs-parser.jay: Some whitespace cleanups.
1832 (current_delegate): New.
1834 (struct_declaration): Make similar to gmcs/cs-parser.jay -- add
1835 a dummy code block, and use 'type_name' instead of 'member_name'.
1836 (interface_declaration, class_declaration): Likewise.
1837 (delegate_declaration): Likewise. Rearrange slightly and use
1839 * cs-tokenizer.cs (handle_where): Rename from handle_constraints.
1840 (GetKeyword): Update to change. Use '!foo' instead of 'foo == false'.
1842 2007-08-02 Marek Safar <marek.safar@gmail.com>
1844 A fix for bug #82039
1846 * ecore.cs (TypeLookup.GetSignatureForError): Use name when type is not
1849 * typemanager.cs (CSharpName): Split to string overload.
1851 2007-08-02 Marek Safar <marek.safar@gmail.com>
1854 * report.cs: Updated warning CS0472.
1856 2007-08-01 Marek Safar <marek.safar@gmail.com>
1858 A fix for bug #82181
1860 * cs-tokenizer.cs: Ignore partial keyword inside block expression.
1862 2007-08-01 Marek Safar <marek.safar@gmail.com>
1864 A fix for bug #82277
1865 * statememnt.cs (Block.Clone): Don't clone explicit blocks twice.
1867 2007-08-01 Marek Safar <marek.safar@gmail.com>
1869 ** C# 3.0 Type Inference (major bits are working)
1871 * anonymous.cs (AnonymousMethodExpression): Removed refactored fields.
1872 (.ImplicitStandardConversionExists): Uses compatible.
1873 (.ExplicitTypeInference): Infers type arguments based on explicit arguments
1874 (.InferReturnType): New method.
1875 (.Compatible): Refactored.
1876 (.ResolveParameters): Uses factory to create resolved parameters.
1877 (.CompatibleMethod): Add probing mode support.
1878 (AnonymousContainer): Removed unused fields. Split Define and Resolve to
1879 clearly distinguish between 2 different operations.
1880 (LambdaMethod): Moved to lambda.cs.
1881 (AnonymousMethod): Removed unused fields and methods.
1882 (AnonymousDelegate): Simplified.
1884 * codegen.cs (ResolveTopBlock): Updated renamed Resolve to Define.
1886 * convert. cs (ImplicitConversionStandard): Compatible works differently.
1888 * delegate.cs (Delegate): New mehods to reduce code duplication.
1889 (.GetConstructor): New method.
1890 (.GetInvokeMethod): New method.
1891 (DelegateCreation): Updated.
1893 * ecore.cs (ResolveOverloadExtensions): Don't crash when extension method
1895 (OverloadResolve): Made probing little bit faster.
1897 * expression.cs (ParameterReference.DoResolveLValue): Reference can be null
1900 * generic.cs (TypeInferenceContext): Dummy implementation.
1902 * iterators.cs: Updated after Resolve/Define rename.
1904 * lambda.cs (LambdaExpression)
1905 (.ResolveParameters): Handles both type of arguments and type inference too.
1907 * parameter.cs (ImplicitLambdaParameter.Resolve): Sanity check.
1908 (InflateTypes): Updated.
1910 * support.cs (InflateTypes): Changed signature and updated.
1912 * typemanager.cs (LookupMemberCache): Better dynamic type check.
1913 (MemberLookup_FindMembers): More MS tricks.
1914 (GetParameterData): Ditto.
1915 (GetDelegateParameters): Uses quick path for dynamic types.
1917 2007-08-01 Marek Safar <marek.safar@gmail.com>
1919 * class.cs (MethodData.Define): EmitContext is required for generic stuff
1922 2007-07-31 Marek Safar <marek.safar@gmail.com>
1924 * statement.cs (ProcessParameters): Don't crash when parameters have wrong
1927 2007-07-26 Jb Evain <jbevain@novell.com>
1929 * typemanager.cs (TypeManager.GetConstructor): Add a method overload
1930 which takes a boolean 'report_errors', similar to the GetMethod.
1931 (InitCodeHelpers): StructLayoutAttribute.ctor(int16) is not visible
1932 in .net 2.1, do not report errors here.
1934 * typemanager.cs (TypeManager.InitCoreTypes): System.ArgIterator,
1935 System.Runtime.CompilerServices.RequiredAttributeAttribute and
1936 System.Runtime.CompilerServices.TypeForwardedToAttribute are internal
1939 * typemanager.cs (TypeManager.InitCoreTypes): Move the resolution
1940 of the type InternalsVisibleToAttribute before the first call
1941 to CoreLookupType which is allowed to fail (third boolean parameter
1942 to true). Because, during the resolution for a type that is not
1943 immediately found, we try to check if the type is not defined in
1944 a friend assembly, and to do so, we need the
1945 InternalVisibleToAttribute.
1947 2007-07-23 Miguel de Icaza <miguel@novell.com>
1949 * expression.cs (Binary): Add support for the brain-dead CSC 2.x
1950 feature that allows structs to be compared against null and inline
1951 the result as true or false.
1953 Notice that the same code is not permitted inside a generic block
1954 of code that would do:
1956 class Foo<T> where T : struct {
1963 It is only allowed if the type of T is not bound (no where
1964 clause). In my opinion, this CSC 2 behavior is broken but people
1965 seem to be using it (IronRuby does, a few bug reports on bugzilla
1966 have it and some people have complained about it).
1968 All of the users that depend on this behavior have code that is
1971 * report.cs (Warning, Error): make these take object arguments,
1972 not strings, as that allows us to take advantage of Format.
1974 2007-07-20 William Holmes <billholmes54@gmail.com>
1976 * decl.cs: Changed MemberName.CountTypeArguments to also check the
1977 Left member variable for the Count.
1978 * doc.cs: Changed DocUtil.GetMethodDocCommentName to call
1979 MemberName.CountTypeArguments to avoid a NRE.
1981 This code is contributed under the MIT X11 license
1983 2007-07-18 Marek Safar <marek.safar@gmail.com>
1985 * cs-tokenizer.cs: Improved lambda parsing and removed old code.
1987 2007-07-18 Atsushi Enomoto <atsushi@ximian.com>
1989 * doc.cs : generic method arguments are written as ``x while generic
1990 type arguments are `x. Combined with the previous change, fixed bug
1993 2007-07-18 Raja R Harinath <rharinath@novell.com>
1996 * expression.cs (Binary.ResolveOperator): When converting
1997 'a + (- b)' to 'a - b', ensure that the unary '-' is discarded.
1999 2007-07-18 Atsushi Enomoto <atsushi@ximian.com>
2001 * doc.cs : when T: or whatever x: is specified, it does not really
2002 check the doc comment's syntax correctness. Fixed bug #82006.
2004 2007-07-18 Marek Safar <marek.safar@gmail.com>
2006 * anonymous.cs (AnonymouseMethodExpression): Refactored to work with
2007 LambdaExpression better.
2009 * cs-tokenizer.cs: Changed a way how we detect lambda parameters.
2011 * driver.cs (LambdaTypeParseTest): Removed, tested method is gone.
2013 * ecore.cs (Expression.MemberLookupFailed): Don't show currect context
2014 as it can be generated.
2016 * expression.cs (Invocation.Error_InvalidArguments): Show correct
2019 * lambda.cs (LambdaExpression): Refactored to share same code with
2020 AnonymousMethodExpression.
2022 2007-07-17 Marek Safar <marek.safar@gmail.com>
2024 * anonymous.cs (MakeName): Include host name for easier debugging.
2025 (LambdaMethod): New class for lambda spcecific stuff.
2027 * attribute.cs: Set EmitContext return type.
2029 * class.cs: Set EmitContext return type.
2031 * codegen.cs (EmitContext): Return type cannot be null to stop messing
2032 with null/void meaning.
2034 * iterators.cs (ContainerType): Implemented.
2036 * rootcontext.cs: Set value of TypeManager.bool_type at early stage.
2038 * statement.cs (Return): Updated to lambda expressions.
2039 (Block.CloneTo): Parent can be null.
2041 2007-07-13 Marek Safar <marek.safar@gmail.com>
2043 A fix for bug #81917
2044 * attribute.cs (AttributeTester.GetFixedBuffer): More robust testing.
2046 * class.cs (FixedField): Check whether field is in unsafe scope.
2048 * ecore.cs (FieldExpr.DoResolve): Create fixed buffer expression here.
2049 (FieldExpr.Emit): Fixed buffers cannot be volatile.
2051 * expression.cs (ElementAccess.Resolve): Move fixed buffers resolve to
2054 * statement.cs (Fixed.Resolve): Simplified fixed buffers.
2056 2007-07-13 Marek Safar <marek.safar@gmail.com>
2058 * cs-tokenizer.cs, class.cs, decl.cs, driver.cs, namespace.cs,
2059 rootcontext.cs, expression.cs, statement.cs: Updated to use WarningLevel
2062 2007-07-13 Marek Safar <marek.safar@gmail.com>
2064 * ecore.cs (FieldExpr.AddressOf): Less confusing warning message.
2066 2007-07-13 Marek Safar <marek.safar@gmail.com>
2068 * anonymous.cs (AnonymousMethodExpression): Parameters are r/o.
2069 (AnonymousContainer.ResolveNoDefine): Another ec to aec flag conversion.
2071 * codegen.cs(EmitContext): Add ProbingMode flag.
2073 * delegate.cs (DelegateInvocation): Set few instance variables as r/o.
2075 * driver.cs: For now set both warning values.
2077 * ecore.cs (SimpleName): Name is readonly.
2078 (MethodGroup.OverloadResolve): One quick path for probing.
2080 * expression.cs (Unary): Set Oper r/o.
2081 (Binary): Set Oper r/o.
2082 (ParameterReference): Set few instance variables as r/o.
2083 (ParameterReference.DoResolveBase): Don't capture aruments when
2085 (Invocation.CloneTo): Fixed typo, looks easy, yeah.
2086 (Arglist): arguments are private.
2087 (SizeOf): type is private and r/o.
2088 (MemberAccess): arguments are private.
2090 * report.cs: Enhanced reporting on/off capabilities.
2092 * lambda.cs: Uses ec.IsInProbingMode.
2093 (ContextualReturn): Derives from return.
2095 * rootcontext.cs: For now set both warning values.
2097 * statement.cs (CloneContext.RemapBlockCopy): Remaps block to cloned
2099 (Return.Resolve): Don't die immediately.
2100 (Block.Resolve): Speed-up probing.
2101 (Block.CloneTo): Clone only child blocks.
2103 Fri Jul 13 11:19:28 CEST 2007 Paolo Molaro <lupus@ximian.com>
2105 * iterators.cs: reverted Miguel's latest change (r81925) as it
2106 breaks the build in System.
2108 2007-07-13 Miguel de Icaza <miguel@novell.com>
2110 * iterators.cs (Yield.CheckContext): Check for the iterator type
2111 also here as we can call into Yield even in codepaths that are not
2113 (MethodOrOperator is the only path that was checked).
2115 In addition to the standard check, use a more specific check for
2116 constructors to report a more verbose error.
2118 2007-07-12 Miguel de Icaza <miguel@novell.com>
2120 * ecore.cs (FieldExpr.AddressOf): Do not stop processing here,
2121 report the warning and continue
2123 * statement.cs (Using.EmitLocalVariableDecls): We were leaving
2124 values on the stack on the call to Emit. Use EmitStatement if
2125 possible, or using Emit + Pop if not possible. Fixes #82064
2127 2007-07-12 Raja R Harinath <rharinath@novell.com>
2129 * expression.cs (Invocation.IsApplicable): Reorganize slightly to
2130 avoid try...finally in some cases.
2132 2007-07-10 Marek Safar <marek.safar@gmail.com>
2134 * attribute.cs (Attribute.ResolveConstructor): Uses method group.
2136 * class.cs (ConstructorInitializer.Resolve): Use and keep method group
2137 instead of method. Re-use standard error handling.
2138 (ConstructorInitializer.Emit): Simplified.
2140 * delegate.cs: Updated after Invocation.EmitCall change.
2142 * ecore.cs (GetOperatorTrueOrFalse): Uses MethodGroupExpr only.
2143 (SimpleName.SimpleNameResolve): Set and reset in_transit flag correctly.
2144 (ExtensionMethodGroupExpr): Refactored to use same OverloadResolve
2145 method and don't permanently changing input arguments.
2146 (MethodGroupExpr): Introduced resolved best_candidate, when method group
2147 is resolved it has one of the candidates is the best one which is later
2148 used to emit. Removed a few unused method.
2149 (MethodGroupExpr.MakeUnionSet): Moved from Invocation, it belongs here.
2151 * expression.cs (StaticCallExpr.MakeSimpleCall): Uses method group.
2152 (Binary.ResolveOperator): Ditto.
2153 (ConditionalLogicalOperator.DoResolve): Ditto.
2154 (Invocation): Uses method group.
2155 (Invocation.DoResolve): Simplified.
2156 (Invocation.EmitCall): Removed useless is_static.
2157 (Invocation.Emit): Delegate to method group.
2158 (Invocation.EmitStatement): Simplified.
2159 (New): Uses method group.
2160 (MemberAccess.DoResolve): Don't destroy original expression.
2162 * statement.cs (ForEach.Resolve): Use null for no method arguments.
2164 2007-07-04 Marek Safar <marek.safar@gmail.com>
2166 * ecore.cs (VarExpr.DoResolveLValue): More restriction checks.
2169 * lambda.cs: Add custom error message type.
2171 2007-07-03 Marek Safar <marek.safar@gmail.com>
2173 * lambda.cs: Simplified little bit.
2175 * parameter.cs: Introduced ImplicitLambdaParameter.
2176 (Parameters.CreateFullyResolved): New factory instead of ctor.
2180 * delegate.cs: Updated parameter creation.
2182 2007-07-03 Marek Safar <marek.safar@gmail.com>
2184 * ecore.cs (SimpleName.GetSignatureForError): Display correctly generic
2187 * generic.cs: Synchronized with gmcs.
2189 2007-07-03 Marek Safar <marek.safar@gmail.com>
2191 * class.cs (Indexer): Check return type as soon as possible.
2193 * cs-parser.jay: Initialize implicit_value_parameter_type for interface
2196 * ecore.cs (VarExpr.DoResolveLValue): Set eclass value.
2198 * expression.cs (Invocation.Error_InvalidArguments): Show type only.
2200 * parameter.cs (Parameter): Use expression type when it is available.
2202 * support.cs (ReflectionParameters.ParameterDesc): Show an extension
2203 method modifier for the first parameter only.
2205 2007-06-24 Marek Safar <marek.safar@gmail.com>
2207 A fix for bug #81938
2208 * typemanager.cs (ChangeType): Fixed couple of char conversions.
2210 * constant.cs: Tide up an exception message.
2212 2007-06-22 Marek Safar <marek.safar@gmail.com>
2214 * ecore.cs (SimpleName.DoSimpleNameResolve): Better error reporting when
2215 an uninitialized variable is used.
2217 * expression.cs (LocalVariableReference.DoResolve): Ditto.
2219 2007-06-22 Marek Safar <marek.safar@gmail.com>
2221 * ecore.cs (SimpleName.TypeOrNamespaceNotFound): Allow to override type
2222 not found error handling.
2224 * expression.cs (ArrayCreation): Removed redundant fields and little bit
2226 (ArrayCreation.ResolveArrayElement): To be ready to customization.
2227 (ArrayCreation.DoResolve): Simplified.
2228 (ImplicitlyTypedArrayCreation.DoResolve): Implicitly typed arrays have
2229 its own resolve process.
2230 (ImplicitlyTypedArrayCreation.ResolveArrayElement): Conversion magic.
2232 2007-06-20 Marek Safar <marek.safar@gmail.com>
2234 * namespace.cs (NamespaceEntry.Error_AmbiguousTypeReference): Print
2237 2007-06-20 Marek Safar <marek.safar@gmail.com>
2239 * cs-tokenizer.cs: Removed var related stuff.
2241 * ecore.cs (Expression.ResolveAsContextualType): Introduced new method.
2242 (VarExpr): Changed to derive from SimpleName. VarExpr now behaves as
2243 a type and a keyword at same time.
2245 * decl.cs (MembeName.GetTypeExpression): Create VarExpr when type name
2248 * expression.cs (ImplicitlyTypedArrayCreation): New empty class for
2249 implicitly typed arrays, more changes will follow.
2251 * statement.cs (LocalInfo.Resolve): Resolve type as contextual type.
2253 2007-06-19 Marek Safar <marek.safar@gmail.com>
2255 * ecore.cs (VarExpr): Removed Handled field.
2257 * statement.cs (Using.ResolveLocalVariableDecls): Refactored to use
2258 build-in assign functionality.
2259 (ForEach.Resolve): Removed all implicitly typed local variable code and
2261 (ArrayForeach.Resolve): Infer implicitly typed local variable here.
2262 (CollectionForeach.Resolve): Infer implicitly typed local variable here.
2264 2007-06-18 Marek Safar <marek.safar@gmail.com>
2266 * assign.cs: Removed implicitly typed local variable check.
2268 * expression.cs (LocalVariableReference.DoResolve): Add check for self
2269 referencing implicitly typed local variable.
2270 (LocalVariableReference.DoResolveLValue): Infer implicitly typed local
2273 * statement.cs (Fixed): Removed unsupported implicitly typed local
2276 2007-06-15 Marek Safar <marek.safar@gmail.com>
2278 * decl.cs (MemberName): Moved all Unbound stuff to parser.
2280 2007-06-14 Marek Safar <marek.safar@gmail.com>
2282 A fix for bugs #81855 and #76274
2283 * attribute.cs (AttachTo): Always set owner for global attributes to
2286 * ecore.cs (Error_TypeDoesNotContainDefinition): A type location can be
2289 * cs-parser.jay: Assembly and module attributes must precede all other
2290 elements except using clauses and extern alias declarations.
2292 2007-06-13 Marek Safar <marek.safar@gmail.com>
2294 A fix for bug #81748
2296 * expression.cs: More checks for non ISO-1 features.
2298 2007-06-12 Marek Safar <marek.safar@gmail.com>
2300 A fix for bug #81807
2301 * statement.cs(Switch.TableSwitchEmit): Define null label when it's not
2302 present inside switch statement and it is required by nullable check.
2304 2007-06-12 Marek Safar <marek.safar@gmail.com>
2306 A fix for bug #81840
2307 * ecore.cs (SimpleName.ResolveAsTypeStep): Look for non-generic type
2308 when type matching fails.
2310 * namespace.cs: Tiny error message change.
2312 2007-06-12 Marek Safar <marek.safar@gmail.com>
2314 * decl.cs (CheckAbstractAndExtern): Moved to MemberCore for easier error
2315 reporting. Added automatic property check.
2317 * class.cs: Updated after CheckAbstractAndExtern relocation.
2318 (AEventPropertyAccessor.GetSignatureForError): Customized.
2320 2007-06-11 Marek Safar <marek.safar@gmail.com>
2322 * class.cs (DefineBaseTypes): Base type can be undefined.
2324 * ecore.cs (TypeLookup): Minor refactoring.
2325 (DoResolveAsTypeStep): Removed redundant check.
2327 * namespace.cs (Lookup): Removed redundant check.
2329 * rootcontext.cs (BootstrapCorlib_ResolveType): Uses normal
2330 ResolveAsTypeTerminal step.
2331 (BootstrapCorlib_*): Simplified.
2332 (PopulateCoreType): Core types can be now external.
2334 2007-06-07 Marek Safar <marek.safar@gmail.com>
2336 * anonymous.cs (VerifyExplicitParameterCompatibility): Add flag to do
2338 (InferTypeArguments): Infers anonymous expression type arguments.
2339 (Compatible): Split to Compatible and InferTypeArguments.
2341 * lambda.cs: Updated.
2343 2007-06-08 Marek Safar <marek.safar@gmail.com>
2345 * anonymous.cs (AnonymousContainer): Marked as compiler generated.
2347 2007-06-07 Raja R Harinath <harinath@gmail.com>
2349 Fix #80477, cs0135-2.cs, cs0135-3.cs
2350 * statement.cs (ToplevelBlock.ProcessParameters): Add parameter
2351 names to the "known" variables list.
2352 (Block.CheckInvariantMeaningInBlock): Handle the fact the
2353 parameter names are also "known".
2354 (Block.CheckError136): Remove.
2355 (ExplicitBlock.CloneTo): New. Set 'known_variables' in target to
2358 2007-06-07 Marek Safar <marek.safar@gmail.com>
2360 * ecore.cs (MethodGroupExpr.OverloadResolve): Print full method definition.
2362 2007-06-06 Marek Safar <marek.safar@gmail.com>
2364 * ecore.cs (SimpleName.Emit): Emitting unresolved simple name is
2365 internal error not an user error.
2367 * expression.cs (IsApplicable): Refactored to make debugging easier.
2369 * support.cs: More tricks for non-mono runtimes.
2371 * typemanager.cs (CoreLookupType): Made public.
2372 (InitSystemCore): All linq specific stuff moved to linq.cs
2374 2007-06-05 Marek Safar <marek.safar@gmail.com>
2376 * typemanager.cs (CSharpSignature): One more missing build-in types
2378 More tricks for non-mono runtime.
2380 2007-06-05 Raja R Harinath <harinath@gmail.com>
2382 * statement.cs (Block.CheckError136_InParents): Remove.
2383 (Block.AddVariable): Use GetParameterInfo instead.
2384 (ToplevelBlock.ProcessArguments): Likewise.
2386 2007-06-04 Raja R Harinath <rharinath@novell.com>
2388 * statement.cs (ToplevelBlock.CloneTo): New. Copy over parameter
2390 (ToplevelBlock.GetParameterInfo): Split out of ...
2391 (ToplevelBlock.GetParameterRefernce): ... this.
2392 (ToplevelBlock.ParameterMap): Remove.
2393 * expression.cs (ParameterReference): Update to use
2394 ToplevelParameterInfo.
2396 * statement.cs (ToplevelBlock.ProcessParameters): Workaround some
2399 * flowanalysis.cs (FlowBranching.CheckOutParameters): Move ...
2400 * statement.cs (ToplevelBlock.CheckOutParameters): ... here.
2402 * statement.cs (ToplevelBlock.ResolveMeta): Move CS0136 checks ...
2403 (ToplevelBlock.ProcessParameters) ... here.
2404 (ToplevelBlock..ctor): Invoke it.
2406 * statement.cs (ToplevelBlock.ResolveMeta): Add sanity checks for
2409 * statement.cs (IKnownVariable): New interface.
2410 (LocalInfo): Implement it.
2411 (ToplevelParameterInfo): New class.
2412 (ExplicitBlock.AddKnownVariable): Use IKnownVariable.
2413 (ExplicitBlock.GetKnownVariable): Likewise. Rename from
2414 GetKnownVariableInfo.
2416 2007-06-03 Raja R Harinath <harinath@gmail.com>
2418 Partly speed up CS0136 error checks.
2419 * statement.cs (ExplicitBlock.GetKnownVariableInfo): Remove
2420 'recurse' parameter.
2421 (Block.DoCheckError136): Only check errors in parameters. Move
2422 local variable checks ...
2423 (Block.AddVariable): ... here, and ...
2424 (ToplevelBlock.ResolveMeta): ... here.
2426 2007-06-02 Raja R Harinath <harinath@gmail.com>
2428 * statement.cs (Block.IsChildOf): Remove.
2430 * statement.cs (Statement.Clone): Move special case code ...
2431 (Block.CloneTo): ... here.
2433 2007-05-29 Raja R Harinath <rharinath@novell.com>
2435 * statement.cs (ToplevelBlock.container): Remove field. It's
2436 redundant with 'Parent'.
2437 (ToplevelBlock.ContainerBlock): Remove accessor.
2438 (ToplevelBlock..ctor): Update to changes. Register anonymous
2439 child with parent here, ...
2440 * cs-parser.jay (end_anonymous): ... not here. Don't modify
2442 (start_anonymous): Don't save current_block.
2443 (top_current_block): Remove.
2445 * statement.cs (Block.Flags): Remove IsExplicit and IsToplevel flags.
2446 (Block.Resolve): Update to changes.
2447 (Block..ctor): Move setting of "correct" 'Toplevel'
2448 and 'Explicit' fields to ...
2449 (ExplicitBlock..ctor, ToplevelBlock..ctor): ... here.
2451 2007-05-27 Raja R Harinath <harinath@gmail.com>
2454 * statement.cs (Block.Implicit): Remove.
2455 (Block): Update to changes.
2456 * flowanalysis.cs: Likewise.
2458 Mildly speed up CheckInvariantMeaningInBlock
2459 * statement.cs (ExplicitBlock.AddKnownVariable): Move here from Block.
2460 Recursively call AddKnownVariable to all enclosing blocks.
2461 (ExplicitBlock.GetKnownVariableInfo): Move here from Block.
2462 Remove recursive calls.
2463 (Block): Update to changes.
2465 New ExplicitBlock invariants
2466 * statement.cs (Block.Explicit): New field. It points to the
2467 immediately enclosing non-implicit block.
2468 (Block..ctor): Maintain the invariant.
2469 * cs-parser.jay: Take advantage of invariant.
2471 Introduce ExplicitBlock
2472 * statement.cs (ExplicitBlock): New.
2473 (ToplevelBlock): Derive from it.
2474 (Block.Flags.IsExplicit): Rename from '...Implicit' and invert
2476 (Block.Implicit): Update to changes.
2477 * cs-parser.jay: Update to changes.
2480 * codegen.cs (EmitContext.IsLastStatement): Remove.
2481 * statement.cs (Block.DoEmit): Update to changes.
2483 2007-05-25 Raja R Harinath <rharinath@novell.com>
2485 * cs-parser.jay: Use 'start_block' and 'end_block' rather than
2486 modifying current_block directly.
2488 2007-05-23 Scott Peterson <lunchtimemama@gmail.com>
2490 * class.cs: Implemented automatic properties (C# 3.0)
2491 Thanks to Marek for the help.
2493 2007-05-23 Raja R Harinath <rharinath@novell.com>
2495 * flowanalysis.cs (VariableInfo.SetAssigned): When noting a
2496 variable as assigned, note also that all its components are
2498 (MyBitVector.SetRange): New. Function to set multiple bits to true.
2500 2007-05-19 Marek Safar <marek.safar@gmail.com>
2502 * anonymous.cs, class.cs: Emit Compiler generated attribute when
2503 member is marked as compiler generated.
2505 * decl.cs (MemberCore): Refactored ModFlags into property.
2507 * modifiers.cs: Add new modifier (COMPILER_GENERATED).
2508 (Check): Check only accessibility modifiers.
2510 2007-05-18 Raja R Harinath <rharinath@novell.com>
2512 Track all assignable slots in one bit array
2513 * statement.cs (ToplevelBlock.ParameterMap): Convert into array.
2514 (ToplevelBlock.ResolveMeta): Don't create a VariableMap. Move
2515 logic from VariableMap constructor here. Use the same 'offset'
2516 variable that's later used for computing offsets of local
2518 * flowanalysis.cs (UsageVector.parameters): Remove.
2519 (UsageVector): Update to changes.
2520 (VariableMap): Remove.
2522 Avoid creating ParameterMap in every block
2523 * statement.cs (Block.ParameterMap): Move ...
2524 (ToplevelBlock.ParameterMap): ... here.
2525 (ToplevelBlock.ResolveMeta): Create VariableMap for parameters
2527 * flowanalysis.cs (FlowBranching.param_map): Remove.
2528 (FlowBranching.UsageVector): Update to changes.
2529 (FlowBranchingToplevel.CheckOutParameters): Likewise.
2531 * statement.cs (Block.CloneTo): Clone Toplevel field too.
2533 * expression.cs (ParameterReference): Distinguish between block
2534 where parameter was referenced and declared.
2536 2007-05-18 Marek Safar <marek.safar@gmail.com>
2538 * flowanalysis.cs, statement.cs: Put back improved error handling.
2540 2007-05-15 Scott Peterson <lunchtimemama@gmail.com>
2544 Imporved object and collection initialization (C# 3.0).
2546 2007-05-15 Marek Safar <marek.safar@gmail.com>
2548 A fix for bug #81380
2549 * expression.cs (Is.DoResolve): Only value types have constant `is'
2552 2007-05-15 Raja R Harinath <rharinath@novell.com>
2554 * statement.cs (ToplevelBlock.child): Remove.
2556 2007-05-15 Raja R Harinath <harinath@gmail.com>
2558 Rationalize ResolveMeta: refactoring
2559 (Block.ResolveMeta): Remove wrong or superfluous comments. Carve
2560 out constant handling code into ...
2561 (Block.DoResolveConstants): ... this.
2563 Rationalize ResolveMeta: kill local_map
2564 * statement.cs (Block.local_map, Block.LocalMap): Remove.
2565 (Block.AssignableSlots): New.
2566 (Block.ResolveMeta): Make protected. Don't create a VariableMap
2567 for locals -- move code from VariableMap here. Avoid unnecessary
2569 * flowanalysis.cs (FlowBranching.local_map): Remove.
2570 (FlowBranching..ctor): Use Block.AssignableSlots.
2571 (VariableMap): Remove unused constructors.
2573 2007-05-11 Raja R Harinath <rharinath@novell.com>
2575 * Makefile [PROFILE=net_2_0_bootstrap]: Add special-case rules.
2577 2007-05-11 Marek Safar <marek.safar@gmail.com>
2579 * typemanager.cs (IsFriendAssembly): Should not be called for building
2582 2007-05-09 Marek Safar <marek.safar@gmail.com>
2584 * literal.cs (NullConstant): Print null in all cases.
2586 * expression.cs (Binary.ResolveOperator): Implemented delegate
2587 comparison based on C# 2.0 changes.
2589 2007-04-28 Scott Peterson <lunchtimemama@gmail.com>
2591 This code is contributed under the MIT X11 license
2593 The following enables support for several C# 3.0 language features:
2595 * cs-tokenizer.cs: Added support for the "var" keyword.
2597 * ecore.cs: Refactored TypeLookupExpression.DoResolveAsTypeStep().
2598 Added VarExpr class to facilitate type inferencing.
2600 * class.cs: Added IDictionary field AnonymousTypes to TypeContainer
2601 to support anonymous types.
2603 * assign.cs: Added support for type inferencing and initialization.
2605 * anonymous.cs: Added AnonymousClass class to enable anonymous types.
2607 * expression.cs: Added implicit array support to ArrayCreation.
2608 Added 5 types and 1 interface:
2610 IInitializable Implementing classes can inject initializing
2611 statements after object instantiation.
2613 Initializer Stores data for object initialization.
2615 AnonymousType An expression for anonymous types.
2617 AnonymousTypeParameter Stores data about an anonymous type's field.
2619 NewInitialize An expression for object initialization.
2621 CollectionInitialize An expression for collection initialization.
2623 * statement.cs: Added "var" keyword support to the foreach, using, and fixed
2626 2007-05-06 Marek Safar <marek.safar@gmail.com>
2628 A fix for bug #81500
2629 * cs-tokenizer.cs: Add special handling for coalescing operator.
2631 2007-05-06 Marek Safar <marek.safar@gmail.com>
2633 A fix for bug #81529
2634 * attribute.cs (GetAttributeUsage): AttributeUsage attribute inherits
2635 its value from base class until it is redefined.
2637 2007-05-02 Raja R Harinath <rharinath@novell.com>
2639 Fix regression in cs0631-3.cs
2640 * cs-parser.jay (operator_declarator): Add opt_attributes to error
2641 fallback. Make error fallback catch more cases.
2643 2007-05-01 Miguel de Icaza <miguel@novell.com>
2645 * cs-parser.jay: Allow parameters in operator declarations to have
2648 2007-04-27 Miguel de Icaza <miguel@novell.com>
2650 * statement.cs (If.CloneTo): Only clone the FalseStatement if it
2653 * lambda.cs (ContextualReturn.Resolve): An expression is valid
2654 inside the ContextualReturn, it does not have to be an
2655 ExpressionStatement.
2657 2007-04-24 Miguel de Icaza <miguel@novell.com>
2659 * lambda.cs (ContextualReturn.Resolve): if the return type is not
2662 2007-04-23 Miguel de Icaza <miguel@novell.com>
2664 * anonymous.cs (AnonymousContainer): split the virtual Resolve
2665 method in two methods: ResolveNoDefine and Resolve.
2667 ResolveNoDefine will stop just after ResolveTopBlock has been
2670 Resolve will then continue by creating a method and issuing the
2671 call to method.Define ().
2673 (AnonymousMethod): Split and implement the new Resolve and
2674 ResolveNoDefine as well.
2676 * lambda.cs (LambdaExpression): Split the anonymous method
2677 resolution code into a separate routine (CoreCompatibilityTest)
2678 from DoCompatibleTest.
2680 (LambdaExpression.TryBuild): New method, this method tries to
2681 build the LambdaExpression with the given set of types to be used
2682 as the types for the various parameters of the lambda expression.
2684 If the compilation succeed with the given types, the infered type
2685 of the Anonymous method is returned, otherwise null is returned.
2687 2007-04-23 Marek Safar <marek.safar@gmail.com>
2689 A fix for bug #81414
2690 * delegate.cs: Better fix, moved ApplyAttributes from Define to Emit.
2692 2007-04-22 Miguel de Icaza <miguel@novell.com>
2694 * cs-tokenizer.cs: Change various identifiers here from the
2695 camelCasing to the recommended Linux-like style for instance
2696 variables from the Coding Guidelines.
2698 2007-04-19 Martin Baulig <martin@ximian.com>
2701 (Convert.ImplicitReferenceConversionCore): Allow conversions from
2702 System.Enum to System.ValueType.
2704 2007-04-13 Martin Baulig <martin@ximian.com>
2706 Rewrote implicit reference conversions. We need to distinguish
2707 between implicit reference conversions (13.1.4) and implicit
2708 boxing conversions (13.1.5).
2710 According to the spec, there's an an implicit conversion
2711 "From a one-dimensional array-type S[] to IList<T> and base
2712 interfaces of this interface, provided there is an implicit
2713 reference conversion from S to T." Note that this does not
2714 include boxing conversions.
2717 (Convert.ImplicitTypeParameterBoxingConversion): New method.
2718 (Convert.ImplicitReferenceConversion): Split into
2719 ImplicitReferenceConversionCore() and
2720 ImplicitBoxingConversionExist().
2721 (Convert.ImplicitReferenceConversionExists): Use the new
2722 ImplicitReferenceConversionCore() and ImplicitBoxingConversionExists().
2724 2007-04-12 Martin Baulig <martin@ximian.com>
2726 * convert.cs (Convert.ImplicitReferenceConversion): Move the
2727 `TypeManager.null_type' checks up to the top of the method.
2729 2007-04-11 Marek Safar <marek.safar@gmail.com>
2731 A fix for bug #81350
2732 * class.cs, decl.cs, ecore.cs, namespace.cs: The optimization for private
2735 2007-04-11 Martin Baulig <martin@ximian.com>
2737 * statement.cs (Foreach.CollectionForeach.ProbeCollectionType):
2738 Use `TypeManager.GetInterfaces(t)' rather than `t.GetInterfaces()'
2739 to make this work for generic classes; fixes #79561.
2741 2007-04-11 Martin Baulig <martin@ximian.com>
2743 * expression.cs (As): Add support for nullable types; fixes #79371.
2745 2007-04-11 Martin Baulig <martin@ximian.com>
2747 * doc.cs (DocUtil.GetSignatureForDoc): Don't crash if
2748 `type.FullName' is null; fixes #80243.
2750 2007-04-11 Martin Baulig <martin@ximian.com>
2752 * expression.cs (Invocation.IsApplicable): Don't modify the method
2753 if type inference succeeded, but the method was not applicable.
2756 2007-04-10 Marek Safar <marek.safar@gmail.com>
2758 A fix for bug #81324
2759 * namespace.cs (Namespace.LookupExtensionMethod): Always inspect both
2760 internal and external namespaces containers.
2762 2007-04-10 Martin Baulig <martin@ximian.com>
2764 * delegate.cs (DelegateCreation.ResolveMethodGroupExpr): Use
2765 TypeManager.DropGenericMethodArguments() so we also call
2766 IMethodData.SetMemberIsUsed() for generic methods. Fixes #80357.
2768 2007-04-10 Martin Baulig <martin@ximian.com>
2770 * iterators.cs (Iterator.CreateIterator): Don't crash if
2771 `method.ReturnType' is null. This happens if something went wrong
2772 while resolving that typ (we already reported an error in this case).
2774 2007-04-10 Martin Baulig <martin@ximian.com>
2776 * expression.cs (New.DoResolve): Don't call CheckComImport() on
2777 generic interfaces; report the CS0144 directly.
2779 2007-04-10 Martin Baulig <martin@ximian.com>
2781 * ecore.cs (MemberExpr.ResolveMemberExpr): If `left' is a
2782 `TypeExpr', call ResolveAsTypeTerminal() on it; fixes #81180.
2784 2007-04-10 Martin Baulig <martin@ximian.com>
2786 * expression.cs (New.DoEmitTypeParameter): Fix #81109.
2788 2007-04-09 Raja R Harinath <rharinath@novell.com>
2791 * flowanalysis.cs (UsageVector.MergeChild): Handle child.Block == null.
2792 * statement.cs: Use KillFlowBranching only in ResolveUnreachable.
2795 * statement.cs (For.Resolve): If resolution fails, use
2798 2007-04-08 Marek Safar <marek.safar@gmail.com>
2800 * anonymous.cs (MakeName): Make faster and zero-based.
2801 (VerifyExplicitParameterCompatibility): Back to mode where generic
2802 parameter is ignored.
2803 (AnonymousMethodMethod.Emit): Decorate method as compiler generated.
2805 * class.cs (EmitType): Method can emit another new method.
2807 * cs-tokenizer.cs (IsLinqEnabled): Fixes static cctor race.
2809 * driver.cs: Updated.
2811 * lambda.cs: Reuse predefined empty parameters.
2813 * parameter.cs: Updated
2815 * support.cs: Implemented InflateTypes.
2817 * typemanager.cs (GetFullName): Don't use FullName as it can be null.
2818 (InitSystemCore): Introduced to isolate 3.0 dependencies.
2820 2007-04-03 Martin Baulig <martin@ximian.com>
2824 * statement.cs (Foreach.CollectionForeach.TryType): Use a custom
2825 version of TypeManager.IsOverride() which also works with generic
2828 2007-04-03 Martin Baulig <martin@ximian.com>
2833 (Convert.ExplicitReferenceConversion): We need to cast when
2834 converting from IList<T> to S[].
2836 2007-04-01 Marek Safar <marek.safar@gmail.com>
2838 * decl.cs (FindExtensionMethods): Consider all candidates with same name
2841 * expression.cs (MemberAccess.DoResolve): Cache resolved expression.
2843 2007-03-31 Marek Safar <marek.safar@gmail.com>
2845 * anonymous.cs (AnonymousMethodExpression.Compatible): Handles both
2846 argument and return type inferring.
2848 * codegen.cs (InferReturnType): Flag whether return can be inferred.
2849 (ReturnType): Turned to property.
2851 * statement.cs (Return): Implemented return type inferring.
2853 * support.cs (ReflectionParameters): Use local types if possible.
2855 2007-03-30 Raja R Harinath <rharinath@novell.com>
2857 * flowanalysis.cs (FlowBranching.Reachability): Remove.
2858 (FlowBranching.UsageVector): Update to changes.
2860 Prepare to kill 'Reachability'
2861 * flowanalysis.cs (UsageVector): Remove 'Reachability' from
2862 argument of constructor.
2864 2007-03-29 Raja R Harinath <rharinath@novell.com>
2866 Prepare to kill 'Reachability'
2867 * flowanalysis.cs (UsageVector.is_unreachable): New.
2868 (UsageVector): Update to maintain 'is_unreachable' in parallel to
2869 'reachability', and verify they're consistent.
2872 * expression.cs (New.EmitStatement): Handle type parameters here too.
2874 2007-03-29 Martin Baulig <martin@ximian.com>
2879 (ScopeInfo.ctor): Use `Modifiers.PUBLIC' if we're a nested
2880 CompilerGeneratedClass.
2881 (ScopeInfo.EmitScopeInstance): Make this protected.
2882 (CapturedVariable.EmitInstance): Use `Ldarg_0' if
2883 `ec.CurrentAnonymousMethod.Scope == Scope'.
2885 * statement.cs (Block.ScopeInfo): Make this a property.
2887 2007-03-27 Raja R Harinath <harinath@gmail.com>
2889 Prepare to kill 'Reachability'
2890 * flowanalysis.cs (FlowBranching.Reachability): Make class private.
2891 (FlowBranching.UsageVector.Reachability): Remove property.
2892 (FlowBranching.UsageVector.IsUnreachable): New property.
2893 (FlowBranching.UsageVector.ResetBarrier): New.
2894 (FlowBranching.UsageVector, FlowBranchingLabeled): Update to changes.
2895 * codegen.cs, statement.cs: Update to changes.
2897 2007-03-27 Martin Baulig <martin@ximian.com>
2902 (DeclSpace.LookupNestedTypeInHierarchy): Correctly handle nested
2905 2007-03-26 Raja R Harinath <rharinath@novell.com>
2907 * flowanalysis.cs (FlowBranching.Reachability): Use a boolean
2908 instead of TriState. Remove all mention of TriState.
2910 * flowanalysis.cs (FlowBranching.Reachability): Prepare to be
2911 replaced by a boolean. Add boolean 'is_unreachable' field, check
2912 and maintain invariants.
2914 2007-03-25 Marek Safar <marek.safar@gmail.com>
2916 * anonymous.cs: Restored checks disabled for uninflated anonymous methods.
2918 2007-03-25 Marek Safar <marek.safar@gmail.com>
2920 * expression.cs: Stop using obsolete 2.0 opcodes.
2922 2007-03-25 Marek Safar <marek.safar@gmail.com>
2924 * enum.cs (EnumMember.Define): Fixed regression and slowdown caused by
2925 one of the latests Martin's fixes.
2927 2007-03-23 Miguel de Icaza <miguel@novell.com>
2929 * expression.cs: On BigEndian systems, swap the bytes, temporary
2930 solution until we get a new bitconverter class.
2932 2007-03-23 Martin Baulig <martin@ximian.com>
2936 * decl.cs (MemberCache.AddMembers): Add generic methods both as
2937 "Method" and "Method`1". Normally, a cache lookup is done on the
2938 "Method" form (ie. without the generic arity), but this one makes
2939 lookups on the full form work as well.
2941 2007-03-22 Raja R Harinath <rharinath@novell.com>
2943 * flowanalysis.cs (Reachability): Reorganize slightly, and remove
2946 2007-03-20 Bill Holmes <billholmes54@gmail.com>
2948 Added 2 MemberCoreArrayList objects, ordered_explicit_member_list and
2949 ordered_member_list, to TypeBuilder to store members to be defined
2950 in the order they were parsed in.
2951 - ordered_explicit_member_list contains all properties indexers
2952 and methods that are defined as explicit implementation of an
2953 interface or base class.
2954 - ordered_member_list contains all properties indexers and methods
2955 that are not defined as explicit implementation of an interface
2958 Removed MethodArrayList and IndexerArrayList from TypeBuilder. The
2959 functionality in these removed classes has been replaced with
2960 ComputeIndexerName, EmitIndexerName, HasEqualss, HasGetHashCode, and
2961 CheckEqualsAndGetHashCode members defined and called in the TypeBuilderClass.
2963 Adding CheckForDuplications to PropertyBase.PropertyMethod and calls
2964 to CheckForDuplications inside GetMethod and SetMethod Define Method
2965 to handle method property and indexer name conflicts.
2969 All code is contributed under the MIT/X11 license.
2971 2007-03-20 Martin Baulig <martin@ximian.com>
2973 * class.cs (TypeContainer.Interfaces): Removed; they're now
2974 included in `TypeContainer.Types'.
2976 2007-03-20 Martin Baulig <martin@ximian.com>
2978 Fix #77963, #80314 and #81019. Added gtest-317, ..., gtest-320.
2980 * class.cs (TypeContainer.CreateType): New public method. This is
2981 now called before DefineType() to create the TypeBuilders.
2982 (TypeContainer.DefineType): Don't create the TypeBuilder here; it
2983 has already been created by CreateType().
2984 (TypeContainer.DefineTypeBuilder): Renamed into CreateTypeBuilder();
2985 don't resolve our base classes here; this has been moved into
2986 DefineBaseTypes(). We're now called from CreateType().
2987 (TypeContainer.DefineBaseTypes): New private method; resolve our
2988 base classes here. We're now called from DefineType().
2991 (RootContext.ResolveTree): Call TypeContainer.CreateType() on all
2992 our types first to create all the TypeBuilders. After that, call
2993 TypeContainer.DefineType() on all the types which'll resolve their
2994 base classes and setup the resolve order.
2996 2007-03-20 Martin Baulig <martin@ximian.com>
2998 * class.cs (TypeContainer.Enums): Removed; they're now included in
2999 `TypeContainer.Types'.
3001 2007-03-20 Martin Baulig <martin@ximian.com>
3004 (TypeContainer.DefineType): Don't call ResolveMembers() here.
3005 (TypeContainer.DoResolveMembers): Call DefineType() on our
3006 `compiler_generated' classes; moved here from DefineNestedTypes().
3009 (RootContext.ResolveTree): Call ResolveMembers() on all
3010 TypeContainer's in the `type_container_resolve_order'.
3012 2007-03-19 Marek Safar <marek.safar@gmail.com>
3014 * class.cs: Use corlib to handle InternalMethodImplAttribute.
3016 2007-03-17 Marek Safar <marek.safar@gmail.com>
3018 * class.cs (EventFieldAccessor.EmitMethod): Don't override existing
3019 implementation flags.
3021 2007-03-17 Marek Safar <marek.safar@gmail.com>
3023 * class.cs: More optimizations for type parameters.
3025 2007-03-15 Marek Safar <marek.safar@gmail.com>
3027 * anonymous.cs (AnomymousMethod): Can be now hosted in generic container.
3029 * ecore.cs, parameter.cs: More common code for both corlibs.
3031 * typemanager.cs (IsGenericMethod): Simplified.
3033 2007-03-15 Raja R Harinath <rharinath@novell.com>
3035 * flowanalysis.cs (FlowBranching.Reachability): Remove handling of
3037 * statement.cs, iterators.cs, lambda.cs: Update to changes.
3039 * statement.cs (Lock.Resolve): Invoke 'ec.NeedReturnLabel'
3040 unconditionally. Simplify explanation.
3041 (Try.Resolve, Using.Resolve): Likewise.
3043 2007-03-15 Martin Baulig <martin@ximian.com>
3047 * decl.cs (DeclSpace): If we're a partial class, use our
3048 `PartialContainer's `TypeParameters' and `CurrentTypeParameters'.
3050 2007-03-15 Raja R Harinath <rharinath@novell.com>
3052 * flowanalysis.cs (FlowBranching.Reachability): Remove handling of
3054 (FlowBranching.UsageVector): Update to changes.
3055 (FlowBranching.MergeSiblings): Likewise.
3056 * statement.cs: Likewise.
3058 2007-03-15 Martin Baulig <martin@ximian.com>
3063 (MemberCache): Added a special .ctor for type parameters.
3066 (TypeManager.MemberLookup_FindMembers): `TypeParameter' now has a
3069 2007-03-09 Martin Baulig <martin@ximian.com>
3071 * enum.cs (Enum): Make this a TypeContainer.
3072 (EnumMember): Derive from `Const'.
3075 (Const.DoResolveValue): New protected virtual method; move most of
3076 the functionality of ResolveValue() here so we can override it in
3078 (Const.CreateConstantReference): Make this virtual.
3080 * class.cs (Kind): Add `Kind.Enum'.
3081 (TypeContainer.Emit): Don't emit the enums here; they're already
3082 in the `RootContext.typecontainer_resolve_order'.
3084 * rootcontext.cs (RootContext.EmitCode): Don't emit the enums
3085 here; they're already in the `typecontainer_resolve_order'.
3087 * ecore.cs (EnumConstant.ConvertImplicitly): Add
3088 TypeManager.DropGenericTypeArguments().
3091 (TypeManager.CSharpEnumValue): Add DropGenericTypeArguments().
3092 (TypeManager.IsEnumType): Likewise.
3093 (TypeManager.EnumToUnderlying): Likewise.
3094 (TypeManager.IsEqual): Add support for enums.
3096 2007-03-12 Raja R Harinath <rharinath@novell.com>
3098 * typemanager.cs (InitCoreTypes) [NET_2_0]: Allow
3099 DefaultParameterValueAttribute to be undefined, say if System.dll
3102 2007-03-11 Marek Safar <marek.safar@gmail.com>
3104 * ecore.cs, parameter.cs, typemanager.cs: Another gmcs fix to work with
3107 2007-03-10 Marek Safar <marek.safar@gmail.com>
3109 * class.cs, parameter.cs: Unified parameters verification.
3111 2007-03-08 Martin Baulig <martin@ximian.com>
3113 * cs-parser.jay (constructor_header): Pass the location to the
3114 newly created TopLevelBlock.
3116 2007-03-07 Martin Baulig <martin@ximian.com>
3118 * statement.cs (Block.Resolve): Don't crash on error; bug #80715.
3120 2007-03-06 Miguel de Icaza <miguel@novell.com>
3122 * convert.cs (ExplicitReferenceConversionExists): Sync this method
3123 with the changes from David, fixes the build.
3125 2007-03-05 David Mitchell <dmitchell@logos.com>
3127 * convert.cs: Implement From System.Collecitons.Generic.IList<T>
3128 and its base interfaces to a one-dimensional array type S[],
3129 provided there is an implicit or explicit reference conversion
3132 2007-03-03 Marek Safar <marek.safar@gmail.com>
3134 * cs-tokenizer.cs: Implemented basic linq grammar.
3136 * driver.cs: Set linq lang version on demand.
3138 2007-02-26 Marek Safar <marek.safar@gmail.com>
3140 * cs-parser.jay, expression.cs: Compile empty __arglist correctly.
3142 2007-02-25 Marek Safar <marek.safar@gmail.com>
3144 * attribute.cs: Replaced DefinePInvoke in favor of S.R.E implementation
3147 * class.cs (InterfaceMemberBase): Share common `extern' modifier checks
3149 Check property and event extern attributes.
3151 * codegen.cs (ModuleClass): HasDefaultCharSet when module defined global
3154 2007-02-24 Marek Safar <marek.safar@gmail.com>
3156 A fix for bug #80407
3157 * ecore.cs: Don't report ambiguity error when methods have same parent.
3159 2007-02-23 Marek Safar <marek.safar@gmail.com>
3161 A fix for bug #80878
3162 * class.cs, cs-parser.jay: Event property can host anonymous methods.
3164 2007-02-22 Marek Safar <marek.safar@gmail.com>
3166 * attribute.cs: Enable ExtensionAttribute presence test.
3168 2007-02-22 Marek Safar <marek.safar@gmail.com>
3170 * class.cs: Warn about missing GetHashCode only when Equals is override.
3172 * decl.cs: Check accessibility of type arguments.
3174 * typemanager.cs: Correctly report nullable array.
3176 2007-02-20 Marek Safar <marek.safar@gmail.com>
3178 * class.cs, report.cs: Capture more details when things go wrong.
3180 2007-02-20 Marek Safar <marek.safar@gmail.com>
3182 A fix for bug #80650
3183 * cs-parser.jay: Anonymous container starts at constructor declaration
3184 and not at block beginning because it has to be usable in constructor
3187 * statement.cs: Use context location and not block one for error reporting.
3189 2007-02-18 Marek Safar <marek.safar@gmail.com>
3191 A fix for bug #78712
3192 * class.cs.cs, decl.cs, ecore.cs: LookupAnyGeneric inspects nested types
3195 2007-02-18 Marek Safar <marek.safar@gmail.com>
3197 A fix for bug #80493 by Atsushi Enomoto
3198 * cs-parser.jay: Ignore invalid attribute target.
3200 2007-02-18 Marek Safar <marek.safar@gmail.com>
3202 * cs-tokenizer.cs: Ignore '\0' as white space character.
3204 2007-02-17 Miguel de Icaza <miguel@novell.com>
3206 * cs-parser.jay: Add support for lambda expressions to the mcs
3209 * lambda.cs: Only clone when we are probing, not on the final call
3210 (Compatible is the final call).
3212 * statement.cs (CloneContext): Introduce class to provide block
3213 remapping during clone.
3215 All statements Clone themselves now.
3217 (Clone): special handling for blocks, when we clone a block, we
3218 register the block inside this routine, as children of the block
3219 might trigger a lookup.
3221 * expression.cs: Add support for CloneContext in all expressions.
3223 2007-02-17 Marek Safar <marek.safar@gmail.com>
3225 A fix for bug #80493
3226 * statement.cs: Report ambiguous warning when interfaces are not related.
3228 2007-02-15 Marek Safar <marek.safar@gmail.com>
3230 C# 3.0 extension methods.
3232 * attribute.cs (Error_MisusedExtensionAttribute): Extension attribute
3233 cannot be used directly.
3235 * class.cs (Class.Emit): Emit extension attribute if any class method
3236 is extension method.
3237 (Method.Define): Add basic extension method validation conditions.
3238 (Method.Emit): Emit extension attribute for method.
3240 * codegen.cs (AssemblyClass): Emit extension attribute if at least one
3241 extension method exists. Currently we follow same approach as Microsoft
3242 does, emit even if a method or a class are private but this can change
3245 * cs-parser.jay: Add handling of `this' keyword in method parameters
3248 * decl.cs (DeclSpace.IsStaticClass): New property.
3249 (MemberCache.FindExtensionMethods): Looks for extension methods with
3250 defined name and extension type.
3252 * doc.cs: Updated after OverloadResolve changes.
3254 * driver.cs: Add new soft reference to System.Core.dll.
3256 * ecore.cs (MethodLookup): Can return only MethodGroupExpr.
3257 (ExtensionMethodGroupExpr): Represents group of extension methods.
3259 * expression.cs (Invocation): Moved methods BetterConversion, MoreSpecific,
3260 BetterFunction, IsOverride, IsAncestralType, OverloadResolve
3261 to MethodGroupExpr and made non-static for easier customization.
3262 (Invocation.DoResolve): Add extension method lookup when no standard
3264 (MemberAccess.DoResolve): Try extension methods if no member exists.
3266 * modifiers.cs: Add METHOD_EXTENSION modifier.
3268 * namespace.cs (RegisterExtensionMethodClass): Register class namespace
3269 as well as candidate extension type.
3270 (ComputeNamespaces): When assembly constains extension methods registers
3272 (Namespace.RegisterExternalExtensionMethodClass): Register type for later
3273 extension method lookup.
3274 (Namespace.LookupExtensionMethod): Looks for extension method in this
3276 (NamespaceEntry.LookupExtensionMethod): Does extension methods lookup to
3277 find a method which matches name and extensionType.
3279 * parameter.cs (Parameter): Add This modifer.
3280 (HasExtensionMethodModifier): New property.
3281 (Resolve): Add extension parameter check.
3282 (ModFlags): turned to property to exclude this modifier as it is not real
3284 (Parameters): Implemented ExtensionMethodType and HasExtensionMethodType.
3286 * support.cs (ParameterData): Add ExtensionMethodType.
3287 (ReflectionParameters): Implemented ExtensionMethodType interface property.
3289 * typemanager.cs: Add type and ctor extension attribute type.
3291 2007-02-15 Miguel de Icaza <miguel@novell.com>
3293 * report.cs (DisableErrors, EnableErrors): used to prevent error
3294 output when we are "trying" to compile various methods with
3297 * ecore.cs (Expression): Add Clone method that calls the virtual
3298 CloneTo method. The current CloneTo method in Expression throws
3299 an exception so we can track down all the places where this must
3300 be implemented (not using abstract, because that would be a lot of
3301 up-front-work before we can start testing the implementation
3304 Important: we only need Clone capabilities for expressions created
3305 by the parser, as the expressions we will be cloning are
3306 expressions in the pre-resolved state. This vastly simplifies
3309 (SimpleName): Add CloneTo that does nothing.
3310 (EmptyCast): Add CloneTo.
3312 * expression.cs (Binary): Implement CloneTo.
3313 (Invocation.IsApplicable): Store the current ec in
3314 EmitContext.TempEc and restore it on return. This is used so we
3315 do not have to sprinkle hundres of methods with an extra
3316 EmitContext, we know that the only user is the lambda expression
3317 ImplicitConversionExists code.
3319 (Argument): Add Cloning capabilities.
3320 (LocalVariableReference, ParenthesizedExpression, Unary, Probe,
3321 Cast, Conditional, ArrayCreation, InvocationOrCast, Invocation,
3322 ArglistAccess, ArgList, TypeOf, SizeOf, CheckedExpr,
3323 UnCheckedExpr, ElementAccess, BaseAccess, BaseIndexerAccess,
3324 IndexerAccess): Add Clone capability.
3326 (LocalVariableReference, This): TODO: needs cloned Block mapping.
3328 (Argument): Add cloning capability.
3330 * assign.cs (Assign): Implement CloneTo.
3332 * anonymous.cs (ImplicitStandardConversionExists): Make virtual.
3334 * lambda.cs (ImplicitStandardConversionExists): Implement lambda
3335 version by calling Convert with the EmitContext (that we are
3336 currently storing in ec, this is not great, but will do for now,
3337 to avoid passing EmitContext parameters to hundreds of functions
3338 that do not need them now).
3340 (SetExpression): Remove, it is not needed.
3342 (ContextualReturn): Implement CloneTo.
3344 * statement.cs (Statement): Implement cloning infrastructure,
3345 similar to expressions.
3347 (Block): Partial implementation of Clone for statements.
3349 (Return): Implement clone.
3351 * constant.cs (Constant.CloneTo): New method, does nothing.
3353 * codegen.cs (TempEc): Add a static EmitContext as a temporary
3354 solution, until we decide how to exactly do this.
3356 2007-02-14 Marek Safar <marek.safar@gmail.com>
3358 A fix for bug #80493
3359 * class.cs (FindOutBaseMethod): When the base accessor does not exist and
3360 a property is override we need to use second accessor.
3362 2007-02-13 Marek Safar <marek.safar@gmail.com>
3364 A fix for bug #80418
3365 * attribute.cs, class.cs: Use correct calling conventions for pinvoke
3368 2007-02-13 Marek Safar <marek.safar@gmail.com>
3370 Another fix for bug #80749
3371 * pending.cs: Abstract class has priority over interfaces.
3373 2007-02-13 Marek Safar <marek.safar@gmail.com>
3375 Another fix for bug #80749
3376 * pending.cs: Abstract class has priority over interfaces.
3378 2007-02-13 Marek Safar <marek.safar@gmail.com>
3380 Another fix for bug #80749
3381 * pending.cs: Abstract class has priority over interfaces.
3383 2007-02-13 Marek Safar <marek.safar@gmail.com>
3385 Another fix for bug #80749
3386 * pending.cs: Abstract class has priority over interfaces.
3388 2007-02-13 Marek Safar <marek.safar@gmail.com>
3390 * class.cs Better error message.
3392 * driver.cs: Add shorter versions of -optimize option.
3394 2007-02-13 Martin Baulig <martin@ximian.com>
3396 * class.cs (Constructor.Emit): Check the return value of
3397 ec.ResolveTopBlock() and return on error.
3399 2007-02-13 Raja R Harinath <rharinath@novell.com>
3401 * ecore.cs (Error_InvalidExpressionStatement): Add a comma to error
3402 message to fix error message regression.
3404 2007-02-12 Marek Safar <marek.safar@gmail.com>
3406 * delegate.cs: Delegate creation expression cannot be of Nullable type.
3408 2007-02-12 Marek Safar <marek.safar@gmail.com>
3410 A fix for bug #80749
3411 * assign.cs (FieldInitializer): FieldInitializer has to keep track of
3412 its parent container.
3414 * class.cs (DefineFieldInitializers): Each initializer can has different
3417 * const.cs: Updated.
3419 2007-02-11 Miguel de Icaza <miguel@novell.com>
3421 * lambda.cs (LambdaExpression.Compatible): Remove some early code,
3422 now all the heavy lifting to check that embedded statements or
3423 expressions have the right form is done in the ContextualReturn.
3425 (ContextualReturn): New class.
3427 * ecore.cs (Error_InvalidExpressionStatement): Make a helper
3428 method that can be invoked to report 201, so we do not replicate
3431 * cs-parser.jay: Reuse Error_InvalidExpressionStatement.
3433 * cs-tokenizer.cs (xtoken): Correctly compute the column, it was
3434 treating tabs as spaces.
3436 2007-02-09 Marek Safar <marek.safar@gmail.com>
3438 A fix for bug #80315 by martin.voelkle@gmail.com (Martin Voelkle)
3439 * assign.cs: Use full implicit conversion for right side check.
3441 2007-02-09 Marek Safar <marek.safar@gmail.com>
3443 * statement.cs (Switch): Switch over boolean type is not standardized.
3445 2007-02-08 Marek Safar <marek.safar@gmail.com>
3447 A fix for bug #80755
3448 * decl.cs (FindBaseEvent): Don't use method cache for events.
3450 2007-02-07 Marek Safar <marek.safar@gmail.com>
3452 * cs-parser.jay: Better syntax error handling.
3454 * ecore.cs, enum.cs, statement.cs, typemanager.cs: Print enum member name
3455 instead of underlying type value.
3457 2007-02-06 Marek Safar <marek.safar@gmail.com>
3459 * driver.cs: Check define identifier before is registered.
3461 * namespace.cs: Use existing error message.
3463 * report.cs: New warning.
3465 2007-02-06 Marek Safar <marek.safar@gmail.com>
3467 A fix for bug #80742
3468 * expression.cs: Delegate Invoke method can be called directly.
3470 2007-02-06 Marek Safar <marek.safar@gmail.com>
3472 A fix for bug #80676
3473 * class.cs (IsEntryPoint): The Main method can have params modifier.
3475 2007-02-04 Miguel de Icaza <miguel@novell.com>
3477 * parameter.cs (Parameter, Parameters): Add Clone method.
3479 * anonymous.cs (Compatible): Turn method into virtual method, so
3480 LambdaExpression can implement a different behavior.
3482 (CompatibleChecks, VerifyExplicitParameterCompatibility): Factor
3483 out the basic checking here, so it can be used by
3486 * lambda.cs: Introduce "Compatible" function that will do the
3489 2007-02-02 Marek Safar <marek.safar@gmail.com>
3491 * attribute.cs: Unified one error message.
3493 * class.cs (Class): Use type attributes and not properties to test static
3495 (IsEntryPoint): Don's pass local variable.
3497 * convert.cs: Removed duplicate check.
3499 * decl.cs, doc.cs, ecore.cs (LookupType): Renamed to LookupNamespaceOrType.
3501 * driver.cs: Don't crash when soft reference does not exist.
3503 * namespace.cs (EnsureNamespace): Renamed to RegisterNamespace.
3504 (UsingEntry): Removed redundant allocation.
3506 * parameter.cs: Add fast path for type parameters.
3508 * support.cs: Don't allocate attribute when it's not used.
3510 2007-01-30 Miguel de Icaza <miguel@novell.com>
3513 (AnonymousMethodExpression.ImplicitStandardConversionExists): turn
3514 this into a virtual method, so we can override it in LambdaExpression.
3516 * driver.cs: Improve diagnostics in case of failure.
3518 * cs-tokenizer.cs: Instead of trying to parse a type and a name,
3519 write a function that is slightly more complex and that parses:
3521 type identifier [, type identifier]* )
3523 The old function would return incorrectly a OPEN_PARENS_LAMBDA for
3526 (canEmpty ? i >= 0 : i > 0)
3528 2007-01-30 Raja R Harinath <rharinath@novell.com>
3530 * cs-tokenizer.cs (parse_namespace_or_typename): Don't throw an
3531 exception on possibly valid code.
3533 2007-01-29 Raja R Harinath <rharinath@novell.com>
3535 * cs-tokenizer.cs (is_punct) ['<']: Update to changes in
3537 (parse_opt_type_arguments): Remove. It's almost the same as
3539 (parse_namespace_or_typename): Use parse_less_than.
3541 2007-01-28 Miguel de Icaza <miguel@novell.com>
3543 * cs-tokenizer.cs: Typo fix, its not GMCS_SOURCES but GMCS_SOURCE,
3544 this bug took a few hours to find, because the state saved and
3545 restored by PushPosition and PopPosition was ignoring the state of
3546 parse_generic_less_than.
3548 I can also now remove the handling of OP_LT and OP_GT, this solves
3551 * cs-tokenizer.cs: store the location for the ARROW token, we use
3554 (PushPosition, PopPosition): save/restore also `current_token',
3555 restore `parse_generic_less_than' (was missing).
3557 (parse_opt_type_arguments): use parse_type, not
3558 parse_namespace_or_typename to parse types.
3560 * lambda.cs: Empty new file, will eventually have the lambda
3561 expression implementation.
3563 * lambda.test: used to test the internal tokenizer.
3565 * report.cs (FeatureIsNotISO1): Rename from
3566 FeatureIsNotStandardized, because it was about the language level
3567 (1 vs 2) it was not about standarization.
3569 (FeatureRequiresLINQ): New.
3571 * support.cs (SeekableStreamReader): Only require that the reader
3572 is a TextReader, not a StreamReader, so we can plug StringReader.
3574 * cs-tokenizer.cs (parse_type_and_parameter): Returns true if at a
3575 given position in the input stream the following tokens can be
3576 parsed as a type followed by an identifier.
3578 (is_punct): after a '(' if parse_type_and_parameter returns true,
3579 then return a special token OPEN_PARENS_LAMBDA which is used to
3580 avoid reduce/reduce errors in the grammar for the
3581 lambda_expression rules.
3583 (parse_type): implement a type parser inside the
3584 tokenizer, the parser only returns true or false depending on
3585 whether the input at a given position can be parsed as a type.
3587 (peek_token): new method used during type parsing.
3589 2007-01-28 Raja R Harinath <rharinath@novell.com>
3592 * anonymous.cs (ScopeInfo.InflateParameters): New.
3593 (AnonymousContainer.Resolve): Use it to redirect types of
3594 delegate parameters.
3596 2007-01-27 Raja R Harinath <rharinath@novell.com>
3599 * expression.cs (Error_InvalidArguments): Don't use two different
3600 messages for CS1503. Use ExtraInformation and
3601 SymbolRelatedToPreviousError instead.
3604 * decl.cs (DeclSpace.initialize_type_params): Don't access
3605 'type_params' of a partial class directly.
3607 2007-01-26 Miguel de Icaza <miguel@novell.com>
3609 * constant.cs: Removed a handful of out-of-range checks that were
3612 2007-01-25 Marek Safar <marek.safar@gmail.com>
3614 * expression.cs (CheckUselessComparison): Add additional check for char
3617 * namespace.cs: Fixed typo.
3619 2007-01-23 Miguel de Icaza <miguel@novell.com>
3621 * constant.cs: Bloat removal, CheckRange and CheckUnsigned are
3622 gone, instead we inline the test, preventing the needless casts to
3623 longs, ulongs and doubles for the parameters, avoiding calls to
3624 methods that overchecked stuff, and instead inlined things
3627 2007-01-20 Marek Safar <marek.safar@gmail.com>
3629 * cs-parser.jay: Better parameter error handling.
3631 2007-01-17 Marek Safar <marek.safar@gmail.com>
3633 A fix for bug #80368, #80522
3634 * expression.cs (ArrayCreation.only_constant_initializers): Indicates
3635 whether array initializer contains constants only.
3636 (ArrayCreation.Emit): Use better formula to decide when
3637 are array initializers for static initialization.
3638 (ArrayCreation.EmitDynamicInitializers): When the array is small enough we
3639 have to emit even constants otherwise they are pre-initialized.
3641 2007-01-17 Bill Holmes <bill.holmes@ansys.com>
3642 Raja R Harinath <rharinath@novell.com>
3644 Fix emit order of 'get' vs. 'set'.
3645 * support.cs (Accessors): New.
3646 * cs-parser.jay (accessor_declarations): Use it instead of 'Pair'.
3647 Note the order in which accessors are declared in the source.
3648 * class.cs (PropertyBase.DefineGet, PropertyBase.DefineSet): New.
3649 Refactored from Property.Define and Indexer.Define.
3650 (PropertyBase.DefineAccessors): New helper that calls the above in
3651 appropriate order as noted by the parser.
3652 (Property.Define, Indexer.Define): Update to changes.
3653 (PropertyBase.SetMethod.PropertyInfo): Don't return a null.
3655 2007-01-17 Raja R Harinath <rharinath@novell.com>
3657 Fix cs0029-6.cs and gcs0029-2.cs (regression)
3658 * ecore.cs (EmptyConstantCast.ConvertImplicitly): Check that
3659 there's an implicit conversion from the current type to the target
3660 type before converting the underlying constant.
3662 2007-01-16 Marek Safar <marek.safar@gmail.com>
3664 * const.cs (ResolveValue): Updated after constant conversion was made more
3667 * constant.cs (GetAttributableValue): constant to object conversion is
3668 used for attributes only.
3669 (IntConstant.ConvertImplicitly): Moved from convert to be used in all
3670 constant conversions.
3671 (LongConstant.ConvertImplicitly): Ditto.
3673 * convert.cs (ImplicitNumericConversion): Extracted constant bussiness.
3674 (ImplicitConversionStandard): Handle constant conversion as extra step.
3675 It solves the issue when constant conversion was called indirectly like
3676 inside array initializer and constant folding was skipped.
3678 * literal.cs (NullLiteral.ConvertImplicitly): Fixed an issue exposed by
3681 * statement.cs(ImplicitConversionStandard): Updated after constant
3682 conversion was made more generic.
3684 2007-01-16 Sergey P. Kondratyev <se@unicom.tomica.ru>
3686 * expression.cs (As.DoResolve): Use GenericConstraints instead of
3687 Constraints, solves the problem where the compiler incorrectly
3688 reported that a type parameter was not constrained to a class (Bug
3691 2007-01-14 Marek Habersack <grendello@gmail.com>
3693 * doc-bootstrap.cs: Fix a compilation problem in the bootstrap phase.
3695 2007-01-14 Marek Safar <marek.safar@gmail.com>
3697 A fix for bug #80368
3698 * assign.cs (FieldInitializer): New class implements field
3699 initializer statement.
3701 * attribute.cs: Update after FieldMember rename.
3703 * class.cs (PropertyBasedMember): New common class for property based
3705 (InterfaceMemberBase): New base class for all members which can be used as
3706 an interface members.
3707 (MethodCore): Moved really common code to InterfaceMemberBase.
3708 (Method.Define): Equal and GetHasCode detection is relevant for methods
3710 (MethodData.Define): Don't assume that public event implements an
3711 interface automatically.
3712 (MethodData.DefineMethodBuilder): Issue an error even if only extern
3714 (MemberBase): Moved all interface speficic code to InterfaceMemberBase.
3715 (FieldMember): Merged with FieldBase.
3716 (EventProperty.AEventPropertyAccessor): New specialization to check whether
3717 event extern modifier can be used.
3718 (EventField.EventFieldAccessor): Moved event field specific code here.
3719 (Event.AllowedModifiers): Even event can be extern.
3720 (Event.FindOutBaseMethod): New override specific to events.
3721 (Indexer.parameters): Reintroduce parameters because base class holds
3722 only properties common data.
3723 (Indexer.CheckForDuplications): Indexers are threated as methods so we
3724 need do extra parameters check.
3726 * const.cs: Update after FieldMember rename.
3728 * decl.cs (MemberCache.FindBaseEvent): New method.
3730 * doc.cs (GetMethodDocCommentName): Accept parameters as extra argument
3731 to reflect that indexer is now derived from PropertyBased.
3733 * ecore.cs (GetMemberType): Made public.
3734 (EventExpr.ResolveMemberAccess): Use right event cache and checks for
3737 * flowanalysis.cs, statement.cs: Update after FieldMember rename.
3739 * typemanager.cs (CSharpSignature): Correctly print event accessors.
3740 (RegisterEvent): Removed.
3741 (RegisterPrivateFieldOfEvent): Renamed to RegisterEventField.
3742 (GetPrivateFieldOfEvent): Renamed to GetEventField.
3744 2007-01-11 Raja R Harinath <rharinath@novell.com>
3747 * statement.cs (CollectionForeach.TryType): Prefer generic
3748 GetEnumerator over non-generic variant. Fix code to follow comments.
3750 2007-01-09 Raja R Harinath <rharinath@novell.com>
3753 * support.cs (ReflectionParameter): Don't use an invalid index on
3754 the generic parameter data.
3756 2007-01-08 Miguel de Icaza <miguel@novell.com>
3758 * driver.cs: Just add a tiny bit of infrastructure.
3760 2007-01-02 Marek Safar <marek.safar@gmail.com>
3762 * class.cs (VerifyMembers): Fixed an crash reported on mono mailing list
3763 where field type is struct from current assembly.
3765 * ecore.cs (EnumConstant.AsString): Report an enum member name whenever
3768 2007-01-02 Marek Safar <marek.safar@gmail.com>
3770 A fix for bug #80381
3771 * attribute.cs (AttributeTester.RegisterNonObsoleteType): Registers
3774 * namespace.cs (GlobalRootNamespace.LookupTypeReflection): Better error
3776 (Namespace.LookupType): Always use core types from corlib when speficied.
3778 * report.cs: A new warning.
3780 * rootcontext.cs (BootstrapCorlib_ResolveInterface,
3781 BootstrapCorlib_ResolveClass): Register type as non-obsolete type.
3782 (ResolveCore): Add missing System.Runtime.InteropServices._Attribute.
3784 * typemanager.cs (CoreLookupType): Register type as non-obsolete type.
3785 (InitCoreTypes): Set expression type of object_type and value_type
3786 immediately after lookup.
3788 2007-01-01 Miguel de Icaza <miguel@novell.com>
3790 * cs-tokenizer.cs: Accept Pc class characters (Connector
3791 Punctuation) as valid identifiers. Fixes #78259
3793 * expression.cs (Invocation.DoResolve): Moved the check for the
3794 use of `this' for doing method calls to the Invocation resolution
3795 step, after overload resolution has taken place instead of doing
3796 the check at the low-level `This.DoResolve' level.
3798 The `This.DoResolve'(appens before overload resolution, so it has
3799 no way of knowing if the method that will be called will be
3800 instace or static, triggering an erroneous report for cs0188 (Bug
3803 We now do the check for instance method invocations after we know
3804 what method will be called.
3806 (This.CheckThisUsage): Move the actual use of this structure
3807 checking into its own method and expose it.
3809 * Everywhere that called Error_ValueCannotBeConverted: pass a new
3812 Exceptions: Null.ConvertImplicitly,
3813 Constant.ImplicitConversionRequired as there are too many call
3814 sites for passing the ec.
3816 * ecore.cs (Expression.Error_ValueCannotBeConverted): Take an
3817 EmitContext, if the value is null, then we do not try to provide
3818 the extra information from the error (If a userdefined conversion
3819 exists, as UserDefinedConversion requires a non null-EmitContext).
3823 2006-12-30 Raja R Harinath <rharinath@novell.com>
3825 * flowanalysis.cs (MyBitVector): Document some invariants.
3826 (MyBitVector.Or, MyBitVector.And): Reimplement the optimizations
3827 introduced below, and add a couple of others,
3829 2006-12-30 Marek Safar <marek.safar@gmail.com>
3831 * attribute.cs (GetMethodObsoleteAttribute): Uses new
3832 GetPropertyFromAccessor and GetEventFromAccessor.
3834 * class.cs (MethodCore.CheckBase): A new warning when obsolete member
3835 overrides non-obsolete one.
3836 (Indexer.Define): Error message has been moved to the parser.
3838 * cs-parser.jay: Better syntax errors handling.
3840 * delegate.cs (NewDelegate.DoResolve): Issue less confusing error message
3841 when an invocation has no arguments.
3843 * ecore.cs: Removed not used caching.
3845 * expression.cs (IsSpecialMethodInvocation): Reuses TypeManager
3848 * report.cs: Add a new warning.
3850 * support.cs (ReflectionParameters): Implements Equals, GetHashCode.
3852 * typemanager.cs (enumeration_type): Removed.
3853 (CSharpSignature): Reuses IsSpecialMethod.
3854 (IsEqual): Hack for MS BCL.
3855 (GetPropertyFromAccessor): New method.
3856 (GetEventFromAccessor): New method.
3857 (IsSpecialMethod): Fixed to handle more cases.
3859 2006-12-30 Marek Safar <marek.safar@gmail.com>
3861 * cs-tokenizer.cs (PreProcessDefinition, handle_preprocessing_directive):
3862 Made white spaces array static.
3864 * ecore.cs (RemoveGenericArity): Optimized.
3866 * flowanalysis.cs (MyBitVector.Or, MyBitVector.And): Optimized (up to
3868 (MyBitVector.initialize_vector): Simplified.
3870 2006-12-22 Miguel de Icaza <miguel@novell.com>
3872 * ecore.cs: Am not entirely happy with this hack, but it seems to
3873 address the issue in 80257 (a small test case for
3876 I set the MethodGroupExpr.Type to an internal compiler type
3877 (itself in this case) to force the resolution to take place. Why
3878 it does not take place with a null is beyond me.
3880 2006-12-20 Marek Safar <marek.safar@gmail.com>
3882 A fix for bug #80288
3883 * expression.cs (ResolveOperator): Consider user defined conversion for
3884 logical and operator too.
3885 (EmitBranchable): Optimization for logical and when full constant folding
3886 could not be applied but one operand is constant.
3888 2006-12-19 Marek Safar <marek.safar@gmail.com>
3890 * class.cs (GetClassBases): Write 5 times every day, will never use
3891 FullName for error reporting.
3893 * decl.cs (AsAccessible, CheckAccessLevel): Always unpack arrays first.
3895 2006-12-19 Martin Baulig <martin@ximian.com>
3897 * statement.cs (LocalInfo.EmitSymbolInfo): New public method; emit
3898 the symbol file info here.
3900 2006-12-18 Marek Safar <marek.safar@gmail.com>
3902 * cs-tokenizer.cs (handle_preprocessing_directive): When previous section
3903 of `elseif' is taking then following sections are not taking.
3904 Fixes an issue reported on mono mailing list.
3906 2006-12-18 Marek Safar <marek.safar@gmail.com>
3908 A fix for bug #80300
3909 * cs-tokenizer.cs (PreProcessDefinition): Do no define/undefine when
3910 a caller is not taking.
3912 2006-12-18 Raja R Harinath <rharinath@novell.com>
3914 * anonymous.cs: Change several TypeContainer declarations to DeclSpace.
3915 (CompilerGeneratedClass): Use parent.PartialContainer unconditionally.
3916 (RootScopeInfo, AnonymousMethodMethod): Update to changes.
3917 * iterator.cs: Change several TypeContainer declarations to DeclSpace.
3918 * class.cs: Update to changes.
3920 2006-12-17 Marek Safar <marek.safar@gmail.com>
3922 A fix for bug #79934
3923 * anonymous.cs (CompilerGeneratedClass): Register class in a shared
3926 * class.cs (ResolveMembers): Register an iterator in current container and
3929 2006-12-16 Raja R Harinath <rharinath@novell.com>
3932 * expression.cs (VerifyArgumentsCompat): Allow zero arguments to
3933 satisfy a params annotated parameter.
3935 2006-12-16 Marek Safar <marek.safar@gmail.com>
3937 A fix for bug #77014
3938 * expression.cs (Invocation.BetterFunction): Fixed to cope with dynamic
3939 paramters correctly and not rely on hacks in Parameters class.
3940 (Invocation.IsParamsMethodApplicable): Changed to accept params parameter
3942 (Invocation.VerifyArgumentsCompat): Ditto.
3943 (Invocation.EmitArguments): Changed to correctly emit params arguments at
3946 * parameter.cs (HasParams): Don't assume that params is the last one.
3948 * support.cs (ReflectionParameters.ctor): Look for params attribute
3950 (ReflectionParameters.ParameterType): Removed hack when we returned last
3951 parameter for out of range parameters.
3952 (ParameterName, ParameterModifier): Ditto.
3954 2006-12-14 Marek Safar <marek.safar@gmail.com>
3956 A fix for bug #79987
3957 * decl.cs (DeclSpace.VerifyClsCompliance): External names cache is null
3958 when assembly is not CLS compliant but type is. I have no idea why is this
3961 * typemanager.cs (Reset): Invalidate AllClsTopLevelTypes cache.
3963 2006-12-13 Miguel de Icaza <miguel@novell.com>
3965 * class.cs (ConstructorInitializer.Resolve): Allow for ":this()"
3966 in struct constructors, they are basically no-ops.
3968 2006-12-12 Marek Safar <marek.safar@gmail.com>
3970 * cs-tokenizer.cs (Position): Save preprocessor status too.
3972 2006-12-12 Marek Safar <marek.safar@gmail.com>
3974 A fix for bug #77794
3975 * cs-tokenizer.cs (consume_identifier): Check for correct partial context.
3977 2006-12-12 Marek Safar <marek.safar@gmail.com>
3979 * cs-tokenizer.cs (get_cmd_arg): Support CR as the line terminator.
3981 (pp_expr): Report error for an invalid expression.
3982 (handle_preprocessing_directive): Simplified; add more error checking.
3984 2006-12-11 Marek Safar <marek.safar@gmail.com>
3986 A fix for bug #74939
3987 * cs-tokenizer.cs (is_punct): We cannot simply disable preprocessor
3988 directives handling.
3990 2006-12-10 Marek Safar <marek.safar@gmail.com>
3992 A fix for bugs #80093, and #75984
3993 * cs-tokenizer.cs (handle_preprocessing_directive): Fixed #if/#else/#endif
3994 logic, it seems to me as it worked before "by coincidence".
3995 (xtoken): Simplified to use reworked handle_preprocessing_directive.
3996 (cleanup): Enabled endif check.
3998 2006-12-09 Marek Safar <marek.safar@gmail.com>
4000 A fix for bug #80162
4001 * statement.cs (CollectionForeach.TryType): Generics and non-generics
4002 enumerators are never ambiguous.
4004 2006-12-08 Raja R Harinath <rharinath@novell.com>
4007 * cs-tokenizer.cs (parse_less_than): Recognize double-colons too.
4009 2006-12-06 Marek Safar <marek.safar@gmail.com>
4011 A fix for bug #80144
4012 * class.cs (EventProperty.Define): Explicit implementation means
4013 that an even is used.
4015 2006-12-06 Marek Safar <marek.safar@gmail.com>
4017 Fixes the operators implementation (part II)
4019 * cfold.cs (DoConstantNumericPromotions): Renamed to
4020 DoBinaryNumericPromotions and simplified.
4021 (BinaryFold): Couple of conversion fixes; simplified.
4023 * constant.cs, ecore.cs, literal.cs
4024 (ToType): Renamed to ConvertImplicitly.
4025 (Reduce): Renamed to ConvertExplicitly.
4027 * class.cs, convert.cs: Updated.
4029 * expression.cs: TryReduce doesn't throw an exception.
4031 2006-12-01 Marek Safar <marek.safar@gmail.com>
4033 A fix for bug #80108
4034 * ecore.cs (EventExpr.EmitAddOrRemove): Don't crash when right side is not
4037 2006-11-30 Marek Safar <marek.safar@gmail.com>
4039 Fixes unary operators implementation (part I)
4042 * cfold.cs (Error_CompileTimeOverflow): Made internal
4044 * const.cs (IConstant): Changed to use reference to constant and
4045 not constant itself.
4046 Updated IConstant implementations.
4048 * constant.cs (CreateConstant): New factory method.
4049 Updated IConstant implementation.
4051 * convert.cs (ImplicitStandardConversionExists): Uses compiler Equals.
4053 * ecore.cs: Updated to use CreateConstantReference.
4055 * enum.cs: Reflects IConstant changes.
4057 * expression.cs (Unary): Reimplemented +,-,~ to conform C# standard.
4059 * literal.cs (NullConstant): Change to be independently usable.
4061 2006-11-29 Martin Baulig <martin@ximian.com>
4063 * class.cs (Constructor.Emit): Correctly handle anonymous methods;
4064 we need to emit the scope initializer before calling the base .ctor.
4066 * anonymous.cs: Merged back from the new anonymous methods branch.
4067 (AnonymousMethodHost): Renamed to `RootScopeInfo'.
4069 * expression.cs (ParameterReference.DoResolveBase): Create a
4070 "normal" ScopeInfo when capturing parameters rather than using the
4071 root scope; this makes things work with anonymous methods having
4075 (ToplevelBlock.AnonymousMethodHost): Renamed into `RootScope'.
4077 2006-11-22 Marek Safar <marek.safar@gmail.com>
4079 A fix for bug #79987
4080 * class.cs (VerifyClsCompliance): Move redundant CLS compliance attribute
4081 check to a base class.
4082 * decl.cs (VerifyClsCompliance): Warn that CLS compliance cannot be tested
4083 only when assembly has missing attribute.
4084 * report.cs: Update.
4086 2006-11-21 Marek Safar <marek.safar@gmail.com>
4088 * cs-tokenizer.cs: Merged with gmcs version.
4090 2006-11-20 Marek Safar <marek.safar@gmail.com>
4093 * cs-parser.jay: Better error message when partial keyword is misplaced.
4095 2006-11-19 Gert Driesen <drieseng@users.sourceforge.net>
4097 A fix for bug #79810
4098 report.cs: CS1058 only applies to 2.0 profile (gmcs).
4099 codegen.cs: on 2.0 profile, non-exception throwables are wrapped in
4100 a RuntimeWrappedException by default.
4102 2006-11-18 Marek Safar <marek.safar@gmail.com>
4104 A fix for bug #79843
4105 * delegate.cs (Delegate.VerifyMethod): Fixed covariance and contravariance
4107 (DelegateCreation.Error_NoMatchingMethodForDelegate): Ditto.
4109 2006-11-18 Marek Safar <marek.safar@gmail.com>
4111 * driver.cs, namespace.cs: Uses faster IndexOf version.
4113 2006-11-17 Marek Safar <marek.safar@gmail.com>
4115 A fix for bug #79941
4116 * class.cs (MemberCore.IsDuplicateImplementation): Add more tricks for
4118 (Operator.Define): Implicit/Explicit operator of same type is duplicate
4119 even if internal name is different.
4120 * convert.cs (GetConversionOperator): Replaced EmitContext with parentType.
4121 (UserDefinedConversion): Simplified as the operators cannot be internal.
4122 * ecore.cs (Error_ValueCannotBeConverted): Take account of user
4124 (MethodLookup): Replaced EmitContext with parentType.
4125 * expression.cs: Updated.
4127 2006-11-09 Raja R Harinath <rharinath@novell.com>
4129 * driver.cs (BadAssembly): Handle all the ugliness of
4130 DefineDynamicAssembly.
4132 2006-11-08 Raja R Harinath <rharinath@novell.com>
4134 Address parts of #58244 -- most of what's left is in the runtime
4135 * driver.cs (LoadAssembly): Simplify slightly. Add CS0009 and
4136 CS1509 error checks, and handle them for all assembly loads, not
4137 just the first invocation.
4138 (LoadModule): Likewise. Move handling of 'adder_method' ...
4139 * codegen.cs (AssemblyClass.AddModule): ... here.
4141 2006-11-02 Marek Safar <marek.safar@gmail.com>
4143 * statement.cs.cs (CollectionForeach.TryType): Issue a error when
4144 IEnumerable<T> is ambiguous.
4146 2006-10-31 Marek Safar <marek.safar@gmail.com>
4148 A fix for bug #67689
4149 * statement.cs.cs (CollectionForeach.TryType): Issue a warning when
4150 GetEnumerator is ambiguous.
4152 * report.cs: Add new warning.
4154 2006-10-29 Marek Safar <marek.safar@gmail.com>
4156 A fix for bug #78602
4157 ecore.cs (PropertyExpr.InstanceResolve): The qualifier for access
4158 to protected member can be nested type.
4160 2006-10-28 Marek Safar <marek.safar@gmail.com>
4162 A fix for bug #78965
4163 ecore.cs (PropertyExpr.InstanceResolve): The qualifier for access
4164 to protected member must derive from current type.
4166 2006-10-27 Marek Safar <marek.safar@gmail.com>
4168 assign.cs: Reuses error method.
4170 ecore.cs (Expression.Error_ValueCannotBeConverted): Report a value
4171 instead of type for constants.
4172 (Expression.Error_ValueAssignment): Common error method.
4174 * expression.cs (UnaryMutator.ResolveOperator): Value cannot be used
4177 2006-10-27 Marek Safar <marek.safar@gmail.com>
4179 A fix for bug #79081
4180 * expression.cs (MemberAccess.DoResolve): Check nested type
4183 2006-10-27 Atsushi Enomoto <atsushi@ximian.com>
4185 * doc.cs : nested delegates were not handled. Fixed bug #79754.
4187 2006-10-26 Marek Safar <marek.safar@gmail.com>
4189 A fix for bug #76591
4190 * cs-tokenizer.cs (IsCastToken): Enable a cast of anonymous method.
4192 2006-10-26 Marek Safar <marek.safar@gmail.com>
4194 * codegen.cs (AssemblyClass.ApplyAttributeBuilder): Don't allow to have
4195 type forwarder of the same type multiple times.
4197 2006-10-26 Raja R Harinath <rharinath@novell.com>
4200 * ecore.cs (PropertyExpr.InstanceResolve): Always resolve the
4201 instance as an rvalue, even when we later resolve as an lvalue.
4203 2006-10-25 Martin Baulig <martin@ximian.com>
4205 * anonymous.cs: Fix #79673.
4207 2006-10-24 Marek Safar <marek.safar@seznam.cz>
4209 A fix for bug #79666
4210 expression.cs (ArrayCreation.GetAttributableValue): An initializer can be
4211 ignored when is optimized (= default value) as its value is already set.
4213 2006-10-23 Marek Safar <marek.safar@seznam.cz>
4215 A fix for bug #79724
4216 * report.cs (SymbolRelatedToPreviousError): Uses DeclSpace instead of
4217 TypeContainer for type lookup.
4219 2006-10-23 Marek Safar <marek.safar@seznam.cz>
4221 A fix for bug #79231
4222 * ecore.cs (ResolveAsBaseTerminal): Removed redundant error test.
4223 * expression.cs (OverloadResolve): Always convert type name for
4225 (ResolveNamespaceOrType): Don't confuse a nested type with any
4228 2006-10-18 Martin Baulig <martin@ximian.com>
4230 * anonymous.cs: Propagate the IsStatic state, fixes the crasher in banshee.
4232 2006-10-17 Miguel de Icaza <miguel@novell.com>
4234 * convert.cs: Fix typo, fixes the test-535.cs, we were casting to
4235 an int32, but requesting an int64 from the conversion
4237 2006-10-12 Martin Baulig <martin@ximian.com>
4240 (AnonymousContainer.Resolve): Inflate the `ReturnType'. Fixes #79592.
4242 2006-10-12 Martin Baulig <martin@ximian.com>
4245 (Using.EmitLocalVariableDeclFinally): Small fix for iterators.
4247 2006-10-11 Miguel de Icaza <miguel@novell.com>
4249 * convert.cs: Remove broken code: I was doing the "Existance"
4250 tests for Implicit conversions.
4252 2006-10-10 Miguel de Icaza <miguel@novell.com>
4254 * convert.cs: Added one missing case in
4255 ImplicitStandardConversionExists uint64 to intptr.
4259 * typemanager.cs (uintptr_type): another core known type.
4261 * ecore.cs (OperatorCast): routine used to do cast operations that
4262 depend on op_Explicit. We could change some of the Decimal
4263 conversions to use this.
4265 This one has a probe mechanism that checks both types for an op_
4266 which it coudl be used to eliminate two classes: CastToDecimal
4267 and CastFromDecimal.
4269 * convert.cs: Implement the conversions documented in #59800
4271 2006-10-10 Martin Baulig <martin@ximian.com>
4273 * iterators.cs (Iterator.Resolve): Call RootScope.ResolveType()
4274 before RootScope.ResolveMembers().
4276 * anonymous.cs (ScopeInfo.CapturedScope.ctor): Use the child's
4277 `CurrentType' if appropriate.
4279 2006-10-09 Marek Safar <marek.safar@seznam.cz>
4281 A fix for bug #78568
4282 * cs-tokenizer.cs (Deambiguate_CloseParens): Expression cannot be cast
4283 when contains binary operators.
4284 * cs-parser.jay: Updated.
4286 2006-10-09 Martin Baulig <martin@ximian.com>
4289 (Delegate.DefineType): Don't call TypeParameter.Resolve() here;
4290 moved that into Define() and also do the other type parameter
4291 checks there. Fixes #79094. Added gtest-292.cs.
4294 (ArrayCreation.EmitDynamicInitializers): Use `etype.IsValueType'
4295 since that doesn't include type parameters; don't use `Ldelema'
4296 for type parameters. Fixes #78980. Added gtest-293.cs.
4298 2006-10-08 Marek Safar <marek.safar@seznam.cz>
4301 * convert.cs (ExplicitReferenceConversion): Only enum to enum value
4302 conversion is allowed.
4304 2006-10-06 Marek Safar <marek.safar@seznam.cz>
4306 * ecore.cs (Expression.MemberLookup): Don't register any symbol for
4307 error reporting when no error occurs.
4309 2006-10-06 Marek Safar <marek.safar@seznam.cz>
4311 * cfold.cs (ConstantFold.BinaryFold): Report an error when the conversion
4314 2006-10-06 Raja R Harinath <rharinath@novell.com>
4317 * class.cs (DefineTypeBuilder): Check circular dependencies before
4318 setting the parent of the TypeBuilder.
4319 (CheckRecursiveDefinition): Don't use 'BaseType', since
4320 it may not be valid until after DefineTypeBuilder. Use
4321 'base_type' instead.
4323 2006-10-04 Martin Baulig <martin@ximian.com>
4325 Merged the Anonymous Methods patch.
4327 * anonymous.cs, iterators.cs: The new anonymous methods code.
4329 * statement.cs (Variable): New public abstract class.
4330 (LocalInfo.Variable): New public property.
4331 (LocalInfo.ResolveVariable): New public method.
4332 (Block.Flags): Add `IsIterator'.
4333 (Block.AddVariable): Improved the CS0136 check.
4334 (Block.AnonymousChildren): New public property.
4335 (Block.AddAnonymousChild): New public method.
4336 (ToplevelBlock): Update to use the new anonymous method framework.
4337 (ToplevelBlock.ctor): `container' is now a `Block' and not a
4338 `ToplevelBlock'; this is required to correctly implement the
4340 (Fixed, Using): Use `TemporaryVariable' instead of directly
4341 creating the `LocalBuilder'.
4343 * parameter.cs (Parameter.ResolveVariable): New public method.
4344 (Parameters.ResolveVariable): Likewise.
4346 * ecore.cs (TemporaryVariable): Use the new `Variable' framework.
4348 * class.cs (TypeContainer): Replaced the `iterators' list and
4349 corresponding methods with a list of `CompilerGeneratedClass'es.
4350 (TypeContainer.ResolveMembers): New public method.
4351 (Method): `IIteratorContainer' has been replaced by
4354 * expression.cs (VariableReference): New public abstract base
4355 class for `LocalVariableReference', `ParameterReference' and
4358 * codegen.cs (EmitContext): Removed `capture_context',
4359 `HaveCaptureInfo', `EmitScopeInitFromBlock()' and `Capture*()'.
4360 (EmitContext.EmitThis): Removed.
4362 * cs-parser.jay: Replace `iterator_container' with
4365 2006-10-04 Martin Baulig <martin@ximian.com>
4367 * generic.cs (GenericMethod): Don't make this abstract.
4368 (Constraints.Clone): Added dummy implementation.
4370 2006-10-04 Raja R Harinath <harinath@gmail.com>
4373 * namespace.cs (LookForAnyGenericType): Avoid nullref on
4374 'declspaces'. Avoid allocating arrays willy-nilly.
4377 * cfold.cs (BinaryFold): Move boolean Equality and Inequality
4378 cases out of the switch.
4380 2006-09-28 Marek Safar <marek.safar@seznam.cz>
4382 * namespace.cs (Namespace.Error_NamespaceDoesNotExist): Better error
4383 message when non-generic type is used with the type arguments.
4384 * expression.cs: Updated.
4386 2006-09-28 Raja R Harinath <rharinath@novell.com>
4389 * convert.cs (Convert.ImplicitStandardConversionExists): Avoid infloop.
4390 * expression.cs (EmptyExpression.Grab, EmptyExpression.Release):
4391 Change semantics slightly. Don't insist on having only one
4392 temporary EmptyExpression -- just throttle the creation of new ones.
4395 * ecore.cs (Expression.MemberLookup): Enable CS0229 errors for
4396 non-interfaces too. If no methods are found, don't try to create
4399 2006-09-28 Marek Safar <marek.safar@seznam.cz>
4401 * ecore.cs (ResolveAsTypeStep): Print better error when type can be
4404 * namespace.cs (Namespace.LookForAnyGenericType): New method to help
4405 us produce better error message.
4407 2006-09-27 Marek Safar <marek.safar@seznam.cz>
4409 * expression.cs (Binary.ResolveOperator): Warn about a side effect
4410 of the `|' operator.
4412 * report.cs: A new warning added.
4414 2006-09-27 Martin Baulig <martin@ximian.com>
4416 * generic.cs (GenericMethod): Don't make this abstract.
4418 2006-09-27 Martin Baulig <martin@ximian.com>
4421 (InternalErrorException): Added overloaded ctor taking a params array.
4423 2006-09-26 Marek Safar <marek.safar@seznam.cz>
4425 * class.cs, codegen.cs, const.cs, cs-tokenizer.cs, driver.cs, ecore.cs:
4426 Fixed the cases when same error was reported twice.
4428 * report.cs (SymbolRelatedToPreviousError): Simplified as all our messages
4429 now report symbol information.
4431 2006-09-25 Martin Baulig <martin@ximian.com>
4433 * class.cs: Completely unified with the gmcs version.
4435 2006-09-25 Martin Baulig <martin@ximian.com>
4437 * typemanager.cs (TypeManager.IsNullableType): New public function.
4438 (TypeManager.IsNullableTypeOf): Likewise.
4439 (TypeManager.IsNullableValueType): Likewise.
4441 * class.cs (MethodCore): Added the `GenericMethod' argument from
4442 gmcs and also unified all classes derived from `MethodCore' with gmcs.
4444 2006-09-24 Raja R Harinath <harinath@gmail.com>
4446 * convert.cs: Unify with gmcs version.
4448 2006-09-24 Marek Safar <marek.safar@seznam.cz>
4450 * decl.cs (DeclSpace.VerifyClsCompliance): When type has type parameters
4451 verify them as well.
4453 * report.cs: New warning.
4455 2006-09-24 Marek Safar <marek.safar@seznam.cz>
4457 * anonymous.cs (AnonymousMethod.Compatible): Cannot generate arguments
4458 for anonymous block with out argument.
4460 2006-09-24 Marek Safar <marek.safar@seznam.cz>
4462 * class.cs (ClassOrStruct.VerifyMembers): Fixed to report correctly
4463 not used private events only.
4465 2006-09-23 Marek Safar <marek.safar@seznam.cz>
4467 * cfold.cs (BinaryFold): On the guest to unify empty constant cast.
4469 * const.cs (Const.Define): Check for constant type.
4470 (Const.IsConstantTypeValid): Looks for valid constant types.
4472 * convert.cs (ImplicitReferenceConversion): NullCast to EmptyConstantCast.
4474 * ecore.cs (EmptyConstantCast): New common class for all constant based
4477 * expression.cs (Is.DoResolve): Handle null constant especially.
4478 (New.DoResolve): Check for new void().
4479 (MemberAccess.DoResolve): Cope with all kind of nulls.
4481 * literal.cs (NullConstant): Uses EmptyConstantCast.
4482 (NullDefault): Based on EmptyConstantCast.
4483 (NullLiteral): Uses EmptyConstantCast.
4485 * statement.cs (Block.ResolveMeta): Check for constant type.
4487 2006-09-22 Martin Baulig <martin@ximian.com>
4489 * delegate.cs, attribute.cs: Merged with the gmcs versions.
4491 2006-09-22 Raja R Harinath <rharinath@novell.com>
4493 * literal.cs (NullDefault): The type of default(IFoo) is 'IFoo',
4497 * typemanager.cs (Closure.Filter): Consider PrivateScope attributes.
4498 * decl.cs (DeclSpace.FindMemberToOverride): Likewise. Reorganize
4501 2006-09-22 Martin Baulig <martin@ximian.com>
4503 * ecore.cs: Merged with the gmcs version.
4505 * generic.cs (ConstructedType): New dummy class.
4506 (TypeArguments): Don't make this abstract.
4509 (TypeManager.IsGenericTypeDefinition): New method.
4510 (TypeManager.GetGenericFieldDefinition): Moved here from gmcs.
4512 2006-09-22 Raja R Harinath <rharinath@novell.com>
4514 * expression.cs (ComposedCast): Check for arrays of TypedReference
4515 before creating the type, not after.
4517 2006-09-21 Marek Safar <marek.safar@seznam.cz>
4519 * cfold.cs, const.cs, enum.cs, statement.cs: Updated
4520 after ToType change.
4522 * constant.cs (Constant.ImplicitConversionRequired): Designed to used
4523 when constant must be implicitly convertible.
4525 * convert.cs (ImplicitReferenceConversion): Reuse ToType.
4527 * ecore.cs (NullCast): Derives from NullConstant.
4529 * expression.cs (Is.DoResolve): Removed useless variables.
4530 (Conditional.DoResolve): Quick hack for `Foo () ? null : null'.
4531 (New.Constantify): Add enum support.
4532 (MemberAccess.DoResolve): Add warning when accessing null constant or
4535 * generic.cs (GenericConstraints.IsReferenceType): Another dummy
4538 * literal.cs (NullConstant): New abstract class with common
4539 functionality for all null specializations.
4540 (NullDefault): Represents default(X) when result can be
4542 (NullLiteral): Updated.
4544 * report.cs: Add new warning.
4546 2006-09-21 Martin Baulig <martin@ximian.com>
4548 * generic.cs (GenericTypeParameterBuilder): Removed this ugly hack.
4550 2006-09-21 Martin Baulig <martin@ximian.com>
4552 * generic.cs (GenericConstraints): New dummy class.
4553 (Constraints): Likewise.
4554 (TypeParameter): Likewise.
4555 (TypeParameterName): Likewise.
4556 (GenericMethod): Likewise.
4558 * typemanager.cs (TypeManager.GetGenericArguments): New method.
4560 * decl.cs: Merged with the gmcs version.
4562 2006-09-21 Raja R Harinath <rharinath@novell.com>
4564 * generic.cs (TypeParameter): Implement IMemberContainer.
4565 (GenericTypeParameterBuilder): New. An abominable repugnant hack.
4567 * rootcontext.cs: Unify with gmcs version.
4569 * report.cs: Unify with gmcs version.
4570 * typemanager.cs (AddTypeParameter, LookupTypeParameter): Move
4571 from gmcs/generics.cs.
4572 * generics.cs (TypeParameter): New dummy class.
4574 * support.cs: Unify with gmcs version.
4576 2006-09-20 Raja R Harinath <rharinath@novell.com>
4578 * ecore.cs (MethodGroupExpr.ResolveGeneric): New dummy method.
4579 * expression.cs (MemberAccess, BaseAccess): Remove GMCS_SOURCE #ifdef.
4581 * decl.cs (MemberName): Unify with gmcs, except for GetTypeExpression.
4582 * generic.cs (TypeArguments): New dummy class to help avoid #ifdefs.
4583 * mcs.exe.sources: Add generic.cs.
4585 * codegen.cs: Unify with gmcs version.
4587 * codegen.cs (IResolveContent.GenericDeclContainer): Copy from gmcs.
4588 (EmitContext): Add GenericDeclContainer implementation.
4589 * decl.cs (MemberCore, DeclSpace): Likewise.
4590 * namespace.cs: Remove #ifdef GMCS_SOURCE.
4592 * namespace.cs (GetTypeInAssembly): Remove #ifdef GMCS_SOURCE.
4593 MCS TypeManager has a corresponding dummy method.
4595 2006-09-19 Martin Baulig <martin@ximian.com>
4597 * expression.cs: Completely merged with the gmcs version.
4599 2006-09-19 Martin Baulig <martin@ximian.com>
4601 * expression.cs (Invocation): Merged with the gmcs version.
4602 (ArrayAccess.GetStoreOpcode): Likewise.
4604 2006-09-19 Martin Baulig <martin@ximian.com>
4607 (TypeManager.IsGenericMethod): Moved here from ../gmcs/generic.cs.
4608 (TypeManager.IsGenericMethodDefinition): Likewise.
4610 2006-09-19 Martin Baulig <martin@ximian.com>
4613 (TypeManager.IsEqual): Moved the gmcs implementation here.
4614 (TypeManager.DropGenericTypeArguments): Likewise.
4615 (TypeManager.DropGenericMethodArguments): Likewise.
4616 (TypeManager.GetTypeArguments): Moved here from gmcs.
4617 (TypeManager.HasGenericArguments): Likewise.
4619 2006-09-19 Martin Baulig <martin@ximian.com>
4621 * expression.cs (Binary): Merged with the gmcs version.
4623 2006-09-19 Martin Baulig <martin@ximian.com>
4625 * expression.cs (Probe, As, Is): Merged with the gmcs version.
4627 2006-09-19 Martin Baulig <martin@ximian.com>
4629 * typemanager.cs: Merged with the gmcs version.
4631 2006-09-16 Raja R Harinath <rharinath@novell.com>
4633 * AssemblyInfo.cs [GMCS_SOURCE]: Unify with gmcs source.
4634 * driver.cs: Likewise.
4636 2006-09-16 Marek Safar <marek.safar@seznam.cz>
4639 * class.cs (MethodCore.VerifyClsCompliance): Do check for abstract members
4640 only if parent type is class.
4641 * decl.cs (MemberCore.GetClsCompliantAttributeValue): Fixed missing cache
4644 2006-09-15 Marek Safar <marek.safar@seznam.cz>
4647 * expression.cs(MemberAccess.DoResolve): Don't crash when not allowed
4649 * typemanager.cs(CSharpName): Converts NullType to null.
4651 2006-09-15 Martin Baulig <martin@ximian.com>
4654 (TypeManager.GetMethodName): Added mcs implementation.
4655 (TypeManager.IsEqual): Likewise.
4658 (SimpleName.RemoveGenericArity): Added dummy implementation.
4660 * pending.cs: Merged with the gmcs version.
4662 2006-09-15 Martin Baulig <martin@ximian.com>
4664 * statement.cs: Merge with the gmcs version.
4666 2006-09-15 Martin Baulig <martin@ximian.com>
4668 * statement.cs (Switch): Merge with the gmcs implementation
4669 (without nullables), which is newer.
4671 2006-09-15 Martin Baulig <martin@ximian.com>
4673 * statement.cs (Block.Variables): Make this public.
4674 (ToplevelBlock.Parameters): Make this a property.
4675 (Throw.Resolve): Use `TypeManager.IsSubclassOf ()'.
4677 2006-09-15 Martin Baulig <martin@ximian.com>
4679 * namespace.cs: Merge with the gmcs version.
4681 2006-09-15 Martin Baulig <martin@ximian.com>
4683 * decl.cs (MemberName): Minor code cleanups.
4685 2006-09-15 Martin Baulig <martin@ximian.com>
4687 * parameter.cs: Merge with the gmcs version.
4689 2006-09-15 Martin Baulig <martin@ximian.com>
4691 * enum.cs: Merge with the gmcs version: 3005 is a warning in gmcs
4692 and an error in mcs.
4694 2006-09-15 Martin Baulig <martin@ximian.com>
4696 * flowanalysis.cs: Merged from GMCS; added the generics code into
4697 a `GMCS_SOURCE' conditional so we can share this file.
4699 2006-09-08 Martin Baulig <martin@ximian.com>
4701 * typemanager.cs (TypeManager.interlocked_type): New public field.
4702 (TypeManager.int_interlocked_compare-exchange): New public field.
4703 (TypeManager.InitEnumUnderlyingTypes): Also initialize the
4704 enumerator types here and call InitGenericCoreTypes().
4705 (TypeManager.InitCoreTypes): Call InitEnumeratorTypes() right
4706 after calling InitEnumUnderlyingTypes().
4709 (RootContext.ResolveCore): Added `System.Threading.Interlocked' to
4710 `classes_second_stage'.
4712 2006-09-14 Marek Safar <marek.safar@seznam.cz>
4714 * assign.cs, ecore.cs, expression.cs: Share error message text.
4715 * class.cs (FieldMember.Define): Check for varible of static type.
4716 * driver.cs (LoadAssembly): Uses error output for errors.
4717 * statement.cs: Updated.
4719 2006-09-08 Marek Safar <marek.safar@seznam.cz>
4721 * expression.cs (Error_OperatorCannotBeApplied): Report type instead of
4724 2006-09-07 Martin Baulig <martin@ximian.com>
4727 (MainDriver): Revert r62663 from Marek; see #70506 for details.
4729 2006-08-29 Miguel de Icaza <miguel@novell.com>
4731 * cs-parser.jay: Turn 1522 into a warning, instead of an error #79210
4733 2006-08-17 Miguel de Icaza <miguel@novell.com>
4735 * cs-tokenizer.cs: Apply patch from Atsushi Enomoto that fixes
4736 #52019 and #79064, the use of the \uXXXX sequence in source code
4737 to represent unicode characters.
4739 2006-08-15 Marek Safar <marek.safar@seznam.cz>
4741 * expression.cs (SizeOf.DoResolve): Check for void type. Fixed enum types
4743 * class.cs, ecore.cs, statement.cs: Merged to one error message.
4745 2006-08-13 Miguel de Icaza <miguel@novell.com>
4747 * assign.cs: Catch attempts to assign to a method groups in += and
4750 2006-08-13 Marek Safar <marek.safar@seznam.cz>
4753 * cs-parser.jay: Don't destroy current array type by typeof of array's.
4755 2006-08-12 Marek Safar <marek.safar@seznam.cz>
4757 * class.cs (Method.Define): Issue a warning when generic method looks like
4759 * decl.cs (MemberCore.GetSignatureForError): Print member type arguments
4762 2006-08-09 Marek Safar <marek.safar@seznam.cz>
4764 * anonymous.cs(AnonymousDelegate.Emit): Uses Constructor filter when
4766 * decl.cs (MemberCache.FindMembers): When container is interface we need to
4767 search all base interfaces as a member can be ambiguous.
4768 * delegate.cs (Delegate.FindMembers): Fixed to return valid data for
4769 Constructor member type filter.
4770 (Delegate.ResolveConstructorMethod) Uses Constructor filter.
4771 * ecore.cs: (Expression.MemberLookup): Implemented ambiguity error/warning
4772 reporting for returned memberinfos.
4773 * report.cs: Updated.
4774 * typemanager.cs (TypeManager.LookupBaseInterfacesCache): Uses TypeManager
4775 version to work on all runtimes.
4776 (TypeManager.RealMemberLookup): Removed members filtering.
4778 2006-08-08 Raja R Harinath <rharinath@novell.com>
4780 * ecore.cs (FieldExpr.EmitAssign): Release temporary.
4781 (PropertyExpr.EmitAssign): Likewise.
4782 * expression.cs (Indirection.EmitAssign): Likewise.
4783 (LocalVariableReference.EmitAssign): Likewise.
4784 (ParameterReference.EmitAssign): Likewise.
4785 (Invocation.EmitArguments): Likewise.
4786 (ArrayAccess.EmitAssign): Likewise.
4787 (IndexerAccess.EmitAssign): Likewise.
4788 (This.EmitAssign): Likewise.
4789 (ConditionalLogicalOperator.Emit): Likewise.
4792 * codegen.cs (EmitContext.GetTemporaryLocal): Simplify. Use Stack
4793 instead of ArrayList. If the hashtable has a LocalBuilder, don't
4794 leave it in after returning it.
4795 (EmitContext.FreeTemporaryLocal): Simplify. Update to changes.
4797 2006-08-06 Marek Safar <marek.safar@seznam.cz>
4799 * expresssion.cs (IndexerAccess.DoResolve): Fixed to report correct error
4802 2006-08-03 Raja R Harinath <rharinath@novell.com>
4804 Fix cs0146-3.cs and cs0146-4.cs.
4805 * class.cs (TypeManager.CheckRecursiveDefinition): Check that
4806 enclosing types don't depend on the current type.
4808 2006-08-02 Raja R Harinath <rharinath@novell.com>
4811 * class.cs (TypeContainer.DoDefineMembers): Use
4812 FindBaseMemberWithSameName on Parent, since we're interested in
4813 whether we hide inherited members or not.
4814 (FindBaseMemberWithSameName): Make slightly more robust.
4816 Fix the non-generic testcase from #77396
4817 * decl.cs (DeclSpace.DeclContainer): Remove override.
4819 * namespace.cs (NamespaceEntry.Doppelganger): Create slave
4820 declspaces for doppelgangers too.
4821 (UsingEntry): Implement IResolveContext.
4822 (UsingEntry.Resolve): Don't set ToplevelTypes.Namespace. Use
4823 'this' as the resolve context.
4824 (LocalAliasEntry): Likewise.
4826 Implement parts of #77403
4827 * roottypes.cs (RootDeclSpace): New. Used to represent the
4828 toplevel declaration space. Each namespace declaration introduces
4829 a "partial" root declaretion space.
4830 * namespace.cs (NamespaceEntry.SlaveDeclSpace): New.
4831 (NamespaceEntry.ctor): Create a SlaveDeclSpace if necessary.
4832 * cs-parser.jay (CSharpParser.ctor): Initialize 'current_class'
4833 from 'current_namespace.SlaveDeclSpace'.
4834 (namespace_declaration): Likewise.
4835 * class.cs (TypeContainer.ctor): Remove parent==ToplevelTypes
4836 check. It can't happen now.
4837 * decl.cs (DeclSpace.LookupType): Likewise.
4838 * driver.cs (MainDriver): Sanity check.
4840 2006-08-01 Raja R Harinath <rharinath@novell.com>
4842 * decl.cs (DeclSpace.FindNestedType): Remove.
4843 (DeclSpace.LookupNestedTypeINHierarchy): Use PartialContainer and
4844 LookupTypeContainer to get the container of the nested type.
4845 * class.cs (TypeContainer.FindNestedType): Make non-override.
4847 2006-07-31 Raja R Harinath <rharinath@novell.com>
4849 * decl.cs (DeclSpace.PartialContainer): Move field from ...
4850 * class.cs (TypeContainer.PartialContainer): ... here.
4851 (TypeContainer.AddBasesForPart): New helper.
4852 (MemberBase.ParentContainer): Remove. Use Parent.PartialContainer
4854 * cs-parser.jay (current_class): Convert to DeclSpace.
4855 (struct_declaration, interface_declaration, class_declaration):
4856 Use AddBasesForPart instead of .Bases directly.
4857 * const.cs, iterators.cs: Update to changes.
4859 2006-07-28 Raja R Harinath <rharinath@novell.com>
4861 * class.cs (TypeContainer.AddMemberType): Rename from
4863 (TypeContainer.AddMember): Rename from AddToMemberContainer.
4864 (AddTypeContainer): New. Combine AddClassOrStruct and
4866 (AddPartial): Update. Add 'is_partial' argument.
4867 * roottypes.cs: Update to changes.
4868 * cs-parser.jay (push_current_class): New helper for handling
4869 current_container and current_class.
4870 (struct_declaration, interface_declaration, class_declaration):
4873 2006-07-26 Raja R Harinath <rharinath@novell.com>
4875 * roottypes.cs: Rename from tree.cs.
4877 Rename RootContext.Tree.Types to RootContext.ToplevelTypes.
4878 * tree.cs (Tree, ITreeDump): Remove types.
4879 * rootcontext.cs (tree, Tree): Remove fields.
4880 (root, ToplevelTypes): New.
4881 * *.cs: Update to rename.
4883 * tree.cs (Tree.RecordDecl): Remove.
4884 (RootTypes.AddToTypeContainer): Record the toplevel type in its
4886 * class.cs, cs-parser.jay: Remove mention of RecordDecl.
4888 2006-07-23 Raja R Harinath <harinath@gmail.com>
4890 * codegen.cs (EmitContext.Flags): Move InCatch, InFinally,
4891 DoFlowAnalysis and OmitStructFlowAnalysis here.
4892 (ec.With): Rename from WithUnsafe and generalize.
4893 (ec.WithCheckState): Remove. All users can be handled by 'With'.
4894 (ec.WithFlowAnalyis): New.
4895 * ecore.cs, expression.cs, statement.cs: Update.
4897 2006-07-22 Raja R Harinath <harinath@gmail.com>
4899 * statement.cs (Block.ResolveMeta): Simplify slightly.
4901 * codegen.cs (EmitContext.Flags): New enum. Used to represent the
4902 multiple boolean fields. Convert InUnsafe, constant_check_state,
4903 check_state to flags.
4904 (CheckState, ConstantCheckState): Update.
4905 (InUnsafe): New read-only property.
4906 (FlagsHandle): Rename from CheckStateHandle and convert to handle
4908 (WithUnsafe): New helper similar to WithCheckState.
4909 * statement.cs (Block.ResolveMeta): Use WithUnsafe.
4910 (Unsafe.Resolve, Unsafe.DoEmit): Likewise.
4912 2006-07-21 Raja R Harinath <rharinath@novell.com>
4914 Make comparisons use the same IL irrespective of whether they're
4915 in a 'checked' or 'unchecked' context: one of the issues in #78899
4916 * codegen.cs (EmitContext.CheckState): Make read-only property.
4917 (EmitContext.ConstantCheckState): Likewise.
4918 (EmitContext.CheckStateHandle, EmitContext.WithCheckState): New
4919 helper that implement a save/restore stack for CheckState
4920 values. This is the only way to change check-state.
4921 * ecore.cs (Expression.ExpressionToArrayArgument): Use WithCheckState.
4922 * expression.cs (CheckedExpr.DoResolve, CheckedExpr.Emit): Likewise.
4923 (CheckedExpr.EmitBranchable): New forwarding method.
4924 (UnCheckedExpr): Likewise.
4925 * statement.cs (Block.ResolveMeta): Use WithCheckState.
4926 (Unchecked.Resolve, Unchecked.DoEmit): Likewise.
4927 (Checked.Resolve, checked.DoEmit): Likewise.
4929 2006-07-20 Miguel de Icaza <miguel@novell.com>
4931 * anonymous.cs: Cache the resolved anonymous delegate, and return
4932 this so that the ResolveTopBlock is only triggered once, not
4935 Currently we trigger ResolvetopBlock twice due to a first pass of
4936 argument check compatibility, and a second pass that does the
4939 2006-07-15 Marek Safar <marek.safar@seznam.cz>
4941 * annonymous.cs (AnonymousMethod.CreateScopeType): Fixed nested type
4943 * rootcontext.cs (Reset): Add helper_classes.
4945 2006-07-15 Marek Safar <marek.safar@seznam.cz>
4948 * statement.cs (Switch.SimpleSwitchEmit): Handle case null at any position
4951 2006-07-13 Miguel de Icaza <miguel@novell.com>
4953 * statement.cs (Lock): Handle expressions of type
4954 TypeManager.null_type specially. Fixes #78770
4956 2006-07-08 Marek Safar <marek.safar@seznam.cz>
4958 * expression.cs (Binary.ResolveOperator): Don't crash when null is assigned
4961 2006-07-08 Marek Safar <marek.safar@seznam.cz>
4963 * attribute.cs (AttributeTester.GetMethodObsoleteAttribute): Fixed to look
4964 for accessors as well.
4965 * ecore.cs (EventExpr): Add AccessorTable.
4967 2006-07-01 Marek Safar <marek.safar@seznam.cz>
4970 * attribute.cs, class.cs, ecore.cs : Add missing location of related symbol
4971 for CS0122 where appropriate.
4972 * typemanager.cs (IsNestedChildOf): Type can be null in the case of top
4974 (Filter): Assembly can be null in the case of top level attributes.
4976 2006-06-25 Marek Safar <marek.safar@seznam.cz>
4980 * ecore.cs (Expression.MemberLookupFailed): Don't crash when failed lookup
4981 is done at global level.
4983 2006-06-24 Marek Safar <marek.safar@seznam.cz>
4985 A fix for #77002, Implemented TypeForwarder support.
4987 * attribute.cs (Attribute.GetArgumentType): Reads type argument.
4988 * expression.cs (TypeOf.TypeArgument): Exposes typeof type.
4989 * typemanager.cs (): Add type_forwarder_attr_type.
4991 2006-06-24 Marek Safar <marek.safar@seznam.cz>
4993 * report.cs: Add CS0469 warning.
4995 2006-06-21 Martin Baulig <martin@ximian.com>
4997 * codegen.cs (CodeGen.Save): Moved the symbol file generation into
4998 the `try'-block, so we also report CS0016 etc. there.
5000 2006-06-21 Martin Baulig <martin@ximian.com>
5003 (Delegate.VerifyMethod): Allow `params' methods; fixes #78678.
5005 2006-06-21 Martin Baulig <martin@ximian.com>
5007 * expression.cs (Unary.ResolveOperator): In `Operator.AddressOf',
5008 also report CS1686 for parameters.
5010 2006-06-21 Martin Baulig <martin@ximian.com>
5012 * statement.cs (GotoCase.Resolve): Report a warning (CS0469)
5013 instead of an error if the value is not implicitly convertible to
5014 the switch types; fixes #77964.
5016 2006-06-21 Raja R Harinath <rharinath@novell.com>
5019 * class.cs (FieldBase.ResolveInitializer): Stop resolution if
5020 FieldBuilder is null.
5023 * expression.cs (Binary.CheckShiftArguments): Don't overwrite original
5024 'left' and 'right' before error-checking.
5026 2006-06-16 Juraj Skripsky <js@hotfeet.ch>
5028 * ecore.cs (SimpleName.Error_ObjectRefRequired): Do not truncate the name.
5030 (MemberExpr.EmitInstance): Use GetSignatureForError () to get full name.
5031 (FieldExpr.DoResolve): likewise.
5032 (PropertyExpr.InstanceResolve): likewise.
5033 (EventExpr.InstanceResolve): likewise.
5035 2006-06-04 Marek Safar <marek.safar@seznam.cz>
5037 * parameter.cs (Parameter.ApplyAttributeBuilder): More DefaultValue
5038 attribute applicable tests for attribute argument.
5040 2006-06-02 Raja R Harinath <rharinath@novell.com>
5043 * expression.cs (Binary.DoNumericPromotions): Remove and rewrite.
5044 (Binary.OverloadResolve_PredefinedIntegral): New.
5045 (Binary.OverloadResolve_PredefinedFloating): New.
5046 (Binary.OverloadResolve_PredefinedString): New.
5047 (Binary.ResolveOperator): Use those instead of DoNumericPromotions.
5048 Follow the standard more closely, and treat numeric promotions in
5049 terms of overload resolution.
5050 (Binary.CheckShiftArguments): Simplify.
5052 2006-06-01 Raja R Harinath <rharinath@novell.com>
5054 * flowanalysis.cs (MyBitVector): Simplify representation.
5055 (MyBitVector.Clone): Avoid allocating BitArray.
5056 (MyBitVector.operator&): Rename from MyBitVector.And and make symmetric.
5057 (MyBitVector.operator|): Likewise, with MyBitVector.Or.
5058 (*): Update. Change all references to MyBitVector.And and
5059 MyBitVector.Or to &= and |=.
5061 2006-05-29 Raja R Harinath <rharinath@novell.com>
5064 * cs-parser.jay (formal_parameter_list): Extend the pattern below
5065 to param arguments too.
5067 2006-05-26 Miguel de Icaza <miguel@novell.com>
5069 * cs-parser.jay: Catch another parsing form for arglist being
5070 followed by other arguments. Fixes #78313.
5072 2006-05-24 Raja R Harinath <rharinath@novell.com>
5074 * flowanalysis.cs (FlowBranchingToplevel.AddReturnOrigin): Move
5075 checking of out parameters to ...
5076 (FlowBranchingToplevel.Merge): ... here.
5077 (FlowBranchingException.AddBreakOrigin): If 'finally_vector' is
5078 set, propagate the origin upward, and only complain if there was
5080 (FlowBranchingException.AddContinueOrigin): Likewise.
5081 (FlowBranchingException.AddReturnOrigin): Likewise.
5082 (FlowBranchingException.AddGotoOrigin): Likewise.
5084 2006-05-23 Raja R Harinath <rharinath@novell.com>
5086 * flowanalysis.cs (UsageVector.MergeOrigins): If an origin is
5087 unreachable, skip it.
5088 (FlowBranchingException.Merge): Always propagate jumps, even if
5089 the finally block renders subsequent code unreachable.
5091 2006-05-18 Raja R Harinath <rharinath@novell.com>
5094 * statement.cs (Goto.Resolve): Move responsibility for resolving
5095 'goto' to FlowBranching.AddGotoOrigin.
5096 (Goto.SetResolvedTarget): New. Callback to set the
5097 LabeledStatement that's the target of the goto.
5098 (Goto.DoEmit): Use Leave instead of Br when crossing an
5099 unwind-protect boundary.
5100 * flowanalysis.cs (FlowBranching.AddGotoOrigin): Rename from
5101 LookupLabel and adjust to new semantics.
5102 (FlowBranchingToplevel.AddGotoOrigin): Likewise.
5103 (FlowBranchingBlock.AddGotoOrigin): Likewise. Use
5104 Goto.SetResolvedTarget to update target.
5105 (FlowBranchingLabeled.AddGotoOrigin): Likewise.
5106 (FlowBranchingException.AddGotoOrigin): Rewrite to be similar to
5107 AddBreakOrigin & co. Delay propagation until ...
5108 (FlowBranchingException.Merge): ... this.
5110 * statement.cs (Block.Resolve): Always depend on flow-branching to
5111 determine unreachability. Kill workaround that originally emitted
5112 only one statement after an "unreachable" label (see infloop in
5115 Fix #77869, #76148, #77755, #75255 and a host of other bugs.
5116 This is still "wrong", but anything better would probably need a
5117 multi-pass algorithm.
5118 * flowanalysis.cs (FlowBranchingLabeled): Salt away a copy of the
5119 usage vector. Force current usage vector to be reachable, to
5120 optimistically signify backward jumps.
5121 (FlowBranchingLabeled.LookupLabel): Note if a backward jump is
5123 (FlowBranchingLabeled.Merge): New. If no backward jump was
5124 detected, return the original salted-away usage vector instead,
5125 updated with appropriate changes. Print unreachable warning if
5127 * statement.cs (Block.Resolve): Don't print unreachable warning on
5128 a labeled statement.
5130 2006-05-17 Gert Driesen <drieseng@users.sourceforge.net>
5132 * driver.cs: Pass filename without path to AssemblyBuilder's
5133 AddResourceFile. Fixes bug #78407.
5135 2006-05-17 Raja R Harinath <rharinath@novell.com>
5137 * statement.cs (LabeledStatement.Resolve): Move merging of origins ...
5138 * flowanalysis.cs (FlowBranchingLabeled): ... here.
5139 (FlowBranching.MergeChild): Overwrite
5140 reachability information from Labeled branchings too.
5142 2006-05-16 Raja R Harinath <rharinath@novell.com>
5144 * statement.cs (Goto.Resolve): Merge jump origins here ...
5145 * flowanalysis.cs (FlowBranching.Label): ... rather than here.
5147 * flowanalysis.cs (FlowBranching.LookupLabel): Move CS0159 check ...
5148 (FlowBranchingToplevel.LookupLabel): ... here. Add CS1632 check.
5149 (FlowBranchingGoto.LookupLabel): New. Handle back jumps.
5150 (FlowBranchingBlock.LookupLabel): Call LabeledStatement.AddReference
5152 * statement.cs (Goto.Resolve): ... not here.
5153 (Goto.Emit): Remove CS1632 check.
5155 2006-05-14 Marek Safar <marek.safar@seznam.cz>
5157 * ecore.cs (Expression.ResolveAsTypeTerminal): Fixed type in the obsolete
5160 2006-05-11 Raja R Harinath <rharinath@novell.com>
5162 * flowanalysis.cs (UsageVector.MergeJumpOrigins): Kill.
5163 (FlowBranchingBlock.Label): Use UsageVector.MergeOrigins.
5164 (FlowBranchingException.Label): Likewise.
5166 * flowanalysis.cs (MyBitVector.SetAll): New. Sets all bits to the
5168 (MyBitVector.Or): Use it to avoid losing information (Count).
5169 (FlowBranching.MergeOrigins): Likewise.
5171 * flowanalysis.cs (UsageVector.IsDirty): Remove.
5172 (UsageVector.Parameters, UsageVector.ParameterVector): Likewise.
5173 (UsageVector.Locals, UsageVector.LocalVector): Likewise.
5174 (UsageVector.ToString): Simplify.
5175 (UsageVector.MergeSiblings): Move here from ...
5176 (FlowBranching.Merge): ... here.
5177 (FlowBranchingToplevel.CheckOutParameters): Take an UsageVector,
5180 2006-05-10 Raja R Harinath <rharinath@novell.com>
5182 * flowanalysis.cs (UsageVector.MergeOrigins): Simplify, now that a
5183 null bitvector is treated as all-true.
5185 * flowanalysis.cs (MyBitVector.And, MyBitVector.Or): Make lazier.
5186 (MyBitVector): Rationalize invariants. 'vector != null' implies
5187 that we have our own copy of the bitvector. Otherwise,
5188 'InheritsFrom == null' implies all inherited bits are true.
5190 2006-05-09 Marek Safar <marek.safar@seznam.cz>
5192 * statement.cs (LocalInfo): Add IsConstant.
5193 (LocalInfo.DeclareLocal): Moved from EmitMeta and changed to don't emit
5194 local variable for constants.
5196 2006-05-09 Raja R Harinath <rharinath@novell.com>
5198 * flowanalysis.cs (MyBitVector.Empty): New.
5199 (MyBitVector): Don't allow InheritedFrom to be null.
5200 (MyBitVector.And, MyBitVector.Or): Treat 'null' as all-ones.
5201 (UsageVector, FlowBranching): Update to changes.
5203 * flowanalysis.cs (FlowBranching.InTryWithCatch): Don't terminate
5204 recursion. The 'Parent == null' condition isn't sufficient for
5206 (FlowBranching.AddBreakOrigin): Likewise.
5207 (FlowBranching.AddContinueOrigin): Likewise.
5208 (FlowBranching.AddReturnOrigin): Likewise.
5209 (FlowBranching.StealFinallyClauses): Likewise.
5210 (FlowBranching.MergeTopBlock): Move to FlowBranchingToplevel.
5211 (FlowBranching.CheckOutParameters): Likewise.
5212 (FlowBranchingToplevel): Terminate all the above recursions here.
5213 (FlowBranchingToplevel.End): Rename from MergeTopBlock.
5214 * codegen.cs (EmitContext.ResolveTopBlock): Update to changes.
5216 * flowanalysis.cs (BranchingType.Toplevel): New. Represents a
5218 (FlowBranchingToplevel): New. Empty for now.
5219 (FlowBranching.MergeTopBlock): Update.
5220 * codegen.cs (EmitContext.ResolveTopBlock): Create a Toplevel
5221 branching for the anonymous delegate.
5222 (EmitContext.StartFlowBranching): Add ToplevelBlock variant.
5224 * flowanalysis.cs (UsageVector.MergeOrigins): Reorganize.
5225 (UsageVector.MergeJumpOrigins): Don't ignore current reachability
5226 information at the start of the merge. Reorganize.
5228 2006-05-07 Marek Safar <marek.safar@seznam.cz>
5230 * class.cs (MethodData.Define): Method cannot implement interface accessor.
5232 2006-05-07 Marek Safar <marek.safar@seznam.cz>
5234 * expression.cs (QualifiedAliasMember.ResolveAsTypeStep): Pass location
5235 to newly introduced ctor.
5237 * namespace.cs (Namespace.Error_NamespaceDoesNotExist): Moved an error
5238 message to one place.
5239 (GlobalRootNamespace.Error_NamespaceDoesNotExist): Custom message for
5242 2006-05-07 Marek Safar <marek.safar@seznam.cz>
5244 * const.cs (Const.Error_ExpressionMustBeConstant): Better error message.
5246 * ecore.cs (Expression.ResolveAsConstant): Updated.
5248 * statement.cs (ResolveMeta): Updated.
5250 2006-05-06 Marek Safar <marek.safar@seznam.cz>
5252 * cs-parser.jay: __arglist cannot be used in initializer.
5254 2006-05-06 Marek Safar <marek.safar@seznam.cz>
5257 * namespace.cs (LocalAliasEntry.DoResolve): Don't allow to access nested
5260 2006-05-05 Raja R Harinath <rharinath@novell.com>
5262 * statement.cs (EmptyStatement.ResolveUnreachable): Override.
5263 (LabeledStatement): Add 'name' parameter.
5264 (LabeledStatement.Name, LabeledStatement.JumpOrigins): New.
5265 (Block.AddLabel): Update to changes.
5266 * cs-parser.jay (labeled_statement): Likewise.
5268 * flowanalysis.cs (BranchingType.Labeled): New.
5269 (UsageVector.MergeOrigins): Remove unused 'branching' argument.
5270 (FlowBranchingLabeled): New. Does nothing for now, but will
5271 eventually handle 'goto' flows.
5272 * codegen.cs (StartFlowBranching): Add new LabeledStatement variant.
5273 * statement.cs (LabeledStatement.Resolve): Create a FlowBranching
5274 that's terminated ...
5275 (Block.Resolve): ... here.
5277 * flowanalysis.cs (UsageVector.MergeFinally): Remove.
5278 (UsageVector.MergeFinallyOrigins): Likewise.
5279 (FlowBranching.InTryOrCatch): Likewise.
5280 (FlowBranching.AddFinallyVector): Likewise.
5281 (FlowBranchingException): Update to changes.
5284 * statement.cs (Return.Resolve): Move error checking to ...
5285 * flowbranching.cs (FlowBranching.AddReturnOrigin): ... this.
5286 (FlowBranchingException): Handle return origins like break and
5288 (FlowBranching.UsageVector.CheckOutParameters): Remove.
5290 2006-05-04 Marek Safar <marek.safar@seznam.cz>
5293 * class.cs (TypeContainer.FindMembers): Includes event method in the methods
5296 2006-05-04 Marek Safar <marek.safar@seznam.cz>
5299 * class.cs (MethodData.Define): Do public accessor check only when method
5300 implements an interface.
5302 2006-05-04 Raja R Harinath <rharinath@novell.com>
5304 Remove special handling of 'break'
5305 * flowanalysis.cs (Reachability): Remove all mention of 'breaks'.
5306 (Reachability.Meet): Simplify. Remove 'do_breaks' argument.
5307 (UsageVector.Break): Remove.
5308 (FlowBranching.Merge): Use 'Reachable.IsUnreachable' to determine
5310 (FlowBranchingBreakable.Merge): Don't ResetBreaks.
5312 * statement.cs (Break.Resolve): Call UsageVector.Goto (), not
5313 UsageVector.Breaks (). Don't set NeedsReturnLabel.
5315 2006-05-03 Marek Safar <marek.safar@seznam.cz>
5318 * pending.cs (PendingImplementation.BaseImplements): A found member cannot
5319 be the interface member.
5321 2006-05-03 Marek Safar <marek.safar@seznam.cz>
5324 * constant.cs (LongConstant.EmitLong): Fixed to catch also negative values
5325 for emitting small (int) values.
5327 2006-05-03 Raja R Harinath <rharinath@novell.com>
5330 * flowanalysis.cs (FlowBranchingException.Merge): Ensure
5331 control-flow passes through the 'finally' after merging-in all the
5332 control-flows from 'try' and the 'catch' clauses.
5334 * flowanalysis.cs (FlowBranching.IsLoop): Remove.
5335 (FlowBranching.IsTryOrCatch): Remove 'is_return' parameter. It's
5336 always true at the only non-recursive entry point.
5337 (FlowBranching.CreateBranching) [BranchingType.Loop]: Return a
5338 FlowBranchingBreakable.
5339 (FlowBranchingLoop): Remove.
5340 * statement.cs (Return.DoResolve): Update to changes.
5343 * flowanalysis.cs (FlowBranching.BranchingType.Embedded): New.
5344 (FlowBranching.CreateBranching): Handle it: create a
5345 FlowBranchingContinuable.
5346 (FlowBranching.BreakCrossesExceptionBoundary): Remove.
5347 (FlowBranching.AddContinueOrigin): Similar to AddBreakOrigin,
5348 except that it handles the 'continue' command.
5349 (FlowBranching.UsageVector.MergeOrigins): Rename from
5351 (FlowBranchingContinuable): Similar to FlowBranchingBreakable,
5352 except that it overrides AddContinueOrigin.
5353 (FlowBranchingException): Override AddContinueOrigin, similar to
5355 * statement.cs (While.Resolve, Foreach.ArrayForeach.Resolve):
5356 Create a new branching around the embedded statement.
5357 (Do.Resolve, For.Resolve): Likewise. Do reachability analysis for
5358 control flow after the embedded statement.
5359 (Continue.Resolve): Move all error checking to AddContinueOrigin.
5361 * flowanalysis.cs (FlowBranching.IsSwitch): Remove.
5362 (FlowBranching.CreateBranching) [BranchingType.Switch]: Create a
5363 FlowBranchingBreakable.
5364 (FlowBranchingSwitch): Remove.
5367 * statement.cs (Break.Resolve): Simplify. Move responsibility for
5368 error reporting to ...
5369 * flowanalysis.cs (FlowBranching.AddBreakOrigin) ... this.
5370 Rename from 'AddBreakVector'. Add new location argument. Return
5371 a bool indicating whether the 'break' crosses an unwind-protect.
5372 (FlowBranchingException.AddBreakOrigin): Add.
5373 (FlowBranchingException.Merge): Propagate 'break's to surrounding
5374 flowbranching after updating with the effects of the 'finally'
5376 (FlowBranchingBreakable): New common base class for
5377 FlowBranchingLoop and FlowBranchingSwitch.
5379 * statement.cs (Foreach.ArrayForeach.Resolve): Set barrier after
5381 (Foreach.CollectionForeach.Resolve): Remove extraneous flowbranching.
5383 2006-05-02 Raja R Harinath <rharinath@novell.com>
5385 * statement.cs (Do.Resolve): If the loop is infinite, set the
5387 (While.Resolve, For.Resolve): Set a barrier after the embedded
5388 statement. There's no direct control flow that goes from the end
5389 of the embedded statement to the end of the loop.
5390 * flowanalysis.cs (FlowBranching.Infinite): Remove.
5391 (FlowBranchingLoop.Merge): Don't look at 'Infinite'. The changes
5392 above ensure that the reachability is correctly computed.
5394 * flowanalysis.cs (Reachability.ResetBarrier): Remove.
5395 (UsageVector.MergeBreakOrigins): If the current path is
5396 unreachable, treat it as if all parameters/locals are initialized.
5397 (FlowBranchingLoop.Merge): Don't clear any barriers. Handle
5398 infinite loops before merging-in break origins.
5400 * flowanalysis.cs (Reachability.Meet): Simplify code handling 'returns'.
5401 (Reachability.Reachable): Split part into ...
5402 (Reachability.Unreachable): ... this. Simplify.
5403 (Reachability.IsUnreachable): Use 'Unreachable' instead.
5405 * flowanalysis.cs (Reachability.SetReturnsSometimes): Remove.
5406 (Reachability.SetThrowsSometimes): Likewise.
5407 (FlowBranchingBlock.MergeTopBlock): Don't compare against
5408 TriState.Always, use corresponding property.
5409 * statement.cs (Lock.Resolve, Try.Resolve, Using.Resolve): Likewise.
5410 (Block.Resolve): Likewise. Remove some redundant checks.
5412 2006-05-02 Raja R Harinath <harinath@gmail.com>
5414 * flowanalysis.cs (UsageVector.Throw): Set barrier too.
5415 (Reachability.Meet): Don't bother checking AlwaysThrows --
5416 barrier is always set.
5417 (FlowBranchingBlock.Merge): Likewise.
5419 2006-05-01 Raja R Harinath <harinath@gmail.com>
5421 * codegen.cs (EmitContext.ResolveTopBlock): Remove redundant
5422 checks for unreachable.
5424 2006-05-01 Marek Safar <marek.safar@seznam.cz>
5427 * flowanalysis.cs (UsageVector.IsAssigned): Add flag to ignore short path.
5429 * statement.cs (Block.UsageWarning): Uses newly introduced flag to detect
5430 whether field is really assigned.
5432 2006-04-30 Raja R Harinath <harinath@gmail.com>
5434 * flowanalysis.cs (Reachability): Make 4-argument constructor
5436 (Reachability.Meet): Rename from 'And'. Remove static variant.
5437 (Reachability.Always): Rename from the highly misleading
5438 'Reachability.Never'.
5439 (FlowBranching.Merge): Update to changes. Mark an impossible
5440 situation with a 'throw'.
5441 (*): Update to changes.
5443 2006-04-29 Raja R Harinath <harinath@gmail.com>
5445 * flowanalysis.cs (TriState): Rename from FlowBranching.FlowReturns.
5447 (FlowBranching.TriState_Meet): Rename from AndFlowReturns. Simplify.
5448 (FlowBranching.TriState_Max): Rename from OrFlowReturns. Simplify.
5449 (*): Update to changes.
5450 * statement.cs: Update to changes.
5452 2006-04-28 Marek Safar <marek.safar@seznam.cz>
5455 *class.cs (Method.FindOutBaseMethod): Base method cannot be property method.
5457 2006-04-28 Raja R Harinath <harinath@gmail.com>
5459 * flowanalysis.cs (FlowBranching.MergeTopBlock): Don't create a
5462 * flowanalysis.cs (UsageVector.MergeChild): Change FlowBranching
5463 argument to two arguments: an usage-vector and a bool. Move call
5464 to FlowBranching.Merge () ...
5465 (FlowBranching.MergeChild, FlowBranching.MergeTopBlock): ... here.
5467 * flowanalysis.cs (UsageVector.MergeChild): Move special-case
5468 handling of loop and switch reachability to ...
5469 (FlowBranchingLoop.Merge, FlowBranchingSwitch.Merge): ... these.
5471 2006-04-27 Raja R Harinath <harinath@gmail.com>
5473 * flowanalysis.cs (FlowBranching.InLoop): Move special-case
5474 handling to FlowBranchingLoop.InLoop.
5475 (FlowBranching.InSwitch): Likewise, to FlowBranchingSwitch.
5477 2006-04-26 Marek Safar <marek.safar@seznam.cz>
5480 * anonymous.cs (AnonymousMethod.DoResolve): Moved the check whether
5481 anonymous method is allowed from AnonymousContainer here.
5483 * attribute.cs, codegen.cs (EmitContext): Add IsAnonymousMethodAllowed.
5485 2006-04-24 Raja R Harinath <rharinath@novell.com>
5488 * flowanalysis.cs (MyBitVector.Or): Add null check on argument.
5490 2006-04-23 Marek Safar <marek.safar@seznam.cz>
5493 * constant.cs (FloatConstant.Reduce): Add range checking for checked context.
5494 (DoubleConstant.Reduce): Ditto.
5496 2006-04-23 Raja R Harinath <rharinath@novell.com>
5498 * expression.cs (LocalVariableReference.DoResolveBase): Simplify.
5499 Remove 'lvalue_right_side' argument. Move parts to ...
5500 (LocalVariableReference.ResolveLocalInfo, LocalVariable.DoResolve)
5501 (LocalVariable.DoResolveLValue): ... these.
5503 2006-04-21 Raja R Harinath <rharinath@novell.com>
5506 * codegen.cs (EmitContext.InRefOutArgumentResolving): Remove.
5507 * expression.cs (EmptyExpression.LValueMemberOutAccess): New.
5508 (LocalVariableReference.DoResolveBase): Use it to implement new
5510 (IndexerAccess.DoResolveLValue): Handle LValueMemberOutAccess.
5511 (Argument.Resolve): Simplify. Move CS1510 check ...
5512 * ecore.cs (Expression.ResolveLValue): ... here.
5513 (UnboxCast.DoResolveLValue): Handle LValueMemberOutAccess.
5514 (PropertyExpr.DoResolveLValue): Likewise.
5515 (FieldExpr.Report_AssignToReadonly): Likewise.
5516 (FieldExpr.DoResolve): Add 'out_access' argument. Use
5517 LValueMemberAccess or LValueMemberOutAccess on instance depending
5519 (FieldExpr.DoResolveLValue): Pass 'out_access' argument to
5520 DoResolve as appropriate.
5522 2006-04-20 Raja R Harinath <rharinath@novell.com>
5525 * expression.cs (Invocation.VerifyArgumentsCompat): Don't try
5526 implicit conversions on 'out' and 'ref' arguments.
5528 * expression.cs (Invocation.VerifyArgumentsCompat): Reorganize to
5529 improve clarity. Remove dead code.
5532 * statement.cs (Block.UsageWarning): Allow VariableInfo to be null.
5533 (Catch.Resolve): Resolve VarBlock if it exists.
5535 2006-04-19 Miguel de Icaza <miguel@novell.com>
5537 * statement.cs (Foreach.EmitFinally): Do not emit the enumerator
5538 twice, this was some residual code, the enumerator was emitted
5539 properly in the two branche of if later.
5541 2006-04-19 Raja R Harinath <rharinath@novell.com>
5543 * expression.cs (Cast.ResolveLValue): Remove. The result of a
5544 cast is never an lvalue.
5545 (Cast.DoResolve, Cast.ResolveRest): Combine.
5546 (Argument.Emit): Simplify slightly. Move 'Expr is
5547 IMemoryLocation' check ...
5548 (Argument.Resolve): ... here.
5549 (Argument.Error_LValueRequired): Remove. Inline into only user.
5551 Simplifications. Fix cs0191-2.cs
5552 * ecore.cs (FieldExpr.DoResolve): Move handling of CS0192, CS0198,
5553 CS1649 and CS1651 to ...
5554 (FieldExpr.Report_AssignToReadonly): ... this. Simplify by moving
5555 the actual selection of the error code and message to a lookup
5556 table. Add a dummy return value to simplify callsites.
5557 (FieldExpr.ResolveLValue): Don't allow a constructor to write to
5558 readonly fields of other instances of the same type. Move CS0197
5560 * expression.cs (Argument.Resolve): ... here. Simplify code.
5561 Ensure that ec.InRefOutArgumentResolving is only set during LValue
5562 resolution of an out or ref argument. The code simplification
5563 above uses this invariant.
5565 2006-04-18 Raja R Harinath <rharinath@novell.com>
5567 Possibly fix #77752. Fix cs1690-[4-7].cs.
5568 * ecore.cs (Expression.CheckMarshalByRefAccess): Renamed from
5569 CheckMarshallByRefAccess. Drop parameter.
5570 (FieldExpr.CheckMarshalByRefAccess): Update. Change CS1690 to a
5572 (FieldExpr.DoResolve): Call CheckMarshalByRefAccess on
5574 * report.cs (AllWarnings): Add CS1690.
5575 * expression.cs (Argument.Resolve): Use EmptyExpression.OutAccess
5577 (LocalVariableReference.DoResolveBase): Update.
5579 2006-04-09 Marek Safar <marek.safar@seznam.cz>
5581 * class.cs (MethodOrOperator): Moved common parts from method class.
5582 detect obsolete attributes.
5583 (Method.Define): Simplified as it reuses code from base.
5584 (Constructor.ValidAttributeTargets): Fixed issue found during
5586 (Destructor.ValidAttributeTargets): Fixed issue found during
5588 (Operator): Finished refactoring set off by #78020. Operator class is now
5589 ordinary method class.
5591 * anonymous.cs: Updated.
5593 * decl.cs (DeclSpace): Add IsGeneric
5595 2006-04-09 Marek Safar <marek.safar@seznam.cz>
5597 * class.cs (Constructor.Emit): Don't emit the attributes twice.
5599 2006-04-09 Marek Safar <marek.safar@seznam.cz>
5601 * class.cs (Operator.Emit): Extracted code from MethodData to correctly
5602 detect obsolete attributes.
5603 (Method.CreateEmitContext): Moved to MethodOrOperator.
5605 2006-04-09 Marek Safar <marek.safar@seznam.cz>
5608 * class.cs (TypeContainer.MemberCoreArrayList.DefineContainerMembers): Throw
5609 customized exception to make crash detection easier.
5610 (MethodOrOperator): Started to work on new base class for methods and
5612 (Method): Derives from MethodOrOperator.
5613 (Constructor.Emit): Emits its own attributes.
5614 (AbstractPropertyEventMethod.Emit): Ditto.
5615 (Operator): Derives from MethodOrOperator, will refactor fully in extra
5617 (Operator.Emit): It's temporary more tricky than should be.
5619 * doc.cs (GetMethodDocCommentName): Updated after operator changes.
5621 * report.cs (InternalErrorException): Add ctor with inner exception.
5623 2006-04-08 Marek Safar <marek.safar@seznam.cz>
5626 * ecore.cs (SimpleName.ResolveAsTypeStep): Report better error when type is
5629 2006-04-07 Marek Safar <marek.safar@seznam.cz>
5632 * expression.cs (ArrayCreation.GetAttributableValue): Creates correctly typed
5635 2006-04-06 Marek Safar <marek.safar@seznam.cz>
5637 * class.cs (Class.ApplyAttributeBuilder): Report an error when ComImport
5638 attribute is present and Guid not.
5639 (Interface.ApplyAttributeBuilder): Ditto.
5641 * attribute.cs: Add error message.
5643 2006-04-06 Marek Safar <marek.safar@seznam.cz>
5647 * attribute.cs (Attribute.AttachTo): The attribute can have multiple
5648 sources (it's composite) so hold them in extra array as they are used in
5649 Emit phase only. It worked in the previous versions by mistake.
5650 (Attribute.Emit): Emit attribute for more owners when exist.
5652 * codegen.cs, class.cs: Updated to don't re-attach attribute twice as now
5653 it has now different behaviour.
5655 2006-04-04 Marek Safar <marek.safar@seznam.cz>
5657 * constant.cs (Constant.IsDefaultInitializer): New method.
5659 * class.cs: Updated.
5661 * expression.cs (ArrayCreation.CheckIndices): Add an optimization to don't
5662 re-initialize default values. It saves KBs almost for every assembly.
5663 Thanks Zoltan for the idea.
5664 (ArrayCreation.ResolveInitializers): Renamed from ValidateInitializers.
5665 (ArrayCreation.DoResolve): Resolve only once.
5666 (ArrayCreation.Emit): Emit static initializer only when it is faster.
5667 (ArrayCreation.GetAttributableValue): Cope with optimized values.
5669 2006-04-03 Zoltan Varga <vargaz@gmail.com>
5671 * report.cs (Warning, Error): Add 0-, 1-, and 2- argument specializations.
5674 2006-04-01 Marek Safar <marek.safar@seznam.cz>
5676 * assign.cs (Assign.DoResolve): Assignment to same variable can occur
5677 in an embedded statement too.
5679 2006-04-01 Raja R Harinath <rharinath@novell.com>
5682 * statement.cs (Switch.EmitObjectInteger) [ulong]: Remove bad cast.
5684 2006-04-01 Marek Safar <marek.safar@seznam.cz>
5688 * class.cs (TypeContainer.AddPartial): Don't report an error when modifier
5691 * modifiers.cs: Add DEFAULT_ACCESS_MODIFER.
5693 2006-03-31 Marek Safar <marek.safar@seznam.cz>
5695 * assign.cs (LocalTemporary): Don't require ILGenerator in the resolve
5698 * anonymous.cs, assign.cs, ecore.cs, expression.cs: Updated after
5699 LocalTemporary change.
5701 * class.cs (ClassOrStruct.DefineDefaultConstructor): Moved from
5703 (ClassOrStruct.DefineFieldInitializers): Implemented static field
5704 initializers optimization.
5705 (ClassOrStruct.TypeAttr): Moved from modifiers.
5706 (Constructor.CheckBase): Don't crash when static ctor has parameters.
5707 (FieldBase.ResolveInitializer): Resolves initializer.
5708 (FieldBase.HasDefaultInitializer): New property.
5710 * cs-parser.jay: Removed message.
5712 * expression.cs (CompilerGeneratedThis): New specialization.
5714 * modifiers.cs (TypeAttr): Moved to ClassOrStruct.TypeAttr
5716 2006-03-28 Marek Safar <marek.safar@seznam.cz>
5718 * cs-parser.jay, cs-tokenizer.cs: On demand Stack allocation.
5720 2006-03-27 Marek Safar <marek.safar@seznam.cz>
5722 * ecore.cs (Expression.ResolveAsConstant): Clean up, enum constants should
5723 be now EnumConstants only.
5725 2006-03-27 Marek Safar <marek.safar@seznam.cz>
5727 * attribute.cs, driver.cs: Reset more caches.
5729 2006-03-26 Marek Safar <marek.safar@seznam.cz>
5731 * cs-tokenizer.cs (adjust_real): Uses float.Parse for float literals.
5733 2006-03-26 Marek Safar <marek.safar@seznam.cz>
5735 * constant.cs (Constant.Reduce): Replaced EmitContext with single bool
5736 for easier reuse. Updated all overrides.
5737 (IntegralConstant): New base class for all integral constants.
5738 (IntegralConstant.Error_ValueCannotBeConverted): When assigned value if out
5739 of the constant range, report custom error.
5740 (UIntConstant.Reduce): Fixed uint conversion.
5742 * ecore.cs, literal.cs: Reduce updates.
5744 2006-03-26 Marek Safar <marek.safar@seznam.cz>
5748 * class.cs (Constructor.Define): Removed extra if for default ctors.
5749 A patch from Atsushi Enomoto.
5751 2006-03-26 Marek Safar <marek.safar@seznam.cz>
5753 * attribute.cs (Attribute.ResolveConstructor): Conversion was moved to
5754 GetAttributableValue.
5756 * constant.cs (Constant.GetAttributableValue): Does implicit conversion
5759 * convert.cs (ImplicitConversionRequired): Error message moved to
5762 * ecore.cs (Expression.GetAttributableValue): Add type parameter for
5763 automatic implicit conversion of an output value.
5764 (EnumConstant.GetAttributableValue): Don't reduce the enum constants.
5766 * expression.cs (ArrayCreation.GetAttributableValue): Add element type
5768 (TypeOf.GetAttributableValue): Add extra handling for object type.
5770 * literal.cs (DoubleLiteral.Error_ValueCannotBeConverted): Doubles can have
5771 special error message.
5773 2006-03-25 Marek Safar <marek.safar@seznam.cz>
5775 * class.cs (Constructor.Emit): Don't crash when struct ctor is
5777 (Constructor.ApplyAttributeBuilder): Transform MethodImplAttribute to be
5778 compatible with MS runtime.
5780 2006-03-23 Marek Safar <marek.safar@seznam.cz>
5782 * attribute.cs (Attribute.ResolveConstructor): Check for an invalid
5783 attribute arguments here.
5785 * class.cs (Indexer.Define): The check was moved to attribute class.
5787 2006-03-22 Marek Safar <marek.safar@seznam.cz>
5789 * assign.cs, class.cs, codegen.cs, convert.cs, decl.cs, ecore.cs,
5790 expression.cs, typemanager.cs: Minor changes from gmcs to make merging
5793 2006-03-22 Raja R Harinath <rharinath@novell.com>
5795 Support ParameterDefaultValueAttribute in gmcs. Also applied to
5796 mcs to keep code differences small.
5797 * attribute.cs (Attribute.GetParameterDefaultValue): New.
5798 * typemanager.cs (parameter_default_value_attribute_type): New.
5799 * parameter.cs (Parameter.ApplyAttributeBuilder): Use them. Add
5802 2006-03-21 Marek Safar <marek.safar@seznam.cz>
5804 * expression.cs (StringConcat.Append): Reverted back to no warning state.
5806 2006-03-21 Marek Safar <marek.safar@seznam.cz>
5808 * const.cs (Error_ConstantCanBeInitializedWithNullOnly): Share a message.
5810 * statement.cs (Block.ResolveMeta): Look for wrong object constants in
5813 2006-03-21 Atsushi Enomoto <atsushi@ximian.com>
5815 * doc-bootstrap.cs : fix build.
5817 2006-03-20 Marek Safar <marek.safar@seznam.cz>
5819 * expression.cs (StringConcat.Append): Issue a warning when empty string
5822 2006-03-20 Marek Safar <marek.safar@seznam.cz>
5824 * assign.cs (CompoundAssign.ResolveSource): Removed.
5826 * attribute.cs (ResolvePossibleAttributeType): Updated after MemberAccess
5829 * class.cs (TypeContainer.FindMethods): Removed.
5830 (TypeContainer.CheckMemberUsage): Made static.
5832 * codegen.cs (GetAssemblyName): Uses Length for empty string test.
5834 * constant.cs (CheckRange): Removed unused type argument.
5835 (CheckUnsigned): Removed unused type argument.
5837 * cs-parser.jay: Updated after MemberAccess clean up.
5838 Uses Length for empty string test.
5840 * cs-tokenizer.cs: Uses Length for empty string test.
5841 (IsCastToken): Made static.
5842 (is_hex): Made static.
5843 (real_type_suffix): Made static.
5845 * decl.cs (SetupCache): Made static.
5846 (OnGenerateDocComment): Removed unused ds argument.
5848 * delegate.cs (VerifyDelegate): Removed unused argument.
5850 * doc.cs: Uses Length for empty string test.
5852 * driver.cs: Uses Length for empty string test.
5854 * enum.cs (IsValidEnumType): Made static
5856 * expression.cs (EnumLiftUp): Removed unused argument.
5857 (ResolveMethodGroup): Ditto.
5858 (BetterConversion): Ditto.
5859 (GetVarargsTypes): Ditto.
5860 (UpdateIndices): Ditto.
5861 (ValidateInitializers): Ditto.
5862 (MemberAccess.ctor): Ditto.
5863 (GetIndexersForType): Ditto.
5865 * flowanalysis.cs: (MergeFinally): Removed unused argument.
5867 * iterators.cs: Updated after MemberAccess clean up.
5869 * location.cs: Uses Length for empty string test.
5871 * namespace.cs: Uses Length for empty string test.
5873 * report.cs (CheckWarningCode): Made static.
5875 * statement.cs (LabeledStatement): Removed unused argument.
5877 * typemanager.cs (FilterNone): Removed.
5879 2006-03-18 Marek Safar <marek.safar@seznam.cz>
5881 * codegen.cs (EmitContext.TestObsoleteMethodUsage): Removed as it become
5884 * class.cs: Updated.
5886 2006-03-18 Marek Safar <marek.safar@seznam.cz>
5888 * cs-parser.jay.cs: __arglist is not allowed for delegates.
5890 2006-03-18 Marek Safar <marek.safar@seznam.cz>
5894 * expression.cs (VerifyArgumentsCompat): Reverted to double error
5895 reporting, it's more tricky than I thought.
5897 2006-03-18 Marek Safar <marek.safar@seznam.cz>
5901 * anonymous.cs.cs (AnonymousMethod): Add host to allow access to
5903 (AnonymousMethod.ImplicitStandardConversionExists): New method.
5904 (AnonymousMethod.Compatible): Moved parameter resolving to DoResolve.
5905 Add more error reporting; Fixed issue with params.
5907 * convert.cs (ImplicitStandardConversionExists): Returned conversion check.
5909 * cs-parser.jay: AnonymousMethod requires host container.
5911 * delegate.cs (NewDelegate.DoResolve): Updated after Compatible changes.
5913 2006-03-18 Raja R Harinath <harinath@gmail.com>
5915 * class.cs: Change 'TypeContainer ds' constructor argument to
5916 'DeclSpace parent'. Some classes were missed below due to
5917 different naming convention.
5919 * class.cs (MemberCore.Parent): Delete. This makes the
5920 ParentContainer changes below enforceable by the compiler.
5922 Treat pointers to enclosing declaration space as 'DeclSpace', not
5924 * class.cs, const.cs, delegate.cs, enum.cs, iterator.cs: Change
5925 'TypeContainer parent' constructor argument to 'DeclSpace parent'.
5927 * statement.cs (LocalInfo..ctor): Use DeclSpace argument instead
5929 (Block.AddThisVariable): Likewise.
5930 * class.cs (MethodData.Define, MethodData.Emit): Likewise.
5931 (AbstractPropertyEventMethod.Emit): Likewise.
5932 (AbstractPropertyEventMethod.EmitMethod): Likewise.
5933 (GetMethod.Define, SetMethod.Define): Likewise.
5934 (PropertyMethod.Define, DelegateMethod.Define): Likewise.
5935 (DelegateMethod.EmitMethod): Likewise.
5937 Fix regression test-partial-13.cs.
5938 Rationalize use of PartialContainer. Ensure that the partial
5939 class semantics can be tied to type-correctness, i.e., any
5940 violation will cause a compile error.
5941 * class.cs, const.cs: Access all fields that belong to class
5942 TypeContainer via ParentContainer. Arguments of EmitContexts and
5943 Resolve()-like functions still use 'Parent'.
5945 * class.cs (SourceMethod): Use DeclSpace, not TypeContainer.
5946 (*.CreateEmitContext): Change TypeContainer argument to DeclSpace.
5947 (PropertyMethod.CheckModifiers): Remove unused argument.
5948 * codegen.cs (EmitContext..ctor): Change TypeContainer argument to
5951 2006-03-17 Raja R Harinath <harinath@gmail.com>
5953 Make semantics of PartialContainer simpler.
5954 * decl.cs (DeclSpace.IsPartial): Remove.
5955 * class.cs (TypeContainer.IsPartial): Likewise.
5956 (TypeContainer..ctor): Set PartialContainer to point to self.
5957 (TypeContainer.GetClsCompliantAttributeValue): Don't use IsPartial.
5958 (TypeContainer.FindNestedType): Likewise.
5959 (MemberCore.ParentContainer): Simplify. Remove deprecation.
5961 2006-03-17 Marek Safar <marek.safar@seznam.cz>
5963 * typemanager.cs.cs (GetInterfaces): Don't recreate 0-sized arrays.
5965 2006-03-15 Marek Safar <marek.safar@seznam.cz>
5967 * class.cs (FieldMember.Emit): ParentContainer is real parent for partial
5970 2006-03-15 Marek Safar <marek.safar@seznam.cz>
5972 * class.cs (Operator.Define): An error for base conversion was not
5975 2006-03-14 Atsushi Enomoto <atsushi@ximian.com>
5977 * iterator.cs : yield break is allowed in try statement which has
5978 catch clauses. Fixed bug #77767.
5980 2006-03-13 Marek Safar <marek.safar@seznam.cz>
5982 A fix for #77593, #77574.
5984 * class.cs (MethodCore.CheckBase): Another if for operator.
5986 2006-03-09 Marek Safar <marek.safar@seznam.cz>
5988 * anonymous.cs (AnonymousMethod.Compatible): Don't crash when parameters
5991 * delegate.cs (Delegate.GetInvokeMethod): Use emitcontext free MemberLookup.
5992 (DelegateCreation.ImplicitStandardConversionExists): New method for just
5995 *ecore.cs (Expression.MemberLookup): Don't ask for emitcontext when it's
5998 * assign.cs, constant.cs, convert.cs, delegate.cs, expression.cs:
5999 Updated after another emitcontext usage was clean up. It should help us to
6000 synchronize with gmcs easier.
6002 2006-03-04 Marek Safar <marek.safar@seznam.cz>
6006 * class.cs (SetMethod.DefineParameters): Uses new parameters type ctor.
6007 (Event.Define): ditto
6008 (SetIndexerMethod.DefineParameters): Uses Parameters.MergeGenerated.
6010 * delegate.cs (Delegate.Define): Uses Parameters.MergeGenerated.
6011 Removed redundant code and set NewSlot for Invoke method too.
6013 * parameter.cs (Parameters.ctor): Add custom, type ctor.
6014 (Parameters.MergeGenerated): New method. Use this method when you merge
6015 compiler generated argument with user arguments.
6017 2006-03-03 Marek Safar <marek.safar@seznam.cz>
6019 * attribute.cs (ResolveAsTypeTerminal): Removed.
6021 * ecore.cs (Expression.ResolveAsTypeTerminal): Make virtual to allow
6022 specialization for predefined types; 30% speed up.
6023 Finally placed obsolete check to right place.
6024 (Expression.ResolveType): Removed.
6026 * enum.cs, expression.cs, parameter.cs, statement.cs, typemanager.cs:
6027 Updated after ResolveType was removed.
6029 * expression.cs (Cast.ctor): Check void cast.
6030 (Binary.ResolveAsTypeTerminal): Is never type.
6031 (Conditional.ResolveAsTypeTerminal): Is never type.
6033 * rootcontext.cs (ResolveCore): Set base type to simplify some code later.
6035 2006-03-01 Raja R Harinath <rharinath@novell.com>
6038 * expression.cs (ParameterReference.DoResolveBase): Change return
6040 (ParameterReference.DoResolve, ParameterReference.DoResolveLValue):
6044 * ecore.cs (PropertyExpr.InstanceResolve): Fix CS1540 check.
6047 * typemanager.cs (GetFullNameSignature): Don't nullref on
6048 protected accessors.
6050 2006-02-27 Marek Safar <marek.safar@seznam.cz>
6052 * attribute.cs (Attribute.PosArguments, Attribute.NamedArguments): Use
6053 these two separated members to simplify the code.
6054 (Attribute.Resolve): Refactored to use new fields and methods.
6055 (Attribute.ResolveConstructor): Extracted from ResolveArguments and
6056 implemented obsolete attribute checking.
6057 (Attribute.ResolveNamedArguments): Extracted from ResolveArguments and
6058 implemented obsolete checking again. It look line never ending quest ;-)
6059 (GlobalAttribute.ResolveConstructor): Need to override as the rest.
6061 * cfold.cs (BinaryFold): TryReduce throws an exception to indicate error.
6063 * constanct.cs (TryReduce): Throws OverflowException to indicate error.
6065 *class.cs (Property.Define): Add RegisterProperty call.
6067 * cs-parser.jay: Replaced ArrayList with fixed array for attribute
6068 argument groups (only 2).
6070 * ecore.cs (Expression.GetAttributableValue): New virtual method used for
6071 encoding expression to arguments.
6072 (Expression.ExprClassToResolveFlags): Just turned to property.
6074 * expression.cs (ArrayCreation.ValidateInitializers): Slightly optimized.
6075 (ArrayCreation.GetAttributableValue): Renamed from EncodeAsAttribute and
6076 optimized as well as implemented support for zero-length attributes.
6078 * typemanager.cs (TypeManager.RegisterProperty, TypeManager.GetProperty):
6079 Add caching of PropertyInfo's.
6081 2006-02-25 Marek Safar <marek.safar@seznam.cz>
6083 * delegate.cs (DelegateCreation.ResolveMethodGroupExpr): Don't report
6084 error multiple times.
6086 2006-02-25 Marek Safar <marek.safar@seznam.cz>
6088 New partial class implementation.
6089 A fix for #77027, #77029, #77403
6091 * attribute.cs (Attributable): Made attributes protected.
6093 * class.cs (TypeContainer): Add PartialContainer and partial_parts as
6094 the replacements of ClassPart and PartialContainer.
6095 (TypeContainer.AddClassOrStruct): Call RecordDecl here.
6096 (TypeContainer.AddInterface): Ditto.
6097 (TypeContainer.AddPartial): The main method for partial classes. It checks
6098 for errors and merges ModFlags and attributes. At the end class is added to
6100 (TYpeContainer.DefineDefaultConstructor): Checks whether default ctor is
6102 (TypeContainer.GetClsCompliantAttributeValue): Cope with partial class too.
6103 (TypeContainer.GetNormalPartialBases): Resolves base classes and interfaces
6104 from the rest of partial classes.
6105 (TypeContainer.GetClassBases): Simplified.
6106 (TypeContainer.DefineTypeBuilder): New method, mostly extracted from
6108 (TypeContainer.DefineDefaultConstructor): Is used by derived classes.
6109 (TypeContainer.HasExplicitLayout): Uses Flags now.
6110 (PartialContainer): Removed.
6111 (ClassOrStruct.AddToContainer): Moved enclosing member name check here.
6112 (StaticClass): Was merged with Class.
6113 (Class.GetClassBases): class and static class bases are verified here.
6114 (Class.TypeAttr): Added static attributes when class is static.
6115 (Struct.RegisterFieldForInitialization): Moved from TypeContainer.
6116 (MemberBase): In some cases we need to call parent container for partial
6117 class. It should be eliminated but it's not easy now.
6119 * cs-parser.jay: Replaced all PartialContainer with AddPartial.
6121 * decls.cs (MemberCore.DocComment): Introduced new property as is used by
6122 partial classed to accumulate class comments.
6123 (MemberCore.GetClsCompliantAttributeValue): Moved from TypeContainer.
6125 * doc.cs (GenerateTypeDocComment): Partial classes clean up.
6127 * driver.cs (MainDriver): Tree.GetDecl was removed.
6129 * modifiers.cs (Modifiers): Add partial modifier.
6131 * tree.cs (Tree.decl): Removed.
6132 (RootTypes): Started to use this class more often for root types
6135 2006-02-22 Marek Safar <marek.safar@seznam.cz>
6139 * attribute.cs (AttributeTester.GetCoClassAttribute): Don't crash when
6140 external interface does not have an attribute.
6142 2006-02-22 Marek Safar <marek.safar@seznam.cz>
6144 Another prerequisites for new partial classs implementation.
6146 * attribute.cs (Attribute.Equal): Implemented.
6147 (Attribute.Emit): Changed as attributes can be applied more than twice.
6148 (Attributes.Emit): Check for duplicate attributes here.
6150 * class.cs, decl.cs, delegate.cs, doc.cs, enum.cs: Don't pass DeclSpace
6151 as a parameter, clean-up.
6153 2006-02-11 Marek Safar <marek.safar@seznam.cz>
6157 * class.cs (TypeContainer.DefineType): Cannot use ResolveType because it
6158 contains obsolete attribute check which can in some cases look for base
6159 type of current class which is not initialized yet.
6160 (TypeContainer.BaseType): Replacement of ptype.
6162 * decl.cs (MemberCore.CheckObsoleteType): Reuse existing code.
6164 2006-02-11 Marek Safar <marek.safar@seznam.cz>
6166 First of prerequisites for new partial classs implemention.
6168 * attribute.cs (Attributable): Extended by ResolveContext;
6169 Attributes finally have correct context for resolving in all cases.
6170 (AttachTo): Attribute owner is assigned here.
6172 * codegen.cs (IResolveContext): Introduce new interface to hold
6173 all information needed in resolving phase.
6174 (EmitContext): Implements IResolveContext; more clean-up needed here.
6176 * decl.cs (MemberCore): Implemented IResolveContext.
6178 * anonymous.cs, attribute.cs, class.cs, codegen.cs, const.cs,
6179 decl.cs, ecore.cs, enum.cs, expression.cs, iterators.cs, namespace.cs,
6180 parameter.cs, statement.cs, tree.cs, typemanager.cs:
6181 Refactored to use new IResolveContext instead of EmitContext; cleanup
6183 2006-02-06 Miguel de Icaza <miguel@novell.com>
6185 * codegen.cs (EmitScopeInitFromBlock): check here the
6186 capture_context, there is no need to make two calls to the
6189 * anonymous.cs: Add some debugging messages that might help me
6190 track other instances of this problem in the future (the
6191 regression of test 467).
6193 * cs-parser.jay: track the variable block, as we need to initalize
6194 any captured variables declared in this block for the "catch"
6195 portion of the "Try" statement.
6197 * statement.cs (Try.Emit): If the "Catch" has a VarBlock, emit any
6198 scope initialization for captured variables.
6200 Also, move the emit for the variables after the block location has
6203 2006-02-06 Marek Safar <marek.safar@seznam.cz>
6205 * ecore.cs (PropertyExpr.FindAccessors): Just made flags const.
6207 2006-02-02 Miguel de Icaza <miguel@novell.com>
6209 * anonymous.cs (CaptureContext.EmitInitScope): I was wrong in the
6210 commit yesterday, the initialization for the roots is necessary.
6211 What is not necessary is the scope activation.
6213 2006-02-02 Raja R Harinath <rharinath@novell.com>
6215 * ecore.cs (PropertyExpr.DoResolveLValue): Add CS0206 check.
6216 * expression.cs (IndexerAccess.DoResolveLValue): Add CS1612 and
6218 (Argument.Resolve): Remove CS0206 checks.
6220 2006-02-01 Miguel de Icaza <miguel@novell.com>
6222 * anonymous.cs (CaptureContext.EmitInitScope): Do not emit the
6223 scopes for all the roots, the scopes will now be emitted when the
6224 Blocks are entered. [This change was wrong, fixed on 2006-02-02]
6226 (CaptureContext.EmitScopeInitFromBlock): Simply emit the ScopeInfo
6227 code. This reduces a lot of existing cruft.
6229 * statement.cs (Block.Emit): Call EmitScopeInitFromBlock here, so
6230 that the ScopeInfo is generated as we enter the scope, not at the
6231 time of use, which is what we used to do before.
6233 * codegen.cs (EmitScopeInitFromBlock): New routine, this is called
6234 every time a Block is about to be emitted if we have a
6237 2006-02-01 Raja R Harinath <rharinath@novell.com>
6239 * typemanager.cs (NoTypes, NoTypeExprs): Remove.
6241 * *.cs: Use Type.EmptyTypes instead of TypeManager.NoTypes.
6243 * typemanager.cs (cons_param_array_attribute): Make private.
6244 (Reset): Set it to null.
6245 (InitCoreHelpers): Don't initialize it.
6246 (ConsParamArrayAttribute): New. Initialize it as needed.
6247 * parameter.cs (ParamsParameter.ApplyAttribute): Update to change.
6249 2006-01-31 Miguel de Icaza <miguel@novell.com>
6251 * expression.cs: There might be errors reported during the
6252 selection of applicable methods. If there are errors, do not
6253 continue execution as it will lead the compiler to crash.
6255 2006-01-30 Miguel de Icaza <miguel@novell.com>
6257 * expression.cs: Member access is not allowed on anonymous
6258 methods. Fixes #77402.
6260 2006-01-30 Raja R Harinath <rharinath@novell.com>
6263 * cs-parser.jay (VariableDeclaration): Don't set
6264 current_array_type to null.
6265 (field_declaration, event_declaration, declaration_statement):
6266 Set it to null here.
6268 2006-01-28 Raja R Harinath <harinath@gmail.com>
6270 * typemanager.cs (GenericParameterPosition): New.
6273 2006-01-28 Atsushi Enomoto <atsushi@ximian.com>
6275 * doc.cs : To process "include" elements, first we should create
6276 another list than XmlNodeList, because it could result in node
6277 removal, which could result in that the XmlNodeList gives up
6280 (Also made code identical to gmcs again.)
6282 2006-01-25 Miguel de Icaza <miguel@novell.com>
6284 * ecore.cs: Introduce an error report that we were not catching
6285 before, if not silent, we must report the error. Gonzalo ran into
6288 2006-01-23 Miguel de Icaza <miguel@novell.com>
6290 A fix for bug: #76957
6292 * iterators.cs (MoveNextMethod.CreateMethodHost): call
6293 ComputeMethodHost before creating the method, this is a new
6296 * anonymous.cs (AnonymousContainer): Now we track all the scopes
6297 that this method references (RegisterScope). The actual scope
6298 where the method is hosted is computed with the ComputeMethodHost
6299 before we create the method.
6301 Moved the Deepest routine here.
6303 (AnonymousContainer.ComputeMethodHost): New routine used to
6304 compute the proper ScopeInfo that will host the anonymous method.
6306 (ScopeInfo): Deal with multiple roots. The problem was that we
6307 did not have a unique root where all ScopeInfos could be hanged
6308 from. Remove `topmost' ScopeInfo, and instead keep an arraylist
6311 Remove AdjustMethodScope which is now computed at the end. Remove
6312 LinkScope which did a partial link, instead link all ScopeInfos
6313 before code generation from the new "LinkScopes" routine.
6315 Simplify all the Add* routines as they no longer need to maintain
6316 the tree, they just need to record that they are using variables
6319 (IsAncestor, GetAncestorScopes, GetParentScope, LinkScope): New
6320 routines to produce the forest of ScopeInfo trees.
6322 * class.cs (TypeContainer.AppendMethod): This is just like
6323 AddMethod, but ensures that an interface implementation method
6324 (IEnumerable.XXX) is not inserted at the beginning of the queue of
6325 methods, but at the end.
6327 We use this functionality to ensure that the generated MoveNext
6328 method in the iterator class is resolved/emitted before the
6329 enumerator methods created.
6331 This is required because the MoveNext method computes the right
6332 ScopeInfo for the method. And the other methods will eventually
6333 need to resolve and fetch information computed from the anonymous
6336 2006-01-21 Raja R Harinath <harinath@gmail.com>
6337 Carlos Alberto Cortez <calberto.cortez@gmail.com>
6340 * namespace.cs (NamespaceEntry.UsingExternalAliases): Don't add to
6342 (NamespaceEntry.LookupAlias): Lookup 'extern_aliases' hash too.
6343 (NamespaceEntry.VerifyUsing): Resolve external aliases too.
6345 2006-01-18 Raja R Harinath <rharinath@novell.com>
6347 Fix #76656, cs0231-2.cs.
6348 * cs-parser.jay (formal_parameter_list): Make error case catch
6350 (parenthesized_expression_0): Add CS1026 check.
6351 (invocation_expression): Remove unused { $$ = lexer.Location }.
6353 2006-01-17 Raja R Harinath <rharinath@novell.com>
6356 * cs-parser.jay (statement_expression): Don't list out the
6357 individual statement-expressions. Convert syntax error into
6360 2006-01-16 Raja R Harinath <rharinath@novell.com>
6363 * ecore.cs (MemberAccess.CheckIntermediateModification): Remove.
6364 (UnboxCast.DoResolveLValue): New. Move CS0445 check from
6365 CheckIntermediateModification.
6366 (FieldExpr.DoResolve): Add new two-argument version that
6367 allows us to resolve the InstanceExpression as an lvalue.
6368 The one-argument variant is now just a wrapper.
6369 (FieldExpr.DoResolveLValue): Use two-argument DoResolve.
6370 Resolve the lhs as an lvalue if the it has a value type.
6371 (FieldExpr.AssignToReadonly): Move CS1648 and CS1650 checks
6372 from Assign.DoResolve.
6373 (PropertyExpr.InstanceResolve): Allow InstanceExpression to be
6374 resolved as an lvalue.
6375 (PropertyExpr.DoResolve): Update.
6376 (PropertyExpr.DoResolveLValue): Resolve the lhs as an lvalue if it
6377 has a value type. Move CS1612 check here from
6378 CheckIntermediateModification.
6379 * assign.cs (Assign.DoResolve): Remove CS1648 and CS1650 checks.
6380 * expression.cs (EmptyExpression.OutAccess): New. Used as the
6381 'right_side' of a ResolveLValue on an 'out' argument.
6382 (EmptyExpression.LValueMemberAccess): New. Used as the
6383 'right_side' of a propagated ResolveLValue on a value type.
6384 (LocalVariableReference.DoResolveBase): Recognize
6385 EmptyExpression.OutAccess and EmptyExpression.LValueMemberAccess.
6387 (Argument.Resolve): Use EmptyExpression.OutAccess rather than
6388 EmptyExpression.Null.
6390 2006-01-16 Atsushi Enomoto <atsushi@ximian.com>
6392 * typemanager.cs : added IsGenericParameter(). In mcs it always
6394 * doc.cs : for generic parameters, use GenericParameterPosition,
6397 2006-01-12 Ben Maurer <bmaurer@andrew.cmu.edu>
6399 * expression.cs: Fix Console.WriteLine ((this = x).foo);
6401 2006-01-12 Miguel de Icaza <miguel@novell.com>
6403 This fixes the problem where we used ldfld instead of ldflda to
6404 load the "THIS" pointer on captured parameters, when THIS is a
6405 value type. See bug #77205.
6407 * iterators.cs (CapturedThisReference.Emit): Pass false to
6408 EmitThis (we do not need the address).
6410 * codegen.cs (EmitThis): it needs to know whether we need the
6411 address of `this' or not. This is used by value types.
6413 * expression.cs (This.AddressOf): Pass true to the EmitThis call,
6414 every other call passes false.
6416 2006-01-12 Raja R Harinath <rharinath@novell.com>
6419 * typemanager.cs (TryGetBaseDefinition): Rename from the mis-named
6421 * expression.cs (Invocation.OverloadResolve): Update.
6422 (Invocation.DoResolve): Avoid double resolution of invocation.
6424 2006-01-11 Raja R Harinath <rharinath@novell.com>
6427 * expression.cs (Unary.Emit): When in /checked+ mode, don't emit
6428 unary negation of floating point types as 0-expr; negation cannot
6429 overflow in floating point types.
6432 * expression.cs (MemberAccess.DoResolve): Disallow the use of '.'
6433 on operands of 'void' type.
6436 * cfold.cs (BinaryFold): Implement folding of BinaryOr, BinaryAnd
6437 and ExclusiveOr for boolean constants too.
6439 2006-01-09 Raja R Harinath <rharinath@novell.com>
6442 * expression.cs (Invocation.OverloadResolve): Replace reflected
6443 override methods with their base virtual methods, rather than
6445 * typemanager.cs (TypeManager.GetOverride): New.
6447 2006-01-05 Jb Evain <jbevain@gmail.com>
6449 * class.cs (Property.Define, Indexer.Define): do not tag the
6450 properties as SpecialName | RTSpecialName.
6452 2006-01-04 Miguel de Icaza <miguel@novell.com>
6454 * class.cs (MethodCore.IsDuplicateImplementation): This method was
6455 doing a low-level comparission of parameter types. It was lacking
6456 a check for __argslist.
6458 2005-12-30 Miguel de Icaza <miguel@novell.com>
6460 * expression.cs (ParameterReference.DoResolveBase): Allow
6461 reference parameters if they are local to this block.
6463 This allows the ref and out parameters of a delegate to be used in
6464 an anonymous method, for example:
6466 delegate void set (out int x);
6468 set s = delegate (out int x){
6472 This is used by functionality introduced late in the C# language.
6474 * anonymous.cs (AnonymousMethod.Compatible): Allow anonymous
6475 method that take ref and out parameters.
6477 Fixes #77119 which was a late change in the spec.
6479 2005-12-23 Miguel de Icaza <miguel@novell.com>
6481 * anonymous.cs (ScopeInfo.LinkScope): Do not link the scope to its
6482 parent if its the same scope. Fixes #77060.
6484 2005-12-21 Miguel de Icaza <miguel@novell.com>
6486 * driver.cs: Report the case of no source files and no -out:
6489 2005-12-20 Raja R Harinath <rharinath@novell.com>
6492 * expression.cs (ComposedCast.GetSignatureForError): Define.
6494 2005-12-18 Carlos Alberto Cortez <calberto.cortez@gmail.com>
6498 * namespace.cs (NamespaceEntry): Add extern_aliases as a
6499 ListDictionary, to contain the ExternAliasEntry entries (in
6500 addition to the NamespaceEntry.aliases hashtable). This field is
6501 shared between the original entry and its doppelganger (bodyless
6503 (NamespaceEntry.UsingExternalAlias): Add the extern alias entry to
6504 extern_aliases field.
6505 (NamespaceEntry.Lookup): Move the IsImplicit check after the
6506 lookup in extern_aliases.
6508 2005-12-16 Raja R Harinath <rharinath@novell.com>
6511 * class.cs (TypeContainer.Mark_HasEquals): New.
6512 (TypeContainer.Mark_HasGetHashCode): New.
6513 (ClassPart): Override them.
6514 (MethodCore.CheckBase): Use them instead of referring to Parent.Methods.
6517 * enum.cs (EnumMember.EnumMember): Pass the parent_enum as the
6518 'parent' argument to the base constructor.
6520 Remove all mention of TypeContainer from decl.cs.
6521 * decl.cs (MemberCore.Parent): Change into a DeclSpace.
6522 (MemberCore.MemberCore): Change type of 'parent' argument to DeclSpace.
6523 (DeclSpace.DeclSpace): Likewise.
6524 (DeclSpace.DefineMembers): Remove unused argument.
6525 * cs-parser.jay (pop_current_class): Update to changes. Simplify
6526 debugging check -- we don't care if the debug code throws an
6527 InvalidCastException instead of an InternalErrorException.
6528 * class.cs (TypeContainer.DefineMembers): Update to changes.
6529 (TypeContainer.DoDefineMembers): Likewise.
6530 (TypeContainer.GetMethods): Likewise.
6531 (PropertyMember.Define): Likewise.
6532 (MemberBase.Parent): New property that forwards to
6533 MemberCore.Parent, but ensures that we get a TypeContainer.
6534 * rootcontext.cs (RootContext.PopulateCoreType): Update to changes.
6535 (RootContext.PopulateTypes): Likewise. Remove special case code
6536 for !RootContext.StdLib: DefineMembers is idempotent.
6538 2005-12-14 Miguel de Icaza <miguel@novell.com>
6540 * convert.cs (ExplicitConversionCore): Check the return value from
6541 ExplicitConversionCore which can return null on failure. Fixes #76914
6543 2005-12-13 Marek Safar <marek.safar@seznam.cz>
6545 * class.cs (Method.ApplyAttributeBuilder): Test out modifier properly.
6547 2005-12-11 Atsushi Enomoto <atsushi@ximian.com>
6549 * doc.cs : The search for referenced namespace was insufficient to
6550 get global one as it used to do. Fixed bug #76965.
6552 2005-12-10 Atsushi Enomoto <atsushi@ximian.com>
6554 * doc.cs : check name in cref in the last phase that whether it is
6557 2005-12-09 Atsushi Enomoto <atsushi@ximian.com>
6559 * cs-tokenizer.cs : reverted the latest change: it somehow broke
6562 2005-12-09 Atsushi Enomoto <atsushi@ximian.com>
6564 * doc.cs : so it turned out that we cannot skip override check for
6565 interface members. Fixed bug #76954.
6567 2005-12-09 Atsushi Enomoto <atsushi@ximian.com>
6569 * cs-tokenizer.cs : fixed bug #75984:
6570 - #warning and #error should not be handled when the source line
6572 - #line is not checked strictly when the source line is disabled.
6573 - #define and #undef is on the other hand checked strictly at any
6576 2005-12-08 Atsushi Enomoto <atsushi@ximian.com>
6578 * cs-tokenizer.cs : missing Location (actually, filename) in one of
6581 2005-12-05 Marek Safar <marek.safar@seznam.cz>
6583 * attribute.cs (GlobalAttribute.ctor): Pass NamespaceEntry only.
6585 * class.cs (EmitFieldInitializers): Simplified and fixed to work with
6587 (FieldBase.EmitInitializer): Moved from TypeContainer and simplified.
6588 (FieldBase.Initializer): Initializer is now optional.
6589 (EventField.Define): Only event field can have initializer.
6591 * codegen.cs (EmitContext): DeclSpace is not readonly (small hack).
6593 * const.cs (Const): Reuse initializer.
6595 * cs-parser.jay: Updated after FieldBase changes.
6596 Added current_array_type to simplify array initializers.
6598 * ecore.cs (NullCast.IsDefaultValue): Implemented.
6600 * expression.cs, iterators.cs: Updated.
6602 * namespace.cs (NamespaceEntry): Made UsingFound private.
6604 2005-12-05 Marek Safar <marek.safar@seznam.cz>
6606 * parameterCollection.cs: Obsolete, removed.
6607 * parser.cs: Obsolete, removed.
6609 2005-12-05 Marek Safar <marek.safar@seznam.cz>
6612 * class.cs (Constructor.Emit): Set obsolete checking for whole context.
6614 * enum.cs (Enum.Define): Set obsolete context here.
6616 2005-12-05 Atsushi Enomoto <atsushi@ximian.com>
6619 - FindDocumentedMember() now expects 1) paramList as null
6620 when "we don't have to check the number of parameters" and
6621 2) Type.EmptyTypes when "there is no arguments".
6622 - Introduced FoundMember struct to hold the exact type which was
6623 used to find the documented member (the above change broke
6624 test-xml-044; it might be better just to use DeclaringType than
6625 what MS does, like this change does, but it depends on usage.)
6627 2005-12-05 Atsushi Enomoto <atsushi@ximian.com>
6629 * doc.cs : documented member might be from DeclaringType for nested
6630 types. Fixed bug #76782.
6632 2005-12-03 Ben Maurer <bmaurer@ximian.com>
6634 * anonymous.cs: Have the param code handle leaving copies on the
6635 stack etc. Allows anonymous params to take part in the assignment
6636 code (++, +=, etc). Fixes bug #76550
6638 * expression.cs: Handle the prepare_for_load/leave_copy by passing
6639 it down to the anon code.
6641 * iterators.cs: Use dummy var here
6643 * codegen.cs: Handle new vars
6645 2005-12-01 Marek Safar <marek.safar@seznam.cz>
6648 * class.cs (MethodData.Define): Set proper Obsolete context.
6650 * ecore.cs (FieldExpr.ResolveMemberAccess): Don't check [Obsolete] in
6652 (FieldExpr.DoResolve): Ditto.
6654 2005-12-01 Marek Safar <marek.safar@seznam.cz>
6657 * class.cs (MethodCore.DoDefineParameters): Test [Obsolete] only when
6658 parent is not obsolete.
6660 2005-12-01 Atsushi Enomoto <atsushi@ximian.com>
6662 * doc.cs : (FindDocumentedMember) find parameterless members first
6663 and get CS0419 in the early stage. Fixed first case of bug #76727.
6665 2005-11-30 Marek Safar <marek.safar@seznam.cz>
6668 * ecore.cs (Expression.ResolveAsConstant): Report constant error only when
6669 no error was reported.
6671 *expression.cs (Binary.DoResolve): left can be null.
6673 2005-11-22 Marek Safar <marek.safar@seznam.cz>
6676 * class.cs (MethodData.Emit): Parameters should be labeled first.
6678 2005-11-21 Marek Safar <marek.safar@seznam.cz>
6681 * parameter.cs (Parameter.ApplyAttributeBuilder): Fixed `ref' detection.
6683 2005-11-18 Marek Safar <marek.safar@seznam.cz>
6685 * attribute.cs (AreParametersCompliant): Moved to Parameter.
6687 * class.cs (MethodCore): Parameter clean up.
6688 (IMethodData): Added ParameterInfo.
6689 (MethodData): Parameter clean up.
6690 (Indexer.Define): Parameter clean up.
6702 * typemanager.cs: Parameter clean up.
6704 * delegate.cs (Define): Get rid of duplicated code.
6706 * expression.cs (ParameterReference): Removed useless parameters
6708 (Invocation): Ditto.
6710 * parameter.cs (ParamsParameter): New class, params specialization.
6711 (ArglistParameter): Attemp to separate arglist.
6712 (Parameter): Refactored to be reusable and faster.
6713 (Parameter.Modifier): Made understandable.
6714 (Parameters): Changed to be used as a class for `this' assembly
6715 parameters. Refactored to use new specialized classes.
6717 * support.cs (ParameterData): Added Types property.
6718 (InternalParameters): Deleted.
6720 2005-08-20 Martin Baulig <martin@ximian.com>
6722 Merging this patch from GMCS to fix #75867.
6724 * anonymous.cs (CaptureContext.CaptureThis): Create the topmost
6725 scope if we don't already have it.
6727 2005-11-17 Martin Baulig <martin@ximian.com>
6730 (CaptureContext.EmitMethodHostInstance): Use `Ldarg_0' if we
6731 inherit the scope from our parent. Fixes #76653.
6733 2005-11-16 Atsushi Enomoto <atsushi@ximian.com>
6735 * doc.cs : the previous patch does not actually fix the bug.
6736 PropertyInfo override check is now implemented and really fixed it.
6737 * expression.cs : Invocation.IsAncestralType() is used from doc.cs.
6739 2005-11-16 Atsushi Enomoto <atsushi@ximian.com>
6741 * doc.cs : apply "override filter" also to properties.
6744 2005-11-16 Atsushi Enomoto <atsushi@ximian.com>
6746 * doc.cs : renamed FindMembers() to FindMethodBase(). For interfaces,
6747 no need to check overrides. For classes, omit those results from
6748 interfaces since they must exist in the class. Fixed bug #76726.
6750 2005-11-15 Atsushi Enomoto <atsushi@ximian.com>
6752 * typemanager.cs : (GetFullNameSignature) differentiate indexers
6753 with different parameters. Fixed the second problem in #76685.
6755 2005-11-15 Atsushi Enomoto <atsushi@ximian.com>
6757 * doc.cs : (FindDocumentedMember) pass invocation_type as well (to
6758 get expected 'protected' access in CheckValidFamilyAccess()).
6761 2005-11-15 Atsushi Enomoto <atsushi@ximian.com>
6763 * doc.cs : (GenerateTypeDocComment) Fields could be FixedField.
6764 Fixed bug #76705. CS1569 was incorrectly commented out.
6766 2005-11-14 Atsushi Enomoto <atsushi@ximian.com>
6768 * doc.cs : use Invocation.IsOverride() to do real override check.
6769 * expression.cs : made Invocation.IsOverride() internal.
6771 2005-11-14 Atsushi Enomoto <atsushi@ximian.com>
6773 * doc.cs : use TypeManager.FindMembers() instead of (possible)
6774 TypeBuilder.FindMembers() and filter overriden base members out.
6777 2005-11-13 Atsushi Enomoto <atsushi@ximian.com>
6779 * doc.cs : ref/out parameters are represented as '@' (instead of
6780 '&' in type FullName). Fixed bug #76630 (additionally crefs).
6782 2005-11-13 Atsushi Enomoto <atsushi@ximian.com>
6784 * doc.cs : when there was no '.' in cref to methods in doc comment,
6785 then parameters were missing in the output. Fixed bug #76691.
6787 2005-11-13 Atsushi Enomoto <atsushi@ximian.com>
6789 * driver.cs : don't output docs when there is an error.
6792 2005-11-13 Atsushi Enomoto <atsushi@ximian.com>
6795 Now it should detect indexers. Fixed primary concern in bug #76685.
6796 Fixed CS0419 message to not show the identical member signature in
6799 2005-11-13 Atsushi Enomoto <atsushi@ximian.com>
6801 * doc.cs : (FindDocumentedMember) use TypeManager.MemberLookup()
6802 instead of Type.FindMembers() since it does not handle events.
6805 2005-11-12 Gert Driesen <drieseng@users.sourceforge.net>
6807 * codegen.cs: Fixed typo (speficied -> specified).
6809 2005-11-11 Marek Safar <marek.safar@seznam.cz>
6812 * doc.cs (FindDocumentedTypeNonArray): Don't resolve again.
6814 2005-11-11 Marek Safar <marek.safar@seznam.cz>
6816 * attribute.cs: Changed error message.
6818 * cs-tokenizer.cs: One more check.
6820 2005-11-10 Marek Safar <marek.safar@seznam.cz>
6822 * statement.cs (Block.Resolve): Ignore empty statement.
6824 2005-11-10 Marek Safar <marek.safar@seznam.cz>
6826 * report.cs: Made error/warning methods more strict to avoid
6829 * anonymous.cs, attribute.cs, class.cs, codegen.cs, constant.cs,
6830 convert.cs, cs-parser.jay, cs-tokenizer.cs, decl.cs, delegate.cs,
6831 doc.cs, driver.cs, ecore.cs, expression.cs, location.cs,
6832 namespace.cs, parameter.cs, statement.cs, typemanager.cs: Updated.
6834 2005-11-08 Marek Safar <marek.safar@seznam.cz>
6836 * attribute.cs (Attribute.GetCoClassAttributeValue): New method.
6837 (AttributeTester.GetCoClassAttribute): Get CoClassAttribute.
6839 * class.cs (TypeContainer.IsComImport): New property.
6840 (Constructor.Define): Create proper ctor for ComImport types.
6842 * expression.cs (New.CheckComImport): Fixed.
6844 2005-11-07 Miguel de Icaza <miguel@novell.com>
6846 * anonymous.cs (CaptureContext.AddParameterToContext): The fact
6847 that a parameter has been captured does not mean that we do not
6848 have to do the rest of the processing. This fixes the second part
6849 of #76592. If there was another anonymous method capturing
6850 values in the past, the Scope would never be set for the second
6851 method that captured the same parameter.
6853 (CaptureContext.EmitAssignParameter): When `leave_copy' is passed,
6854 properly manipulate the stack. Second part of fix for #76592.
6856 * expression.cs (New): Add support for invoking "new" on
6857 interfaces that have been flagged with the ComImport attribute and
6858 the CoClass. Fixes #76637
6860 * statement.cs (Try.DoEmit): When a variable is captured, do not
6861 try to emit the vi.LocalBuilder variable as it has been captured.
6862 Create a temporary variable and store the results on the
6863 FieldBuilder. Fixes #76642
6865 2005-11-07 Marek Safar <marek.safar@seznam.cz>
6867 * class.cs (CheckPairedOperators): Made compilable with csc 2.0.
6869 * ecore.cs (InstanceResolve): Fixed CS1540 detection.
6871 * expression.cs (Binary.DoResolve): Added && optimalization.
6873 * typemanager.cs (AddUserType): Removed useless argument.
6875 2005-11-04 Marek Safar <marek.safar@seznam.cz>
6877 * statement.cs (Block.variables): Uses ListDictionary.
6879 2005-11-03 Marek Safar <marek.safar@seznam.cz>
6882 * class.cs (PartialContainer.EmitType): Customized to emit
6883 security attributes.
6884 (ClassPart.ApplyAttributeBuilder): Transform security attribute
6885 for partial classes.
6887 2005-11-03 Marek Safar <marek.safar@seznam.cz>
6890 * expression.cs (ElementAccess.DoResolveLValue): Fixed buffer
6891 access has to be fixed.
6893 * typemanager.cs (IsUnmanagedType): Wrong common field type.
6895 2005-11-01 Marek Safar <marek.safar@seznam.cz>
6898 * ecore.cs (NullCast.Reduce): Implemented.
6900 * expression.cs (ArrayCreation.CheckIndices): Correcly check
6903 * statement.cs (SwitchLabel.ResolveAndReduce): Catch null
6905 (Foreach.Resolve): Catch null properly.
6907 2005-10-29 Marek Safar <marek.safar@seznam.cz>
6909 * cs-tokenizer.cs: Warning text fix.
6911 * driver.cs: AllWarningNumbers exposed on public interface.
6913 * report.cs (): Reviewed warning numbers.
6914 (IsValidWarning): Use binary search.
6916 2005-10-29 Marek Safar <marek.safar@seznam.cz>
6918 * driver.cs: Implemeted resource visibility.
6919 (Resources): New class for code sharing between /res: and
6922 2005-10-28 Marek Safar <marek.safar@seznam.cz>
6925 * cfold.cs (ConstantFold.BinaryFold): Implemented null cast
6928 * convert (Convert.ImplicitReferenceConversion): NullCast holds
6931 * ecore.cs (NullCast): Child is contant only.
6933 * literal.cs (NullLiteral.Reduce): null can be converted to any
6936 2005-10-28 Kornél Pál <kornelpal@hotmail.com>
6938 * driver.cs: Use Encoding.Default as default code page instead
6941 2005-10-27 Raja R Harinath <rharinath@novell.com>
6944 * expression.cs (Invocation.Error_InvalidArguments): Handle
6945 __arglist parameters.
6946 (Invocation.VerifyArgumentsCompat): Likewise.
6947 * support.cs (ReflectionParameters.GetSignatureForError): Print
6948 __arglist parameters.
6949 (InternalParamters.GetSignatureForError): Likewise.
6950 * parameter.cs (Parameters.GetSignatureForError): Likewise.
6952 2005-10-26 Marek Safar <marek.safar@seznam.cz>
6954 * attribute.cs (GetPropertyValue): Made public.
6956 * codegen.cs (AssemblyClass): ResolveClsCompliance renamed to
6958 Add new property WrapNonExceptionThrows to handle 2.0 assembly
6960 (AssemblyClass.Emit): Emit RuntimeCompatibilityAttribute when it
6963 * driver.cs: Reflect method name change.
6965 * statement.cs (Try.Resolve): Warn when try has both general
6968 * typemanager.cs: runtime_compatibility_attr_type new predefined
6971 2005-10-26 Raja R Harinath <harinath@gmail.com>
6974 * pending.cs (InterfaceMethod): Allow tm.args [i] to be null --
6975 treat it as an empty parameter list.
6977 2005-10-26 Raja R Harinath <rharinath@novell.com>
6980 * ecore.cs (SimpleName.DoSimpleNameResolve): Make fall-back
6981 ResolveAsTypeStep silent.
6982 * statement.cs (Block.AddConstant): Mark block as used.
6983 (Block.ResolveMeta): Avoid piling on error messages
6984 if a constant initializer resolution fails.
6986 2005-10-25 Raja R Harinath <rharinath@novell.com>
6988 * namespace.cs (RootNamespace.VerifyUsingForAll, Namespace.VerifyUsing):
6990 (NamespaceEntry.VerifyAllUsing): New.
6991 (NamespaceEntry.AliasEntry.Resolve): New. Handles common error
6992 behaviour. Delegates actual resolution of alias to ...
6993 (NamespaceEntry.DoResolve): ... this. Renamed from Resolve.
6994 (NamespaceEntry.LocalAliasEntry, NamespaceEntry.ExternAliasEntry):
6996 * driver.cs (Driver.MainDriver): Update.
6998 * namespace.cs (NamespaceEntry.DefineNamespace): Remove.
6999 (NamespaceEntry.SymbolFileID): Make into a on-demand computed
7001 (Namespace.DefineNamespaces, RootNamespace.DefineNamespacesForAll):
7003 * symbolwriter.cs (SymbolWriter.Initialize): Don't call
7004 RootNamespace.DefineNamespacesForAll.
7006 2005-10-24 Raja R Harinath <harinath@gmail.com>
7008 * typemanager.cs (assemblies, external_aliases, modules)
7009 (AddAssembly, AddExternAlias, AddModule GetAssemblies, Modules)
7010 (ComputeNamespaces, GetRootNamespace): Remove extra staging
7011 overhead. Move resposibility ...
7012 * namespace.cs (GlobalRootNamespace): ... here. Update to changes.
7013 * driver.cs, attribute.cs, codegen.cs: Update to changes.
7015 2005-10-23 Raja R Harinath <harinath@gmail.com>
7017 * namespace.cs (RootNamespace.all_namespaces): Renamed from
7018 cached_namespaces. Improve usage.
7019 (RootNamespace.Reset, RootNamespace.RegisterNamespace)
7020 (RootNamespace.VerifyUsingForAll, RootNamespace.DefineNamespacesForAll):
7021 Move from GlobalRootNamespace and simplify.
7022 (RootNamespace.Global): Make instance variable.
7023 (RootNamespace.RootNamespace): Add "alias name" parameter.
7024 (GlobalRootNamespace): Simplify drastically.
7025 (Namespace.Lookup): Don't use GetNamespace.
7026 * typemanager.cs (GetRootNamespace): Rename from
7027 ComputeNamespaceForAlias.
7028 (NamespaceClash): Use Global.IsNamespace instead of GetNamespace.
7030 2005-10-23 Marek Safar <marek.safar@seznam.cz>
7032 * anonymous.cs (AnonymousContainer): Don't crash when container
7035 2005-10-23 Marek Safar <marek.safar@seznam.cz>
7037 * expression.cs (Binary.DoResolve): Warn when comparing same
7040 2005-10-23 Marek Safar <marek.safar@seznam.cz>
7043 * expression.cs (Binary.DoResolve): It looks like there are no
7044 convetsion rules in enum context.
7046 2005-10-19 Carlos Alberto Cortez <calberto.cortez@gmail.com>
7048 Add support for extern alias qualifiers.
7049 * typemanager.cs: Move some LookupTypeReflection code
7050 to namespace.cs, to have cleaner code. Added some methods
7051 to help us keep track of the extern aliased references.
7052 * driver.cs: Add suport for extern alias assemblies on command
7053 line and check for their warnings/errors. Also keep track of the
7054 extern aliased assemblies.
7055 * namespace.cs: Move the global functionality of Namespace
7056 to GlobalRootNamespace/RootNamespace. Now the global namespace
7057 is GlobalRootNamespace.Globa. Also the code moved from
7058 typemanager.cs lives in GlobalRootNames.cs/RootNamespace.cs.
7059 Finally added LocalAliasEntry (AliasEntry before) and
7060 ExternAliasEntry, to handle alias statements.
7061 * cs-parser.jay: Add support in the grammar for extern alias
7063 * doc.cs, delegate.cs, expression.cs ecore.cs, symbolwriter.cs:
7064 Update callings to Namespace (now in GlobalRootNamespace).
7066 2005-10-18 Raja R Harinath <rharinath@novell.com>
7069 * class.cs (TypeContainer.DefineType): Move updating of
7070 topological sort earlier in the code.
7071 * decl.cs (DeclSpace.ResolveBaseTypeExpr): Don't use TypeBuilder.
7073 2005-10-18 Marek Safar <marek.safar@seznam.cz>
7076 * cfold.cs (BinaryFold): Reduce constant in enum conversion.
7078 * constant.cs (Constant.TryReduce): Moved from Cast class.
7079 (Reduce): Made little bit more OO and fixed missing conversions.
7081 * ecore.cs (Reduce): Implemented.
7082 (Binary.EnumLiftUp): New method to upgrade values to enum values.
7084 * literal.cs (Reduce): Implemented.
7086 * class.cs: Reverted Miguel's wrong commit.
7088 2005-10-14 Miguel de Icaza <miguel@novell.com>
7090 * ecore.cs (GetMemberType): Report the correct mapping for the MemberCore
7092 2005-10-14 Atsushi Enomoto <atsushi@ximian.com>
7094 * cs-parser.jay, expression.cs : CS0214 was missing error location
7095 for constants. Fixed bug #76404.
7097 2005-10-11 Marek Safar <marek.safar@seznam.cz>
7100 * convert.cs (ExplicitConversionCore): Fixed object->enum
7103 2005-10-10 Raja R Harinath <rharinath@novell.com>
7105 * ecore.cs (PropertyExpr.Emit): Use Invocation.EmitCall to emit
7107 (PropertyExpr.EmitCall): Likewise.
7108 * expression.cs (Invocation.EmitArguments): Handle case where
7110 (Invocation.EmitCall): Avoid allocating temporary variable if
7111 there are no arguments.
7113 2005-10-07 Raja R Harinath <rharinath@novell.com>
7116 * convert.cs (ImplicitConversionStandard): Move conversion of
7117 void* to arbitrary pointer types ...
7118 (ExplicitConversionStandard): .. here.
7119 * ecore.cs (Expression.Error_ValueCannotBeConverted): Fix CS0266
7120 error to always print typenames.
7122 2005-10-07 Raja R Harinath <rharinath@novell.com>
7124 * convert.cs (GetConversionOperator): Rename from
7125 GetConversionOperators. Move operator selection code from ...
7126 (UserDefinedConversion): ... here.
7128 2005-10-06 Marek Safar <marek.safar@seznam.cz>
7130 * convert.cs (ExplicitConversionCore): Removed duplicate enum
7133 2005-10-05 Marek Safar <marek.safar@seznam.cz>
7135 * assign.cs (Assign.DoResolve): Error method changed.
7137 * cfold.cs (DoConstantNumericPromotions): Error method changed.
7139 * const.cs (ResolveValue): Reset in_transit immediately.
7141 * constant.cs: Error method changed.
7143 * convert.cs: Removed useless location parameter.
7144 (ExplicitNumericConversion): Don't do double enum check.
7145 (ExplicitConversionCore): Renamed from ExplicitConversion.
7146 (ExplicitUnsafe): Extracted from ExplicitConversion.
7147 (ExplicitConversion): Uses for error reporting.
7149 * ecore.cs (Error_ValueCannotBeConverted): More logic for more
7151 (ResolveBoolean): Uses common error method.
7152 (CastToDecimal): Get rid of ec.
7153 (CastFromDecimal): Optimized.
7154 (ConvCast): Get rid of ec.
7156 * enum.cs (ResolveValue): Reset in_transit immediately.
7157 (Emit): Return after first error.
7159 * expression.cs: Convert changes.
7161 * literal.cs: Error method changed.
7163 * statement.cs: Error method changed.
7165 2005-10-03 Raja R Harinath <rharinath@novell.com>
7167 * support.cs (SeekableStreamReader.Position): Don't error out when
7168 the requested position is just beyond the end of the current
7171 2005-09-28 Raja R Harinath <rharinath@novell.com>
7173 * support.cs (SeekableStreamReader): Simplify drastically. Don't
7174 try to keep in sync with the byte count of the underlying Stream.
7175 However, this limits us to a window size of 2048 characters: i.e.,
7176 the maximum lookahead of our lexer/parser can be 2048 characters.
7178 2005-09-28 Marek Safar <marek.safar@seznam.cz>
7181 * driver.cs: Fix compilation files with full root path.
7183 2005-09-25 Miguel de Icaza <miguel@novell.com>
7185 * report.cs (SymbolRelatedToPreviousError): Format the output so
7186 it does not use an open parenthesis that is never closed.
7188 * driver.cs: Follow coding guidelines
7190 2005-09-27 Marek Safar <marek.safar@seznam.cz>
7193 * const.cs (Const.ResolveValue): Check for assigning non-null
7194 value to reference type.
7196 2005-09-27 Marek Safar <marek.safar@seznam.cz>
7198 * anonymous.cs: Implemented ExprClassName.
7200 * assign.cs (Assign.DoResolve): Don't chrash when type is not
7203 * attribute.cs (ResolveArguments): Enabled MethodImplOptions
7206 * class.cs (StaticClass.DefineContainerMembers): Report protected
7209 * codegen.cs: if(ed) PRODUCTION.
7211 * convert.cs (Error_CannotImplicitConversion): Better error
7214 * cs-parser.jay: More error checks.
7216 * cs-tokenizer.cs (consume_identifier): Fixed Miguel's revert.
7218 * driver.cs (CSCParseOption): Enabled wrong option check.
7220 * ecore.cs (Expression.ExprClassName): Turned to property.
7221 (MemberExpr.CheckIntermediateModification): For checking boxed
7222 value types modification.
7224 * statement.cs (Fixed.Resolve): Expression type must be
7225 convertible to fixed type.
7226 (CollectionForeach.GetEnumeratorFilter,TryType):
7227 Small refactoring for easier error checking.
7229 2005-09-26 Marek Safar <marek.safar@seznam.cz>
7231 * attribute.cs (Attribute.Resolve): Check Obsolete attribute for
7234 * class.cs (GeneratedBaseInitializer): New class for customization
7235 compiler generated initializers.
7236 (MemberBase.DoDefine): Check Obsolete attribute here.
7237 (FieldMember.DoDefine): Ditto.
7239 * const.cs (ExternalConstant.CreateDecimal): Builder for decimal
7242 * decl.cs (MemberCore.EmitContext): Returns valid current ec.
7243 (MemberCore.GetObsoleteAttribute): Removed argument.
7244 (MemberCore.CheckObsoleteness): Obsolete attributes are hierarchic.
7245 (MemberCore.CheckObsoleteType): New helper.
7249 * statement.cs: Updates after MemberCore changes.
7251 * ecore.cs (TypeExpr.ResolveType): Check type obsoleteness here.
7252 (FieldExpr.ResolveMemberAccess): Fixed decimal constants checks.
7254 * expression.cs (ComposedCast.DoResolveAsTypeStep): Don't check
7255 obsolete attribute for compiler construct.
7256 (As.DoResolve): Cache result.
7258 * iterators.cs (Define_Constructor): Use GeneratedBaseInitializer.
7260 2005-09-26 Raja R Harinath <rharinath@novell.com>
7263 * expression.cs (This.VerifyFixed): In a value type T, the type of
7264 'this' is T&, iow, 'this' is either an out or ref parameter. In a
7265 value type R, 'this' is treated as a value parameter.
7267 2005-09-22 Miguel de Icaza <miguel@novell.com>
7269 * statement.cs (Lock): Use the TemporaryVariable class instead of
7270 manually using local variables as those do not work when variables
7273 * ecore.cs: Moved the TemporaryVariable class from being a nested
7274 class inside Foreach to be a public class that can be employed in
7277 2005-09-19 Marek Safar <marek.safar@seznam.cz>
7279 * cs-parser.jay: interface_accessors replaced by
7280 accessor_declarations.
7282 * ecore.cs, literal.cs, statement.cs: NullLiteral holds null
7285 * statement.cs (GotoCase.Resolve): Convert null constant to
7287 (SwitchLabel.ResolveAndReduce): Ditto.
7288 (SwitchLabel.NullStringCase): Custom null stamp.
7289 (Switch.SimpleSwitchEmit): Fix from NullLiteral to NullStringCase.
7291 typemanager.cs (CSharpSignature): Don't skip first argument
7294 2005-09-18 Miguel de Icaza <miguel@novell.com>
7296 * driver.cs: Set InEmacs based on the environment variable EMACS.
7298 * location.cs (InEmacs): in this mode, do not report column
7299 location as it confuses Emacs.
7301 2005-09-16 Marek Safar <marek.safar@seznam.cz>
7303 * cfold.cs, constant.cs, convert.cs, ecore.cs,
7304 expression.cs, iterators.cs, literal.cs: Store constants and
7307 * class.cs (MemberBase.ShortName): Pass location.
7309 * cs-parser.jay: Some location fixes.
7311 * ecore.cs (Expression.Location): Made virtual.
7313 2005-09-05 Miguel de Icaza <miguel@novell.com>
7315 * expression.cs (Cast.TryReduce): Only reduce to an EnumConstant
7316 if the underlying types are the same, otherwise we need to produce
7317 code that will do the proper cast.
7319 This was exposed by Marek's constant rewrite which produced
7320 invalid code for the call site:
7323 void Method (X v) {}
7327 This fixes test-49.cs
7329 2005-09-05 Atsushi Enomoto <atsushi@ximian.com>
7331 * attribute.cs : (Attribute.IsValidArgumentType): array of string/
7332 Type/Object should be allowed as well. Fixed bug #75968.
7334 2005-09-05 Atsushi Enomoto <atsushi@ximian.com>
7336 * expression.cs : (Binary.DoResolve): when one is enum constant and
7337 another is constant 0, then return enum one *as enum type*.
7340 2005-09-02 Raja R Harinath <rharinath@novell.com>
7342 * attribute.cs (GetMarshal): Work even if "DefineCustom" is
7346 * ecore.cs (SimpleNameResolve.DoSimpleNameResolve): Disable
7347 flow-branching for LocalVariableReferences in case we were invoked
7348 from a MemberAccess.
7349 * expression.cs (LocalVariableReference.VerifyAssigned): New.
7351 (LocalVariableReference.DoResolveBase): ... this.
7352 (MemberAccess.Resolve): Do the check that was disabled during
7355 2005-09-01 Atsushi Enomoto <atsushi@ximian.com>
7358 (PartialContainer.Create): check abstract/sealed/static strictly
7359 but abstract/sealed can exist only at one side. Fixed bug #75883.
7361 2005-09-01 Kornél Pál <kornelpal@hotmail.com>
7364 * attribute.cs (Attribute.GetMarshal): If ArraySubType is not
7365 specified, don't default to UnmanagedType.I4.
7367 2005-09-01 Atsushi Enomoto <atsushi@ximian.com>
7369 * expression.cs : conditional operator should check possibly
7370 incorrect assign expression. Fixed bug #75946.
7372 2005-08-31 Atsushi Enomoto <atsushi@ximian.com>
7374 * cs-tokenizer.cs, cs-parser.jay, driver.cs, support.cs :
7375 Reverting the change. gmcs is much complex than mcs on this matter.
7377 2005-08-31 Atsushi Enomoto <atsushi@ximian.com>
7379 * cs-tokenizer.cs : To read another token ahead of the actual
7380 consumption, use new SavedToken and cache token instead of moving
7381 back the stream with SeekableStreamReader (it seemed problematic).
7383 driver.cs : Thus use StreamReader directly.
7384 * support.cs : Thus removed SeekableStreamReader.
7386 2005-08-30 Raja R Harinath <rharinath@novell.com>
7389 * anonymous.cs (ScopeInfo.MakeFieldName): New helper.
7390 (ScopeInfo.EmitScopeType): Use it to construct field names from
7391 names of captured locals.
7394 * ecore.cs (BoxedCast.BoxedCast) [1-argument variant]: Remove.
7395 * convert.cs (ImplicitReferenceConversion, TryImplicitIntConversion):
7396 Pass 'target_type' to BoxedCast. Don't default to 'object'.
7397 (ExplicitConversion): Remove enum cases already handled by
7398 implicit conversion. Move implicit conversion check to the beginning.
7399 * delegate.cs (DelegateCreation.ResolveMethodGroupExpr): Update.
7400 * expression.cs (ArrayCreation.EmitDynamicInitializers):
7401 Don't treat System.Enum as a struct.
7403 2005-08-30 Jb Evain <jbevain@gmail.com>
7405 * attribute.cs: handles as expression in parameters.
7407 2005-08-30 Raja R Harinath <rharinath@novell.com>
7410 * class.cs (TypeContainer.VerifyClsName): Don't use a
7411 PartialContainer when verifying CLS compliance.
7412 (AbstractPropertyEventMethod): Set Parent here, ...
7413 (PropertyMethod): ... not here.
7415 2005-08-30 Atsushi Enomoto <atsushi@ximian.com>
7417 * attribute.cs : escaped attribute name should not be allowed to be
7418 resolved (e.g. @class as classAttribute). Fixed bug #75930.
7420 2005-08-29 Raja R Harinath <rharinath@novell.com>
7423 * convert.cs (ImplicitStandardConversionExists): Allow zero also
7424 when converting a long constant to unsigned long.
7425 * expression.cs (Invocation.OverloadResolve): Add sanity check to
7426 detect where IsApplicable and VerifyArgumentsCompat disagree.
7428 2005-08-29 Raja R Harinath <rharinath@novell.com>
7429 and Carlos Alberto Cortez <carlos@unixmexico.org>
7432 * class.cs (TypeContainer.CanElideInitializer): New helper.
7433 (TypeContainer.EmitFieldInitializers): Use it to determine if we
7434 can safely emitting the initializer of a field.
7436 2005-08-25 Atsushi Enomoto <atsushi@ximian.com>
7438 * statement.cs : (Continue.Resolve()) Unlike break, continue is not
7439 allowed inside a switch (without loop). Fixed bug #75433.
7441 2005-08-26 Kornél Pál <kornelpal@hotmail.com>
7443 * AssemblyInfo.cs: Using Consts.MonoVersion instead of MonoVersion.cs.
7444 * mcs.exe.sources: Using Consts.MonoVersion instead of MonoVersion.cs.
7446 2005-08-25 Atsushi Enomoto <atsushi@ximian.com>
7448 * driver.cs : kinda reverting the default encoding changes (not exact
7449 revert since I noticed that "codepage:reset" might not work fine).
7451 2005-08-25 Atsushi Enomoto <atsushi@ximian.com>
7453 * class.cs : (AbstractPropertyEventMethod) SetupName() now takes
7454 Location. Now getter and setter store location correctly.
7455 (errors/cs0111-12.cs now reports the expected location.)
7457 2005-08-25 Atsushi Enomoto <atsushi@ximian.com>
7459 * driver.cs : Use default encoding on the environment.
7460 Removed (now that) extra parameter for SeekableStreamReader.
7461 * support.cs : (SeekableStreamReader) third .ctor() argument for
7462 StreamReader is not required (always true). preamble size could
7463 be acquired in simpler and safe way.
7465 2005-08-24 Atsushi Enomoto <atsushi@ximian.com>
7467 * cs-parser.jay: report CS0642 at warning level 3
7468 and report CS0642 for an if else statement also
7469 fixes bug #74745. Patch by John Luke (and a bit
7471 Removed extra CS0642 warning check for "while",
7473 * statement.cs: In Block.Resolve(), CS0642 check
7474 is reimplemented to check a sequence of an empty
7475 statement and a block.
7477 Both fix bug #66777.
7479 2005-08-24 Marek Safar <marek.safar@seznam.cz>
7481 * attribute.cs (GetMethodObsoleteAttribute): Disabled obsolete properties
7482 detection until I fix it.
7484 * cs-tokenizer.cs: Changed error message.
7486 * cs-parser.jay: Fixed 2 error locations.
7488 * ecore.cs (Error_TypeDoesNotContainDefinition): Share error message.
7489 (PropertyExpr.Error_PropertyNotFound): First attempt to detect non C#
7492 * enum.cs (GetSignatureForError): Fixed.
7494 * expression.cs (Invocation.IsSpecialMethodInvocation): Improved special
7498 * typemanager.cs (RegisterProperty): Removed.
7500 * statement.cs (CheckInvariantMeaningInBlock): Changed error message.
7502 2005-08-24 Raja R Harinath <rharinath@novell.com>
7505 * expression.cs (ArrayAccess.EmitLoadOpcode): Emit ldelem.i for pointers.
7506 (ArrayAccess.GetStoreOpcode): Return stelem.i for pointers.
7508 2005-08-23 Atsushi Enomoto <atsushi@ximian.com>
7510 * expression.cs : tiny fix is required for not warning positive ulong.
7513 2005-08-23 Atsushi Enomoto <atsushi@ximian.com>
7515 * expression.cs : add CS0652 check for constant and integral
7516 expression. Fixed bug #53974.
7518 2005-08-23 Atsushi Enomoto <atsushi@ximian.com>
7520 * expression.cs : in DoNumericPromotions(), check if there is implicit
7521 conversion overload for string (to check CS0034). Fixed bug #52492.
7523 2005-08-23 Atsushi Enomoto <atsushi@ximian.com>
7525 * cs-tokenizer.cs : Check newline in char constant. Fixed bug #75245.
7527 2005-08-23 Atsushi Enomoto <atsushi@ximian.com>
7529 * ecore.cs : report location when it is *not* Null.
7531 2005-08-23 Atsushi Enomoto <atsushi@ximian.com>
7537 Added OmitStructFlowAnalysis to EmitContext to handle CS0165 check
7538 correctly. Fixed bug #75721.
7540 2005-08-23 Raja R Harinath <rharinath@novell.com>
7542 * support.cs (SeekableStreamReader.Position): Avoid an expensive
7543 loop that performs 'min (pos, char_count)'.
7546 * expression.cs (Unary.ResolveOperator): Don't discard implicit
7547 converted value in Operator.OnesComplement.
7549 2005-08-22 Ben Maurer <bmaurer@ximian.com>
7551 * anonymous.cs: If the anon method is pulled into a helper class,
7552 it needs to be `internal' not `private'. Fixes runtime behavior on
7555 2005-08-20 Martin Baulig <martin@ximian.com>
7557 * anonymous.cs (CaptureContext.CaptureThis): Create the topmost
7558 scope if we don't already have it.
7560 * expression.cs (Invocation.EmitCall): Use `ec.EmitThis ()' rather
7561 than `ig.Emit (OpCodes.Ldarg_0)' to make it work inside iterators;
7564 2005-08-17 Marek Safar <marek.safar@seznam.cz>
7567 * decl.cs (DeclSpace.VerifyClsCompliance): Skip when collision object
7570 2005-08-16 Marek Safar <marek.safar@seznam.cz>
7572 The big constants rewrite
7573 Fix #75746, #75685 and more
7574 As a side effect saved 1MB for MWF ;-)
7576 * attribute.cs (GetAttributeArgumentExpression): Use ToType, GetTypedValue.
7577 (GetMarshal, GetMethodImplOptions, GetLayoutKindValue): Values are not
7578 enum based for corlib compilation.
7580 * cfold.cs (BinaryFold): Convert operand for enum additions. Fixed enum
7583 * class.cs (FixedField.Define): Use ResolveAsConstant.
7585 * const.cs (IConstant): Interface constants and enums.
7586 (Const.ResolveValue): New method for constant resolvning.
7587 (ExternalConstant): Constants from imported assemblies.
7589 * constant.cs (Constant.GetTypedValue): Used to get constant with forced
7590 conversion; like enums.
7591 (Constant.ToType): Converts this constant to different type.
7592 (Constant.Increment): Adds 1.
7594 * convert.cs (ImplicitConversionRequired): Simplified.
7596 * cs-parser.jay: Create EnumMember directly.
7598 * decl.cs (MemberCore.CheckObsoleteness): Checks for ObsoleteAttribute presence.
7600 * doc.cs (GenerateEnumDocComment): Removed.
7602 * ecore.cs (Expression.ResolveAsConstant): New constant specific method.
7603 (ConvertIntLiteral): Removed.
7604 (FieldExpr.ResolveMemberAccess): Refactored to remove constant specific if(s).
7606 * enum.cs (EnumMember): Implement IConstant.
7607 (Enum.IsValidEnumConstant): Removed.
7608 (Enum.GetNextDefaultValue): Removed.
7609 (Enum.FindMembers): Updated.
7610 (Enum.GenerateDocComment): Iterate enum members.
7612 * expression.cs (Cast.TryReduce): Handle enums correctly.
7613 (New.Constantify): Made public.
7614 (MemberAccess.DoResolve): Removed contant specific if(s).
7616 * literal.cs (NullLiteral): Implement new abstract methods.
7618 * statement.cs (GotoCase.Resolve): Use new constant methods.
7619 (SwitchLabel.ResolveAndReduce): Use new constant methods.
7621 * typemanager.cs (LookupEnum): Removed.
7622 (IsEnumType): Fixed to work with corlib.
7623 (RegisterConstant): Removed.
7624 (LookupConstant): Removed.
7625 (GetConstant): Changed to work with IConstant.
7627 2005-08-04 Atsushi Enomoto <atsushi@ximian.com>
7629 * location.cs : Fixed overflown (>255) column number.
7631 2005-08-03 Raja R Harinath <rharinath@novell.com>
7633 First cut of the qualified-alias-member feature.
7634 * cs-tokenizer.cs (Tokenizer.is_punct): Recognize the double-colon
7636 * cs-parser.jay (DOUBLE_COLON): New token.
7637 (namespace_or_type_name): Add rule for recognizing
7638 qualified-alias-members.
7639 (primary_expression): Likewise.
7640 (element_access): Allow QualifiedAliasMember as a possible
7641 type-bearing expression.
7642 (local_variable_type, local_variable_pointer_type): Likewise.
7643 * namespace.cs (NamespaceEntry.LookupAlias): New. Looks up
7644 aliases in the current and enclosing namespace declarations.
7645 (NamespaceEntry.UsingAlias): Add CS0440 warning.
7646 * decl.cs (MemberName.is_double_colon): New.
7647 (MemberName.MemberName): Add new constructor for alias-member.
7648 (MemberName.GetTypeExpression): Generate QualifiedAliasMember too.
7649 * expression.cs (QualifiedAliasMember): New expression type.
7651 2005-08-02 Atsushi Enomoto <atsushi@ximian.com>
7653 * location.cs : it borked when no argument was specified.
7655 2005-08-02 Atsushi Enomoto <atsushi@ximian.com>
7657 * location.cs : tiny ToString() format fix.
7659 2005-08-02 Atsushi Enomoto <atsushi@ximian.com>
7661 * statement.cs : oops, it was missing.
7663 2005-08-02 Atsushi Enomoto <atsushi@ximian.com>
7665 A set of fixes for precise line/column location.
7668 "token" field now holds a file/line "delta", a line number offset
7669 from the segment, and a column number. See also:
7670 http://lists.ximian.com/pipermail/mono-devel-list/2004-
7671 December/009508.html
7672 Removed static IsNull. Use instance IsNull property instead.
7674 For some tokens it stores Location. For Identifier it stores
7675 LocatedToken which is a pair of string name and location.
7676 Column numbers are adjusted only at getChar().
7678 Use Location.ToString() for reporting (it now contains column).
7680 Largely modified to use LocatedToken instead of
7681 string (IDENTIFIER), and to acquire Location from some tokens.
7682 * namespace.cs, decl.cs, ecore.cs, class.cs, delegate.cs,
7683 iterators.cs, const.cs, anonymous.cs, tree.cs, enum.cs,
7685 Now MemberName holds Location. DeclSpace.ctor() receives Location
7686 as a parameter. Removed extra parameters to all derived classes.
7687 Replaced Location.IsNull() with instance property.
7688 * assign.cs, expression.cs :
7689 Added .ctor() overload that omits Location.
7691 Added "nameEscaped" flag that indicates the identifier was escaped
7692 in the source file. This fixes bug #57047.
7694 2005-08-02 Marek Safar <marek.safar@seznam.cz>
7696 * attribute.cs (AttributeTester.GetImportedIgnoreCaseClsType):
7697 New method, looking for lo-case imported cls type.
7699 * decl.cs (DeclSpace.VerifyClsCompliance): Check CS3005 for types
7702 * driver.cs: Removed VerifyTopLevelNameClsCompliance usage.
7704 * enum (Enum.VerifyClsCompliance): Hardcode non-compliant types.
7706 * typemanager.cs (TypeManager.AllClsTopLevelTypes): Renamed from
7708 (TypeManager.LoadAllImportedTypes): Lo-case imported types.
7710 Optimized to save 3.5 MB for SWF compilation.
7712 2005-08-01 Marek Safar <marek.safar@seznam.cz>
7714 * class.cs (AddToTypeContainer): Use inheritance insted of if(s).
7715 (PartialContainer.Create): Moved logic AddToContainer.
7716 (PartialContainer.MarkForDuplicationCheck): Shares name.
7718 * decl.cs (DeclSpace.AddToContainer): Check name collisions at one
7721 * namespace.cs (Namespace.AddDeclSpace): Lazy declspaces
7723 (Namespace.GetSignatureForError): New method.
7725 * tree.cs (Tree.RecordDecl): Moved to AddToContainer.
7726 (RootTypes.AddToTypeContainer): se inheritance insted of if(s).
7728 2005-08-01 Raja R Harinath <rharinath@novell.com>
7731 * ecore.cs (Expression.MemberLookupFailed): Use queried_type for
7732 member lookup rather than qualifier_type, since qualifier_type can
7735 2005-08-01 Marek Safar <marek.safar@seznam.cz>
7737 * enum.cs (Enum.VerifyClsName): Fixed to allow not CLSCompliant
7740 2005-07-31 Miguel de Icaza <miguel@novell.com>
7742 * statement.cs: Copy the local exception into the exception
7743 captured local. Fixes 75674
7745 2005-07-31 Raja R Harinath <harinath@gmail.com>
7748 * expression.cs (Invocation.OverloadResolve): Don't report error
7749 CS1501 if error CS1502 has been reported.
7750 (New.DoResolve): Delegate CS1501 reporting to
7751 Invocation.OverloadResolve.
7754 * statement.cs (Block.CheckInvariantMeaningInBlock): Verify
7755 invariant-meaning-in-block property in an enclosing block if
7758 2005-07-29 Marek Safar <marek.safar@seznam.cz>
7760 * statement.cs (SwitchLabel.ResolveAndReduce): Refactored.
7761 (SwitchLabel.Erorr_AlreadyOccurs): Share error message.
7762 (Switch.CheckSwitch): Just save 50kb for SWF.
7764 2005-07-27 Martin Baulig <martin@ximian.com>
7766 * anonymous.cs (CaptureContext.AddField): Added
7767 `AnonymousContainer am' argument; compute its toplevel scope if
7768 it's not already computed. Fixes #75649.
7770 2005-07-26 Raja R Harinath <rharinath@novell.com>
7773 * class.cs (Constructor.Emit): Reset block to null if the block
7776 2005-07-25 Marek Safar <marek.safar@seznam.cz>
7778 * class.cs (TypeContainer.VerifyMembers): Be compatible in warning 169.
7780 2005-07-25 Marek Safar <marek.safar@seznam.cz>
7782 * class.cs (MethodData.Define): Check whether accessor implementing
7783 interface is public.
7785 * driver.cs (Driver.parse): Try to be smart and check for `MZ' header.
7787 2005-07-22 Marek Safar <marek.safar@seznam.cz>
7790 * namespace.cs (LookupType): Moved same type check to...
7792 * typemanager.cs (LookupTypeReflection): Don't allow to import more types
7795 2005-07-21 Raja R Harinath <rharinath@novell.com>
7797 * namespace.cs (NamespaceLookupType): Avoid a string allocation when we
7798 already found a typebuilder.
7799 * class.cs (MethodCore.IsDuplicateImplementation): Compare
7800 MemberNames, not strings.
7802 * const.cs (Error_ExpressionMustBeConst):
7803 Rename from Error_EpressionMustBeConst.
7804 * const.cs, class.cs, statement.cd: Update.
7806 2005-07-21 Marek Safar <marek.safar@seznam.cz>
7810 * const.cs (Const.LookupConstantValue): Report missing contant expression
7812 (Error_EpressionMustBeConstant): Only one error method.
7814 * class.cs, statement.c: Updated.
7816 2005-07-20 Raja R Harinath <rharinath@novell.com>
7818 * statement.cs (Block.Flags): Add back HasVarargs.
7819 (Block.flags): Make protected.
7820 (ToplevelBlock.HasVarargs): Convert to a property that updates flags.
7822 * typemanager.cs (types, typecontainers, user_types): Remove.
7823 (UserTypes, TypeContainers): Likewise.
7824 (HandleDuplicate, AddDelegateType, AddEnumType): Likewise.
7825 (CleanUp, Reset): Update.
7826 (AddUserType): Combine variants. Now, only updates builder_to_declspace.
7827 (GetNestedType): Use Type.GetNestedType.
7828 (CoreLookupType): Take two arguments, the namespace and the
7829 basename of the type. Update to use the Namespace.Lookup
7831 (InitEnumUnderlyingTypes, InitCoreTypes): Update.
7832 (RealMemberLookup): Use IsNestedChildOf instead of playing with
7833 string concatenation and substring matches.
7834 * class.cs, enum.cs, delegate.cs: Update to changes.
7836 2005-07-20 Marek Safar <marek.safar@seznam.cz>
7838 * constant.cs (Constant.Error_ConstantValueCannotBeConverted): Moved from
7839 Expression and made virtual.
7841 * convert.cs (ImplicitReferenceConversionExists): Skip for value types.
7842 (ImplicitStandardConversionExists): Fixed `byte' typo ?
7844 * ecore.cs (Expression.Error_ConstantValueCannotBeConverted): Moved.
7846 * literal.cs (NullLiteral.Error_ConstantValueCannotBeConverted): Customize
7849 * convert.cs, ecore.cs, enum.cs: Reflect Error_ConstantValueCannotBeConverted
7852 2005-07-18 Marek Safar <marek.safar@seznam.cz>
7855 * codegen.cs (AssemblyClass.ApplyAttributeBuilder): Check whether
7856 AssemblyCultureAttribute is not used on executable.
7859 * typemanager.cs: Add System.Reflection.AssemblyCultureAttribute.
7861 2005-07-16 Raja R Harinath <rharinath@novell.com>
7864 * expression.cs (Binary.Warning_UnintendeReferenceComparison):
7865 New. Reports CS0252/CS0253.
7866 Mostly taken from preliminary patch by Duncak Mak.
7867 (Binary.DoResolveOperator): Store results of operator lookup.
7868 Use them to detect if we need to warn about unintended reference
7871 2005-07-15 Raja R Harinath <rharinath@novell.com>
7874 * namespace.cs (Namespace.Lookup): Add back location parameter.
7875 (Namespace.LookupType): Add CS0436 report. Add location parameter.
7876 * delegate.cs, ecore.cs, expression.cs: Update to changes.
7878 * codegen.cs (EmitContext.DeclSpace): Make readonly.
7879 * namespace.cs (Namespace.Lookup): Carve out type lookup into ...
7880 (Namespace.LookupType): ... this.
7881 (NamespaceEntry.GetUsingTable): Allocate only one zero-sized array
7883 * typemanager.cs (LookupTypeReflection): Remove buggy code that
7884 purported to handle pointers.
7885 (char_ptr_type, void_ptr_type): Use GetPointerType rather than
7888 2005-07-15 Marek Safar <marek.safar@seznam.cz>
7890 * expression.cs (MemberAccess.ResolveNamespaceOrType): Don't report nested
7893 2005-07-15 Raja R Harinath <rharinath@novell.com>
7895 * namespace.cs (Namespace.Lookup): Drop location parameter.
7896 (NamespaceEntry.LookupAlias): Remove. Merge into ...
7897 (NamespaceEntry.Lookup): ... this.
7898 (NamespaceEntry.Error_AmbiguousTypeReference):
7899 Move here from DeclSpace.
7900 (NamespaceEntry.LookupNamespaceOrType): Move support for dotted
7902 * ecore.cs (TypeLookupExpression.DoResolveAsTypeStep): ... here.
7903 * decl.cs (DeclSpace.ErrorAmbiguousTypeReference):
7904 Move to NamespaceEntry.
7905 * delegate.cs, expression.cs: Update to changes.
7907 2005-07-14 Marek Safar <marek.safar@seznam.cz>
7909 * attribute.cs (Attribute.ResolveAttributeType): Renamed from
7910 CheckAttributeType and refactored.
7911 (Attribute.ResolvePossibleAttributeType): Changed to reuse
7912 ResolveAsTypeTerminal error handling.
7913 (ResolveAsTypeTerminal): Introduced because of global attributes extra
7915 (GetSignatureForError): Print errors in same way.
7918 * codegen.cs: Reflect attribute GetSignatureForError change.
7921 * expression.cs: Add silent parameter to ResolveAsTypeStep.
7923 * namespace.cs (UsingEntry): Refactored to make fields private.
7926 statement.cs: Error_UnexpectedKind has extra parameter.
7928 2005-07-14 Raja R Harinath <rharinath@novell.com>
7930 * ecore.cs (IAlias): Remove.
7931 * decl.cs (DeclSpace): Don't derive from IAlias. Remove members
7932 that implement the interface.
7933 * namespace.cs (Namespace): Likewise.
7934 (Namespace.declspaces): Renamed from 'defined_names'.
7935 (Namespace.AddDeclSpace): Renamed from 'DefineName'. Take a
7936 DeclSpace instead of an IAlias.
7937 * tree.cs (Tree.AddDecl): Update.
7939 2005-07-12 Raja R Harinath <rharinath@novell.com>
7941 * statement.cs (Block.Flags); Remove HasVarargs.
7942 (Block.HasVarargs): Move to ToplevelBlock.
7943 (Block.ThisVariable, Block.AddThisVariable): Likewise.
7944 (Block.Variables): Make protected. Initialize variable hashtable
7946 (Block.AddVariable): Update.
7947 (Block.Resolve): Update to changes.
7948 (ToplevelBlock.HasVarargs): New boolean.
7949 (ToplevelBlock.ThisVariable): Move here from Block.
7950 (ToplevelBlock.AddThisVariable): Likewise.
7951 (ToplevelBlock.IsThisAssigned): New. Forwards call to this_variable.
7952 * expression.cs (This.ResolveBase): Update to changes.
7953 (ArglistAccess.DoResolve): Likewise.
7955 2005-07-11 Marek Safar <marek.safar@seznam.cz>
7958 * ecore.cs, class.cs: Use SetAssigned instead of direct access.
7960 * class.cs (TypeContainer.VerifyMembers): Distinguish between
7961 not used and not used & assigned.
7962 (FieldBase.ASSIGNED): Moved to MemberCore.Flags.
7964 2005-07-11 Marek Safar <marek.safar@seznam.cz>
7967 * expression.cs (Is.DoResolve): null is never provided type.
7969 2005-07-08 Marek Safar <marek.safar@seznam.cz>
7972 * cs-parser.jay: Less strict event error rule to catch more errors.
7974 2005-07-08 Martin Baulig <martin@ximian.com>
7976 Fix test-iter-10.cs - distinguish whether we `yield' in a property
7977 gettter (allowed) or setter (not allowed).
7979 * class.cs (Accessor): Implement IIteratorContainer.
7980 (Accessor.Yields): New public field.
7981 (PropertyBase.PropertyMethod.Define): Handle iterators on a
7985 (get_accessor_declaration, set_accessor_declaration): Set the
7986 `yields' flag on the accessor, not the property.
7987 (property_declaration): Do the iterators check on a per-accessor
7988 basis and not for the whole property.
7990 2005-07-08 Martin Baulig <martin@ximian.com>
7992 * anonymous.cs (CaptureContext.EmitParameterInstance): Correctly
7993 handle parameters in nested scopes; fixes #74808; see gtest-188.cs.
7995 2005-07-07 Marek Safar <marek.safar@seznam.cz>
7998 * attribute.cs (orig_sec_assembly): Holds original version of assembly.
7999 (ExtractSecurityPermissionSet): Cope with self referencing security
8000 attributes properly.
8002 * driver.cs (SetOutputFile): Made public property OutputFile.
8004 2005-07-07 Raja R Harinath <rharinath@novell.com>
8007 * class.cs (TypeContainer.first_nonstatic_field): Rename from
8008 has_nonstatic_fields. Make into a FieldBase pointer.
8009 (TypeContainer.AddField): Add CS0282 check.
8010 (TypeContainer.EmitType): Update.
8012 2005-07-06 Miguel de Icaza <miguel@novell.com>
8014 * cs-tokenizer.cs (consume_identifier): Do not create strings to
8015 compare if they start with __.
8017 2005-07-06 Raja R Harinath <rharinath@novell.com>
8019 * statement.cs (Switch.SwitchGoverningType): Only look at
8020 UserCasts that don't need implicit standard conversions to one of
8021 the allowed switch types (Fixes test-322.cs).
8022 (LocalInfo.Resolve): Re-enable sanity-test.
8024 2005-07-06 Marek Safar <marek.safar@seznam.cz>
8026 * cs-tokenizer.cs (consume_identifier): Detect double undescores
8028 * ecore.cs (FieldExpr.AddressOf): Changed volatile error to warning.
8030 * expression.cs (Invocation.DoResolve): Report error CS0245 here.
8032 2005-07-06 Raja R Harinath <rharinath@novell.com>
8035 * ecore.cs (SimpleName.GetSignatureForError): Add.
8036 * expression.cs (MemberAccess.DoResolve): Don't clobber 'expr' field.
8037 (MemberAccess.GetSignatureForError): Add.
8039 2005-07-05 Marek Safar <marek.safar@seznam.cz>
8041 The big error and warning messages review.
8071 * typemanager.cs: Updated.
8073 * class.cs: (MethodCore.SetYields): Moved here to share.
8074 (PropertyMethod.Define): Moved iterator setup here.
8076 * iterators.cs: Add orig_method to have full access to parent
8079 2005-07-05 Raja R Harinath <rharinath@novell.com>
8081 Make 'fixed variable' handling standards compliant. Fix #70807, #72729.
8082 * ecore.cs (IVariable.VerifyFixed): Remove 'is_expression' parameter.
8083 (FieldExpr.VerifyFixed): Ensure that the field is part of a fixed
8084 variable of struct type.
8085 * expression.cs (Unary.ResolveOperator): Update to change.
8086 (Indirection.VerifyFixed): Likewise.
8087 (LocalVariableReference.VerifyFixed): A local variable is always fixed.
8088 (ParameterReference.VerifyFixed): Value parameters are fixed.
8089 (This.VerifyFixed): Treat 'this' as a value parameter.
8090 * statement.cs (LocalInfo.IsFixed): Remove.
8092 2005-07-01 Martin Baulig <martin@ximian.com>
8094 * iterators.cs (Iterator.CapturedThisReference.Emit): Use
8095 `ec.EmitThis ()' to get the correct scope.
8097 2005-07-01 Martin Baulig <martin@ximian.com>
8099 * ecore.cs (FieldExpr.DoResolve): Don't capture the field if it's
8100 instance is a ParameterReference; fixes #75299.
8102 2005-07-01 Martin Baulig <martin@ximian.com>
8104 Reverted Marek's latest patch (r46725):
8105 - it contains structural changes which are neither mentioned in
8106 the ChangeLog nor explained anywhere; for example the additional
8107 argument of EmitContext's and Iterator's .ctor's and the
8108 TypeContainer.DefineMembers() change.
8109 - structural changes like this should go in in seperate patches
8110 and not be hidden in a huge patch which just seems to affect
8111 warnings and errors.
8112 a big and hard to understand patch.
8113 - it breaks iterators and causes regressions, for instance in
8116 2005-06-30 Raja R Harinath <rharinath@novell.com>
8119 * expression.cs (Indexers.map): Remove.
8120 (Indexers.Append): Filter out inaccessible setters and getters.
8121 (IndexerAccess.DoResolve, IndexerAccess.DoResolveLValue): Update.
8124 * ecore.cs (MemberExpr.EmitInstance): New. Add CS0120 check.
8126 (FieldExpr.EmitInstance, PropertyExpr.EmitInstance): ... these.
8127 (FieldExpr.Emit, PropertyExpr.Emit): Update.
8128 (FieldExpr.EmitAssign, PropertyExpr.EmitAssign): Update.
8129 * expression.cs (Invocation.EmitCall): Add CS0120 check.
8131 2005-06-30 Marek Safar <marek.safar@seznam.cz>
8134 * class.cs (FieldBase.GetInitializerExpression): One more field
8137 2005-06-28 Miguel de Icaza <miguel@novell.com>
8139 * pending.cs: Do not define a proxy if the base method is virtual,
8140 it will be picked up by the runtime (bug 75270).
8142 2005-06-08 Martin Baulig <martin@ximian.com>
8144 The big Iterators rewrite :-)
8146 * iterators.cs: Rewrite this to use the anonymous methods framework.
8148 * rootcontext.cs (RootContext.DefineTypes): Define Delegates
8149 before the TypeContainers; see 2test-21.cs.
8152 (TypeContainer.DefineType): Don't create a new EmitContext if we
8153 already have one (this only happens if we're an Iterator).
8154 (TypeContainer.Define): Also call Define() on all our iterators.
8155 (Method.CreateEmitContext): Added support for iterators.
8158 (AnonymousContainer): New abstract base class for `AnonymousMethod'.
8159 (AnonymousContainer.CreateMethodHost): Moved here from
8160 AnonymousMethod and made abstract.
8161 (AnonymousContainer.CreateScopeType): New abstract method.
8162 (AnonymousContainer.IsIterator): New public property.
8163 (ScopeInfo.EmitScopeType): Call CreateScopeType() on our Host to
8164 get the ScopeTypeBuilder rather than manually defining it here.
8165 (ScopeInfo.EmitScopeInstance): New public method; correctly handle
8168 * driver.cs (Driver.MainDriver): Call TypeManager.InitCodeHelpers()
8169 before RootContext.DefineTypes().
8171 * codegen.cs (EmitContext.RemapToProxy): Removed.
8172 (EmitContext.CurrentAnonymousMethod): Changed type from
8173 AnonymousMethod -> AnonymousContainer.
8174 (EmitContext.ResolveTopBlock): Protect from being called twice.
8175 (EmitContext.MapVariable, RemapParameter(LValue)): Removed.
8176 (EmitContext.EmitThis): Removed the iterators hacks; use the
8177 anonymous methods framework for that.
8180 (ToplevelBlock.Container): Make this a property, not a field.
8181 (ToplevelBlock.ReParent): New public method; move the
8182 ToplevelBlock into a new container.
8183 (Foreach.TemporaryVariable): Simplify.
8185 2005-06-05 Martin Baulig <martin@ximian.com>
8187 * statement.cs (LocalInfo.CompilerGenerated): New flag.
8188 (Block.AddTemporaryVariable): New public method; creates a new
8189 `LocalInfo' for a temporary variable.
8190 (Block.EmitMeta): Create the LocalBuilders for all the temporary
8192 (Foreach.TemporaryVariable): Use Block.AddTemporaryVariable() for
8193 non-iterator variables.
8195 2005-06-05 Martin Baulig <martin@ximian.com>
8197 * statement.cs (Foreach.TemporaryVariable): Create the
8198 LocalBuilder in the Emit phase and not in Resolve since in some
8199 situations, we don't have an ILGenerator during Resolve; see
8200 2test-19.cs for an example.
8202 2005-06-04 Martin Baulig <martin@ximian.com>
8204 **** Merged r45395 from GCS ****
8206 The big Foreach rewrite - Part II.
8208 * typemanager.cs (TypeManager.object_getcurrent_void): Replaced
8209 with `PropertyInfo ienumerator_getcurrent'.
8211 * codegen.cs (VariableStorage): Removed.
8214 (Foreach): Derive from Statement, not ExceptionStatement.
8215 (Foreach.CollectionForeach): New nested class. Moved all the code
8216 dealing with collection foreach here.
8217 (Foreach.ForeachHelperMethods): Removed.
8218 (Foreach.TemporaryVariable): Implement IMemoryLocation.
8220 2005-05-23 Martin Baulig <martin@ximian.com>
8222 * statement.cs (Try.DoResolve): Don't create a `finally' if we
8223 don't need to. Fix #75014.
8225 2005-05-20 Martin Baulig <martin@ximian.com>
8227 Merged r44808 from GMCS.
8229 * class.cs (TypeContainer.CircularDepException): Removed.
8230 (TypeContainer.DefineType): Removed the `InTransit' stuff.
8231 (TypeContainer.CheckRecursiveDefinition): Check for circular class
8232 (CS0146) and interface (CS0529) dependencies here.
8234 2005-06-21 Raja R Harinath <rharinath@novell.com>
8236 * expression.cs (Invocation.EmitCall): Fix initialization
8237 'this_call' to reflect current behaviour. Fix indentation.
8239 * convert.cs (FindMostEncompassedType): Add two trivial special
8240 cases (number_of_types == 0 || number_of_types == 1).
8241 (FindMostEncompasingType): Likewise.
8243 2005-06-17 Raja R Harinath <rharinath@novell.com>
8245 Some cleanups preparing for the fix of #75283.
8246 * ecore.cs (PropertyExpr.InstanceResolve): Tighten conditions for
8248 (EventExpr.InstanceResolve): Likewise.
8249 (EventExpr.DoResolve): Remove redundant checks.
8251 2005-06-10 Duncan Mak <duncan@novell.com>
8253 * cs-tokenizer.cs (process_directives): New flag for controlling
8254 the processing of preprocessor directives.
8255 (x_token): After seeing a '#', return Token.NONE instead of going
8256 to handle_preprocessing_directive() when not processing
8257 directives. This avoids unnecessary processing during the token peek in
8262 * cs-tokenizer.cs (handle_preprocessing_directive, xtoken): Use
8263 the existing error reporting methods instead of Report.Error.
8265 * convert.cs (priv_fmt_expr): Remove. It's not needed anymore
8266 after Raja's rewrite.
8268 2005-06-08 Miguel de Icaza <miguel@novell.com>
8270 * class.cs: Small fix.
8272 2005-06-08 Raja R Harinath <rharinath@novell.com>
8275 * class.cs (GetPartialBases): Fix return value check of
8278 2005-06-07 Raja R Harinath <rharinath@novell.com>
8280 Ensure that partial classes are registered in their enclosing
8281 namespace. Initial part of fix of #75160.
8282 * tree.cs (Tree.RecordDecl): Add new namespace argument.
8283 Register declspace with namespace here, not in
8284 DeclSpace.RecordDecl.
8285 * cs-parser.jay: Pass namespace to RecordDecl.
8286 * class.cs (PartialContainer.Create): Likewise.
8287 (ClassPart.DefineType): New sanity-check. Throws an exception if
8289 * decl.cs (Declspace.RecordDecl): Remove.
8290 * namespace.cs (NamespaceEntry.DefineName): Remove.
8292 2005-06-06 Marek Safar <marek.safar@seznam.cz>
8294 * rootcontext.cs: Reset TargetExt as well.
8296 2005-06-03 Raja R Harinath <rharinath@novell.com>
8298 * ecore.cs (Expression.Resolve): Emit CS0654 error when
8301 2005-06-02 Raja R Harinath <rharinath@novell.com>
8303 Fix #75080, cs0119.cs.
8304 * ecore.cs (Expression.ExprClassToResolveFlags): New. Broken out
8306 (Expression.Resolve): ... this. Use it. Remove bogus code
8307 allowing ExprClass.Type and ExprClass.Namespace for
8308 ResolveFlags.VariableOrValue.
8309 (Expression.Resolve) [1-argument variant]: Change default resolve
8310 flags based on language version.
8311 (Expression.Error_UnexpectedKind): Use a simple string array
8312 rather than an ArrayList.
8313 * expression.cs (TypeOf.DoResolve): Set eclass to ExprClass.Value,
8315 (TypeOfVoid.DoResolve): Likewise.
8316 (MemberAccess.DoResolve) [3-argument variant]: Make private. Drop
8317 flags argument -- it always has the same value.
8319 2005-05-31 Raja R Harinath <rharinath@novell.com>
8322 * ecore.cs (Expression.ResolveLValue): Add a Location parameter.
8323 Use it in the error message.
8324 * assign.cs, expression.cs, statement.cs: Update.
8326 2005-05-30 Raja R Harinath <rharinath@novell.com>
8329 * ecore.cs (Expression.MemberLookupFailed): Add CS0122 check in
8330 the "almostMatchedMember" case too.
8331 * typemanager.cs (Closure.CheckValidFamilyAccess): Add anything
8332 that failed the accessibility checks to 'almost_match'.
8334 2005-05-27 Vladimir Vukicevic <vladimir@pobox.com>
8336 * attribute.cs: Use internal MethodBuilder methods to set
8337 ExactSpelling and SetLastError on PInvoke methods, instead
8338 of passing them via charset. Fixes #75060.
8340 2005-05-27 Raja R Harinath <rharinath@novell.com>
8342 * parameter.cs (Parameter): Remove TODO comment.
8343 (Parameter.DefineParameter): Remove Location parameter.
8344 (Parameters.LabelParameters): Likewise.
8345 * class.cs (Constructor.Emit): Update to change.
8346 (MethodData.Emit): Likewise.
8347 * anonymous.cs (AnonymousMethod.EmitMethod): Likewise.
8348 * delegate.cs (Delegate.Define, Delegate.Emit): Likewise.
8350 2005-05-27 Atsushi Enomoto <atsushi@ximian.com>
8353 Removed Parameters.Location and added Parameter.Location instead.
8354 Removed Location parameter from Emit() and GetSignature().
8361 Modified all related calls.
8363 2005-05-26 Raja R Harinath <rharinath@novell.com>
8365 Improve user-defined conversion handling.
8366 * convert.cs (GetConversionOperators): Rewrite. Return only the
8367 applicable operators.
8368 (AddConversionOperators): New. Helper for GetConversionOperators.
8369 (FindMostEncompassedType, FindMostEncompassingType): Verify that
8370 there is only one most encompassed/encompassing type.
8371 (FindMostSpecificSource, FindMostSpecificTarget): Remove
8372 "applicable operator" handling.
8373 (UserConversion): Move cache here from GetConversionOperators.
8374 Directly cache the chosen operator, rather than the whole
8376 (ExplicitNumericConversion): Fix buggy implementation of Decimal
8377 case. Allow conversion of decimal to sbyte and byte too.
8378 * expression.cs (EmptyExpression.Grab, EmptyExpression.Release):
8379 New static methods. Used to avoid allocating EmptyExpressions in
8382 2005-05-24 Duncan Mak <duncan@novell.com>
8384 * ecore.cs (CastFromDecimal): New class for casting a decimal to
8385 another class, used in Convert.ExplicitNumericConversion.
8386 (CastToDecimal): New class, similar to above, but casts to
8387 System.Decimal, used in Convert.ImplicitNumericConversion and also
8388 in explicit convesion from double/float to decimal.
8390 * convert.cs (ImplicitNumericConversion): Handle implicit
8391 conversions to System.Decimal.
8392 (ExplicitNumericConversion): handle explicit conversions to
8397 2005-05-20 Miguel de Icaza <miguel@novell.com>
8399 * typemanager.cs (EnumToUnderlying): Do not throw if we do not
8400 know the type at this stage, just break through. Fixes #75008
8402 2005-05-19 Martin Baulig <martin@ximian.com>
8405 (ImplicitDelegateCreation.Check): Added `bool check_only' argument
8406 to disable error reporting.
8408 * convert.cs (Convert.ImplicitStandardConversionExists): Use it
8409 here since we don't want to report an error; see the new test-336.cs.
8411 2005-05-19 Raja R Harinath <rharinath@novell.com>
8413 * statement.cs (ToplevelBlock.GetParameterReference)
8414 (ToplevelBlock.IsParameterReference,ToplevelBlock.IsLocalParameter):
8415 Move here from class Block.
8416 * ecore.cs (SimpleName.SimpleNameResolve): Update to changes.
8417 * expression.cs (ParameterReference.DoResolveBase): Likewise.
8419 2005-05-18 Martin Baulig <martin@ximian.com>
8424 (FlowBranching.Reachability): Add non-static public And() and Or()
8426 (FlowBranchingSwitch): New class; do the `break_origins' thing
8427 like in FlowBranchingLoop.
8428 (FlowBranching.UsageVector.MergeBreakOrigins): Also merge the
8429 reachability, not just locals and parameters.
8430 (FlowBranching.MergeChild): Remove some of the hacks for loop and
8431 switch; MergeBreakOrigins() now takes care of that.
8433 2005-05-18 Martin Baulig <martin@ximian.com>
8435 * flowanalysis.cs (FlowBranching.UsageVector.MergeChild): If we're
8436 a loop and may leave it, reset the barrier; fixes #74974.
8438 2005-05-17 Marek Safar <marek.safar@seznam.cz>
8440 * attribute.cs (Attribute.ResolveArguments): GuidAttribute check
8443 * cs-parser.jay: Catch more lexical errors.
8445 * report.cs: Add one more Error method.
8448 * typemanager.cs: Register System.Runtime.InteropServices.GuidAttribute
8450 2005-05-17 Martin Baulig <martin@ximian.com>
8452 * expression.cs (Argument.Resolve): Turn on flow analysis; fix
8455 2005-05-16 Raja R Harinath <rharinath@novell.com>
8457 Fix test-382.cs. Emit values of decimal constants.
8458 * class.cs (TypeContainer.RegisterFieldForInitialization): New.
8460 (TypeContainer.AddField): ... this.
8461 (TypeContainer.EmitFieldInitializers): Allow the list of fields
8462 with initializers to include 'Const's.
8463 (ClassPart.RegisterFieldForInitialization): Forward to
8465 * const.cs (Const.Const): Pass initializer to base class.
8466 (Const.Define): In case of decimal constants, register them for
8467 initialization in a static constructor.
8469 2005-05-14 Martin Baulig <martin@ximian.com>
8471 * statement.cs (Block.Resolve): Correctly handle unreachable code;
8472 do not call ResolveUnreachable() on unreachable statements in
8473 here, see the comment in the source code.
8475 2005-05-13 Raja R Harinath <rharinath@novell.com>
8478 * expression.cs (BinaryResolveOperator): If one of the operands of
8479 an equality comparison is 'null' and the other is a pointer type,
8480 convert the null to a NullPointer.
8481 * convert.cs (ImplicitReferenceConversion): If the expression is a
8482 NullLiteral and the target type is a pointer type, return a
8483 NullPointer instead.
8484 (ImplicitConversionStandard): Likewise.
8486 2005-05-13 Marek Safar <marek.safar@seznam.cz>
8488 * cs-parser.jay: Set readonly context based on special constructs.
8490 * expression.cs (LocalVariableReference.DoResolveBase): Improved
8491 readonly variable error handling.
8493 * rootcontext.cs (EmitCode): Don't verify members when error
8496 * statement.cs (LocalInfo): Add reaodnly context information.
8497 (SetReadOnlyContext, GetReadOnlyContext): New methods.
8499 2005-05-13 Raja R Harinath <rharinath@novell.com>
8501 * statement.cs (Block.Resolve): Revert change below. Modify fix
8502 for #74041 to initialize 'resolved' to false only for explicit
8503 blocks. Fixes #74873.
8505 2005-05-12 Raja R Harinath <harinath@gmail.com>
8508 * typemanager.cs (unmanaged_enclosing_types): New.
8509 (IsUnmanagedType): Avoid infloops by using
8510 'unmanaged_enclosing_types' to talk with recursive invocations.
8512 2005-05-13 Martin Baulig <martin@ximian.com>
8514 * statement.cs (Block.Resolve): Make the `bool unresolved' flag an
8515 instance variable, not a local. Fix #74873.
8516 (Block.ResolveUnreachable): Set it to true here.
8518 2005-05-11 Duncan Mak <duncan@novell.com>
8520 * cs-tokenizer.cs (get_cmd_arg): Check that 'c' is not -1 before
8521 continuing to process for 'arg'.
8522 (handle_preprocessing_directive): Check the argument of the #endif
8523 directive and report error CS1025 if there are any trailing
8526 According to the C# spec, having even whitespace after the #endif
8527 directive is illegal; however, because we call arg.TrimEnd ()
8528 beforehand, we have the same behavior as csc, allowing whitespace
8529 after the directive.
8533 2005-05-11 Marek Safar <marek.safar@seznam.cz>
8537 * class.cs (ConstructorInitializer.GetOverloadedConstructor): Removed.
8538 (Constructor.GetObsoleteAttribute): Implemented correctly.
8540 2005-05-10 Martin Baulig <martin@ximian.com>
8542 * support.cs (ReflectionParameters.ParameterModifier): Use
8543 `Parameter.Modifier.REF' if we both have `ParameterAttributes.Out'
8544 and `ParameterAttributes.In'. Fixes #74884.
8546 2005-05-10 Marek Safar <marek.safar@seznam.cz>
8548 * class.cs (Method.Define): Catch attempt for Finalizer declaration.
8550 * expression.cs (Argument.GetParameterModifier): Turned to property.
8551 (Invocation.Error_InvalidArguments): Add more descriptive errors.
8553 * parameter.cs (Parameter.GetModifierSignature): Translates modifier to
8556 2005-05-09 Raja R Harinath <rharinath@novell.com>
8559 * decl.cs (MemberCache.AddMethods): Register override methods,
8560 rather than non-override methods.
8561 * typemanager.cs (RegisterOverride): New.
8562 (IsOverride): Update.
8564 2005-05-09 Marek Safar <marek.safar@seznam.cz>
8568 * ecore.cs (SimpleName.SimpleNameResolve): Add in_transit to catch
8569 recursive declaration.
8571 * statement.cs (Block.ResolveMeta): Report any error in resolving.
8573 2005-05-06 Marek Safar <marek.safar@seznam.cz>
8575 * cfold (DoConstantNumericPromotions): Don't try to convert 0 enum.
8577 * expression.cs (Binary.DoResolve): (x && 0) is always 0.
8579 2005-05-05 Raja R Harinath <rharinath@novell.com>
8582 * decl.cs (DeclSpace.FamilyAccessible):
8583 Use TypeManager.IsNestedFamilyAccessible.
8585 Fix reopened #64812.
8586 * typemanager.cs (Closure.Filter): Introduce checks for 'protected
8589 2005-05-04 Raja R Harinath <rharinath@novell.com>
8590 Abin Thomas <projectmonokochi@rediffmail.com>
8591 Anoob V E <projectmonokochi@rediffmail.com>
8592 Harilal P R <projectmonokochi@rediffmail.com>
8595 * typemanager.cs (Closure.CheckValidFamilyAccess): Don't blindly
8596 allow access to all static members.
8598 2005-05-04 Martin Baulig <martin@ximian.com>
8600 * ecore.cs (FieldExpr.DoResolveLValue): Always call fb.SetAssigned().
8602 2005-05-04 Martin Baulig <martin@ximian.com>
8606 * statement.cs (Switch.SimpleSwitchEmit): Always emit the default
8607 section at the end; make things work if `default' is not the last
8610 2005-05-04 Martin Baulig <martin@ximian.com>
8614 * statement.cs (Switch): Replaced the `got_default' field with a
8615 `default_section' one.
8616 (Switch.CheckSwitch): Set `default_section' here.
8617 (Switch.Resolve): If we're a constant switch and the constant is
8618 not found, use the default section.
8620 2005-05-03 Martin Baulig <martin@ximian.com>
8622 * expression.cs (ArrayAccess.EmitGetLength): New public method.
8624 * statement.cs (Foreach.ArrayForeach): New nested class.
8625 (Foreach.TemporaryVariable): New nested class.
8626 (Foreach.EmitArrayForeach): Removed; this is now in the new
8629 2005-05-03 Raja R Harinath <rharinath@novell.com>
8631 * pending.cs (BaseImplements): Move the #74773 fix here. This is
8633 (VerifyPendingMethods): Revert change below.
8635 * typemanager.cs (IsOverride, RegisterNonOverride): New.
8636 * decl.cs (MemberCache.AddMethod): Register "non-override" methods
8637 that used to trigger warning -28. Remove warning -28.
8638 * expression.cs (Invocation.OverloadResolve): Use
8639 TypeManager.IsOverride to distinguish override methods.
8642 * pending.cs (VerifyPendingMethods): If a base type implements the
8643 requested interface, don't bother checking individual methods of
8644 the base type. As a side-effect, this prevents the creation of
8645 unnecessary proxies.
8647 2005-05-02 Martin Baulig <martin@ximian.com>
8651 * flowanalysis.cs (FlowBranching.UsageVector.MergeJumpOrigins):
8652 Also `And' the locals if the old vector is null.
8653 (FlowBranching.UsageVector.BitVector.And): Allow `vector' being
8654 null; in this case we basically reset all the variables.
8656 2005-05-02 Martin Baulig <martin@ximian.com>
8660 * flowanalysis.cs (FlowBranching.UsageVector.MergeBreakOrigins):
8661 Added `FlowBranching branching' argument; always `and' the
8662 variables instead of `or'ing them unless we're an infinite loop.
8664 * statement.cs (While.Resolve): Create a new sibling unless we're
8667 2005-05-02 Martin Baulig <martin@ximian.com>
8671 * class.cs (ConstructorInitializer.Resolve): Added `Block block'
8672 arguments; use it instead of creating a new TopLevelBlock.
8673 (Constructor.Emit): Call `block.ResolveMeta ()' before resolving
8674 our ConstructorInitializer.
8677 (TopLevelBlock.TopLevelBranching): New public property.
8678 (TopLevelBlock.ResolveMeta): New public method; call ResolveMeta()
8679 and create our `TopLevelBranching'.
8681 * codegen.cs (EmitContext.ResolveTopBlock): If we're not an
8682 anonymous method host, use `block.TopLevelBranching' rather than
8683 creating a new branching.
8685 2005-04-20 Miguel de Icaza <miguel@novell.com>
8687 * anonymous.cs (ScopeInfo.AddChild): when adding a new child to
8688 a ScopeInfo, if any of the current children is a child of the new
8689 entry, move those children there.
8691 2005-04-30 Martin Baulig <martin@ximian.com>
8693 * statement.cs (Switch.SimpleSwitchEmit): Reset `default_at_end'
8694 at the beginning of a SwitchSection. Fix #73335.
8696 2005-04-27 Marek Safar <marek.safar@seznam.cz>
8699 * class.cs (EmitFieldInitializers): Use FieldExpr in initializer.
8701 * ecore.cs (FieldExpr): Add a new ctor with in_initializer.
8702 (FieldExpr.DoResolve): Obsolete members are ignored for field
8705 2005-04-26 Marek Safar <marek.safar@seznam.cz>
8707 * attribute.cs (AreOverloadedMethodParamsClsCompliant): Add array
8708 of arrays detection.
8710 * class.cs (Interface.VerifyClsCompliance): Add base interfaces
8712 (Field.VerifyClsCompliance): Volatile fields are not compliant.
8714 * decl.cs (MemberCache.VerifyClsParameterConflict): Add array of
8717 2005-04-25 Ben Maurer <bmaurer@ximian.com>
8719 * cs-parser.jay: Use the prefered version of -unsafe in error
8722 2005-04-22 Marek Safar <marek.safar@seznam.cz>
8724 * driver.cs (CompilerCallableEntryPoint.Invoke): Reset under any
8727 2005-04-20 John Luke <john.luke@gmail.com>
8729 * driver.cs: fix typo in error message, --outout to --output
8731 2005-04-20 Marek Safar <marek.safar@seznam.cz>
8733 * codegen.cs (InRefOutArgumentResolving): New field.
8735 * ecore.cs (FieldExpr.DoResolve): Check for assigning to readonly
8736 fields outside contructor.
8738 * expression.cs (Argument.Resolve): Set InRefOutArgumentResolving.
8740 2005-04-19 Miguel de Icaza <miguel@novell.com>
8742 * anonymous.cs (CaptureContext.EmitParameterInstance): The
8743 parameter code was not completed ever, so it was not as up-to-date
8744 as local variables. Must finish it.
8746 The bug fix was to compare the Toplevel of the block, not the
8747 current block. Thanks for Ben for pointing this out.
8749 2005-04-19 Raja R Harinath <rharinath@novell.com>
8751 * decl.cs (AddMethods): Use the declaring type of the problem
8752 method to determine if we want to squash a warning.
8754 2005-04-19 Marek Safar <marek.safar@seznam.cz>
8756 * attribute.cs: Removed debug output.
8758 * decl.cs (MemberCache.AddMethods): Fixed Finalize ignoring.
8760 * driver.cs (Driver.parse): Synchronize parser ErrorOutput with
8763 2005-04-18 Raja R Harinath <rharinath@novell.com>
8766 * expression.cs (Binary.EqualsNullIsReferenceEquals): New.
8767 (Binary.DoResolveOperator): Use it to avoid blindly optimizing out
8768 all null comparisons against reference types.
8770 2005-04-18 Marek Safar <marek.safar@seznam.cz>
8773 * class.cs (TypeContainer.CircularDepException) New nested
8775 (GetPartialBases, GetNormalBases, GetClassBases): Removed error.
8776 (TypeContainer.DefineType): Removed error, reset InTransit before
8778 (Class.DefineType): Throw exception when is in Transit.
8779 Catch exception and report error.
8780 (Struct.DefineType): Throw exception when is in Transit.
8781 Catch exception and report error.
8782 (Interface.DefineType): Throw exception when is in Transit.
8783 Catch exception and report error.
8785 * codegen.cs: Add InCatch,InFinally to EmitContext to easily
8786 handle nested exception handlers.
8788 * flowanalysis.cs (InTryWithCatch): New method, search for try with
8791 * iterators.cs (Yield.CheckContext): Add CS1626 report. Updated
8792 InFinally and InCatch storage.
8794 * statement.cs (Throw.Resolve): Use InCatch, InFinally from ec.
8795 (Catch.Resolve): Set and Restore ec.InCatch.
8796 (Try.Resolve): Set and Restore ec.InFinally.
8797 (Try.HasCatch): True when try has catch.
8799 2005-04-17 Atsushi Enomoto <atsushi@ximian.com>
8801 * doc.cs : In some cases FilterName returns MonoEvent and MonoField
8802 for the same event member, so exclude such cases from warning 419.
8805 2005-04-16 Miguel de Icaza <miguel@novell.com>
8807 * expression.cs (Binary.ResolveOperator): Apply patch from John
8808 Luke to fix bug 59864: operators &, | and ^ on enumerations
8809 require that the same enum type on both sides.
8811 * driver.cs: Add warnings to old flag usage, this is to assist
8812 people who produce Makefiles and hope that the Makefiles will be
8815 * class.cs (TypeContainer.EmitType): Moved the definition of the
8816 special $PRIVATE$ field from the resolve phase to the Emit phase.
8817 During resolve we do not know if we are a struct with
8818 HasExplicitLayout, we know this only after the attributes for the
8821 Set the FieldOffset to zero on the dummy field that we create for
8822 the class. Fixes 74590.
8824 2005-04-16 Raja R Harinath <rharinath@novell.com>
8827 * ecore.cs (PropertyExpr.resolved): New.
8828 (DoResolve): Use it to handle a case of double resolution here.
8829 Handle a case of identical-name-and-type-name.
8830 * expression.cs (ArrayCreation.CheckIndices): Avoid double
8831 resolution by storing the results of expression resolution back
8832 into the "probes" array.
8834 2005-04-15 Raja R Harinath <rharinath@novell.com>
8836 Fix cs0208-7.cs and cs0208-8.cs.
8837 * typemanager.cs (IsUnmanagedType): Arrays are not allowed
8838 (cf. ECMA standard, behaviour of CSC 1.1 and CSC 2.0). Improve
8839 error reporting to point out the reason a struct is not unmanaged.
8841 2005-04-13 Atsushi Enomoto <atsushi@ximian.com>
8843 * doc.cs : In FindDocumentedType(), avoid TypeExpr.ResolveType() and
8844 just use TypeExpr.Type. This fixes bug #74595 when merged to gmcs.
8846 2005-04-13 Raja R Harinath <rharinath@novell.com>
8849 * ecore.cs (PropertyExpr.InstanceResolve): Handle a case of
8850 IdenticalNameAndTypeName here.
8851 (EventExpr.InstanceResolve): Likewise.
8853 2005-04-13 Marek Safar <marek.safar@seznam.cz>
8855 C# 2.0 DefaultCharSetAttribute implementation
8857 * attribute.cs (Attribute.ResolveAsTypeStep): New protected method
8858 which allows us to set GlobalNamespace for every resolve.
8859 (Attribute.ResolveArguments): Cut from Resolve.
8860 (Attribute.GetCharSetValue): Returns CharSet named argument.
8861 (Attribute.DefinePInvokeMethod): Gets default charset from
8863 (GlobalAttribute.ResolveAsTypeStep): Override.
8864 (GlobalAttribute.ResolveArguments): Override.
8866 * class.cs (TypeAttr): Is protected.
8868 * codegen.cs (ModuleClass.DefaultCharSet): New member.
8869 (ModuleClass.DefaultCharSetType): New memeber.
8870 (ModuleClass.ResolveAttributes): Resolves DefaultCharSetAttribute.
8872 * decl.cs (Decl.TypeAttr): New protected virtual. Returns default
8873 charset from module.
8875 * delegate.cs (TypeAttr): Override.
8876 (Delegate.DefineType): Use this TypeAttr.
8878 * driver.cs (Driver.MainDriver): Call Module.ResolveAttributes
8879 at very early stage (before types are defined) to resolve model
8880 module attributes. It will probably not work with corlib but it
8883 * enum.cs (Enum.TypeAttr): New protected virtual. Returns default
8884 charset from module.
8886 * typemanager.cs (default_charset_type): New type.
8888 2005-04-13 Raja R Harinath <rharinath@novell.com>
8890 * decl.cs (MemberCache.AddMethods): Don't warn if
8891 System.Object.Finalize has buggy MethodAttributes.
8893 * typemanager.cs (IsUnmanagedType): Restore !IsValueType check
8896 2005-04-13 Atsushi Enomoto <atsushi@ximian.com>
8898 * doc.cs : detect ambiguous reference to overloaded members.
8899 Fixed bug #71603. MS 1.1 csc does not detect it.
8901 2005-04-13 Atsushi Enomoto <atsushi@ximian.com>
8903 * doc.cs : delegates must not be referenced with parameters.
8906 2005-04-12 Miguel de Icaza <miguel@novell.com>
8908 * typemanager.cs (IsUnmanagedType): Arrays are allowed.
8910 2005-04-10 Miguel de Icaza <miguel@novell.com>
8912 * driver.cs (MainDriver): Stop processing if the CLS stage found
8915 (CompilerCallableEntryPoint.InvokeCompiler): Always
8916 reset after execution; Take a TextWriter argument for the
8919 * report.cs: Use the error stream instead of hardcoding stderr.
8921 2005-04-09 Miguel de Icaza <miguel@novell.com>
8923 * class.cs: Reduce code paths to test, too small of an
8924 optimization to make it worth the extra testing. Always perform
8927 2005-04-08 Raja R Harinath <rharinath@novell.com>
8930 * class.cs (OperatorArrayList.CheckPairedOperators): Skip
8931 operators that had errors reported on them.
8933 2005-04-08 Marek Safar <marek.safar@seznam.cz>
8935 * attribute.cs (Attribute.IsValidArgumentType): Test valid named
8937 (Attribute.Resolve): Add named argument type checking.
8939 * class.cs (FixedField.Define): Use IsPrimitiveType
8941 * expression.cs (Binary.ResolveOperator): Reflect IsCLRType renaming.
8943 * iterators.cs (Iterator.DefineIterator): Add check for arglist and
8944 unsafe parameter types.
8946 * statement.cs (Using.ResolveExpression): Add better error description.
8948 * typemanager.cs (IsCLRType): Renamed to IsPrimitiveType.
8950 2005-04-08 Raja R Harinath <rharinath@novell.com>
8953 * attribute.cs (Attribute.GetAttributeUsage): Resolve
8954 AttributeUsageAttribute in the emitcontext of the attribute class,
8955 not in the emitcontext of the attributable entity it was attached to.
8956 * cs-parser.jay: Use 'current_class', not 'current_container',
8957 when creating a GlobalAttribute.
8959 2005-04-08 Alp Toker <alp@atoker.com>
8961 * pending.cs: The fix to #58413 failed to compile methods implementing
8962 interfaces with/without params modifiers and vice versa, even though
8963 params modifiers aren't part of the signature. Make the modifier check
8964 less strict as in csc.
8966 2005-04-07 Abin Thomas <projectmonokochi@rediffmail.com>
8967 Anoob V E <projectmonokochi@rediffmail.com>
8968 Harilal P R <projectmonokochi@rediffmail.com>
8971 * pending.cs (TypeAndMethods.mods): New. Store the parameter
8972 modifiers of pending methods.
8973 (PendingImplementation.PendingImplementation): Initialize it.
8974 Add Parameter.Modifier [][] mods and initialize it with ParameterData.
8975 (PendingImplementation.InterFaceMethod): Repalce Type[] argument
8976 with ParameterData. Add check for modifiers.
8977 * class.cs (MethodData.Define): Update to changes.
8979 2005-04-07 Raja R Harinath <rharinath@novell.com>
8981 * ecore.cs (Expression.IsAccessorAccessible): Clarify code somewhat.
8983 2005-04-07 Marek Safar <marek.safar@seznam.cz>
8985 * class.cs (PropertyMethod.Define): Check private accessor in abstract
8988 * decl.cs (DeclSpace.ApplyAttributeBuilder): Don't allow RequiredAttribute
8991 * typemanager.cs: Registered RequiredAttributeAttribute.
8993 2005-04-06 Marek Safar <marek.safar@seznam.cz>
8995 * class.cs (VerifyMembers): Doesn't need EmitContext argument.
8996 Warning CS0169 is back at level 3.
8997 (IMethodData.SetMemberIsUsed): New method.
8999 * decl.cs (IsUsed): New value; moved from FieldBase.Status
9000 (SetMemberIsUsed, IsUsed): New methods, encapsulate IsUsed.
9002 * delegate.cs (ResolveMethodGroupExpr): Call SetMemberIsUsed.
9004 * ecore.cs (FieldExpr.ResolveMemberAccess): Call SetMemberIsUsed for
9006 (PropertyExpr.ResolveAccessors): Call SetMemberIsUsed when delegate
9009 * expression.cs (OverloadResolve): Call SetMemberIsUsed. when method
9012 * rootcontext.cs (RootContext.EmitCode): Call VerifyMembers in extra run
9013 to avoid the problems with nested types.
9015 2005-04-05 Abin Thomas <projectmonokochi@rediffmail.com>
9016 Anoob V.E <projectmonokochi@rediffmail.com>
9017 Harilal P.R <projectmonokochi@rediffmail.com>
9018 Raja R Harinath <rharinath@novell.com>
9021 * delegate.cs (Define): Emit ParamArrayAttribute for 'params'
9023 * typemanager (GetConstructor): Make public.
9025 2005-04-05 John Luke <john.luke@gmail.com>
9026 Raja R Harinath <rharinath@novell.com>
9029 * typemanager.cs (IsUnmanagedType): Check non-public fields of a
9030 struct too. Return false quicker in a few cases.
9031 (VerifyUnManaged): Use it.
9033 2005-04-05 Raja R Harinath <rharinath@novell.com>
9036 * statement.cs (Block.Resolve): Initialize 'unreachable' to false,
9037 not 'unreachable_seen'.
9039 2005-04-04 Marek Safar <marek.safar@seznam.cz>
9041 * attribute.cs (Attribute.GetValue): Removed unused.
9043 * codegen.cs (CodeGen.TrimExt): Removed unused.
9045 * cs-parser.jay (output): Removed unused.
9047 * cs-tokenizer.cs (hex_digits): Removed unused.
9049 * enum.cs (MapToInternalType, GetEnumeratorName): Removed unused.
9051 * expression.cs (Indirection.LoadExprValue): Removed unused.
9052 (ArrayCreation.ExpressionToArrayArgument): Removed unused.
9054 * iterators.cs (Iterator.param_types): Removed unused.
9056 * statement.cs (Goto.block): Removed unused.
9057 (ToplevelBlock.did): Removed unused.
9058 (Switch.ResolveConstantSwitch): Removed unused.
9060 2005-04-01 Ben Maurer <bmaurer@ximian.com>
9062 * rootcontext.cs: Allow mcs to bootstrap with the compilation
9065 2005-04-01 Raja R Harinath <rharinath@novell.com>
9067 Fix #74232 and cs0208-3.cs.
9068 * expression.cs (ComposedCast.DoResolveAsTypeStep): Add CS0208 check.
9069 * typemanager.cs (IsUnmanagedType): Don't allow 'object' as an
9070 unmanaged type. Don't use FieldBuilders when 't' is a
9071 TypeBuilder. Use ModFlags and MemberType fields.
9072 * class.cs (MemberBase.member_type): Rename from MemberType.
9073 (MemberBase.MemberType): New property. Determines member_type on
9075 (MemberBase.DoDefine): Don't initialize MemberType here.
9076 (FieldMember.Define): Likewise.
9078 2005-04-01 Marek Safar <marek.safar@seznam.cz>
9081 * class.cs (Event.Emit): Call Add/Remove emit even for interfaces.
9082 Attributes are emitted there.
9084 2005-04-01 Raja R Harinath <rharinath@novell.com>
9086 * cs-tokenizer.cs (consume_identifier): Treat 'partial' as a
9087 keyword in 'partial enum' too.
9088 * cs-parser.jay (enum_declaration): Add CS0267 check ('partial enum'
9090 Report from Kamil Skalski <nazgul@omega.pl>.
9093 * rootcontext.cs (ResolveTree): The 'root.Interfaces' list can
9094 have partial containers too.
9096 * ecore.cs (SimpleName.SimpleNameResolve): Move 'invariant meaning
9097 in block' checks to Block.CheckInvariantMeaningInBlock.
9098 * statement.cs (Block.GetKnownVariableInfo): Make private.
9099 (Block.IsVariableUsedInChildBlock): Remove.
9100 (Block.IsVariableUsedInBlock): Likewise.
9101 (Block.CheckInvariantMeaningInBlock): New. Show location of
9102 conflicting declaration.
9103 (Block.AddVariable): Make error messages less long-winded and more
9104 specific. Show location of conflicting declaration.
9105 * parameter.cs (Parameters.Location): New readonly property.
9107 2005-03-31 Raja R Harinath <rharinath@novell.com>
9109 Clean up semantics of invoking ResolveMemberAccess.
9110 * ecore.cs (SimpleName.DoSimpleNameResolve): If a MemberExpression
9111 can have an instance, ensure that we pass in a non-TypeExpression
9112 to ResolveMemberAccess. Tighten up IdenticalNameAndTypeName checks.
9113 (MemberExpr.DoSimpleNameResolve): Remove type_is_inferred
9114 argument. Update to changes and simplify.
9115 (FieldExpr.Emitinstance): Remove CS0120 check.
9116 (PropertyExpr.EmitInstance): Likewise.
9117 * expression.cs (Argument.Resolve): Likewise.
9118 (Invocation.DoResolve): Update to changes in semantics of
9121 2005-03-31 Marek Safar <marek.safar@seznam.cz>
9124 * class.cs (AbstractPropertyEventMethod.EmitMethod): Enable emit method
9127 * decl.cs (MemberCache.AddMethods): Fix infinite loop.
9129 2005-03-31 Raja R Harinath <rharinath@novell.com>
9131 Fix difference in behaviour with commandline invocation.
9132 * driver.cs (Driver.Reset): New.
9133 (CompilerCallableEntryPoint): Call it.
9135 * statement.cs (If.Resolve): Avoid spurious "uninitialized
9136 variable" warnings if the boolean expression failed to resolve.
9138 2005-03-30 Sebastien Pouliot <sebastien@ximian.com>
9140 * attribute.cs: Fix the union of several permissions when some of them
9141 are unrestricted (so the result isn't an unrestricted permission set).
9144 2005-03-30 Raja R Harinath <rharinath@novell.com>
9146 * ecore.cs (MemberExpr): New class. Convert from interface
9148 (MemberExpr.ResolveMemberAccess): Refactor and move here from
9149 MemberAccess.ResolveMemberAccess. Tighten up pre-conditions and
9151 (MethodGroupExpr, FieldExpr, PropertyExpr, EventExpr): Update.
9152 (MethodGroupExpr.IsExplicitImpl): Remove.
9153 (Expression.GetFieldFromEvent): Remove.
9154 (SimpleName.MemberStaticCheck): Remove.
9155 (SimpleName.DoSimpleNameResolve): Update to changes.
9156 * expression.cs (MemberAccess.ResolveMemberAccess): Refactor.
9157 (MemberAccess.IdenticalNameAndTypeName): Remove.
9158 (MemberAccess.error176): Move to MemberExpr.
9159 (MemberAccess.DoResolve): Update to changes.
9160 (BaseAccess.DoResolve): Likewise.
9162 2005-03-30 Marek Safar <marek.safar@seznam.cz>
9164 C# 2.0 Conditional attribute class implementation
9166 * attribute.cs (AttributeTester.IsAttributeExcluded): New method.
9167 Analyzes class whether it has attribute which has ConditionalAttribute
9168 and its condition is not defined.
9170 * class.cs (Class.ApplyAttributeBuilder): Add IsAttributeExcluded check.
9171 (Class.IsExcluded): New method. Search for at least one defined
9172 condition in ConditionalAttribute of attribute class.
9174 2005-03-30 Raja R Harinath <rharinath@novell.com>
9176 * ecore.cs (PropertyExpr): Derive from Expression, not
9177 ExpressionStatement.
9178 (PropertyExpr.EmitStatement): Remove.
9180 2005-03-29 Raja R Harinath <rharinath@novell.com>
9183 * expression.cs (MemberAccess.ResolveMemberAccess): Allow the
9184 internal field "value__" of an enum be private. The examples for
9185 "value__" that I found on MSDN all used FieldAttributes.Private.
9187 * decl.cs (MemberCache.AddMethods): Use C# terminology in warning.
9188 Don't mention IL method attribute names.
9190 Fix #47991. Remove a TODO.
9191 * statement.cs (Block.Toplevel): Make into a field.
9192 (Block.Parameters): Move into ToplevelBlock.
9193 (Block.known_variables): Rename from child_variable_names.
9194 (Block.Block): Remove variants that take Parameters. Initialize
9195 'Toplevel' with the immediately surrounding toplevel block.
9196 (Block.AddKnownVariable): Rename from AddChildVariableName. Add a
9197 LocalInfo parameter.
9198 (Block.GetKnownVariableInfo): New.
9199 (Block.IsVariableNameUsedInChildBlock): Update.
9200 (Block.IsVariableNameUsedInBlock): New. Checks if a name is used in
9201 the block, even though it may not be in scope.
9202 (Block.AddVariable): Remove Parameters parameter. Use
9203 Toplevel.Parameters instead.
9204 (Block.AddConstant): Remove Parameters parameter.
9205 (Block.GetParameterReference): Update to use Toplevel.Parameters.
9206 (Block.IsParamaterReference): Likewise.
9207 (Block.IsLocalParameter): Likewise. Simplify a lot.
9208 (ToplevelBlock.Parameters): New. Moved from Block.
9209 (ToplevelBlock.ToplevelBlock): Update to changes. Always
9210 initialize Parameters to a non-null value.
9211 * cs-parser.jay: Update to changes.
9212 * ecore.cs (SimpleName.SimpleNameResolve): Emit cs0136 error for
9213 simple names that mean different things in the same block. Use
9214 Block.IsVariableNameUsedInBlock.
9216 2005-03-28 Raja R Harinath <rharinath@novell.com>
9218 * typemanager.cs (TypeHandle.BaseType): Make into an IMemberContainer.
9219 (TypeHandle.TypeHandle): Use LookupMemberCache rather than
9220 GetTypeHandle. It is possible for a reflected type to derive from
9221 a TypeBuilder (e.g., int[] derives from the TypeBuilder
9222 System.Array during mscorlib compilation).
9223 * decl.cs (MemberCache.MemberCache): If the base cache doesn't
9224 contain a method_hash, don't create one either. Don't create a
9225 deep copy of the base cache's method_hash.
9226 (MemberCache.SetupCache): Rename back from DeepCopy.
9227 (MemberCache.AddMethods): Rewrite, now that method_hash isn't
9228 already initialized. If we see an override function, add its
9229 underlying base virtual function to the member_hash too.
9231 * enum.cs (Enum.LookupEnumValue): Remove debugging code.
9233 2005-03-26 Raja R Harinath <harinath@acm.org>
9236 * assign.cs (Assign.DoResolve): When the RHS of an assignment
9237 fails to resolve, ensure that the LHS is still resolved as an
9240 2005-03-25 Raja R Harinath <harinath@acm.org>
9242 * enum.cs (Enum.DefineType): Set ec.InEnumContext and
9244 (Enum.current_ec): Remove.
9245 (Enum.LookupEnumValue): Remove EmitContext argument.
9246 Just uses the one created during DefineType.
9247 (Enum.FindMembers): Update.
9248 * expression.cs (MemberAccess.DoResolve): Update.
9250 2005-03-22 Marek Safar <marek.safar@seznam.cz>
9252 * assign.cs (Assign.DoResolve): Check for CS1717 when
9253 source and target are same (uses Equals).
9255 * expression.cs (LocalVariableReference, ParameterReference,
9256 This): Implemented Equals, GetHashCode.
9258 * statement.cs (Block.GetParameterReference): Removed useless
9261 2005-03-22 Raja R Harinath <rharinath@novell.com>
9264 * statement.cs (Block.AddVariable): Ensure that we skip implicit
9265 blocks before deciding whether the error is cs0136 or cs0128.
9267 * cs-parser.jay: Pass MemberName to RootContext.Tree.RecordDecl.
9268 (using_alias_directive, using_namespace_directive): Pass
9269 MemberName, not an expression to Namespace.UsingAlias and
9271 (MakeName): Use the MemberName of the namespace.
9272 * namespace.cs (Namespace.MemberName): New.
9273 (UsingEntry.UsingEntry): Take a MemberName, not an expression.
9274 (AliasEntry.AliasEntry, Namespace.Using, Namespace.UsingAlias):
9276 * decl.cs (MemberName.Name): Make readonly.
9277 (MemberName.FromDotted): New "constructor".
9278 (MemberName.Equals, MemberName.GetHashCode): Implement overrides.
9279 (MemberCore.Name): Compute from MemberName on demand.
9280 (MemberCore.SetMemberName): Provide a way to change the
9282 (MemberCore.AddToContainer): Don't take a fullname parameter.
9283 * class.cs (TypeContainer.AddToMemberContainer): Don't add the
9284 fully qualified name of the container to the member name.
9285 (TypeContainer.AddToTypeContainer): Use a fully qualified name
9286 only if the type is a member of the root container.
9287 (TypeContainer.AddMethod, TypeContainer.AddProperty): Use
9288 MemberName.Left rather than searching for an embedded ".".
9289 (PartialContainer.CreatePart): Update to changes in RootContext.
9290 (MemberBase.ShortName): Turn into a property. Use
9291 MemberCore.SetMemberName.
9292 (MemberBase.ExplicitInterfaceName): Remove.
9293 (MemberBase.UpdateMemberName): Remove.
9294 (AbstractPropertyEventMethod.UpdateName): Use SetMemberName.
9295 (PropertyBase.SetMemberName): New override.
9296 * tree.cs (Tree.RecordDecl): Take a MemberName and use it as hash key.
9297 (Tree.GetDecl): New.
9298 (Tree.AllDecls): Rename from Decls.
9299 * attribute.cs, enum.cs, report.cs: Update to changes.
9300 * driver.cs (MainDriver): Use MemberName.FromDotted on
9301 RootContext.MainClass.
9303 2005-03-21 Marek Safar <marek.safar@seznam.cz>
9305 * class.cs (FixedField.Define): Check for CS1664 and more sanity
9308 * expression.cs (ElementAccess.DoResolveLValue): Check for CS1708.
9310 2005-03-18 Marek Safar <marek.safar@seznam.cz>
9312 * modifiers.cs (Modifiers.PROPERTY_CUSTOM): New constant for
9313 property accessor modifiers.
9315 * class.cs (FieldMember.ApplyAttributeBuilder): Don't allow apply
9316 fixed buffer attribute (CS1716).
9317 (PropertyMethod.HasCustomAccessModifier): When property accessor
9318 has custom modifier.
9320 * ecore (PropertyExpr.DoResolve): Add CS0271 for custom accessor
9322 (PropertyExpr.DoResolveLValue): Add CS0272.
9324 2005-03-17 Miguel de Icaza <miguel@novell.com>
9326 * convert.cs: When converting to a pointer, use the proper Conv.U
9327 or Conv.I depending on the source data type.
9329 * cs-tokenizer.cs: Make the size for large decimal constants,
9332 2005-03-17 Martin Baulig <martin@ximian.com>
9334 * anonymous.cs (AnonymousMethod.method_modifiers): Change default
9335 from `Modifiers.INTERNAL' to `Modifiers.PRIVATE'. Fixes #73260.
9337 2005-03-17 Martin Baulig <martin@ximian.com>
9339 * anonymous.cs (AnonymousMethod.EmitMethod): Changed return type
9340 to bool so we can return an error condition.
9341 (AnonymousDelegate.Emit): Check whether AnonymousMethod.EmitMethod()
9344 2005-03-16 Zoltan Varga <vargaz@freemail.hu>
9346 * attribute.cs: Encode ThrowOnUnmappableChar and BestFitMapping
9349 2005-03-16 Raja R Harinath <rharinath@novell.com>
9351 Remove TypeManager.LookupType and TypeManager.LookupTypeDirect.
9352 Refactor to avoid traversing the list of assemblies, and to avoid
9353 string concatenation.
9354 * typemanager.cs (guid_attr_type): Remove.
9355 (negative_hits, pointers, references): Remove hashes.
9357 (GetConstructedType): New. Uses type_hash to handle constructed
9358 types (arrays, references, pointers).
9359 (GetReferenceType, GetPointerType): Use it.
9360 (GetNestedType): New. Uses type_hash to handle nested types of
9362 (LookupType, LookupTypeDirect): Remove.
9363 (CoreLookupType): Inline parts of old LookupTypeDirect code. Use
9364 'types' hash and LookupTypeReflection directly.
9365 (params_string, params_object): Use GetConstructedType.
9366 * namespace.cs (Namespace.cached_types): New. Cache of reflected
9368 (Namespace.Lookup): Use cached_types.
9369 (NamespaceEntry.LookupNamespaceOrType): Inline the functionality
9370 provided by old TypeManager.LookupType.
9371 * rootcontext.cs (MakeFQN): Remove.
9372 * decl.cs (DeclSpace.MakeFQN): Likewise.
9373 (DeclSpace.LookupType): Use TypeManager.GetNestedType.
9374 * expression.cs (ComposedCast.DoResolveAsTypeStep): Use
9375 TypeManager.GetConstructedType.
9376 * tree.cs (decl_ns_hash, LookupByNamespace): Remove.
9378 2005-03-15 Marek Safar <marek.safar@seznam.cz>
9380 * class.cs (MethodCore.CheckBase): Report CS1715 for properties and
9383 * cs-parser.jay: Reports CS1527 for any namespace element.
9385 * delegate.cs (DelegateCreation.Error_NoMatchingMethodForDelegate):
9388 * expression.cs (ParameterReference.IsAssigned): Changed error to
9390 (Error_WrongNumArguments): Moved CS0245 detection here.
9392 * statement.cs (Return.Resolve): Add CS1622 report.
9394 2005-03-11 Marek Safar <marek.safar@seznam.cz>
9396 * class.cs (StaticClass.DefineContainerMembers): Added CS0720.
9398 2005-03-11 Zoltan Varga <vargaz@freemail.hu>
9400 * attribute.cs expression.cs: Get rid of some allocations.
9402 2004-03-11 Atsushi Enomoto <atsushi@ximian.com>
9404 * doc.cs : just eliminate the latest change.
9406 2004-03-10 Atsushi Enomoto <atsushi@ximian.com>
9408 * doc.cs : commented out the latest change. It breaks xml-030.cs
9410 2004-03-10 Atsushi Enomoto <atsushi@ximian.com>
9412 * doc.cs : When TypeBuilder did not create Type yet, GetEvents() will
9413 fail. So invoke CreateType() in FindDocumentedType().
9415 2004-03-10 Atsushi Enomoto <atsushi@ximian.com>
9417 * cs-tokenizer.cs : added IsKeyword().
9418 * doc.cs : Detect keyword incorrectly used as identifier.
9419 Allow identifiers prefixed by @.
9421 2005-03-10 Marek Safar <marek.safar@seznam.cz>
9423 * attributes.cs (Attributes.Emit): Continue after CheckTargets.
9424 It caused exception in namespace resolving (again!).
9426 * class.cs (Class.ctor): Removed exit.
9427 (PropertyMethod.ctor): ditto.
9429 * codegen.cs (Codegen.Reset): Reset static data.
9430 (Codegen.ResolveTopBlock): Forward error status from ResolveMeta.
9432 * cs-tokenizer.cs (Cleanup): Removed.
9434 * driver.cs (GetSystemDir): Rewrote to one line command.
9435 It caused problem with unloaded dynamic modules.
9436 (UnixParseOption): Removed Exit.
9437 (CompilerCallableEntryPoint.InvokeCompiler): Make static.
9438 (CompilerCallableEntryPoint.Reset): Reset suitable static data.
9439 Now can be mcs used as library.
9441 * ecore.cs (Expression.ResolveBoolean): Use Location.Null for
9444 * location.cs (Reset): Reset static data.
9446 * namespace.cs (Reset): Reset static data.
9448 * report.cs (Report.Reset): Reset static data.
9450 * rootcontext.cs (RootContext.Reset): Reset static data.
9452 * tree.cs (RootTypes.ctor): Use Location.Null
9454 * typemanager.cs (TypeManager.Reset): Reset static data.
9455 (CoreLookupType): Removed Exit.
9456 (TypeHandle.Reset): Reset static data.
9458 2005-03-10 Raja R Harinath <rharinath@novell.com>
9461 * typemanager.cs (ComputeNamespaces): Import namespaces from
9462 referenced modules too.
9464 2005-03-09 Raja R Harinath <rharinath@novell.com>
9466 * class.cs (TypeContainer.AddToMemberContainer): Use "." rather
9469 2005-03-09 Raja R Harinath <rharinath@novell.com>
9471 * decl.cs (DeclSpace.LookupType): Don't loop but recurse into
9472 enclosing DeclSpace. This ensures that a name-lookup populates
9473 more caches and there are fewer 'TypeExpression's. Carve out
9474 nested type lookup into ...
9475 (LookupNestedTypeInHierarchy): ... this.
9477 2005-03-09 Raja R Harinath <rharinath@novell.com>
9479 Clean up a few partial-class semantics.
9480 Fixes test-357.cs and cs1618-2.cs.
9481 * cs-parser.jay (struct_declaration): Use 'current_class' as
9482 parent of newly-created struct. Remove call to Register ().
9483 Use 'pop_current_class' to complete handing the current struct.
9484 (interface_declaration): Likewise.
9485 (class_declaration): Likewise.
9486 (enum_declaration): Use 'current_class' as parent of newly created
9488 (delegate_declaration): Likewise.
9489 (pop_current_class): New function. This is used to handle closing
9490 up the 'current_class' and 'current_container', and pointing them
9491 to the enclosing class/container.
9492 (CSharpParser): Initialize 'current_class' too.
9493 * decl.cs (MemberCore): Add check for invariant: a partial
9494 container is not a parsed entity, and thus does not enclose any
9496 (DeclSpace.TypeResolveEmitContext): Expose 'type_resolve_ec'.
9497 (DeclSpace.BaseTypeExpr): Use it.
9498 (DeclSpace.LookupType): Add check for invariant.
9499 * class.cs (TypeContainer): Add check for invariant: a nested
9500 class should have the same NamespaceEntry as its enclosing class.
9501 (TypeContainer.EmitFieldInitializers): Make virtual.
9502 (TypeContainer.DefineDefaultConstructor): Adhere to invariant in
9504 (TypeContainer.Register): Remove.
9505 (TypeContainer.DefineType): Set the 'ec' of a PartialContainer to
9506 null. Use TypeResolveEmitContext for resolving base types and
9507 interfaces. Move initialization of Parts.TypeBuilder here from
9509 (TypeContainer.DefineNestedTypes): ... here.
9510 (PartialContainer): Take a Namespace not a NamespaceEntry.
9511 (PartialContainer.Create): Don't use Register. Call the
9512 appropriate Add... function directly.
9513 (ClassPart): Take both the PartialContainer and the enclosing
9514 class as constructor arguments.
9515 (ClassPart.EmitFieldInitializers): Override.
9516 (ClassPart.PartFindNestedTypes): Remove.
9517 (FieldBase.GetInitializerExpression): Resolve the initializer
9518 expression in the emit context of the enclosing class.
9519 * tree.cs (RootTypes): Remove Register ().
9521 2005-03-08 Marek Safar <marek.safar@seznam.cz>
9523 * cs-parser.jay: Removed CS0134.
9525 * driver.cs: Removed CS1901.
9527 * expression.cs (SizeOf.DoResolve): Don't report CS0233
9528 for predefined types.
9530 2005-03-07 Duncan Mak <duncan@novell.com>
9532 * codegen.cs (Save): Catch UnauthorizedAccessException as
9533 well. Fixes bug #73454.
9535 2005-03-07 Marek Safar <marek.safar@seznam.cz>
9537 * cs-tokenizer.cs (xtoken): Add CS1035.
9539 * class.cs (MethodData.Define): Add CS0683.
9540 (FieldMember.ctor): Add CS0681.
9542 2005-03-07 Raja R Harinath <rharinath@novell.com>
9544 * ecore.cs (SimpleName.DoResolve): Rename from
9545 SimpleName.DoResolveAllowStatic.
9546 (SimpleName.DoSimpleNameResolve): Remove 'allow_static' argument.
9547 Pass 'intermediate' flag to MemberStaticCheck.
9548 (SimpleName.MemberStaticCheck): Skip "static check" only in case
9549 of "intermediate" lookups via MemberAccess.
9550 (SimpleName.IdenticalNameAndTypeName): New. Carved out of ...
9551 * expression.cs (MemberAccess.IdenticalNameAndTypeName): ... this.
9553 2005-03-07 Raja R Harinath <rharinath@novell.com>
9556 * ecore.cs (FieldExpr.EmitInstance): Catch cases of CS0120 that
9557 slipped in because of variable names that are identical to a
9558 builtin type's BCL equivalent ('string String;', 'int Int32;').
9559 (PropertyExpr.EmitInstance): Likewise.
9561 2005-03-04 Marek Safar <marek.safar@seznam.cz>
9563 * cs-tokenizer.cs (PreProcessPragma): Add warning 1633, 1635.
9565 * report.cs (warning_ignore_table): Made public.
9567 2005-03-04 Raja R Harinath <rharinath@novell.com>
9570 * class.cs (MethodData.Emit): Pass 'container' to
9571 container.GetObsoleteAttribute instead of 'container.Parent'.
9573 2005-03-03 Marek Safar <marek.safar@seznam.cz>
9575 * cs-parser.jay: Add 1534 error test.
9577 * iterators.cs (Yield.CheckContext): Add error 1629.
9578 (Iterator.ctor): Save unsafe modifier.
9579 (MoveNextMethod.DoEmit): Restore unsafe context.
9581 * namespace.cs (UsingAlias): Better error message.
9583 2005-03-03 Dan Winship <danw@novell.com>
9585 * convert.cs (Error_CannotImplicitConversion): fix two bugs in
9586 the warning message [#73219]
9588 2005-03-03 Raja R Harinath <rharinath@novell.com>
9590 Fix compile with MCS 1.0.0.0.
9591 * cs-tokenizer.cs (PreProcessPragma): Simplify w_disable and
9592 w_restore to not depend on string constant folding.
9594 2005-03-03 Raja R Harinath <rharinath@novell.com>
9596 * decl.cs (DeclSpace.LookupType): Remove 'silent' argument. Move
9597 CS0246 check to users who passed 'silent = false'.
9598 * ecore.cs (TypeLookupExpression.DoResolveAsTypeStep): Add CS0246
9600 (SimpleName.SimpleNameResolve): Update.
9601 * expression.cs (ComposedCast.DoResolveAsTypeStep): Add CS0246 check.
9602 (MemberAccess.IdenticalNameAndTypeName): Update.
9603 * doc.cs (FindDocumentedTypeNonArray): Update.
9605 2005-03-03 Raja R Harinath <rharinath@novell.com>
9607 * codegen.cs (EmitContext): Remove ResolvingTypeTree.
9608 * parameters.cs (ComputeAndDefineParameters): Remove.
9609 * decl.cs (ResolveBaseTypeExpr): Don't set ResolvingTypeTree.
9610 * delegate.cs (Define): Don't invoke ComputeAndDefineParameters.
9611 Use GetParameterInfo.
9613 2005-03-02 Marek Safar <marek.safar@seznam.cz>
9615 * report.cs (StaticClass.DefineContainerMembers): Add warning 628.
9617 2005-03-02 Raja R Harinath <rharinath@novell.com>
9619 Unify DeclSpace.LookupType and DeclSpace.FindType.
9620 * decl.cs (DeclSpace.FindNestedType): New virtual function. This
9621 is in charge of defining nested types on demand.
9622 (DeclSpace.LookupType): Use it when the current_type is a
9623 TypeBuilder. Use LookupTypeDirect for reflected types.
9624 (DeclSpace.FindType): Remove.
9625 (DeclSpace.LookupInterfaceOrClass): Likewise.
9626 (DeclSpace.DefineTypeAndParents): Likewise.
9627 * ecore.cs (SimpleName.ResolveAsTypeStep): Just call
9628 DeclSpace.LookupType.
9629 * doc.cs (FindDocumentedTypeNonArray): Use DeclSpace.LookupType.
9630 * typemanager.cs (LookupType): Simplify.
9631 (AddUserType): Remove type from negative_hits.
9632 * namespace.cs (Namespace.Lookup): Use TypeManager.LookupTypeDirect.
9633 * class.cs (TypeContainer.FindMembers): Move handling of nested
9635 (TypeContainer.FindMembers_NestedTypes): ... here.
9636 (TypeContainer.FindNestedType): Implement override.
9637 (ClassPart.FindNestedType): Delegate to PartialContainer.
9638 (ClassPart.PartFindNestedType): Looks up the nested types of the
9641 2005-03-02 Martin Baulig <martin@ximian.com>
9643 * class.cs (TypeContainer.DoDefineMembers): We also need a default
9644 static constructor in static classes.
9646 2005-03-01 Zoltan Varga <vargaz@freemail.hu>
9648 * attribute.cs: Pass -1 to DefineLPArrayInternal if sizeConst or
9649 sizeParamIndex is not specified.
9651 2005-03-01 Marek Safar <marek.safar@seznam.cz>
9654 * report.cs (WarningMessage.IsEnabled): Missing null check.
9656 2005-02-28 Marek Safar <marek.safar@seznam.cz>
9658 * attribute.cs (DefinePInvokeMethod): Fix, all data are stored
9659 in the fields and not in the properties.
9661 2005-02-28 Zoltan Varga <vargaz@freemail.hu>
9663 * attribute.cs (GetMarshal): Marshal SizeConst and SizeParamIndex
9666 2005-02-28 Marek Safar <marek.safar@seznam.cz>
9668 * attribute.cs: Small refactoring (improved robustness).
9669 (ImplOptions, UnmanagedType, UsageAttribute): Removed members.
9670 (ValidateGuid): Removed.
9671 (Resolve): Removed referenced to above mentioned.
9672 (GetAttributeUsage): Made private and changed to work without
9674 (GetIndexerAttributeValue): Don't crash.
9675 (GetConditionalAttributeValue): Ditto.
9676 (GetClsCompliantAttributeValue): Ditto.
9677 (ExtractSecurityPermissionSet): All attributes exceptions are
9679 (GetPropertyValue): New helper.
9680 (GetMethodImplOptions): New method.
9681 (DefinePInvokeMethod): Reuse common code. Implemented handling of
9682 some missing properties.
9684 * class.cs (ClassOrStruct.ApplyAttributeBuilder): Updated.
9685 (Method.ApplyAttributeBuilder): Updated.
9687 * decl.cs (DeclSpace.ApplyAttributeBuilder): Don't catch shared
9690 2005-02-28 Raja R Harinath <rharinath@novell.com>
9693 * report.cs (Report.SymbolRelatedToPreviousError): Handle
9694 non-simple types (array, pointer, reference).
9696 2005-02-28 Marek Safar <marek.safar@seznam.cz>
9698 * cs-parser.jay: Add errors 1617, 650, 1007, 531, 547, 548
9700 * class.cs (MethodCore.IsDuplicateImplementation): Special error
9702 (Method.CheckBase): Catch wrong destructor here.
9703 (MethodData.Define): Add errors 550, 668.
9705 * cs-tokenizer.cs (PreProcessPragma): Add warning 1634.
9707 * ecore.cs (PropertyExpr.DoResolveLValue): Fixed wrong error code.
9709 * pending.cs (VerifyPendingMethods): Add error 551.
9711 * typemanager.cs (CSharpName): Next error report helper.
9713 2005-02-25 Marek Safar <marek.safar@seznam.cz>
9715 * attribute.cs (Atttribute.Resolve): Add cache for parameter-less
9716 attributes. Removed useless attribute double check.
9717 It saves almost 2MBs for corlib.
9719 2005-02-25 Raja R Harinath <rharinath@novell.com>
9722 * statement.cs (ExpressionStatement.Resolve): Make robust to being
9723 called twice in case of error.
9725 2005-02-23 Chris Toshok <toshok@ximian.com>
9727 Fix compiler portions of #72827.
9728 * statement.cs (Block.Emit): call Begin/EndScope on the
9729 EmitContext instead of the ILGenerator.
9731 * codegen.cs (EmitContext.BeginScope): new method, call
9732 ILGenerator.BeginScope as well as the SymbolWriter's OpenScope (if
9734 (EmitContext.BeginScope): same, but EndScope and CloseScope
9736 * symbolwriter.cs (SymbolWriter.OpenScope): get the current il
9737 offset and call the superclass's OpenScope(int) with it.
9738 (SymbolWriter.CloseScope): get the current il
9739 offset and call superclass's CloseScope(int) with it.
9741 2005-02-23 Marek Safar <marek.safar@seznam.cz>
9743 * anonymous.cs (AnonymousMethod.Compatible): Fixed to report
9744 CS1677 for out and ref as well.
9746 * class.cs (Method.Define): Add error CS1599 detection.
9748 * cs-parser.jay: Add CS1609, CS1670, CS1627 detection.
9750 * cs-tokenizer.cs (xtoken): Add error CS1646 detection.
9752 * delegate.cs (Delegate.Define): Add error CS1599 detection.
9754 * support.cs.cs (ModifierDesc): New helper method.
9756 2005-02-23 Raja R Harinath <rharinath@novell.com>
9757 Abin Thomas <projectmonokochi@rediffmail.com>
9758 Anoob V E <projectmonokochi@rediffmail.com>
9759 Harilal P R <projectmonokochi@rediffmail.com>
9762 * class.cs (ConstructorBuilder.Resolve): Make sure that the second
9763 MemberLookup (used for error reporting) actually returns a result.
9764 Fix error report number (122, not 112).
9766 2005-02-22 Abin Thomas <projectmonokochi@rediffmail.com>
9767 Anoob V E <projectmonokochi@rediffmail.com>
9768 Harilal P R <projectmonokochi@rediffmail.com>
9771 * pending.cs (PendingImplementation.GetAbstractMethods):
9772 Find NonPublic members too.
9774 2005-02-22 Marek Safar <marek.safar@seznam.cz>
9776 * expression.cs.cs (ConditionalLogicalOperator.DoResolve):
9779 * class.cs (MethodCore.CheckMethodAgainstBase):
9780 Add error 239 report.
9782 2005-02-21 Raja R Harinath <rharinath@novell.com>
9785 * expression.cs (Invocation.IsApplicable): Make public.
9786 (Invocation.IsParamsMethodApplicable): Likewise.
9787 * delegate.cs (Delegate.VerifyApplicability): Don't use
9788 Invocation.VerifyArgumentCompat for parameter applicability
9789 testing. Use Invocation.IsApplicable and
9790 Invocation.IsParamsMethodApplicable.
9792 2005-02-21 Marek Safar <marek.safar@seznam.cz>
9794 * ecore.cs (PropertyExpr.DoResolve): Add error 214 report.
9796 * class.cs (Operator.Define): Add error 217 report.
9798 2005-02-21 Raja R Harinath <rharinath@novell.com>
9800 * namespace.cs (UsingEntry.Resolve): Undo change below.
9802 2005-02-21 Raja R Harinath <rharinath@novell.com>
9805 * ecore.cs (Expression.MemberLookupFailed): Add argument to
9806 disable the error message when the extended MemberLookup also
9808 (Expression.MemberLookupFinal): Update.
9809 (SimpleName.DoSimpleNameResolve): Update.
9810 * expression.cs (MemberAccess.ResolveNamespaceOrType):
9811 Don't use MemberLookupFinal.
9812 (New.DoResolve): Update.
9813 (BaseAccess.CommonResolve): Update.
9815 2005-02-21 Raja R Harinath <rharinath@novell.com>
9818 * attribute.cs (Attribute.ResolveType): If a 'resolve_error' had
9819 occured previously, don't resolve again.
9821 2005-02-21 Marek Safar <marek.safar@seznam.cz>
9824 * attribute.cs (Attribute.GetAttributeUsage): Add EmitContext
9825 argument. Call ResolveAttributeUsage for unresolved.
9826 when types doesn't match ctor arguments.
9828 * class.cs (DoDefineMembers.TypeContainer): Removed safety check
9829 for nested attribute classes.
9830 (Class.attribute_usage): Removed.
9831 (Class.ResolveAttributeUsage): Resolves AttributeUsageAttribute
9832 for attribute class.
9834 * ecore.cs (IsAttribute): Removed.
9836 * namespace.cs (UsingEntry.Resolve): Don't destroy NamespaceEntry.
9838 * rootcontext.cs (RegisterAttribute): Removed, attributes are
9840 (attribute_types): Removed.
9841 (EmitCode): Global attributes are emited as the latest.
9843 2005-02-18 Marek Safar <marek.safar@seznam.cz>
9845 * class.cs (EmitFieldInitializers): Don't emit field initializer
9846 for default values when optimilization is on.
9848 * constant.cs (Constant.IsDefaultValue): New property.
9850 * driver.cs: Add /optimize handling.
9854 * literal.cs: Implement new IsDefaultValue property.
9856 * rootcontext.cs (Optimize): New field, holds /optimize option.
9858 2005-02-18 Raja R Harinath <rharinath@novell.com>
9860 Fix crasher in re-opened #72347.
9861 * namespace.cs (Namespace.Lookup): Return null if
9862 DeclSpace.DefineType returns null.
9865 * expression.cs (Argument.Resolve): Handle a case of CS0120 here.
9867 2005-02-18 Raja R Harinath <rharinath@novell.com>
9869 Fix remainder of #63202. Change semantics of DoResolveLValue: it
9870 now returns null if it cannot resolve to an lvalue.
9871 * ecore.cs (Expression.DoResolveLValue): Return 'null' by default.
9872 (Expression.ResolveLValue): Emit CS0131 error if DoResolveLValue
9873 returned null. Remove check for SimpleName.
9874 (EventExpr.DoResolveLValue): New.
9875 * iterators.cs (Iterator.FieldExpression.DoResolveLValue): New.
9876 * expression.cs (Argument.Error_LValueRequired): New. Move CS1510
9878 (Argument.Resolve): ... here. Use it. Use DoResolveLValue to
9880 (Unary.ResolveOperator): Move CS0211 check ...
9881 (Unary.DoResolve): ... here. Use DoResolveLValue to avoid
9883 (Unary.DoResolveLValue): Simplify.
9884 (AddressOf.DoResolveLValue): New.
9885 (ArrayAccess.DoResolveLValue): New.
9887 2005-02-16 Marek Safar <marek.safar@seznam.cz>
9889 * attribute.cs (Attribute.Resolve): Add arguments casting for
9890 when types doesn't match ctor arguments.
9892 2005-02-16 Raja R Harinath <rharinath@novell.com>
9894 Fix parts of #63202.
9895 * expression.cs (UnaryMutator.ResolveOperator): Remove redundant
9896 lookup of operator in base type. Ensure that all checks happen
9897 when the operator resolves to an "op_..." method.
9899 2005-02-15 Raja R Harinath <rharinath@novell.com>
9902 * namespace.cs (NamespaceEntry.LookupNamespaceOrType): Add
9903 'ignore_cs0104' parameter. Pass it to ...
9904 (NamespaceEntry.Lookup): ... this.
9905 * decl.cs (DeclSpace.LookupType): Add 'ignore_cs0104' parameter.
9906 * ecore.cs (SimpleName.ResolveAsTypeStep): Update.
9907 (TypeLookupExpression.DoResolveAsTypeStep): Update.
9908 * expression.cs (MemberAccess.IdenticalNameAndTypeName):
9909 Update. Request that cs0104 errors be ignored.
9910 (ComposedCast.ResolveAsTypeStep): Update.
9912 2005-02-14 Raja R Harinath <rharinath@novell.com>
9915 * expression.cs (Invocation.BetterFunction): Remove support for
9916 comparing virtual functions and their overrides.
9917 (Invocation.IsOverride): New.
9918 (Invocation.OverloadResolve): Don't consider 'override' functions
9919 during candidate selection. Store them in a lookaside list.
9920 If the selected method is a 'virtual' function, use the list to
9921 find any overrides that are closer to the LHS type.
9923 2005-02-14 Marek Safar <marek.safar@seznam.cz>
9925 * expression.cs (New.DoResolve): Add complex core type reduction.
9926 (New.Constantify): Converts complex core type syntax like 'new int ()'
9929 2005-02-14 Raja R Harinath <rharinath@novell.com>
9931 * decl.cs (EntryType.EntryType): New constructor to create an
9932 updated copy of a cache entry.
9933 (MemberCache.AddMethods): Use it.
9934 (MemberCache.ClearDeclaredOnly): Remove.
9935 (MemberCache.MemberCache): Update.
9937 2005-02-11 Miguel de Icaza <miguel@novell.com>
9939 * codegen.cs (EmitContext): Introduce the `MethodIsStatic'
9940 variable. This one is represents the actual low-level declaration
9941 of the method, as opposed to the semantic level `IsStatic'.
9943 An anonymous method which is hosted into a static method might be
9944 actually an instance method. IsStatic would reflect the
9945 container, while MethodIsStatic represents the actual code
9948 * expression.cs (ParameterReference): Use the new MethodIsStatic
9949 instead of IsStatic.
9951 * anonymous.cs (AnonymousMethod.Compatible): Pass the
9952 Modifiers.STATIC to the Anonymous' Method EmitContext if static is
9953 set on the current EmitContext.
9955 * expression.cs (Cast): Overload DoResolveLValue so we can pass
9956 resolve our casted expression as an LValue. This triggers the
9957 proper LValue processing that is later required by Assign.
9961 * cs-tokenizer.cs (pp_and): recurse on pp_and, fixes #61903.
9963 2005-02-11 Marek Safar <marek.safar@seznam.cz>
9965 C# 2.0 Fixed buffer implementation
9967 * anonymous.cs: Update after RegisterHelperClass renaming.
9969 * attribute.cs (AttributeTester.fixed_buffer_cache):
9970 Cache of external fixed buffers.
9971 (AttributeTester.GetFixedBuffer): Returns IFixedBuffer
9972 implementation if field is fixed buffer else null.
9975 (TypeContainer.AddField): Accept FieldMember instead of Field.
9976 (FieldBase.IsFieldClsCompliant): Extracted code from
9977 VerifyClsCompliance descendant customization.
9978 (FixedField): New class handles fixed buffer fields.
9979 (FixedFieldExternal): Keeps information about imported fixed
9981 (IFixedField): Make access to internal or external fixed buffer
9984 * cs-parser.jay: Add fixed buffer parsing.
9986 * ecore.cs (FieldExpr.Emit): Add special emit case for fixed
9989 * expression.cs (Indirection): Extended implementation to accept
9991 (PointerArithmetic.Emit): Get element from fixed buffer as well.
9992 (ElementAccess.MakePointerAccess): Get type as parameter.
9993 (DoResolve): Add fixed buffer field expression conversion.
9994 (DoResolveLValue): Ditto.
9995 (FixedBufferPtr): New class. Moved most of original ArrayPtr.
9996 (ArrayPtr): Derives from FixedBufferPtr.
9997 (ArrayPtr.Emit): Add extra emit for array elements.
9999 * flowanalysis.cs.cs (StructInfo): Use FieldMember.
10001 * rootcontext.cs (CloseTypes): Emit CompilerGenerated attribute
10002 for compiler generated types.
10003 (RegisterCompilerGeneratedType): Renamed from RegisterHelperClass.
10005 * statement.cs (Fixed): Refactored to be easier add fixed buffer
10006 and consume less memory.
10007 (Fixed.Resolve): Add fixed buffer case.
10009 * typemanager.cs (compiler_generated_attr_ctor,
10010 fixed_buffer_attr_ctor): Add new 2.0 compiler attributes.
10011 (HasElementType): Add our own implementation to work on every
10014 2005-02-11 Miguel de Icaza <miguel@novell.com>
10016 * anonymous.cs (CaptureContext): Track whether `this' has been
10019 * expression.cs (This.ResolveBase): Call CaptureThis. Before we
10020 only captured `this' if it was implicitly done (instance
10021 methods/variables were used).
10023 * codegen.cs (EmitContext.CaptureThis): New method to flag that
10024 `this' must be captured.
10026 2005-01-30 Miguel de Icaza <miguel@novell.com>
10028 * anonymous.cs (CreateMethodHost): If there Scope.ScopeTypeBuilder
10029 is null it means that there has been no need to capture anything,
10030 so we just create a sibling.
10032 Renamed `EmitHelperClasses' to `EmitAnonymousHelperClasses'
10034 Just a partial fix. The other half is fairly elusive.
10036 2005-02-10 Raja R Harinath <rharinath@novell.com>
10038 Fix #52586, cs0121-4.cs.
10039 * decl.cs (MemberCache.DeepCopy): Rename from SetupCache. Take
10040 and return a hashtable.
10041 (MemberCache.ClearDeclaredOnly): New.
10042 (MemberCache.MemberCache): Update to change. Make a deep copy of
10043 the method_hash of a base type too.
10044 (MemberCache.AddMethods): Adapt to having a deep copy of the base
10045 type methods. Overwrite entries with the same MethodHandle so
10046 that the ReflectedType is correct. The process leaves in base
10047 virtual functions and their overrides as distinct entries.
10048 (CacheEntry): Now a class instead of a struct. It shouldn't alter
10049 matters since it was boxed in a ArrayList before.
10050 (CacheEntry.Member, CacheEntry.EntryType): Remove 'readonly'
10052 * expression.cs (Invocation.BetterFunction): Simplify. Handle the
10053 case of a virtual function and its override (choose the overload
10055 (Invocation.OverloadResolve): Avoid 'override' members during
10056 'applicable_type' calculation.
10058 2005-02-09 Raja R Harinath <rharinath@novell.com>
10060 Combine two near-redundant caches.
10061 * typemanager.cs (method_params): Rename from method_internal_params.
10062 (TypeManager.GetParameterData): New. Replace
10063 Invocation.GetParameterData.
10064 (TypeManager.LookupParametersByBuilder): Remove.
10065 * expression.cs (Invocation.method_parameter_cache): Remove.
10066 (Invocation.GetParameterData): Remove.
10068 * anonymous.cs, attribute.cs, convert.cs, delegate.cs:
10071 2005-02-08 Raja R Harinath <rharinath@novell.com>
10074 * delegate.cs (Delegate.DefineType): When bootstrapping corlib, if
10075 TypeManager.multicast_delegate_type is null, resolve it by looking
10076 up "System.MulticastDelegate".
10077 * rootcontext.cs (RootContext.ResolveCore): Simplify.
10079 2005-02-07 Abin Thomas (NOSIP) <projectmonokochi@rediffmail.com>
10080 Anoob V.E (NOSIP) <projectmonokochi@rediffmail.com>
10081 Harilal P.R (NOSIP) <projectmonokochi@rediffmail.com>
10084 * statement.cs (LabeledStatement.Resolve): Don't set 'referenced'.
10085 (LabeledStatement.AddReference): New. Set 'referenced'.
10086 (Goto.Resolve): Use it.
10088 2005-02-05 John Luke <john.luke@gmail.com>
10090 * driver.cs: remove duplicate -doc line in Usage ()
10092 2005-02-04 Raja R Harinath <rharinath@novell.com>
10094 * location.cs (Location.AddFile): Fix CS2002 error report.
10096 2005-02-02 Martin Baulig <martin@ximian.com>
10098 * delegate.cs (Delegate.DefineType): Report an internal error if
10099 TypeManager.multicast_delegate_type is null. See bug #72015 for
10102 2005-02-02 Raja R Harinath <rharinath@novell.com>
10104 Fix a crasher in a variant of #31984.
10105 * const.cs (Constant.CheckBase): New override that defers the
10106 new-or-override check in case the base type hasn't been populated
10108 (Constant.Define): Ensure the new-or-override check is performed.
10110 2005-02-01 Duncan Mak <duncan@ximian.com>
10112 * const.cs (LookupConstantValue): Check that `ce' is not null
10113 before calling GetValue ().
10115 2005-02-01 Raja R Harinath <rharinath@novell.com>
10117 Fix test-334.cs (#69519).
10118 * cs-parser.jay (using_alias_directive): Pass in an expression to
10119 NamespaceEntry.UsingAlias.
10120 (using_namespace_directive): Pass in an expression to
10121 NamespaceEntry.Using.
10122 (namespace_name): Don't flatten to a string.
10123 * namespace.cs (NamespaceEntry.AliasEntry): Store an expression.
10124 (NamespaceEntry.AliasEntry.Resolve): Lookup using
10126 (NamespaceEntry.UsingEntry): Likewise.
10127 (NamespaceEntry.Using,NamespaceEntry.UsingAlias): Update to
10129 (NamespaceEntry.LookupForUsing): Remove.
10130 (NamespaceEntry.LookupNamespaceOrType): Add support for dotted
10132 (NamespaceEntry.Lookup): Remove support for dotted names.
10134 2005-02-01 Raja R Harinath <rharinath@novell.com>
10136 * namespace.cs (NamespaceEntry.NamespaceEntry): Simplify, and
10138 (NamespaceEntry.ImplicitParent): Compute on demand.
10139 (NamespaceEntry.Doppelganger): New implicit namespace-entry that
10140 parallels the current.
10141 (NamespaceEntry.LookupForUsing): Use it.
10142 (NamespaceEntry.Lookup): If the current namespace-entry is
10143 implicit, don't search aliases and using tables.
10145 2005-02-01 Raja R Harinath <rharinath@novell.com>
10148 * class.cs (TypeContainer.DoDefineMembers): Don't initialize
10150 (TypeContainer.BaseCache): Compute on demand.
10151 (TypeContainer.FindMembers): Define constants and types if they're
10152 not already created.
10153 (FieldMember.Define): Move resetting of ec.InUnsafe before error
10155 * const.cs (Constant.Define): Make idempotent.
10157 2005-01-29 Miguel de Icaza <miguel@novell.com>
10159 * pending.cs: Produce better code (no nops produced by using Ldarg
10162 * pending.cs (PendingImplementation.DefineProxy): It was not `arg
10163 i - 1' it should be arg + 1.
10167 2005-01-28 Raja R Harinath <rharinath@novell.com>
10169 * attribute.cs (Attribute.CheckAttributeType): Make private
10171 (Attribute.ResolveType): Make virtual.
10172 (GlobalAttribute.ResolveType,GlobalAttribute.Resolve): Simplify
10173 handling of RootContext.Tree.Types.
10175 2005-01-27 Raja R Harinath <rharinath@novell.com>
10177 Update attribute-handling to use the SimpleName/MemberAccess
10179 * cs-parser.jay (attribute): Pass in an expression to the
10180 constructors of Attribute and GlobalAttribute.
10181 * attribute.cs (Attribute): Take an expression for the name.
10182 (Attribute.ResolvePossibleAttributeTypes): New. Resolves the
10183 passed in attribute name expression.
10184 (Attribute.CheckAttributeType): Use it.
10185 * ecore.cs (FullNamedExpression.ResolveAsTypeStep): New.
10186 * expression.cs (MemberAccess.ResolveAsTypeStep): Move body to ...
10187 (MemberAccess.ResolveNamespaceOrType): ... here. Add 'silent'
10188 argument to prevent error messages if the lookup fails.
10190 2005-01-27 Marek Safar <marek.safar@seznam.cz>
10192 * expression.cs (Indirection): Implemented IVariable interface
10193 to support indirection in AddressOf operator.
10194 (PointerArithmetic.Emit): Add optimalization for case where
10195 result can be precomputed.
10197 2005-01-26 Martin Baulig <martin@ximian.com>
10199 * class.cs (TypeContainer.AttributeTargets): Return the correct
10200 AttributeTargets depending on our `Kind' instead of throwing an
10201 exception; fixes #71632.
10203 2005-01-26 Marek Safar <marek.safar@seznam.cz>
10206 * expression.cs (MemberAccess.ResolveMemberAccess): Add CS0176 test for
10209 2005-01-25 Raja R Harinath <rharinath@novell.com>
10212 * expression.cs (MemberAccess.DoResolve): Don't complain with
10213 cs0572 when the LHS of a member access has identical name and type
10216 2005-01-25 Marek Safar <marek.safar@seznam.cz>
10219 * attribute.cs (ExtractSecurityPermissionSet): Catch exceptions from
10221 Create custom PermissionSet only for PermissionSetAttribute.
10223 2005-01-24 Marek Safar <marek.safar@seznam.cz>
10226 * class.cs (StaticClass.DefineContainerMembers): Enable enums and
10227 delegates in static class.
10229 2005-01-24 Martin Baulig <martin@ximian.com>
10231 * flowanalysis.cs (FlowBranching.UsageVector.MergeChild): If we're
10232 merging an implicit block, just use its reachability.
10234 * statement.cs (Block.Resolve): Make the unreachable code check
10235 work wrt. implicit blocks; see test-337 from #63842.
10237 2005-01-21 Alp Toker <alp@atoker.com>
10239 * cs-parser.jay: destructor_declaration's container is PartialContainer
10240 not Class when partial types are used, so use Kind prop instead of
10243 2005-01-22 Miguel de Icaza <miguel@ximian.com>
10245 * cs-parser.jay: Improve error reporting when an interface
10246 declares new types.
10248 2005-01-20 Dick Porter <dick@ximian.com>
10250 * support.cs: SeekableStreamReader fix from Sandor Dobos
10251 (dobos_s@ibcnet.hu) to cope with Position setting when multibyte
10252 chars are read. Fixes bug 70369.
10254 2005-01-20 Raja R Harinath <rharinath@novell.com>
10256 * cs-parser.jay (catch_clause): Simplify current_block handling
10259 2005-01-17 Miguel de Icaza <miguel@ximian.com>
10261 * convert.cs (ImplicitStandardConversionExists): Synchronize the
10262 code with ImplicitStandardConversion to handle the implicit
10263 conversion of method groups into valid delegate invocations.
10265 The problem is that in parameter handling we were using this code
10266 path. Fixes bug #64698
10268 2005-01-19 Raja R Harinath <rharinath@novell.com>
10270 * cs-parser.jay: Fix several infelicities.
10271 - Avoid assigning to the parser value stack. Code like
10272 '$3 = null' is unclean. Synthesize a value for the code block
10274 - Avoid using oob_stack for storing location information. Use ...
10275 (_mark_): ... this. New (empty) rule. Saves the current location
10277 (foreach_statement): Avoid using oob_stack for current_block
10278 handling. Use technique used in for_statement and
10279 using_statement. Synthesize a value for the code block to store
10280 additional intermediate information.
10282 2005-01-13 Miguel de Icaza <miguel@ximian.com>
10284 * ecore.cs (IsAccessorAccessible): Accessibility to private fields
10285 of a different type is only allowed to private fields of a
10286 containing type, not on fields of a base class.
10288 See test-174.cs and error cs0122-9.cs
10290 2005-01-13 Raja R Harinath <rharinath@novell.com>
10292 Fix test-335.cs (bug #58126).
10293 * cs-parser.jay (argument): Split out non-expression parts of the
10294 rule into 'non_simple_argument'.
10295 (invocation_expression): Support parenthesized invocations with
10296 multiple arguments, and with single non-simple arguments.
10298 2005-01-13 Raja R Harinath <rharinath@novell.com>
10300 * cs-tokenizer.cs (xtoken): Reset 'comments_seen' in a couple more
10303 2005-01-12 Raja R Harinath <rharinath@novell.com>
10305 Fix cs0038-1.cs, cs1640-6.cs.
10306 * ecore.cs (Expression.Resolve): Remove special-case for
10307 SimpleName in error-handling.
10308 (Expression.almostMatchedMembers): Relax access permission to
10310 (Expression.MemberLookupFailed): Handle duplicates in
10311 almostMatchedMembers list.
10312 (SimpleName.DoSimpleNameResolve): Catch CS0038 errors earlier.
10313 * expression.cs (New.DoResolve): Report CS1540 for more cases.
10314 * typemanager.cs (GetFullNameSignature): Use the MethodBase
10315 overload if the passed in MemberInfo is a MethodBase.
10317 2005-01-12 Marek Safar <marek.safar@seznam.cz>
10320 * attribute.cs (ExtractSecurityPermissionSet): Don't report error
10321 for non-CAS & merge permission sets properly.
10323 2005-01-11 Raja R Harinath <rharinath@novell.com>
10325 Improve standard-compliance of simple name and member access
10326 resolution. Fixes bugs #52697, #57200, #67520, #69519.
10327 * ecore.cs (FullNamedExpression): New abstract base class
10328 for Namespaces and TypeExpressions.
10329 (ResolveFlags.SimpleName): Remove.
10330 (SimpleName): Remove support for dotted names.
10331 (SimpleName.ResolveAsTypeStep): Simplify. Now just a wrapper to
10332 DeclSpace.FindType and DeclSpace.LookupType.
10333 (SimpleName.DoSimpleNameResolve): Remove support for dotted names.
10334 (Expression.ExprClassName): Make member function.
10335 * expression.cs (MemberAccess.ResolveAsTypeStep): Support LHS being
10336 a namespace. Remove creation of dotted "SimpleName"s.
10337 (MemberAccess.DoResolve): Likewise.
10338 * decl.cs (DeclSpace.Cache): Make private.
10339 (DeclSpace.LookupInterfaceOrClass): Return a FullNamedExpression.
10340 (DeclSpace.FindType): Update.
10341 (DeclSpace.LookupType): Move here from RootContext. Return a
10342 FullNamedExpression.
10343 * namespace.cs (Namespace): Derive from FullNamedExpression
10344 so that it can be part of expression resolution.
10345 (Namespace.Lookup): Return an FullNamedExpression.
10346 (NamespaceEntry.LookupAlias): Lookup aliases only in current
10348 * rootcontext.cs (NamespaceLookup): Remove.
10349 (LookupType): Move to DeclSpace.
10350 * attribute.cs (CheckAttributeType): Update.
10351 * doc.cs (FindDocumentedType): Remove allowAlias argument.
10352 (FindDocumentedTypeNonArray): Likewise.
10354 2005-01-11 Raja R Harinath <rharinath@novell.com>
10356 Fix cs0509.cs, cs1632.cs.
10357 * class.cs (TypeContainer.GetNormalBases): Don't assume !IsClass
10358 is the same as IsInterface.
10359 (TypeContainer.GetClassBases): Likewise.
10360 * statement.cs (LabeledStatement.ig): New field.
10361 (LabeledStatement.LabelTarget): Save ILGenerator which created the
10363 (LabeledStatement.DoEmit): Check that the label was created with
10364 the same ILGenerator.
10366 2005-01-10 Marek Safar <marek.safar@seznam.cz>
10369 * attribute.cs (GetMethodObsoleteAttribute): Need to transform
10370 accessors to its properties.
10372 * ecore.cs (PropertyExpr): Add AccessorTable to help track back
10373 from accessors to property.
10375 2005-01-10 Marek Safar <marek.safar@seznam.cz>
10378 * class.cs (MethodCore.CheckBase): Test base method obsoleteness
10379 only for overrides.
10381 2005-01-08 Miguel de Icaza <miguel@ximian.com>
10383 * attribute.cs: Check for null and empty strings.
10385 I have lost another battle to Paolo.
10387 2005-01-07 Marek Safar <marek.safar@seznam.cz>
10390 * class.cs (PropertyMethod): Set Parent field in ctors.
10391 (SetMethod.InternalParameters): Add unsafe switch hack.
10392 Override MarkForDuplicationCheck where it is appropriate.
10394 * decl.cs (MemberCore.MarkForDuplicationCheck): New method.
10395 It says whether container allows members with the same name.
10396 Base default is no.
10397 (DeclSpace.AddToContainer): Use MarkForDuplicationCheck.
10398 Removed is_method parameter.
10400 2005-01-06 Duncan Mak <duncan@ximian.com>
10402 * cs-tokenizer.cs (xtoken): Redo the work for signaling CS1040
10403 because the previous change led to incorrect reporting of CS1032
10404 ("Cannot define/undefine preprocessor symbols after first token in
10405 file"). Instead of using `tokens_seen' as the only flag that
10406 triggers CS1040, introduce `comments_seen'. This new flag is used
10407 to signify having seen comments on the current line, so it is
10408 unset after a newline.
10410 2005-01-06 Atsushi Enomoto <atsushi@ximian.com>
10412 * doc.cs : When searching for a type, find nested type too.
10413 This fixes bug #71040.
10415 2005-01-06 Atsushi Enomoto <atsushi@ximian.com>
10418 - Warn missing member comment on those classes which also does not
10419 have doc comments. Fixed bug #71041.
10420 - Don't warn missing doc comment on default constructor.
10423 2005-01-06 Duncan Mak <duncan@ximian.com>
10425 * cs-tokenizer.cs (xtoken): After handling traditional C-style
10426 comments, set `tokens_seen' to true. This allows us to detect
10427 misplaced preprocessor directives (i.e. not at the beginning of
10428 the a line, nor after whitespaces). In that case, report error
10429 CS1040. This fixes bug #56460.
10431 * cs-parser.jay (interface_member_declaration): Add checks for
10432 IsExplicitImpl, and report CS0541 error if an interface member is
10433 defined as an explicit interface declaration.
10435 2005-01-06 Marek Safar <marek.safar@seznam.cz>
10438 * class.cs (PropertyMethod): Set Parent field in ctors.
10439 (SetMethod.InternalParameters): Add unsafe switch hack.
10441 * decl.cs (MemberCore.Parent): Cannot be readonly.
10443 2005-01-06 Raja R Harinath <rharinath@novell.com>
10445 * decl.cs (DeclSpace.ResolveType): Remove.
10446 (DeclSpace.ResolveBaseTypeExpr): Rename from ResolveTypeExpr.
10447 Merge in code from ...
10448 (DeclSpace.GetTypeResolvingEmitContext): ... here. Remove.
10449 * class.cs, enum.cs: Update to changes.
10451 2005-01-06 Miguel de Icaza <miguel@ximian.com>
10453 * anonymous.cs: Ensure that we init the scope of our parent if it
10454 has not been initialized yet.
10456 2004-12-30 Duncan Mak <duncan@ximian.com>
10458 * typemanager.cs (TypeManager.CheckStructCycles): Don't crash here
10459 if field.FieldBuilder is null. Fixes #70758.
10461 * convert.cs: Fixed some typos and updated some of the comments.
10462 (ImplicitStandardConversionExists):
10463 (TryImplicitIntConversion): If `target_type' is an interface and
10464 the type of `ic' implements this interface, return true or a new
10465 BoxedCast instead of null. This fixes #70468.
10467 2004-12-29 Duncan Mak <duncan@ximian.com>
10469 * expression.cs (Argument.Emit): Check that Expr is
10470 IMemoryLocation before casting to it, and report CS1510 otherwise.
10474 2004-12-21 Ben Maurer <bmaurer@ximian.com>
10476 * statement.cs (Block.ThisVariable): remove the recursion here, to
10477 make the --profile more sane.
10479 2004-12-17 Carlos Cortez <calberto.cortez@gmail.com>
10481 * driver.cs: Patch to handle a xsp bug that prevents to reference an .exe
10482 assembly, by JB Evain.
10484 2004-12-17 Raja R Harinath <rharinath@novell.com>
10486 * class.cs, decl.cs, ecore.cs, iterators.cs, pending.cs,
10487 rootcontext.cs, typemanager.cs: Make nomenclature consistent.
10488 "parent" refers to enclosing type/class. "base" refers to superclass.
10490 2004-12-17 Raja R Harinath <rharinath@novell.com>
10492 * codegen.cs (CommonAssemblyModulClass.GetClsCompliantAttribute):
10493 Ensure that we only have GlobalAttributes.
10494 * attribute.cs (Attribute.Emit): Make non-virtual.
10495 (GlobalAttribute.Emit): Remove.
10496 (Attribute.Resolve): Make virtual.
10497 (GlobalAttribute.Resolve): New. Set Rootcontext.Tree.Types.NamespaceEntry.
10498 (Attribute.GetConditionalAttributeValue): Take an EmitContext as
10499 the argument. Don't create one.
10500 (Attribute.GetObsoleteAttribute): Likewise.
10501 (Attribute.GetClsCompliantAttributeValue): Likewise.
10502 * class.cs, decl.cs: Update to changes.
10504 2004-12-17 Marek Safar <marek.safar@seznam.cz>
10506 * delegate.cs (NewDelegate.DoResolve): Add error 149 report.
10508 * ecore.cs (Expression.MemberLookupFailed): Fixed error 143.
10510 * statement.cs (Foreach.Resolve): Add error 186 report.
10512 2004-12-16 Marek Safar <marek.safar@seznam.cz>
10514 * expression.cs (Conditional.DoResolve): Add warning 429.
10516 * statement.cs (If.Resolve): Add warning 665.
10518 2004-12-16 Raja R Harinath <rharinath@novell.com>
10520 New invariant: RootContext.Tree.Types.NamespaceEntry == null
10521 except when in the parser, and in GlobalAttribute.
10522 * driver.cs (MainDriver): Reset RootContext.Tree.Types.NamespaceEntry.
10523 * attribute.cs (GlobalAttribute.CheckAttributeType): Reset
10524 RootContext.Tree.Types.NamespaceEntry once work is done.
10525 (GlobalAttribute.Emit): New. Wrapper for Attribute.Emit, but sets
10526 and resets RootContext.Tree.Types.NamespaceEntry.
10528 2004-12-15 Marek Safar <marek.safar@seznam.cz>
10530 * cs-parser.jay: Don't create a block for every variable.
10532 2004-12-14 Miguel de Icaza <miguel@ximian.com>
10534 * location.cs: Provide extra information.
10536 * statement.cs: The instance is not `ldarg_0.THIS' when accessing
10537 variables from the captured environment, it is the ldarg_0.
10539 2004-12-14 Marek Safar <marek.safar@seznam.cz>
10541 * cs-parser.jay: Changed warning level for 642 to 4 until Miguel
10544 * class.cs: Changed warning level for 169 to avoid developer
10545 displeasure from warning flooding. It will be changed back when they
10546 fix most of current BCL warnings.
10548 * RootContext.cs: Pushed default WarningLevel to 3.
10550 * statement.cs: Removed unused variable.
10552 2004-12-14 Marek Safar <marek.safar@seznam.cz>
10554 * class.cs (TypeContainer.GetClassBases): Add error 1521 report.
10555 (TypeContainer.MethodModifiersValid): Refactored to use MemberCore.
10556 Add error 502 report.
10557 (StaticClass.DefineType): Add error 441 report.
10558 (Class.AllowedModifiersProp): New virtual property as temporary
10559 extension to AllowedModifiers.
10560 (Class.DefineType): Add error 418 report. Moved ModFlags check here
10561 to share implementation with StaticClass and don't call virtual
10564 * driver.cs (MainDriver): Add error 1558 test.
10566 * parameter.cs (Parameter.ApplyAttributeBuilder): Add error 662
10567 report. Moved error 36 test here.
10569 * statement.cs (Throw.Resolve): Add error 724 report.
10571 * typemanager.cs: Add out_attribute_type core type.
10573 2004-12-13 Marek Safar <marek.safar@seznam.cz>
10575 * class.cs (TypeContainer.VerifyClsCompliance): Add error
10577 (PropertyBase.VerifyClsCompliance): Add errror 3025 report.
10579 * codegen.cs (ModuleClass.ApplyAttributeBuilder): Add error
10582 * decl.cs (MemberCore.VerifyClsCompliance): Add warning 3021.
10584 * parameter.cs (ReturnParameter.ApplyAttributeBuilder):
10585 Add error 3023 report.
10586 (Parameter.ApplyAttributeBuilder): Add error 3022 report.
10588 * tree.cs (RootTypes.IsClsCompliaceRequired): Add fake
10591 2004-12-12 John Luke <john.luke@gmail.com>
10593 * driver.cs (AddArgs): take -- into account when
10594 adding arguments, fixes bug 65710
10596 2004-12-12 Martin Baulig <martin@ximian.com>
10598 * expression.cs (Unary.TryReduceNegative): Added support for
10599 SByteConstant and ByteConstant.
10600 (Unary.Reduce): Check error values from TryReduceNegative().
10602 2004-12-10 Marek Safar <marek.safar@seznam.cz>
10604 * attributes.cs (Attribute.Resolve): Avoid multiple error report
10605 and report exception as error 182.
10607 2004-12-10 Raja R Harinath <rharinath@novell.com>
10609 * driver.cs (Main): Fix message when there are warnings.
10611 2004-12-09 Miguel de Icaza <miguel@ximian.com>
10613 * delegate.cs: Fixed my fix from yesterday, sorry about that.
10615 2004-12-09 Marek Safar <marek.safar@seznam.cz>
10617 * anonymous.cs, class.cs, convert.cs, doc.cs, support.cs:
10618 Reduced number of warnings.
10620 * class.cs (TypeContainer.VerifyClsCompliance): One if is enough.
10622 2004-12-08 Miguel de Icaza <miguel@ximian.com>
10624 * driver.cs: Removed message.
10626 * delegate.cs: Fix bug introduced in 1.1.x: 70219.
10628 2004-12-08 <vargaz@freemail.hu>
10630 * cs-tokenizer.cs: Add workaround for NET 2.0 beta 1 csc bug.
10632 2004-12-08 Martin Baulig <martin@ximian.com>
10634 * class.cs (TypeContainer.VerifyClsCompliance): Report a CS3003
10635 instead of a CS3002 for properties and indexer.
10637 2004-12-08 Martin Baulig <martin@ximian.com>
10639 * decl.cs (MemberName.ToString): Make this work again.
10641 2004-12-08 Marek Safar <marek.safar@seznam.cz>
10643 * attribute.cs (Resolve): Add error 591 detection.
10645 * class.cs (FieldMember.Define): Add error 1547 detection.
10646 (Indexer.Define): Add error 620 detection.
10647 (Operator.Define): Add error 590 detection.
10649 * ecore.cs: Missing argument for error 79.
10651 * expression.cs (ComposedCast.DoResolveAsTypeStep): Add error 611
10654 2004-12-07 Marek Safar <marek.safar@seznam.cz>
10657 * assign.cs.cs (Assign.DoResolve): Reports error 1648 for value types
10660 2004-12-07 Atsushi Enomoto <atsushi@ximian.com>
10662 * cs-parser.jay : handle doc comments on implicit/explicit operators.
10663 Some operator comments were suppressed.
10664 * doc.cs : Implicit/explicit operator name in doc comments are like
10665 "op_Explicit(type)~returnType", so added suffix handling.
10667 2004-12-07 Martin Baulig <martin@ximian.com>
10670 (MemberCore.GetObsoleteAttribute): Don't create a new EmitContext.
10671 (MemberCore.GetClsCompliantAttributeValue): Likewise.
10672 (DeclSpace.ec): New protected field; store the EmitContext here.
10673 (DeclSpace.EmitContext): New public property; moved here from
10675 (DeclSpace.GetClsCompliantAttributeValue): Don't create a new
10678 * enum.cs (Enum.Define): Store the EmitContext in the `ec' field.
10679 (Enum.Emit): Don't create a new EmitContext.
10681 * delegate.cs (Delegate.DefineType): Always create the
10684 * iterators.cs (Iterators.DefineIterator): Create a new
10685 EmitContext and store it in `ec'.
10687 2004-08-24 Martin Baulig <martin@ximian.com>
10690 (TypeManager.IsSubclassOf): Renamed to IsFamilyAccessible; use
10691 this for accessibility checks.
10692 (TypeManager.IsSubclassOrNestedChildOf): Renamed to
10693 IsNestedFamilyAccessible.
10694 (TypeManager.IsSubclassOf): New method, do what the name actually
10697 2004-12-06 Raja R Harinath <rharinath@novell.com>
10699 Fix crash on cs0657-17.cs.
10700 * codegen.cs (CommonAssemblyModulClass.GetClsCompliantAttribute):
10701 Use RootContext.Tree.Types, not 'new RootTypes ()'.
10702 * attribute.cs (GlobalAttribute.CheckAttributeType): Narrow down
10703 the case where the NamespaceEntry gets overwritten.
10705 2004-12-06 Marek Safar <marek.safar@seznam.cz>
10707 Fixed #69195, #56821
10708 * ecore.cs (ResolveBoolean): Tiny refactoring.
10710 * expression.cs (Binary.DoResolve): Add warning 429 and skipping
10711 of right expression resolving when left is false constant and
10712 operator is LogicalAnd OR true constant and operator is LogicalOr.
10714 * statement.cs (ResolveUnreachable): Always reports warning.
10716 2004-12-05 Miguel de Icaza <miguel@ximian.com>
10718 * class.cs: Distinguish between 1721 and 1722 (just a little help
10719 for the programmer).
10721 2004-12-03 Miguel de Icaza <miguel@ximian.com>
10723 * delegate.cs: Only allow this on new versions of the language.
10725 2004-12-02 Duncan Mak <duncan@ximian.com>
10727 * ecore.cs (PropertyExpr.IsAccessorAccessible): Moved to
10729 (Expression.IsAccessorAccessible): Moved from the PropertyExpr to
10730 here as a static method. Take an additional bool out parameter
10731 `must_do_cs1540_check' for signaling to InstanceResolve.
10732 (PropertyExpr.InstanceResolve): Removed the `must_do_cs1540_check'
10733 member field from PropertyExpr class and made it an argument of
10734 the method instead.
10735 (EventExpr.InstanceResolve): Copied from PropertyExpr, removed the
10736 check for MarshalByRefObject, and report CS0122 instead of CS1540.
10737 (EventExpr.DoResolve): Call IsAccessorAccessible on `add_accessor'
10738 and `remove_accessor' as well as InstanceResolve: report CS0122
10743 2004-12-03 Raja R Harinath <rharinath@novell.com>
10745 Fix test-327.cs, test-328.cs, and put in early infrastructure
10746 for eventually fixing #52697.
10747 * namespace.cs (NamespaceEntry.LookupForUsing): New method.
10748 (NamespaceEntry.LookupNamespaceOrType): New method, refactored
10749 from other methods.
10750 (NamespaceEntry.Lookup): Remove 'ignore_using' flag.
10751 (AliasEntry.Resolve, UsingEntry.Resolve): Use 'LookupForUsing'.
10752 (VerifyUsing, error246): Update.
10753 * rootcontext.cs (RootContext.NamespaceLookup): Just use
10754 'NamespaceEntry.LookupNamespaceOrType'.
10756 2004-12-03 Martin Baulig <martin@ximian.com>
10758 * delegate.cs (NewDelegate.DoResolve): If we have an anonymous
10759 method as our child, call AnonymousMethod.Compatible() on it.
10761 2004-12-03 Raja R Harinath <rharinath@novell.com>
10763 Disable XML documentation support in 'basic' profile.
10764 * decl.cs, class.cs [BOOTSTRAP_WITH_OLDLIB]: Don't import System.Xml.
10765 Redirect XmlElement to System.Object.
10766 * driver.cs, enum.cs, rootcontext.cs: Don't reference System.Xml.
10767 * doc.cs [BOOTSTRAP_WITH_OLDLIB]: Disable compile.
10768 * mcs.exe.sources: Add doc-bootstrap.cs.
10769 * doc-bootstrap.cs: New file. Contains empty stub implementation
10772 2004-12-03 Atsushi Enomoto <atsushi@ximian.com>
10774 * cs-tokenizer.cs : Only '////' is rejected. Other non-whitespace
10775 comments are allowed.
10777 2004-12-03 Carlos Alberto Cortez <calberto.cortez@gmail.com>
10779 * delegate.cs: Add checks for subtypes in paramaters and return values
10780 in VerifyMethod () to add support for Covariance/Contravariance
10783 2004-12-02 Miguel de Icaza <miguel@ximian.com>
10785 * report.cs: Remove extra closing parenthesis.
10787 * convert.cs (Error_CannotImplicitConversion): If the name of the
10788 types are the same, provide some extra information.
10790 * class.cs (FieldBase): Use an unused bit field from the field to
10791 encode the `has_offset' property from the FieldMember. This saves
10792 a couple of Ks on bootstrap compilation.
10794 * delegate.cs (NewDelegate.DoResolve): If we have an anonymous
10795 method as our child, return the AnonymousMethod resolved
10798 * expression.cs (New.DoResolve): Allow return values from
10799 NewDelegate to also include AnonymousMethods.
10803 2004-12-02 Marek Safar <marek.safar@seznam.cz>
10806 * attribute.cs (Resolve): Improved implementation of params
10807 attribute arguments.
10809 * support.cs (ParameterData): Add HasParams to be faster.
10811 2004-12-02 Atsushi Enomoto <atsushi@ximian.com>
10813 all things are for /doc support:
10815 * doc.cs: new file that supports XML documentation generation.
10816 * mcs.exe.sources: added doc.cs.
10818 Handle /doc command line option.
10819 Report error 2006 instead of 5 for missing file name for /doc.
10820 Generate XML documentation when required, after type resolution.
10822 Added support for picking up documentation (/// and /** ... */),
10823 including a new XmlCommentState enumeration.
10825 Added lines to fill Documentation element for field, constant,
10826 property, indexer, method, constructor, destructor, operator, event
10827 and class, struct, interface, delegate, enum.
10828 Added lines to warn incorrect comment.
10830 Added Documentation field (passed only when /doc was specified).
10832 Added DocComment, DocCommentHeader, GenerateDocComment() and
10833 OnGenerateDocComment() and some supporting private members for
10834 /doc feature to MemberCore.
10836 Added GenerateDocComment() on TypeContainer, MethodCore and Operator.
10838 Added overriden DocCommentHeader.
10840 Added overriden DocCommentHeader and GenerateDocComment().
10842 2004-12-01 Miguel de Icaza <miguel@ximian.com>
10844 * cfold.cs (ConstantFold.DoConstantNumericPromotions): After
10845 unwrapping the enumeration values, chain to
10846 DoConstantNumericPromotions again, so we can promote things to the
10847 fundamental types (takes care of enums that are bytes, sbytes).
10851 2004-12-01 Raja R Harinath <rharinath@novell.com>
10853 * attribute.cs (Attribute.CheckAttributeType): Remove complain flag.
10854 Fix long-standing bug in type-lookup. Use FindType instead of
10855 LookupType when ec.ResolvingTypeTree.
10856 (Attribute.ResolveType, Attribute.Resolve)
10857 (Attribute.DefinePInvokeMethod,GlobalAttribute.CheckAttributeType):
10859 (Attributes.Search): Remove internal version. Update.
10860 (Attributes.SearchMulti): Update.
10861 (Attributes.GetClsCompliantAttribute): Remove.
10862 (Attributes.GetIndexerNameAttribute): Remove.
10863 * decl.cs (MemberCore.GetClsCompliantAttributeValue): Update to changes.
10864 (DeclSpace.GetClsCompliantAttributeValue): Likewise.
10865 * class.cs (Indexer.Define): Likewise.
10867 2004-12-01 Marek Safar <marek.safar@seznam.cz>
10870 * ecore.cs: CheckMarshallByRefAccess new virtual method for testing
10871 MarshallByReference members access.
10873 * expression.cs: Use CheckMarshallByRefAccess;
10874 Better error CS0197 message.
10876 * report.cs: Print whole related error message.
10878 2004-11-30 Raja R Harinath <rharinath@novell.com>
10880 * Makefile (mcs.exe) [PROFILE=default]: Keep a copy of mcs.exe in
10881 the current directory to help debugging.
10883 2004-11-29 Marek Safar <marek.safar@seznam.cz>
10885 * class (GetClassBases): Better error 60 report.
10886 (EventProperty): Disabled warning 67 detection.
10888 2004-11-29 Marek Safar <marek.safar@seznam.cz>
10891 * cfold.cs (Assign.DoResolve): Add subtraction for DecimalConstant.
10893 * constant.cs (DecimalConstant.Emit): Don't use int ctor for
10896 2004-11-29 Marek Safar <marek.safar@seznam.cz>
10899 * assign.cs (Assign.DoResolve): Add error 1648, 1650 report.
10901 * decl.cs (MemberCore.MemberName): Error 1648 in compiler.
10903 2004-11-26 Miguel de Icaza <miguel@ximian.com>
10905 * attribute.cs (Attribute.Resolve): Refine error reporting and
10906 report a cs0117 if the identifier does not exist, to distinguish
10907 from 0617 which is a miss-use of the actual identifier.
10909 * ecore.cs (EventExpr.Emit): Refine error report and distinguish
10910 between cs0070 and cs0079.
10912 * class.cs (MemberBase.DoDefine): When reporting a wrong
10913 accessibility level, we use MethodCore to compare instead of
10914 Method (this was a regression in some refactoring effort).
10916 So now we correctly report cs0056 again.
10918 * convert.cs (ImplicitReferenceConversion): Corrected typo, I was
10919 testing the target_type (which was known to be object_type) and
10920 not the source type (which is anonymous_method).
10922 Fixed reporting of error cs1660.
10924 * expression.cs (UserCast.Source): Expose the underlying cast.
10926 * statement.cs (Switch.SwitchGoverningType): Sort the list of
10927 allowed types to find a match to int32 first (most common).
10929 In addition, it ignores any ImplicitUserConversions that did an
10930 internal implicit conversion (as the switch statement allows only
10931 one integral conversion to exist).
10933 * class.cs (PartialContainer.Create): rename `name' to
10934 `member_name' for clarity. Then replace the string calls with a
10935 call to MemberName.GetPartialName, as now using
10936 MemberName.ToString is an error (this is due to the side effects
10937 it had, that were fixed in the past).
10939 This will restore the error reporting on a number of partial class
10940 errors that were missusing this (and getting an exception as a
10941 results, which is now just a plain textual warning, because
10942 yyparse debug output would crash otherwise).
10944 2004-11-26 Raja R Harinath <rharinath@novell.com>
10946 * Makefile (PROGRAM_INSTALL_DIR): Remove.
10948 2004-11-25 Ben Maurer <bmaurer@ximian.com>
10950 * rootcontext.cs (LookupType): Make sure to cache lookups that
10951 don't give us a negative result. This saves about 5% of corlib
10954 2004-11-25 Miguel de Icaza <miguel@ximian.com>
10956 * report.cs (AbstractMessage.Print): messages are sent to stderr
10958 * class.cs (TypeContainer.GetClassBases): It is an error to have a
10959 non-interface in the list of interfaces (at this point, either
10960 parent was properly set, or a base class is being listed in the
10961 interfaces section).
10963 This flags error 1722, and resolves the crash from bug 69259.
10965 2004-11-25 Ben Maurer <bmaurer@ximian.com>
10967 * statement.cs (Using.EmitExpressionFinally): make this work right
10968 for valuetypes. Fixes 69926.
10970 2004-11-25 Miguel de Icaza <miguel@ximian.com>
10972 * const.cs (Const.ChangeType): Cope with the "0 literal can be
10973 converted to an enum" here, before we try to change the underlying
10974 type. This code exists, but it is a different code path than the
10975 one used while encoding constants.
10977 * convert.cs (ImplicitReferenceConversionExists): A surprisingly
10978 old bug: when converting from the null literal to a pointer,
10979 return an EmptyCast, not the NullLiteral.
10981 This fixes #69921, the recent null_type changes probably made this
10982 bug more prominent.
10984 (ImplicitReferenceConversionExists): In addition, resynchronized
10985 the code here, so it matches the same code in
10986 ImplicitReferenceConversionExists for the `from any class-type S
10987 to any interface-type T'.
10990 2004-11-25 Marek Safar <marek.safar@seznam.cz>
10992 * cfold.cs (BinaryFold): Add addition for DecimalConstant.
10994 2004-11-24 Miguel de Icaza <miguel@ximian.com>
10996 * cs-parser.jay: Use verbosity accordingly.
10998 2004-11-24 Marek Safar <marek.safar@seznam.cz>
11000 * expression.cs (Unary.ResolveOperator): Do not report warning;
11001 AddressOf reads from variable.
11003 (LocalVariableReferences.DoResolveBase): Improved my previous fix.
11005 2004-11-24 Marek Safar <marek.safar@seznam.cz>
11009 * attribute.cs (Attributable): Removed CheckTargets.
11010 (Attributes.Emit): Explicit attribute targets are tested here.
11012 * class.cs (EventField.ValidAttributeTargets): Explicit target "field" is
11013 not enabled for interfaces.
11015 * codegen.cs (CommonAssemblyModulClass.AddAttributes): Removed CheckTargets.
11016 (GetAssemblyName): Ouch next bug there.
11018 2004-11-23 Carlos Alberto Cortez <calberto.cortez@gmail.com>
11020 * expression.cs: Error 275 added.
11022 2004-11-23 Marek Safar <marek.safar@seznam.cz>
11024 Fix bug #69177 (Implemented decimal constant support)
11026 * cfold.cs (DoConstantNumericPromotions: Add DecimalConstant.
11027 (BinaryFold): Add DecimalConstant.
11029 * const.cs (Define): Decimal constant
11031 (ChangeType): Add decimal type handling.
11032 (LookupConstantValue): Don't set value for decimal type but
11033 emit DecimalConstantAttribute. Needed for constant optimization.
11035 * constant.cs (ToDecimal): New method.
11036 (ConvertToDecimal): New method.
11037 (IntConstant): Implemented ConvertToDecimal.
11038 (DecimalConstant.Emit): Emit optimized version for decimals in
11041 * expression.cs (ResolveOperator): Changed order of constant
11042 reduction to work correctly with native types which have
11043 overloaded operators.
11044 (ResolveMemberAccess): Extract constant value from attribute
11047 * rootcontext.cs (ResolveCore): Add DecimalConstantAttribute.
11049 * typemanager.cs (TypeManager): Add decimal_constant_attribute_type,
11050 void_decimal_ctor_int_arg, decimal_constant_attribute_ctor.
11051 (ChangeType): Decimal is special.
11052 (TypeToCoreType): Add decimal type.
11054 2004-11-22 Marek Safar <marek.safar@seznam.cz>
11056 * convert.cs (ImplicitConversionRequired): Add error cs0642 for
11059 2004-11-22 Marek Safar <marek.safar@seznam.cz>
11061 * class.cs (EventField.ApplyAttributeBuilder): Fix error
11064 2004-11-19 Marek Safar <marek.safar@seznam.cz>
11066 * class.cs (MemberBase.DoDefine): Fix error cs0508 report.
11068 * pending.cs (PendingImplementation): Grab only interfaces.
11070 2004-11-19 Marek Safar <marek.safar@seznam.cz>
11072 * statement.cs (ForeachHelperMethods): Add location member and
11073 error 202 detection.
11075 2004-11-19 Raja R Harinath <rharinath@novell.com>
11077 * Makefile (EXTRA_DISTFILES): Remove mcs.exe.config. It's
11078 automatically handled by executable.make.
11079 (PROGRAM): Make profile-specific.
11081 2004-11-18 Marek Safar <marek.safar@seznam.cz>
11083 * expression.cs (DoResolveBase): Fixed wrong warning for out
11086 2004-11-18 Martin Baulig <martin@ximian.com>
11088 Merged latest changes into gmcs. Please keep this comment in
11089 here, it makes it easier for me to see what changed in MCS since
11090 the last time I merged.
11092 2004-11-17 Raja R Harinath <rharinath@novell.com>
11094 * typemanager.cs (TypeHandle.GetTypeHandle): Make private.
11095 (TypeHandle.GetMemberCache): New.
11096 (TypeHandle.TypeHandle): Update.
11097 (TypeManager.LookupMemberCache): Rewritten from LookupMemberContainer.
11098 (TypeManager.LookupParentInterfacesCache):
11099 Rename from LookupInterfaceCache. Optimize slightly.
11100 (TypeManager.MemberLookup_FindMembers): Update.
11101 * decl.cs (MemberCache.MemberCache): Set Container to null in the
11102 multi-type variant.
11103 (AddCacheContents): Rename from AddHashtable.
11104 * class.cs (TypeContainer.parent_container): Remove.
11105 (TypeContainer.VerifyClsCompliance): Don't use parent_container.
11106 (TypeContainer.DoDefineMembers): Don't initialize it.
11107 Update to name changes.
11109 2004-11-17 Miguel de Icaza <miguel@ximian.com>
11111 * class.cs (MethodCore.CheckAccessModifiers): New helper routine
11112 that factors the code to check access modifiers on override.
11114 (PropertyBase): Use the code here.
11116 Patch from Lluis S'anchez, fixes bug #69361.
11118 2004-11-15 Miguel de Icaza <miguel@ximian.com>
11120 * anonymous.cs (AnonymousMethod.Error_AddressOfCapturedVar): New
11121 routine that is used to report the use of a captured variable
11122 whose address has been taken.
11124 There are two checks: one when variables are being captured and
11125 the other check is when the address of a variable is taken.
11127 (because an anonymous methods might be resolved before *or* after
11128 the address has been taken) and
11130 * expression.cs (Conditional.DoResolve): Remove the special
11131 casing that Martin added to trueExpr and falseExpr being both
11132 NullLiteral. We get the right behavior now just by introducing
11133 the null_type into the compiler.
11135 * convert.cs (ExplicitConversion): Change the code to use
11136 null_type instead of testing `expr is NullLiteral'.
11137 (ImplicitConversionStandard): use null_type too.
11138 (ImplicitReferenceConversionExists): use null_type too.
11139 (ImplicitReferenceConversion): use null_type too.
11141 * literal.cs: The type of `NullLiteral' is now null_type instead
11143 (Resolve): Set the type here.
11145 * typemanager.cs: Introduce null_type.
11147 2004-11-17 Martin Baulig <martin@ximian.com>
11149 * decl.cs (MemberCache.AddHashtable): Add entries in the opposite
11150 direction, like FindMembers() does. Fixes #69546, testcase is in
11153 2004-11-16 Martin Baulig <martin@ximian.com>
11155 This is based on a patch from Marek Safar, see bug #69082.
11156 Fixes bugs #63705 and #67130.
11158 * typemanager.cs (TypeManager.LookupInterfaceCache): New public
11159 method; create a MemberCache for an interface type and cache the
11162 * decl.cs (IMemberContainer.ParentContainer): Removed.
11163 (IMemberContainer.ParentCache): New property.
11164 (MemberCache.SetupCacheForInterface): Removed.
11165 (MemberCache..ctor): Added .ctor which takes a `Type[]'; use this
11166 to create a cache for an interface's "parent".
11168 * class.cs (TypeContainer.DoDefineMembers): Setup cache for
11171 2004-11-16 Martin Baulig <martin@ximian.com>
11173 Merged back from gmcs; these changes already went into gmcs a
11174 couple of weeks ago.
11177 (TypeManager.AddUserType): Removed the `ifaces' argument.
11178 (TypeManager.RegisterBuilder): Take a `Type []' instead of a
11180 (TypeManager.AddUserInterface): Removed.
11181 (TypeManager.ExpandInterfaces): Return a `Type []' instead of a
11183 (TypeManager.GetInterfaces): Likewise.
11184 (TypeManager.GetExplicitInterfaces): Likewise.
11186 * ecore.cs (TypeExpr.GetInterfaces): Removed.
11188 * class.cs (TypeContainer.base_class_type): Replaced with `ptype'.
11189 (TypeContainer.base_inteface_types): Replaced with `ifaces'.
11191 2004-11-14 Ben Maurer <bmaurer@ximian.com>
11193 * statement.cs: Avoid adding bools to a hashtable.
11195 2004-11-07 Miguel de Icaza <miguel@ximian.com>
11197 * expression.cs (Invocation.OverloadResolve): Flag error if we are
11198 calling an unsafe method from a safe location.
11200 2004-11-06 Marek Safar <marek.safar@seznam.cz>
11203 * codegen.cs (ApplyAttributeBuilder): Do not return; it is only warning.
11205 2004-11-06 Miguel de Icaza <miguel@ximian.com>
11207 * namespace.cs (VerifyUsing): use GetPartialName instead of
11210 2004-11-05 Miguel de Icaza <miguel@ximian.com>
11212 * statement.cs (Return.Resolve): Fix regression in typo: if
11213 `in_exc', we have to request a NeedReturnLabel, this was a typo
11214 introduced in the anonymous method check-in. Fixes #69131.
11216 * Indexers were using the ShortName when defining themselves,
11217 causing a regression in the compiler bootstrap when applying the
11218 patch from 2004-11-02 (first part), now they use their full name
11219 and the bug is gone.
11221 2004-11-04 Zoltan Varga <vargaz@freemail.hu>
11223 * driver.cs: Strip the path from the names of embedded resources. Fixes
11226 2004-11-04 Raja R Harinath <rharinath@novell.com>
11228 Fix error message regression: cs0104-2.cs.
11229 * namespace.cs (NamespaceEntry.Lookup): Remove 'silent' flag.
11230 (AliasEntry.Resolve): Update.
11231 * rootcontext.cs (RootContext.NamespaceLookup): Update. Remove
11233 (RootContext.LookupType): Update.
11235 2004-11-03 Carlos Alberto Cortez <carlos@unixmexico.org>
11237 * cs-parser.jay: Add support for handling accessor modifiers
11238 * class: Add support port accessor modifiers and error checking,
11239 define PropertyMethod.Define as virtual (not abstract anymore)
11240 * ecore.cs: Add checking for proeprties access with access modifiers
11241 * iterators.cs: Modify Accessor constructor call based in the modified
11243 2004-11-02 Ben Maurer <bmaurer@ximian.com>
11245 * expression.cs (StringConcat): Handle being called twice,
11246 as when we have a concat in a field init with more than two
11249 2004-11-02 Miguel de Icaza <miguel@ximian.com>
11251 * class.cs (Event.Define, Indexer.Define, Property.Define): Do not
11252 special case explicit implementations, we should always produce
11253 the .property or .event declaration.
11255 * decl.cs (MemberName): Renamed GetFullName to GetPartialName
11256 since it will not return correct data if people use this
11257 unresolved in the presence of using statements (see test-313).
11259 * class.cs (MethodData.Define): If we are an explicit interface
11260 implementation, set the method name to the full name of the
11261 interface plus the name of the method.
11263 Notice that using the method.MethodName.GetFullName() does not
11264 work, as it will only contain the name as declared on the source
11265 file (it can be a shorthand in the presence of using statements)
11266 and not the fully qualifed type name, for example:
11270 class D : ICloneable {
11271 object ICloneable.Clone () {
11275 Would produce a method called `ICloneable.Clone' instead of
11276 `System.ICloneable.Clone'.
11278 * namespace.cs (Alias.Resolve): Use GetPartialName.
11280 2004-11-01 Marek Safar <marek.safar@seznam.cz>
11282 * cs-parser.jay: Add error 1055 report.
11284 2004-11-01 Miguel de Icaza <miguel@ximian.com>
11286 * assign.cs (Assign.DoResolve): Only do the transform of
11287 assignment into a New if the types are compatible, if not, fall
11288 through and let the implicit code deal with the errors and with
11289 the necessary conversions.
11291 2004-11-01 Marek Safar <marek.safar@seznam.cz>
11293 * cs-parser.jay: Add error 1031 report.
11295 * cs-tokenizer.cs: Add location for error 1038.
11297 2004-10-31 Marek Safar <marek.safar@seznam.cz>
11299 * cs-parser.jay: Add error 1016 report.
11301 2004-10-31 Marek Safar <marek.safar@seznam.cz>
11303 * cs-parser.jay: Add errors 1575,1611 report.
11305 2004-10-31 Marek Safar <marek.safar@seznam.cz>
11307 * cs-parser.jay: Add error 1001 report.
11309 2004-10-31 Marek Safar <marek.safar@seznam.cz>
11312 * attribute.cs (GetMarshal): Add method argument for
11313 caller identification.
11315 * class.cs, codegen.cs, enum.cs, parameter.cs: Added
11316 agument for GetMarshal and RuntimeMissingSupport.
11318 2004-10-31 Marek Safar <marek.safar@seznam.cz>
11320 * attribute.cs (ExtractSecurityPermissionSet): Removed
11321 TypeManager.code_access_permission_type.
11323 * typemanager.cs: Removed TypeManager.code_access_permission_type.
11325 2004-10-27 Miguel de Icaza <miguel@ximian.com>
11327 * expression.cs (LocalVariableReference.DoResolveLValue): Check
11328 for obsolete use of a variable here. Fixes regression on errors
11329 cs0619-25 and cs0619-26.
11331 2004-10-27 Marek Safar <marek.safar@seznam.cz>
11333 Fix #62358, implemented security attribute encoding.
11335 * attribute.cs (Attribute.CheckSecurityActionValididy): New method.
11336 Tests permitted SecurityAction for assembly or other types.
11337 (Assembly.ExtractSecurityPermissionSet): New method. Transforms
11338 data from SecurityPermissionAttribute to PermisionSet class.
11340 * class.cs (ApplyAttributeBuilder): Added special handling
11341 for System.Security.Permissions.SecurityAttribute based types.
11343 * codegen.cs (AssemblyClass.ApplyAttributeBuilder): Added
11344 special handling for System.Security.Permissions.SecurityAttribute
11347 * enum.cs (ApplyAttributeBuilder): Added special handling
11348 for System.Security.Permissions.SecurityAttribute based types.
11350 * parameter.cs (ApplyAttributeBuilder): Added special handling
11351 for System.Security.Permissions.SecurityAttribute based types.
11353 * rootcontext.cs: Next 2 core types.
11355 * typemanager.cs (TypeManager.security_permission_attr_type):
11356 Built in type for the SecurityPermission Attribute.
11357 (code_access_permission_type): Build in type.
11359 2004-10-17 Miguel de Icaza <miguel@ximian.com>
11361 * expression.cs (LocalVariableReference.DoResolveBase, Emit):
11362 Remove the tests for `ec.RemapToProxy' from here, and encapsulate
11363 all of this information into
11364 EmitContext.EmitCapturedVariableInstance.
11366 * codegen.cs (EmitCapturedVariableInstance): move here the
11367 funcionality of emitting an ldarg.0 in the presence of a
11368 remapping. This centralizes the instance emit code.
11370 (EmitContext.EmitThis): If the ScopeInfo contains a THIS field,
11371 then emit a load of this: it means that we have reached the
11372 topmost ScopeInfo: the one that contains the pointer to the
11373 instance of the class hosting the anonymous method.
11375 * anonymous.cs (AddField, HaveCapturedFields): Propagate field
11376 captures to the topmost CaptureContext.
11378 2004-10-12 Miguel de Icaza <miguel@ximian.com>
11380 * expression.cs (LocalVariableReference): Move the knowledge about
11381 the iterators into codegen's EmitCapturedVariableInstance.
11383 2004-10-11 Miguel de Icaza <miguel@ximian.com>
11385 * codegen.cs (EmitContext.ResolveTopBlock): Emit a 1643 when not
11386 all code paths return a value from an anonymous method (it is the
11387 same as the 161 error, but for anonymous methods).
11389 2004-10-08 Miguel de Icaza <miguel@ximian.com>
11391 The introduction of anonymous methods in the compiler changed
11392 various ways of doing things in the compiler. The most
11393 significant one is the hard split between the resolution phase
11394 and the emission phases of the compiler.
11396 For instance, routines that referenced local variables no
11397 longer can safely create temporary variables during the
11398 resolution phase: they must do so from the emission phase,
11399 since the variable might have been "captured", hence access to
11400 it can not be done with the local-variable operations from the runtime.
11404 (Block.Flags): New flag `IsTopLevel' to indicate that this block
11405 is a toplevel block.
11407 (ToplevelBlock): A new kind of Block, these are the blocks that
11408 are created by the parser for all toplevel method bodies. These
11409 include methods, accessors and anonymous methods.
11411 These contain some extra information not found in regular blocks:
11412 A pointer to an optional CaptureContext (for tracking captured
11413 local variables and parameters). A pointer to the parent
11416 (Return.Resolve): Catch missmatches when returning a value from an
11417 anonymous method (error 1662).
11418 Invoke NeedReturnLabel from the Resolve phase instead of the emit
11421 (Break.Resolve): ditto.
11423 (SwitchLabel): instead of defining the labels during the
11424 resolution phase, we now turned the public ILLabel and ILLabelCode
11425 labels into methods called GetILLabelCode() and GetILLabel() that
11426 only define the label during the Emit phase.
11428 (GotoCase): Track the SwitchLabel instead of the computed label
11429 (its contained therein). Emit the code by using
11430 SwitchLabel.GetILLabelCode ().
11432 (LocalInfo.Flags.Captured): A new flag has been introduce to track
11433 whether the Local has been captured or not.
11435 (LocalInfo.IsCaptured): New property, used to tell whether the
11436 local has been captured.
11438 * anonymous.cs: Vastly updated to contain the anonymous method
11441 The main classes here are: CaptureContext which tracks any
11442 captured information for a toplevel block and ScopeInfo used to
11443 track the activation frames for various local variables.
11445 Each toplevel block has an optional capture context associated
11446 with it. When a method contains an anonymous method both the
11447 toplevel method and the anonymous method will create a capture
11448 context. When variables or parameters are captured, they are
11449 recorded on the CaptureContext that owns them, for example:
11453 MyDelegate d = delegate {
11458 Here `a' will be recorded as captured on the toplevel
11459 CapturedContext, the inner captured context will not have anything
11460 (it will only have data if local variables or parameters from it
11461 are captured in a nested anonymous method.
11463 The ScopeInfo is used to track the activation frames for local
11464 variables, for example:
11466 for (int i = 0; i < 10; i++)
11467 for (int j = 0; j < 10; j++){
11468 MyDelegate d = delegate {
11473 At runtime this captures a single captured variable `i', but it
11474 captures 10 different versions of the variable `j'. The variable
11475 `i' will be recorded on the toplevel ScopeInfo, while `j' will be
11476 recorded on a child.
11478 The toplevel ScopeInfo will also track information like the `this'
11479 pointer if instance variables were referenced (this is necessary
11480 as the anonymous method lives inside a nested class in the host
11481 type of the method).
11483 (AnonymousMethod): Expanded to track the Toplevel, implement
11484 `AnonymousMethod.Compatible' to tell whether an anonymous method
11485 can be converted to a target delegate type.
11487 The routine now also produces the anonymous method content
11489 (AnonymousDelegate): A helper class that derives from
11490 DelegateCreation, this is used to generate the code necessary to
11491 produce the delegate for the anonymous method that was created.
11493 * assign.cs: API adjustments for new changes in
11494 Convert.ImplicitStandardConversionExists.
11496 * class.cs: Adjustments to cope with the fact that now toplevel
11497 blocks are of type `ToplevelBlock'.
11499 * cs-parser.jay: Now we produce ToplevelBlocks for toplevel blocks
11500 insteda of standard blocks.
11502 Flag errors if params arguments are passed to anonymous methods.
11504 * codegen.cs (EmitContext): Replace `InAnonymousMethod' with
11505 `CurrentAnonymousMethod' which points to the current Anonymous
11506 Method. The variable points to the AnonymousMethod class that
11507 holds the code being compiled. It is set in the new EmitContext
11508 created for the anonymous method.
11510 (EmitContext.Phase): Introduce a variable and an enumeration to
11511 assist in enforcing some rules about when and where we are allowed
11512 to invoke certain methods (EmitContext.NeedsReturnLabel is the
11513 only one that enfonces this right now).
11515 (EmitContext.HaveCaptureInfo): new helper method that returns
11516 whether we have a CapturedContext initialized.
11518 (EmitContext.CaptureVariable): New method used to register that a
11519 LocalInfo must be flagged for capturing.
11521 (EmitContext.CapturedParameter): New method used to register that a
11522 parameters must be flagged for capturing.
11524 (EmitContext.CapturedField): New method used to register that a
11525 field must be flagged for capturing.
11527 (EmitContext.HaveCapturedVariables,
11528 EmitContext.HaveCapturedFields): Return whether there are captured
11529 variables or fields.
11531 (EmitContext.EmitMethodHostInstance): This is used to emit the
11532 instance for the anonymous method. The instance might be null
11533 (static methods), this (for anonymous methods that capture nothing
11534 and happen to live side-by-side with the current method body) or a
11535 more complicated expression if the method has a CaptureContext.
11537 (EmitContext.EmitTopBlock): Routine that drives the emission of
11538 code: it will first resolve the top block, then emit any metadata
11539 and then emit the code. The split is done so that we can extract
11540 any anonymous methods and flag any captured variables/parameters.
11542 (EmitContext.ResolveTopBlock): Triggers the resolution phase,
11543 during this phase, the ILGenerator should not be used as labels
11544 and local variables declared here might not be accessible to any
11545 code that is part of an anonymous method.
11547 Exceptions to this include the temporary variables that are
11548 created by some statements internally for holding temporary
11551 (EmitContext.EmitMeta): New routine, in charge of emitting all the
11554 (EmitContext.TemporaryReturn): This method is typically called
11555 from the Emit phase, and its the only place where we allow the
11556 ReturnLabel to be defined other than the EmitMeta. The reason is
11557 that otherwise we would have to duplicate a lot of logic in the
11558 Resolve phases of various methods that today is on the Emit
11561 (EmitContext.NeedReturnLabel): This no longer creates the label,
11562 as the ILGenerator is not valid during the resolve phase.
11564 (EmitContext.EmitThis): Extended the knowledge in this class to
11565 work in anonymous methods in addition to iterators.
11567 (EmitContext.EmitCapturedVariableInstance): This emits whatever
11568 code is necessary on the stack to access the instance to a local
11569 variable (the variable will be accessed as a field).
11571 (EmitContext.EmitParameter, EmitContext.EmitAssignParameter,
11572 EmitContext.EmitAddressOfParameter): Routines to support
11573 parameters (not completed at this point).
11575 Removals: Removed RemapLocal and RemapLocalLValue. We probably
11576 will also remove the parameters.
11578 * convert.cs (Convert): Define a `ConstantEC' which points to a
11579 null. This is just to prefity some code that uses
11580 ImplicitStandardConversion code and do not have an EmitContext
11583 The idea is to flag explicitly that at that point in time, it is
11584 known that the conversion will not trigger the delegate checking
11585 code in implicit conversions (which requires a valid
11588 Everywhere: pass new EmitContext parameter since
11589 ImplicitStandardConversionExists now requires it to check for
11590 anonymous method conversions.
11592 (Convert.ImplicitStandardConversionExists): If the type of an
11593 expression is the anonymous_method_type, and the type is a
11594 delegate, we invoke the AnonymousMethod.Compatible method to check
11595 whether an implicit conversion is possible.
11597 (Convert.ImplicitConversionStandard): Only do implicit method
11598 group conversions if the language level is not ISO_1.
11600 * delegate.cs (Delegate.GetInvokeMethod): Common method to get the
11601 MethodInfo for the Invoke method. used by Delegate and
11604 * expression.cs (Binary.DoNumericPromotions): only allow anonymous
11605 method conversions if the target type is a delegate.
11607 Removed extra debugging nops.
11609 (LocalVariableReference): Turn the `local_info' into a public
11612 Add `prepared' field, the same hack used for FieldExprs to cope
11613 with composed assignments, as Local variables do not necessarily
11614 operate purely on the stack as they used to: they can be captured
11617 Add `temp' for a temporary result, like fields.
11619 Refactor DoResolve and DoResolveLValue into DoResolveBase.
11621 It now copes with Local variables that are captured and emits the
11622 proper instance variable to load it from a field in the captured
11625 (ParameterReference.DoResolveBase): During the resolve phase,
11626 capture parameters if we are in an anonymous method.
11628 (ParameterReference.Emit, ParameterReference.AddressOf): If in an
11629 anonymous method, use the EmitContext helper routines to emit the
11630 parameter reference.
11632 * iterators.cs: Set RemapToProxy to true/false during the
11635 * parameters.cs (GetParameterByName): New helper method.
11637 * typemanager.cs (anonymous_method_type) a new type that
11638 represents an anonyous method. This is always an internal type,
11639 used as a fencepost to test against the anonymous-methodness of an
11642 2004-10-20 Marek Safar <marek.safar@seznam.cz>
11644 * class.cs (MethodCore.CheckBase): Add errors 505, 533, 544,
11646 (PropertyBase.FindOutParentMethod): Add errors 545, 546 report.
11648 2004-10-18 Martin Baulig <martin@ximian.com>
11650 * statement.cs (Fixed.Resolve): Don't access the TypeExpr's
11651 `Type' directly, but call ResolveType() on it.
11652 (Catch.Resolve): Likewise.
11653 (Foreach.Resolve): Likewise.
11655 2004-10-18 Martin Baulig <martin@ximian.com>
11657 * expression.cs (Cast.DoResolve): Don't access the TypeExpr's
11658 `Type' directly, but call ResolveType() on it.
11659 (Probe.DoResolve): Likewise.
11660 (ArrayCreation.LookupType): Likewise.
11661 (TypeOf.DoResolve): Likewise.
11662 (SizeOf.DoResolve): Likewise.
11664 2004-10-18 Martin Baulig <martin@ximian.com>
11666 * expression.cs (Invocation.BetterFunction): Put back
11667 TypeManager.TypeToCoreType().
11669 2004-10-18 Raja R Harinath <rharinath@novell.com>
11671 * class.cs (FieldMember.DoDefine): Reset ec.InUnsafe after doing
11674 2004-10-18 Martin Baulig <martin@ximian.com>
11676 * parameter.cs (Parameter.Resolve): Don't access the TypeExpr's
11677 `Type' directly, but call ResolveType() on it.
11679 2004-10-18 Martin Baulig <martin@ximian.com>
11681 * class.cs (FieldMember.Define): Don't access the TypeExpr's
11682 `Type' directly, but call ResolveType() on it.
11683 (MemberBase.DoDefine): Likewise.
11685 * expression.cs (New.DoResolve): Don't access the TypeExpr's
11686 `Type' directly, but call ResolveType() on it.
11687 (ComposedCast.DoResolveAsTypeStep): Likewise.
11689 * statement.cs (LocalInfo.Resolve): Don't access the TypeExpr's
11690 `Type' directly, but call ResolveType() on it.
11692 2004-10-17 John Luke <john.luke@gmail.com>
11694 * class.cs (Operator.GetSignatureForError): use CSharpName
11696 * parameter.cs (Parameter.GetSignatureForError): Returns
11697 correct name even if was not defined.
11699 2004-10-13 Raja R Harinath <rharinath@novell.com>
11702 * class.cs (TypeContainer.EmitContext): New property.
11703 (DefineNestedTypes): Create an emitcontext for each part.
11704 (MethodCore.DoDefineParameters): Use container's emitcontext.
11705 Pass type array to InternalParameters.
11706 (MemberBase.DoDefine): Use container's emitcontext.
11707 (FieldMember.Define): Likewise.
11708 (Event.Define): Likewise.
11709 (SetMethod.GetParameterInfo): Change argument to EmitContext.
11710 Pass type array to InternalParameters.
11711 (SetIndexerMethod.GetParameterInfo): Likewise.
11712 (SetMethod.Define): Pass emitcontext to GetParameterInfo.
11713 * delegate.cs (Define): Pass emitcontext to
11714 ComputeAndDefineParameterTypes and GetParameterInfo. Pass type
11715 array to InternalParameters.
11716 * expression.cs (ParameterReference.DoResolveBase): Pass
11717 emitcontext to GetParameterInfo.
11718 (ComposedCast.DoResolveAsTypeStep): Remove check on
11719 ec.ResolvingTypeTree.
11720 * parameter.cs (Parameter.Resolve): Change argument to
11721 EmitContext. Use ResolveAsTypeTerminal.
11722 (Parameter.GetSignature): Change argument to EmitContext.
11723 (Parameters.ComputeSignature): Likewise.
11724 (Parameters.ComputeParameterTypes): Likewise.
11725 (Parameters.GetParameterInfo): Likewise.
11726 (Parameters.ComputeAndDefineParameterTypes): Likewise.
11727 Re-use ComputeParameterTypes. Set ec.ResolvingTypeTree.
11728 * support.cs (InternalParameters..ctor): Remove variant that takes
11730 * typemanager.cs (system_intptr_expr): New.
11731 (InitExpressionTypes): Initialize it.
11733 2004-10-12 Chris Toshok <toshok@ximian.com>
11735 * cs-parser.jay: fix location for try_statement and catch_clause.
11737 2004-10-11 Martin Baulig <martin@ximian.com>
11739 * report.cs: Don't make --fatal abort on warnings, we have
11740 -warnaserror for that.
11742 2004-10-07 Raja R Harinath <rharinath@novell.com>
11744 More DeclSpace.ResolveType avoidance.
11745 * decl.cs (MemberCore.InUnsafe): New property.
11746 * class.cs (MemberBase.DoDefine): Use ResolveAsTypeTerminal
11747 with newly created EmitContext.
11748 (FieldMember.Define): Likewise.
11749 * delegate.cs (Delegate.Define): Likewise.
11750 * ecore.cs (SimpleName.ResolveAsTypeStep): Lookup with alias
11751 only if normal name-lookup fails.
11752 (TypeExpr.DoResolve): Enable error-checking.
11753 * expression.cs (ArrayCreation.DoResolve): Use ResolveAsTypeTerminal.
11754 (SizeOf.DoResolve): Likewise.
11755 (ComposedCast.DoResolveAsTypeStep): Likewise.
11756 (StackAlloc.DoResolve): Likewise.
11757 * statement.cs (Block.Flags): Add new flag 'Unsafe'.
11758 (Block.Unsafe): New property.
11759 (Block.EmitMeta): Set ec.InUnsafe as appropriate.
11760 (Unsafe): Set 'unsafe' flag of contained block.
11761 (LocalInfo.Resolve): Use ResolveAsTypeTerminal.
11762 (Fixed.Resolve): Likewise.
11763 (Catch.Resolve): Likewise.
11764 (Using.ResolveLocalVariableDecls): Likewise.
11765 (Foreach.Resolve): Likewise.
11767 2004-10-05 John Luke <john.luke@gmail.com>
11769 * cs-parser.jay: add location to error CS0175
11771 2004-10-04 Miguel de Icaza <miguel@ximian.com>
11773 * ecore.cs (Expression.Constantity): Add support for turning null
11776 * const.cs (Const.Define): Allow constants to be reference types
11777 as long as the value is Null.
11779 2004-10-04 Juraj Skripsky <js@hotfeet.ch>
11781 * namespace.cs (NamespaceEntry.Using): No matter which warning
11782 level is set, check if this namespace name has already been added.
11784 2004-10-03 Ben Maurer <bmaurer@ximian.com>
11786 * expression.cs: reftype [!=]= null should always use br[true,false].
11789 2004-10-03 Marek Safar <marek.safar@seznam.cz>
11792 * attribute.cs: Enum conversion moved to
11793 GetAttributeArgumentExpression to be applied to the all
11796 2004-10-01 Raja R Harinath <rharinath@novell.com>
11798 Fix #65833, test-300.cs, cs0122-5.cs, cs0122-6.cs.
11799 * class.c (TypeContainer.DefineType): Flag error if
11800 base types aren't accessible due to access permissions.
11801 * decl.cs (DeclSpace.ResolveType): Move logic to
11802 Expression.ResolveAsTypeTerminal.
11803 (DeclSpace.ResolveTypeExpr): Thin layer over
11804 Expression.ResolveAsTypeTerminal.
11805 (DeclSpace.CheckAccessLevel, DeclSpace.FamilyAccess):
11806 Refactor code into NestedAccess. Use it.
11807 (DeclSpace.NestedAccess): New.
11808 * ecore.cs (Expression.ResolveAsTypeTerminal): Add new
11809 argument to silence errors. Check access permissions.
11810 (TypeExpr.DoResolve, TypeExpr.ResolveType): Update.
11811 * expression.cs (ProbeExpr.DoResolve): Use ResolveAsTypeTerminal.
11812 (Cast.DoResolve): Likewise.
11813 (New.DoResolve): Likewise.
11814 (InvocationOrCast.DoResolve,ResolveStatement): Likewise.
11815 (TypeOf.DoResolve): Likewise.
11817 * expression.cs (Invocation.BetterConversion): Return the Type of
11818 the better conversion. Implement section 14.4.2.3 more faithfully.
11819 (Invocation.BetterFunction): Make boolean. Make correspondence to
11820 section 14.4.2.2 explicit.
11821 (Invocation.OverloadResolve): Update.
11822 (Invocation): Remove is_base field.
11823 (Invocation.DoResolve): Don't use is_base. Use mg.IsBase.
11824 (Invocation.Emit): Likewise.
11826 2004-09-27 Raja R Harinath <rharinath@novell.com>
11828 * README: Update to changes.
11830 2004-09-24 Marek Safar <marek.safar@seznam.cz>
11832 * cs-parser.jay: Reverted 642 warning fix.
11834 2004-09-23 Marek Safar <marek.safar@seznam.cz>
11837 * decl.cs (FindMemberWithSameName): Indexer can have more than
11840 2004-09-23 Marek Safar <marek.safar@seznam.cz>
11842 * expression.cs (LocalVariableReference.DoResolveLValue):
11843 Do not report warning 219 for out values.
11844 (EmptyExpression.Null): New member to avoid extra allocations.
11846 2004-09-23 Marek Safar <marek.safar@seznam.cz>
11848 * cs-parser.jay: Fix wrong warning 642 report.
11850 * cs-tokenizer.cs (CheckNextToken): New helper;
11851 Inspect next character if is same as expected.
11853 2004-09-23 Martin Baulig <martin@ximian.com>
11855 * convert.cs (Convert.ImplicitReferenceConversion): Some code cleanup.
11856 (Convert.ImplicitReferenceConversionExists): Likewise.
11858 2004-09-23 Marek Safar <marek.safar@seznam.cz>
11860 * class.cs (Operator.Define): Add error 448 and 559 report.
11862 2004-09-22 Marek Safar <marek.safar@seznam.cz>
11864 * class.cs (MemberBase.IsTypePermitted): New protected
11865 method for checking error CS0610.
11867 2004-09-22 Marek Safar <marek.safar@seznam.cz>
11869 * class.cs (TypeContainer.HasExplicitLayout): New property
11870 Returns whether container has StructLayout attribute set Explicit.
11871 (FieldMember): New abstract class for consts and fields.
11872 (FieldMember.ApplyAttributeBuilder): Add error 636 and 637 report.
11873 (Field): Reuse FieldMember.
11875 * const.cs (Const): Reuse FieldMember.
11877 * rootcontext.cs: EmitConstants call moved to class.
11879 2004-09-22 Martin Baulig <martin@ximian.com>
11881 Thanks to Peter Sestoft for this bug report.
11883 * expression.cs (Conditional): If both the `trueExpr' and the
11884 `falseExpr' is a NullLiteral, return a NullLiteral.
11886 2004-09-22 Martin Baulig <martin@ximian.com>
11888 * statement.cs (Foreach.EmitCollectionForeach): If we're in an
11889 iterator, use `enumerator.EmitThis()' instead of `ec.EmitThis()'
11890 for the "get_Current" call.
11892 2004-09-22 Martin Baulig <martin@ximian.com>
11894 Marek and me just fixed one of our oldest bugs: #28562 :-)
11896 * ecore.cs (EnumConstant.GetValueAsEnumType): New public method.
11898 * attribute.cs (Attribute.GetAttributeArgumentExpression): If
11899 we're an EnumConstant, just return that.
11900 (Attribute.Resolve): GetAttributeArgumentExpression() may give us
11901 an EnumConstant. In this case, we need to use GetValueAsEnumType()
11902 to get the value which'll actually be written into the attribute.
11903 However, we have to use GetValue() to access the attribute's value
11906 2004-09-22 Marek Safar <marek.safar@seznam.cz>
11908 * constant.cs (Constant.IsNegative): New abstract property
11911 * expression.cs (ArrayAccess.DoResolve): Add warning 251.
11912 (StackAlloc.DoResolve): Reused IsNegative.
11914 2004-09-21 Martin Baulig <martin@ximian.com>
11916 * codegen.cs (VariableStorage): Don't store the ILGenerator here;
11917 if we're used in an iterator, we may be called from different
11920 * statement.cs (Foreach.EmitFinally): Only emit an `Endfinally' if
11921 we actually have an exception block.
11923 2004-09-20 John Luke <jluke@cfl.rr.com>
11925 * class.cs, cs-parser.jay: Improve the error report for 1520:
11926 report the actual line where the error happens, not where the
11927 class was declared.
11929 * assign.cs, delegate.cs, ecore.cs, expression.cs, statement.cs:
11930 Pass location information that was available elsewhere.
11932 2004-09-19 Sebastien Pouliot <sebastien@ximian.com>
11934 * codegen.cs: Fix bug #56621. It is now possible to use MCS on the MS
11935 runtime to delay sign assemblies.
11937 2004-09-19 Miguel de Icaza <miguel@ximian.com>
11939 * cs-parser.jay: Do not report the stack trace, this is barely
11942 2004-08-22 John Luke <john.luke@gmail.com>
11944 * driver.cs : check that a resource id is not already used
11945 before adding it, report CS1508 if it is, bug #63637
11947 2004-09-19 Miguel de Icaza <miguel@ximian.com>
11949 * ecore.cs: Removed dead code.
11951 2004-09-18 Marek Safar <marek.safar@seznam.cz>
11953 * class.cs: Do not report warning CS0067 on the interfaces.
11955 2004-09-16 Marek Safar <marek.safar@seznam.cz>
11957 * cs-parser.jay: Add error 504 report.
11959 2004-09-16 Marek Safar <marek.safar@seznam.cz>
11961 * rootcontext.cs: WarningLevel is 4 by default now.
11963 * statement.cs (Fixed.Resolve): Do not null
11966 2004-09-16 Marek Safar <marek.safar@seznam.cz>
11969 * ecore.cs (PropertyExpr.FindAccessors): Do not perform
11970 deep search when property is not virtual.
11971 (PropertyExpr.ResolveAccessors): Make one call for both
11974 2004-09-15 Marek Safar <marek.safar@seznam.cz>
11977 * statement.cs: Error 152 report constains also location.
11979 2004-09-15 Marek Safar <marek.safar@seznam.cz>
11982 * const.cs: Explicitly set constant as static.
11984 2004-09-15 Marek Safar <marek.safar@seznam.cz>
11987 * cs-parser.jay: Add error 1017 report.
11989 2004-09-15 Marek Safar <marek.safar@seznam.cz>
11991 Fixed bug #59980, #64224
11992 * expression.cs (Invocation.DoResolve): Fixed error CS0571 test.
11994 * typemanager.cs (IsSpecialMethod): Simplified
11996 2004-09-14 Marek Safar <marek.safar@seznam.cz>
11998 * decl.cs (MemberCore.Emit): Resuscitated VerifyObsoleteAttribute
11999 condition with better params.
12001 2004-09-14 Marek Safar <marek.safar@seznam.cz>
12004 * attribute.cs (Resolve): Property has to have both
12007 2004-09-14 Martin Baulig <martin@ximian.com>
12009 * decl.cs (MemberCore.Emit): Always call VerifyObsoleteAttribute().
12011 2004-09-14 Marek Safar <marek.safar@seznam.cz>
12014 * codegen.cs (TestObsoleteMethodUsage): Trace when method is
12015 called and is obsolete then this member suppress message
12016 when call is inside next [Obsolete] method or type.
12018 * expression.cs: Use TestObsoleteMethodUsage member.
12020 2004-09-14 Martin Baulig <martin@ximian.com>
12022 * cs-parser.jay: Sync a bit with the GMCS version.
12024 2004-09-14 Martin Baulig <martin@ximian.com>
12026 * cs-parser.jay (CSharpParser): Don't derive from GenericsParser.
12027 (CSharpParser.yacc_verbose_flag): New public field.
12029 * genericparser.cs: Removed.
12031 2004-09-14 Raja R Harinath <rharinath@novell.com>
12033 * cs-parser.jay (event_declaration): Re-enable cs0071 error.
12035 2004-09-13 Marek Safar <marek.safar@seznam.cz>
12037 * class.cs (MethodCore.CheckBase): Fix bug #65757.
12039 2004-09-10 Martin Baulig <martin@ximian.com>
12041 Backported my MemberName changes from GMCS into MCS.
12043 - we are now using a special `MemberName' class instead of using
12044 strings; in GMCS, the `MemberName' also contains the type
12047 - changed the grammar rules a bit:
12048 * the old `member_name' is now a `namespace_or_type_name':
12049 The rule is that we use `namespace_or_type_name' everywhere
12050 where we expect either a "member name" (GetEnumerator) or a
12051 "member name" with an explicit interface name
12052 (IEnumerable.GetEnumerator).
12053 In GMCS, the explicit interface name may include type arguments
12054 (IEnumerable<T>.GetEnumerator).
12055 * we use `member_name' instead of just `IDENTIFIER' for
12057 The rule is that we use `member_name' wherever a member may
12058 have type parameters in GMCS.
12060 * decl.cs (MemberName): New public class.
12061 (MemberCore.MemberName): New public readonly field.
12062 (MemberCore.ctor): Take a `MemberName' argument, not a string.
12063 (DeclSpace): Likewise.
12065 * delegate.cs (Delegate.ctor): Take a MemberName, not a string.
12066 * enum.cs (Enum.ctor): Likewise.
12068 * namespace.cs (AliasEntry.Alias): Changed type from Expression to
12070 (AliasEntry.ctor): Take a MemberName, not an Expression.
12071 (AliasEntry.UsingAlias): Likewise.
12073 * class.cs (TypeContainer.ctor): Take a MemberName, not a string.
12074 (IMethodData.MemberName): Changed type from string to MemberName.
12075 (MemberBase.ExplicitInterfaceName): Likewise.
12076 (AbstractPropertyEventMethod.SetupName): Make this private.
12077 (AbstractPropertyEventMethod.ctor): Added `string prefix'
12078 argument; compute the member name here.
12079 (AbstractPropertyEventMethod.UpdateName): Recompute the name based
12080 on the `member.MemberName' and the `prefix'.
12082 * cs-parser.jay (attribute_name): Use `namespace_or_type_name',
12084 (struct_declaration): Use `member_name' instead of `IDENTIFIER';
12085 thus, we get a `MemberName' instead of a `string'. These
12086 declarations may have type parameters in GMCS.
12087 (interface_method_declaration, delegate_declaration): Likewise.
12088 (class_declaration, interface_declaration): Likewise.
12089 (method_header): Use `namespace_or_type_name' instead of
12090 `member_name'. We may be an explicit interface implementation.
12091 (property_declaration, event_declaration): Likewise.
12092 (member_name): This is now just an `IDENTIFIER', not a
12093 `namespace_or_type_name'.
12094 (type_name, interface_type): Removed.
12095 (namespace_or_type_name): Return a MemberName, not an Expression.
12096 (primary_expression): Use `member_name' instead of `IDENTIFIER';
12097 call GetTypeExpression() on the MemberName to get an expression.
12098 (IndexerDeclaration.interface_type): Changed type from string to
12100 (MakeName): Operate on MemberName's instead of string's.
12102 2004-09-13 Raja R Harinath <rharinath@novell.com>
12105 * namespace.cs (AliasEntry.Resolve): Implement section 16.3.1.
12106 (NamespaceEntry.Lookup): Add new argument to flag if we want the
12107 lookup to avoid symbols introduced by 'using'.
12108 * rootcontext.cs (NamespaceLookup): Update.
12110 2004-09-12 Marek Safar <marek.safar@seznam.cz>
12112 * class.cs (TypeContainer.DoDefineMembers): Do not call
12113 DefineDefaultConstructor for static classes.
12115 2004-09-12 Marek Safar <marek.safar@seznam.cz>
12117 * attribute.cs (Attribute.Resolve): Add error 653 report.
12119 * class.cs (Class.ApplyAttributeBuilder): Add error 641
12121 (Method.ApplyAttributeBuilder): Add error 685 report.
12122 (Operator.Define): Add error 564 report.
12124 * cs-tokenizer.cs (handle_hex): Add error 1013 report.
12126 * expression.cs (Invocation.DoResolve): Add error
12127 245 and 250 report.
12129 * parameter.cs (Parameter.ApplyAttributeBuilder): Add
12132 2004-09-11 Marek Safar <marek.safar@seznam.cz>
12134 * class.cs (ConstructorInitializer.Resolve):
12135 Wrong error number (515->516).
12137 2004-09-11 Marek Safar <marek.safar@seznam.cz>
12139 * class.cs (Indexer.Define): Add error 631 report.
12141 2004-09-11 Marek Safar <marek.safar@seznam.cz>
12143 * ecore.cs (Error_NegativeArrayIndex): Fix 248 error.
12145 2004-09-11 Marek Safar <marek.safar@seznam.cz>
12147 * expression.cs (Probe.DoResolve): Add error CS0241 report.
12149 2004-09-10 Marek Safar <marek.safar@seznam.cz>
12151 * cs-parser.jay: Added error CS0241 report.
12153 2004-09-10 Raja R Harinath <rharinath@novell.com>
12155 * cs-parser.jay (fixed_statement): Introduce a scope for the
12156 declaration in the 'fixed' statement.
12158 2004-09-09 Marek Safar <marek.safar@seznam.cz>
12160 * cs-parser.jay: Added CS0230 error report.
12162 2004-09-09 Marek Safar <marek.safar@seznam.cz>
12164 * cs-parser.jay: Added errors CS0231 and CS0257 report.
12166 2004-09-09 Marek Safar <marek.safar@seznam.cz>
12168 * expression.cs (Argument.Resolve): Added error CS0192 and
12171 2004-09-09 Marek Safar <marek.safar@seznam.cz>
12173 C# 2.0 #pragma warning feature
12175 * cs-tokenizer.cs (PreProcessPragma): New method;
12176 Handles #pragma directive.
12178 * report.cs (WarningRegions): New class; Support
12179 class for #pragma warning directive. It tests whether
12180 warning is enabled for a given line.
12182 2004-09-08 Miguel de Icaza <miguel@ximian.com>
12184 * const.cs: Add more descriptive error report, tahnks to
12187 2004-09-08 Marek Safar <marek.safar@seznam.cz>
12189 * ecore.cs (FieldExpr.DoResolveLValue): Fixed CS0198 report.
12191 2004-09-07 Miguel de Icaza <miguel@ximian.com>
12193 * expression.cs: Apply patch from Ben: Remove dead code from
12194 ArrayCreation, and remove the TurnintoConstant call in const.cs,
12195 as that code just threw an exception anwyays.
12197 * const.cs: Remove the call to the turnintoconstant, for details
12200 * literal.cs: The type of the null-literal is the null type; So
12201 we use a placeholder type (literal.cs:System.Null, defined here)
12204 * expression.cs (Conditional.DoResolve): Remove some old code that
12205 is no longer needed, conversions have been fixed.
12207 (ArrayCreationExpression.DoResolve): Return false if we fail to
12208 resolve the inner expression.
12210 2004-09-07 Raja R Harinath <rharinath@novell.com>
12213 * cs-parser.jay (delegate_declaration): Record a delegate
12214 declaration as a type declaration.
12215 Reported by Jo Vermeulen <jo@lumumba.luc.ac.be>.
12217 2004-09-06 Miguel de Icaza <miguel@ximian.com>
12219 * parameter.cs: Do not crash if the type can not be resolved.
12221 * expression.cs: Report errors with unsafe pointers, fixes #64896
12223 2004-09-06 Ben Maurer <bmaurer@users.sourceforge.net>
12225 * expression.cs: Pointer arith always needs to do a conv.i
12226 if the operand is a long. fix 65320
12228 2004-09-04 Marek Safar <marek.safar@seznam.cz>
12230 Fixed cs0619-37.cs, cs0619-38.cs
12232 * enum.cs (GetObsoleteAttribute): Removed.
12234 * expression.cs (MemberAccess.DoResolve): Test for [Obsolete]
12235 on Enum member is double staged. The first is tested member
12238 2004-09-04 Marek Safar <marek.safar@seznam.cz>
12240 Fixed #56986, #63631, #65231
12242 * class.cs: (TypeContainer.AddToMemberContainer): New method,
12243 adds member to name container.
12244 (TypeContainer.AddToTypeContainer): New method, adds type to
12246 (AddConstant, AddEnum, AddClassOrStruct, AddDelegate, AddMethod,
12247 AddConstructor, AddInterface, AddField, AddProperty, AddEvent,
12248 AddOperator): Simplified by reusing AddToMemberContainer.
12249 (TypeContainer.UserDefinedStaticConstructor): Changed to property
12251 (Method.CheckForDuplications): Fixed implementation to test all
12253 (MemberBase): Detection whether member is explicit interface
12254 implementation is now in constructor.
12255 (MemberBase.UpdateMemberName): Handles IndexerName.
12256 (Accessor): Changed to keep also location information.
12257 (AbstractPropertyEventMethod): Is derived from MemberCore.
12258 (AbstractPropertyEventMethod.IsDummy): Says whether accessor
12259 will be emited or not.
12260 (PropertyBase.AreAccessorsDuplicateImplementation):
12261 Tests whether accessors are not in collision with some method.
12262 (Operator): Is derived from MethodCore to simplify common
12265 * decl.cs (Flags.TestMethodDuplication): Test for duplication
12267 (DeclSpace.AddToContainer): Adds the member to defined_names
12268 table. It tests for duplications and enclosing name conflicts.
12270 * enum.cs (EnumMember): Clean up to reuse the base structures
12272 2004-09-03 Martin Baulig <martin@ximian.com>
12274 * class.cs (TypeContainer.DefineDefaultConstructor): Put this back
12275 into TypeContainer, to make partial classes work again.
12277 2004-09-03 Martin Baulig <martin@ximian.com>
12279 * rootcontext.cs (RootContext.V2): Removed.
12281 2004-03-23 Martin Baulig <martin@ximian.com>
12283 * expression.cs (Invocation.OverloadResolve): Added `bool
12284 may_fail' argument and use it instead of the Location.IsNull() hack.
12286 2004-09-03 Martin Baulig <martin@ximian.com>
12288 Merged latest changes into gmcs. Please keep this comment in
12289 here, it makes it easier for me to see what changed in MCS since
12290 the last time I merged.
12292 2004-09-03 Raja R Harinath <rharinath@novell.com>
12295 * expression.cs (BetterConversion): Don't allow either conversion
12296 to be null. Remove redundant implicit conversion test when 'q ==
12297 null' -- when this function is invoked, we already know that the
12298 implicit conversion exists.
12299 (BetterFunction): Assume that 'best' is non-null. Remove
12300 redundant reimplementation of IsApplicable when 'best' is null.
12301 (IsParamsMethodApplicable, IsApplicable): Add new parameter for
12302 number of arguments.
12303 (IsAncestralType): Extract from OverloadResolve.
12304 (OverloadResolve): Make robust to the MethodGroupExpr being
12305 unsorted. Implement all the logic of Section 14.5.5.1, and
12306 support overloading of methods from multiple applicable types.
12307 Clean up logic somewhat. Don't pass null methods to BetterFunction.
12309 * report.cs (SymbolRelatedToPreviousError): Cleanup output.
12310 (RealError, Warning): Append type of report to related symbol.
12312 2004-09-03 Marek Safar <marek.safar@seznam.cz>
12314 * enum.cs: Fixed CLS-Compliance checks for enum members.
12315 Error tests cs3008-8.cs, cs3014-8.cs
12317 2004-09-02 Marek Safar <marek.safar@seznam.cz>
12319 Fixed bug #62342, #63102
12320 * class.cs: ImplementIndexer uses member.IsExplicitImpl
12321 like ImplementMethod.
12323 2004-09-02 Marek Safar <marek.safar@seznam.cz>
12325 * attribute.cs (Attribute.GetAttributeArgumentExpression):
12328 2004-09-02 Martin Baulig <martin@ximian.com>
12330 * statement.cs (Using.EmitLocalVariableDeclFinally): Use
12331 TypeManager.GetArgumentTypes() rather than calling GetParameters()
12334 2004-09-01 Marek Safar <marek.safar@seznam.cz>
12336 C# 2.0 Static classes implemented
12338 * class.cs (TypeContainer): instance_constructors,
12339 initialized_fields, initialized_static_fields,
12340 default_constructor, base_inteface_types are protected to be
12341 accessible from StaticClass.
12342 (TypeContainer.DefineDefaultConstructor): New virtual method
12343 for custom default constructor generating
12344 (StaticClass): New class to handle "Static classes" feature.
12346 * cs-parser.jay: Handle static keyword on class like instance
12349 * driver.cs: Added "/langversion" command line switch with two
12350 options (iso-1, default).
12352 2004-08-31 Marek Safar <marek.safar@seznam.cz>
12354 * ecore.cs (FieldExpr.Resolve): Fixed bug #64689.
12356 2004-08-31 Miguel de Icaza <miguel@ximian.com>
12358 * delegate.cs: Style.
12360 2004-08-31 Ben Maurer <bmaurer@users.sourceforge.net>
12362 * delegate.cs: Add seperate instance expr field for miguel.
12364 2004-08-29 Ben Maurer <bmaurer@users.sourceforge.net>
12366 * PointerArithmetic (Resolve): make sure we are not doing
12367 pointer arith on void*. Also, make sure we are resolved
12368 by not setting eclass until resolve.
12370 All callers: Make sure that PointerArithmetic gets resolved.
12372 2004-08-29 Ben Maurer <bmaurer@users.sourceforge.net>
12374 * ArrayCreation (LookupType): If the type does not resolve
12375 to an array, give an error.
12377 2004-08-27 Marek Safar <marek.safar@seznam.cz>
12379 * statement.cs (Try.Resolve): Fixed bug #64222
12381 2004-08-27 Martin Baulig <martin@ximian.com>
12384 (TC.OperatorArrayList.OperatorEntry.CheckPairedOperators): Don't
12387 2004-08-26 Marek Safar <marek.safar@seznam.cz>
12389 * ecore.cs (Constantify): Get underlying type via
12390 System.Enum.GetUnderlyingType to avoid StackOverflow on the
12391 Windows in special cases.
12393 2004-08-26 Marek Safar <marek.safar@seznam.cz>
12395 * typemanager.cs (GetAddMethod): Used GetAddMethod (true)
12396 for obtaining also private methods.
12397 (GetRemoveMethod): Used GetRemoveMethod (true)
12398 for obtaining also private methods.
12400 2004-08-24 Martin Baulig <martin@ximian.com>
12402 * class.cs (Method.Define): Set MethodAttributes.SpecialName and
12403 MethodAttributes.HideBySig for operators.
12405 2004-08-23 Martin Baulig <martin@ximian.com>
12407 Back to the old error reporting system :-)
12409 * report.cs (Message): Removed.
12410 (Report.MessageData, ErrorData, WarningData): Removed.
12411 (Report.Error, Warning): Back to the old system.
12413 2004-08-23 Martin Baulig <martin@ximian.com>
12415 * decl.cs (IMemberContainer.Parent): Renamed to ParentContainer.
12417 * class.cs (TypeContainer.ParentContainer): New public virtual
12418 method; replaces the explicit interface implementation.
12419 (ClassPart.ParentContainer): Override.
12421 2004-08-23 Martin Baulig <martin@ximian.com>
12423 * statement.cs (Switch): Added support for constant switches; see
12424 #59428 or test-285.cs.
12426 2004-08-22 Marek Safar <marek.safar@seznam.cz>
12429 * statement.cs (GetEnumeratorFilter): Removed useless
12430 logic because C# specs is strict. GetEnumerator must be
12433 2004-08-22 Martin Baulig <martin@ximian.com>
12435 * flowanalysis.cs (FlowBranching.UsageVector.MergeChild): If we're
12436 a switch and may break, reset the barrier. Fixes #59867.
12438 2004-08-22 Marek Safar <marek.safar@seznam.cz>
12440 CLS-Compliance speed up (~5% for corlib)
12442 * attribute.cs (AttributeTester.VerifyTopLevelNameClsCompliance):
12443 New method. Tests container for CLS-Compliant names
12445 * class.cs (TypeContainer.VerifyClsName): New method.
12446 Checks whether container name is CLS Compliant.
12447 (Constructor): Implements IMethodData.
12449 * decl.cs (MemberCache.GetPublicMembers ): New method. Builds
12450 low-case table for CLS Compliance test.
12451 (MemberCache.VerifyClsParameterConflict): New method.
12452 Checks method parameters for CS3006 error.
12454 * enum.cs (EnumMember): Is derived from MemberCore.
12455 (Enum.VerifyClsName): Optimized for better performance.
12457 2004-08-06 Marek Safar <marek.safar@seznam.cz>
12459 * report.cs: Renamed Error_T to Error and changed all
12462 2004-08-06 Marek Safar <marek.safar@seznam.cz>
12464 * class.cs (TypeContainer.IndexerArrayList): New inner class
12465 container for indexers.
12466 (TypeContainer.DefaultIndexerName): New constant for default
12467 indexer name. Replaced all "Item" with this constant.
12468 (TypeContainer.DefineIndexers): Moved to IndexerArrayList class.
12470 * typemanager.cs (TypeManager.default_member_ctor): Cache here
12471 DefaultMemberAttribute constructor.
12473 2004-08-05 Martin Baulig <martin@ximian.com>
12475 * flowanalysis.cs (FlowBranching.UsageVector.MergeJumpOrigins):
12478 2004-08-05 Marek Safar <marek.safar@seznam.cz>
12480 * mcs.exe.sources: $(EXTRA_SOURCES) are now here to avoid
12481 multi platforms problem.
12483 * compiler.csproj: Included shared files.
12485 2004-08-04 Marek Safar <marek.safar@seznam.cz>
12487 Fix bug 60333, 55971 in the more general way
12488 * attribute.cs (Attribute.GetAttributeArgumentExpression):
12489 Added arg_type argument for constant conversion.
12490 (Attribute.Resolve): Reuse GetAttributeArgumentExpression.
12492 2004-08-04 Marek Safar <marek.safar@seznam.cz>
12495 * class.cs (TypeContainer ): New inner classes MethodArrayList,
12496 OperatorArrayList, MethodCoreArrayList for typecontainer
12497 containers. Changed class member types to these new types.
12498 (MethodArrayList.DefineMembers): Added test for CS0659.
12500 2004-08-04 Miguel de Icaza <miguel@ximian.com>
12502 * cfold.cs: Synchronize the folding with the code in expression.cs
12503 Binary.DoNumericPromotions for uint operands.
12505 * attribute.cs: Revert patch from Raja, it introduced a regression
12506 while building Blam-1.2.1 (hard to isolate a test case).
12508 2004-08-04 Marek Safar <marek.safar@seznam.cz>
12512 (TypeContainer.Define): Renamed to DefineContainerMembers because of
12514 (MethodCore.parent_method): New member. The method we're overriding
12515 if this is an override method.
12516 (MethodCore.CheckBase): Moved from Method class and made common.
12517 (MethodCore.CheckMethodAgainstBase): Moved from MemberBase and made
12519 (MethodCore.CheckForDuplications): New abstract method. For custom
12520 member duplication search in a container
12521 (MethodCore.FindOutParentMethod): New abstract method. Gets parent
12522 method and its return type.
12523 (Event.conflict_symbol): New member. Symbol with same name in the
12527 (MemberCache.FindMemberWithSameName): New method. The method
12528 is looking for conflict with inherited symbols.
12530 2004-08-04 Martin Baulig <martin@ximian.com>
12532 * codegen.cs (VariableStorage.EmitLoadAddress): New public method.
12534 * statement.cs (Foreach.EmitFinally): Make this work for valuetypes.
12536 2004-08-03 Marek Safar <marek.safar@seznam.cz>
12538 * report.cs (Message): New enum for better error, warning reference in
12540 (MessageData): New inner abstract class. It generally handles printing of
12541 error and warning messages.
12542 Removed unused Error, Warning, Message methods.
12544 2004-08-03 Marek Safar <marek.safar@seznam.cz>
12546 Fix for cs0592-8.cs test
12548 (Attributable.ValidAttributeTargets): Made public.
12549 (Attribute.ExplicitTarget): New member for explicit target value.
12550 (Attribute.CheckTargets): Now we translate explicit attribute
12551 target to Target here.
12553 2004-08-03 Ben Maurer <bmaurer@ximian.com>
12555 * ecore.cs (MethodGroupExpr): new IsBase property.
12557 * expression.cs (BaseAccess): Set IsBase on MethodGroupExpr.
12559 * delegate.cs (DelegateCreation): store a MethodGroupExpr
12560 rather than an instance expr.
12562 (DelegateCreation.Emit): Use the method group rather than
12563 the instance expression. Also, if you have base.Foo as the
12564 method for a delegate, make sure to emit ldftn, not ldftnvirt.
12566 (ResolveMethodGroupExpr): Use the MethodGroupExpr.
12568 (NewDelegate.DoResolve): Only check for the existance of Invoke
12569 if the method is going to be needed. Use MethodGroupExpr.
12571 (NewDelegate.Emit): Remove, DelegateCreation implements this.
12573 * expression.cs: For pointer arith., make sure to use
12574 the size of the type, not the size of the pointer to
12577 2004-08-03 Marek Safar <marek.safar@seznam.cz>
12580 * class.cs (Class): Added error CS0502 test.
12582 2004-08-03 John Luke <jluke@cfl.rr.com>
12583 Raja R Harinath <rharinath@novell.com>
12586 * attribute.cs (Attribute.complained_before): New flag.
12587 (Attribute.ResolveType, Attribute.Resolve),
12588 (Attribute.DefinePInvokeMethod): Set it.
12589 (Attributes.Search): Pass 'complain' to Attribute.ResolveType.
12591 2004-08-03 Martin Baulig <martin@ximian.com>
12593 * expression.cs (Binary.ResolveOperator): Don't abort if we can't
12594 use a user-defined operator; we still need to do numeric
12595 promotions in case one argument is a builtin type and the other
12596 one has an implicit conversion to that type. Fixes #62322.
12598 2004-08-02 Martin Baulig <martin@ximian.com>
12600 * statement.cs (LocalInfo.Flags): Added `IsThis'.
12601 (LocalInfo.IsThis): New public property.
12602 (Block.EmitMeta): Don't create a LocalBuilder for `this'.
12604 2004-08-01 Martin Baulig <martin@ximian.com>
12606 * class.cs (TypeContainer.GetClassBases): Don't set the default
12607 here since we may get called from GetPartialBases().
12608 (TypeContainer.DefineType): If GetClassBases() didn't return a
12609 parent, use the default one.
12611 2004-07-30 Duncan Mak <duncan@ximian.com>
12613 * Makefile (mcs2.exe, mcs3.exe): add $(EXTRA_SOURCES).
12615 2004-07-30 Martin Baulig <martin@ximian.com>
12617 * Makefile (EXTRA_SOURCES): List the symbol writer's sources here.
12619 * class.cs (SourceMethod): New public class, derive from the
12620 symbol writer's ISourceMethod.
12621 (Method): Use the new symbol writer API.
12623 * codegen.cs (CodeGen.InitializeSymbolWriter): Take the filename
12624 as argument and use the new symbol writer.
12627 (SourceFile): Implement the symbol writer's ISourceFile.
12628 (Location.SymbolDocument): Removed.
12629 (Location.SourceFile): New public property.
12631 * symbolwriter.cs: Use the new symbol writer API.
12633 2004-07-30 Raja R Harinath <rharinath@novell.com>
12635 * Makefile (install-local): Remove. Functionality moved to
12638 2004-07-28 Lluis Sanchez Gual <lluis@novell.com>
12640 * Makefile: Install mcs.exe.config file together with mcs.exe.
12641 * mcs.exe.config: Added supportedRuntime entry to make sure it runs in the
12642 correct runtime version.
12644 2004-07-25 Martin Baulig <martin@ximian.com>
12647 (TypeContainer.RegisterOrder): Removed, this was unused.
12648 (TypeContainer, interface_order): Removed.
12649 (TypeContainer.AddClass, AddStruct, AddInterface): Take a
12650 TypeContainer as argument since we can also be called with a
12651 `PartialContainer' for a partial class/struct/interface.
12652 (TypeContainer.IsInterface): Use `Kind == Kind.Interface' instead
12653 of checking whether we're an `Interface' - we could be a
12654 `PartialContainer'.
12655 (PartialContainer.Register): Override; call
12656 AddClass()/AddStruct()/AddInterface() on our parent.
12658 * cs-parser.jay (interface_member_declaration): Add things to the
12659 `current_container', not the `current_class'.
12661 * rootcontext.cs (RegisterOrder): The overloaded version which
12662 takes an `Interface' was unused, removed.
12664 * typemanager.cs (TypeManager.LookupInterface): Return a
12665 `TypeContainer', not an `Interface'.
12666 (TypeManager.IsInterfaceType): The `builder_to_declspace' may
12667 contain a `PartialContainer' for an interface, so check it's
12668 `Kind' to figure out what it is.
12670 2004-07-25 Martin Baulig <martin@ximian.com>
12672 * class.cs (Class.DefaultTypeAttributes): New public constant.
12673 (Struct.DefaultTypeAttributes): Likewise.
12674 (Interface.DefaultTypeAttributes): Likewise.
12675 (PartialContainer.TypeAttr): Override this and add the
12676 DefaultTypeAttributes.
12678 2004-07-25 Martin Baulig <martin@ximian.com>
12680 * decl.cs (DeclSpace.Emit): Removed the `TypeContainer' argument,
12681 we can just use the `Parent' field instead.
12683 2004-07-25 Martin Baulig <martin@ximian.com>
12685 * class.cs (TypeContainer.Emit): Renamed to EmitType().
12687 2004-07-25 Martin Baulig <martin@ximian.com>
12689 * class.cs (TypeContainer.DefineMembers): Call DefineMembers() on
12690 our parts before defining any methods.
12691 (TypeContainer.VerifyImplements): Make this virtual.
12692 (ClassPart.VerifyImplements): Override and call VerifyImplements()
12693 on our PartialContainer.
12695 2004-07-25 Martin Baulig <martin@ximian.com>
12697 * iterators.cs (Iterator.Define): Renamed to DefineIterator().
12699 * decl.cs (DeclSpace.Define): Removed the `TypeContainer'
12700 argument, we can just use the `Parent' field instead.
12703 (MemberBase.CheckBase): Removed the `TypeContainer' argument.
12704 (MemberBase.DoDefine): Likewise.
12706 2004-07-24 Martin Baulig <martin@ximian.com>
12708 * decl.cs (MemberCore.Parent): New public field.
12709 (DeclSpace.Parent): Moved to MemberCore.
12711 * class.cs (MethodCore.ds): Removed; use `Parent' instead.
12712 (MemberBase.ctor): Added TypeContainer argument, pass it to our
12714 (FieldBase, Field, Operator): Likewise.
12715 (EventProperty.ctor): Take a TypeContainer instead of a DeclSpace.
12716 (EventField, Event): Likewise.
12718 2004-07-23 Martin Baulig <martin@ximian.com>
12720 * class.cs (PartialContainer): New public class.
12721 (ClassPart): New public class.
12722 (TypeContainer): Added support for partial classes.
12723 (TypeContainer.GetClassBases): Splitted some of the functionality
12724 out into GetNormalBases() and GetPartialBases().
12726 * cs-tokenizer.cs (Token.PARTIAL): New token.
12727 (Tokenizer.consume_identifier): Added some hacks to recognize
12728 `partial', but only if it's immediately followed by `class',
12729 `struct' or `interface'.
12731 * cs-parser.jay: Added support for partial clases.
12733 2004-07-23 Martin Baulig <martin@ximian.com>
12735 * class.cs (MethodCore.ds): Made this a `TypeContainer' instead of
12736 a `DeclSpace' and also made it readonly.
12737 (MethodCore.ctor): Take a TypeContainer instead of a DeclSpace.
12738 (Method.ctor, Constructor.ctor, Destruktor.ctor): Likewise.
12739 (PropertyBase.ctor, Property.ctor, Indexer.ctor): Likewise.
12741 * cs-parser.jay: Pass the `current_class', not the
12742 `current_container' (at the moment, this is still the same thing)
12743 to a new Method, Property, Event, Indexer or Constructor.
12745 2004-07-23 Martin Baulig <martin@ximian.com>
12747 * cs-parser.jay (CSharpParser): Added a new `current_class' field
12748 and removed the `current_interface' one.
12749 (struct_declaration, class_declaration, interface_declaration):
12750 Set `current_class' to the newly created class/struct/interface;
12751 set their `Bases' and call Register() before parsing their body.
12753 2004-07-23 Martin Baulig <martin@ximian.com>
12755 * class.cs (Kind): New public enum.
12756 (TypeContainer): Made this class abstract.
12757 (TypeContainer.Kind): New public readonly field.
12758 (TypeContainer.CheckDef): New public method; moved here from
12760 (TypeContainer.Register): New public abstract method.
12761 (TypeContainer.GetPendingImplementations): New public abstract
12763 (TypeContainer.GetClassBases): Removed the `is_class' and
12764 `is_iface' parameters.
12765 (TypeContainer.DefineNestedTypes): Formerly known as
12767 (ClassOrStruct): Made this class abstract.
12769 * tree.cs (RootTypes): New public type.
12771 2004-07-20 Martin Baulig <martin@ximian.com>
12773 * tree.cs (Tree.RecordNamespace): Removed.
12774 (Tree.Namespaces): Removed.
12776 * rootcontext.cs (RootContext.IsNamespace): Removed.
12778 * cs-parser.jay (namespace_declaration): Just create a new
12779 NamespaceEntry here.
12781 2004-07-20 Martin Baulig <martin@ximian.com>
12783 * statement.cs (ExceptionStatement): New abstract class. This is
12784 now used as a base class for everyone who's using `finally'.
12785 (Using.ResolveLocalVariableDecls): Actually ResolveLValue() all
12786 our local variables before using them.
12788 * flowanalysis.cs (FlowBranching.StealFinallyClauses): New public
12789 virtual method. This is used by Yield.Resolve() to "steal" an
12790 outer block's `finally' clauses.
12791 (FlowBranchingException): The .ctor now takes an ExceptionStatement
12794 * codegen.cs (EmitContext.StartFlowBranching): Added overloaded
12795 version which takes an ExceptionStatement. This version must be
12796 used to create exception branchings.
12799 (Yield.Resolve): "Steal" all `finally' clauses from containing blocks.
12800 (Iterator.EmitMoveNext): Added exception support; protect the
12801 block with a `fault' clause, properly handle 'finally' clauses.
12802 (Iterator.EmitDispose): Run all the `finally' clauses here.
12804 2004-07-20 Martin Baulig <martin@ximian.com>
12806 * iterator.cs: This is the first of a set of changes in the
12807 iterator code. Match the spec more closely: if we're an
12808 IEnumerable, then GetEnumerator() must be called. The first time
12809 GetEnumerator() is called, it returns the current instance; all
12810 subsequent invocations (if any) must create a copy.
12812 2004-07-19 Miguel de Icaza <miguel@ximian.com>
12814 * expression.cs: Resolve the constant expression before returning
12817 2004-07-19 Martin Baulig <martin@ximian.com>
12819 * iterators.cs (Iterator.MapVariable): Don't define fields twice.
12820 (Iterator.MoveNextMethod.DoEmit): Use `TypeManager.int32_type' as
12821 the return type of the new EmitContext.
12823 2004-07-18 Martin Baulig <martin@ximian.com>
12825 * class.cs (Property.Define): Fix iterators.
12827 * iterators.cs (Iterator.Define): Moved the
12828 `container.AddInterator (this)' call here from the .ctor; only do
12829 it if we resolved successfully.
12831 2004-07-17 Miguel de Icaza <miguel@ximian.com>
12833 * cs-tokenizer.cs (handle_preprocessing_directive): Do not return
12834 `true' for preprocessing directives that we parse. The return
12835 value indicates whether we should return to regular tokenizing or
12836 not, not whether it was parsed successfully.
12838 In the past if we were in: #if false ... #line #endif, we would
12839 resume parsing after `#line'. See bug 61604.
12841 * typemanager.cs: Removed an old hack from Gonzalo to get corlib
12842 building: IsEnumType should return true only for enums, not for
12843 enums or System.Enum itself. This fixes #61593.
12845 Likely what happened is that corlib was wrong: mcs depended on
12846 this bug in some places. The bug got fixed, we had to add the
12847 hack, which caused bug 61593.
12849 * expression.cs (ArrayAccess.GetStoreOpCode): Remove an old hack
12850 that was a workaround for the older conditions.
12852 2004-07-16 Ben Maurer <bmaurer@ximian.com>
12854 * assign.cs: IAssignMethod has a new interface, as documented
12855 inline. All assignment code now uses this new api.
12857 * ecore.cs, expression.cs: All classes which implement
12858 IAssignMethod now use the new interface.
12860 * expression.cs (Invocation): add a hack to EmitCall so that
12861 IndexerAccess can be the target of a compound assignment without
12862 evaluating its arguments twice.
12864 * statement.cs: Handle changes in Invocation api.
12866 2004-07-16 Martin Baulig <martin@ximian.com>
12868 * iterators.cs: Rewrote this. We're now using one single Proxy
12869 class for both the IEnumerable and the IEnumerator interface and
12870 `Iterator' derives from Class so we can use the high-level API.
12872 * class.cs (TypeContainer.AddIterator): New method.
12873 (TypeContainer.DoDefineType): New protected virtual method, which
12874 is called from DefineType().
12875 (TypeContainer.DoDefineMembers): Call DefineType() and
12876 DefineMembers() on all our iterators.
12877 (TypeContainer.Emit): Call Emit() on all our iterators.
12878 (TypeContainer.CloseType): Call CloseType() on all our iterators.
12880 * codegen.cs (EmitContext.CurrentIterator): New public field.
12882 2004-07-15 Martin Baulig <martin@ximian.com>
12885 (TypeManager.not_supported_exception_type): New type.
12887 2004-07-14 Martin Baulig <martin@ximian.com>
12889 * iterators.cs: Use real error numbers.
12891 2004-07-14 Martin Baulig <martin@ximian.com>
12893 * iterator.cs (IteratorHandle.IsIEnumerable): The spec explicitly
12894 requires this to be a System.Collection.IEnumerable and not a
12895 class implementing that interface.
12896 (IteratorHandle.IsIEnumerator): Likewise, for IEnumerator.
12898 2004-07-13 Marek Safar <marek.safar@seznam.cz>
12900 * class.cs: Fixed previous fix, it broke some error tests.
12902 2004-07-12 Martin Baulig <martin@ximian.com>
12904 * enum.cs (Enum.Define): Call Emit() to emit the attributes.
12907 2004-07-09 Miguel de Icaza <miguel@ximian.com>
12909 * assign.cs (LocalTemporary): Add new argument: is_address,If
12910 `is_address' is true, then the value that we store is the address
12911 to the real value, and not the value itself.
12913 * ecore.cs (PropertyExpr): use the new local temporary
12914 stuff to allow us to handle X.Y += z (where X is a struct)
12916 2004-07-08 Martin Baulig <martin@ximian.com>
12918 * statement.cs (Lock.Resolve): Set ec.NeedReturnLabel() if we do
12919 not always return, just like we're doing in Using.Resolve().
12921 2004-07-07 Miguel de Icaza <miguel@ximian.com>
12923 * cs-parser.jay (fixed_statement): flag this as Pinned.
12925 2004-07-06 Miguel de Icaza <miguel@ximian.com>
12927 * typemanager.cs (TypeManager): Removed MakePinned method, this
12928 mechanism is replaced with the .NET 2.x compatible mechanism of
12929 calling `ILGenerator.DeclareLocal (Type t, bool pinned)'.
12931 * statement.cs (LocalInfo): Remove MakePinned, add Pinned property
12932 Rename `Fixed' to `Pinned' as a flag, to distinguish from the
12933 `IsFixed' property which has a different meaning.
12935 2004-07-02 Raja R Harinath <rharinath@novell.com>
12937 * ecore.cs (DoSimpleNameResolve): Expand CS0038 check to all names
12938 visible from inside a nested class, not just the names of the
12939 immediately enclosing class.
12940 Fix for bug #60730.
12942 2004-06-24 Raja R Harinath <rharinath@novell.com>
12944 * expression.cs (BetterConversion): Remove buggy special-case
12945 handling of "implicit constant expression conversions". At this
12946 point, we already know that the conversion is possible -- we're
12947 only checking to see which is better.
12949 2004-06-24 Marek Safar <marek.safar@seznam.cz>
12951 * cs-parser.jay: Added error CS0210 test.
12953 2004-06-24 Marek Safar <marek.safar@seznam.cz>
12955 * cs-parser.jay: Added error CS0134 test.
12957 2004-06-24 Marek Safar <marek.safar@seznam.cz>
12960 * cs-parser.jay: Added error CS0145 test.
12962 2004-06-24 Marek Safar <marek.safar@seznam.cz>
12964 * class.cs (Operator.Define): Added test for errors CS0553, CS0554.
12966 2004-06-23 Ben Maurer <bmaurer@ximian.com>
12968 * expression.cs (StackAlloc.Resolve): The argument may not
12969 be a constant; deal with this case.
12971 2004-06-23 Marek Safar <marek.safar@seznam.cz>
12973 * attribute.cs (IndexerName_GetIndexerName): Renamed to
12974 GetIndexerAttributeValue.
12975 (ScanForIndexerName): Renamed to GetIndexerNameAttribute.
12977 * class.cs (Indexer.Define): Added error tests for CS0415,
12980 2004-06-23 Miguel de Icaza <miguel@ximian.com>
12982 * attribute.cs (Attribute.Resolve): Keep field code in sync with
12985 2004-06-23 Martin Baulig <martin@ximian.com>
12987 * flowanalysis.cs (UsageVector.MergeChild): If we're a loop and we
12988 neither return nor throw, reset the barrier as well. Fixes #60457.
12990 2004-06-22 Atsushi Enomoto <atsushi@ximian.com>
12992 * class.cs : EventAttributes is now set to None by default.
12993 This fixes bug #60459.
12995 2004-06-18 Marek Safar <marek.safar@seznam.cz>
12998 * class.cs (ConstructorInitializer.GetOverloadedConstructor):
12999 Don't throw exception but return null (it's sufficient now).
13001 2004-06-18 Marek Safar <marek.safar@seznam.cz>
13003 * typemanager.cs (GetArgumentTypes): Faster implementation.
13005 2004-06-18 Martin Baulig <martin@ximian.com>
13007 * attribute.cs (Attribute.Resolve): Check whether we're an
13008 EmptyCast which a Constant child. Fixes #60333.
13010 2004-06-17 Ben Maurer <bmaurer@ximian.com>
13012 * statement.cs (EmitCollectionForeach): Account for the fact that
13013 not all valuetypes are in areas which we can take the address of.
13014 For these variables, we store to a temporary variable. Also, make
13015 sure that we dont emit a `callvirt' on a valuetype method.
13017 2004-06-15 Marek Safar <marek.safar@seznam.cz>
13019 * expression.cs (StackAlloc.DoReSolve): Added test for
13020 negative parameter (CS0247).
13022 2004-06-15 Marek Safar <marek.safar@seznam.cz>
13025 * class.cs: (Event.DelegateMethod.Emit): Added synchronization flag.
13027 2004-06-15 Marek Safar <marek.safar@seznam.cz>
13030 * expression.cs: (Binary.DoNumericPromotions): Added conversion for
13033 2004-06-14 Marek Safar <marek.safar@seznam.cz>
13035 Fix bug #58254 & cs1555.cs, cs1556.cs
13036 * driver.cs (MainDriver): Added tests for errors CS1555, CS1556.
13038 2004-06-14 Marek Safar <marek.safar@seznam.cz>
13040 * cs-parser.jay: Added error CS1669 test for indexers.
13042 2004-06-11 Martin Baulig <martin@ximian.com>
13044 * expression.cs (Invocation.IsParamsMethodApplicable): We need to
13045 call this twice: for params and varargs methods.
13047 2004-06-11 Marek Safar <marek.safar@seznam.cz>
13050 (FieldBase.DoDefine, PropertyBase.DoDefine): Added error test CS0610.
13052 2004-06-11 Marek Safar <marek.safar@seznam.cz>
13054 * attribute.cs (Attribute.GetValidTargets): Made public.
13057 (AbstractPropertyEventMethod): New class for better code sharing.
13058 (AbstractPropertyEventMethod.ApplyAttributeBuilder): Add error
13060 (PropertyMethod, DelegateMethod): Derived from AbstractPropertyEventMethod
13062 2004-06-11 Raja R Harinath <rharinath@novell.com>
13065 * ecore.cs (ResolveFlags): Add new 'Intermediate' flag to tell
13066 that the call to Resolve is part of a MemberAccess.
13067 (Expression.Resolve): Use it for SimpleName resolution.
13068 (SimpleName.SimpleNameResolve, SimpleName.DoResolveAllowStatic):
13069 Add 'intermediate' boolean argument.
13070 (SimpleName.DoSimpleNameResolve): Likewise. Use it to disable an
13071 error message when the SimpleName can be resolved ambiguously
13072 between an expression and a type.
13073 * expression.cs (MemberAccess.IdenticalNameAndTypeName): Make
13075 (MemberAccess.Resolve): Pass 'Intermediate' flag to the Resolve()
13076 call on the left-side.
13078 2004-06-11 Marek Safar <marek.safar@seznam.cz>
13081 (MethodCore.VerifyClsCompliance): Added test for error CS3000.
13083 2004-06-11 Marek Safar <marek.safar@seznam.cz>
13085 * attribute.cs (Attribute.Emit): Fixed error CS0579 reporting.
13087 2004-06-11 Martin Baulig <martin@ximian.com>
13089 * expression.cs (Invocation.EmitCall): Use OpCodes.Callvirt for
13090 varargs methods if applicable.
13092 2004-06-11 Martin Baulig <martin@ximian.com>
13094 * expression.cs (Invocation.EmitCall): Don't use
13095 `method.CallingConvention == CallingConventions.VarArgs' since the
13096 method could also have `CallingConventions.HasThis'.
13098 2004-06-11 Marek Safar <marek.safar@seznam.cz>
13100 * class.cs (Event.GetSignatureForError): Implemented.
13101 Fixed crash in error test cs3010.cs
13103 2004-06-10 Miguel de Icaza <miguel@ximian.com>
13105 * cs-tokenizer.cs: Change the way we track __arglist to be
13106 consistent with the other keywords.
13108 2004-06-09 Miguel de Icaza <miguel@ximian.com>
13110 * codegen.cs: FAQ avoider: turn 1577 into a warning for now until
13113 2004-06-09 Sebastien Pouliot <sebastien@ximian.com>
13115 * codegen.cs: Check that all referenced assemblies have a strongname
13116 before strongnaming the compiled assembly. If not report error CS1577.
13117 Fix bug #56563. Patch by Jackson Harper.
13118 * typemanager.cs: Added a method to return all referenced assemblies.
13119 Fix bug #56563. Patch by Jackson Harper.
13121 2004-06-08 Marek Safar <marek.safar@seznam.cz>
13124 (Method.ApplyAttributeBuilder): Moved and added conditional
13125 attribute error tests (CS0577, CS0578, CS0243, CS0582, CS0629).
13128 (DelegateCreation.ResolveMethodGroupExpr): Added error CS1618 test.
13130 2004-06-08 Marek Safar <marek.safar@seznam.cz>
13133 * class.cs: (EventField.attribute_targets): Changed default target.
13135 2004-06-08 Martin Baulig <martin@ximian.com>
13137 * expression.cs (Invocation.EmitCall): Enable varargs methods.
13139 2004-06-08 Martin Baulig <martin@ximian.com>
13141 * rootcontext.cs (ResolveCore): Added "System.RuntimeArgumentHandle".
13143 2004-06-07 Martin Baulig <martin@ximian.com>
13145 Added support for varargs methods.
13147 * cs-tokenizer.cs (Token.ARGLIST): New token for the `__arglist'
13150 * cs-parser.jay: Added support for `__arglist'.
13152 * decl.cs (MemberCache.AddMethods): Don't ignore varargs methods.
13154 * expression.cs (Argument.AType): Added `ArgList'.
13155 (Invocation): Added support for varargs methods.
13156 (ArglistAccess): New public class.
13157 (Arglist): New public class.
13159 * parameter.cs (Parameter.Modifier): Added `ARGLIST'.
13161 * statement.cs (Block.Flags): Added `HasVarargs'. We set this on
13162 a method's top-level block if the method has varargs.
13164 * support.cs (ReflectionParameters, InternalParameters): Added
13165 support for varargs methods.
13167 2004-06-07 Miguel de Icaza <miguel@ximian.com>
13169 * class.cs: Provide location in indexer error report.
13171 * driver.cs: Use standard names.
13173 * namespace.cs: Catch the use of using after a namespace has been
13174 declared also on using aliases.
13176 2004-06-03 Raja R Harinath <rharinath@novell.com>
13179 * typemanager.cs (closure_private_ok, closure_invocation_type)
13180 (closure_qualifier_type, closure_invocation_assembly)
13181 (FilterWithClosure): Move to ...
13182 (Closure): New internal nested class.
13183 (Closure.CheckValidFamilyAccess): Split out from Closure.Filter.
13184 (MemberLookup, RealMemberLookup): Add new almost_match parameter.
13185 * ecore.cs (almostMatchedMembers): New variable to help report CS1540.
13186 (MemberLookup, MemberLookupFailed): Use it.
13187 * expression.cs (New.DoResolve): Treat the lookup for the
13188 constructor as being qualified by the 'new'ed type.
13189 (Indexers.GetIndexersForTypeOrInterface): Update.
13191 2004-06-03 Marek Safar <marek.safar@seznam.cz>
13194 (GetConditionalAttributeValue): New method. Returns
13195 condition of ConditionalAttribute.
13196 (SearchMulti): New method. Returns all attributes of type 't'.
13197 Use it when attribute is AllowMultiple = true.
13198 (IsConditionalMethodExcluded): New method.
13201 (Method.IsExcluded): Implemented. Returns true if method has conditional
13202 attribute and the conditions is not defined (method is excluded).
13203 (IMethodData): Extended interface for ConditionalAttribute support.
13204 (PropertyMethod.IsExcluded): Implemented.
13207 (MemberCore.Flags): Excluded_Undetected, Excluded new caching flags.
13210 (Invocation.IsMethodExcluded): Checks the ConditionalAttribute
13213 2004-06-02 Ben Maurer <bmaurer@users.sourceforge.net>
13215 * expression.cs (ArrayCreationExpression): Make this just an
13216 `expression'. It can't be a statement, so the code here was
13219 2004-06-02 Marek Safar <marek.safar@seznam.cz>
13222 * typemanager.cs (GetFullNameSignature): New method for
13225 2004-06-02 Marek Safar <marek.safar@seznam.cz>
13228 * class.cs (MemberBase.GetSignatureForError): New virtual method.
13229 Use this method when MethodBuilder is null.
13230 (MethodData.DefineMethodBuilder): Encapsulated code to the new method.
13231 Added test for error CS0626 (MONO reports error for this situation).
13232 (IMethodData.GetSignatureForError): Extended interface.
13234 2004-06-01 Marek Safar <marek.safar@seznam.cz>
13237 (AttributeTester.GetObsoleteAttribute): Returns instance of
13238 ObsoleteAttribute when type is obsolete.
13241 (TypeContainer.VerifyObsoleteAttribute): Override.
13242 (Method.GetSignatureForError): New method for usage when MethodBuilder is null.
13243 (MethodCode.VerifyObsoleteAttribute): Override.
13244 (MemberBase.VerifyObsoleteAttribute): Override.
13247 (MemberCore.CheckUsageOfObsoleteAttribute): Tests presence of ObsoleteAttribute
13248 and report proper error.
13251 Delegate.VerifyObsoleteAttribute): Override.
13254 (Expression.CheckObsoleteAttribute): Tests presence of ObsoleteAttribute
13255 and report proper error.
13256 (FieldExpr.DoResolve): Added tests for ObsoleteAttribute.
13259 (Enum.GetObsoleteAttribute): Returns ObsoleteAttribute for both enum type
13263 (Probe.DoResolve, Cast.DoResolve, LocalVariableReference.DoResolve,
13264 New.DoResolve, SizeOf.DoResolve, TypeOf.DoResolce, MemberAccess.DoResolve):
13265 Added test for ObsoleteAttribute.
13268 (Catch): Derived from Statement.
13270 2004-06-01 Marek Safar <marek.safar@seznam.cz>
13272 Fixed bug #59071 & cs0160.cs
13274 * statement.cs (Try.Resolve): Check here whether order of catch
13275 clauses matches their dependencies.
13277 2004-05-31 Miguel de Icaza <miguel@ximian.com>
13279 * Reverted patch to namespace.cs (Use lookuptypedirect). This
13280 caused a regression: #59343. Referencing nested classes from an
13281 assembly stopped working.
13283 2004-05-31 Martin Baulig <martin@ximian.com>
13285 MCS is now frozen for beta 2.
13287 2004-05-30 Ben Maurer <bmaurer@users.sourceforge.net>
13289 * convert.cs: add a trivial cache for overload operator resolution.
13291 2004-05-30 Ben Maurer <bmaurer@users.sourceforge.net>
13293 * decl.cs: If possible, use lookuptypedirect here. We can only do
13294 this if there is no `.' after the namespace. Avoids using
13295 LookupType, which does lots of slow processing.
13296 (FindNestedType) New method, does what it says :-).
13297 * namespace.cs: use LookupTypeDirect.
13298 * rootcontext.cs: use membercache, if possible.
13299 * typemanager.cs (LookupTypeDirect): Cache negative hits too.
13301 2004-05-30 Ben Maurer <bmaurer@users.sourceforge.net>
13304 According to the spec,
13306 In a member access of the form E.I, if E is a single identifier,
13307 and if the meaning of E as a simple-name (§7.5.2) is a constant,
13308 field, property, localvariable, or parameter with the same type as
13309 the meaning of E as a type-name (§3.8), then both possible
13310 meanings of E are permitted.
13312 We did not check that E as a simple-name had the same type as E as
13315 This trivial check gives us 5-7% on bootstrap time.
13317 2004-05-30 Ben Maurer <bmaurer@users.sourceforge.net>
13319 * expression.cs (Invocation.OverloadResolve): Avoid the
13320 use of hashtables and boxing here by allocating on demand.
13322 2004-05-30 Martin Baulig <martin@ximian.com>
13324 * rootcontext.cs (RootContext.LookupType): Don't cache things if
13325 we're doing a silent lookup. Don't try to lookup nested types in
13326 TypeManager.object_type (thanks to Ben Maurer).
13328 2004-05-30 Martin Baulig <martin@ximian.com>
13330 Committing a patch from Ben Maurer.
13332 * rootcontext.cs (RootContext.LookupType): Cache negative results.
13334 2004-05-29 Martin Baulig <martin@ximian.com>
13336 * class.cs (IMethodData.ShouldIgnore): New method.
13338 * typemanager.cs (TypeManager.MethodFlags): Don't take a
13339 `Location' argument, we don't need it anywhere. Use
13340 `IMethodData.ShouldIgnore ()' instead of
13341 `MethodData.GetMethodFlags ()'.
13342 (TypeManager.AddMethod): Removed.
13343 (TypeManager.AddMethod2): Renamed to AddMethod.
13345 2004-05-29 Martin Baulig <martin@ximian.com>
13347 Committing a patch from Benjamin Jemlich <pcgod@gmx.net>.
13349 * convert.cs (Convert.ImplicitReferenceConversion): If we're
13350 converting from a class type S to an interface type and we already
13351 have an object on the stack, don't box it again. Fixes #52578.
13353 2004-05-29 Martin Baulig <martin@ximian.com>
13355 * class.cs (ConstructorInitializer.GetOverloadedConstructor):
13356 Added support for `params' parameters. Fixes #59267.
13358 2004-05-29 Martin Baulig <martin@ximian.com>
13360 * literal.cs (NullPointer): Provide a private .ctor which sets
13361 `type' to TypeManager.object_type. Fixes #59048.
13363 2004-05-29 Martin Baulig <martin@ximian.com>
13365 * expression.cs (MemberAccess.ResolveMemberAccess): If we're an
13366 EventExpr, set `ee.InstanceExpression = left'. Fixes #59188.
13368 * ecore.cs (EventExpr.instance_expr): Make the field private.
13370 2004-05-26 Marek Safar <marek.safar@seznam.cz>
13372 Fixed bug #50080 & cs0214-2.cs
13373 * expression.cs (Cast.DoResolve): Check unsafe context here.
13375 * statement.cs (Resolve.DoResolve): Likewise.
13377 2004-05-26 Martin Baulig <martin@ximian.com>
13379 * namespace.cs (NamespaceEntry.Lookup): Added `bool silent'.
13381 * rootcontext.cs (RootContext.NamespaceLookup): Added `bool silent'.
13382 (RootContext.LookupType): Pass down the `silent' flag.
13384 2004-05-25 Martin Baulig <martin@ximian.com>
13387 (MethodGroupExpr.IdenticalTypeName): New public property.
13388 (Invocation.DoResolve): Don't report a CS0176 if the "instance"
13389 expression actually refers to a type.
13391 2004-05-25 Martin Baulig <martin@ximian.com>
13393 * expression.cs (Invocation.DoResolve): Applied Ben Maurer's patch
13394 for #56176 and made it actually work.
13396 2004-05-25 Martin Baulig <martin@ximian.com>
13398 * ecore.cs (Expression.CacheTemporaries): Make this virtual.
13399 (FieldExpr, PropertyExpr): Override and implement
13400 CacheTemporaries. Fixes #52279.
13402 2004-05-25 Miguel de Icaza <miguel@ximian.com>
13404 * location.cs: In the new compiler listing a file twice is a
13405 warning, not an error.
13407 2004-05-24 Martin Baulig <martin@ximian.com>
13409 * enum.cs (Enum.DefineType): For the `BaseType' to be a
13410 TypeLookupExpression; otherwise, report a CS1008. Fixes #58571.
13412 2004-05-24 Martin Baulig <martin@ximian.com>
13414 * decl.cs (DeclSpace.FindType): Try doing an alias lookup before
13415 walking the `using' list. Fixes #53921.
13417 2004-05-24 Martin Baulig <martin@ximian.com>
13419 * const.cs (Const.LookupConstantValue): Added support for
13420 EmptyCast's; fixes #55251.
13422 2004-05-24 Martin Baulig <martin@ximian.com>
13424 * ecore.cs (SimpleName.SimpleNameResolve): Renamed to
13425 DoSimpleNameResolve() and provide a SimpleNameResolve() wrapper
13426 which does the CS0135 check. The reason is that we first need to
13427 check whether the variable actually exists.
13429 2004-05-24 Martin Baulig <martin@ximian.com>
13431 * class.cs (MemberBase.DoDefine): Use DeclSpace.FindType() rather
13432 than RootContext.LookupType() to find the explicit interface
13433 type. Fixes #58584.
13435 2004-05-24 Raja R Harinath <rharinath@novell.com>
13437 * Makefile: Simplify. Use executable.make.
13438 * mcs.exe.sources: New file. List of sources of mcs.exe.
13440 2004-05-24 Anders Carlsson <andersca@gnome.org>
13444 Use the invariant culture when doing String.Compare for CLS case
13447 2004-05-23 Martin Baulig <martin@ximian.com>
13449 * decl.cs (DeclSpace.FindType): Only check the `using' list if we
13450 don't have any dots. Fixes #52622, added cs0246-8.cs.
13452 * namespace.cs (NamespaceEntry.Lookup): Likewise.
13454 2004-05-23 Marek Safar <marek.safar@seznam.cz>
13456 * class.cs (MemberBase.Define): Reuse MemberType member for
13457 resolved type. Other methods can use it too.
13459 2004-05-23 Martin Baulig <martin@ximian.com>
13461 * ecore.cs (SimpleName.SimpleNameResolve): Only report a CS0135 if
13462 the variable also exists in the current block (otherwise, we need
13463 to report a CS0103). Fixes #58670.
13465 2004-05-23 Martin Baulig <martin@ximian.com>
13467 * flowanalysis.cs (Reachability.Reachable): Compute this
13468 on-the-fly rather than storing it as a field.
13470 2004-05-23 Martin Baulig <martin@ximian.com>
13472 * flowanalysis.cs (Reachability.And): Manually compute the
13473 resulting `barrier' from the reachability.
13475 2004-05-23 Marek Safar <marek.safar@seznam.cz>
13478 * attribute.cs (AttributeTester.GetMethodObsoleteAttribute): Returns
13479 instance of ObsoleteAttribute when symbol is obsolete.
13482 (IMethodData): Extended interface for ObsoleteAttribute support.
13484 2004-05-22 Marek Safar <marek.safar@seznam.cz>
13486 * attribute.cs: Fix bug #55970
13488 2004-05-22 Marek Safar <marek.safar@seznam.cz>
13492 (GetObsoleteAttribute): New method. Creates the instance of
13494 (AttributeTester.GetMemberObsoleteAttribute): Returns instance of
13495 ObsoleteAttribute when member is obsolete.
13496 (AttributeTester.Report_ObsoleteMessage): Common method for
13497 Obsolete error/warning reporting.
13500 (TypeContainer.base_classs_type): New member for storing parent type.
13503 (MemberCore.GetObsoleteAttribute): Returns instance of ObsoleteAttribute
13504 for this MemberCore.
13506 2004-05-21 Marek Safar <marek.safar@seznam.cz>
13508 * attribute.cs, const.cs: Fix bug #58590
13510 2004-05-21 Martin Baulig <martin@ximian.com>
13512 * flowanalysis.cs (FlowBranching.MergeTopBlock): Don't check for
13513 out parameters if the end of the method is unreachable. Fixes
13516 2004-05-21 Marek Safar <marek.safar@seznam.cz>
13518 * codegen.cs, cs-parser.jay: Removed SetAttributes method.
13519 Hari was right, why extra method.
13521 2004-05-21 Marek Safar <marek.safar@seznam.cz>
13523 * attribute.cs, cs-parser.jay: Fix errors/cs0579-7.cs.
13525 2004-05-20 Martin Baulig <martin@ximian.com>
13527 Merged this back from gmcs to keep the differences to a minumum.
13529 * attribute.cs (Attribute.CheckAttributeType): Take an EmitContext
13530 instead of a Declspace.
13531 (Attribute.ResolveType): Likewise.
13532 (Attributes.Search): Likewise.
13533 (Attributes.Contains): Likewise.
13534 (Attributes.GetClsCompliantAttribute): Likewise.
13536 * class.cs (TypeContainer.VerifyMembers): Added EmitContext
13538 (MethodData.ApplyAttributes): Take an EmitContext instead of a
13541 2004-05-19 Marek Safar <marek.safar@seznam.cz>
13543 Fix bug #58688 (MCS does not report error when the same attribute
13546 * attribute.cs (Attribute.Emit): Distinction between null and default.
13548 2004-05-19 Raja R Harinath <rharinath@novell.com>
13550 * cs-parser.jay (attribute): Create a GlobalAttribute for the case
13551 of a top-level attribute without an attribute target.
13552 * attribute.cs (Attribute.Error_AttributeConstructorMismatch):
13554 (Attribute.Conditional_GetConditionName),
13555 (Attribute.Obsolete_GetObsoleteMessage): Update.
13556 (Attribute.IndexerName_GetIndexerName): New. Attribute-specific
13557 part of ScanForIndexerName.
13558 (Attribute.CanIgnoreInvalidAttribute): New function.
13559 (Attribute.ScanForIndexerName): Move to ...
13560 (Attributes.ScanForIndexerName): ... here.
13561 (Attributes.Attrs): Rename from now-misnamed AttributeSections.
13562 (Attributes.Search): New internal variant that can choose not to
13563 complain if types aren't resolved. The original signature now
13565 (Attributes.GetClsCompliantAttribute): Use internal variant, with
13566 complaints suppressed.
13567 (GlobalAttribute.CheckAttributeType): Overwrite ds.NamespaceEntry
13568 only if it not useful.
13569 (CanIgnoreInvalidAttribute): Ignore assembly attribute errors at
13570 top-level for attributes that are shared between the assembly
13571 and a top-level class.
13572 * parameter.cs (ImplicitParameter): Rename from ParameterAtribute.
13573 * class.cs: Update to reflect changes.
13574 (DefineIndexers): Fuse loops.
13575 * codegen.cs (GetAssemblyName): Update to reflect changes. Accept
13576 a couple more variants of attribute names.
13578 2004-05-18 Marek Safar <marek.safar@seznam.cz>
13580 Fix bug #52585 (Implemented explicit attribute declaration)
13583 (Attributable.ValidAttributeTargets): New abstract method. It gets
13584 list of valid attribute targets for explicit target declaration.
13585 (Attribute.Target): It holds target itself.
13586 (AttributeSection): Removed.
13587 (Attribute.CheckTargets): New method. It checks whether attribute
13588 target is valid for the current element.
13591 (EventProperty): New class. For events that are declared like
13592 property (with add and remove accessors).
13593 (EventField): New class. For events that are declared like field.
13596 * cs-parser.jay: Implemented explicit attribute target declaration.
13598 * class.cs, decl.cs, delegate.cs, enum.cs, parameter.cs:
13599 Override ValidAttributeTargets.
13602 (ReturnParameter): Class for applying custom attributes on
13604 (ParameterAtribute): New class. Class for applying custom
13605 attributes on the parameter type.
13607 2004-05-17 Miguel de Icaza <miguel@ximian.com>
13609 * class.cs (MemberBase.DoDefine): Pass UNSAFE on interface
13612 (Method): Allow UNSAFE here.
13614 * modifiers.cs: Support unsafe reporting.
13616 2004-05-17 Marek Safar <marek.safar@seznam.cz>
13618 * decl.cs: Fix bug #58478.
13620 2004-05-17 Gonzalo Paniagua Javier <gonzalo@ximian.com>
13622 * statement.cs: When checking for unreachable code on an EmptyStatement,
13623 set the location. Fixes bug #58488.
13625 2004-05-13 Miguel de Icaza <miguel@ximian.com>
13627 * driver.cs: Add -pkg handling.
13629 From Gonzalo: UseShelLExecute=false
13631 2004-05-12 Marek Safar <marek.safar@seznam.cz>
13634 (Attribute.GetAttributeTargets): New method. Gets AttributeTargets
13636 (Attribute.IsClsCompliaceRequired): Moved to base for better
13638 (Attribute.UsageAttribute): New property for AttributeUsageAttribute
13639 when attribute is AttributeUsageAttribute.
13640 (Attribute.GetValidTargets): Simplified.
13641 (Attribute.GetAttributeUsage): New method returns AttributeUsage
13642 attribute for this type.
13643 (Attribute.ApplyAttributes): Method renamed to Emit and make
13645 (GlobalAttributeSection): New class for special handling of global
13646 attributes (assembly, module).
13647 (AttributeSection.Emit): New method.
13649 * class.cs: Implemented Attributable abstract methods.
13650 (MethodCore.LabelParameters): Moved to Parameter class.
13651 (Accessor): Is back simple class.
13652 (PropertyMethod): Implemented Attributable abstract class.
13653 (DelegateMethod): Implemented Attributable abstract class.
13654 (Event): New constructor for disctintion between normal Event
13655 and Event with accessors.
13657 * cs-parser.jay: Used new Event ctor and GlobalAttributeSection.
13659 * codegen.cs, const.cs, decl.cs, delegate.cs:
13660 (CommonAssemblyModulClass): Implemented Attributable abstract class
13663 * enum.cs: Implement IAttributeSupport interface.
13664 (EnumMember): New class for emum members. Implemented Attributable
13668 (ParameterBase): Is abstract.
13669 (ReturnParameter): New class for easier [return:] attribute handling.
13671 * typemanager.cs: Removed builder_to_attr.
13673 2004-05-11 Raja R Harinath <rharinath@novell.com>
13676 * attribute.cs (Attribute.GetPositionalValue): New function.
13677 * class.cs (TypeContainer.VerifyMembers): New function.
13678 (TypeContainer.Emit): Use it.
13679 (ClassOrStruct): New base class for Class and Struct.
13680 (ClassOrStruct.ApplyAttributeBuilder): New function. Note if
13681 StructLayout(LayoutKind.Explicit) was ascribed to the struct or
13683 (ClassOrStruct.VerifyMembers): If the struct is explicitly laid out,
13684 then each non-static field should have a FieldOffset attribute.
13685 Otherwise, none of the fields should have a FieldOffset attribute.
13686 * rootcontext.cs (RootContext.ResolveCore): Resolve StructLayout
13687 and FieldOffset attributes.
13688 * typemanager.cs (TypeManager.struct_layout_attribute_type)
13689 (TypeManager.field_offset_attribute_type): New core types.
13690 (TypeManager.InitCoreTypes): Initialize them.
13692 2004-05-11 Michal Moskal <malekith@pld-linux.org>
13694 * class.cs (Event.RemoveDelegateMethod.DelegateMethodInfo):
13695 Return correct type.
13698 2004-05-09 Miguel de Icaza <miguel@ximian.com>
13700 * expression.cs (Binary.DoNumericPromotions): 0 long constant can
13701 be implicitly converted to ulong.
13703 * expression.cs: The logic for allowing operator &, | and ^ worked
13704 was wrong, it worked before because we did not report an error in
13705 an else branch. Fixes 57895.
13707 * class.cs: Applied patch from iain@mccoy.id.au Iain McCoy to
13708 allow volatile fields to be reference types.
13710 2004-05-07 Miguel de Icaza <miguel@ximian.com>
13712 * driver.cs: Add support for /debug-
13714 2004-05-07 Raja R Harinath <rharinath@novell.com>
13716 * attribute.cs (Attribute.CheckAttributeType, Attribute.ResolveType):
13717 Add a 'complain' parameter to silence errors.
13718 (Attribute.Resolve): Update to changes. Put in sanity check to catch
13719 silently overlooked type-resolutions.
13720 (Attribute.ScanForIndexerName, Attribute.DefinePInvokeMethod): Update
13721 to reflect changes.
13722 (Attributes.Search): New function.
13723 (Attributes.Contains, Attributes.GetClsCompliantAttribute): Use Search.
13724 (Attributes.GetAttributeFullName): Remove hack.
13725 * class.cs (MethodCore.LabelParameters, MethodData.ApplyAttributes):
13726 Update to reflect changes.
13727 * codegen.cs (CommonAssemblyModulClass.GetClsCompliantAttribute):
13728 Use Attributes.Search instead of nested loops.
13730 2004-05-07 Marek Safar <marek.safar@seznam.cz>
13733 (MemberCore.Flags): Extended for caching presence of CLSCompliantAttribute.
13734 (MemberCore.VerifyClsCompliance): Implemented CS3019 error report.
13735 (DeclSpace.GetClsCompliantAttributeValue): Returns simple bool.
13737 * report.cs: (Report.Warning): Renamed to Warning_T because of
13738 parameter collision.
13740 2004-05-05 Raja R Harinath <rharinath@novell.com>
13742 * expression.cs (MemberAccess.ResolveMemberAccess):
13743 Exit with non-zero status after Report.Error.
13744 * rootcontext.cs (RootContext.BootstrapCorlib_ResolveDelegate):
13746 * typemanager.cs (TypeManager.CoreLookupType): Likewise.
13748 2004-05-04 Lluis Sanchez Gual <lluis@ximian.com>
13750 * support.cs: Don't hang when the file is empty.
13752 2004-05-04 Lluis Sanchez Gual <lluis@ximian.com>
13754 * support.cs: In SeekableStreamReader, compute the preamble size of the
13755 underlying stream. Position changes should take into account that initial
13758 2004-05-03 Todd Berman <tberman@sevenl.net>
13760 * driver.cs: remove unused GetSysVersion function.
13762 2004-05-03 Todd Berman <tberman@sevenl.net>
13764 * driver.cs: Remove the hack from saturday, as well as the hack
13765 from jackson (LoadAssemblyFromGac), also adds the CWD to the
13766 link_paths to get that bit proper.
13768 2004-05-01 Todd Berman <tberman@sevenl.net>
13770 * driver.cs: Try a LoadFrom before a Load, this checks the current
13771 path. This is currently a bug in mono that is be fixed, however, this
13772 provides a workaround for now. This will be removed when the bug
13775 2004-05-01 Sebastien Pouliot <sebastien@ximian.com>
13777 * CryptoConvert.cs: Updated to latest version. Fix issue with
13778 incomplete key pairs (#57941).
13780 2004-05-01 Todd Berman <tberman@sevenl.net>
13782 * driver.cs: Remove '.' from path_chars, now System.* loads properly
13785 2004-04-30 Jackson Harper <jackson@ximian.com>
13787 * codegen.cs: Open keys readonly.
13789 2004-04-30 Gonzalo Paniagua Javier <gonzalo@ximian.com>
13791 * typemanager.cs: don't report cyclic struct layout when a struct
13792 contains 2 or more fields of the same type. Failed for Pango.AttrShape
13793 which has 2 Pango.Rectangle fields.
13795 2004-04-29 Ben Maurer <bmaurer@users.sourceforge.net>
13797 * expression.cs: Handle IntPtr comparisons with IL code
13798 rather than a method call.
13800 2004-04-29 Martin Baulig <martin@ximian.com>
13802 * ecore.cs (PropertyExpr.FindAccessor): New private method. Walk
13803 the list of PropertyInfo's in class hierarchy and find the
13804 accessor. Fixes #56013.
13806 2004-04-29 Martin Baulig <martin@ximian.com>
13808 * typemanager.cs (TypeManager.CheckStructCycles): Fixed.
13810 2004-04-29 Martin Baulig <martin@ximian.com>
13812 Applying a patch from Benjamin Jemlich <pcgod@gmx.net>.
13814 * ecore.cs (FieldExpr.AddressOf): Make this work for valuetypes.
13816 2004-04-29 Martin Baulig <martin@ximian.com>
13818 * class.cs (ConstructorInitializer.Resolve): Check whether the
13819 parent .ctor is accessible. Fixes #52146.
13821 2004-04-29 Martin Baulig <martin@ximian.com>
13823 Applying a patch from Benjamin Jemlich <pcgod@gmx.net>.
13825 * statement.cs (Using.EmitLocalVariableDecls): Use
13826 TypeManager.idisposable_type, not typeof (IDisposable).
13827 (Foreach.EmitCollectionForeach): Added support for valuetypes.
13829 2004-04-29 Martin Baulig <martin@ximian.com>
13831 * class.cs (Event.Define): Don't emit the field and don't set
13832 RTSpecialName and SpecialName for events on interfaces. Fixes
13835 2004-04-29 Raja R Harinath <rharinath@novell.com>
13837 Refactor Attribute.ApplyAttributes.
13838 * attribute.cs (Attributable): New base class for objects that can
13839 have Attributes applied on them.
13840 (Attribute): Make AttributeUsage fields public.
13841 (Attribute.GetFieldValue, Attribute.GetMarshal): Make non-static.
13842 (Attribute.IsInternalCall): New property.
13843 (Attribute.UsageAttr): Convert to a public read-only property.
13844 (Attribute.CheckAttributeType): Use a DeclSpace, not an EmitContext.
13845 (Attribute.ResolveType, Attribute.Resolve)
13846 (Attribute.ScanForIndexerName): Update to reflect changes.
13847 (Attribute.CheckAttributeTarget): Re-format.
13848 (Attribute.ApplyAttributes): Refactor, to various
13849 Attributable.ApplyAttributeBuilder methods.
13850 * decl.cs (MemberCore): Make Attributable.
13851 * class.cs (Accessor): Make Attributable.
13852 (MethodData.ApplyAttributes): Use proper attribute types, not
13854 (TypeContainer.LabelParameters): Pass Parameter to ApplyAttributes.
13855 (TypeContainer.ApplyAttributeBuilder)
13856 (Method.ApplyAttributeBuilder, Constructor.ApplyAttributeBuilder)
13857 (Field.ApplyAttributeBuilder, Accessor.ApplyAttributeBuilder)
13858 (PropertyBase.ApplyAttributeBuilder, Event.ApplyAttributeBuilder)
13859 (Operator.ApplyAttributeBuilder): New factored-out methods.
13860 * const.cs (Const.ApplyAttributeBuilder): Likewise.
13861 * delegate.cs (Delegate.ApplyAttributeBuilder): Likewise.
13862 * enum.cs (Enum.ApplyAttributeBuilder): Likewise.
13863 * parameter.cs (ParameterBase): New Attributable base class
13864 that can also represent Return types.
13865 (Parameter): Update to the changes.
13867 2004-04-29 Jackson Harper <jackson@ximian.com>
13869 * driver.cs: Prefer the corlib system version when looking for
13870 assemblies in the GAC. This is still a hack, but its a better hack
13873 2004-04-29 Marek Safar <marek.safar@seznam.cz>
13875 * decl.cs, enum.cs: Improved error 3005 reporting.
13877 * report.cs (SymbolRelatedToPreviousError): New method for error reporting.
13878 (related_symbols): New private member for list of symbols
13879 related to reported error/warning.
13881 * tree.cs: Do not use now obsolete Report.LocationOfPreviousError.
13883 2004-04-29 Martin Baulig <martin@ximian.com>
13885 * ecore.cs (Expression.Constantify): If we're an enum and
13886 TypeManager.TypeToCoreType() doesn't give us another type, use
13887 t.UnderlyingSystemType. Fixes #56178.
13889 2004-04-29 Martin Baulig <martin@ximian.com>
13891 * decl.cs (MemberCache.SetupCacheForInterface): Look over all our
13892 interfaces and for each interface, only add members directly
13893 declared in that interface. Fixes #53255.
13895 2004-04-28 Martin Baulig <martin@ximian.com>
13897 * expression.cs (ConditionalLogicalOperator): Use a temporary
13898 variable for `left' to avoid that we evaluate it more than once;
13901 2004-04-28 Martin Baulig <martin@ximian.com>
13903 * expression.cs (ComposedCast.DoResolveAsTypeStep): Don't allow
13906 2004-04-28 Martin Baulig <martin@ximian.com>
13908 * statement.cs (LocalInfo.Resolve): Check whether the type is not
13911 * class.cs (MemberBase.CheckParameters, FieldBase.DoDefine): Check
13912 whether the type is not void (CS1547).
13914 2004-04-28 Martin Baulig <martin@ximian.com>
13916 * expression.cs (Unary.DoResolveLValue): Override this and report
13917 CS0131 for anything but Operator.Indirection.
13919 2004-04-28 Martin Baulig <martin@ximian.com>
13921 Committing a patch from Ben Maurer; see bug #50820.
13923 * typemanager.cs (TypeManager.FilterWithClosure): Added CS1540
13926 * ecore.cs (Expression.MemberLookupFailed): Added CS1540 check for
13929 2004-04-28 Martin Baulig <martin@ximian.com>
13931 Committing a patch from Ben Maurer; see bug #50820.
13933 * typemanager.cs (TypeManager.FilterWithClosure): Added CS1540
13936 * ecore.cs (Expression.MemberLookupFailed): Added CS1540 check for
13939 2004-04-28 Martin Baulig <martin@ximian.com>
13941 * statement.cs (Block.LookupLabel): Also lookup in implicit child blocks.
13942 (Block.AddLabel): Call DoLookupLabel() to only search in the
13945 2004-04-28 Martin Baulig <martin@ximian.com>
13947 * cfold.cs (ConstantFold.BinaryFold): Added special support for
13948 comparing StringConstants and NullLiterals in Equality and Inequality.
13950 2004-04-28 Jackson Harper <jackson@ximian.com>
13952 * driver.cs: Attempt to load referenced assemblies from the
13953 GAC. This is the quick and dirty version of this method that
13954 doesnt take into account versions and just takes the first
13955 canidate found. Will be good enough for now as we will not have more
13956 then one version installed into the GAC until I update this method.
13958 2004-04-28 Martin Baulig <martin@ximian.com>
13960 * typemanager.cs (TypeManager.CheckStructCycles): New public
13961 static method to check for cycles in the struct layout.
13963 * rootcontext.cs (RootContext.PopulateTypes): Call
13964 TypeManager.CheckStructCycles() for each TypeContainer.
13965 [Note: We only need to visit each type once.]
13967 2004-04-28 Martin Baulig <martin@ximian.com>
13969 * constant.cs (StringConstant.Emit): Emit Ldnull if we're null.
13971 * const.cs (Const.LookupConstantValue): Return a `bool' signalling
13972 success and added `out object value'. Use a `bool resolved' field
13973 to check whether we've already been called rather than
13974 `ConstantValue != null' since this breaks for NullLiterals.
13976 2004-04-28 Raja R Harinath <rharinath@novell.com>
13978 * driver.cs (Driver.MainDriver) [IsModuleOnly]: Open code the
13979 setting of this flag, since the 'set' method may be non-public.
13981 2004-04-28 Raja R Harinath <rharinath@novell.com>
13983 * flowanalysis.cs (FlowBranchingException.LookupLabel): Add a null
13984 check on current_vector.Block.
13986 2004-04-27 Martin Baulig <martin@ximian.com>
13988 * expression.cs (BaseAccess.CommonResolve): Don't allow `base' in
13989 a field initializer. Fixes #56459.
13991 2004-04-27 Martin Baulig <martin@ximian.com>
13993 * ecore.cs (PropertyExpr.DoResolve/DoResolveLValue): Check whether
13994 we're not attempting to use an indexer. Fixes #52154.
13996 2004-04-27 Martin Baulig <martin@ximian.com>
13998 * statement.cs (Return): Don't create a return label if we don't
13999 need it; reverts my change from January 20th. Thanks to Ben
14002 2004-04-27 Martin Baulig <martin@ximian.com>
14004 According to the spec, `goto' can only leave a nested scope, but
14007 * statement.cs (Block.LookupLabel): Only lookup in the current
14008 block, don't recurse into parent or child blocks.
14009 (Block.AddLabel): Check in parent and child blocks, report
14010 CS0140/CS0158 if we find a duplicate.
14011 (Block): Removed this indexer for label lookups.
14012 (Goto.Resolve): Call LookupLabel() on our current FlowBranching;
14013 this already does the error reporting for us.
14016 (FlowBranching.UsageVector.Block): New public variable; may be null.
14017 (FlowBranching.CreateSibling): Added `Block' argument.
14018 (FlowBranching.LookupLabel): New public virtual method. Lookup a
14019 label for the target of a `goto' and check whether we're not
14020 leaving a `finally'.
14022 2004-04-27 Martin Baulig <martin@ximian.com>
14024 * flowanalysis.cs (FlowBranching.UsageVector.MergeChild): If we're
14025 a finite loop block, also do the ALWAYS->SOMETIMES for throws (not
14028 2004-04-27 Martin Baulig <martin@ximian.com>
14030 * statement.cs (Block.AddLabel): Also check for implicit blocks
14031 and added a CS0158 check.
14033 2004-04-27 Martin Baulig <martin@ximian.com>
14035 * flowanalysis.cs (FlowBranchingLoop): New class.
14036 (FlowBranching.UsageVector.MergeJumpOrigins): Take a list of
14037 UsageVector's instead of an ArrayList.
14038 (FlowBranching.Label): Likewise.
14039 (FlowBranching.UsageVector.MergeBreakOrigins): New method.
14040 (FlowBranching.AddBreakVector): New method.
14042 2004-04-27 Miguel de Icaza <miguel@ximian.com>
14044 * attribute.cs: Small regression fix: only convert the type if we
14045 the type is different, fixes System.Drawing build.
14047 2004-04-27 Martin Baulig <martin@ximian.com>
14049 * attribute.cs (Attribute.Resolve): If we have a constant value
14050 for a named field or property, implicity convert it to the correct
14053 2004-04-27 Raja R Harinath <rharinath@novell.com>
14055 * statement.cs (Block.Block): Implicit blocks share
14056 'child_variable_names' fields with parent blocks.
14057 (Block.AddChildVariableNames): Remove.
14058 (Block.AddVariable): Mark variable as "used by a child block" in
14059 every surrounding block.
14060 * ecore.cs (SimpleName.SimpleNameResolve): If the name has already
14061 been used in a child block, complain about violation of "Invariant
14062 meaning in blocks" rule.
14063 * cs-parser.jay (declare_local_variables): Don't use
14064 AddChildVariableNames.
14065 (foreach_statement): Don't create an implicit block: 'foreach'
14066 introduces a scope.
14068 2004-04-23 Miguel de Icaza <miguel@ximian.com>
14070 * convert.cs (ImplicitNumericConversion): 0 is also positive when
14071 converting from 0L to ulong. Fixes 57522.
14073 2004-04-22 Marek Safar <marek.safar@seznam.cz>
14075 * decl.cs (FindMemberToOverride): Fix wrong warning for case when
14076 derived class hides via 'new' keyword field from base class (test-242.cs).
14077 TODO: Handle this in the more general way.
14079 * class.cs (CheckBase): Ditto.
14081 2004-04-22 Marek Safar <marek.safar@seznam.cz>
14083 * decl.cs (caching_flags): New member for storing cached values
14085 (MemberCore.Flags): New enum where bit flags for caching_flags
14087 (MemberCore.cls_compliance): Moved to caching_flags.
14088 (DeclSpace.Created): Moved to caching_flags.
14090 * class.cs: Use caching_flags instead of DeclSpace.Created
14092 2004-04-21 Miguel de Icaza <miguel@ximian.com>
14094 * ecore.cs (PropertyExpr.GetAccesor): Only perform the 1540 check
14095 if we are only a derived class, not a nested class.
14097 * typemanager.cs: Same as above, but do this at the MemberLookup
14098 level (used by field and methods, properties are handled in
14099 PropertyExpr). Allow for the qualified access if we are a nested
14102 2004-04-21 Marek Safar <marek.safar@seznam.cz>
14104 * class.cs: Refactoring.
14105 (IMethodData): New inteface; Holds links to parent members
14106 to avoid member duplication (reduced memory allocation).
14107 (Method): Implemented IMethodData interface.
14108 (PropertyBase): New inner classes for get/set methods.
14109 (PropertyBase.PropertyMethod): Implemented IMethodData interface
14110 (Event): New inner classes for add/remove methods.
14111 (Event.DelegateMethod): Implemented IMethodData interface.
14113 * cs-parser.jay: Pass DeclSpace to Event class for creation of valid
14114 EmitContext (related to class.cs refactoring).
14116 2004-04-21 Raja R Harinath <rharinath@novell.com>
14118 * delegate.cs (Delegate.VerifyApplicability): If the number of
14119 arguments are the same as the number of parameters, first try to
14120 verify applicability ignoring any 'params' modifier on the last
14124 2004-04-16 Raja R Harinath <rharinath@novell.com>
14126 * class.cs (TypeContainer.AddIndexer): Use
14127 'ExplicitInterfaceName' to determine if interface name was
14128 explicitly specified. 'InterfaceType' is not initialized at this time.
14129 (TypeContainer.DefineIndexers): Remove use of temporary list. The
14130 Indexers array is already in the required order. Initialize
14131 'IndexerName' only if there are normal indexers.
14132 (TypeContainer.DoDefineMembers): Don't initialize IndexerName.
14133 (TypeContainer.Emit): Emit DefaultMember attribute only if
14134 IndexerName is initialized.
14137 2004-04-15 Benjamin Jemlich <pcgod@gmx.net>
14139 * enum.cs (Enum.DefineType): Don't allow char as type for enum.
14142 2004-04-15 Raja R Harinath <rharinath@novell.com>
14144 * attribute.cs (Attribute.CheckAttributeType): Check for ambiguous
14148 * attribute.cs (Attribute.Resolve): Check for duplicate named
14152 2004-04-15 Miguel de Icaza <miguel@ximian.com>
14154 * iterators.cs (MarkYield): track whether we are in an exception,
14155 and generate code accordingly. Use a temporary value to store the
14156 result for our state.
14158 I had ignored a bit the interaction of try/catch with iterators
14159 since their behavior was not entirely obvious, but now it is
14160 possible to verify that our behavior is the same as MS .NET 2.0
14164 2004-04-14 Miguel de Icaza <miguel@ximian.com>
14166 * iterators.cs: Avoid creating temporaries if there is no work to
14169 * expression.cs (ArrayAccess.EmitLoadOpcode): If dealing with
14170 Enumerations, use TypeManager.EnumToUnderlying and call
14173 Based on the patch from Benjamin Jemlich (pcgod@gmx.net), fixes
14176 (This.Emit): Use EmitContext.EmitThis to emit our
14179 (This.EmitAssign): Ditto.
14181 * ecore.cs (FieldExpr.Emit): Remove RemapToProxy special
14182 codepaths, we will move all the functionality into
14185 (FieldExpr.EmitAssign): Ditto.
14187 This fixes several hidden bugs that I uncovered while doing a code
14188 review of this today.
14190 * codegen.cs (EmitThis): reworked so the semantics are more clear
14191 and also support value types "this" instances.
14193 * iterators.cs: Changed so that for iterators in value types, we
14194 do not pass the value type as a parameter.
14196 Initialization of the enumerator helpers is now done in the caller
14197 instead of passing the parameters to the constructors and having
14198 the constructor set the fields.
14200 The fields have now `assembly' visibility instead of private.
14202 2004-04-11 Miguel de Icaza <miguel@ximian.com>
14204 * expression.cs (Argument.Resolve): Check if fields passed as ref
14205 or out are contained in a MarshalByRefObject.
14207 * typemanager.cs, rootcontext.cs: Add System.Marshalbyrefobject as
14208 another compiler type.
14210 2004-04-06 Ben Maurer <bmaurer@users.sourceforge.net>
14212 * class.cs (Indexer.Define): use the new name checking method.
14213 Also, return false on an error.
14214 * cs-tokenizer.cs (IsValidIdentifier): Checks for a valid identifier.
14215 (is_identifier_[start/part]_character): make static.
14217 2004-04-10 Miguel de Icaza <miguel@ximian.com>
14219 * expression.cs (Binary.ResolveOperator): Do no append strings
14220 twice: since we can be invoked more than once (array evaluation)
14221 on the same concatenation, take care of this here. Based on a fix
14222 from Ben (bug #56454)
14224 2004-04-08 Sebastien Pouliot <sebastien@ximian.com>
14226 * codegen.cs: Fix another case where CS1548 must be reported (when
14227 delay-sign isn't specified and no private is available #56564). Fix
14228 loading the ECMA "key" to delay-sign an assembly. Report a CS1548
14229 error when MCS is used on the MS runtime and we need to delay-sign
14230 (which seems unsupported by AssemblyBuilder - see #56621).
14232 2004-04-08 Marek Safar <marek.safar@seznam.cz>
14234 * typemanager.cs (TypeManager.TypeToCoreType): Handle IntPtr too.
14235 (TypeManager.ComputeNamespaces): Faster implementation for
14238 * compiler.csproj: Updated AssemblyName to mcs.
14240 2004-04-07 Miguel de Icaza <miguel@ximian.com>
14242 * rootcontext.cs: Add new types to the boot resolution.
14244 * ecore.cs (TypeExpr.CanInheritFrom): Inheriting from
14245 MulticastDelegate is not allowed.
14247 * typemanager.cs: Add new types to lookup: System.TypedReference
14250 * paramter.cs (Parameter.Resolve): if we are an out/ref parameter,
14251 check for TypedReference or ArgIterator, they are not allowed.
14253 * ecore.cs (BoxedCast): Set the eclass to ExprClass.Value, this
14254 makes us properly catch 1510 in some conditions (see bug 56016 for
14257 2004-04-06 Bernie Solomon <bernard@ugsolutions.com>
14259 * CryptoConvert.cs: update from corlib version
14262 2004-04-05 Miguel de Icaza <miguel@ximian.com>
14264 * class.cs (Indexer.Define): Check indexername declaration
14266 2004-04-05 Marek Safar <marek.safar@seznam.cz>
14268 * attribute.cs (IsClsCompliant): Fixed problem with handling
14269 all three states (compliant, not-compliant, undetected).
14271 2004-03-30 Marek Safar <marek.safar@seznam.cz>
14273 * attribute.cs (Attribute): Location is now public.
14274 (Resolve): Store resolved arguments (pos_values) in attribute class.
14275 Attribute extractors (now GetClsCompliantAttributeValue) can reuse them.
14276 (GetClsCompliantAttributeValue): New method that gets
14277 CLSCompliantAttribute value.
14278 (GetClsCompliantAttribute): Returns CLSCompliantAttribute for DeclSpace
14279 if exists else null.
14280 (AttributeTester): New class for CLS-Compliant verification routines.
14282 * class.cs (Emit): Add CLS-Compliant verification.
14283 (Method.GetSignatureForError): Implemented.
14284 (Constructor.GetSignatureForError): Implemented
14285 (Constructor.HasCompliantArgs): Returns if constructor has
14286 CLS-Compliant arguments.
14287 (Constructor.Emit): Override.
14288 (Construcor.IsIdentifierClsCompliant): New method; For constructors
14289 is needed to test only parameters.
14290 (FieldBase.GetSignatureForError): Implemented.
14291 (TypeContainer): New member for storing base interfaces.
14292 (TypeContainer.FindMembers): Search in base interfaces too.
14294 * codegen.cs (GetClsComplianceAttribute): New method that gets
14295 assembly or module CLSCompliantAttribute value.
14296 (ResolveClsCompliance): New method that resolve CLSCompliantAttribute
14298 (ModuleClass.Emit): Add error 3012 test.
14300 * const.cs (Emit): Override and call base for CLS-Compliant tests.
14302 * decl.cs (ClsComplianceValue): New enum that holds CLS-Compliant
14303 state for all decl types.
14304 (MemberCore.Emit): Emit is now virtual and call VerifyClsCompliance
14305 if CLS-Compliant tests are required.
14306 (IsClsCompliaceRequired): New method. Analyze whether code
14307 must be CLS-Compliant.
14308 (IsExposedFromAssembly): New method. Returns true when MemberCore
14309 is exposed from assembly.
14310 (GetClsCompliantAttributeValue): New method. Resolve CLSCompliantAttribute
14311 value or gets cached value.
14312 (HasClsCompliantAttribute): New method. Returns true if MemberCore
14313 is explicitly marked with CLSCompliantAttribute.
14314 (IsIdentifierClsCompliant): New abstract method. This method is
14315 used to testing error 3005.
14316 (IsIdentifierAndParamClsCompliant): New method. Common helper method
14317 for identifier and parameters CLS-Compliant testing.
14318 (VerifyClsCompliance): New method. The main virtual method for
14319 CLS-Compliant verifications.
14320 (CheckAccessLevel): In one special case (System.Drawing) was TypeBuilder
14321 null. I don't know why is null (too many public members !).
14322 (GetClsCompliantAttributeValue). New method. Goes through class hierarchy
14323 and get value of first CLSCompliantAttribute that found.
14325 * delegate.cs (Emit): Override and call base for CLS-Compliant tests.
14326 (VerifyClsCompliance): Override and add extra tests.
14328 * driver.cs (CSCParseOption): New command line options (clscheck[+|-]).
14329 clscheck- disable CLS-Compliant verification event if assembly is has
14330 CLSCompliantAttribute(true).
14332 * enum.cs (Emit): Override and call base for CLS-Compliant tests.
14333 ApllyAttribute is now called in emit section as in the other cases.
14334 Possible future Emit integration.
14335 (IsIdentifierClsCompliant): New override.
14336 (VerifyClsCompliance): New override.
14337 (GetEnumeratorName): Returns full enum name.
14339 * parameter.cs (GetSignatureForError): Implemented.
14341 * report.cs (WarningData): New struct for Warning message information.
14342 (LocationOfPreviousError): New method.
14343 (Warning): New method. Reports warning based on the warning table.
14344 (Error_T): New method. Reports error based on the error table.
14346 * rootcontext.cs (EmitCode): Added new Emit(s) because CLS-Compliant
14347 verifications are done here.
14349 * tree.cs (RecordDecl): Used new LocationOfPreviousError method.
14351 * typemanager.cs (cls_compliant_attribute_type): New member thath holds
14352 CLSCompliantAttribute.
14353 (all_imported_types): New member holds all imported types from other
14355 (LoadAllImportedTypes): New method fills static table with exported types
14356 from all referenced assemblies.
14357 (Modules): New property returns all assembly modules.
14359 2004-03-30 Miguel de Icaza <miguel@ximian.com>
14361 * cs-parser.jay: Add a rule to catch wrong event syntax instead of
14362 throwing a parser error.
14364 * ecore.cs (PropertyExpr.GetAccessor): Apply patch from Patrik Reali
14365 which removes the hardcoded get_/set_ prefixes for properties, as
14366 IL allows for the properties to be named something else.
14370 * expression.cs: Do not override operand before we know if it is
14371 non-null. Fix 56207
14373 2004-03-29 Ben Maurer <bmaurer@users.sourceforge.net>
14375 * typemanager.cs: support for pinned variables.
14377 2004-03-29 Ben Maurer <bmaurer@users.sourceforge.net>
14379 * decl.cs, typemanager.cs: Avoid using an arraylist
14380 as a buffer if there is only one result set.
14382 2004-03-29 Ben Maurer <bmaurer@users.sourceforge.net>
14384 * expression.cs: Make sure you cant call a static method
14385 with an instance expression, bug #56174.
14387 2004-03-29 Miguel de Icaza <miguel@ximian.com>
14389 * class.cs (IsDuplicateImplementation): Improve error reporting to
14390 flag 663 (method only differs in parameter modifier).
14392 * cs-tokenizer.cs: Do not require whitespace when a ( or " will do
14393 in preprocessor directives.
14395 * location.cs (LookupFile): Allow for the empty path.
14397 * attribute.cs (DefinePInvokeMethod): Fix 56148; I would like a
14398 better approach for some of that patch, but its failing with the
14399 CharSet enumeration. For now try/catch will do.
14401 * typemanager.cs: Do not crash if a struct does not have fields.
14404 2004-03-28 Ben Maurer <bmaurer@users.sourceforge.net>
14406 * expression.cs: cs0213, cant fix a fixed expression.
14409 2004-03-28 Ben Maurer <bmaurer@users.sourceforge.net>
14411 * cs-parser.jay: detect invalid embeded statements gracefully.
14414 2004-03-28 Ben Maurer <bmaurer@users.sourceforge.net>
14416 * ecore.cs, typemanager.cs: Correct impl of cs1540 check.
14419 the invocation type may not be a subclass of the tye of the item/
14420 The type of the item must be a subclass of the invocation item.
14425 2004-03-25 Sebastien Pouliot <sebastien@ximian.com>
14427 * attribute.cs: Added methods to get a string and a bool from an
14428 attribute. Required to information from AssemblyKeyFileAttribute,
14429 AttributeKeyNameAttribute (string) and AssemblyDelaySign (bool).
14430 * codegen.cs: Modified AssemblyName creation to include support for
14431 strongnames. Catch additional exceptions to report them as CS1548.
14432 * compiler.csproj: Updated include CryptoConvert.cs.
14433 * compiler.csproj.user: Removed file - user specific configuration.
14434 * CryptoConvert.cs: New. A COPY of the class CryptoConvert from
14435 Mono.Security assembly. The original class is maintained and tested in
14436 /mcs/class/Mono.Security/Mono.Security.Cryptography/CryptoConvert.cs.
14437 * drivers.cs: Added support for /keyfile, /keycontainer and /delaysign
14438 like CSC 8.0 (C# v2) supports.
14439 * Makefile: Added CryptoConvert.cs to mcs sources.
14440 * rootcontext.cs: Added new options for strongnames.
14442 2004-03-24 Ben Maurer <bmaurer@users.sourceforge.net>
14444 * driver.cs: For --expect-error, report error code `2'
14445 if the program compiled with no errors, error code `1' if
14446 it compiled with an error other than the one expected.
14448 2004-03-24 Sebastien Pouliot <sebastien@ximian.com>
14450 * compiler.csproj: Updated for Visual Studio .NET 2003.
14451 * compiler.csproj.user: Updated for Visual Studio .NET 2003.
14452 * compiler.sln: Updated for Visual Studio .NET 2003.
14454 2004-03-24 Ravi Pratap M <ravi@ximian.com>
14456 * expression.cs: Fix bug #47234. We basically need to apply the
14457 rule that we prefer the conversion of null to a reference type
14458 when faced with a conversion to 'object' (csc behaviour).
14460 2004-03-23 Ben Maurer <bmaurer@users.sourceforge.net>
14462 * statement.cs: Shorter form for foreach, eliminates
14463 a local variable. r=Martin.
14465 2004-03-23 Ben Maurer <bmaurer@users.sourceforge.net>
14467 * constant.cs, ecore.cs, literal.cs: New prop IsZeroInteger that
14468 checks if we can use brtrue/brfalse to test for 0.
14469 * expression.cs: use the above in the test for using brtrue/brfalse.
14470 cleanup code a bit.
14472 2004-03-23 Ben Maurer <bmaurer@users.sourceforge.net>
14474 * expression.cs: Rewrite string concat stuff. Benefits:
14476 - "a" + foo + "b" + "c" becomes "a" + foo + "bc"
14477 - "a" + foo + "b" + bar + "c" + baz ... uses concat (string []).
14478 rather than a concat chain.
14480 * typemanager.cs: Add lookups for more concat overloads.
14482 2004-03-23 Ben Maurer <bmaurer@users.sourceforge.net>
14484 * expression.cs: Emit shorter il code for array init.
14501 2004-03-22 Ben Maurer <bmaurer@users.sourceforge.net>
14503 * statement.cs: Before, two switch blocks would be merged if the
14504 total size of the blocks (end_item - begin_item + 1) was less than
14505 two times the combined sizes of the blocks.
14507 Now, it will only merge if after the merge at least half of the
14512 2004-03-20 Atsushi Enomoto <atsushi@ximian.com>
14514 * class.cs : csc build fix for GetMethods(). See bug #52503.
14516 2004-03-20 Ben Maurer <bmaurer@users.sourceforge.net>
14518 * expression.cs: Make sure fp comparisons work with NaN.
14519 This fixes bug #54303. Mig approved this patch a long
14520 time ago, but we were not able to test b/c the runtime
14523 2004-03-19 Miguel de Icaza <miguel@ximian.com>
14525 * ecore.cs (TypExpr.GetHashCode): implement this overload.
14527 2004-03-19 Martin Baulig <martin@ximian.com>
14529 * class.cs (MemberCore.IsDuplicateImplementation): Report the
14530 error here and not in our caller.
14532 2004-03-19 Martin Baulig <martin@ximian.com>
14534 * interface.cs: Completely killed this file.
14535 (Interface): We're now a TypeContainer and live in class.cs.
14537 * class.cs (TypeContainer.GetClassBases): Added `bool is_iface'
14538 argument; we're now also called for interfaces.
14539 (TypeContainer.DefineMembers): Allow this method being called
14541 (TypeContainer.GetMethods): New public method; formerly known as
14542 Interface.GetMethod(). This is used by PendingImplementation.
14543 (TypeContainer.EmitDefaultMemberAttr): Moved here from Interface;
14544 it's now private and non-static.
14545 (Interface): Moved this here; it's now implemented similar to
14547 (Method, Property, Event, Indexer): Added `bool is_interface'
14548 argument to their .ctor's.
14549 (MemberBase.IsInterface): New public field.
14551 * cs-parser.jay: Create normal Method, Property, Event, Indexer
14552 instances instead of InterfaceMethod, InterfaceProperty, etc.
14553 (opt_interface_base): Removed; we now use `opt_class_base' instead.
14554 (InterfaceAccessorInfo): Create `Get' and `Set' Accessor's.
14556 2004-03-19 Martin Baulig <martin@ximian.com>
14558 * class.cs (MethodCore.IsDuplicateImplementation): New private
14559 method which does the CS0111 checking.
14560 (Method.CheckBase, Constructor.CheckBase, PropertyBase.CheckBase):
14561 Use IsDuplicateImplementation().
14563 2004-03-17 Ben Maurer <bmaurer@users.sourceforge.net>
14565 * decl.cs (FindMemberToOverride): New method to find the correct
14566 method or property to override in the base class.
14568 - Make Method/Property use the above method to find the
14569 version in the base class.
14570 - Remove the InheritableMemberSignatureCompare as it is now
14573 This patch makes large code bases much faster to compile, as it is
14574 O(n) rather than O(n^2) to do this validation.
14576 Also, it fixes bug 52458 which is that nested classes are not
14577 taken into account when finding the base class member.
14579 Reviewed/Approved by Martin.
14581 2004-03-17 Marek Safar <marek.safar@seznam.cz>
14583 * interface.cs: In all interface classes removed redundant
14584 member initialization.
14586 2004-03-16 Martin Baulig <martin@ximian.com>
14588 * class.cs (TypeContainer.GetClassBases): Fix the CS0528 check.
14590 2004-03-15 Miguel de Icaza <miguel@ximian.com>
14592 * decl.cs (DefineTypeAndParents): New helper method to define a
14593 type's containers before the type itself is defined; This is a
14594 bug exposed by the recent changes to Windows.Forms when an
14595 implemented interface was defined inside a class that had not been
14598 * modifiers.cs (MethodAttr): All methods in C# are HideBySig.
14600 (Check): Loop correctly to report errors modifiers
14601 (UNSAFE was not in the loop, since it was the same as TOP).
14603 * interface.cs: Every interface member now takes a ModFlags,
14604 instead of a "is_new" bool, which we set on the base MemberCore.
14606 Every place where we called "UnsafeOk" in the interface, now we
14607 call the proper member (InterfaceMethod.UnsafeOK) instead to get
14608 the unsafe settings from the member declaration instead of the
14609 container interface.
14611 * cs-parser.jay (opt_new): Allow unsafe here per the spec.
14613 * pending.cs (TypeAndMethods): Add `get_indexer_name' and
14614 `set_indexer_name' to the pending bits (one per type).
14616 We fixed a bug today that was picking the wrong method to
14617 override, since for properties the existing InterfaceMethod code
14618 basically ignored the method name. Now we make sure that the
14619 method name is one of the valid indexer names.
14621 2004-03-14 Gustavo Giráldez <gustavo.giraldez@gmx.net>
14623 * support.cs (SeekableStreamReader): Keep track of stream byte
14624 positions and don't mix them with character offsets to the buffer.
14626 Patch from Gustavo Giráldez
14628 2004-03-15 Marek Safar <marek.safar@seznam.cz>
14630 * interface.cs (InterfaceSetGetBase): Removed double member
14631 initialization, base class does it as well.
14633 2004-03-13 Martin Baulig <martin@ximian.com>
14635 * class.cs: Reverted Miguel's latest commit; it makes mcs crash
14636 when compiling corlib.
14638 2004-03-13 Miguel de Icaza <miguel@ximian.com>
14640 * convert.cs (ExplicitConversion): We were reporting an error on
14641 certain conversions (object_type source to a value type, when the
14642 expression was `null') before we had a chance to pass it through
14643 the user defined conversions.
14645 * driver.cs: Replace / and \ in resource specifications to dots.
14648 * class.cs: Add check for duplicate operators. Fixes 52477
14650 2004-03-11 Miguel de Icaza <miguel@ximian.com>
14652 * statement.cs (Switch.SimpleSwitchEmit): Deal with default labels
14653 that are in the middle of the statements, not only at the end.
14656 * class.cs (TypeContainer.AddField): No longer set the
14657 `HaveStaticConstructor' flag, now we call it
14658 `UserDefineStaticConstructor' to diferentiate the slightly
14659 semantic difference.
14661 The situation is that we were not adding BeforeFieldInit (from
14662 Modifiers.TypeAttr) to classes that could have it.
14663 BeforeFieldInit should be set to classes that have no static
14668 http://www.yoda.arachsys.com/csharp/beforefieldinit.html
14670 And most importantly Zoltan's comment:
14672 http://bugzilla.ximian.com/show_bug.cgi?id=44229
14674 "I think beforefieldinit means 'it's ok to initialize the type sometime
14675 before its static fields are used', i.e. initialization does not need
14676 to be triggered by the first access to the type. Setting this flag
14677 helps the JIT to compile better code, since it can run the static
14678 constructor at JIT time, and does not need to generate code to call it
14679 (possibly lots of times) at runtime. Unfortunately, mcs does not set
14680 this flag for lots of classes like String.
14682 csc sets this flag if the type does not have an explicit static
14683 constructor. The reasoning seems to be that if there are only static
14684 initalizers for a type, and no static constructor, then the programmer
14685 does not care when this initialization happens, so beforefieldinit
14688 This bug prevents the AOT compiler from being usable, since it
14689 generates so many calls to mono_runtime_class_init that the AOT code
14690 is much slower than the JITted code. The JITted code is faster,
14691 because it does not generate these calls if the vtable is type is
14692 already initialized, which is true in the majority of cases. But the
14693 AOT compiler can't do this."
14695 2004-03-10 Miguel de Icaza <miguel@ximian.com>
14697 * class.cs (MethodData.Emit): Refactor the code so symbolic
14698 information is generated for destructors; For some reasons we
14699 were taking a code path that did not generate symbolic information
14702 2004-03-11 Ben Maurer <bmaurer@users.sourceforge.net>
14704 * class.cs: Create a Constructor.CheckBase method that
14705 takes care of all validation type code. The method
14706 contains some code that was moved from Define.
14708 It also includes new code that checks for duplicate ctors.
14709 This fixes bug #55148.
14711 2004-03-09 Joshua Tauberer <tauberer@for.net>
14713 * expression.cs (ArrayCreation): Fix: More than 6 nulls in
14714 a { ... }-style array creation invokes EmitStaticInitializers
14715 which is not good for reference-type arrays. String, decimal
14716 and now null constants (NullCast) are not counted toward
14717 static initializers.
14719 2004-03-05 Martin Baulig <martin@ximian.com>
14721 * location.cs (SourceFile.HasLineDirective): New public field;
14722 specifies whether the file contains or is referenced by a "#line"
14724 (Location.DefineSymbolDocuments): Ignore source files which
14725 either contain or are referenced by a "#line" directive.
14727 2004-02-29 Ben Maurer <bmaurer@users.sourceforge.net>
14729 * class.cs (Method.CheckBase): Avoid using FindMembers, we have
14730 direct access to our parent, so check the method inline there.
14732 2004-02-27 Ben Maurer <bmaurer@users.sourceforge.net>
14734 * expression.cs (Invocation.EmitCall): Miguel's last commit
14735 caused a regression. If you had:
14740 In Foo the implict this would be null.
14742 2004-02-27 Miguel de Icaza <miguel@ximian.com>
14744 * expression.cs (Invocation.EmitCall): If the method is not
14745 virtual, do not emit a CallVirt to it, use Call.
14747 * typemanager.cs (GetFullNameSignature): Improve the method to
14748 cope with ".ctor" and replace it with the type name.
14750 * class.cs (ConstructorInitializer.Resolve): Now the method takes
14751 as an argument the ConstructorBuilder where it is being defined,
14752 to catch the recursive constructor invocations.
14754 2004-02-26 Miguel de Icaza <miguel@ximian.com>
14756 * iterators.cs (IteratorHandler.IsIEnumerator, IsIEnumerable): New
14757 routines to check if a type is an enumerable/enumerator allow
14758 classes that implement the IEnumerable or IEnumerator interfaces.
14760 * class.cs (Property, Operator): Implement IIteratorContainer, and
14761 implement SetYields.
14763 (Property.Define): Do the block swapping for get_methods in the
14764 context of iterators. We need to check if Properties also
14765 include indexers or not.
14767 (Operator): Assign the Block before invoking the
14768 OperatorMethod.Define, so we can trigger the Iterator code
14771 * cs-parser.jay (SimpleIteratorContainer): new helper class. Both
14772 Property and Operator classes are not created when we parse the
14773 declarator but until we have the block completed, so we use a
14774 singleton SimpleIteratorContainer.Simple to flag whether the
14775 SetYields has been invoked.
14777 We propagate this setting then to the Property or the Operator to
14778 allow the `yield' to function.
14780 2004-02-25 Marek Safar <marek.safar@seznam.cz>
14782 * codegen.cs: Implemented attribute support for modules.
14783 New AssemblyClass, ModuleClass and CommonAssemblyModulClass for
14784 Assembly/Module functionality.
14786 * attribute.cs, class.cs, cs-parser.jay, delegate.cs, driver.cs, enum.cs
14787 interface.cs, rootcontext.cs, statement.cs, typemanager.cs:
14788 Updated dependencies on CodeGen.ModuleBuilder and CodeGen.AssemblyBuilder.
14790 2004-02-16 Marek Safar <marek.safar@seznam.cz>
14792 * interface.cs (FindMembers): The operation is performed on all base
14793 interfaces and not only on the first. It is required for future CLS Compliance patch.
14795 2004-02-12 Ben Maurer <bmaurer@users.sourceforge.net>
14797 * statement.cs, codegen.cs:
14798 This patch deals with patterns such as:
14800 public class List : IEnumerable {
14802 public MyEnumerator GetEnumerator () {
14803 return new MyEnumerator(this);
14806 IEnumerator IEnumerable.GetEnumerator () {
14810 public struct MyEnumerator : IEnumerator {
14815 Before, there were a few things we did wrong:
14816 1) we would emit callvirt on a struct, which is illegal
14817 2) we emited ldarg when we needed to emit ldarga
14818 3) we would mistakenly call the interface methods on an enumerator
14819 type that derived from IEnumerator and was in another assembly. For example:
14821 public class MyEnumerator : IEnumerator
14823 Would have the interface methods called, even if there were public impls of the
14824 method. In a struct, this lead to invalid IL code.
14826 2004-02-11 Marek Safar <marek.safar@seznam.cz>
14828 * const.cs: Const is now derived from FieldBase. Method EmitConstant name
14831 * delegate.cs (Define): Fixed crash when delegate type is undefined.
14833 2004-02-11 Miguel de Icaza <miguel@ximian.com>
14835 * cs-parser.jay: Fix small regression: we were not testing V2
14836 compiler features correctly.
14838 * interface.cs: If the emit context is null, then create one
14840 2004-02-09 Marek Safar <marek.safar@seznam.cz>
14842 * decl.cs (GetSignatureForError): New virtual method to get full name
14843 for error messages.
14845 * attribute.cs (IAttributeSupport): New interface for attribute setting.
14846 Now it is possible to rewrite ApplyAttributes method to be less if/else.
14848 * interface.cs : All InterfaceXXX classes are now derived from MemberCore.
14849 Duplicated members and code in these classes has been removed.
14850 Better encapsulation in these classes.
14852 2004-02-07 Miguel de Icaza <miguel@ximian.com>
14854 * assign.cs (Assign.DoResolve): When dealing with compound
14855 assignments, there is a new rule in ECMA C# 2.4 (might have been
14856 there before, but it is documented here) that states that in:
14860 If b is of type int, and the `op' is a shift-operator, then the
14861 above is evaluated as:
14865 * expression.cs (Binary.ResolveOperator): Instead of testing for
14866 int/uint/long/ulong, try to implicitly convert to any of those
14867 types and use that in pointer arithmetic.
14869 * delegate.cs (Error_NoMatchingMethodForDelegate): Compute the
14870 method to print information for from the type, not from the
14871 null-method we were given.
14873 2004-02-01 Duncan Mak <duncan@ximian.com>
14875 * cs-tokenizer.cs (get_cmd_arg): Skip over whitespace before
14876 parsing for cmd, fixes bug #53694.
14878 2004-02-04 Marek Safar <marek.safar@seznam.cz>
14880 * class.cs, decl.cs: Fixed problem where IndexerName attribute was ignored
14881 in the member name duplication tests. Property and operator name duplication
14882 was missing too (error tests cs0102-{2,3,4,5}.cs, cs0111-{3,4}.cs).
14884 2004-02-03 Marek Safar <marek.safar@seznam.cz>
14886 * interface.cs (PopulateMethod): Fixed crash when interface method
14887 returns not existing type (error test cs0246-3.cs).
14889 2004-02-02 Ravi Pratap M <ravi@ximian.com>
14891 * cs-parser.jay (interface_accessors): Re-write actions to also
14892 store attributes attached to get and set methods. Fix spelling
14895 (inteface_property_declaration): Modify accordingly.
14897 (InterfaceAccessorInfo): New helper class to store information to pass
14898 around between rules that use interface_accessors.
14900 * interface.cs (Emit): Apply attributes on the get and set
14901 accessors of properties and indexers too.
14903 * attribute.cs (ApplyAttributes): Modify accordingly to use the
14904 right MethodBuilder when applying attributes to the get and set accessors.
14906 2004-01-31 Miguel de Icaza <miguel@ximian.com>
14908 * cs-tokenizer.cs: Applied patch from Marek Safar to fix bug 53386
14910 2004-01-26 Miguel de Icaza <miguel@ximian.com>
14912 * cs-tokenizer.cs: Handle #line hidden from PDC bits.
14914 2004-01-25 Miguel de Icaza <miguel@ximian.com>
14916 * cs-parser.jay: Remove YIELD token, instead use the new grammar
14917 changes that treat `yield' specially when present before `break'
14918 or `return' tokens.
14920 * cs-tokenizer.cs: yield is no longer a keyword.
14922 2004-01-23 Marek Safar <marek.safar@seznam.cz>
14924 * cs-parser.jay, class.cs (DefineDefaultConstructor): Fixed ModFlags
14925 setting for default constructors.
14926 For default constructors are almost every time set wrong Modifier. The
14927 generated IL code has been alright. But inside mcs this values was
14928 wrong and this was reason why several of my CLS Compliance tests
14931 2004-01-22 Martin Baulig <martin@ximian.com>
14933 * cs-parser.jay (namespace_or_type_name): Return an Expression,
14934 not a QualifiedIdentifier. This is what `type_name_expression'
14935 was previously doing.
14936 (type_name_expression): Removed; the code is now in
14937 `namespace_or_type_name'.
14938 (qualified_identifier): Removed, use `namespace_or_type_name'
14940 (QualifiedIdentifier): Removed this class.
14942 2004-01-22 Martin Baulig <martin@ximian.com>
14944 * namespace.cs (NamespaceEntry.UsingAlias): Take an Expression,
14945 not a string as alias name.
14947 2004-01-21 Miguel de Icaza <miguel@ximian.com>
14949 * ecore.cs (FieldInfo.AddressOf): Revert patch from previous
14950 #52730 bug, and instead compute correctly the need to use a
14951 temporary variable when requesting an address based on the
14952 static/instace modified of the field and the constructor.
14954 2004-01-21 Martin Baulig <martin@ximian.com>
14956 * ecore.cs (SimpleName.ResolveAsTypeStep): Lookup in the current
14957 class and namespace before looking up aliases. Fixes #52517.
14959 2004-01-21 Martin Baulig <martin@ximian.com>
14961 * flowanalysis.cs (UsageVector.Merge): Allow variables being
14962 assinged in a 'try'; fixes exception4.cs.
14964 2004-01-21 Marek Safar <marek.safar@seznam.cz>
14965 * class.cs : Implemented parameter-less constructor for TypeContainer
14967 * decl.cs: Attributes are now stored here. New property OptAttributes
14969 * delegate.cs, enum.cs, interface.cs: Removed attribute member.
14971 * rootcontext.cs, tree.cs: Now use parameter-less constructor of TypeContainer
14973 2004-01-21 Marek Safar <marek.safar@seznam.cz>
14975 * typemanager.cs (CSharpSignature): Now reports also inner class name.
14976 (CSharpSignature): New method for indexer and property signature.
14978 2004-01-21 Marek Safar <marek.safar@seznam.cz>
14980 * pending.cs (IsVirtualFilter): Faster implementation.
14982 2004-01-21 Marek Safar <marek.safar@seznam.cz>
14984 * typemanager.cs: Avoid inclusion of same assembly more than once.
14986 2004-01-21 Marek Safar <marek.safar@seznam.cz>
14988 * cs-parser.jay: Fixed problem where the last assembly attribute
14989 has been applied also to following declaration (class, struct, etc.)
14991 2004-01-21 Marek Safar <marek.safar@seznam.cz>
14993 * class.cs: Added error CS0538, CS0539 reporting.
14994 Fixed crash on Microsoft runtime when field type is void.
14996 * cs-parser.jay: Added error CS0537 reporting.
14998 * pending.cs: Added error CS0535 reporting.
14999 Improved error report for errors CS0536, CS0534.
15001 2004-01-20 Miguel de Icaza <miguel@ximian.com>
15003 Merge a few bits from the Anonymous Method MCS tree.
15005 * statement.cs (ToplevelBlock): New class for toplevel methods,
15006 will hold anonymous methods, lifted variables.
15008 * cs-parser.jay: Create toplevel blocks for delegates and for
15009 regular blocks of code.
15011 2004-01-20 Martin Baulig <martin@ximian.com>
15013 * codegen.cs (EmitContext): Removed `InTry', `InCatch',
15014 `InFinally', `InLoop', `TryCatchLevel', `LoopBeginTryCatchLevel'
15015 and `NeedExplicitReturn'; added `IsLastStatement'.
15016 (EmitContext.EmitTopBlock): Emit the explicit "ret" if we either
15017 have a `ReturnLabel' or we're not unreachable.
15019 * flowanalysis.cs (FlowBranching.MergeChild): Actually merge the
15020 child's reachability; don't just override ours with it. Fixes
15021 #58058 (lluis's example).
15022 (FlowBranching): Added public InTryOrCatch(), InCatch(),
15023 InFinally(), InLoop(), InSwitch() and
15024 BreakCrossesTryCatchBoundary() methods.
15026 * statement.cs (Return): Do all error checking in Resolve().
15027 Unless we are the last statement in a top-level block, always
15028 create a return label and jump to it.
15029 (Break, Continue): Do all error checking in Resolve(); also make
15030 sure we aren't leaving a `finally'.
15031 (Block.DoEmit): Set `ec.IsLastStatement' when emitting the last
15032 statement in a top-level block.
15033 (Block.Flags): Added `IsDestructor'.
15034 (Block.IsDestructor): New public property.
15036 2004-01-20 Martin Baulig <martin@ximian.com>
15038 * statement.cs (Break.DoEmit): Set ec.NeedExplicitReturn; fixes #52427.
15040 2004-01-20 Martin Baulig <martin@ximian.com>
15042 * statement.cs (Statement.ResolveUnreachable): New public method.
15043 (If, While): Do the dead-code elimination in Resolve(), not in Emit().
15044 (Block.Resolve): Resolve unreachable statements.
15046 2004-01-19 Ben Maurer <bmaurer@users.sourceforge.net>
15048 * expression.cs: We need to fix the case where we do
15049 not have a temp variable here.
15051 * assign.cs: Only expression compound assignments need
15052 temporary variables.
15054 2004-01-19 Ben Maurer <bmaurer@users.sourceforge.net>
15056 * flowanalysis.cs: Reduce memory allocation in a few ways:
15057 - A block with no variables should not allocate a bit
15059 - A method with no out parameters does not need any tracking
15060 for assignment of the parameters, so we need not allocate
15063 public readonly Type[] VariableTypes;
15064 public readonly string[] VariableNames;
15065 Are redundant. The data is already stored in the variable
15066 map, so we need not allocate another array for it.
15067 - We need to add alot of checks for if (params | locals) == null
15068 due to the first two changes.
15070 2004-01-18 Miguel de Icaza <miguel@ximian.com>
15072 * ecore.cs (FieldExpr.AddressOf): For ValueTypes that do not
15073 implement IMemoryLocation, we store a copy on a local variable and
15074 take the address of it. Patch from Benjamin Jemlich
15076 * cs-parser.jay: Applied patch from Ben Maurer to the "type" rule
15077 to use a special "type_name_expression" rule which reduces the
15078 number of "QualifiedIdentifier" classes created, and instead
15079 directly creates MemberAccess expressions.
15081 2004-01-17 Miguel de Icaza <miguel@ximian.com>
15083 * convert.cs: Applied patch from Benjamin Jemlich (pcgod@gmx.net)
15084 that fixes #52853. Null literal assignment to ValueType
15086 * class.cs (MethodData.Emit): Instead of checking the name of the
15087 method to determine if its a destructor, create a new derived
15088 class from Method called Destructor, and test for that.
15090 * cs-parser.jay: Create a Destructor object instead of a Method.
15092 Based on a fix from Benjamin Jemlich (pcgod@gmx.net)
15096 2004-01-16 Miguel de Icaza <miguel@ximian.com>
15098 * expression.cs (Binary.ResolveOperator): Perform an implicit
15099 conversion from MethodGroups to their delegate types on the
15100 Addition operation.
15102 * delegate.cs: Introduce a new class DelegateCreation that is the
15103 base class for `NewDelegate' and `ImplicitDelegateCreation',
15104 factor some code in here.
15106 * convert.cs (Convert.ImplicitConversionStandard): Add an implicit
15107 conversion from MethodGroups to compatible delegate types.
15109 * ecore.cs (Expression.Resolve): Do not flag error 654
15110 (Methodgroupd needs parenthesis) if running on the V2 compiler, as
15111 we allow conversions from MethodGroups to delegate types now.
15113 * assign.cs (Assign.DoResolve): Do not flag errors on methodgroup
15114 assignments in v2 either.
15116 2004-01-10 Miguel de Icaza <miguel@ximian.com>
15118 * ecore.cs (FieldExpr.AddressOf): Fix generated IL for accessing
15119 static read-only fields in ctors.
15121 Applied patch from Benjamin Jemlich
15123 * expression.cs (UnaryMutator): Avoid leaking local variables.
15125 2004-01-09 Miguel de Icaza <miguel@ximian.com>
15127 * cs-tokenizer.cs (IsCastToken): Allow the various native types
15128 here to return true, as they can be used like this:
15130 (XXX) int.MEMBER ()
15132 Fixed 49836 and all the other dups
15134 2004-01-09 Zoltan Varga <vargaz@freemail.hu>
15136 * driver.cs: Implement /win32res and /win32icon.
15138 2004-01-08 Miguel de Icaza <miguel@ximian.com>
15140 * cs-parser.jay: Add a rule to improve error handling for the
15141 common mistake of placing modifiers after the type.
15143 2004-01-07 Miguel de Icaza <miguel@ximian.com>
15145 * cs-parser.jay (interface_event_declaration): Catch
15146 initialization of events on interfaces, and report cs0068
15148 * cs-parser.jay (interface_event_declaration): Catch
15149 initialization of events.
15151 * ecore.cs: Better report missing constructors.
15153 * expression.cs (Binary.ResolveOperator): My previous bug fix had
15154 the error reporting done in the wrong place. Fix.
15156 * expression.cs (Binary.ResolveOperator): Catch the
15157 operator + (E x, E y) error earlier, and later allow for implicit
15158 conversions in operator +/- (E e, U x) from U to the underlying
15161 * class.cs (TypeContainer.DefineDefaultConstructor): Fix bug
15162 52596, if the container class is abstract, the default constructor
15163 is protected otherwise its public (before, we were always public).
15165 * statement.cs (Fixed.Resolve): Catch a couple more errors in the
15168 (Using.EmitLocalVariableDecls): Applied patch from Benjamin
15169 Jemlich that fixes bug #52597, MCS was generating invalid code for
15170 idisposable structs. Thanks to Ben for following up with this
15173 2004-01-06 Miguel de Icaza <miguel@ximian.com>
15175 * driver.cs: Allow assemblies without code to be generated, fixes
15178 2004-01-07 Nick Drochak <ndrochak@gol.com>
15180 * attribute.cs: Remove unneeded catch variables. Eliminates a warning.
15182 2004-01-05 Miguel de Icaza <miguel@ximian.com>
15184 * cs-parser.jay: Add rules to improve error reporting if fields or
15185 methods are declared at the namespace level (error 116)
15187 * Add rules to catch event add/remove
15189 2004-01-04 David Sheldon <dave-mono@earth.li>
15191 * expression.cs: Added matching ")" to error message for
15194 2004-01-03 Todd Berman <tberman@gentoo.org>
15196 * ecore.cs, attribute.cs:
15197 Applying fix from #52429.
15199 2004-01-03 Ben Maurer <bmaurer@users.sourceforge.net>
15201 * ecore.cs, expression.cs, statement.cs:
15202 Total rewrite of how we handle branching. We
15203 now handle complex boolean expressions with fewer
15204 jumps. As well if (x == 0) no longer emits a ceq.
15206 if (x is Foo) is much faster now, because we generate
15209 Overall, we get a pretty big improvement on our benchmark
15210 tests. The code we generate is smaller and more readable.
15212 I did a full two-stage bootstrap. The patch was reviewed
15213 by Martin and Miguel.
15215 2004-01-03 Ben Maurer <bmaurer@users.sourceforge.net>
15217 * cs-parser.jay: Make primary_expression not take a QI.
15218 we dont need this because the member_access rule covers
15219 us here. So we replace the rule with just IDENTIFIER.
15221 This has two good effects. First, we remove a s/r conflict.
15222 Second, we allocate many fewer QualifiedIdentifier objects.
15224 2004-01-03 Ben Maurer <bmaurer@users.sourceforge.net>
15226 * attribute.cs: Handle MarshalAs attributes as pseudo, and
15227 set the correct information via SRE. This prevents
15228 hanging on the MS runtime. Fixes #29374.
15230 2004-01-03 Ben Maurer <bmaurer@users.sourceforge.net>
15232 * convert.cs: correctly handle conversions to value types
15233 from Enum and ValueType as unboxing conversions.
15235 Fixes bug #52569. Patch by Benjamin Jemlich.
15237 2004-01-02 Ravi Pratap <ravi@ximian.com>
15239 * expression.cs (BetterConversion): Prefer int -> uint
15240 over int -> ulong (csc's behaviour). This fixed bug #52046.
15242 2004-01-02 Ben Maurer <bmaurer@users.sourceforge.net>
15244 * decl.cs (MemberCache.FindMembers): now returns a
15247 * typemanager.cs: In general, go with with ^^.
15248 (CopyNewMethods): take an IList.
15249 (RealMemberLookup): Only allocate an arraylist
15250 if we copy from two sets of methods.
15252 This change basically does two things:
15253 1) Fewer array lists allocated due to CopyNewMethods.
15254 2) the explicit cast in MemberList costed ALOT.
15256 2004-01-02 Zoltan Varga <vargaz@freemail.hu>
15258 * cs-tokenizer.cs (consume_identifier) driver.cs: Cache identifiers in
15259 a hashtable to avoid needless string allocations when an identifier is
15260 used more than once (the common case).
15262 2004-01-01 Ben Maurer <bmaurer@users.sourceforge.net>
15264 * pending.cs: MS's TypeBuilder.GetInterfaces ()
15265 is broken, it will not return anything. So, we
15266 have to use the information we have in mcs to
15269 * typemanager.cs: Add a cache for GetInterfaces,
15270 since this will now be used more often (due to ^^)
15272 (GetExplicitInterfaces) New method that gets the
15273 declared, not effective, interfaces on a type
15274 builder (eg, if you have interface IFoo, interface
15275 IBar, Foo : IFoo, Bar : Foo, IBar, GetExplInt (Bar) ==
15278 This patch makes MCS able to bootstrap itself on
15281 2004-01-01 Ben Maurer <bmaurer@users.sourceforge.net>
15283 * expression.cs: Remove the Nop's that Miguel put
15286 2003-12-31 Ben Maurer <bmaurer@users.sourceforge.net>
15288 * report.cs, codegen.cs: Give the real stack trace to
15289 the error when an exception is thrown.
15291 2003-12-31 Ben Maurer <bmaurer@users.sourceforge.net>
15293 * decl.cs: only allocate hashtables for ifaces if
15296 2003-12-31 Ben Maurer <bmaurer@users.sourceforge.net>
15298 * expression.cs: fix the error from cs0121-2.cs
15299 (a parent interface has two child interfaces that
15300 have a function with the same name and 0 params
15301 and the function is called through the parent).
15303 2003-12-30 Ben Maurer <bmaurer@users.sourceforge.net>
15305 * class.cs, rootcontext.cs, typmanager.cs: do not
15308 2003-12-28 Ben Maurer <bmaurer@users.sourceforge.net>
15310 * codegen.cs: remove stack for the ec flow branching.
15311 It is already a linked list, so no need.
15313 2003-12-27 Ben Maurer <bmaurer@users.sourceforge.net>
15315 * Makefile: Allow custom profiler here.
15317 2003-12-26 Ben Maurer <bmaurer@users.sourceforge.net>
15319 * typemanager.cs (LookupType):
15320 - Use a static char [], because split takes
15321 a param array for args, so it was allocating
15323 - Do not store true in a hashtable, it boxes.
15325 2003-12-26 Ben Maurer <bmaurer@users.sourceforge.net>
15327 * flowanalysis.cs: bytify common enums.
15329 2003-12-25 Ben Maurer <bmaurer@users.sourceforge.net>
15331 * modifiers.cs: Add a new set of flags for the
15332 flags allowed on explicit interface impls.
15333 * cs-parser.jay: catch the use of modifiers in
15334 interfaces correctly.
15335 * class.cs: catch private void IFoo.Blah ().
15337 All related to bug #50572.
15339 2003-12-25 Ben Maurer <bmaurer@users.sourceforge.net>
15341 * decl.cs: Rewrite the consistant accessability checking.
15342 Accessability is not linear, it must be implemented in
15343 a tableish way. Fixes #49704.
15345 2003-12-25 Ben Maurer <bmaurer@users.sourceforge.net>
15347 * expression.cs: Handle negation in a checked context.
15348 We must use subtraction from zero. Fixes #38674.
15350 2003-12-23 Ben Maurer <bmaurer@users.sourceforge.net>
15352 * class.cs: Ignore static void main in DLLs.
15353 * rootcontext.cs: Handle the target type here,
15354 since we are have to access it from class.cs
15355 * driver.cs: account for the above.
15357 2003-12-23 Ben Maurer <bmaurer@users.sourceforge.net>
15359 * report.cs: Give line numbers and files if available.
15361 2003-12-20 Zoltan Varga <vargaz@freemail.hu>
15363 * driver.cs: Implement /addmodule.
15365 * typemanager.cs: Change 'modules' field so it now contains Modules not
15368 2003-12-20 Martin Baulig <martin@ximian.com>
15370 * class.cs (TypeContainer.DefineMembers): Don't do the CS0649 check here.
15371 (FieldBase.IsAssigned): Removed this field.
15372 (FieldBase.SetAssigned): New public method.
15373 (TypeContainer.Emit): Make the CS0169/CS0649 checks actually work.
15375 2003-12-20 Martin Baulig <martin@ximian.com>
15377 * expression.cs (LocalVariableReference.DoResolve): Don't set
15378 `vi.Used' if we're called from DoResolveLValue().
15380 * statement.cs (Block.DoResolve): `ec.DoEndFlowBranching()' now
15381 returns the usage vector it just merged into the current one -
15382 pass this one to UsageWarning().
15383 (Block.UsageWarning): Take the `FlowBranching.UsageVector' instead
15384 of the `EmitContext', don't call this recursively on our children.
15386 2003-12-19 Zoltan Varga <vargaz@freemail.hu>
15388 * driver.cs: Implement /target:module.
15390 2003-12-18 Zoltan Varga <vargaz@freemail.hu>
15392 * support.cs (CharArrayHashtable): New helper class.
15394 * cs-tokenizer.cs: Store keywords in a hashtable indexed by
15395 char arrays, not strings, so we can avoid creating a string in
15396 consume_identifier if the identifier is a keyword.
15398 2003-12-16 Martin Baulig <martin@ximian.com>
15400 * statement.cs (LocalInfo.Assigned): Removed this property.
15401 (LocalInfo.Flags): Removed `Assigned'.
15402 (LocalInfo.IsAssigned): New public method; takes the EmitContext
15403 and uses flow analysis.
15404 (Block.UsageWarning): Made this method private.
15405 (Block.Resolve): Call UsageWarning() if appropriate.
15407 * expression.cs (LocalVariableReference.DoResolve): Always set
15408 LocalInfo.Used here.
15410 2003-12-13 Martin Baulig <martin@ximian.com>
15412 * statement.cs (Statement.DoEmit, Statement.Emit): Don't return
15413 any value here; we're now using flow analysis to figure out
15414 whether a statement/block returns a value.
15416 2003-12-13 Martin Baulig <martin@ximian.com>
15418 * flowanalysis.cs (UsageVector.MergeFinallyOrigins): Made this
15420 (FlowBranching.MergeFinally): Don't call
15421 `branching.CheckOutParameters()' here, this is called in
15423 (FlowBranchingException.AddSibling): Call MergeFinallyOrigins()
15424 when adding the `finally' vector.
15426 2003-12-13 Martin Baulig <martin@ximian.com>
15429 (UsageVector.MergeJumpOrigins, FlowBranching.Label): Make this
15430 actually work and also fix #48962.
15432 2003-12-12 Ben Maurer <bmaurer@users.sourceforge.net>
15434 * decl.cs: Do not check System.Object for nested types,
15435 since we know it does not have any. Big bang for buck:
15438 Run 1: 8.35 seconds
15439 Run 2: 8.32 seconds
15440 corlib: 17.99 seconds
15442 Run 1: 8.17 seconds
15443 Run 2: 8.17 seconds
15444 corlib: 17.39 seconds
15446 2003-12-11 Ben Maurer <bmaurer@users.sourceforge.net>
15448 * class.cs (FindMembers): Allocate arraylists on demand. Most of the
15449 time we are returning 0 members, so we save alot here.
15451 2003-12-11 Martin Baulig <martin@ximian.com>
15453 * flowanalysis.cs (UsageVector.MergeResult): Renamed this back to
15454 `MergeChild()', also just take the `FlowBranching' as argument;
15455 call Merge() on it and return the result.
15456 (FlowBranching.Merge): We don't need to do anything if we just
15459 2003-12-11 Martin Baulig <martin@ximian.com>
15461 * flowanalysis.cs: Use a list of `UsageVector's instead of storing
15462 them in an `ArrayList' to reduce memory usage. Thanks to Ben
15463 Maurer for this idea.
15465 2003-12-11 Martin Baulig <martin@ximian.com>
15467 * flowanalysis.cs (MergeResult): This class is now gone; we now
15468 use the `UsageVector' for this. The reason for this is that if a
15469 branching just has one sibling, we don't need to "merge" them at
15470 all - that's the next step to do.
15471 (FlowBranching.Merge): We now return a `UsageVector' instead of a
15474 2003-12-11 Martin Baulig <martin@ximian.com>
15476 Reworked flow analyis and made it more precise and bug-free. The
15477 most important change is that we're now using a special `Reachability'
15478 class instead of having "magic" meanings of `FlowReturns'. I'll
15479 do some more cleanups and optimizations and also add some more
15480 documentation this week.
15482 * flowanalysis.cs (Reachability): Added `Throws' and `Barrier';
15483 largely reworked this class.
15484 (FlowReturns): Removed `Unreachable' and `Exception'; we now use
15485 the new `Reachability' class instead of having "magic" values here.
15486 (FlowBranching): We're now using an instance of `Reachability'
15487 instead of having separate `Returns', `Breaks' etc. fields.
15489 * codegen.cs (EmitContext.EmitTopBlock): Set `has_ret' solely
15490 based on flow analysis; ignore the return value of block.Emit ().
15492 2003-12-10 Zoltan Varga <vargaz@freemail.hu>
15494 * driver.cs typemanager.cs: Find the mono extensions to corlib even
15495 if they are private.
15497 2003-12-09 Martin Baulig <martin@ximian.com>
15499 * flowanalyis.cs (FlowBranching.Return, Goto, Throw): Removed;
15500 call them directly on the UsageVector.
15502 2003-12-09 Martin Baulig <martin@ximian.com>
15504 * flowanalysis.cs (FlowBranching.MergeChild, MergeTopBlock):
15505 Changed return type from `FlowReturns' to `Reachability'.
15507 2003-12-09 Martin Baulig <martin@ximian.com>
15509 * flowanalysis.cs (FlowBranching.Reachability): New sealed class.
15510 (FlowBranching.MergeResult): Replaced the `Returns', `Breaks' and
15511 `Reachable' fields with a single `Reachability' one.
15513 2003-12-08 Ben Maurer <bmaurer@users.sourceforge.net>
15515 * class.cs (FindMembers): Remove foreach's.
15520 Run 1: 8.74 seconds
15521 Run 2: 8.71 seconds
15524 Run 1: 8.64 seconds
15525 Run 2: 8.58 seconds
15528 2003-12-08 Ben Maurer <bmaurer@users.sourceforge.net>
15533 This patch does a few things:
15534 1. EmptyStatement is now a singleton, so it is never reallocated.
15535 2. All blah is EmptyStatement constructs have been changed to
15536 blah == EmptyStatement.Value, which is much faster and valid
15537 now that EmptyStatement is a singleton.
15538 3. When resolving a block, rather than allocating a new array for
15539 the non-empty statements, empty statements are replaced with
15540 EmptyStatement.Value
15541 4. Some recursive functions have been made non-recursive.
15542 Mainly the performance impact is from (3), however (1) and (2) are needed for
15543 this to work. (4) does not make a big difference in normal situations, however
15544 it makes the profile look saner.
15549 9.25user 0.23system 0:10.28elapsed 92%CPU (0avgtext+0avgdata 0maxresident)k
15550 9.34user 0.13system 0:10.23elapsed 92%CPU (0avgtext+0avgdata 0maxresident)k
15551 Total memory allocated: 56397 KB
15554 9.13user 0.09system 0:09.64elapsed 95%CPU (0avgtext+0avgdata 0maxresident)k
15555 8.96user 0.24system 0:10.13elapsed 90%CPU (0avgtext+0avgdata 0maxresident)k
15556 Total memory allocated: 55666 KB
15558 2003-12-08 Ben Maurer <bmaurer@users.sourceforge.net>
15560 * support.cs: Rewrite DoubleHash to use its own impl. Is faster
15561 than the hashtable in a hashtable version
15563 * decl.cs: Right now, whenever we try to lookup a type inside a namespace,
15564 we always end up concating a string. This results in a huge perf
15565 loss, because many strings have to be tracked by the GC. In this
15566 patch, we first use a hashtable that works with two keys, so that
15567 the strings do not need to be concat'ed.
15571 Run 1: 8.74 seconds
15572 Run 2: 8.71 seconds
15575 Run 1: 8.65 seconds
15576 Run 2: 8.56 seconds
15578 2003-12-08 Ben Maurer <bmaurer@users.sourceforge.net>
15580 * Makefile: Add a new target `do-time' that does a quick and simple
15581 profile, leaving easy to parse output.
15583 2003-12-08 Zoltan Varga <vargaz@freemail.hu>
15585 * codegen.cs (Init): Create the dynamic assembly with
15586 AssemblyBuilderAccess.Save, to enable some optimizations in the runtime.
15588 2003-12-02 Ben Maurer <bmaurer@users.sourceforge.net>
15590 * support.cs: Make the PtrHashtable use only one
15591 instance of its comparer.
15593 2003-11-30 Zoltan Varga <vargaz@freemail.hu>
15595 * typemanager.cs: Fix lookup of GetNamespaces.
15597 2003-11-29 Miguel de Icaza <miguel@ximian.com>
15599 * expression.cs: Removed redundant line.
15601 * statement.cs (Block.Resolve, Block.Emit): Avoid foreach on
15602 ArrayLists, use for loops with bounds.
15604 * flowanalysis.cs (FlowBranching.Merge): Avoid foreach on
15607 * expression.cs (Invocation.OverloadResolve): Avoid foreach on
15608 arraylists, use for loop with bounds.
15610 The above three changes give us a 0.071 second performance
15611 improvement out of 3.294 seconds down to 3.223. On my machine
15612 the above changes reduced the memory usage by 1,387 KB during
15613 compiler bootstrap.
15615 * cs-parser.jay (QualifiedIdentifier): New class used to represent
15616 QualifiedIdentifiers. Before we created a new string through
15617 concatenation, and mostly later on, the result would be
15618 manipulated by DecomposeQI through string manipulation.
15620 This reduced the compiler memory usage for bootstrapping from
15621 59380 KB to 59007 KB on my machine, 373 KB, and also reduced the
15622 compile times in 0.05 seconds.
15624 2003-11-28 Dick Porter <dick@ximian.com>
15626 * support.cs: Do string compares with the Invariant culture.
15634 * class.cs: Use the char forms of IndexOf and LastIndexOf, so that
15635 the comparison is done with the Invariant culture.
15637 2003-11-27 Miguel de Icaza <miguel@ximian.com>
15639 * statement.cs (Foreach.TryType): Use DeclaredOnly to find the
15640 GetEnumerator method.
15642 (ProbeCollectionType): Iterate starting at the most specific type
15643 upwards looking for a GetEnumerator
15645 * expression.cs: Shift count can be up to 31 for int/uint and 63
15648 2003-11-26 Miguel de Icaza <miguel@ximian.com>
15650 * statement.cs (Block.LookupLabel): Also look for the label on the
15651 children blocks. Use a hash table to keep track of visited
15654 * cfold.cs (IntConstant to UIntConstant mapping): Only return if
15655 we actually did transform the other operand, otherwise fall back
15656 to the common codepath that casts to long.
15658 * cs-tokenizer.cs: Use the same code pattern as the int case.
15659 Maybe I should do the parsing myself, and avoid depending on the
15660 Parse routines to get this done.
15662 2003-11-25 Miguel de Icaza <miguel@ximian.com>
15664 * expression.cs: Apply fix from l_m@pacbell.net (Laurent Morichetti),
15665 which fixes bug 51347. This time test it.
15667 * expression.cs: Make TypeOfVoid derive from TypeOf, so code in
15668 attributes for example can not tell the difference between these.
15669 The difference was only a syntax feature of the language.
15671 * attribute.cs: Apply attributes to delegates.
15673 * delegate.cs: Call the apply attributes method.
15675 2003-11-24 Miguel de Icaza <miguel@ximian.com>
15677 * convert.cs (TryImplicitIntConversion): One line bug fix: we were
15678 comparing 0 vs Byte.MinValue, not the value
15680 (ImplicitConversionRequired): When reporting a conversion error,
15681 use error 31 to print out the constant error instead of the
15684 * expression.cs: Apply fix from l_m@pacbell.net (Laurent Morichetti),
15685 which fixes bug 51347.
15687 2003-11-22 Miguel de Icaza <miguel@ximian.com>
15689 * driver.cs: Applied patch from gert.driesen@pandora.be (Gert Driesen)
15690 which fixes the -warnaserror command line option.
15692 2003-11-21 Miguel de Icaza <miguel@ximian.com>
15694 * cfold.cs (DoNumericPromotions): During constant folding of
15695 additions on UIntConstant, special case intconstants with
15696 IntConstants like we do on the expression binary operator.
15698 2003-11-12 Miguel de Icaza <miguel@ximian.com>
15700 * convert.cs (ImplicitReferenceConversion): We were missing a case
15701 (System.Enum are not value types or class types, so we need to
15702 classify them separatedly).
15704 * driver.cs: We do not support error 2007.
15706 2003-11-12 Jackson Harper <jackson@ximian.com>
15708 * driver.cs: Use corlib.dll or mscorlib.dll when looking up the
15709 system directory. Also use the full file name so users can
15710 libraries names mscorlib-o-tron.dll in a non system dir.
15712 2003-11-10 Martin Baulig <martin@ximian.com>
15714 * typemanager.cs (TypeManager.ResolveExpressionTypes): Removed.
15715 (TypeManager.InitCoreTypes): Initialize them here, but instead of
15716 calling `ResolveType()' on them, directly assign their `Type'.
15718 2003-11-08 Martin Baulig <martin@ximian.com>
15720 * class.cs (TypeContainer.GetClassBases): Use TypeExpr's for the
15721 return value and the `out parent' parameter.
15722 (TypeContainer.DefineType): Moved the CS0644 check into
15723 GetClassBases(). Don't pass the interface types to the
15724 `builder.DefineType()'/`builder.DefineNestedType()', but resolve
15725 them later and then call `TypeBuilder.AddInterfaceImplementation()'.
15727 * ecore.cs (TypeExpr.IsAttribute): New property.
15728 (TypeExpr.GetInterfaces): New method.
15730 * interface.cs (Interface.GetInterfaceTypeByName): Return a
15731 TypeExpr instead of a Type.
15732 (Interface.GetInterfaceBases): Return TypeExpr's instead of Type's.
15733 (Interface.DefineType): Don't pass the interface types to the
15734 `builder.Definetype()'/`builder.DefineNestedType()', but resolve
15735 them later and then call `TypeBulider.AddInterfaceImplementation()'.
15737 * typemanager.cs (TypeManager.AddUserType): Take a `TypeExpr[]'
15738 instead of a `Type[]'.
15739 (TypeManager.RegisterBuilder): Likewise.
15740 (TypeManager.AddUserInterface): Likewise.
15741 (TypeManager.ExpandInterfaces): Take a `Type[]' instead of a
15742 `Type[]' and also return a `TypeExpr[]'.
15743 (TypeManager.GetInterfaces): Return a `TypeExpr[]'.
15745 2003-11-08 Martin Baulig <martin@ximian.com>
15747 * decl.cs (DeclSpace.ResolveTypeExpr): Return a TypeExpr, not an
15750 2003-11-08 Martin Baulig <martin@ximian.com>
15752 * decl.cs (DeclSpace.GetTypeResolveEmitContext): Call
15753 TypeManager.ResolveExpressionTypes().
15755 * ecore.cs (Expression.ResolveAsTypeTerminal): Return a TypeExpr
15756 instead of an Expression.
15757 (TypeExpr): This is now an abstract base class for `TypeExpression'.
15758 (TypeExpression): New public class; formerly known as `TypeExpr'.
15760 * expression.cs (ComposedCast): Derive from TypeExpr.
15762 * typemanager.cs (TypeManager.system_*_expr): These are now
15763 TypExpr's instead of Expression's.
15764 (TypeManager.ResolveExpressionTypes): New public static function;
15765 called from DeclSpace.GetTypeResolveEmitContext() to resolve all
15768 2003-11-06 Miguel de Icaza <miguel@ximian.com>
15770 * expression.cs (New.DoResolve): Do not dereference value that
15771 might be a null return.
15773 * statement.cs (Block.EmitMeta): Use the Const.ChangeType to make
15774 sure that the constant value has the right type. Fixes an
15775 unreported bug, similar to 50425.
15777 * const.cs (Const.LookupConstantValue): Call
15778 ImplicitStandardConversionExists before doing a conversion to
15779 avoid havng the TypeManager.ChangeType do conversions.
15781 Reduced the number of casts used
15783 (Const.ChangeType): New routine to enable reuse of the constant
15784 type changing code from statement.
15786 * typemanager.cs (ChangeType): Move common initialization to
15787 static global variables.
15791 * convert.cs (ImplicitReferenceConversion): Somehow we allowed
15792 every value type to go through, even if it was void. Fix that.
15794 * cs-tokenizer.cs: Use is_identifier_start_character on the start
15795 character of the define, and the is_identifier_part_character for
15796 the rest of the string.
15798 2003-11-05 Miguel de Icaza <miguel@ximian.com>
15800 * expression.cs (UnaryMutator.EmitCode): When I updated
15801 LocalVariableReference.DoResolve, I overdid it, and dropped an
15802 optimization done on local variable references.
15804 2003-11-04 Miguel de Icaza <miguel@ximian.com>
15806 * ecore.cs: Convert the return from Ldlen into an int.
15808 2003-10-20 Miguel de Icaza <miguel@ximian.com>
15810 * decl.cs (DeclSpace.GetAccessLevel): Handle NotPublic case for
15811 the accessibility, this is a special case for toplevel non-public
15812 classes (internal for instance).
15814 2003-10-20 Nick Drochak <ndrochak@gol.com>
15816 * ecore.cs: Fix typo and build. Needed another right paren.
15818 2003-10-19 Miguel de Icaza <miguel@ximian.com>
15820 * ecore.cs: Applied fix from Ben Maurer. We were handling in the
15821 `internal' case regular and protected, but not allowing protected
15822 to be evaluated later. Bug 49840
15824 2003-10-15 Miguel de Icaza <miguel@ximian.com>
15826 * statement.cs (Switch.TableSwitchEmit): Compare the upper bound
15827 to kb.Nlast, and not the kb.nFirst to isolate the switch
15830 Extract the underlying type, so enumerations of long/ulong are
15831 treated like long/ulong.
15833 2003-10-14 Miguel de Icaza <miguel@ximian.com>
15835 * expression.cs (New): Overload the meaning of RequestedType to
15836 track the possible creation of the NewDelegate type, since
15837 DoResolve is invoked more than once for new constructors on field
15840 See bugs: #48800 and #37014
15842 * cs-parser.jay (declare_local_constants): Take an arraylist
15843 instead of a single constant.
15845 (local_constant_declaration): It should take a
15846 constant_declarators, not a constant_declarator. Fixes 49487
15848 * convert.cs: Fix error report.
15850 2003-10-13 Jackson Harper <jackson@ximian.com>
15852 * typemanager.cs (TypeToCoreType): Add float and double this fixes
15855 2003-10-09 Martin Baulig <martin@ximian.com>
15857 * class.cs (MethodCore): Added additional `DeclSpace ds' argument
15859 (MethodCore.DoDefineParameters): Removed the TypeContainer
15860 argument; use the DeclSpace which was passed to the .ctor instead.
15861 (MethodCore.CheckParameter): Take a DeclSpace instead of a
15862 TypeContainer; we only need a DeclSpace here.
15864 2003-10-09 Martin Baulig <martin@ximian.com>
15866 * class.cs (MethodData): Added additional `DeclSpace ds' argument
15868 (MethodData.Define, MethodData.Emit): Pass the `ds' to the
15869 EmitContext's .ctor.
15871 2003-10-09 Martin Baulig <martin@ximian.com>
15873 * decl.cs (DeclSpace.AsAccessible): Moved here from TypeContainer.
15874 (AccessLevel, CheckAccessLevel, GetAccessLevel): They're used by
15875 AsAccessible(), moved them as well.
15877 * class.cs (TypeContainer.AsAccessible): Moved to DeclSpace.
15879 2003-10-08 Atsushi Enomoto <ginga@kit.hi-ho.ne.jp>
15881 * cs-parser.jay : Renamed yyName to yyNames related to jay.
15883 2003-10-07 Miguel de Icaza <miguel@ximian.com>
15885 * expression.cs (Binary.Emit.GreatherThanOrEqual): Fix the code
15886 generation for >=, as spotted by Paolo, bug 48679.
15887 Patch from David Waite.
15889 * cs-tokenizer.cs: Add handling for #pragma.
15891 * cs-parser.jay: Allow for both yield and yield return in the
15892 syntax. The anti-cobolization of C# fight will go on!
15894 * class.cs (TypeBuilder.DefineType): Catch error condition here
15895 (Parent.DefineType erroring out and returning null).
15897 * expression.cs (ArrayCreation.EmitDynamicInitializers): When
15898 coping with enumerations variables, we were mistakenly processing
15899 them as a regular value type instead of built-in types. Fixes the
15902 * typemanager.cs (IsBuiltinOrEnum): New method.
15904 2003-09-30 Miguel de Icaza <miguel@ximian.com>
15906 * cs-parser.jay: Upgrade: yield now needs the return clause.
15908 2003-09-19 Martin Baulig <martin@ximian.com>
15910 * decl.cs (MemberCache.SetupCacheForInterface): Take a
15911 `MemberCache parent' argument. Normally, an interface doesn't
15912 have a parent type except System.Object, but we use this in gmcs
15913 for generic type parameters.
15915 2003-09-18 Martin Baulig <martin@ximian.com>
15917 * typemanager.cs (TypeHandle.ctor): Set `IsInterface' solely based
15918 on `type.IsInterface'; don't check whether the type has a parent
15919 to determine whether it's an interface.
15921 2003-09-15 Martin Baulig <martin@ximian.com>
15923 * class.cs (TypeContainer.DefineType): Added an error flag to
15924 avoid reporting duplicate CS0146's ("class definition is
15927 * driver.cs (Driver.MainDriver): Abort if
15928 RootContext.ResolveTree() reported any errors.
15930 2003-09-07 Martin Baulig <martin@ximian.com>
15932 * report.cs (Error, Warning): Added overloaded versions which take
15933 a `params object[] args' and call String.Format().
15935 2003-09-07 Martin Baulig <martin@ximian.com>
15937 * decl.cs (DeclSpace..ctor): Don't call
15938 NamespaceEntry.DefineName() here; do it in RecordDecl() which is
15939 called from Tree.RecordDecl(). Fixes the CS0101 reporting.
15940 (DeclSpace.RecordDecl): New method.
15942 * tree.cs (Tree.RecordDecl): Call ds.RecordDecl().
15944 2003-09-02 Ravi Pratap <ravi@ximian.com>
15946 * attribute.cs (CheckAttributeTarget): Ensure that we allow return
15947 value attributes to be applied to ParameterBuilders.
15949 * class.cs (MethodCore.LabelParameters): Make static and more
15950 generic so that it can be used from other places - like interface
15951 methods, for instance.
15953 * interface.cs (Interface.Emit): Call LabelParameters before
15954 emitting attributes on the InterfaceMethod.
15956 2003-08-26 Martin Baulig <martin@ximian.com>
15958 * ecore.cs (SimpleName.SimpleNameResolve): Look for members before
15959 resolving aliases; fixes #47927.
15961 2003-08-26 Martin Baulig <martin@ximian.com>
15963 * statement.cs (Using.DoResolve): This is internally emitting a
15964 try/finally clause, so we need to set ec.NeedExplicitReturn if we
15965 do not always return. Fixes #47681.
15967 2003-08-26 Martin Baulig <martin@ximian.com>
15969 * decl.cs (MemberCore): Moved WarningNotHiding(),
15970 Error_CannotChangeAccessModifiers() and CheckMethodAgainstBase()
15972 (AdditionResult): Make this nested in DeclSpace.
15973 (DeclSpace.ctor): The .ctor now takes an additional NamespaceEntry
15974 argument; call NamespaceEntry.Define() unless we're nested in a
15977 * namespace.cs (Namespace.DefineName): New public function. This
15978 is called from DeclSpace's .ctor to add
15979 (Namespace.Lookup): Include DeclSpaces in the lookup.
15981 * class.cs (Operator): Derive from MemberBase, not MemberCore.
15983 * const.cs (Const): Derive from MemberBase, not MemberCore.
15985 2003-08-25 Martin Baulig <martin@ximian.com>
15987 * convert.cs (Convert.ExplicitReferenceConversion): When
15988 converting from an interface type to a class, unbox if the target
15989 type is a struct type. Fixes #47822.
15991 2003-08-24 Gonzalo Paniagua Javier <gonzalo@ximian.com>
15993 * typemanager.cs: fixed the values of MethodFlags. Closes #47855 and
15996 2003-08-22 Martin Baulig <martin@ximian.com>
15998 * class.cs (TypeManager.DefineType): When defining a nested type,
15999 call DefineType() on our parent; fixes #47801.
16001 2003-08-22 Martin Baulig <martin@ximian.com>
16003 * class.cs (MethodData.Define): While checking if a method is an
16004 interface implementation, improve the test a bit more to fix #47654.
16006 2003-08-22 Martin Baulig <martin@ximian.com>
16008 * expression.cs (Probe.DoResolve): Check whether `expr' resolved
16009 correctly; fixes #47722.
16011 2003-08-22 Martin Baulig <martin@ximian.com>
16013 * expression.cs (UnaryMutator.ResolveVariable): If the target is a
16014 LocalVariableReference, ensure it's not read-only. Fixes #47536.
16016 * statement.cs (Fixed.DoResolve): Make all variables read-only.
16018 2003-08-22 Martin Baulig <martin@ximian.com>
16020 * ecore.cs (FieldExpr.DoResolveLValue): Static read-only fields
16021 can only be assigned in static constructors. Fixes #47161.
16023 2003-08-22 Martin Baulig <martin@ximian.com>
16025 Rewrote and improved the flow analysis code.
16027 * flowbranching.cs (FlowBranching): Make this class abstract.
16028 (FlowBranching.CreateBranching): New static function to create a
16029 new flow branching.
16030 (FlowBranchingBlock, FlowBranchingException): New classes.
16031 (FlowBranching.UsageVector.Type): New public readonly field.
16032 (FlowBranching.UsageVector.Breaks): Removed the setter.
16033 (FlowBranching.UsageVector.Returns): Removed the setter.
16034 (FlowBranching.UsageVector): Added Break(), Return(),
16035 NeverReachable() and Throw() methods to modify the reachability.
16036 (FlowBranching.UsageVector.MergeChildren): Removed, this is now
16037 done by FlowBranching.Merge().
16038 (FlowBranching.UsageVector.MergeChild): New method; merges the
16039 merge result into the current vector.
16040 (FlowBranching.Merge): New abstract method to merge a branching.
16042 2003-08-12 Martin Baulig <martin@ximian.com>
16044 * expression.cs (Indirection.CacheTemporaries): Create the
16045 LocalTemporary with the pointer type, not its element type.
16047 2003-08-10 Miguel de Icaza <miguel@ximian.com>
16049 * cs-parser.jay: FIRST_KEYWORD, LAST_KEYWORD: used to know if a
16050 token was a keyword or not.
16052 Add `error' options where an IDENTIFIER was expected; Provide
16053 CheckToken and CheckIdentifierToken convenience error reporting
16056 Do not use `DeclSpace.Namespace', use `DeclSpace.NamespaceEntry'.
16058 * decl.cs: Rename `NamespaceEntry Namespace' public field into
16059 NameSpaceEntry NameSpaceEntry.
16061 (LookupInterfaceOrClass): Avoid creating a full qualified name
16062 from namespace and name: avoid doing lookups when we know the
16063 namespace is non-existant. Use new Tree.LookupByNamespace which
16064 looks up DeclSpaces based on their namespace, name pair.
16066 * driver.cs: Provide a new `parser verbose' to display the
16067 exception thrown during parsing. This is turned off by default
16068 now, so the output of a failure from mcs is more graceful.
16070 * namespace.cs: Track all the namespaces defined in a hashtable
16073 (IsNamespace): New method
16075 2003-08-09 Miguel de Icaza <miguel@ximian.com>
16077 * namespace.cs: Remove redundant call; Avoid using MakeFQN when
16078 we know that we need to concatenate (full typename can never be
16083 * statement.cs: Use a bitfield; Do not initialize to null things
16084 which are done by the constructor by default.
16086 * cs-parser.jay: bug fix, parameter was 4, not 3.
16088 * expression.cs: Just use the property;
16090 * statement.cs: No need for GetVariableInfo method.
16092 2003-08-08 Martin Baulig <martin@ximian.com>
16094 * flowanalysis.cs (FlowReturns): This is now nested in the
16095 `FlowBranching' class.
16096 (MyBitVector): Moved this here from statement.cs.
16097 (FlowBranching.SiblingType): New enum type.
16098 (FlowBranching.CreateSibling): Added `SiblingType' argument.
16100 2003-08-07 Martin Baulig <martin@ximian.com>
16102 * flowanalysis.cs (FlowBranchingType): This is now nested in the
16103 `FlowBranching' class and called `BranchingType'.
16105 2003-08-07 Martin Baulig <martin@ximian.com>
16107 * flowanalysis.cs: Moved all the control flow analysis code into
16110 2003-08-07 Martin Baulig <martin@ximian.com>
16112 * assign.cs (Assign.DoResolve): `target' must either be an
16113 IAssignMethod or an EventAccess; report a CS0131 otherwise. Fixes
16116 2003-08-07 Miguel de Icaza <miguel@ximian.com>
16118 * expression.cs (BinaryMethod): This kind of expression is created by the
16119 Binary class if it determines that the operator has to be handled
16122 (BinaryDelegate): This kind of expression is created if we are
16123 dealing with a + or - operator on delegates.
16125 (Binary): remove method, argumetns, and DelegateOperator: when
16126 dealing with methods,
16128 * ecore.cs (EventExpr.EmitAddOrRemove): Update to new layout.
16130 * statement.cs (Block): use bitfields for the three extra booleans
16131 we had in use. Remove unused topblock parameter.
16133 * codegen.cs: Remove unecessary argument to Block.EmitTopBlock
16135 * assign.cs: Drop extra unneeded tests.
16137 2003-08-06 Miguel de Icaza <miguel@ximian.com>
16139 * iterators.cs (Mapvariable): provide a mechanism to use prefixes.
16141 * statement.cs (Foreach): Use VariableStorage instead of
16144 * codegen.cs (VariableStorage): New class used by clients that
16145 require a variable stored: locals or fields for variables that
16146 need to live across yield.
16148 Maybe provide a convenience api for EmitThis+EmitLoad?
16150 (GetTemporaryLocal, FreeTemporaryLocal): Recycle
16153 2003-08-05 Miguel de Icaza <miguel@ximian.com>
16155 * codegen.cs (RemapLocal, RemapLocalLValue, RemapParameter,
16156 RemapParameterLValue): New methods that are used to turn a
16157 precomputed FieldInfo into an expression like this:
16161 The idea is to use this instead of making LocalVariableReference
16162 have more than one meaning.
16164 * cs-parser.jay: Add error production to BASE.
16166 * ecore.cs: Deal with TypeManager.GetField returning null, which
16167 is now a valid return value.
16169 (FieldExprNoAddress): New expression for Fields whose address can
16172 * expression.cs (LocalVariableReference): During the resolve
16173 phases, create new expressions if we are in a remapping context.
16174 Remove code that dealt with remapping here.
16176 (ParameterReference): same.
16178 (ProxyInstance): New expression, like the `This' expression, but
16179 it is born fully resolved. We know what we are doing, so remove
16180 the errors that are targeted to user-provided uses of `this'.
16182 * statement.cs (Foreach): our variable is now stored as an
16183 Expression; During resolution, follow the protocol, dont just
16184 assume it will return this.
16186 2003-08-06 Martin Baulig <martin@ximian.com>
16188 * support.cs (SeekableStreamReader.cs): New public class.
16190 * cs-tokenizer.cs, cs-parser.jay, driver.cs: Use the new
16191 SeekableStreamReader instead of the normal StreamReader.
16193 2003-08-04 Martin Baulig <martin@ximian.com>
16195 * cs-parser.jay (CLOSE_PARENS_CAST, CLOSE_PARENS_NO_CAST,
16196 CLOSE_PARENS_OPEN_PARENS, CLOSE_PARENS_MINUS): New tokens to
16197 deambiguate casts and delegate invocations.
16198 (parenthesized_expression): Use the new tokens to ensure this is
16199 not a cast of method invocation.
16201 * cs-tokenizer.cs (is_punct): Return one of the new special tokens
16202 when reading a `)' and Deambiguate_CloseParens () was previously
16205 * expression.cs (ParenthesizedExpression): New class. This is
16206 just used for the CS0075 test.
16207 (Binary.DoResolve): Check for CS0075.
16209 2003-07-29 Ravi Pratap <ravi@ximian.com>
16211 * expression.cs (Invocation.MakeUnionSet): Patch from Lluis
16212 Sanchez : use TypeManager.ArrayContainsMethod instead of a direct
16213 reference comparison.
16215 (TypeManager.ArrayContainsMethod): When we have a MethodInfo, also
16216 examine the ReturnType for equality - this is necessary in the
16217 cases of implicit and explicit operators whose signature also
16218 includes the return type.
16220 2003-07-26 Miguel de Icaza <miguel@ximian.com>
16222 * namespace.cs: Cache the result of the namespace computation,
16223 instead of computing it every time.
16225 2003-07-24 Miguel de Icaza <miguel@ximian.com>
16227 * decl.cs: Use a global arraylist that we reuse over invocations
16228 to avoid excesive memory consumption. Reduces memory usage on an
16229 mcs compile by one meg (45 average).
16231 * typemanager.cs (LookupTypeReflection): In .NET pointers are
16232 private, work around that.
16234 2003-07-23 Miguel de Icaza <miguel@ximian.com>
16236 * literal.cs (IntLiteral): Define Zero and One static literals.
16238 * cs-parser.jay (integer_literal): use static literals to reduce
16239 memory usage for the most used literals (0, 1 and -1). 211kb
16240 reduced in memory usage.
16242 Replace all calls to `new ArrayList' with `new
16243 ArrayList(4)' which is a good average number for most allocations,
16244 and also requires only 16 bytes of memory for its buffer by
16247 This reduced MCS memory usage in seven megabytes for the RSS after
16250 2003-07-28 Ravi Pratap <ravi@ximian.com>
16252 * expression.cs (Invocation.OverloadResolve): Fix the algorithm to
16253 handle params methods the correct way by forming only one
16254 applicable set with params and normal methods in them. Earlier we
16255 were looking at params methods only if we found no normal methods
16256 which was not the correct thing to do.
16258 (Invocation.BetterFunction): Take separate arguments indicating
16259 when candidate and the best method are params methods in their
16262 This fixes bugs #43367 and #46199.
16264 * attribute.cs: Documentation updates.
16266 (CheckAttribute): Rename to CheckAttributeTarget.
16267 (GetValidPlaces): Rename to GetValidTargets.
16269 * expression.cs (Invocation.IsParamsMethodApplicable): Fix trivial
16270 bug - use Convert.ImplicitConversion, not ImplicitUserConversion!
16274 2003-07-28 Martin Baulig <martin@ximian.com>
16276 * class.cs (TypeContainer.DefineMembers): Use the base type's full
16277 name when looking up the base class of a nested class. Fixes #46977.
16279 2003-07-26 Martin Baulig <martin@ximian.com>
16281 * expression.cs (Indexers.Indexer): New nested struct; contains
16282 getter, setter and the indexer's type.
16283 (Indexers.Properties): This is now an ArrayList of
16284 Indexers.Indexer's.
16285 (IndexerAccess.DoResolveLValue): Correctly set the type if the
16286 indexer doesn't have any getters.
16288 * assign.cs (Assign.DoResolve): Also do the implicit conversions
16289 for embedded property and indexer assignments.
16291 2003-07-26 Martin Baulig <martin@ximian.com>
16293 * cs-tokenizer.cs (Tokenizer.xtoken): Report a CS1040 if a
16294 preprocessor directive is not the first non-whitespace character
16297 2003-07-26 Martin Baulig <martin@ximian.com>
16299 * namespace.cs (NamespaceEntry.Lookup): New method; rewrote the
16300 namespace parsing, follow the spec more closely.
16302 * rootcontext.cs (RootContext.NamespaceLookup): Use the new
16303 NamespaceEntry.Lookup().
16305 2003-07-25 Martin Baulig <martin@ximian.com>
16307 * MethodCore.cs (OverridesSomething): New public field; it's set
16308 from TypeContainer.DefineMembers if this method overrides
16309 something (which doesn't need to be a method). Fix #39462.
16311 2003-07-25 Ravi Pratap <ravi@ximian.com>
16313 * typemanager.cs (GetMembers): Ensure that the list of members is
16314 reversed. This keeps things in sync.
16316 * attribute.cs (Attribute.CheckAttribute): Break as soon as we
16317 find an AttributeUsage attribute.
16319 * expression.cs (Invocation.OverloadResolve): Perform the check
16320 which disallows Invoke to be directly called on a Delegate.
16322 (Error_InvokeOnDelegate): Report error cs1533.
16324 2003-07-25 Martin Baulig <martin@ximian.com>
16326 * expression.cs (Indexers.GetIndexersForType): Only look in the
16327 interface hierarchy if the requested type is already an
16328 interface. Fixes #46788 while keeping #46502 fixed.
16330 2003-07-25 Martin Baulig <martin@ximian.com>
16332 * class.cs (TypeContainer.DefineMembers): Check whether all
16333 readonly fields have been assigned and report warning CS0649 if
16336 * statement.cs (LocalInfo.IsFixed): Always return true if this is
16339 2003-07-24 Ravi Pratap <ravi@ximian.com>
16341 * decl.cs (MemberCache.AddMethods): Reverse the order of the array
16342 returned from GetMethods to make things consistent with the
16343 assumptions MCS makes about ordering of methods.
16345 This should comprehensively fix bug #45127 and it does :-)
16347 * ecore.cs (MethodGroupExpr.DeclaringType): Correct bug - the
16348 ordering is actually reverse.
16350 * Clean up some debug messages I left lying around.
16352 * interface.cs (Populate*): Get rid of code which emits attributes
16353 since the stage in which we emit attributes is the 'Emit' stage,
16354 not the define stage.
16356 (Emit): Move attribute emission for interface members here.
16358 2003-07-22 Ravi Pratap <ravi@ximian.com>
16360 * expression.cs (Invocation.OverloadResolve): Follow the spec more
16361 closely: we eliminate methods in base types when we have an
16362 applicable method in a top-level type.
16364 Please see section 14.5.5.1 for an exact description of what goes
16367 This fixes bug #45127 and a host of other related to corlib compilation.
16369 * ecore.cs (MethodGroupExpr.DeclaringType): The element in the
16370 array is the method corresponding to the top-level type (this is
16371 because of the changes made to icall.c) so we change this
16374 (MethodGroupExpr.Name): This too.
16376 * typemanager.cs (GetElementType): New method which does the right
16377 thing when compiling corlib.
16379 * everywhere: Make use of the above in the relevant places.
16381 2003-07-22 Martin Baulig <martin@ximian.com>
16383 * cs-parser.jay (invocation_expression): Moved
16384 `OPEN_PARENS expression CLOSE_PARENS unary_expression' here from
16385 `cast_expression', but create a InvocationOrCast which later
16386 resolves to either an Invocation or a Cast.
16388 * ecore.cs (ExpressionStatement.ResolveStatement): New virtual
16389 method; call this before EmitStatement() to make sure that this
16390 expression can be used as a statement.
16392 * expression.cs (InvocationOrCast): New class; resolves to either
16393 an Invocation or a Cast.
16395 * statement.cs (StatementExpression): Call ResolveStatement() on
16396 the ExpressionStatement before emitting it.
16398 2003-07-21 Martin Baulig <martin@ximian.com>
16400 * expression.cs (Invocation.VerifyArgumentsCompat): Check whether
16401 `ref' and `out' attributes match; fixes #46220.
16402 (MemberAccess.ResolveMemberAccess): You can't reference a type
16403 through an expression; fixes #33180.
16404 (Indexers.GetIndexersForType): Don't return the indexers from
16405 interfaces the class implements; fixes #46502.
16407 2003-07-21 Martin Baulig <martin@ximian.com>
16409 * class.cs (TypeContainer.CheckPairedOperators): Added CS0660 and
16410 CS0661 checks; fixes bug #30442.
16412 2003-07-21 Martin Baulig <martin@ximian.com>
16414 * decl.cs (AdditionResult): Added `Error'.
16416 * enum.cs (AddEnumMember): Report a CS0076 if name is `value__'.
16418 * typemanager.cs (TypeManager.ChangeType): Catch exceptions;
16419 makes cs0031.cs actually work.
16421 2003-07-20 Martin Baulig <martin@ximian.com>
16423 * namespace.cs: Fixed that bug which caused a crash when compiling
16424 the debugger's GUI.
16426 2003-07-20 Miguel de Icaza <miguel@ximian.com>
16428 * typemanager.cs (LookupTypeReflection): Never expose types which
16429 are NotPublic, NestedPrivate, NestedAssembly, or
16430 NestedFamANDAssem. We used to return these, and later do a check
16431 that would report a meaningful error, but the problem is that we
16432 would not get the real match, if there was a name override.
16434 2003-07-18 Miguel de Icaza <miguel@ximian.com>
16436 * namespace.cs (Namespace, Name): Do not compute the namespace
16437 name dynamically, compute it in the constructor. This reduced
16438 memory usage by 1697 KB.
16440 * driver.cs: Use --pause to pause at the end.
16442 2003-07-17 Peter Williams <peter@newton.cx>
16444 * Makefile: Change the name of the test target so that it doesn't
16445 conflict with the recursive test target.
16447 2003-07-17 Miguel de Icaza <miguel@ximian.com>
16449 * expression.cs (LocalVariableReference.Emit, EmitAssign,
16450 AddressOf): Do not use EmitThis, that was wrong, use the actual
16453 2003-07-15 Miguel de Icaza <miguel@ximian.com>
16455 * class.cs (MethodData.Define): While checking if a method is an
16456 interface implementation, improve the test: If we are not public
16457 (use new test here: use the computed MethodAttributes directly,
16458 instead of the parsed modifier flags) check if the `implementing'
16459 method comes from an interface or not.
16461 * pending.cs (VerifyPendingMethods): Slightly better error
16464 * makefile: add test target that does the mcs bootstrap.
16466 2003-07-16 Ravi Pratap <ravi@ximian.com>
16468 * interface.cs (Define): Do nothing here since there are no
16469 members to populate etc. Move the attribute emission out of here
16470 since this was just totally the wrong place to put it. Attribute
16471 application happens during the 'Emit' phase, not in the 'Define'
16474 (Emit): Add this method and move the attribute emission here
16476 * rootcontext.cs (EmitCode): Call the Emit method on interface
16479 2003-07-14 Ravi Pratap M <ravi@ximian.com>
16481 * expression.cs (OverloadResolve): Report error only if Location
16482 is not 'Null' which means that there was a probe going on.
16484 2003-07-14 Martin Baulig <martin@ximian.com>
16486 * expression.cs (ConditionalLogicalOperator): New public class to
16487 implement user defined conditional logical operators.
16488 This is section 14.11.2 in the spec and bug #40505.
16490 2003-07-14 Martin Baulig <martin@ximian.com>
16492 * ecore.cs (FieldExpr.DoResolveLValue): Fixed bug #46198.
16494 2003-07-14 Martin Baulig <martin@ximian.com>
16496 * codegen.cs (EmitContext.InFixedInitializer): New public field.
16498 * ecore.cs (IVariable.VerifyFixed): New interface method.
16500 * expression.cs (Unary.ResolveOperator): When resolving the `&'
16501 operator, check whether the variable is actually fixed. Fixes bug
16502 #36055. Set a variable definitely assigned when taking its
16503 address as required by the spec.
16505 * statement.cs (LocalInfo.IsFixed): New field.
16506 (LocalInfo.MakePinned): Set `IsFixed' to true.
16508 2003-07-14 Ravi Pratap M <ravi@ximian.com>
16510 * attribute.cs (Attribute.Resolve): While doing a Member lookup
16511 for .ctors, ensure that we only ask for members declared in the
16512 attribute type (BindingFlags.DeclaredOnly).
16516 * expression.cs (Error_WrongNumArguments): Report error 1501
16517 correctly the way CSC does.
16519 2003-07-13 Martin Baulig <martin@ximian.com>
16521 * expression.cs (MemberAccess.ResolveAsTypeStep): Try to do a type
16522 lookup on the fully qualified name, to make things like "X.X" work
16523 where "X.X" is a fully qualified type name, but we also have a
16524 namespace "X" in the using list. Fixes #41975.
16526 2003-07-13 Martin Baulig <martin@ximian.com>
16528 * assign.cs (Assign.GetEmbeddedAssign): New protected virtual
16529 function. If we're a CompoundAssign, we need to create an embedded
16530 CompoundAssign, not an embedded Assign.
16531 (Assign.DoResolve): Make this work for embedded CompoundAssign's.
16534 2003-07-13 Martin Baulig <martin@ximian.com>
16536 * typemanager.cs (TypeManager.IsNestedChildOf): Make this actually
16537 work to fix bug #46088.
16539 2003-07-13 Ravi Pratap <ravi@ximian.com>
16541 * class.cs (Operator.Emit): Do not emit attributes here - it is
16542 taken care of by the Method class that we delegate too. This takes
16543 care of bug #45876.
16545 2003-07-10 Martin Baulig <martin@ximian.com>
16547 * expression.cs (TypeOfVoid): New class.
16548 (TypeOf): Report a CS0673 if it's System.Void. Fixes #42264.
16550 2003-07-10 Martin Baulig <martin@ximian.com>
16552 * class.cs (MethodCore.DoDefineParameters): Added CS0225 check;
16555 2003-07-10 Martin Baulig <martin@ximian.com>
16557 * rootcontext.cs (RootContext.NamespaceLookup): Take a DeclSpace,
16558 not a NamespaceEntry, so we can use DeclSpace.CheckAccessLevel().
16560 * decl.cs (DeclSpace.FindType): Use DeclSpace.CheckAccessLevel().
16562 * typemanager.cs (TypeManager.IsAccessibleFrom): Removed.
16564 2003-07-10 Martin Baulig <martin@ximian.com>
16566 * expression.cs (ArrayCreation): Don't use a byte blob for arrays
16567 of decimal. Fixes #42850.
16569 NOTE: I also fixed the created byte blob, but this doesn't work on
16570 the MS runtime and csc never produces any byte blobs for decimal
16573 2003-07-10 Martin Baulig <martin@ximian.com>
16575 * statement.cs (StructInfo.GetStructInfo): Catch deep cycles in
16576 structs; fixes #32068.
16577 (Block.AddChildVariableNames): Fixed #44302.
16579 2003-07-07 Gonzalo Paniagua Javier <gonzalo@ximian.com>
16581 * namespace.cs: fixed compilation with csc. It's bugzilla #44302.
16583 2003-07-07 Miguel de Icaza <miguel@ximian.com>
16585 * attribute.cs: And this test is onger needed.
16587 2003-07-08 Martin Baulig <martin@ximian.com>
16589 * rootcontext.cs (RootContext.NamespaceLookup): Ignore
16590 inaccessible types. Fixes #36313.
16592 * decl.cs (DeclSpace.FindType): Ignore inaccessible types.
16594 * namespace.cs (NamespaceEntry): Create implicit entries for all
16595 namespaces; ie. if we have `namespace N1.N2.N3 { ... }', we create
16596 implicit entries for N1.N2 and N1.
16598 2003-07-08 Martin Baulig <martin@ximian.com>
16600 Rewrote the handling of namespaces to fix a lot of the issues
16601 wrt. `using' aliases etc.
16603 * namespace.cs (Namespace): Splitted this class into a
16604 per-assembly `Namespace' and a per-file `NamespaceEntry'.
16606 * typemanager.cs (TypeManager.IsNamespace): Removed.
16607 (TypeManager.ComputeNamespaces): Only compute namespaces from
16608 loaded assemblies here, not the namespaces from the assembly we're
16609 currently compiling.
16611 2003-07-08 Martin Baulig <martin@ximian.com>
16613 * rootcontext.cs, class.cs: Fixed the CS1530 reporting.
16615 2003-07-07 Miguel de Icaza <miguel@ximian.com>
16617 * typemanager.cs: Reverted patch from Gonzalo, my previous patch
16620 I thought about the memory savings here, but LookupTypeReflection
16621 is used under already very constrained scenarios. Compiling
16622 corlib or mcs only exposes one hit, so it would not really reduce
16623 any memory consumption.
16625 2003-07-07 Gonzalo Paniagua Javier <gonzalo@ximian.com>
16627 * typemanager.cs: fixes bug #45889 by only adding public types from
16628 other assemblies to the list of known types.
16630 2003-07-07 Miguel de Icaza <miguel@ximian.com>
16632 * attribute.cs (Attribute.Resolve): Add call to CheckAccessLevel
16633 on the type we resolved.
16635 2003-07-05 Martin Baulig <martin@ximian.com>
16637 * pending.cs (PendingImplementation.ParentImplements): Don't
16638 create the proxy if the parent is abstract.
16640 * class.cs (TypeContainer.DefineIndexers): Process explicit
16641 interface implementations first. Fixes #37714.
16643 2003-07-04 Miguel de Icaza <miguel@ximian.com>
16645 * expression.cs (MemberAccess.ResolveMemberAccess): Events are
16646 defined recursively; but since we modify the input parameters
16647 (left is set to `this' temporarily), we reset this value if the
16648 left_is_explicit is false, which gives the original semantics to
16651 * literal.cs (NullPointer): new class used to represent a null
16652 literal in a pointer context.
16654 * convert.cs (Convert.ImplicitReferenceConversion): Is the target
16655 type is a pointer, use a NullPointer object instead of a
16656 NullLiteral. Closes 43687
16658 (ExplicitConversion): Convert pointer values using
16659 the conv opcode to the proper type.
16661 * ecore.cs (New): change ValueTypeVariable property into a method,
16662 that returns whether the valuetype is suitable for being used.
16664 * expression.cs (Binary.DoNumericPromotions): Only return if we
16665 the int constant was a valid uint, and we can return both left and
16666 right as uints. If not, we continue processing, to trigger the
16667 type conversion. This fixes 39018.
16669 * statement.cs (Block.EmitMeta): During constant resolution, set
16670 the CurrentBlock property on the emitcontext, so that we resolve
16671 constants propertly.
16673 2003-07-02 Martin Baulig <martin@ximian.com>
16675 * codegen.cs (EmitContext.NeedExplicitReturn): New public variable.
16676 (EmitContext.EmitTopBlock): Emit an explicit return if it's set.
16678 * statement.cs (Try.Resolve): Set ec.NeedExplicitReturn rather
16679 than emitting it here.
16681 * statement.cs: Fixed some more flow analysis bugs.
16683 2003-07-02 Martin Baulig <martin@ximian.com>
16685 * class.cs (MethodData.Define): When implementing interface
16686 methods, set Final unless we're Virtual.
16688 * decl.cs (MemberCore.CheckMethodAgainstBase): Make the CS0506
16689 check work for interface methods.
16691 2003-07-01 Martin Baulig <martin@ximian.com>
16693 * ecore.cs (EmitContext.This): Replaced this property with a
16694 GetThis() method which takes a Location argument. This ensures
16695 that we get the correct error location for a CS0188.
16697 2003-07-01 Miguel de Icaza <miguel@ximian.com>
16699 * ecore.cs: (Convert.ConvertIntLiteral): Add test for
16700 ImplicitStandardConversion.
16702 * class.cs (TypeContainer.GetClassBases): Small bug fix for 45649.
16704 2003-07-01 Zoltan Varga <vargaz@freemail.hu>
16706 * expression.cs (ResolveOperator): Fix Concat (string, string, string)
16709 2003-06-30 Miguel de Icaza <miguel@ximian.com>
16711 * class.cs (Constructor.Define): Turn off initlocals for unsafe
16714 (MethodData.Define): Turn off initlocals for unsafe methods.
16716 2003-06-29 Miguel de Icaza <miguel@ximian.com>
16718 * decl.cs (DeclSpace.CheckAccessLevel): Make this routine
16719 complete; Fixes #37521.
16721 * delegate.cs: Use Modifiers.TypeAttr to compute the
16722 TypeAttributes, instead of rolling our own. This makes the flags
16723 correct for the delegates.
16725 2003-06-28 Miguel de Icaza <miguel@ximian.com>
16727 * class.cs (Constructor.Define): Set the private flag for static
16728 constructors as well.
16730 * cs-parser.jay (statement_expression): Set the return value to
16731 null, to avoid a crash when we catch an error.
16733 2003-06-24 Miguel de Icaza <miguel@ximian.com>
16735 * cs-parser.jay: Applied patch from Jackson that adds support for
16736 extern and unsafe modifiers to destructor declarations.
16738 * expression.cs: Report error 21 if the user is trying to index a
16741 * driver.cs: Add an error message, suggested by the bug report.
16743 * class.cs (TypeContainer.Emit): Only call EmitFieldInitializers
16744 if we do not have a ": this ()" constructor initializer. Fixes 45149
16746 2003-06-14 Miguel de Icaza <miguel@ximian.com>
16748 * namespace.cs: Add some information to reduce FAQs.
16750 2003-06-13 Miguel de Icaza <miguel@ximian.com>
16752 * cfold.cs (BinaryFold): BitwiseAnd, BitwiseOr: handle other
16753 underlying enumeration types. Fixes #43915.
16755 * expression.cs: Treat ushort/short as legal values to be used in
16756 bitwise operations.
16758 Wed Jun 4 13:19:04 CEST 2003 Paolo Molaro <lupus@ximian.com>
16760 * delegate.cs: transfer custom attributes for paramenters from
16761 the delegate declaration to Invoke and BeginInvoke.
16763 Tue Jun 3 11:11:08 CEST 2003 Paolo Molaro <lupus@ximian.com>
16765 * attribute.cs: handle custom marshalers and emit marshal info
16768 2003-05-28 Hector E. Gomez Morales <hgomez_36@flashmail.com>
16770 * makefile.gnu: Added anonymous.cs to the compiler sources.
16772 2003-05-28 Miguel de Icaza <miguel@ximian.com>
16774 * iterators.cs: Change the name of the proxy class to include two
16777 * cs-parser.jay: Update grammar to include anonymous methods.
16779 * anonymous.cs: new file.
16781 2003-05-27 Miguel de Icaza <miguel@ximian.com>
16783 * class.cs (Field.Define): Add missing test for pointers and
16786 2003-05-27 Ravi Pratap <ravi@ximian.com>
16788 * expression.cs (ArrayAccess.GetStoreOpCode): For System.IntPtr,
16789 we use the stobj opcode.
16791 (ArrayCreation.EmitDynamicInitializers): Revert Miguel's patch
16792 since it wasn't the correct fix.
16794 It still is puzzling that we are required to use stobj for IntPtr
16795 which seems to be a ValueType.
16797 2003-05-26 Miguel de Icaza <miguel@ximian.com>
16799 * ecore.cs (SimpleName.SimpleNameResolve): Consider using aliases
16800 during regular simple name resolution. Now, the trick is that
16801 instead of returning for processing the simplename, we do a
16802 TypeManager.LookupType (ie, a rooted lookup as opposed to a
16803 contextual lookup type). If a match is found, return that, if
16804 not, return for further composition.
16806 This fixes long-standing 30485.
16808 * expression.cs (ArrayCreation.EmitDynamicInitializers): When
16809 using the address to initialize an object, do an Stobj instead of
16810 using the regular Stelem.
16812 (IndexerAccess.Emit, IndexerAccess.EmitAssign):
16813 Pass `is_base_indexer' to Invocation.EmitCall instead of false.
16814 Because if we are a BaseIndexerAccess that value will be true.
16817 * statement.cs (GotoCase.Resolve): Return after reporting an
16818 error, do not attempt to continue.
16820 * expression.cs (PointerArithmetic.Emit): If our operand is a
16821 long, convert our constants to match the operand before
16822 multiplying. Convert to I type before adding. Fixes 43670.
16824 2003-05-14 Ravi Pratap <ravi@ximian.com>
16826 * enum.cs (ImplicitConversionExists) : Rename to
16827 ImplicitEnumConversionExists to remove ambiguity.
16829 * ecore.cs (NullCast): New type of cast expression class which
16830 basically is very similar to EmptyCast with the difference being
16831 it still is a constant since it is used only to cast a null to
16833 (eg. (string) null)
16835 * convert.cs (ImplicitReferenceConversion): When casting a null
16836 literal, we return a NullCast.
16838 * literal.cs (NullLiteralTyped): Remove - I don't see why this
16839 should be around anymore.
16841 The renaming (reported was slightly wrong). Corrections:
16843 ConvertImplicitStandard -> ImplicitConversionStandard
16844 ConvertExplicitStandard -> ExplicitConversionStandard
16846 * expression.cs (StaticCallExpr.MakeSimpleCall): Resolve arguments
16847 before passing them in !
16849 * convert.cs (ImplicitConversionStandard): When comparing for
16850 equal expr and target types, ensure that expr is not a
16853 In general, we must not be checking (expr_type ==
16854 target_type) in the top level conversion methods
16855 (ImplicitConversion, ExplicitConversion etc). This checking is
16856 done in the methods that they delegate to.
16858 2003-05-20 Miguel de Icaza <miguel@ximian.com>
16860 * convert.cs: Move Error_CannotConvertType,
16861 ImplicitReferenceConversion, ImplicitReferenceConversionExists,
16862 ImplicitNumericConversion, ImplicitConversionExists,
16863 ImplicitUserConversionExists, StandardConversionExists,
16864 FindMostEncompassedType, FindMostSpecificSource,
16865 FindMostSpecificTarget, ImplicitUserConversion,
16866 ExplicitUserConversion, GetConversionOperators,
16867 UserDefinedConversion, ConvertImplicit, ConvertImplicitStandard,
16868 TryImplicitIntConversion, Error_CannotConvertImplicit,
16869 ConvertImplicitRequired, ConvertNumericExplicit,
16870 ExplicitReferenceConversionExists, ConvertReferenceExplicit,
16871 ConvertExplicit, ConvertExplicitStandard from the ecore.cs into
16874 Perform the following renames:
16876 StandardConversionExists -> ImplicitStandardConversionExists
16877 ConvertImplicit -> ImplicitConversion
16878 ConvertImplicitStandard -> ImplicitStandardConversion
16879 TryImplicitIntConversion -> ImplicitIntConversion
16880 ConvertImplicitRequired -> ImplicitConversionRequired
16881 ConvertNumericExplicit -> ExplicitNumericConversion
16882 ConvertReferenceExplicit -> ExplicitReferenceConversion
16883 ConvertExplicit -> ExplicitConversion
16884 ConvertExplicitStandard -> ExplicitStandardConversion
16886 2003-05-19 Martin Baulig <martin@ximian.com>
16888 * statement.cs (TypeInfo.StructInfo): Made this type protected.
16889 (TypeInfo): Added support for structs having structs as fields.
16891 * ecore.cs (FieldExpr): Implement IVariable.
16892 (FieldExpr.DoResolve): Call VariableInfo.GetSubStruct() to get the
16893 VariableInfo for the field.
16895 2003-05-18 Martin Baulig <martin@ximian.com>
16897 * expression.cs (This.DoResolve): Report a CS0027 if we're
16898 emitting a field initializer.
16900 2003-05-18 Martin Baulig <martin@ximian.com>
16902 * expression.cs (This.ResolveBase): New public function.
16903 (This.DoResolve): Check for CS0188.
16905 * codegen.cs (EmitContext.This): Just call This.ResolveBase(), not
16908 * ecore.cs (MethodGroupExpr.DoResolve): Set the
16909 `instance_expression' to null if we don't have any non-static
16912 2003-05-18 Martin Baulig <martin@ximian.com>
16914 Reworked the way how local variables and parameters are handled by
16915 the flow analysis code.
16917 * statement.cs (TypeInfo, VariableMap): New public classes.
16918 (VariableInfo): New public class. This is now responsible for
16919 checking whether a variable has been assigned. It is used for
16920 parameters and local variables.
16921 (Block.EmitMeta): Take the InternalParameters as argument; compute
16922 the layout of the flow vectors here.
16923 (Block.LocalMap, Block.ParameterMap): New public properties.
16924 (FlowBranching): The .ctor doesn't get the InternalParameters
16925 anymore since Block.EmitMeta() now computes the layout of the flow
16927 (MyStructInfo): This class is now known as `StructInfo' and nested
16928 in `TypeInfo'; we don't access this directly anymore.
16930 * ecore.cs (IVariable): Added `VariableInfo VariableInfo'
16931 property and removed IsAssigned(), IsFieldAssigned(),
16932 SetAssigned() and SetFieldAssigned(); we now call them on the
16933 VariableInfo so we don't need to duplicate this code everywhere.
16935 * expression.cs (ParameterReference): Added `Block block' argument
16937 (LocalVariableReference, ParameterReference, This): The new
16938 VariableInfo class is now responsible for all the definite
16941 * codegen.cs (EmitContext.IsVariableAssigned, SetVariableAssigned,
16942 IsParameterAssigned, SetParameterAssigned): Removed.
16944 2003-05-18 Martin Baulig <martin@ximian.com>
16946 * typemanager.cs (InitCoreTypes): Try calling
16947 SetCorlibTypeBuilders() with 4 args; if that fails, fall back to
16948 the 3-args-version. Corlib now also needs our `void_type'.
16949 (GetMethod): Added overloaded version which takes an optional
16950 `bool report_errors' to allow lookups of optional methods.
16952 2003-05-12 Martin Baulig <martin@ximian.com>
16954 * statement.cs (VariableInfo): Renamed to LocalInfo since it's
16955 only used for locals and not for parameters.
16957 2003-05-12 Miguel de Icaza <miguel@ximian.com>
16959 * support.cs (InternalParameters.ParameterType): Return the
16960 ExternalType of the parameter.
16962 * parameter.cs (Parameter.ExternalType): drop the two arguments,
16965 2003-05-11 Miguel de Icaza <miguel@ximian.com>
16967 * class.cs (MethodData.Define): Do not set the `newslot' on
16968 interface members, if they are also flagged as "override".
16970 * expression.cs (UnaryMutator.EmitCode): Simple workaround to emit
16971 better code for ++i and i++. This only works for static fields
16972 and local variables.
16974 * typemanager.cs (LookupDeclSpace): Add new method, sometimes we
16975 want to pull the DeclSpace out of the builder_to_declspace instead
16976 of the TypeBuilder (like in TypeContainer.FindMembers).
16978 * class.cs (TypeContainer.FindMembers): Use LookupDeclSpace
16979 instead of LookupTypeContainer. Fixes the crash on .NET for
16980 looking up interface members.
16982 * const.cs: Create our own emit context during the Definition
16983 stage, so that constants are evaluated in the proper context, when
16984 a recursive definition happens.
16986 2003-05-11 Martin Baulig <martin@ximian.com>
16988 * statement.cs (Block.CreateSwitchBlock): New method. Creates a
16989 new block for a switch section.
16990 (Block.AddLabel, Block.LookupLabel): If we're a switch section, do
16991 the adding/lookup in the switch block. Fixes #39828.
16993 2003-05-09 Miguel de Icaza <miguel@ximian.com>
16995 * expression.cs (UnaryMutator.LoadOneAndEmitOp): Missing
16996 functionality: I needed to convert the data after I had performed
16997 the add/sub operation into the operands type size.
16999 * ecore.cs (ImplicitReferenceConversion): When boxing an interface
17000 pass the type for the box operation, otherwise the resulting
17001 object would have been of type object.
17003 (BoxedCast): Add constructor to specify the type to box as.
17005 2003-05-07 Miguel de Icaza <miguel@ximian.com>
17007 * iterators.cs: I was reusing the `count' variable inadvertently,
17008 take steps to not allow this to happen.
17010 2003-05-06 Miguel de Icaza <miguel@ximian.com>
17012 * attribute.cs (Attribute.Resolve): Params attributes are encoded
17013 by creating an array at the point where the params starts and
17014 putting all those arguments there, then adjusting the size of the
17017 2003-05-05 Miguel de Icaza <miguel@ximian.com>
17019 * expression.cs (New.AddressOf): Implement interface
17020 IMemoryLocation. This is used when the `new' operator is used in
17021 the context of an invocation to a method on a value type.
17023 See http://bugzilla.ximian.com/show_bug.cgi?id=#42390 for an
17026 * namespace.cs: Also check the using aliases here.
17028 * driver.cs: Move the test for using validity after the types have
17029 been entered, so we do a single pass that also includes the using
17032 * statement.cs (Try.Resolve): Avoid crashing if there is a failure
17033 in the regular case. CreateSiblingForFinally is doing extra
17036 * attribute.cs (GetAttributeArgumentExpression): Store the result
17037 on an out value, and use the return value to indicate failure
17038 instead of using null (which is a valid return for Constant.GetValue).
17040 * statement.cs: Perform the analysis flow for the increment
17041 portion after the statement, because this will be the real flow of
17042 execution. Fixes #42385
17044 * codegen.cs (EmitContext.EmitArgument,
17045 EmitContext.EmitStoreArgument): New helper functions when the
17046 RemapToProxy flag is set.
17048 * expression.cs (ParameterReference.EmitLdarg): Expose this useful
17051 Add support for remapping parameters.
17053 * iterators.cs: Propagate parameter values; Store parameter
17054 values in the proxy classes.
17056 2003-05-04 Miguel de Icaza <miguel@ximian.com>
17058 * ecore.cs (FieldExpr): Fix an obvious bug. static fields do not
17059 need a proxy reference; I do not know what I was thinking
17061 * cs-parser.jay (constructor_initializer): catch another error,
17062 and display nice message.
17064 (field_declaration): catch void field declaration
17065 to flag a better error.
17067 * class.cs (MemberBase.CheckBase): Report an error instead of a
17068 warning if a new protected member is declared in a struct.
17069 (Field.Define): catch the error of readonly/volatile.
17071 * ecore.cs (FieldExpr.EmitAssign): reuse the field lookup.
17073 (FieldExpr.AddressOf): ditto. Catch error where the address of a
17074 volatile variable is taken
17076 2003-05-02 Miguel de Icaza <miguel@ximian.com>
17078 * statement.cs (Fixed.Resolve): Report an error if we are not in
17081 2003-05-01 Miguel de Icaza <miguel@ximian.com>
17083 * typemanager.cs: reuse the code that handles type clashes for
17084 delegates and enumerations.
17086 * class.cs (Report28): Always report.
17088 * expression.cs (EncodeAsAttribute): Allow nulls here.
17090 2003-04-28 Miguel de Icaza <miguel@ximian.com>
17092 * attribute.cs (Attribute.GetAttributeArgumentExpression): Moved
17093 the functionality for testing whether an expression is valid for
17094 an attribute here. Also handle the case of arrays of elements
17097 * expression.cs (ArrayCreation.EncodeAsAttribute): Add support for
17098 encoding a linear array into an array of objects that are suitable
17099 to be passed to an CustomAttributeBuilder.
17101 * delegate.cs: Check unsafe types being used outside of an Unsafe context.
17103 * ecore.cs: (FieldExpr): Handle field remapping here.
17105 * iteratators.cs: Pass the instance variable (if the method is an
17106 instance method) to the constructors, so we can access the field
17107 variables on the class.
17109 TODO: Test this with structs. I think the THIS variable on
17110 structs might have to be a pointer, and not a refenrece
17112 2003-04-27 Miguel de Icaza <miguel@ximian.com>
17114 * codegen.cs (EmitContext.Mapvariable): Adds a mechanism to map
17115 local variables to fields in a proxy class.
17117 * iterators.cs (PopulateProxy): Rename our internal fields to
17119 Create a <THIS> field if we are an instance method, so we can
17120 reference our parent container variables.
17121 (MapVariable): Called back from the EmitContext code to enter a
17122 new variable to field mapping into the proxy class (we just create
17126 (LocalVariableReference.{Emit,EmitAssign,AddressOf}): Add support
17127 for using the remapped locals to fields.
17129 I placed the code here, because that gives the same semantics to
17130 local variables, and only changes the Emit code.
17132 * statement.cs (Fixed.Resolve): it is not allowed to have fixed
17133 statements inside iterators.
17134 (VariableInfo): Add a FieldBuilder for the cases when we are
17135 remapping local variables to fields in a proxy class
17137 * ecore.cs (SimpleNameResolve): Avoid testing two times for
17138 current_block != null.
17140 * statement.cs (Swithc.SimpleSwitchEmit): Removed code that did
17141 not cope with strings, as it has been moved to the
17142 TableSwitchEmit. Fixed bug in switch generation.
17144 * expression.cs (New.DoResolve): Provide more context for the user
17145 when reporting an error.
17147 * ecore.cs (Expression.LoadFromPtr): Use ldind_i when loading
17150 * expression.cs (MemberAccess.DoResolve): When we get a type back,
17151 check the permissions for it. Note than in a type-resolution
17152 context the check was already present in DeclSpace.ResolveType,
17153 but was missing from the MemberAccess.
17155 (ArrayCreation.CheckIndices): warn if the user has
17156 more nested levels of expressions, but there are no more
17157 dimensions specified. Avoids crash on bug 41906.
17159 2003-04-26 Miguel de Icaza <miguel@ximian.com>
17161 * statement.cs (Block): replace Implicit bool, for a generic
17163 New flag: `Unchecked'. This is used during the EmitMeta phase
17164 (which is out-of-line with the regular Resolve/Emit process for a
17165 statement, as this is done ahead of time, but still gets a chance
17166 to call constant resolve).
17168 (Block.Flags): new enum for adding a new flag.
17170 (Block.EmitMeta): track the state of unchecked.
17172 (Unchecked): Set the "UnChecked" flags on any blocks we enclose,
17173 to enable constant resolution to work there as well.
17175 2003-04-22 Miguel de Icaza <miguel@ximian.com>
17177 * typemanager.cs (ienumerable_type): Also look up
17178 System.Collections.IEnumerable.
17180 2003-04-21 Miguel de Icaza <miguel@ximian.com>
17182 TODO: Test more than one conditional per method.
17184 * class.cs (Indexer.Define): Report the location where the user is
17185 referencing the unsupported feature.
17187 (MethodData): Overload the use of `conditionals' to
17188 minimize the creation of needless ArrayLists. This saves roughly
17189 212kb on my machine.
17191 (Method): Implement the new IIteratorContainer interface.
17192 (Method.SetYields): Implement the method by setting the ModFlags
17193 to contain METHOD_YIELDS.
17195 * expression.cs (Unary.ResolveOperator): Use expr_type, not Expr,
17196 which just got set to null.
17198 * iterators.cs: New file.
17200 (Yield, YieldBreak): New statements.
17202 * statement.cs (Return.Resolve): Flag an error if we are used in
17203 an iterator method.
17205 * codegen.cs (InIterator): New flag set if the code is being
17206 compiled in an iterator method.
17208 * modifiers.cs: New flag METHOD_YIELDS. This modifier is an
17209 internal modifier, and we just use it to avoid adding extra
17210 fields, as this is seldom used.
17212 * cs-parser.jay: Add yield_statement (yield and yield break).
17214 * driver.cs: New flag -v2 to turn on version 2 features.
17216 * cs-tokenizer.cs (Tokenizer): Add yield and __yield to the
17217 hashtable when v2 is enabled.
17219 2003-04-20 Miguel de Icaza <miguel@ximian.com>
17221 * typemanager.cs (TypeManager.NamespaceClash): Use to check if
17222 there is already a namespace defined with this name.
17224 (TypeManager.InitCoreTypes): Remove the temporary workaround, as
17225 people upgraded their corlibs.
17227 (TypeManager.CoreLookupType): Use LookupTypeDirect, as we
17228 always use fully qualified types, no need to use the compiler
17231 (TypeManager.IsNamespace): Use binarysearch.
17233 * class.cs (AddClass, AddStruct, AddInterface, AddEvent,
17234 AddDelegate): I did not quite use the new IsValid API properly: I
17235 have to pass the short-name and the fullname. I was passing only
17236 the basename instead of the fullname sometimes.
17238 (TypeContainer.DefineType): call NamespaceClash.
17240 * interface.cs (Interface.DefineType): use NamespaceClash before
17243 * delegate.cs (Delegate.DefineType): use NamespaceClash before
17246 * enum.cs: (Enum.DefineType): use NamespaceClash before
17249 * typemanager.cs (: 3-line patch that gives us some tasty 11%
17250 speed increase. First, use the negative_hits cache when we get a
17251 negative. Second, add the type with its full original name
17252 instead of the new . and + encoded name (reflection uses + to
17253 separate type from a nested type). Use LookupTypeReflection
17254 directly which bypasses the type->name hashtable (that we already
17255 know does not contain the type.
17257 * decl.cs (DeclSpace.ResolveTypeExpr): track the
17258 location/container type.
17260 * driver.cs: When passing utf8, use directly the UTF8Encoding.
17262 2003-04-19 Miguel de Icaza <miguel@ximian.com>
17264 * decl.cs (ResolveTypeExpr): Mirror check acess here too.
17266 * delegate.cs (NewDelegate.Resolve): Test whether an instance
17267 method is being referenced in the method group from a static
17268 context, and report error 120 if so.
17270 * expression.cs, ecore.cs (Error_UnexpectedKind): New name for
17273 * typemanager.cs: Add intermediate namespaces (if a namespace A.B
17274 is created, we create the A namespace).
17276 * cs-parser.jay: A namespace also introduces a DeclarationFound.
17279 2003-04-18 Miguel de Icaza <miguel@ximian.com>
17281 * typemanager.cs (GetReferenceType, GetPointerType): In .NET each
17282 invocation to ModuleBuilder.GetType with the same values will
17283 return a new type instance, so we need to cache its return
17286 * expression.cs (Binary.ResolveOperator): Only allow the compare
17287 operators on enums if they are of the same type.
17289 * ecore.cs (Expression.ImplicitReferenceConversion): handle target
17290 types of ValueType on their own case. Before we were giving them
17291 the same treatment as objects.
17293 * decl.cs (DeclSpace.IsValid): IsValid takes the short name and
17294 fullname. Short name is used to compare against container name.
17295 Fullname is used to check against defined namespace names.
17297 * class.cs (AddProperty, AddField, AddClass, AddStruct, AddEnum,
17298 AddDelegate, AddEvent): Pass new parameter to DeclSpace.IsValid
17300 (Method.CheckBase): Call parent.
17301 (MemberBase.CheckBase): Check for protected members on sealed
17303 (PropertyBase.CheckBase): Call parent.
17304 (Field.Define): Call parent.
17306 * report.cs: Negative error codes are now mapped to 8000 - code,
17307 so that the display is render more nicely.
17309 * typemanager.cs: Do not use try/catch, instead report a regular
17312 (GetPointerType, GetReferenceType): These methods provide
17313 mechanisms to obtain the T* and T& from a T. We had the code
17314 previously scattered around the code base, and it also used
17315 TypeManager.LookupType that would go through plenty of caches.
17316 This one goes directly to the type source.
17318 In some places we did the Type.GetType followed by
17319 ModuleBuilder.GetType, but not in others, so this unifies the
17320 processing as well.
17322 * namespace.cs (VerifyUsing): Perform a non-lazy approach to using
17323 statements now that we have namespace information.
17325 * typemanager.cs (IsNamespace): New method, returns whether the
17326 string presented is a namespace or not.
17328 (ComputeNamespaces): New public entry point, computes the list of
17329 available namespaces, using the GetNamespaces API call in Mono, or
17330 the slower version in MS.NET.
17332 Now before we start the semantic analysis phase, we have a
17333 complete list of namespaces including everything that the user has
17336 Deleted old code to cache namespaces in .nsc files.
17338 2003-04-17 Miguel de Icaza <miguel@ximian.com>
17340 * class.cs: (TypeContainer.DefineDefaultConstructor): Use the
17341 class/struct location definition Location for the implicit
17342 constructor location.
17344 (Operator.Define): Use the location of the operator for the
17345 implicit Method definition.
17347 (Constructor.Emit): use the constructor location for the implicit
17348 base initializer constructor.
17350 * ecore.cs: Remove ITypeExpression. This interface is now gone,
17351 and the Expression class now contains two new methods:
17353 ResolveAsTypeStep and ResolveAsTypeTerminal. This is used to
17354 isolate type lookup from the rest of the resolution process.
17356 Since we use Expressions to hold type definitions due to the way
17357 we parse the input we have historically overloaded Resolve to
17358 perform the Type lookups if a special flag is passed. Now this is
17359 eliminated and two methods take their place.
17361 The differences in the two methods between xStep and xTerminal is
17362 that xStep is involved in our current lookup system that uses
17363 SimpleNames to compose a name, while xTerminal is used just to
17364 catch the case where the simplename lookup failed.
17366 2003-04-16 Miguel de Icaza <miguel@ximian.com>
17368 * expression.cs (ResolveMemberAccess): Remove redundant code.
17369 TypeExpr expressions are always born fully resolved.
17371 * interface.cs (PopulateMethod): Do not lookup the types twice.
17372 We were doing it once during SemanticAnalysis and once during
17375 * cs-parser.jay: Due to our hack in the grammar, things like A.B[]
17376 in local variable type definitions, were being returned as a
17377 SimpleName (we decomposed everything into a string), that is
17378 because primary_expression was being used instead of a type in the
17379 grammar (reduce/reduce conflicts).
17381 The part that was wrong is that we converted the expression into a
17382 string (an oversimplification in one hand, compounded with primary
17383 expressions doing string concatenation).
17389 Would return "A.B.C[]" as a SimpleName. This stopped things like
17390 using clauses from working on this particular context. And a type
17391 was being matched directly against "A.B.C[]".
17393 We now use the correct approach, and allow for ComposedCast to be
17394 part of the unary expression. So the "A.B.C []" become a composed
17395 cast of "A.B.C" (as a nested group of MemberAccess with a
17396 SimpleName at the end) plus the rank composition "[]".
17400 2003-04-10 Miguel de Icaza <miguel@ximian.com>
17402 * decl.cs (CheckAccessLevel): Implement the NestedPrivate rules
17403 for the access level checking.
17405 * class.cs: Cosmetic changes. Renamed `TypeContainer parent' to
17406 `TypeContainer container', because I kept getting confused when I
17407 was debugging this code.
17409 * expression.cs (Indexers): Instead of tracking getters/setters,
17410 we now track them in parallel. We create one arraylist less, but
17411 most importantly it is possible now for the LValue code to find a
17412 matching get for a set.
17414 (IndexerAccess.DoResolveLValue): Update the code.
17415 GetIndexersForType has been modified already to extract all the
17416 indexers from a type. The code assumed it did not.
17418 Also make the code set the correct return type for the indexer.
17419 This was fixed a long time ago for properties, but was missing for
17420 indexers. It used to be void_type.
17422 (Binary.Emit): Test first for doubles instead of
17423 floats, as they are more common.
17425 (Binary.EmitBranchable): Use the .un version of the branch opcodes
17426 when dealing with floats and the <=, >= operators. This fixes bug
17429 * statement.cs (Foreach.EmitArrayForeach): bug fix: The code used
17430 to load the array value by emitting a load on the foreach variable
17431 type. This was incorrect.
17433 We now emit the code to load an element using the the array
17434 variable type, and then we emit the conversion operator.
17438 2003-04-10 Zoltan Varga <vargaz@freemail.hu>
17440 * attribute.cs: Avoid allocation of ArrayLists in the common case.
17442 2003-04-09 Miguel de Icaza <miguel@ximian.com>
17444 * class.cs (MethodSignature.InheritableMemberSignatureCompare):
17445 test for protection before we test for signatures.
17447 (MethodSignature.ToString): implement.
17449 * expression.cs (Unary.TryReduceNegative): Add missing minus sign
17450 to the case where we reduced into a LongConstant.
17452 * decl.cs (CheckAccessLevel): If the type is an array, we can not
17453 depend on whether the information is acurrate, because the
17454 Microsoft runtime will always claim that the array type is public,
17455 regardless of the real state.
17457 If the type is a pointer, another problem happens: the type is
17458 reported as non-public in Microsoft.
17460 In both cases we have to call CheckAccessLevel recursively with
17461 the underlying type as the argument to be tested.
17463 2003-04-08 Miguel de Icaza <miguel@ximian.com>
17465 * assign.cs (Assign.Emit): If we are dealing with a compound
17466 assignment expression, we should use the code path that stores the
17467 intermediate result in a temporary value. This fixes #40903.
17469 *expression.cs (Indirection.ToString): Provide ToString method for
17472 2003-04-08 Zoltan Varga <vargaz@freemail.hu>
17474 * class.cs: Null out fields holding references to Block objects so
17475 they can be garbage collected.
17477 * expression.cs (OverloadResolve): Remove unused local.
17479 2003-04-07 Martin Baulig <martin@ximian.com>
17481 * codegen.cs (EmitContext.CurrentFile): New public field.
17482 (EmitContext.Mark): Use the CurrentFile to check whether the
17483 location is in the correct file.
17484 (EmitContext.EmitTopBlock): Initialize CurrentFile here.
17486 2003-04-07 Martin Baulig <martin@ximian.com>
17488 * ecore.cs (Expression.ResolveBoolean): Don't call ec.Mark().
17490 * codegen.cs (EmitContext.EmitTopBlock): Don't call Mark() on the
17491 location. [FIXME: The location argument which gets passed to this
17492 method is sometimes wrong!]
17494 2003-04-07 Nick Drochak <ndrochak@gol.com>
17496 * codegen.cs: Be more verbose when we can't find the symbol writer dll.
17498 2003-04-07 Miguel de Icaza <miguel@ximian.com>
17500 * expression.cs (Indirection.EmitAssign): We were using the
17501 temporary, but returning immediately instead of continuing the
17504 2003-04-06 Martin Baulig <martin@ximian.com>
17506 * ecore.cs (SimpleName.SimpleNameResolve): Don't report an error
17507 if it's a nested child, but also deriving from the outer class.
17510 * typemanager.cs (IsNestedChildOf): Make this work if it's a
17511 nested child, but also deriving from the outer class. See
17513 (FilterWithClosure): We may access private members of the outer
17514 class if we're a nested child and deriving from the outer class.
17515 (RealMemberLookup): Only set `closure_private_ok' if the
17516 `original_bf' contained BindingFlags.NonPublic.
17518 2003-04-05 Martin Baulig <martin@ximian.com>
17520 * statement.cs (FlowBranching.UsageVector.MergeChildren): Fix bug #40670.
17522 2003-04-02 Miguel de Icaza <miguel@ximian.com>
17524 * class.cs (Event.Define): Do not allow abstract events to have
17527 2003-04-01 Miguel de Icaza <miguel@ximian.com>
17529 * cs-parser.jay: Add error productions for ADD/REMOVE missing a
17530 block in event declarations.
17532 * ecore.cs (FieldExpr.AddressOf): If our instance expression is a
17533 value type, get its address.
17535 * expression.cs (Is.Emit): For action `LeaveOnStack' we were
17536 leaving a class on the stack instead of a boolean value (int
17537 0/1). Change the code so we compare against null, and then the
17538 result against zero.
17540 * class.cs (TypeContainer.GetClassBases): We were checking for the
17541 parent class being sealed too late.
17543 * expression.cs (Binary.Emit): For <= and >= when dealing with
17544 floating point values, use cgt.un and clt.un instead of cgt and
17547 2003-04-01 Zoltan Varga <vargaz@freemail.hu>
17549 * statement.cs: Apply the same optimization as MS: skip the
17550 GetEnumerator returning an IEnumerator, and use the one returning a
17551 CharEnumerator instead. This allows us to avoid the try-finally block
17554 2003-03-31 Gaurav Vaish <gvaish_mono@lycos.com>
17556 * cs-parser.jay: Attributes cannot be applied to
17557 namespaces. Fixes #40473
17559 2003-03-31 Gonzalo Paniagua Javier <gonzalo@ximian.com>
17562 (Add*): check if the name is valid using the full name for constants,
17563 fields, properties and events.
17565 2003-03-28 Miguel de Icaza <miguel@ximian.com>
17567 * enum.cs (Enum.DefineType, Enum.IsValidEnumConstant): Also allow
17568 char constants to be part of the enumeration.
17570 * expression.cs (Conditional.DoResolve): Add support for operator
17571 true. Implements the missing functionality from 14.12
17573 * class.cs (TypeContainer.CheckPairedOperators): Report error for missmatch on
17574 operator true/false as required by the spec.
17576 * expression.cs (Unary.ResolveOperator): In LogicalNot, do an
17577 implicit conversion to boolean.
17579 * statement.cs (Statement.ResolveBoolean): A boolean expression is
17580 also one where the type implements `operator true'.
17582 * ecore.cs (Expression.GetOperatorTrue): New helper routine to
17583 get an expression that will invoke operator true based on an
17586 (GetConversionOperators): Removed the hack that called op_True
17589 (Expression.ResolveBoolean): Move this from Statement.
17591 2003-03-17 Miguel de Icaza <miguel@ximian.com>
17593 * ecore.cs (FieldExpr): do not allow initialization of initonly
17594 fields on derived classes
17596 2003-03-13 Martin Baulig <martin@ximian.com>
17598 * statement.cs (Block.Emit): Call ig.BeginScope() and
17599 ig.EndScope() when compiling with debugging info; call
17600 LocalBuilder.SetLocalSymInfo _after_ opening the scope.
17602 2003-03-08 Miguel de Icaza <miguel@ximian.com>
17604 * expression.cs (Indexers): Do not construct immediately, allow
17605 for new members to be appended as we go. Fixes 38143
17607 2003-03-07 Gonzalo Paniagua Javier <gonzalo@ximian.com>
17609 * expression.cs: save/restore context when resolving an unchecked
17612 2003-03-05 Miguel de Icaza <miguel@ximian.com>
17614 * cfold.cs: Catch division by zero in modulus operator during
17617 2003-03-03 Miguel de Icaza <miguel@ximian.com>
17619 * interface.cs (Interface.DefineMembers): Avoid defining members
17622 2003-02-27 Miguel de Icaza <miguel@ximian.com>
17624 * driver.cs: handle the +/- options for -noconfig
17626 * statement.cs (Unckeched.Resolve): Also track the state of
17627 unchecked in the Resolve phase.
17629 2003-02-27 Martin Baulig <martin@ximian.com>
17631 * ecore.cs (Expression.MemberLookup): Don't create a
17632 MethodGroupExpr for something which is not a method. Fixes #38291.
17634 2003-02-25 Miguel de Icaza <miguel@ximian.com>
17636 * class.cs (MemberBase.CheckParameters): Also check that the type
17637 is unmanaged if it is a pointer.
17639 * expression.cs (SizeOf.Resolve): Add location information.
17641 * statement.cs (Block.EmitMeta): Flag error (208) if a pointer to
17642 a managed type is declared.
17644 * expression.cs (Invocation.VerifyArgumentsCompat): Check for the
17645 parameter modifiers as well. Fixes bug 38606
17647 * class.cs: Very sad. Am backing out the speed up changes
17648 introduced by the ArrayList -> Array in the TypeContainer, as they
17649 were not actually that much faster, and introduced a bug (no error
17650 reports on duplicated methods).
17652 * assign.cs (CompoundAssign.DoLResolve): Resolve the original
17653 source first, this will guarantee that we have a valid expression
17654 before calling in lower levels functions that will require a
17655 resolved object. Then use this original_source in the
17656 target.ResolveLValue instead of the original source that was
17659 Another change. Use target.Resolve instead of LValueResolve.
17660 Although we are resolving for LValues, we will let the Assign code
17661 take care of that (it will be called again from Resolve). This
17662 basically allows code like this:
17664 class X { X operator + (X x, object o) {} X this [int idx] { get; set; } }
17665 class Y { void A (X x) { x [0] += o; }
17667 The problem was that the indexer was trying to resolve for
17668 set_Item (idx, object o) and never finding one. The real set_Item
17669 was set_Item (idx, X). By delaying the process we get the right
17674 2003-02-23 Martin Baulig <martin@ximian.com>
17676 * statement.cs (Block.Emit): Override this and set ec.CurrentBlock
17677 while calling DoEmit ().
17679 * codegen.cs (EmitContext.Mark): Don't mark locations in other
17680 source files; if you use the #line directive inside a method, the
17681 compiler stops emitting line numbers for the debugger until it
17682 reaches the end of the method or another #line directive which
17683 restores the original file.
17685 2003-02-23 Martin Baulig <martin@ximian.com>
17687 * statement.cs (FlowBranching.UsageVector.MergeChildren): Fix bug #37708.
17689 2003-02-23 Martin Baulig <martin@ximian.com>
17691 * statement.cs (Block.AddChildVariableNames): We need to call this
17692 recursively, not just for our immediate children.
17694 2003-02-23 Martin Baulig <martin@ximian.com>
17696 * class.cs (Event.Define): Always make the field private, like csc does.
17698 * typemanager.cs (TypeManager.RealMemberLookup): Make events
17699 actually work, fixes bug #37521.
17701 2003-02-23 Miguel de Icaza <miguel@ximian.com>
17703 * delegate.cs: When creating the various temporary "Parameters"
17704 classes, make sure that we call the ComputeAndDefineParameterTypes
17705 on those new parameters (just like we do with the formal ones), to
17706 allow them to be resolved in the context of the DeclSpace.
17708 This fixes the bug that Dick observed in Bugzilla #38530.
17710 2003-02-22 Miguel de Icaza <miguel@ximian.com>
17712 * expression.cs (ResolveMemberAccess): When resolving a constant,
17713 do not attempt to pull a constant if the value was not able to
17714 generate a valid constant.
17716 * const.cs (LookupConstantValue): Do not report more errors than required.
17718 2003-02-19 Gonzalo Paniagua Javier <gonzalo@ximian.com>
17720 * expression.cs: fixes bug #38328.
17722 2003-02-18 Miguel de Icaza <miguel@ximian.com>
17724 * class.cs: Changed all the various members that can be part of a
17725 class from being an ArrayList to be an Array of the right type.
17726 During the DefineType type_list, interface_list, delegate_list and
17727 enum_list are turned into types, interfaces, delegates and enums
17730 And during the member population, indexer_list, event_list,
17731 constant_list, field_list, instance_constructor_list, method_list,
17732 operator_list and property_list are turned into their real arrays.
17734 Although we could probably perform this operation earlier, for
17735 good error reporting we need to keep the lists and remove the
17736 lists for longer than required.
17738 This optimization was triggered by Paolo profiling the compiler
17739 speed on the output of `gen-sample-program.pl' perl script.
17741 * decl.cs (DeclSpace.ResolveType): Set the ContainerType, so we do
17742 not crash in methods like MemberLookupFailed that use this field.
17744 This problem arises when the compiler fails to resolve a type
17745 during interface type definition for example.
17747 2003-02-18 Miguel de Icaza <miguel@ximian.com>
17749 * expression.cs (Indexers.GetIndexersForType): Interfaces do not
17750 inherit from System.Object, so we have to stop at null, not only
17751 when reaching System.Object.
17753 2003-02-17 Miguel de Icaza <miguel@ximian.com>
17755 * expression.cs: (Indexers.GetIndexersForType): Martin's fix used
17756 DeclaredOnly because the parent indexer might have had a different
17757 name, but did not loop until the top of the hierarchy was reached.
17759 The problem this one fixes is 35492: when a class implemented an
17760 indexer from an interface, we were getting the interface method
17761 (which was abstract) and we were flagging an error (can not invoke
17764 This also keeps bug 33089 functioning, and test-148 functioning.
17766 * typemanager.cs (IsSpecialMethod): The correct way of figuring
17767 out if a method is special is to see if it is declared in a
17768 property or event, or whether it is one of the predefined operator
17769 names. This should fix correctly #36804.
17771 2003-02-15 Miguel de Icaza <miguel@ximian.com>
17773 The goal here is to remove the dependency on EmptyCast.Peel ().
17774 Killing it completely.
17776 The problem is that currently in a number of places where
17777 constants are expected, we have to "probe" for an EmptyCast, and
17778 Peel, which is not the correct thing to do, as this will be
17779 repetitive and will likely lead to errors.
17781 The idea is to remove any EmptyCasts that are used in casts that
17782 can be reduced to constants, so we only have to cope with
17785 This bug hunt was triggered by Bug 37363 and the desire to remove
17786 the duplicate pattern where we were "peeling" emptycasts to check
17787 whether they were constants. Now constants will always be
17790 * ecore.cs: Use an enumconstant here instead of wrapping with
17793 * expression.cs (Cast.TryReduce): Ah, the tricky EnumConstant was
17794 throwing me off. By handling this we can get rid of a few hacks.
17796 * statement.cs (Switch): Removed Peel() code.
17798 2003-02-14 Miguel de Icaza <miguel@ximian.com>
17800 * class.cs: Location information for error 508
17802 * expression.cs (New.DoResolve): Add a guard against double
17803 resolution of an expression.
17805 The New DoResolve might be called twice when initializing field
17806 expressions (see EmitFieldInitializers, the call to
17807 GetInitializerExpression will perform a resolve on the expression,
17808 and later the assign will trigger another resolution
17810 This leads to bugs (#37014)
17812 * delegate.cs: The signature for EndInvoke should contain any ref
17813 or out parameters as well. We were not doing this in the past.
17815 * class.cs (Field.Define): Do not overwrite the type definition
17816 inside the `volatile' group. Turns out that volatile enumerations
17817 were changing the type here to perform a validity test, which
17820 2003-02-12 Miguel de Icaza <miguel@ximian.com>
17822 * ecore.cs (FieldExpr.AddressOf): In the particular case of This
17823 and structs, we do not want to load the instance variable
17825 (ImplicitReferenceConversion, ImplicitReferenceConversionExists):
17826 enum_type has to be handled like an object reference (implicit
17827 conversions exists from this to object), but the regular IsClass
17828 and IsValueType tests will never return true for this one.
17830 Also we use TypeManager.IsValueType instead of type.IsValueType,
17831 just for consistency with the rest of the code (this is only
17832 needed if we ever use the construct exposed by test-180.cs inside
17833 corlib, which we dont today).
17835 2003-02-12 Zoltan Varga <vargaz@freemail.hu>
17837 * attribute.cs (ApplyAttributes): apply all MethodImplAttributes, not
17840 2003-02-09 Martin Baulig <martin@ximian.com>
17842 * namespace.cs (Namespace..ctor): Added SourceFile argument.
17843 (Namespace.DefineNamespaces): New static public method; this is
17844 called when we're compiling with debugging to add all namespaces
17845 to the symbol file.
17847 * tree.cs (Tree.RecordNamespace): Added SourceFile argument and
17848 pass it to the Namespace's .ctor.
17850 * symbolwriter.cs (SymbolWriter.OpenMethod): Added TypeContainer
17851 and MethodBase arguments; pass the namespace ID to the symwriter;
17852 pass the MethodBase instead of the token to the symwriter.
17853 (SymbolWriter.DefineNamespace): New method to add a namespace to
17856 2003-02-09 Martin Baulig <martin@ximian.com>
17858 * symbolwriter.cs: New file. This is a wrapper around
17859 ISymbolWriter with a cleaner API. We'll dynamically Invoke()
17860 methods here in near future.
17862 2003-02-09 Martin Baulig <martin@ximian.com>
17864 * codegen.cs (EmitContext.Mark): Just pass the arguments to
17865 ILGenerator.MarkSequencePoint() which are actually used by the
17868 2003-02-09 Martin Baulig <martin@ximian.com>
17870 * location.cs (SourceFile): New public sealed class. This
17871 contains the name and an index which is used in the location's token.
17872 (Location): Reserve an appropriate number of bits in the token for
17873 the source file instead of walking over that list, this gives us a
17874 really huge performance improvement when compiling with debugging.
17876 * driver.cs (Driver.parse, Driver.tokenize_file): Take a
17877 `SourceFile' argument instead of a string.
17878 (Driver.ProcessFile): Add all the files via Location.AddFile(),
17879 but don't parse/tokenize here, we need to generate the list of all
17880 source files before we do that.
17881 (Driver.ProcessFiles): New static function. Parses/tokenizes all
17884 * cs-parser.jay (CSharpParser): Take a `SourceFile' argument
17885 instead of a string.
17887 * cs-tokenizer.cs (Tokenizer): Take `SourceFile' argument instead
17890 2003-02-09 Martin Baulig <martin@ximian.com>
17892 * cs-tokenizer.cs (Tokenizer.PreProcessLine): Also reset the
17893 filename on `#line default'.
17895 Sat Feb 8 17:03:16 CET 2003 Paolo Molaro <lupus@ximian.com>
17897 * statement.cs: don't clear the pinned var when the fixed statement
17898 returns from the method (fixes bug#37752).
17900 Sat Feb 8 12:58:06 CET 2003 Paolo Molaro <lupus@ximian.com>
17902 * typemanager.cs: fix from mathpup@mylinuxisp.com (Marcus Urban)
17905 2003-02-07 Martin Baulig <martin@ximian.com>
17907 * driver.cs: Removed the `--debug-args' command line argument.
17909 * codegen.cs (CodeGen.SaveSymbols): Removed, this is now done
17910 automatically by the AsssemblyBuilder.
17911 (CodeGen.InitializeSymbolWriter): We don't need to call any
17912 initialization function on the symbol writer anymore. This method
17913 doesn't take any arguments.
17915 2003-02-03 Miguel de Icaza <miguel@ximian.com>
17917 * driver.cs: (AddAssemblyAndDeps, LoadAssembly): Enter the types
17918 from referenced assemblies as well.
17920 2003-02-02 Martin Baulig <martin@ximian.com>
17922 * class.cs (MethodData.Emit): Generate debugging info for external methods.
17924 2003-02-02 Martin Baulig <martin@ximian.com>
17926 * class.cs (Constructor.Emit): Open the symbol writer before
17927 emitting the constructor initializer.
17928 (ConstructorInitializer.Emit): Call ec.Mark() to allow
17929 single-stepping through constructor initializers.
17931 2003-01-30 Miguel de Icaza <miguel@ximian.com>
17933 * class.cs: Handle error 549: do not allow virtual methods in
17936 2003-02-01 Jackson Harper <jackson@latitudegeo.com>
17938 * decl.cs: Check access levels when resolving types
17940 2003-01-31 Jackson Harper <jackson@latitudegeo.com>
17942 * statement.cs: Add parameters and locals set in catch blocks that might
17943 return to set vector
17945 2003-01-29 Miguel de Icaza <miguel@ximian.com>
17947 * class.cs (Operator): Set the SpecialName flags for operators.
17949 * expression.cs (Invocation.DoResolve): Only block calls to
17950 accessors and operators on SpecialName methods.
17952 (Cast.TryReduce): Handle conversions from char constants.
17955 Tue Jan 28 17:30:57 CET 2003 Paolo Molaro <lupus@ximian.com>
17957 * statement.cs: small memory and time optimization in FlowBranching.
17959 2003-01-28 Pedro Mart <yoros@wanadoo.es>
17961 * expression.cs (IndexerAccess.DoResolveLValue): Resolve the same
17962 problem that the last fix but in the other sid (Set).
17964 * expression.cs (IndexerAccess.DoResolve): Fix a problem with a null
17965 access when there is no indexer in the hierarchy.
17967 2003-01-27 Jackson Harper <jackson@latitudegeo.com>
17969 * class.cs: Combine some if statements.
17971 2003-01-27 Gonzalo Paniagua Javier <gonzalo@ximian.com>
17973 * driver.cs: fixed bug #37187.
17975 2003-01-27 Pedro Martinez Juliá <yoros@wanadoo.es>
17977 * expression.cs (IndexerAccess.DoResolve): Before trying to resolve
17978 any indexer, it's needed to build a list with all the indexers in the
17979 hierarchy (AllGetters), else we have problems. Fixes #35653.
17981 2003-01-23 Miguel de Icaza <miguel@ximian.com>
17983 * class.cs (MethodData.Define): It is wrong for an interface
17984 implementation to be static in both cases: explicit and implicit.
17985 We were only handling this in one case.
17987 Improve the if situation there to not have negations.
17989 * class.cs (Field.Define): Turns out that we do not need to check
17990 the unsafe bit on field definition, only on usage. Remove the test.
17992 2003-01-22 Gonzalo Paniagua Javier <gonzalo@ximian.com>
17994 * driver.cs: use assembly.Location instead of Codebase (the latest
17995 patch made mcs fail when using MS assemblies).
17997 2003-01-21 Tim Haynes <thaynes@openlinksw.com>
17999 * driver.cs: use DirectorySeparatorChar instead of a hardcoded "/" to
18000 get the path to *corlib.dll.
18002 2003-01-21 Nick Drochak <ndrochak@gol.com>
18006 * typemanager.cs: Remove compiler warnings
18008 2003-01-20 Duncan Mak <duncan@ximian.com>
18010 * AssemblyInfo.cs: Bump the version number to 0.19.
18012 2003-01-20 Gonzalo Paniagua Javier <gonzalo@ximian.com>
18014 * cs-tokenizer.cs: little fixes to line numbering when #line is used.
18016 2003-01-18 Zoltan Varga <vargaz@freemail.hu>
18018 * class.cs (Constructor::Emit): Emit debugging info for constructors.
18020 2003-01-17 Miguel de Icaza <miguel@ximian.com>
18022 * cs-parser.jay: Small fix: we were not comparing the constructor
18023 name correctly. Thanks to Zoltan for the initial pointer.
18025 2003-01-16 Jackson Harper <jackson@latitudegeo.com>
18027 * cs-tokenizer.cs: Set file name when specified with #line
18029 2003-01-15 Miguel de Icaza <miguel@ximian.com>
18031 * cs-parser.jay: Only perform the constructor checks here if we
18032 are named like the class; This will help provider a better
18033 error. The constructor path is taken when a type definition is
18034 not found, but most likely the user forgot to add the type, so
18035 report that rather than the constructor error.
18037 Tue Jan 14 10:36:49 CET 2003 Paolo Molaro <lupus@ximian.com>
18039 * class.cs, rootcontext.cs: small changes to avoid unnecessary memory
18042 2003-01-13 Jackson Harper <jackson@latitudegeo.com>
18044 * cs-parser.jay: Add cleanup call.
18046 2003-01-13 Duncan Mak <duncan@ximian.com>
18048 * cs-tokenizer.cs (Cleanup): Rename to 'cleanup' to make it more
18049 consistent with other methods.
18051 2003-01-13 Jackson Harper <jackson@latitudegeo.com>
18053 * cs-tokenizer.cs: Add Cleanup method, also fix #region error messages.
18055 Sun Jan 12 19:58:42 CET 2003 Paolo Molaro <lupus@ximian.com>
18057 * attribute.cs: only set GuidAttr to true when we have a
18060 2003-01-09 Gonzalo Paniagua Javier <gonzalo@ximian.com>
18064 * typemanager.cs: fixes to allow mcs compile corlib with the new
18065 Type.IsSubclassOf fix.
18067 2003-01-08 Miguel de Icaza <miguel@ximian.com>
18069 * expression.cs (LocalVariableReference.DoResolve): Classify a
18070 constant as a value, not as a variable. Also, set the type for
18073 * cs-parser.jay (fixed_statement): take a type instead of a
18074 pointer_type, so we can produce a better error message later.
18076 * statement.cs (Fixed.Resolve): Flag types that are not pointers
18079 (For.DoEmit): Make inifinite loops have a
18080 non-conditional branch back.
18082 (Fixed.DoEmit): First populate the pinned variables, then emit the
18083 statement, then clear the variables. Before I was emitting the
18084 code once for each fixed piece.
18087 2003-01-08 Martin Baulig <martin@ximian.com>
18089 * statement.cs (FlowBranching.MergeChild): A break in a
18090 SWITCH_SECTION does not leave a loop. Fixes #36155.
18092 2003-01-08 Martin Baulig <martin@ximian.com>
18094 * statement.cs (FlowBranching.CheckOutParameters): `struct_params'
18095 lives in the same number space than `param_map'. Fixes #36154.
18097 2003-01-07 Miguel de Icaza <miguel@ximian.com>
18099 * cs-parser.jay (constructor_declaration): Set the
18100 Constructor.ModFlags before probing for it. This makes the
18101 compiler report 514, 515 and 132 (the code was there, but got
18104 * statement.cs (Goto.Resolve): Set `Returns' to ALWAYS.
18105 (GotoDefault.Resolve): Set `Returns' to ALWAYS.
18106 (GotoCase.Resolve): Set `Returns' to ALWAYS.
18108 Tue Jan 7 18:32:24 CET 2003 Paolo Molaro <lupus@ximian.com>
18110 * enum.cs: create the enum static fields using the enum type.
18112 Tue Jan 7 18:23:44 CET 2003 Paolo Molaro <lupus@ximian.com>
18114 * class.cs: don't try to create the ParamBuilder for the return
18115 type if it's not needed (and handle it breaking for the ms runtime
18118 2003-01-06 Jackson Harper <jackson@latitudegeo.com>
18120 * cs-tokenizer.cs: Add REGION flag to #region directives, and add checks to make sure that regions are being poped correctly
18122 2002-12-29 Miguel de Icaza <miguel@ximian.com>
18124 * cs-tokenizer.cs (get_cmd_arg): Fixups to allow \r to terminate
18125 the command. This showed up while compiling the JANET source
18126 code, which used \r as its only newline separator.
18128 2002-12-28 Miguel de Icaza <miguel@ximian.com>
18130 * class.cs (Method.Define): If we are an operator (because it
18131 reuses our code), then set the SpecialName and HideBySig. #36128
18133 2002-12-22 Miguel de Icaza <miguel@ximian.com>
18135 * ecore.cs (FieldExpr.DoResolve): Instead of throwing an
18136 exception, report error 120 `object reference required'.
18138 * driver.cs: Add --pause option, used during to measure the size
18139 of the process as it goes with --timestamp.
18141 * expression.cs (Invocation.DoResolve): Do not allow methods with
18142 SpecialName to be invoked.
18144 2002-12-21 Miguel de Icaza <miguel@ximian.com>
18146 * cs-tokenizer.cs: Small fix to the parser: compute the ascii
18147 number before adding it.
18149 2002-12-21 Ravi Pratap <ravi@ximian.com>
18151 * ecore.cs (StandardImplicitConversion): When in an unsafe
18152 context, we allow conversion between void * to any other pointer
18153 type. This fixes bug #35973.
18155 2002-12-20 Jackson Harper <jackson@latitudegeo.com>
18157 * codegen.cs: Use Path.GetFileNameWithoutExtension so an exception
18158 is not thrown when extensionless outputs are used
18160 2002-12-20 Gonzalo Paniagua Javier <gonzalo@ximian.com>
18162 * rootcontext.cs: fixed compilation of corlib.
18164 2002-12-19 Miguel de Icaza <miguel@ximian.com>
18166 * attribute.cs (Attributes.Contains): Add new method.
18168 * class.cs (MethodCore.LabelParameters): if the parameter is an
18169 `out' parameter, check that no attribute `[In]' has been passed.
18171 * enum.cs: Handle the `value__' name in an enumeration.
18173 2002-12-14 Jaroslaw Kowalski <jarek@atm.com.pl>
18175 * decl.cs: Added special case to allow overrides on "protected
18178 2002-12-18 Ravi Pratap <ravi@ximian.com>
18180 * attribute.cs (Attributes.AddAttributeSection): Rename to this
18181 since it makes much more sense.
18183 (Attributes.ctor): Don't require a Location parameter.
18185 * rootcontext.cs (AddGlobalAttributeSection): Rename again.
18187 * attribute.cs (ApplyAttributes): Remove extra Location parameters
18188 since we already have that information per attribute.
18190 * everywhere : make appropriate changes.
18192 * class.cs (LabelParameters): Write the code which actually
18193 applies attributes to the return type. We can't do this on the MS
18194 .NET runtime so we flag a warning in the case an exception is
18197 2002-12-18 Miguel de Icaza <miguel@ximian.com>
18199 * const.cs: Handle implicit null conversions here too.
18201 2002-12-17 Ravi Pratap <ravi@ximian.com>
18203 * class.cs (MethodCore.LabelParameters): Remove the extra
18204 Type [] parameter since it is completely unnecessary. Instead
18205 pass in the method's attributes so that we can extract
18206 the "return" attribute.
18208 2002-12-17 Miguel de Icaza <miguel@ximian.com>
18210 * cs-parser.jay (parse): Use Report.Error to flag errors instead
18211 of ignoring it and letting the compile continue.
18213 * typemanager.cs (ChangeType): use an extra argument to return an
18214 error condition instead of throwing an exception.
18216 2002-12-15 Miguel de Icaza <miguel@ximian.com>
18218 * expression.cs (Unary.TryReduce): mimic the code for the regular
18219 code path. Perform an implicit cast in the cases where we can
18220 implicitly convert to one of the integral types, and then reduce
18221 based on that constant. This fixes bug #35483.
18223 2002-12-14 Gonzalo Paniagua Javier <gonzalo@ximian.com>
18225 * typemanager.cs: fixed cut & paste error in GetRemoveMethod.
18227 2002-12-13 Gonzalo Paniagua Javier <gonzalo@ximian.com>
18229 * namespace.cs: fixed bug #35489.
18231 2002-12-12 Miguel de Icaza <miguel@ximian.com>
18233 * class.cs: Remove some dead code.
18235 * cs-parser.jay: Estimate the number of methods needed
18236 (RootContext.MethodCount);
18238 * cs-tokenizer.cs: Use char arrays for parsing identifiers and
18239 numbers instead of StringBuilders.
18241 * support.cs (PtrHashtable): Add constructor with initial size;
18242 We can now reduce reallocations of the method table.
18244 2002-12-10 Ravi Pratap <ravi@ximian.com>
18246 * attribute.cs (ApplyAttributes): Keep track of the emitted
18247 attributes on a per-target basis. This fixes bug #35413.
18249 2002-12-10 Miguel de Icaza <miguel@ximian.com>
18251 * driver.cs (MainDriver): On rotor encoding 28591 does not exist,
18252 default to the Windows 1252 encoding.
18254 (UnixParseOption): Support version, thanks to Alp for the missing
18257 * AssemblyInfo.cs: Add nice assembly information.
18259 * cs-tokenizer.cs: Add fix from Felix to the #if/#else handler
18262 * cs-parser.jay: Allow a trailing comma before the close bracked
18263 in the attribute_section production.
18265 * ecore.cs (FieldExpr.AddressOf): Until I figure out why the
18266 address of the instance was being taken, I will take this out,
18267 because we take the address of the object immediately here.
18269 2002-12-09 Ravi Pratap <ravi@ximian.com>
18271 * typemanager.cs (AreMultipleAllowed): Take care of the most
18272 obvious case where attribute type is not in the current assembly -
18275 2002-12-08 Miguel de Icaza <miguel@ximian.com>
18277 * ecore.cs (SimpleName.DoResolve): First perform lookups on using
18278 definitions, instead of doing that afterwards.
18280 Also we use a nice little hack, depending on the constructor, we
18281 know if we are a "composed" name or a simple name. Hence, we
18282 avoid the IndexOf test, and we avoid
18284 * codegen.cs: Add code to assist in a bug reporter to track down
18285 the source of a compiler crash.
18287 2002-12-07 Ravi Pratap <ravi@ximian.com>
18289 * attribute.cs (Attribute.ApplyAttributes) : Keep track of which attribute
18290 types have been emitted for a given element and flag an error
18291 if something which does not have AllowMultiple set is used more
18294 * typemanager.cs (RegisterAttributeAllowMultiple): Keep track of
18295 attribute types and their corresponding AllowMultiple properties
18297 (AreMultipleAllowed): Check the property for a given type.
18299 * attribute.cs (Attribute.ApplyAttributes): Register the AllowMultiple
18300 property in the case we have a TypeContainer.
18302 (Attributes.AddAttribute): Detect duplicates and just skip on
18303 adding them. This trivial fix catches a pretty gross error in our
18304 attribute emission - global attributes were being emitted twice!
18306 Bugzilla bug #33187 is now fixed.
18308 2002-12-06 Miguel de Icaza <miguel@ximian.com>
18310 * cs-tokenizer.cs (pp_expr): Properly recurse here (use pp_expr
18311 instead of pp_and).
18313 * expression.cs (Binary.ResolveOperator): I can only use the
18314 Concat (string, string, string) and Concat (string, string,
18315 string, string) if the child is actually a concatenation of
18318 2002-12-04 Miguel de Icaza <miguel@ximian.com>
18320 * cs-tokenizer.cs: Small fix, because decimal_digits is used in a
18321 context where we need a 2-character lookahead.
18323 * pending.cs (PendingImplementation): Rework so we can keep track
18324 of interface types all the time, and flag those which were
18325 implemented by parents as optional.
18327 2002-12-03 Miguel de Icaza <miguel@ximian.com>
18329 * expression.cs (Binary.ResolveOperator): Use
18330 String.Concat(string,string,string) or
18331 String.Concat(string,string,string,string) when possible.
18333 * typemanager: More helper methods.
18336 Tue Dec 3 19:32:04 CET 2002 Paolo Molaro <lupus@ximian.com>
18338 * pending.cs: remove the bogus return from GetMissingInterfaces()
18339 (see the 2002-11-06 entry: the mono runtime is now fixed in cvs).
18341 2002-12-02 Gonzalo Paniagua Javier <gonzalo@ximian.com>
18343 * namespace.cs: avoid duplicated 'using xxx' being added to
18344 using_clauses. This prevents mcs from issuing and 'ambiguous type' error
18345 when we get more than one 'using' statement for the same namespace.
18346 Report a CS0105 warning for it.
18348 2002-11-30 Miguel de Icaza <miguel@ximian.com>
18350 * cs-tokenizer.cs (consume_identifier): use read directly, instead
18351 of calling getChar/putback, uses internal knowledge of it.
18353 (xtoken): Reorder tokenizer so most common patterns are checked
18354 first. This reduces the compilation time in another 5% (from 8.11s
18355 average to 7.73s for bootstrapping mcs on my Mobile p4/1.8ghz).
18357 The parsing time is 22% of the compilation in mcs, and from that
18358 64% is spent on the tokenization process.
18360 I tried using a binary search for keywords, but this is slower
18361 than the hashtable. Another option would be to do a couple of
18364 * Not use a StringBuilder, instead use an array of chars,
18365 with a set value. Notice that this way we could catch
18366 the 645 error without having to do it *afterwards*.
18368 * We could write a hand-parser to avoid the hashtable
18369 compares altogether.
18371 The identifier consumption process takes 37% of the tokenization
18372 time. Another 15% is spent on is_number. 56% of the time spent
18373 on is_number is spent on Int64.Parse:
18375 * We could probably choose based on the string length to
18376 use Int32.Parse or Int64.Parse and avoid all the 64-bit
18379 Another 3% is spend on wrapping `xtoken' in the `token' function.
18381 Handle 0xa0 as whitespace (#34752)
18383 2002-11-26 Miguel de Icaza <miguel@ximian.com>
18385 * typemanager.cs (IsCLRType): New routine to tell whether a type
18386 is one of the builtin types.
18388 Maybe it needs to use TypeCodes to be faster. Maybe we could use
18389 typecode in more places instead of doing pointer comparissions.
18390 We could leverage some knowledge about the way the typecodes are
18393 New code to cache namespaces in assemblies, it is currently not
18394 invoked, to be used soon.
18396 * decl.cs (DeclSpace.MakeFQN): Simple optimization.
18398 * expression.cs (Binary.ResolveOperator): specially handle
18399 strings, and do not perform user-defined operator overloading for
18402 2002-11-24 Miguel de Icaza <miguel@ximian.com>
18404 * cs-tokenizer.cs: Avoid calling Char.IsDigit which is an
18405 internalcall as it is a pretty simple operation; Avoid whenever
18406 possible to call Char.IsLetter.
18408 (consume_identifier): Cut by half the number of
18409 hashtable calls by merging the is_keyword and GetKeyword behavior.
18411 Do not short-circuit, because if we do, we
18412 report errors (ie, #if false && true would produce an invalid
18416 2002-11-24 Martin Baulig <martin@ximian.com>
18418 * expression.cs (Cast.TryReduce): If we're in checked syntax,
18419 check constant ranges and report a CS0221. Fixes #33186.
18421 2002-11-24 Martin Baulig <martin@ximian.com>
18423 * cs-parser.jay: Make this work for uninitialized variable
18424 declarations in the `for' initializer. Fixes #32416.
18426 2002-11-24 Martin Baulig <martin@ximian.com>
18428 * ecore.cs (Expression.ConvertExplicit): Make casting from/to
18429 System.Enum actually work. Fixes bug #32269, added verify-6.cs.
18431 2002-11-24 Martin Baulig <martin@ximian.com>
18433 * expression.cs (Binary.DoNumericPromotions): Added `check_user_conv'
18434 argument; if true, we also check for user-defined conversions.
18435 This is only needed if both arguments are of a user-defined type.
18436 Fixes #30443, added test-175.cs.
18437 (Binary.ForceConversion): Pass the location argument to ConvertImplicit.
18439 * ecore.cs (Expression.ImplicitUserConversionExists): New method.
18441 2002-11-24 Martin Baulig <martin@ximian.com>
18443 * expression.cs (ArrayAccess.GetStoreOpcode): New public static
18444 function to get the store opcode.
18445 (Invocation.EmitParams): Call ArrayAccess.GetStoreOpcode() and
18446 only emit the Ldelema if the store opcode is Stobj. You must run
18447 both test-34 and test-167 to test this. Fixes #34529.
18449 2002-11-23 Martin Baulig <martin@ximian.com>
18451 * ecore.cs (Expression.MemberLookup): Added additional
18452 `qualifier_type' argument which is used when we're being called
18453 from MemberAccess.DoResolve() and null if we're called from a
18455 (Expression.MemberLookupFailed): New method to report errors; this
18456 does the CS1540 check and reports the correct error message.
18458 * typemanager.cs (MemberLookup): Added additional `qualifier_type'
18459 argument for the CS1540 check and redone the way how we're dealing
18460 with private members. See the comment in the source code for details.
18461 (FilterWithClosure): Reverted this back to revision 1.197; renamed
18462 `closure_start_type' to `closure_qualifier_type' and check whether
18463 it's not null. It was not this filter being broken, it was just
18464 being called with the wrong arguments.
18466 * expression.cs (MemberAccess.DoResolve): use MemberLookupFinal()
18467 and pass it the correct `qualifier_type'; this also does the error
18470 2002-11-22 Miguel de Icaza <miguel@ximian.com>
18472 * expression.cs (Invocation.EmitParams): If the we are dealing
18473 with a non-built-in value type, load its address as well.
18475 (ArrayCreation): Use a a pretty constant instead
18476 of the hardcoded value 2. Use 6 instead of 2 for the number of
18477 static initializers.
18479 (ArrayCreation.EmitDynamicInitializers): Peel enumerations,
18480 because they are not really value types, just glorified integers.
18482 * driver.cs: Do not append .exe, the CSC compiler does not do it.
18484 * ecore.cs: Remove redundant code for enumerations, make them use
18485 the same code path as everything else, fixes the casting issue
18486 with enumerations in Windows.Forms.
18488 * attribute.cs: Do only cast to string if it is a string, the
18489 validation happens later.
18491 * typemanager.cs: Temproary hack to avoid a bootstrap issue until
18492 people upgrade their corlibs.
18494 * ecore.cs: Oops, enumerations were not following the entire code path
18496 2002-11-21 Miguel de Icaza <miguel@ximian.com>
18498 * typemanager.cs (FilterWithClosure): Commented out the test for
18499 1540 in typemanager.cs, as it has problems when accessing
18500 protected methods from a parent class (see test-174.cs).
18502 * attribute.cs (Attribute.ValidateGuid): new method.
18503 (Attribute.Resolve): Use above.
18505 2002-11-19 Miguel de Icaza <miguel@ximian.com>
18507 * enum.cs: In FindMembers, perform a recursive lookup for values. (34308)
18509 * ecore.cs (SimpleName.SimpleNameResolve): Remove the special
18510 handling for enumerations, as we only needed the TypeContainer
18511 functionality to begin with (this is required for the fix below to
18512 work for enums that reference constants in a container class for
18515 * codegen.cs (EmitContext): Make TypeContainer a DeclSpace.
18517 * enum.cs (Enum.Define): Use `this' instead of parent, so we have
18518 a valid TypeBuilder to perform lookups on.o
18520 * class.cs (InheritableMemberSignatureCompare): Use true in the
18521 call to GetGetMethod and GetSetMethod, because we are comparing
18522 the signature, and we need to get the methods *even* if they are
18525 (PropertyBase.CheckBase): ditto.
18527 * statement.cs (Switch.ResolveAndReduce, Block.EmitMeta,
18528 GotoCase.Resolve): Use Peel on EmpytCasts.
18530 * ecore.cs (EmptyCast): drop child, add Peel method.
18532 2002-11-17 Martin Baulig <martin@ximian.com>
18534 * ecore.cs (EmptyCast.Child): New public property.
18536 * statement.cs (SwitchLabel.ResolveAndReduce): Check whether the
18537 label resolved to an EmptyCast. Fixes #34162.
18538 (GotoCase.Resolve): Likewise.
18539 (Block.EmitMeta): Likewise.
18541 2002-11-17 Martin Baulig <martin@ximian.com>
18543 * expression.cs (Invocation.BetterConversion): Prefer int over
18544 uint; short over ushort; long over ulong for integer literals.
18545 Use ImplicitConversionExists instead of StandardConversionExists
18546 since we also need to check for user-defined implicit conversions.
18547 Fixes #34165. Added test-173.cs.
18549 2002-11-16 Martin Baulig <martin@ximian.com>
18551 * expression.cs (Binary.EmitBranchable): Eliminate comparisions
18552 with the `true' and `false' literals. Fixes #33151.
18554 2002-11-16 Martin Baulig <martin@ximian.com>
18556 * typemanager.cs (RealMemberLookup): Reverted Miguel's patch from
18557 October 22nd; don't do the cs1540 check for static members.
18559 * ecore.cs (PropertyExpr.ResolveAccessors): Rewrote this; we're
18560 now using our own filter here and doing the cs1540 check again.
18562 2002-11-16 Martin Baulig <martin@ximian.com>
18564 * support.cs (InternalParameters): Don't crash if we don't have
18565 any fixed parameters. Fixes #33532.
18567 2002-11-16 Martin Baulig <martin@ximian.com>
18569 * decl.cs (MemberCache.AddMethods): Use BindingFlags.FlattenHierarchy
18570 when looking up static methods to make this work on Windows.
18573 2002-11-16 Martin Baulig <martin@ximian.com>
18575 * ecore.cs (PropertyExpr.VerifyAssignable): Check whether we have
18576 a setter rather than using PropertyInfo.CanWrite.
18578 2002-11-15 Nick Drochak <ndrochak@gol.com>
18580 * class.cs: Allow acces to block member by subclasses. Fixes build
18583 2002-11-14 Martin Baulig <martin@ximian.com>
18585 * class.cs (Constructor.Emit): Added the extern/block check.
18588 2002-11-14 Martin Baulig <martin@ximian.com>
18590 * expression.cs (IndexerAccess.DoResolve): Do a DeclaredOnly
18591 iteration while looking for indexers, this is needed because the
18592 indexer may have a different name in our base classes. Fixed the
18593 error reporting (no indexers at all, not get accessor, no
18594 overloaded match). Fixes bug #33089.
18595 (IndexerAccess.DoResolveLValue): Likewise.
18597 2002-11-14 Martin Baulig <martin@ximian.com>
18599 * class.cs (PropertyBase.CheckBase): Make this work for multiple
18600 indexers. Fixes the first part of bug #33089.
18601 (MethodSignature.InheritableMemberSignatureCompare): Added support
18604 2002-11-13 Ravi Pratap <ravi@ximian.com>
18606 * attribute.cs (Attribute.Resolve): Catch the
18607 NullReferenceException and report it since it isn't supposed to
18610 2002-11-12 Miguel de Icaza <miguel@ximian.com>
18612 * expression.cs (Binary.EmitBranchable): Also handle the cases for
18613 LogicalOr and LogicalAnd that can benefit from recursively
18614 handling EmitBranchable. The code now should be nice for Paolo.
18616 2002-11-08 Miguel de Icaza <miguel@ximian.com>
18618 * typemanager.cs (LookupType): Added a negative-hit hashtable for
18619 the Type lookups, as we perform quite a number of lookups on
18620 non-Types. This can be removed once we can deterministically tell
18621 whether we have a type or a namespace in advance.
18623 But this might require special hacks from our corlib.
18627 * ecore.cs (TryImplicitIntConversion): Handle conversions to float
18628 and double which avoids a conversion from an integer to a double.
18630 * expression.cs: tiny optimization, avoid calling IsConstant,
18631 because it effectively performs the lookup twice.
18633 2002-11-06 Miguel de Icaza <miguel@ximian.com>
18635 But a bogus return here to keep the semantics of the old code
18636 until the Mono runtime is fixed.
18638 * pending.cs (GetMissingInterfaces): New method used to remove all
18639 the interfaces that are already implemented by our parent
18640 classes from the list of pending methods.
18642 * interface.cs: Add checks for calls after ResolveTypeExpr.
18644 2002-11-05 Miguel de Icaza <miguel@ximian.com>
18646 * class.cs (Class.Emit): Report warning 67: event not used if the
18647 warning level is beyond 3.
18649 * ecore.cs (Expression.ConvertExplicit): Missed a check for expr
18650 being a NullLiteral.
18652 * cs-parser.jay: Fix, Gonzalo reverted the order of the rank
18655 * class.cs (TypeContainer.GetClassBases): Cover a missing code
18656 path that might fail if a type can not be resolved.
18658 * expression.cs (Binary.Emit): Emit unsigned versions of the
18661 * driver.cs: use error 5.
18663 2002-11-02 Gonzalo Paniagua Javier <gonzalo@gnome-db.org>
18665 * cs-parser.jay: simplified a rule and 5 SR conflicts dissapeared.
18667 2002-11-01 Miguel de Icaza <miguel@ximian.com>
18669 * cs-parser.jay (switch_section): A beautiful patch from Martin
18670 Baulig that fixed 33094.
18672 2002-10-31 Miguel de Icaza <miguel@ximian.com>
18674 * ecore.cs (PropertyExpr.DoResolveLValue, PropertyExpr.DoResolve):
18675 Check whether the base is abstract and report an error if so.
18677 * expression.cs (IndexerAccess.DoResolveLValue,
18678 IndexerAccess.DoResolve): ditto.
18680 (Invocation.DoResolve): ditto.
18682 (Invocation.FullMethodDesc): Improve the report string.
18684 * statement.cs (Block): Eliminate IsVariableDefined as it is
18685 basically just a wrapper for GetVariableInfo.
18687 * ecore.cs (SimpleName): Use new
18689 * support.cs (ReflectionParamter.ParameterType): We unwrap the
18690 type, as we return the actual parameter ref/unref state on a
18693 2002-10-30 Miguel de Icaza <miguel@ximian.com>
18695 * support.cs: Return proper flags REF/OUT fixing the previous
18698 * expression.cs: Reverted last patch, that was wrong. Is_ref is
18699 not used to mean `ref' but `ref or out' in ParameterReference
18701 * delegate.cs (FullDelegateDesc): use ParameterDesc to get the
18702 full type signature instead of calling TypeManger.CSharpName
18705 * support.cs (InternalParameters.ParameterDesc): Do not compare
18706 directly to the modflags, because REF/OUT will actually be bitsets
18709 * delegate.cs (VerifyMethod): Check also the modifiers.
18711 * cs-tokenizer.cs: Fix bug where floating point values with an
18712 exponent where a sign was missing was ignored.
18714 * driver.cs: Allow multiple assemblies to be specified in a single
18717 2002-10-28 Miguel de Icaza <miguel@ximian.com>
18719 * cs-parser.jay: Ugly. We had to add a multiplicative_expression,
18720 because identifiers after a parenthesis would end up in this kind
18721 of production, and we needed to desamiguate it for having casts
18724 (UserDefinedType *) xxx
18726 2002-10-24 Miguel de Icaza <miguel@ximian.com>
18728 * typemanager.cs (RealMemberLookup): when we deal with a subclass,
18729 we should set on the Bindingflags.NonPublic, but not turn on
18730 private_ok. private_ok controls whether a Private member is
18731 returned (this is chekced on the filter routine), while the
18732 BindingFlags.NonPublic just controls whether private/protected
18733 will be allowed. This fixes the problem part of the problem of
18734 private properties being allowed to be used in derived classes.
18736 * expression.cs (BaseAccess): Provide an DoResolveLValue method,
18737 so we can call the children DoResolveLValue method (this will
18738 properly signal errors on lvalue assignments to base properties)
18740 * ecore.cs (PropertyExpr.ResolveAccessors): If both setter and
18741 getter are null, and we have a property info, we know that this
18742 happened because the lookup failed, so we report an error 122 for
18743 protection level violation.
18745 We also silently return if setter and getter are null in the
18746 resolve functions, this condition only happens if we have flagged
18747 the error before. This is the other half of the problem.
18749 (PropertyExpr.ResolveAccessors): Turns out that PropertyInfo does
18750 not have accessibility information, that is why we were returning
18751 true in the filter function in typemanager.cs.
18753 To properly report 122 (property is inaccessible because of its
18754 protection level) correctly, we report this error in ResolveAccess
18755 by failing if both the setter and the getter are lacking (ie, the
18758 DoResolve and DoLResolve have been modified to check for both
18759 setter/getter being null and returning silently, the reason being
18760 that I did not want to put the knowledge about this error in upper
18763 int old = Report.Errors;
18764 x = new PropertyExpr (...);
18765 if (old != Report.Errors)
18770 So the property expr is returned, but it is invalid, so the error
18771 will be flagged during the resolve process.
18773 * class.cs: Remove InheritablePropertySignatureCompare from the
18774 class, as we no longer depend on the property signature to compute
18775 whether it is possible to implement a method or not.
18777 The reason is that calling PropertyInfo.GetGetMethod will return
18778 null (in .NET, in Mono it works, and we should change this), in
18779 cases where the Get Method does not exist in that particular
18784 class X { public virtual int A { get { return 1; } } }
18786 class Z : Y { public override int A { get { return 2; } } }
18788 Would fail in Z because the parent (Y) would not have the property
18789 defined. So we avoid this completely now (because the alternative
18790 fix was ugly and slow), and we now depend exclusively on the
18793 (PropertyBase.CheckBase): Use a method-base mechanism to find our
18794 reference method, instead of using the property.
18796 * typemanager.cs (GetPropertyGetter, GetPropertySetter): These
18797 routines are gone now.
18799 * typemanager.cs (GetPropertyGetter, GetPropertySetter): swap the
18800 names, they were incorrectly named.
18802 * cs-tokenizer.cs: Return are more gentle token on failure.
18804 * pending.cs (PendingImplementation.InterfaceMethod): This routine
18805 had an out-of-sync index variable, which caused it to remove from
18806 the list of pending methods the wrong method sometimes.
18808 2002-10-22 Miguel de Icaza <miguel@ximian.com>
18810 * ecore.cs (PropertyExpr): Do not use PropertyInfo.CanRead,
18811 CanWrite, because those refer to this particular instance of the
18812 property, and do not take into account the fact that we can
18813 override single members of a property.
18815 Constructor requires an EmitContext. The resolution process does
18816 not happen here, but we need to compute the accessors before,
18817 because the resolution does not always happen for properties.
18819 * typemanager.cs (RealMemberLookup): Set private_ok if we are a
18820 subclass, before we did not update this flag, but we did update
18823 (GetAccessors): Drop this routine, as it did not work in the
18824 presence of partially overwritten set/get methods.
18826 Notice that this broke the cs1540 detection, but that will require
18829 2002-10-22 Gonzalo Paniagua Javier <gonzalo@ximian.com>
18833 * driver.cs: issue a warning instead of an error if we don't support
18834 debugging for the platform. Also ignore a couple of errors that may
18835 arise when trying to write the symbols. Undo my previous patch.
18837 2002-10-22 Gonzalo Paniagua Javier <gonzalo@ximian.com>
18839 * driver.cs: ignore /debug switch except for Unix platforms.
18841 2002-10-23 Nick Drochak <ndrochak@gol.com>
18843 * makefile: Remove mcs2.exe and mcs3.exe on 'make clean'
18845 2002-10-21 Miguel de Icaza <miguel@ximian.com>
18847 * driver.cs: Do not make mcs-debug conditional, so we do not break
18848 builds that use it.
18850 * statement.cs (UsageVector.MergeChildren): I would like Martin to
18851 review this patch. But basically after all the children variables
18852 have been merged, the value of "Breaks" was not being set to
18853 new_breaks for Switch blocks. I think that it should be set after
18854 it has executed. Currently I set this to the value of new_breaks,
18855 but only if new_breaks is FlowReturn.ALWAYS, which is a bit
18856 conservative, but I do not understand this code very well.
18858 I did not break anything in the build, so that is good ;-)
18860 * cs-tokenizer.cs: Also allow \r in comments as a line separator.
18862 2002-10-20 Mark Crichton <crichton@gimp.org>
18864 * cfold.cs: Fixed compile blocker. Really fixed it this time.
18866 2002-10-20 Nick Drochak <ndrochak@gol.com>
18868 * cfold.cs: Fixed compile blocker.
18870 2002-10-20 Miguel de Icaza <miguel@ximian.com>
18872 * driver.cs: I was chekcing the key, not the file.
18874 2002-10-19 Ravi Pratap <ravi@ximian.com>
18876 * ecore.cs (UserDefinedConversion): Get rid of the bogus error
18877 message that we were generating - we just need to silently return
18880 2002-10-19 Miguel de Icaza <miguel@ximian.com>
18882 * class.cs (Event.Define): Change my previous commit, as this
18883 breaks the debugger. This is a temporary hack, as it seems like
18884 the compiler is generating events incorrectly to begin with.
18886 * expression.cs (Binary.ResolveOperator): Added support for
18887 "U operator - (E x, E y)"
18889 * cfold.cs (BinaryFold): Added support for "U operator - (E x, E
18892 * ecore.cs (FieldExpr.AddressOf): We had a special code path for
18893 init-only variables, but this path did not take into account that
18894 there might be also instance readonly variables. Correct this
18897 This fixes bug 32253
18899 * delegate.cs (NewDelegate.DoResolve): Catch creation of unsafe
18902 * driver.cs: Change the extension for modules to `netmodule'
18904 * cs-parser.jay: Improved slightly the location tracking for
18905 the debugger symbols.
18907 * class.cs (Event.Define): Use Modifiers.FieldAttr on the
18908 modifiers that were specified instead of the hardcoded value
18909 (FamAndAssem). This was basically ignoring the static modifier,
18910 and others. Fixes 32429.
18912 * statement.cs (Switch.SimpleSwitchEmit): Simplified the code, and
18913 fixed a bug in the process (32476)
18915 * expression.cs (ArrayAccess.EmitAssign): Patch from
18916 hwang_rob@yahoo.ca that fixes bug 31834.3
18918 2002-10-18 Miguel de Icaza <miguel@ximian.com>
18920 * driver.cs: Make the module extension .netmodule.
18922 2002-10-16 Miguel de Icaza <miguel@ximian.com>
18924 * driver.cs: Report an error if the resource file is not found
18925 instead of crashing.
18927 * ecore.cs (PropertyExpr.EmitAssign): Pass IsBase instead of
18928 false, like Emit does.
18930 2002-10-16 Nick Drochak <ndrochak@gol.com>
18932 * typemanager.cs: Remove unused private member. Also reported mcs
18933 bug to report this as a warning like csc.
18935 2002-10-15 Martin Baulig <martin@gnome.org>
18937 * statement.cs (Statement.Emit): Made this a virtual method; emits
18938 the line number info and calls DoEmit().
18939 (Statement.DoEmit): New protected abstract method, formerly knows
18940 as Statement.Emit().
18942 * codegen.cs (EmitContext.Mark): Check whether we have a symbol writer.
18944 2002-10-11 Miguel de Icaza <miguel@ximian.com>
18946 * class.cs: Following the comment from 2002-09-26 to AddMethod, I
18947 have fixed a remaining problem: not every AddXXXX was adding a
18948 fully qualified name.
18950 Now everyone registers a fully qualified name in the DeclSpace as
18951 being defined instead of the partial name.
18953 Downsides: we are slower than we need to be due to the excess
18954 copies and the names being registered this way.
18956 The reason for this is that we currently depend (on the corlib
18957 bootstrap for instance) that types are fully qualified, because
18958 we dump all the types in the namespace, and we should really have
18959 types inserted into the proper namespace, so we can only store the
18960 basenames in the defined_names array.
18962 2002-10-10 Martin Baulig <martin@gnome.org>
18964 * expression.cs (ArrayAccess.EmitStoreOpcode): Reverted the patch
18965 from bug #31834, see the bug report for a testcase which is
18968 2002-10-10 Martin Baulig <martin@gnome.org>
18970 * codegen.cs (EmitContext.Breaks): Removed, we're now using the
18971 flow analysis code for this.
18973 * statement.cs (Do, While, For): Tell the flow analysis code about
18975 (FlowBranching.UsageVector): Added support for infinite loops.
18976 (Block.Resolve): Moved the dead code elimination here and use flow
18979 2002-10-09 Miguel de Icaza <miguel@ximian.com>
18981 * class.cs (Field.Define): Catch cycles on struct type
18984 * typemanager.cs (IsUnmanagedtype): Do not recursively check
18985 fields if the fields are static. We only need to check instance
18988 * expression.cs (As.DoResolve): Test for reference type.
18990 * statement.cs (Using.ResolveExpression): Use
18991 ConvertImplicitRequired, not ConvertImplicit which reports an
18993 (Using.ResolveLocalVariableDecls): ditto.
18995 * expression.cs (Binary.ResolveOperator): Report errors in a few
18996 places where we had to.
18998 * typemanager.cs (IsUnmanagedtype): Finish implementation.
19000 2002-10-08 Miguel de Icaza <miguel@ximian.com>
19002 * expression.cs: Use StoreFromPtr instead of extracting the type
19003 and then trying to use Stelem. Patch is from hwang_rob@yahoo.ca
19005 * ecore.cs (ImplicitReferenceConversion): It is possible to assign
19006 an enumeration value to a System.Enum, but System.Enum is not a
19007 value type, but an class type, so we need to box.
19009 (Expression.ConvertExplicit): One codepath could return
19010 errors but not flag them. Fix this. Fixes #31853
19012 * parameter.cs (Resolve): Do not allow void as a parameter type.
19014 2002-10-06 Martin Baulig <martin@gnome.org>
19016 * statemenc.cs (FlowBranching.SetParameterAssigned): Don't crash
19017 if it's a class type and not a struct. Fixes #31815.
19019 2002-10-06 Martin Baulig <martin@gnome.org>
19021 * statement.cs: Reworked the flow analysis code a bit to make it
19022 usable for dead code elimination.
19024 2002-10-06 Gonzalo Paniagua Javier <gonzalo@ximian.com>
19026 * cs-parser.jay: allow empty source files. Fixes bug #31781.
19028 2002-10-04 Miguel de Icaza <miguel@ximian.com>
19030 * expression.cs (ComposedCast.DoResolveType): A quick workaround
19031 to fix the test 165, will investigate deeper.
19033 2002-10-04 Martin Baulig <martin@gnome.org>
19035 * statement.cs (FlowBranching.UsageVector.MergeChildren): Make
19036 finally blocks actually work.
19037 (Try.Resolve): We don't need to create a sibling for `finally' if
19038 there is no finally block.
19040 2002-10-04 Martin Baulig <martin@gnome.org>
19042 * class.cs (Constructor.Define): The default accessibility for a
19043 non-default constructor is private, not public.
19045 2002-10-04 Miguel de Icaza <miguel@ximian.com>
19047 * class.cs (Constructor): Make AllowedModifiers public, add
19050 * cs-parser.jay: Perform the modifiers test here, as the
19051 constructor for the Constructor class usually receives a zero
19052 because of the way we create it (first we create, later we
19053 customize, and we were never checking the modifiers).
19055 * typemanager.cs (Typemanager.LookupTypeDirect): This new function
19056 is a version of LookupTypeReflection that includes the type-name
19057 cache. This can be used as a fast path for functions that know
19058 the fully qualified name and are only calling into *.GetType() to
19059 obtain a composed type.
19061 This is also used by TypeManager.LookupType during its type
19064 (LookupType): We now also track the real type name, as sometimes
19065 we can get a quey for the real type name from things like
19066 ComposedCast. This fixes bug 31422.
19068 * expression.cs (ComposedCast.Resolve): Since we are obtaining a
19069 complete type fullname, it does not have to go through the type
19070 resolution system to obtain the composed version of the type (for
19071 obtaining arrays or pointers).
19073 (Conditional.Emit): Use the EmitBoolExpression to
19074 generate nicer code, as requested by Paolo.
19076 (ArrayCreation.CheckIndices): Use the patch from
19077 hwang_rob@yahoo.ca to validate the array initializers.
19079 2002-10-03 Miguel de Icaza <miguel@ximian.com>
19081 * class.cs (ConstructorInitializer.Emit): simplify code by using
19082 Invocation.EmitCall, and at the same time, fix the bugs in calling
19083 parent constructors that took variable arguments.
19085 * ecore.cs (Expression.ConvertNumericExplicit,
19086 Expression.ImplicitNumericConversion): Remove the code that
19087 manually wrapped decimal (InternalTypeConstructor call is now gone
19090 * expression.cs (Cast.TryReduce): Also handle decimal types when
19091 trying to perform a constant fold on the type.
19093 * typemanager.cs (IsUnmanagedtype): Partially implemented.
19095 * parameter.cs: Removed ResolveAndDefine, as it was not needed, as
19096 that only turned off an error report, and did nothing else.
19098 2002-10-02 Miguel de Icaza <miguel@ximian.com>
19100 * driver.cs: Handle and ignore /fullpaths
19102 2002-10-01 Miguel de Icaza <miguel@ximian.com>
19104 * expression.cs (Binary.ResolveOperator): Catch the case where
19105 DoNumericPromotions returns true,
19107 (Binary.DoNumericPromotions): Simplify the code, and the tests.
19109 2002-09-27 Miguel de Icaza <miguel@ximian.com>
19111 * ecore.cs (EventExpr.Emit): Instead of emitting an exception,
19114 2002-09-26 Miguel de Icaza <miguel@ximian.com>
19116 * ecore.cs (ConvertNumericExplicit): It is not enough that the
19117 conversion exists, but it is also required that the conversion be
19118 performed. This manifested in "(Type64Enum) 2".
19120 * class.cs (TypeManager.AddMethod): The fix is not to change
19121 AddEnum, because that one was using a fully qualified name (every
19122 DeclSpace derivative does), but to change the AddMethod routine
19123 that was using an un-namespaced name. This now correctly reports
19124 the duplicated name.
19126 Revert patch until I can properly fix it. The issue
19127 is that we have a shared Type space across all namespaces
19128 currently, which is wrong.
19130 Options include making the Namespace a DeclSpace, and merge
19131 current_namespace/current_container in the parser.
19133 2002-09-25 Miguel de Icaza <miguel@ximian.com>
19135 * cs-parser.jay: Improve error reporting when we get a different
19136 kind of expression in local_variable_type and
19137 local_variable_pointer_type.
19139 Propagate this to avoid missleading errors being reported.
19141 * ecore.cs (ImplicitReferenceConversion): treat
19142 TypeManager.value_type as a target just like object_type. As
19147 Is valid, and needs to result in the int 1 being boxed before it
19148 is assigned to the value type v.
19150 * class.cs (TypeContainer.AddEnum): Use the basename, not the name
19151 to validate the enumeration name.
19153 * expression.cs (ArrayAccess.EmitAssign): Mimic the same test from
19154 EmitDynamicInitializers for the criteria to use Ldelema. Thanks
19155 to hwang_rob@yahoo.ca for finding the bug and providing a patch.
19157 * ecore.cs (TryImplicitIntConversion): When doing an
19158 implicit-enumeration-conversion, check if the type is 64-bits and
19159 perform a conversion before passing to EnumConstant.
19161 2002-09-23 Miguel de Icaza <miguel@ximian.com>
19163 * decl.cs (Error_AmbiguousTypeReference); New routine used to
19164 report ambiguous type references. Unlike the MS version, we
19165 report what the ambiguity is. Innovation at work ;-)
19167 (DeclSpace.FindType): Require a location argument to
19168 display when we display an ambiguous error.
19170 * ecore.cs: (SimpleName.DoResolveType): Pass location to FindType.
19172 * interface.cs (GetInterfaceTypeByName): Pass location to FindType.
19174 * expression.cs (EmitDynamicInitializers): Apply patch from
19175 hwang_rob@yahoo.ca that fixes the order in which we emit our
19178 2002-09-21 Martin Baulig <martin@gnome.org>
19180 * delegate.cs (Delegate.VerifyApplicability): Make this work if the
19181 delegate takes no arguments.
19183 2002-09-20 Miguel de Icaza <miguel@ximian.com>
19185 * constant.cs: Use Conv_U8 instead of Conv_I8 when loading longs
19188 * expression.cs: Extract the underlying type.
19190 * ecore.cs (StoreFromPtr): Use TypeManager.IsEnumType instad of IsEnum
19192 * decl.cs (FindType): Sorry about this, fixed the type lookup bug.
19194 2002-09-19 Miguel de Icaza <miguel@ximian.com>
19196 * class.cs (TypeContainer.DefineType): We can not use the nice
19197 PackingSize with the size set to 1 DefineType method, because it
19198 will not allow us to define the interfaces that the struct
19201 This completes the fixing of bug 27287
19203 * ecore.cs (Expresion.ImplicitReferenceConversion): `class-type S'
19204 means also structs. This fixes part of the problem.
19205 (Expresion.ImplicitReferenceConversionExists): ditto.
19207 * decl.cs (DeclSparce.ResolveType): Only report the type-not-found
19208 error if there were no errors reported during the type lookup
19209 process, to avoid duplicates or redundant errors. Without this
19210 you would get an ambiguous errors plus a type not found. We have
19211 beaten the user enough with the first error.
19213 (DeclSparce.FindType): Emit a warning if we have an ambiguous
19216 * ecore.cs (SimpleName.DoResolveType): If an error is emitted
19217 during the resolution process, stop the lookup, this avoids
19218 repeated error reports (same error twice).
19220 * rootcontext.cs: Emit a warning if we have an ambiguous reference.
19222 * typemanager.cs (LookupType): Redo the type lookup code to match
19223 the needs of System.Reflection.
19225 The issue is that System.Reflection requires references to nested
19226 types to begin with a "+" sign instead of a dot. So toplevel
19227 types look like: "NameSpace.TopLevelClass", and nested ones look
19228 like "Namespace.TopLevelClass+Nested", with arbitrary nesting
19231 2002-09-19 Martin Baulig <martin@gnome.org>
19233 * codegen.cs (EmitContext.EmitTopBlock): If control flow analysis
19234 says that a method always returns or always throws an exception,
19235 don't report the CS0161.
19237 * statement.cs (FlowBranching.UsageVector.MergeChildren): Always
19238 set `Returns = new_returns'.
19240 2002-09-19 Martin Baulig <martin@gnome.org>
19242 * expression.cs (MemberAccess.ResolveMemberAccess): When resolving
19243 to an enum constant, check for a CS0176.
19245 2002-09-18 Miguel de Icaza <miguel@ximian.com>
19247 * class.cs (TypeContainer.CheckPairedOperators): Now we check
19248 for operators that must be in pairs and report errors.
19250 * ecore.cs (SimpleName.DoResolveType): During the initial type
19251 resolution process, when we define types recursively, we must
19252 check first for types in our current scope before we perform
19253 lookups in the enclosing scopes.
19255 * expression.cs (MakeByteBlob): Handle Decimal blobs.
19257 (Invocation.VerifyArgumentsCompat): Call
19258 TypeManager.TypeToCoreType on the parameter_type.GetElementType.
19259 I thought we were supposed to always call this, but there are a
19260 few places in the code where we dont do it.
19262 2002-09-17 Miguel de Icaza <miguel@ximian.com>
19264 * driver.cs: Add support in -linkres and -resource to specify the
19265 name of the identifier.
19267 2002-09-16 Miguel de Icaza <miguel@ximian.com>
19269 * ecore.cs (StandardConversionExists): Sync with the conversion
19270 code: allow anything-* to void* conversions.
19272 (FindMostSpecificSource): Use an Expression argument
19273 instead of a Type, because we might be handed over a Literal which
19274 gets a few more implicit conversions that plain types do not. So
19275 this information was being lost.
19277 Also, we drop the temporary type-holder expression when not
19280 2002-09-17 Martin Baulig <martin@gnome.org>
19282 * class.cs (PropertyBase.CheckBase): Don't check the base class if
19283 this is an explicit interface implementation.
19285 2002-09-17 Martin Baulig <martin@gnome.org>
19287 * class.cs (PropertyBase.CheckBase): Make this work for indexers with
19288 different `IndexerName' attributes.
19290 * expression.cs (BaseIndexerAccess): Rewrote this class to use IndexerAccess.
19291 (IndexerAccess): Added special protected ctor for BaseIndexerAccess and
19292 virtual CommonResolve().
19294 2002-09-16 Miguel de Icaza <miguel@ximian.com>
19296 * enum.cs (LookupEnumValue): Use the EnumConstant declared type,
19297 and convert that to the UnderlyingType.
19299 * statement.cs (Foreach.Resolve): Indexers are just like variables
19300 or PropertyAccesses.
19302 * cs-tokenizer.cs (consume_string): Track line numbers and columns
19303 inside quoted strings, we were not doing this before.
19305 2002-09-16 Martin Baulig <martin@gnome.org>
19307 * ecore.cs (MethodGroupExpr.DoResolve): If we have an instance expression,
19308 resolve it. This is needed for the definite assignment check of the
19309 instance expression, fixes bug #29846.
19310 (PropertyExpr.DoResolve, EventExpr.DoResolve): Likewise.
19312 2002-09-16 Nick Drochak <ndrochak@gol.com>
19314 * parameter.cs: Fix compile error. Cannot reference static member
19315 from an instance object. Is this an mcs bug?
19317 2002-09-14 Martin Baulig <martin@gnome.org>
19319 * decl.cs (MemberCache.SetupCacheForInterface): Don't add an interface
19320 multiple times. Fixes bug #30295, added test-166.cs.
19322 2002-09-14 Martin Baulig <martin@gnome.org>
19324 * statement.cs (Block.Emit): Don't emit unreachable code.
19325 (Switch.SimpleSwitchEmit, Switch.TableSwitchEmit): Check for missing
19326 `break' statements.
19327 (Goto.Emit, Continue.Emit): Set ec.Breaks = true.
19329 2002-09-14 Martin Baulig <martin@gnome.org>
19331 * parameter.cs (Parameter.Attributes): Make this work if Modifier.ISBYREF
19334 2002-09-14 Martin Baulig <martin@gnome.org>
19336 * typemanager.cs (TypeManager.IsNestedChildOf): This must return false
19337 if `type == parent' since in this case `type.IsSubclassOf (parent)' will
19338 be false on the ms runtime.
19340 2002-09-13 Martin Baulig <martin@gnome.org>
19342 * ecore.cs (SimpleName.SimpleNameResolve): Include the member name in
19343 the CS0038 error message.
19345 2002-09-12 Miguel de Icaza <miguel@ximian.com>
19347 * expression.cs (CheckedExpr, UnCheckedExpr): If we have a
19348 constant inside, return it.
19350 2002-09-12 Martin Baulig <martin@gnome.org>
19352 * cfold.cs (ConstantFold.DoConstantNumericPromotions): Check whether an
19353 implicit conversion can be done between enum types.
19355 * enum.cs (Enum.LookupEnumValue): If the value is an EnumConstant,
19356 check whether an implicit conversion to the current enum's UnderlyingType
19357 exists and report an error if not.
19359 * codegen.cs (CodeGen.Init): Delete the symbol file when compiling
19360 without debugging support.
19362 * delegate.cs (Delegate.CloseDelegate): Removed, use CloseType instead.
19363 Fixes bug #30235. Thanks to Ricardo Fernández Pascual.
19365 2002-09-12 Martin Baulig <martin@gnome.org>
19367 * typemanager.cs (TypeManager.IsNestedChildOf): New method.
19369 * ecore.cs (IMemberExpr.DeclaringType): New property.
19370 (SimpleName.SimpleNameResolve): Check whether we're accessing a
19371 nonstatic member of an outer type (CS0038).
19373 2002-09-11 Miguel de Icaza <miguel@ximian.com>
19375 * driver.cs: Activate the using-error detector at warning level
19376 4 (at least for MS-compatible APIs).
19378 * namespace.cs (VerifyUsing): Small buglett fix.
19380 * pending.cs (PendingImplementation): pass the container pointer.
19382 * interface.cs (GetMethods): Allow for recursive definition. Long
19383 term, I would like to move every type to support recursive
19384 definitions, not the current ordering mechanism that we have right
19387 The situation is this: Attributes are handled before interfaces,
19388 so we can apply attributes to interfaces. But some attributes
19389 implement interfaces, we will now handle the simple cases
19390 (recursive definitions will just get an error).
19392 * parameter.cs: Only invalidate types at the end if we fail to
19395 2002-09-09 Martin Baulig <martin@gnome.org>
19397 * ecore.cs (PropertyExpr.Emit): Also check for
19398 TypeManager.system_int_array_get_length so this'll also work when
19399 compiling corlib. Fixes #30003.
19401 2002-09-09 Martin Baulig <martin@gnome.org>
19403 * expression.cs (ArrayCreation.MakeByteBlob): Added support for enums
19404 and throw an exception if we can't get the type's size. Fixed #30040,
19407 2002-09-09 Martin Baulig <martin@gnome.org>
19409 * ecore.cs (PropertyExpr.DoResolve): Added check for static properies.
19411 * expression.cs (SizeOf.DoResolve): Sizeof is only allowed in unsafe
19412 context. Fixes bug #30027.
19414 * delegate.cs (NewDelegate.Emit): Use OpCodes.Ldvirtftn for
19415 virtual functions. Fixes bug #30043, added test-164.cs.
19417 2002-09-08 Ravi Pratap <ravi@ximian.com>
19419 * attribute.cs : Fix a small NullRef crash thanks to my stupidity.
19421 2002-09-08 Nick Drochak <ndrochak@gol.com>
19423 * driver.cs: Use an object to get the windows codepage since it's not a
19426 2002-09-08 Miguel de Icaza <miguel@ximian.com>
19428 * statement.cs (For.Emit): for infinite loops (test == null)
19429 return whether there is a break inside, not always "true".
19431 * namespace.cs (UsingEntry): New struct to hold the name of the
19432 using definition, the location where it is defined, and whether it
19433 has been used in a successful type lookup.
19435 * rootcontext.cs (NamespaceLookup): Use UsingEntries instead of
19440 2002-09-06 Ravi Pratap <ravi@ximian.com>
19442 * attribute.cs : Fix incorrect code which relied on catching
19443 a NullReferenceException to detect a null being passed in
19444 where an object was expected.
19446 2002-09-06 Miguel de Icaza <miguel@ximian.com>
19448 * statement.cs (Try): flag the catch variable as assigned
19450 * expression.cs (Cast): Simplified by using ResolveType instead of
19451 manually resolving.
19453 * statement.cs (Catch): Fix bug by using ResolveType.
19455 2002-09-06 Ravi Pratap <ravi@ximian.com>
19457 * expression.cs (BetterConversion): Special case for when we have
19458 a NullLiteral as the argument and we have to choose between string
19459 and object types - we choose string the way csc does.
19461 * attribute.cs (Attribute.Resolve): Catch the
19462 NullReferenceException and report error #182 since the Mono
19463 runtime no more has the bug and having this exception raised means
19464 we tried to select a constructor which takes an object and is
19467 2002-09-05 Ravi Pratap <ravi@ximian.com>
19469 * expression.cs (Invocation.OverloadResolve): Flag a nicer error
19470 message (1502, 1503) when we can't locate a method after overload
19471 resolution. This is much more informative and closes the bug
19474 * interface.cs (PopulateMethod): Return if there are no argument
19475 types. Fixes a NullReferenceException bug.
19477 * attribute.cs (Attribute.Resolve): Ensure we allow TypeOf
19478 expressions too. Previously we were checking only in one place for
19479 positional arguments leaving out named arguments.
19481 * ecore.cs (ImplicitNumericConversion): Conversion from underlying
19482 type to the enum type is not allowed. Remove code corresponding to
19485 (ConvertNumericExplicit): Allow explicit conversions from
19486 the underlying type to enum type. This precisely follows the spec
19487 and closes a bug filed by Gonzalo.
19489 2002-09-04 Gonzalo Paniagua Javier <gonzalo@ximian.com>
19492 * compiler.csproj.user: patch from Adam Chester (achester@bigpond.com).
19494 2002-09-03 Miguel de Icaza <miguel@ximian.com>
19496 * statement.cs (SwitchLabel.ResolveAndReduce): In the string case,
19497 it was important that we stored the right value after the
19498 reduction in `converted'.
19500 2002-09-04 Martin Baulig <martin@gnome.org>
19502 * location.cs (Location.SymbolDocument): Use full pathnames for the
19505 2002-08-30 Miguel de Icaza <miguel@ximian.com>
19507 * expression.cs (ComposedCast): Use DeclSparce.ResolveType instead
19508 of the expression resolve mechanism, because that will catch the
19509 SimpleName error failures.
19511 (Conditional): If we can not resolve the
19512 expression, return, do not crash.
19514 2002-08-29 Gonzalo Paniagua Javier <gonzalo@ximian.com>
19517 (location): display token name instead of its number.
19519 2002-08-28 Martin Baulig <martin@gnome.org>
19521 * expression.cs (Binary.ResolveOperator): Don't silently return
19522 but return an error if an operator cannot be applied between two
19525 2002-08-28 Martin Baulig <martin@gnome.org>
19527 * class.cs (Constructor.Define): Set the permission attributes
19528 correctly instead of making all constructors public.
19530 2002-08-28 Martin Baulig <martin@gnome.org>
19532 * ecore.cs (Expression.DoResolve): Do a TypeManager.MemberLook
19533 for private members before reporting a CS0103; if we find anything,
19536 2002-08-28 Martin Baulig <martin@gnome.org>
19538 * typemanager.cs (TypeManager.FilterWithClosure): It's not enough
19539 to check whether `closure_start_type == closure_invocation_type',
19540 we also need to check whether `m.DeclaringType == closure_invocation_type'
19541 before bypassing the permission checks. We might be accessing
19542 protected/private members from the base class.
19543 (TypeManager.RealMemberLookup): Only set private_ok if private
19544 members were requested via BindingFlags.NonPublic.
19546 * ecore.cs (MethodGroupExpr.IsExplicitImpl): New property.
19548 * expression.cs (MemberAccess.ResolveMemberAccess): Set
19549 MethodGroupExpr.IsExplicitImpl if appropriate.
19550 (Invocation.DoResolve): Don't report the CS0120 for explicit
19551 interface implementations.
19553 2002-08-27 Martin Baulig <martin@gnome.org>
19555 * expression.cs (Invocation.DoResolve): If this is a static
19556 method and we don't have an InstanceExpression, we must report
19559 2002-08-25 Martin Baulig <martin@gnome.org>
19561 * expression.cs (Binary.ResolveOperator): Don't allow `!=' and
19562 `==' between a valuetype and an object.
19564 2002-08-25 Miguel de Icaza <miguel@ximian.com>
19566 * ecore.cs (TypeExpr): Provide a ToString method.
19568 2002-08-24 Martin Baulig <martin@gnome.org>
19570 * codegen.cs (CodeGen.InitMonoSymbolWriter): The symbol file is
19571 now called proggie.dbg and it's a binary file.
19573 2002-08-23 Martin Baulig <martin@gnome.org>
19575 * decl.cs (MemberCache.AddMethods): Ignore varargs methods.
19577 2002-08-23 Martin Baulig <martin@gnome.org>
19579 * struct.cs (MyStructInfo.ctor): Make this work with empty
19580 structs; it's not allowed to use foreach() on null.
19582 2002-08-23 Martin Baulig <martin@gnome.org>
19584 * codegen.cs (CodeGen.InitMonoSymbolWriter): Tell the symbol
19585 writer the full pathname of the generated assembly.
19587 2002-08-23 Martin Baulig <martin@gnome.org>
19589 * statements.cs (FlowBranching.UsageVector.MergeChildren):
19590 A `finally' block never returns or breaks; improved handling of
19593 2002-08-23 Martin Baulig <martin@gnome.org>
19595 * statement.cs (Throw.Resolve): Allow `throw null'.
19597 2002-08-23 Martin Baulig <martin@gnome.org>
19599 * expression.cs (MemberAccess.ResolveMemberAccess): If this is an
19600 EventExpr, don't do a DeclaredOnly MemberLookup, but check whether
19601 `ee.EventInfo.DeclaringType == ec.ContainerType'. The
19602 MemberLookup would return a wrong event if this is an explicit
19603 interface implementation and the class has an event with the same
19606 2002-08-23 Martin Baulig <martin@gnome.org>
19608 * statement.cs (Block.AddChildVariableNames): New public method.
19609 (Block.AddChildVariableName): Likewise.
19610 (Block.IsVariableNameUsedInChildBlock): Likewise.
19611 (Block.AddVariable): Check whether a variable name has already
19612 been used in a child block.
19614 * cs-parser.jay (declare_local_variables): Mark all variable names
19615 from the current block as being used in a child block in the
19618 2002-08-23 Martin Baulig <martin@gnome.org>
19620 * codegen.cs (CodeGen.InitializeSymbolWriter): Abort if we can't
19621 find the symbol writer.
19623 * driver.cs: csc also allows the arguments to /define being
19624 separated by commas, not only by semicolons.
19626 2002-08-23 Martin Baulig <martin@gnome.org>
19628 * interface.cs (Interface.GetMembers): Added static check for events.
19630 2002-08-15 Martin Baulig <martin@gnome.org>
19632 * class.cs (MethodData.EmitDestructor): In the Expression.MemberLookup
19633 call, use ec.ContainerType.BaseType as queried_type and invocation_type.
19635 * ecore.cs (Expression.MemberLookup): Added documentation and explained
19636 why the MethodData.EmitDestructor() change was necessary.
19638 2002-08-20 Martin Baulig <martin@gnome.org>
19640 * class.cs (TypeContainer.FindMembers): Added static check for events.
19642 * decl.cs (MemberCache.AddMembers): Handle events like normal members.
19644 * typemanager.cs (TypeHandle.GetMembers): When queried for events only,
19645 use Type.GetEvents(), not Type.FindMembers().
19647 2002-08-20 Martin Baulig <martin@gnome.org>
19649 * decl.cs (MemberCache): Added a special method cache which will
19650 be used for method-only searched. This ensures that a method
19651 search will return a MethodInfo with the correct ReflectedType for
19654 2002-08-20 Martin Baulig <martin@gnome.org>
19656 * decl.cs (DeclSpace.FindMembers): Made this public.
19658 2002-08-20 Gonzalo Paniagua Javier <gonzalo@ximian.com>
19660 * delegate.cs: fixed build on windows.
19661 [FIXME: Filed as bug #29150: MCS must report these errors.]
19663 2002-08-19 Ravi Pratap <ravi@ximian.com>
19665 * ecore.cs (StandardConversionExists): Return a false
19666 if we are trying to convert the void type to anything else
19667 since that is not allowed.
19669 * delegate.cs (DelegateInvocation.DoResolve): Ensure that
19670 we flag error 70 in the event an event is trying to be accessed
19671 directly from outside the declaring type.
19673 2002-08-20 Martin Baulig <martin@gnome.org>
19675 * typemanager.cs, decl.cs: Moved MemberList, IMemberContainer and
19676 MemberCache from typemanager.cs to decl.cs.
19678 2002-08-19 Martin Baulig <martin@gnome.org>
19680 * class.cs (TypeContainer): Implement IMemberContainer.
19681 (TypeContainer.DefineMembers): Create the MemberCache.
19682 (TypeContainer.FindMembers): Do better BindingFlags checking; only
19683 return public members if BindingFlags.Public was given, check
19684 whether members are static.
19686 2002-08-16 Martin Baulig <martin@gnome.org>
19688 * decl.cs (DeclSpace.Define): Splitted this in Define and
19689 DefineMembers. DefineMembers is called first and initializes the
19692 * rootcontext.cs (RootContext.DefineMembers): New function. Calls
19693 DefineMembers() on all our DeclSpaces.
19695 * class.cs (TypeContainer.Define): Moved all code to DefineMembers(),
19696 but call DefineMembers() on all nested interfaces. We call their
19697 Define() in our new Define() function.
19699 * interface.cs (Interface): Implement IMemberContainer.
19700 (Interface.Define): Moved all code except the attribute stuf to
19702 (Interface.DefineMembers): Initialize the member cache.
19704 * typemanager.cs (IMemberFinder): Removed this interface, we don't
19705 need this anymore since we can use MemberCache.FindMembers directly.
19707 2002-08-19 Martin Baulig <martin@gnome.org>
19709 * typemanager.cs (MemberCache): When creating the cache for an
19710 interface type, add all inherited members.
19711 (TypeManager.MemberLookup_FindMembers): Changed `ref bool searching'
19712 to `out bool used_cache' and documented it.
19713 (TypeManager.MemberLookup): If we already used the cache in the first
19714 iteration, we don't need to do the interfaces check.
19716 2002-08-19 Martin Baulig <martin@gnome.org>
19718 * decl.cs (DeclSpace.FindMembers): New abstract method. Moved this
19719 here from IMemberFinder and don't implement this interface anymore.
19720 (DeclSpace.MemberCache): Moved here from IMemberFinder.
19722 * typemanager.cs (IMemberFinder): This interface is now only used by
19723 classes which actually support the member cache.
19724 (TypeManager.builder_to_member_finder): Renamed to builder_to_declspace
19725 since we only put DeclSpaces into this Hashtable.
19726 (MemberLookup_FindMembers): Use `builder_to_declspace' if the type is
19727 a dynamic type and TypeHandle.GetTypeHandle() otherwise.
19729 2002-08-16 Martin Baulig <martin@gnome.org>
19731 * typemanager.cs (ICachingMemberFinder): Removed.
19732 (IMemberFinder.MemberCache): New property.
19733 (TypeManager.FindMembers): Merged this with RealFindMembers().
19734 This function will never be called from TypeManager.MemberLookup()
19735 so we can't use the cache here, just the IMemberFinder.
19736 (TypeManager.MemberLookup_FindMembers): Check whether the
19737 IMemberFinder has a MemberCache and call the cache's FindMembers
19739 (MemberCache): Rewrote larger parts of this yet another time and
19740 cleaned it up a bit.
19742 2002-08-15 Miguel de Icaza <miguel@ximian.com>
19744 * driver.cs (LoadArgs): Support quoting.
19746 (Usage): Show the CSC-like command line arguments.
19748 Improved a few error messages.
19750 2002-08-15 Martin Baulig <martin@gnome.org>
19752 * typemanager.cs (IMemberContainer.Type): New property.
19753 (IMemberContainer.IsInterface): New property.
19755 The following changes are conditional to BROKEN_RUNTIME, which is
19756 defined at the top of the file.
19758 * typemanager.cs (MemberCache.MemberCache): Don't add the base
19759 class'es members, but add all members from TypeHandle.ObjectType
19760 if we're an interface.
19761 (MemberCache.AddMembers): Set the Declared flag if member.DeclaringType
19762 is the current type.
19763 (MemberCache.CacheEntry.Container): Removed this field.
19764 (TypeHandle.GetMembers): Include inherited members.
19766 2002-08-14 Gonzalo Paniagua Javier <gonzalo@ximian.com>
19768 * typemanager.cs: fixed compilation and added a comment on a field that
19771 2002-08-15 Martin Baulig <martin@gnome.org>
19773 * class.cs (ConstructorInitializer.Resolve): In the
19774 Expression.MemberLookup call, use the queried_type as
19777 * typemanager.cs (IMemberContainer.GetMembers): Removed the `bool
19778 declared' attribute, it's always true.
19779 (IMemberContainer.Parent, IMemberContainer.Name): New properties.
19780 (TypeManager.MemberLookup_FindMembers): [FIXME FIXME FIXME] Added
19781 temporary wrapper for FindMembers which tells MemberLookup whether
19782 members from the base classes are included in the return value.
19783 This will go away soon.
19784 (TypeManager.MemberLookup): Use this temporary hack here; once the
19785 new MemberCache is completed, we don't need to do the DeclaredOnly
19786 looping here anymore since the MemberCache will take care of this.
19787 (TypeManager.IsSubclassOrNestedChildOf): Allow `type == parent'.
19788 (MemberCache): When creating the MemberCache for a class, get
19789 members from the current class and all its base classes.
19790 (MemberCache.CacheEntry.Container): New field. This is a
19791 temporary hack until the Mono runtime is fixed to distinguish
19792 between ReflectedType and DeclaringType. It allows us to use MCS
19793 with both the MS runtime and the unfixed Mono runtime without
19794 problems and without accecting performance.
19795 (MemberCache.SearchMembers): The DeclaredOnly looping from
19796 TypeManager.MemberLookup is now done here.
19798 2002-08-14 Martin Baulig <martin@gnome.org>
19800 * statement.cs (MyStructInfo.MyStructInfo): Don't call
19801 Type.GetFields on dynamic types but get the fields from the
19802 corresponding TypeContainer.
19803 (MyStructInfo.GetStructInfo): Added check for enum types.
19805 * typemanager.cs (MemberList.IsSynchronized): Implemented.
19806 (MemberList.SyncRoot): Implemented.
19807 (TypeManager.FilterWithClosure): No need to check permissions if
19808 closure_start_type == closure_invocation_type, don't crash if
19809 closure_invocation_type is null.
19811 2002-08-13 Martin Baulig <martin@gnome.org>
19813 Rewrote TypeContainer.FindMembers to use a member cache. This
19814 gives us a speed increase of about 35% for the self-hosting MCS
19815 build and of about 15-20% for the class libs (both on GNU/Linux).
19817 * report.cs (Timer): New class to get enhanced profiling. This
19818 whole class is "TIMER" conditional since it remarkably slows down
19821 * class.cs (MemberList): New class. This is an IList wrapper
19822 which we're now using instead of passing MemberInfo[]'s around to
19823 avoid copying this array unnecessarily.
19824 (IMemberFinder.FindMember): Return a MemberList, not a MemberInfo [].
19825 (ICachingMemberFinder, IMemberContainer): New interface.
19826 (TypeManager.FilterWithClosure): If `criteria' is null, the name
19827 has already been checked, otherwise use it for the name comparision.
19828 (TypeManager.FindMembers): Renamed to RealMemberFinder and
19829 provided wrapper which tries to use ICachingMemberFinder.FindMembers
19830 if possible. Returns a MemberList, not a MemberInfo [].
19831 (TypeHandle): New class, implements IMemberContainer. We create
19832 one instance of this class per type, it contains a MemberCache
19833 which is used to do the member lookups.
19834 (MemberCache): New class. Each instance of this class contains
19835 all members of a type and a name-based hash table.
19836 (MemberCache.FindMembers): This is our new member lookup
19837 function. First, it looks up all members of the requested name in
19838 the hash table. Then, it walks this list and sorts out all
19839 applicable members and returns them.
19841 2002-08-13 Martin Baulig <martin@gnome.org>
19843 In addition to a nice code cleanup, this gives us a performance
19844 increase of about 1.4% on GNU/Linux - not much, but it's already
19845 half a second for the self-hosting MCS compilation.
19847 * typemanager.cs (IMemberFinder): New interface. It is used by
19848 TypeManager.FindMembers to call FindMembers on a TypeContainer,
19849 Enum, Delegate or Interface.
19850 (TypeManager.finder_to_member_finder): New PtrHashtable.
19851 (TypeManager.finder_to_container): Removed.
19852 (TypeManager.finder_to_delegate): Removed.
19853 (TypeManager.finder_to_interface): Removed.
19854 (TypeManager.finder_to_enum): Removed.
19856 * interface.cs (Interface): Implement IMemberFinder.
19858 * delegate.cs (Delegate): Implement IMemberFinder.
19860 * enum.cs (Enum): Implement IMemberFinder.
19862 * class.cs (TypeContainer): Implement IMemberFinder.
19864 2002-08-12 Martin Baulig <martin@gnome.org>
19866 * ecore.cs (TypeExpr.DoResolveType): Mark this as virtual.
19868 2002-08-12 Martin Baulig <martin@gnome.org>
19870 * ecore.cs (ITypeExpression): New interface for expressions which
19872 (TypeExpression): Renamed to TypeLookupExpression.
19873 (Expression.DoResolve): If we're doing a types-only lookup, the
19874 expression must implement the ITypeExpression interface and we
19875 call DoResolveType() on it.
19876 (SimpleName): Implement the new ITypeExpression interface.
19877 (SimpleName.SimpleNameResolve): Removed the ec.OnlyLookupTypes
19878 hack, the situation that we're only looking up types can't happen
19879 anymore when this method is called. Moved the type lookup code to
19880 DoResolveType() and call it.
19881 (SimpleName.DoResolveType): This ITypeExpression interface method
19882 is now doing the types-only lookup.
19883 (TypeExpr, TypeLookupExpression): Implement ITypeExpression.
19884 (ResolveFlags): Added MaskExprClass.
19886 * expression.cs (MemberAccess): Implement the ITypeExpression
19888 (MemberAccess.DoResolve): Added support for a types-only lookup
19889 when we're called via ITypeExpression.DoResolveType().
19890 (ComposedCast): Implement the ITypeExpression interface.
19892 * codegen.cs (EmitContext.OnlyLookupTypes): Removed. Call
19893 Expression.Resolve() with ResolveFlags.Type instead.
19895 2002-08-12 Martin Baulig <martin@gnome.org>
19897 * interface.cs (Interface.Define): Apply attributes.
19899 * attribute.cs (Attribute.ApplyAttributes): Added support for
19900 interface attributes.
19902 2002-08-11 Martin Baulig <martin@gnome.org>
19904 * statement.cs (Block.Emit): Only check the "this" variable if we
19905 do not always throw an exception.
19907 * ecore.cs (PropertyExpr.DoResolveLValue): Implemented, check
19908 whether the property has a set accessor.
19910 2002-08-11 Martin Baulig <martin@gnome.org>
19912 Added control flow analysis support for structs.
19914 * ecore.cs (ResolveFlags): Added `DisableFlowAnalysis' to resolve
19915 with control flow analysis turned off.
19916 (IVariable): New interface.
19917 (SimpleName.SimpleNameResolve): If MemberAccess.ResolveMemberAccess
19918 returns an IMemberExpr, call DoResolve/DoResolveLValue on it.
19919 (FieldExpr.DoResolve): Resolve the instance expression with flow
19920 analysis turned off and do the definite assignment check after the
19921 resolving when we know what the expression will resolve to.
19923 * expression.cs (LocalVariableReference, ParameterReference):
19924 Implement the new IVariable interface, only call the flow analysis
19925 code if ec.DoFlowAnalysis is true.
19926 (This): Added constructor which takes a Block argument. Implement
19927 the new IVariable interface.
19928 (MemberAccess.DoResolve, MemberAccess.DoResolveLValue): Call
19929 DoResolve/DoResolveLValue on the result of ResolveMemberLookup().
19930 This does the definite assignment checks for struct members.
19932 * class.cs (Constructor.Emit): If this is a non-static `struct'
19933 constructor which doesn't have any initializer, call
19934 Block.AddThisVariable() to tell the flow analysis code that all
19935 struct elements must be initialized before control returns from
19938 * statement.cs (MyStructInfo): New public class.
19939 (UsageVector.this [VariableInfo vi]): Added `int field_idx'
19940 argument to this indexer. If non-zero, check an individual struct
19941 member, not the whole struct.
19942 (FlowBranching.CheckOutParameters): Check struct members.
19943 (FlowBranching.IsVariableAssigned, SetVariableAssigned): Added
19944 overloaded versions of these methods which take an additional
19945 `int field_idx' argument to check struct members.
19946 (FlowBranching.IsParameterAssigned, SetParameterAssigned): Added
19947 overloaded versions of these methods which take an additional
19948 `string field_name' argument to check struct member.s
19949 (VariableInfo): Implement the IVariable interface.
19950 (VariableInfo.StructInfo): New public property. Returns the
19951 MyStructInfo instance of the variable if it's a struct or null.
19952 (Block.AddThisVariable): New public method. This is called from
19953 Constructor.Emit() for non-static `struct' constructor which do
19954 not have any initializer. It creates a special variable for the
19955 "this" instance variable which will be checked by the flow
19956 analysis code to ensure that all of the struct's fields are
19957 initialized before control returns from the constructor.
19958 (UsageVector): Added support for struct members. If a
19959 variable/parameter is a struct with N members, we reserve a slot
19960 in the usage vector for each member. A struct is considered fully
19961 initialized if either the struct itself (slot 0) or all its
19962 members are initialized.
19964 2002-08-08 Martin Baulig <martin@gnome.org>
19966 * driver.cs (Driver.MainDriver): Only report an error CS5001
19967 if there were no compilation errors.
19969 * codegen.cs (EmitContext.EmitContext): Use the DeclSpace's
19970 `UnsafeContext' property to determine whether the parent is in
19971 unsafe context rather than checking the parent's ModFlags:
19972 classes nested in an unsafe class are unsafe as well.
19974 2002-08-08 Martin Baulig <martin@gnome.org>
19976 * statement.cs (UsageVector.MergeChildren): Distinguish between
19977 `Breaks' and `Returns' everywhere, don't set `Breaks' anymore if
19978 we return. Added test17() and test18() to test-154.cs.
19980 2002-08-08 Martin Baulig <martin@gnome.org>
19982 * typemanager.cs (TypeManager.FilterWithClosure): If we have
19983 Family access, make sure the invoking type isn't a subclass of the
19984 queried type (that'd be a CS1540).
19986 * ecore.cs (Expression.MemberLookup): Added overloaded version of
19987 this method which takes an additional `Type invocation_type'.
19989 * expression.cs (BaseAccess.DoResolve): Use the base type as
19990 invocation and query type.
19991 (MemberAccess.DoResolve): If the lookup failed and we're about to
19992 report a CS0122, try a lookup with the ec.ContainerType - if this
19993 succeeds, we must report a CS1540.
19995 2002-08-08 Martin Baulig <martin@gnome.org>
19997 * ecore.cs (IMemberExpr): Added `bool IsInstance' property.
19998 (MethodGroupExpr): Implement the IMemberExpr interface.
20000 * expression (MemberAccess.ResolveMemberAccess): No need to have
20001 any special code for MethodGroupExprs anymore, they're now
20004 2002-08-08 Martin Baulig <martin@gnome.org>
20006 * typemanager.cs (TypeManager.FilterWithClosure): Check Assembly,
20007 Family, FamANDAssem and FamORAssem permissions.
20008 (TypeManager.IsSubclassOrNestedChildOf): New public method.
20010 2002-08-08 Martin Baulig <martin@gnome.org>
20012 * statement.cs (FlowBranchingType): Added LOOP_BLOCK.
20013 (UsageVector.MergeChildren): `break' breaks unless we're in a switch
20016 Thu Aug 8 10:28:07 CEST 2002 Paolo Molaro <lupus@ximian.com>
20018 * driver.cs: implemented /resource option to embed managed resources.
20020 2002-08-07 Martin Baulig <martin@gnome.org>
20022 * class.cs (FieldBase.Initializer): Renamed to `init' and made private.
20023 (FieldBase.HasFieldInitializer): New public property.
20024 (FieldBase.GetInitializerExpression): New public method. Resolves and
20025 returns the field initializer and makes sure it is only resolved once.
20026 (TypeContainer.EmitFieldInitializers): Call
20027 FieldBase.GetInitializerExpression to get the initializer, this ensures
20028 that it isn't resolved multiple times.
20030 * codegen.cs (EmitContext): Added `bool IsFieldInitialier'. This tells
20031 the resolving process (SimpleName/MemberLookup) that we're currently
20032 emitting a field initializer (which must not access any instance members,
20033 this is an error CS0236).
20035 * ecore.cs (SimpleName.Error_ObjectRefRequired): Added EmitContext
20036 argument, if the `IsFieldInitializer' flag is set, we must report and
20037 error CS0236 and not an error CS0120.
20039 2002-08-07 Martin Baulig <martin@gnome.org>
20041 * ecore.cs (IMemberExpr): New public interface.
20042 (FieldExpr, PropertyExpr, EventExpr): Implement IMemberExpr.
20043 (SimpleName.SimpleNameResolve): Call MemberAccess.ResolveMemberAccess
20044 if the expression is an IMemberExpr.
20046 * expression.cs (MemberAccess.ResolveMemberAccess): Allow `left'
20047 to be null, implicitly default to `this' if we're non-static in
20048 this case. Simplified the code a lot by using the new IMemberExpr
20049 interface. Also fixed bug #28176 here.
20051 2002-08-06 Martin Baulig <martin@gnome.org>
20053 * cs-parser.jay (SimpleLookup): Removed. We need to create
20054 ParameterReferences during semantic analysis so that we can do a
20055 type-only search when resolving Cast, TypeOf and SizeOf.
20056 (block): Pass the `current_local_parameters' to the Block's
20059 * class.cs (ConstructorInitializer): Added `Parameters parameters'
20060 argument to the constructor.
20061 (ConstructorInitializer.Resolve): Create a temporary implicit
20062 block with the parameters.
20064 * ecore.cs (SimpleName.SimpleNameResolve): Resolve parameter
20065 references here if we aren't doing a type-only search.
20067 * statement.cs (Block): Added constructor which takes a
20068 `Parameters parameters' argument.
20069 (Block.Parameters): New public property.
20071 * support.cs (InternalParameters.Parameters): Renamed `parameters'
20072 to `Parameters' and made it public readonly.
20074 2002-08-06 Martin Baulig <martin@gnome.org>
20076 * ecore.cs (Expression.Warning): Made this public as well.
20078 * report.cs (Report.Debug): Print the contents of collections.
20080 2002-08-06 Martin Baulig <martin@gnome.org>
20082 * ecore.cs (Expression.ResolveFlags): New [Flags] enum. This is
20083 used to tell Resolve() which kinds of expressions it may return.
20084 (Expression.Resolve): Added overloaded version of this method which
20085 takes a `ResolveFlags flags' argument. This can be used to tell
20086 Resolve() which kinds of expressions it may return. Reports a
20088 (Expression.ResolveWithSimpleName): Removed, use Resolve() with
20089 ResolveFlags.SimpleName.
20090 (Expression.Error118): Added overloaded version of this method which
20091 takes a `ResolveFlags flags' argument. It uses the flags to determine
20092 which kinds of expressions are allowed.
20094 * expression.cs (Argument.ResolveMethodGroup): New public method.
20095 Resolves an argument, but allows a MethodGroup to be returned.
20096 This is used when invoking a delegate.
20098 * TODO: Updated a bit.
20100 2002-08-06 Gonzalo Paniagua Javier <gonzalo@ximian.com>
20102 Fixed compilation with csc.
20104 * ecore.cs: Expression.Error made public. Is this correct? Should
20105 Warning be made public too?
20107 * expression.cs: use ea.Location instead of ea.loc.
20108 [FIXME: Filed as bug #28607: MCS must report these errors.]
20110 2002-08-06 Martin Baulig <martin@gnome.org>
20112 * ecore.cs (Expression.loc): Moved the location here instead of
20113 duplicating it in all derived classes.
20114 (Expression.Location): New public property.
20115 (Expression.Error, Expression.Warning): Made them non-static and
20116 removed the location argument.
20117 (Expression.Warning): Added overloaded version which takes an
20118 `int level' argument.
20119 (Expression.Error118): Make this non-static and removed the
20120 expression and location arguments.
20121 (TypeExpr): Added location argument to the constructor.
20123 * expression.cs (StaticCallExpr): Added location argument to
20125 (Indirection, PointerArithmetic): Likewise.
20126 (CheckedExpr, UnCheckedExpr): Likewise.
20127 (ArrayAccess, IndexerAccess, UserCast, ArrayPtr): Likewise.
20128 (StringPtr): Likewise.
20131 2002-08-05 Martin Baulig <martin@gnome.org>
20133 * expression.cs (BaseAccess.DoResolve): Actually report errors.
20135 * assign.cs (Assign.DoResolve): Check whether the source
20136 expression is a value or variable.
20138 * statement.cs (Try.Resolve): Set ec.InTry/InCatch/InFinally
20139 while resolving the corresponding blocks.
20141 * interface.cs (Interface.GetInterfaceTypeByName): Actually report
20142 an error, don't silently return null.
20144 * statement.cs (Block.AddVariable): Do the error reporting here
20145 and distinguish between CS0128 and CS0136.
20146 (Block.DoResolve): Report all unused labels (warning CS0164).
20147 (LabeledStatement): Pass the location to the constructor.
20148 (LabeledStatement.HasBeenReferenced): New property.
20149 (LabeledStatement.Resolve): Set it to true here.
20151 * statement.cs (Return.Emit): Return success even after reporting
20152 a type mismatch error (CS0126 or CS0127), this is what csc does and
20153 it avoids confusing the users with any consecutive errors.
20155 2002-08-05 Martin Baulig <martin@gnome.org>
20157 * enum.cs (Enum.LookupEnumValue): Catch circular definitions.
20159 * const.cs (Const.LookupConstantValue): Catch circular definitions.
20161 * expression.cs (MemberAccess.DoResolve): Silently return if an
20162 error has already been reported.
20164 * ecore.cs (Expression.MemberLookupFinal): Silently return if an
20165 error has already been reported.
20167 2002-08-05 Martin Baulig <martin@gnome.org>
20169 * statement.cs (UsageVector): Only initialize the `parameters'
20170 vector if we actually have any "out" parameters.
20172 2002-08-05 Martin Baulig <martin@gnome.org>
20174 * expression.cs (Binary.ResolveOperator): When combining delegates,
20175 they must have the same type.
20177 2002-08-05 Martin Baulig <martin@gnome.org>
20179 * typemanager.cs (TypeManager.GetArgumentTypes): Don't call
20180 PropertyInfo.GetIndexParameters() on dynamic types, this doesn't
20181 work with the ms runtime and we also don't need it: if we're a
20182 PropertyBuilder and not in the `indexer_arguments' hash, then we
20183 are a property and not an indexer.
20185 * class.cs (TypeContainer.AsAccessible): Use Type.IsArray,
20186 Type.IsPointer and Type.IsByRef instead of Type.HasElementType
20187 since the latter one doesn't work with the ms runtime.
20189 2002-08-03 Martin Baulig <martin@gnome.org>
20191 Fixed bugs #27998 and #22735.
20193 * class.cs (Method.IsOperator): New public field.
20194 (Method.CheckBase): Report CS0111 if there's already a method
20195 with the same parameters in the current class. Report CS0508 when
20196 attempting to change the return type of an inherited method.
20197 (MethodData.Emit): Report CS0179 if a method doesn't have a body
20198 and it's not marked abstract or extern.
20199 (PropertyBase): New abstract base class for Property and Indexer.
20200 (PropertyBase.CheckBase): Moved here from Property and made it work
20202 (PropertyBase.Emit): Moved here from Property.Emit, Indexer.Emit is
20203 the same so we can reuse it there.
20204 (Property, Indexer): Derive from PropertyBase.
20205 (MethodSignature.inheritable_property_signature_filter): New delegate
20206 to find properties and indexers.
20208 * decl.cs (MemberCore.CheckMethodAgainstBase): Added `string name'
20209 argument and improved error reporting.
20211 * parameter.cs (Parameters.GetEmptyReadOnlyParameters): Renamed to
20212 EmptyReadOnlyParameters and made it a property.
20214 * typemanager.cs (TypeManager.GetArgumentTypes): Added overloaded
20215 version of this method which takes a `PropertyInfo indexer'.
20216 (TypeManager.RegisterIndexer): New method.
20218 * class.cs: Added myself as author of this file :-)
20220 2002-08-03 Gonzalo Paniagua Javier <gonzalo@ximian.com>
20222 * class.cs: fixed compilation on windoze.
20224 2002-08-03 Martin Baulig <martin@gnome.org>
20226 * interface.cs (Interface.GetInterfaceBases): Check whether all
20227 base interfaces are at least as accessible than the current one.
20229 * class.cs (TypeContainer.GetClassBases): Check whether base types
20230 are at least as accessible than the current type.
20231 (TypeContainer.AsAccessible): Implemented and made non-static.
20232 (MemberBase.CheckParameters): Report errors if the accessibility
20235 * delegate.cs (Delegate.Delegate): The default visibility is
20236 internal for top-level types and private for nested types.
20237 (Delegate.Define): Report errors if the accessibility checks fail.
20239 * enum.cs (Enum.Enum): The default visibility is internal for
20240 top-level types and private for nested types.
20241 (Enum.DefineType): Compute the correct visibility.
20243 * modifiers.cs (Modifiers.TypeAttr): Added a version of this
20244 function which takes a `bool is_toplevel' instead of a TypeContainer.
20246 * typemanager.cs (TypeManager.IsBuiltinType): `void' is also a
20249 2002-08-02 Martin Baulig <martin@gnome.org>
20251 * expression.cs (LocalVariableReferenc): Added constructor which
20252 takes additional `VariableInfo vi' and `bool is_readonly' arguments.
20253 (LocalVariableReference.IsReadOnly): New property.
20254 (LocalVariableReference.DoResolveLValue): Report a CS1604 if the
20255 variable is readonly, use our own readonly flag to do this; you can
20256 use the new constructor to get a writable reference to a read-only
20259 * cs-parser.jay (foreach_statement, using_statement): Get a writable
20260 reference to the local variable.
20262 2002-08-01 Miguel de Icaza <miguel@ximian.com>
20264 * rootcontext.cs (ResolveCore): Also include System.Exception
20266 * statement.cs (Block.Emit): Do not emit the dead-code warnings if
20267 we reach an EmptyStatement.
20269 (Catch.DoResolve, Throw.DoResolve): Throwing the System.Exception
20272 * expression.cs (Binary.ResolveOperator): Check error result in
20275 use brtrue/brfalse directly and avoid compares to null.
20277 2002-08-02 Martin Baulig <martin@gnome.org>
20279 * class.cs (TypeContainer.Define): Define all nested interfaces here.
20280 Fixes bug #28407, added test-155.cs.
20282 2002-08-01 Martin Baulig <martin@gnome.org>
20284 * class.cs (Event.EmitDefaultMethod): Make this work with static
20285 events. Fixes #28311, added verify-3.cs.
20287 2002-08-01 Martin Baulig <martin@gnome.org>
20289 * statement.cs (ForeachHelperMethods): Added `enumerator_type' and
20290 `is_disposable' fields.
20291 (Foreach.GetEnumeratorFilter): Set `hm.enumerator_type' and
20292 `hm.is_disposable' if we're using the collection pattern.
20293 (Foreach.EmitCollectionForeach): Use the correct type for the
20294 enumerator's local variable, only emit the try/finally block if
20295 necessary (fixes #27713).
20297 2002-08-01 Martin Baulig <martin@gnome.org>
20299 * ecore.cs (Expression.report118): Renamed to Error118 and made
20302 * statement.cs (Throw.Resolve): Check whether the expression is of
20303 the correct type (CS0118) and whether the type derives from
20304 System.Exception (CS0155).
20305 (Catch.Resolve): New method. Do the type lookup here and check
20306 whether it derives from System.Exception (CS0155).
20307 (Catch.CatchType, Catch.IsGeneral): New public properties.
20309 * typemanager.cs (TypeManager.exception_type): Added.
20311 2002-07-31 Miguel de Icaza <miguel@ximian.com>
20313 * driver.cs: Updated About function.
20315 2002-07-31 Martin Baulig <martin@gnome.org>
20317 Implemented Control Flow Analysis.
20319 * codegen.cs (EmitContext.DoFlowAnalysis): New public variable.
20320 (EmitContext.CurrentBranching): Added.
20321 (EmitContext.StartFlowBranching): Added.
20322 (EmitContext.EndFlowBranching): Added.
20323 (EmitContext.KillFlowBranching): Added.
20324 (EmitContext.IsVariableAssigned): Added.
20325 (EmitContext.SetVariableAssigned): Added.
20326 (EmitContext.IsParameterAssigned): Added.
20327 (EmitContext.SetParameterAssigned): Added.
20328 (EmitContext.EmitTopBlock): Added `InternalParameters ip' argument.
20329 Added control flow analysis stuff here.
20331 * expression.cs (Unary.DoResolve): If the operator is Oper.AddressOf,
20332 resolve the expression as lvalue.
20333 (LocalVariableReference.DoResolve): Check whether the variable has
20334 already been assigned.
20335 (ParameterReference.DoResolveLValue): Override lvalue resolve to mark
20336 the parameter as assigned here.
20337 (ParameterReference.DoResolve): Check whether the parameter has already
20339 (Argument.Resolve): If it's a `ref' or `out' argument, resolve the
20340 expression as lvalue.
20342 * statement.cs (FlowBranching): New class for the flow analysis code.
20343 (Goto): Resolve the label in Resolve, not in Emit; added flow analysis.
20344 (LabeledStatement.IsDefined): New public property.
20345 (LabeledStatement.AddUsageVector): New public method to tell flow
20346 analyis that the label may be reached via a forward jump.
20347 (GotoCase): Lookup and resolve the label in Resolve, not in Emit; added
20349 (VariableInfo.Number): New public field. This is used by flow analysis
20350 to number all locals of a block.
20351 (Block.CountVariables): New public property. This is the number of
20352 local variables in this block (including the locals from all parent
20354 (Block.EmitMeta): Number all the variables.
20356 * statement.cs: Added flow analysis support to all classes.
20358 2002-07-31 Martin Baulig <martin@gnome.org>
20360 * driver.cs: Added "--mcs-debug" argument if MCS_DEBUG is defined.
20361 To get debugging messages, compile mcs with /define:MCS_DEBUG and
20362 then use this argument.
20364 * report.cs (Report.Debug): Renamed to conditional to "MCS_DEBUG".
20366 * makefile.gnu (MCS_FLAGS): Include $(MCS_DEFINES), the user may
20367 use this to specify /define options.
20369 2002-07-29 Martin Baulig <martin@gnome.org>
20371 * statement.cs (Fixed): Moved all code that does variable lookups
20372 and resolvings from Emit to Resolve.
20374 * statement.cs (For): Moved all code that does variable lookups
20375 and resolvings from Emit to Resolve.
20377 * statement.cs (Using): Moved all code that does variable lookups
20378 and resolvings from Emit to Resolve.
20380 2002-07-29 Martin Baulig <martin@gnome.org>
20382 * attribute.cs (Attribute.Resolve): Explicitly catch a
20383 System.NullReferenceException when creating the
20384 CustromAttributeBuilder and report a different warning message.
20386 2002-07-29 Martin Baulig <martin@gnome.org>
20388 * support.cs (ParameterData.ParameterName): Added method to
20389 get the name of a parameter.
20391 * typemanager.cs (TypeManager.IsValueType): New public method.
20393 2002-07-29 Martin Baulig <martin@gnome.org>
20395 * parameter.cs (Parameter.Modifier): Added `ISBYREF = 8'. This
20396 is a flag which specifies that it's either ref or out.
20397 (Parameter.GetParameterInfo (DeclSpace, int, out bool)): Changed
20398 the out parameter to `out Parameter.Modifier mod', also set the
20399 Parameter.Modifier.ISBYREF flag on it if it's either ref or out.
20401 * support.cs (InternalParameters.ParameterModifier): Distinguish
20402 between Parameter.Modifier.OUT and Parameter.Modifier.REF, set the
20403 Parameter.Modifier.ISBYREF flag if it's either ref or out.
20405 * expression.cs (Argument.GetParameterModifier): Distinguish
20406 between Parameter.Modifier.OUT and Parameter.Modifier.REF, set the
20407 Parameter.Modifier.ISBYREF flag if it's either ref or out.
20409 2002-07-29 Martin Baulig <martin@gnome.org>
20411 * expression.cs (ParameterReference.ParameterReference): Added
20412 `Location loc' argument to the constructor.
20414 * cs-parser.jay: Pass location to ParameterReference.
20416 2002-07-28 Miguel de Icaza <miguel@ximian.com>
20418 * statement.cs (Try): Initialize the location.
20420 * cs-parser.jay: pass location to Try.
20422 * expression.cs (Unary.Reduce): Change the prototype to return
20423 whether a constant fold could be performed or not. The result is
20424 returned in an out parameters. In the case of Indirection and
20425 AddressOf, we want to perform the full tests.
20427 2002-07-26 Miguel de Icaza <miguel@ximian.com>
20429 * statement.cs (Statement.Emit): Flag dead code.
20431 2002-07-27 Andrew Birkett <andy@nobugs.org>
20433 * expression.cs (Unary.Reduce): Handle AddressOf and Indirection.
20435 2002-07-27 Martin Baulig <martin@gnome.org>
20437 * class.cs (MethodData.Define): Put back call to
20438 TypeManager.AddMethod(), accidentally commented this out.
20440 * report.cs (Debug): New public method to print debugging information,
20441 this is `[Conditional ("DEBUG")]'.
20443 2002-07-26 Martin Baulig <martin@gnome.org>
20445 * cs-parser.jay (CSharpParser): Added `Stack switch_stack'.
20446 (switch_statement): Push the current_block to the switch_stack and
20447 pop it again when we're done with the switch.
20448 (switch_section): The new block is a child of the current_block.
20449 Fixes bug #24007, added test-152.cs.
20451 2002-07-27 Martin Baulig <martin@gnome.org>
20453 * expression.cs (Invocation.EmitArguments): When calling a varargs
20454 function with only its fixed arguments, we need to pass an empty
20457 2002-07-27 Martin Baulig <martin@gnome.org>
20459 Mono 0.13 has been released.
20461 2002-07-25 Miguel de Icaza <miguel@ximian.com>
20463 * driver.cs: Rename --resource to --linkres, because that is what
20464 we do currently, we dont support --resource yet.
20466 * cs-tokenizer.cs: Fix test for reporting endif mismatches.
20468 2002-07-25 Martin Baulig <martin@gnome.org>
20470 * class.cs (MethodData): New public class. This is a `method builder'
20471 class for a method or one accessor of a Property/Indexer/Event.
20472 (MethodData.GetMethodFlags): Moved here from MemberBase.
20473 (MethodData.ApplyAttributes): Likewise.
20474 (MethodData.ApplyObsoleteAttribute): Likewise.
20475 (MethodData.ApplyConditionalAttribute): Likewise.
20476 (MethodData.ApplyDllImportAttribute): Likewise.
20477 (MethodData.CheckAbstractAndExternal): Likewise.
20478 (MethodData.Define): Formerly knows as MemberBase.DefineMethod().
20479 (MethodData.Emit): Formerly known as Method.Emit().
20480 (MemberBase): Moved everything which was specific to a single
20481 accessor/method to MethodData.
20482 (Method): Create a new MethodData and call Define() and Emit() on it.
20483 (Property, Indexer, Event): Create a new MethodData objects for each
20484 accessor and call Define() and Emit() on them.
20486 2002-07-25 Martin Baulig <martin@gnome.org>
20488 Made MethodCore derive from MemberBase to reuse the code from there.
20489 MemberBase now also checks for attributes.
20491 * class.cs (MethodCore): Derive from MemberBase, not MemberCore.
20492 (MemberBase.GetMethodFlags): Moved here from class Method and marked
20494 (MemberBase.DefineAccessor): Renamed to DefineMethod(), added
20495 `CallingConventions cc' and `Attributes opt_attrs' arguments.
20496 (MemberBase.ApplyAttributes): New virtual method; applies the
20497 attributes to a method or accessor.
20498 (MemberBase.ApplyObsoleteAttribute): New protected virtual method.
20499 (MemberBase.ApplyConditionalAttribute): Likewise.
20500 (MemberBase.ApplyDllImportAttribute): Likewise.
20501 (MemberBase.CheckAbstractAndExternal): Likewise.
20502 (MethodCore.ParameterTypes): This is now a property instead of a
20503 method, it's initialized from DoDefineParameters().
20504 (MethodCore.ParameterInfo): Removed the set accessor.
20505 (MethodCore.DoDefineParameters): New protected virtual method to
20506 initialize ParameterTypes and ParameterInfo.
20507 (Method.GetReturnType): We can now simply return the MemberType.
20508 (Method.GetMethodFlags): Override the MemberBase version and add
20509 the conditional flags.
20510 (Method.CheckBase): Moved some code from Define() here, call
20511 DoDefineParameters() here.
20512 (Method.Define): Use DoDefine() and DefineMethod() from MemberBase
20513 here to avoid some larger code duplication.
20514 (Property.Emit, Indexer.Emit): Call CheckAbstractAndExternal() to
20515 ensure that abstract and external accessors don't declare a body.
20517 * attribute.cs (Attribute.GetValidPieces): Make this actually work:
20518 `System.Attribute.GetCustomAttributes (attr.Type)' does a recursive
20519 lookup in the attribute's parent classes, so we need to abort as soon
20520 as we found the first match.
20521 (Attribute.Obsolete_GetObsoleteMessage): Return the empty string if
20522 the attribute has no arguments.
20524 * typemanager.cs (TypeManager.AddMethod): Now takes a MemberBase instead
20527 2002-07-24 Gonzalo Paniagua Javier <gonzalo@ximian.com>
20529 * cs-parser.jay: reverted previous patch.
20531 2002-07-24 Gonzalo Paniagua Javier <gonzalo@ximian.com>
20533 * cs-parser.jay: fixed bug #22119.
20535 2002-07-24 Gonzalo Paniagua Javier <gonzalo@ximian.com>
20537 * attribute.cs: fixed compilation. The error was:
20538 "attribute.cs(571,17): error CS0177: The out parameter 'is_error' must
20539 be assigned to before control leaves the current method."
20540 [FIXME: Filed as bug #28186: MCS must report this error.]
20542 2002-07-25 Martin Baulig <martin@gnome.org>
20544 * attribute.cs (Attribute.Conditional_GetConditionName): New static
20545 method to pull the condition name ouf of a Conditional attribute.
20546 (Attribute.Obsolete_GetObsoleteMessage): New static method to pull
20547 the obsolete message and error flag out of an Obsolete attribute.
20549 * class.cs (Method.GetMethodFlags): New public method to get the
20550 TypeManager.MethodFlags for this method.
20551 (Method.ApplyConditionalAttribute, Method.ApplyObsoleteAttribute): New
20553 (Method.Define): Get and apply the Obsolete and Conditional attributes;
20554 if we're overriding a virtual function, set the new private variable
20555 `parent_method'; call the new TypeManager.AddMethod().
20557 * typemanager.cs (TypeManager.AddMethod): New static method. Stores
20558 the MethodBuilder and the Method in a PtrHashtable.
20559 (TypeManager.builder_to_method): Added for this purpose.
20560 (TypeManager.MethodFlags): Added IsObsoleteError.
20561 (TypeManager.GetMethodFlags): Added `Location loc' argument. Lookup
20562 Obsolete and Conditional arguments in MethodBuilders. If we discover
20563 an Obsolete attribute, emit an appropriate warning 618 / error 619 with
20564 the message from the attribute.
20566 2002-07-24 Martin Baulig <martin@gnome.org>
20568 * cs-tokenizer.cs: Eat up trailing whitespaces and one-line comments in
20569 preprocessor directives, ensure that the argument to #define/#undef is
20570 exactly one identifier and that it's actually an identifier.
20572 Some weeks ago I did a `#define DEBUG 1' myself and wondered why this
20575 2002-07-24 Martin Baulig <martin@gnome.org>
20577 * statement.cs (Foreach.ForeachHelperMethods): Added `Type element_type',
20578 initialize it to TypeManager.object_type in the constructor.
20579 (Foreach.GetEnumeratorFilter): Set `hm.element_type' to the return type
20580 of the `hm.get_current' method if we're using the collection pattern.
20581 (Foreach.EmitCollectionForeach): Use `hm.element_type' as the source type
20582 for the explicit conversion to make it work when we're using the collection
20583 pattern and the `Current' property has a different return type than `object'.
20586 2002-07-24 Martin Baulig <martin@gnome.org>
20588 * delegate.cs (Delegate.VerifyMethod): Simply return null if the method
20589 does not match, but don't report any errors. This method is called in
20590 order for all methods in a MethodGroupExpr until a matching method is
20591 found, so we don't want to bail out if the first method doesn't match.
20592 (NewDelegate.DoResolve): If none of the methods in the MethodGroupExpr
20593 matches, report the 123. Fixes #28070.
20595 2002-07-24 Martin Baulig <martin@gnome.org>
20597 * expression.cs (ArrayAccess.EmitStoreOpcode): Moved the
20598 TypeManager.TypeToCoreType() to the top of the method so the
20599 following equality checks will work. Fixes #28107.
20601 2002-07-24 Martin Baulig <martin@gnome.org>
20603 * cfold.cs (ConstantFold.DoConstantNumericPromotions): "If either
20604 operand is of type uint, and the other operand is of type sbyte,
20605 short or int, the operands are converted to type long." -
20606 Actually do what this comment already told us. Fixes bug #28106,
20609 2002-07-24 Martin Baulig <martin@gnome.org>
20611 * class.cs (MethodBase): New abstract class. This is now a base
20612 class for Property, Indexer and Event to avoid some code duplication
20613 in their Define() and DefineMethods() methods.
20614 (MethodBase.DoDefine, MethodBase.DefineAccessor): Provide virtual
20615 generic methods for Define() and DefineMethods().
20616 (FieldBase): Derive from MemberBase, not MemberCore.
20617 (Property): Derive from MemberBase, not MemberCore.
20618 (Property.DefineMethod): Moved all the code from this method to the
20619 new MethodBase.DefineAccessor(), just call it with appropriate
20621 (Property.Define): Call the new Property.DoDefine(), this does some
20622 sanity checks and we don't need to duplicate the code everywhere.
20623 (Event): Derive from MemberBase, not MemberCore.
20624 (Event.Define): Use the new MethodBase.DefineAccessor() to define the
20625 accessors, this will also make them work with interface events.
20626 (Indexer): Derive from MemberBase, not MemberCore.
20627 (Indexer.DefineMethod): Removed, call MethodBase.DefineAccessor() insstead.
20628 (Indexer.Define): Use the new MethodBase functions.
20630 * interface.cs (InterfaceEvent.InterfaceEvent): Added `Location loc'
20631 argument to the constructor.
20632 (Interface.FindMembers): Added support for interface events.
20633 (Interface.PopluateEvent): Implemented.
20635 Added test-149.cs for this. This also fixes bugs #26067 and #24256.
20637 2002-07-22 Miguel de Icaza <miguel@ximian.com>
20639 * class.cs (TypeContainer.AddMethod): Adding methods do not use IsValid,
20640 but this is required to check for a method name being the same as
20641 the containing class.
20645 2002-07-22 Gonzalo Paniagua Javier <gonzalo@ximian.com>
20647 * interface.cs: initialize variable.
20649 2002-07-23 Martin Baulig <martin@gnome.org>
20651 Implemented the IndexerName attribute in interfaces.
20653 * class.cs (TypeContainer.DefineIndexers): Don't set the indexer
20654 name if this is an explicit interface implementation.
20655 (Indexer.InterfaceIndexerName): New public variable. If we're
20656 implementing an interface indexer, this is the IndexerName in that
20657 interface. Otherwise, it's the IndexerName.
20658 (Indexer.DefineMethod): If we're implementing interface indexer,
20659 set InterfaceIndexerName. Use the new Pending.IsInterfaceIndexer
20660 and Pending.ImplementIndexer methods.
20661 (Indexer.Define): Also define the PropertyBuilder if we're
20662 implementing an interface indexer and this is neither an explicit
20663 interface implementation nor do the IndexerName match the one in
20666 * pending.cs (TypeAndMethods): Added `MethodInfo [] need_proxy'.
20667 If a method is defined here, then we always need to create a proxy
20668 for it. This is used when implementing interface indexers.
20669 (Pending.IsInterfaceIndexer): New public method.
20670 (Pending.ImplementIndexer): New public method.
20671 (Pending.InterfaceMethod): Added `MethodInfo need_proxy' argument.
20672 This is used when implementing interface indexers to define a proxy
20674 (Pending.VerifyPendingMethods): Look in the `need_proxy' array and
20675 define a proxy if necessary.
20677 * interface.cs (Interface.IndexerName): New public variable.
20678 (Interface.PopulateIndexer): Set the IndexerName.
20679 (Interface.DefineIndexers): New private method. Populate all the
20680 indexers and make sure their IndexerNames match.
20682 * typemanager.cs (IndexerPropertyName): Added support for interface
20685 2002-07-22 Martin Baulig <martin@gnome.org>
20687 * codegen.cs (EmitContext.HasReturnLabel): New public variable.
20688 (EmitContext.EmitTopBlock): Always mark the ReturnLabel and emit a
20689 ret if HasReturnLabel.
20690 (EmitContext.TryCatchLevel, LoopBeginTryCatchLevel): New public
20693 * statement.cs (Do.Emit, While.Emit, For.Emit, Foreach.Emit): Save
20694 and set the ec.LoopBeginTryCatchLevel.
20695 (Try.Emit): Increment the ec.TryCatchLevel while emitting the block.
20696 (Continue.Emit): If the ec.LoopBeginTryCatchLevel is smaller than
20697 the current ec.TryCatchLevel, the branch goes out of an exception
20698 block. In this case, we need to use Leave and not Br.
20700 2002-07-22 Martin Baulig <martin@gnome.org>
20702 * statement.cs (Try.Emit): Emit an explicit ret after the end of the
20703 block unless the block does not always return or it is contained in
20704 another try { ... } catch { ... } block. Fixes bug #26506.
20705 Added verify-1.cs to the test suite.
20707 2002-07-22 Martin Baulig <martin@gnome.org>
20709 * statement.cs (Switch.TableSwitchEmit): If we don't have a default,
20710 then we do not always return. Fixes bug #24985.
20712 2002-07-22 Martin Baulig <martin@gnome.org>
20714 * expression.cs (Invocation.OverloadedResolve): Do the BetterFunction()
20715 lookup on a per-class level; ie. walk up the class hierarchy until we
20716 found at least one applicable method, then choose the best among them.
20717 Fixes bug #24463 and test-29.cs.
20719 2002-07-22 Martin Baulig <martin@gnome.org>
20721 * typemanager.cs (TypeManager.ArrayContainsMethod): Don't check the
20722 return types of the methods. The return type is not part of the
20723 signature and we must not check it to make the `new' modifier work.
20724 Fixes bug #27999, also added test-147.cs.
20725 (TypeManager.TypeToCoreType): Added TypeManager.type_type.
20727 * expression.cs (Invocation.DoResolve): Call TypeManager.TypeToCoreType()
20728 on the method's return type.
20730 2002-07-21 Martin Baulig <martin@gnome.org>
20732 * assign.cs: Make this work if the rightmost source is a constant and
20733 we need to do an implicit type conversion. Also adding a few more tests
20734 to test-38.cs which should have caught this.
20736 * makefile.gnu: Disable debugging, there's already the mcs-mono2.exe
20737 target in the makefile for this. The makefile.gnu is primarily intended
20738 for end-users who don't want to debug the compiler.
20740 2002-07-21 Martin Baulig <martin@gnome.org>
20742 * assign.cs: Improved the Assign class so it can now handle embedded
20743 assignments (X = Y = Z = something). As a side-effect this'll now also
20744 consume less local variables. test-38.cs now passes with MCS, added
20745 a few new test cases to that test.
20747 2002-07-20 Martin Baulig <martin@gnome.org>
20749 * expression.cs (Binary.EmitBranchable): Emit correct unsigned branch
20750 instructions. Fixes bug #27977, also added test-146.cs.
20752 2002-07-19 Gonzalo Paniagua Javier <gonzalo@ximian.com>
20754 * cs-tokenizer.cs: fixed getHex ().
20756 2002-07-19 Martin Baulig <martin@gnome.org>
20758 * expression.cs (Invocation.EmitParams): Use TypeManager.LookupType(),
20759 not Type.GetType() to lookup the array type. This is needed when
20760 we're constructing an array of a user-defined type.
20761 (ArrayAccess.EmitDynamicInitializers): Only emit the Ldelema for
20762 single-dimensional arrays, but also for single-dimensial arrays of
20765 2002-07-19 Martin Baulig <martin@gnome.org>
20767 * expression.cs (New.DoEmit): Create a new LocalTemporary each time
20768 this function is called, it's not allowed to share LocalBuilders
20769 among ILGenerators.
20771 2002-07-19 Martin Baulig <martin@gnome.org>
20773 * expression.cs (Argument.Resolve): Report an error 118 when trying
20774 to pass a type as argument.
20776 2002-07-18 Martin Baulig <martin@gnome.org>
20778 * ecore.cs (Expression.ImplicitNumericConversion): Don't emit a
20779 Conv_R_Un for the signed `long' type.
20781 2002-07-15 Miguel de Icaza <miguel@ximian.com>
20783 * expression.cs (MemberAccess.DoResolve): Do not reuse the field
20784 `expr' for the temporary result, as that will fail if we do
20785 multiple resolves on the same expression.
20787 2002-07-05 Miguel de Icaza <miguel@ximian.com>
20789 * ecore.cs (SimpleNameResolve): Use ec.DeclSpace instead of
20790 ec.TypeContainer for looking up aliases.
20792 * class.cs (TypeContainer): Remove LookupAlias from here.
20794 * decl.cs (DeclSpace); Move here.
20796 2002-07-01 Miguel de Icaza <miguel@ximian.com>
20798 * class.cs (FindMembers): Only call filter if the constructor
20799 bulider is not null.
20801 Also handle delegates in `NestedTypes' now. Now we will perform
20802 type lookups using the standard resolution process. This also
20805 * decl.cs (DeclSpace.ResolveType): New type resolution routine.
20806 This uses Expressions (the limited kind that can be parsed by the
20807 tree) instead of strings.
20809 * expression.cs (ComposedCast.ToString): Implement, used to flag
20810 errors since now we have to render expressions.
20812 (ArrayCreation): Kill FormElementType. Use ComposedCasts in
20815 * ecore.cs (SimpleName.ToString): ditto.
20817 * cs-parser.jay: Instead of using strings to assemble types, use
20818 Expressions to assemble the type (using SimpleName, ComposedCast,
20819 MemberAccess). This should fix the type lookups in declarations,
20820 because we were using a different code path for this.
20822 * statement.cs (Block.Resolve): Continue processing statements
20823 even when there is an error.
20825 2002-07-17 Miguel de Icaza <miguel@ximian.com>
20827 * class.cs (Event.Define): Also remove the `remove' method from
20828 the list of pending items.
20830 * expression.cs (ParameterReference): Use ldarg.N (0..3) to
20831 generate more compact code.
20833 2002-07-17 Martin Baulig <martin@gnome.org>
20835 * const.cs (Const.LookupConstantValue): Add support for constant
20836 `unchecked' and `checked' expressions.
20837 Also adding test case test-140.cs for this.
20839 2002-07-17 Martin Baulig <martin@gnome.org>
20841 * statement.cs (Foreach.GetEnumeratorFilter): When compiling corlib,
20842 check whether mi.ReturnType implements the IEnumerator interface; the
20843 `==' and the IsAssignableFrom() will fail in this situation.
20845 2002-07-16 Ravi Pratap <ravi@ximian.com>
20847 * ecore.cs (SimpleName.SimpleNameResolve) : Apply Gonzalo's fix
20850 2002-07-16 Gonzalo Paniagua Javier <gonzalo@ximian.com>
20852 * expression.cs: fixed bug #27811.
20854 2002-07-14 Miguel de Icaza <miguel@ximian.com>
20856 * expression.cs (ParameterReference.AddressOf): Patch from Paolo
20857 Molaro: when we are a ref, the value already contains a pointer
20858 value, do not take the address of it.
20860 2002-07-14 Rafael Teixeira <rafaelteixeirabr@hotmail.com>
20861 * removed mb-parser.jay and mb-tokenizer.cs
20863 Sat Jul 13 19:38:03 CEST 2002 Paolo Molaro <lupus@ximian.com>
20865 * expression.cs: check against the building corlib void type.
20867 Sat Jul 13 19:35:58 CEST 2002 Paolo Molaro <lupus@ximian.com>
20869 * ecore.cs: fix for valuetype static readonly fields: when
20870 initializing them, we need their address, not the address of a copy.
20872 Sat Jul 13 17:32:53 CEST 2002 Paolo Molaro <lupus@ximian.com>
20874 * typemanager.cs: register also enum_type in corlib.
20876 Sat Jul 13 15:59:47 CEST 2002 Paolo Molaro <lupus@ximian.com>
20878 * class.cs: allow calling this (but not base) initializers in structs.
20880 Sat Jul 13 15:12:06 CEST 2002 Paolo Molaro <lupus@ximian.com>
20882 * ecore.cs: make sure we compare against the building base types
20885 Sat Jul 13 15:10:32 CEST 2002 Paolo Molaro <lupus@ximian.com>
20887 * typemanager.cs: fix TypeToCoreType() to handle void and object
20888 (corlib gets no more typerefs after this change).
20890 2002-07-12 Miguel de Icaza <miguel@ximian.com>
20892 * expression.cs (ArrayCreation.EmitArrayArguments): use
20893 Conv.Ovf.U4 for unsigned and Conv.Ovf.I4 for signed.
20895 (ArrayAccess.LoadArrayAndArguments): Use Conv_Ovf_I and
20896 Conv_Ovf_I_Un for the array arguments. Even if C# allows longs as
20897 array indexes, the runtime actually forbids them.
20899 * ecore.cs (ExpressionToArrayArgument): Move the conversion code
20900 for array arguments here.
20902 * expression.cs (EmitLoadOpcode): System.Char is a U2, use that
20903 instead of the default for ValueTypes.
20905 (New.DoEmit): Use IsValueType instead of
20906 IsSubclassOf (value_type)
20907 (New.DoResolve): ditto.
20908 (Invocation.EmitCall): ditto.
20910 * assign.cs (Assign): ditto.
20912 * statement.cs (Unsafe): Ok, so I got the semantics wrong.
20913 Statements *are* currently doing part of their resolution during
20916 Expressions do always resolve during resolve, but statements are
20917 only required to propagate resolution to their children.
20919 2002-07-11 Miguel de Icaza <miguel@ximian.com>
20921 * driver.cs (CSCParseOption): Finish the /r: and /lib: support.
20923 (LoadAssembly): Do not add the dll if it is already specified
20925 (MainDriver): Add the System directory to the link path at the end,
20926 after all the other -L arguments.
20928 * expression.cs (ArrayAccess.EmitLoadOpcode): I was using the
20929 wrong opcode for loading bytes and bools (ldelem.i1 instead of
20930 ldelem.u1) and using the opposite for sbytes.
20932 This fixes Digger, and we can finally run it.
20934 * driver.cs (UnixParseOption): Move the option parsing here.
20935 (CSCParseOption): Implement CSC-like parsing of options.
20937 We now support both modes of operation, the old Unix way, and the
20938 new CSC-like way. This should help those who wanted to make cross
20939 platform makefiles.
20941 The only thing broken is that /r:, /reference: and /lib: are not
20942 implemented, because I want to make those have the same semantics
20943 as the CSC compiler has, and kill once and for all the confussion
20944 around this. Will be doing this tomorrow.
20946 * statement.cs (Unsafe.Resolve): The state is checked during
20947 resolve, not emit, so we have to set the flags for IsUnsfe here.
20949 2002-07-10 Miguel de Icaza <miguel@ximian.com>
20951 * expression.cs (MemberAccess.ResolveMemberAccess): Since we can
20952 not catch the Error_ObjectRefRequired in SimpleName (as it is
20953 possible to have a class/instance variable name that later gets
20954 deambiguated), we have to check this here.
20956 2002-07-10 Ravi Pratap <ravi@ximian.com>
20958 * class.cs (TypeContainer.GetFieldFromEvent): Move away from here,
20959 make static and put into Expression.
20961 (Event.Define): Register the private field of the event with the
20962 TypeManager so that GetFieldFromEvent can get at it.
20964 (TypeManager.RegisterPrivateFieldOfEvent): Implement to
20965 keep track of the private field associated with an event which
20968 (TypeManager.GetPrivateFieldOfEvent): Implement to get at the
20971 * ecore.cs (GetFieldFromEvent): RE-write to use the above methods.
20973 2002-07-10 Miguel de Icaza <miguel@ximian.com>
20975 * expression.cs (Binary.EmitBranchable): this routine emits the
20976 Binary expression in a branchable context. This basically means:
20977 we need to branch somewhere, not just get the value on the stack.
20979 This works together with Statement.EmitBoolExpression.
20981 * statement.cs (Statement.EmitBoolExpression): Use
20984 2002-07-09 Miguel de Icaza <miguel@ximian.com>
20986 * statement.cs (For): Reduce the number of jumps in loops.
20988 (For): Implement loop inversion for the For statement.
20990 (Break): We can be breaking out of a Try/Catch controlled section
20991 (foreach might have an implicit try/catch clause), so we need to
20992 use Leave instead of Br.
20994 * ecore.cs (FieldExpr.AddressOf): Fix for test-139 (augmented
20995 now). If the instace expression supports IMemoryLocation, we use
20996 the AddressOf method from the IMemoryLocation to extract the
20997 address instead of emitting the instance.
20999 This showed up with `This', as we were emitting the instance
21000 always (Emit) instead of the Address of This. Particularly
21001 interesting when This is a value type, as we dont want the Emit
21002 effect (which was to load the object).
21004 2002-07-08 Miguel de Icaza <miguel@ximian.com>
21006 * attribute.cs: Pass the entry point to the DefinePInvokeMethod
21008 * statement.cs (Checked): Set the CheckedState during the resolve
21009 process too, as the ConvCast operations track the checked state on
21010 the resolve process, and not emit.
21012 * cs-parser.jay (namespace_member_declaration): Flag that we have
21013 found a declaration when we do. This is used to flag error 1529
21015 * driver.cs: Report ok when we display the help only.
21017 2002-07-06 Andrew Birkett <adb@tardis.ed.ac.uk>
21019 * cs-tokenizer.cs (xtoken): Improve handling of string literals.
21021 2002-07-04 Miguel de Icaza <miguel@ximian.com>
21023 * cs-tokenizer.cs (define): We also have to track locally the
21024 defines. AllDefines is just used for the Conditional Attribute,
21025 but we also need the local defines for the current source code.
21027 2002-07-03 Miguel de Icaza <miguel@ximian.com>
21029 * statement.cs (While, For, Do): These loops can exit through a
21030 Break statement, use this information to tell whether the
21031 statement is the last piece of code.
21033 (Break): Flag that we break.
21035 * codegen.cs (EmitContexts): New `Breaks' state variable.
21037 2002-07-03 Martin Baulig <martin@gnome.org>
21039 * class.cs (TypeContainer.MethodModifiersValid): Allow override
21040 modifiers in method declarations in structs. Otherwise, you won't
21041 be able to override things like Object.Equals().
21043 2002-07-02 Miguel de Icaza <miguel@ximian.com>
21045 * class.cs (Method, Property, Indexer): Do not allow the public
21046 modifier to be used in explicit interface implementations.
21048 (TypeContainer.MethodModifiersValid): Catch virtual, abstract and
21049 override modifiers in method declarations in structs
21051 2002-07-02 Andrew Birkett <adb@tardis.ed.ac.uk>
21053 * cs-tokenizer.cs (adjust_int, adjust_real): Do not abort on
21054 integer or real overflow, report an error
21056 2002-07-02 Martin Baulig <martin@gnome.org>
21058 * typemanager.cs (TypeManager.InitCoreTypes): When compiling
21059 corlib, dynamically call AssemblyBuilder.SetCorlibTypeBuilders()
21060 to tell the runtime about our newly created System.Object and
21061 System.ValueType types.
21063 2002-07-02 Miguel de Icaza <miguel@ximian.com>
21065 * expression.cs (This): Use Stobj/Ldobj when we are a member of a
21066 struct instead of Ldarg/Starg.
21068 2002-07-02 Martin Baulig <martin@gnome.org>
21070 * expression.cs (Indirection.Indirection): Call
21071 TypeManager.TypeToCoreType() on `expr.Type.GetElementType ()'.
21073 2002-07-02 Martin Baulig <martin@gnome.org>
21075 * expression.cs (ArrayAccess.EmitStoreOpcode): If the type is a
21076 ValueType, call TypeManager.TypeToCoreType() on it.
21077 (Invocations.EmitParams): Call TypeManager.TypeToCoreType() on
21078 the OpCodes.Newarr argument.
21080 2002-07-02 Martin Baulig <martin@gnome.org>
21082 * expression.cs (Invocation.EmitCall): When compiling corlib,
21083 replace all calls to the system's System.Array type to calls to
21084 the newly created one.
21086 * typemanager.cs (TypeManager.InitCodeHelpers): Added a few more
21087 System.Array methods.
21088 (TypeManager.InitCoreTypes): When compiling corlib, get the methods
21089 from the system's System.Array type which must be replaced.
21091 Tue Jul 2 19:05:05 CEST 2002 Paolo Molaro <lupus@ximian.com>
21093 * typemanager.cs: load unverifiable_code_ctor so we can build
21094 corlib using the correct type. Avoid using GetTypeCode() with
21096 * rootcontext.cs: uses TypeManager.unverifiable_code_ctor and
21097 TypeManager.object_type to allow building corlib.
21099 Tue Jul 2 19:03:19 CEST 2002 Paolo Molaro <lupus@ximian.com>
21101 * ecore.cs: handle System.Enum separately in LoadFromPtr().
21103 2002-07-01 Martin Baulig <martin@gnome.org>
21105 * class.cs: Make the last change actually work, we need to check
21106 whether `ifaces != null' to avoid a crash.
21108 Mon Jul 1 16:15:03 CEST 2002 Paolo Molaro <lupus@ximian.com>
21110 * class.cs: when we build structs without fields that implement
21111 interfaces, we need to add the interfaces separately, since there is
21112 no API to both set the size and add the interfaces at type creation
21115 Mon Jul 1 14:50:47 CEST 2002 Paolo Molaro <lupus@ximian.com>
21117 * expression.cs: the dimension arguments to the array constructors
21118 need to be converted if they are a long.
21120 Mon Jul 1 12:26:12 CEST 2002 Paolo Molaro <lupus@ximian.com>
21122 * class.cs: don't emit ldarg.0 if there is no parent constructor
21123 (fixes showstopper for corlib).
21125 2002-06-29 Martin Baulig <martin@gnome.org>
21127 MCS now compiles corlib on GNU/Linux :-)
21129 * attribute.cs (Attribute.ApplyAttributes): Treat Accessors like Method,
21130 ie. check for MethodImplOptions.InternalCall.
21132 * class.cs (TypeContainer.DefineType): When compiling corlib, both parent
21133 and TypeManager.attribute_type are null, so we must explicitly check
21134 whether parent is not null to find out whether it's an attribute type.
21135 (Property.Emit): Always call Attribute.ApplyAttributes() on the GetBuilder
21136 and SetBuilder, not only if the property is neither abstract nor external.
21137 This is necessary to set the MethodImplOptions on the accessor methods.
21138 (Indexer.Emit): Call Attribute.ApplyAttributes() on the GetBuilder and
21139 SetBuilder, see Property.Emit().
21141 * rootcontext.cs (RootContext.PopulateTypes): When compiling corlib, don't
21142 populate "System.Object", "System.ValueType" and "System.Attribute" since
21143 they've already been populated from BootCorlib_PopulateCoreTypes().
21145 2002-06-29 Martin Baulig <martin@gnome.org>
21147 * ecore.cs (Expression.ImplicitReferenceConversionExists): If expr
21148 is the NullLiteral, we also need to make sure that target_type is not
21151 2002-06-29 Martin Baulig <martin@gnome.org>
21153 * rootcontext.cs (RootContext.ResolveCore): We must initialize
21154 `TypeManager.multicast_delegate_type' and `TypeManager.delegate_type'
21155 before calling BootstrapCorlib_ResolveDelegate ().
21157 2002-06-27 Gonzalo Paniagua Javier <gonzalo@ximian.com>
21159 * statement.cs: fixed build-breaker. All tests passed ok.
21161 2002-06-27 Martin Baulig <martin@gnome.org>
21163 * typemanager.cs (TypeManager.VerifyUnManaged): Added explicit check
21164 for System.Decimal when compiling corlib.
21166 2002-06-27 Martin Baulig <martin@gnome.org>
21168 * statement.cs (Switch.TableSwitchEmit): Make this work with empty
21169 switch blocks which contain nothing but a default clause.
21171 2002-06-26 Andrew <adb@tardis.ed.ac.uk>
21173 * ../errors/cs1501-3.cs: Added new test for struct ctr typechecks.
21175 2002-06-27 Martin Baulig <martin@gnome.org>
21177 * ecore.cs (PropertyExpr.PropertyExpr): Call
21178 TypeManager.TypeToCoreType() on the `pi.PropertyType'.
21180 * typemanager.cs (TypeManager.TypeToCoreType): Return if the type
21181 is already a TypeBuilder.
21183 2002-06-27 Martin Baulig <martin@gnome.org>
21185 * ecore.cs (Expression.ImplicitReferenceConversionExists): Use
21186 `target_type == TypeManager.array_type', not IsAssignableFrom() in
21187 the "from an array-type to System.Array" case. This makes it work
21188 when compiling corlib.
21190 2002-06-27 Martin Baulig <martin@gnome.org>
21192 * ecore.cs (Expression.SimpleNameResolve): If the expression is a
21193 non-static PropertyExpr, set its InstanceExpression. This makes
21194 the `ICollection.Count' property work in System/Array.cs.
21196 2002-06-25 Andrew Birkett <adb@tardis.ed.ac.uk>
21198 * driver.cs: Made error handling more consistent. Errors now
21199 tracked by Report class, so many methods which used to return int
21200 now return void. Main() now prints success/failure and
21201 errors/warnings message.
21203 Renamed '--probe' compiler argument to '--expect-error'. Removed
21204 the magic number return values (123 and 124). Now, if the
21205 expected error occurs, the compiler exits with success (exit value
21206 0). If the compilation completes without seeing that particular
21207 error, the compiler exits with failure (exit value 1). The
21208 makefile in mcs/errors has been changed to handle the new behaviour.
21210 * report.cs: Made 'expected error' number a property and renamed
21211 it from 'Probe' to 'ExpectedError'.
21213 * genericparser.cs: Removed error handling support, since it is
21214 now all done by Report class.
21216 * cs-parser.jay, mb-parser.jay: Errors are tracked by Report
21217 class, so parse() no longer returns an int.
21219 * namespace.cs: Use Report.Error instead of GenericParser.error
21221 2002-06-22 Miguel de Icaza <miguel@ximian.com>
21223 * class.cs (TypeContainer.AddMethod, TypeContainer.AddIndexer,
21224 TypeContainer.AddOperator): At the front of the list put the
21225 explicit implementations, so they get resolved/defined first.
21227 2002-06-21 Miguel de Icaza <miguel@ximian.com>
21229 * class.cs (TypeContainer.VerifyImplements): Verifies that a given
21230 interface type is implemented by this TypeContainer. Used during
21231 explicit interface implementation.
21233 (Property.Define, Indexer.Define, Method.Define): Validate that
21234 the given interface in the explicit implementation is one of the
21235 base classes for the containing type.
21237 Also if we are explicitly implementing an interface, but there is
21238 no match in the pending implementation table, report an error.
21240 (Property.Define): Only define the property if we are
21241 not explicitly implementing a property from an interface. Use the
21242 correct name also for those properties (the same CSC uses,
21243 although that is really not needed).
21245 (Property.Emit): Do not emit attributes for explicitly implemented
21246 properties, as there is no TypeBuilder.
21248 (Indexer.Emit): ditto.
21250 Hiding then means that we do not really *implement* a pending
21251 implementation, which makes code fail.
21253 2002-06-22 Martin Baulig <martin@gnome.org>
21255 * ecore.cs (Expression.Constantify): Call TypeManager.TypeToCoreType() on
21256 the return value of Object.GetType(). [FIXME: we need to do this whenever
21257 we get a type back from the reflection library].
21259 Fri Jun 21 13:37:57 CEST 2002 Paolo Molaro <lupus@ximian.com>
21261 * typemanager.cs: make ExpandInterfaces() slip duplicated interfaces.
21263 2002-06-20 Miguel de Icaza <miguel@ximian.com>
21265 * attribute.cs: Return null if we can not look up the type.
21267 * class.cs (TypeContainer.GetClassBases): Use ExpandInterfaces on
21268 the interface types found.
21270 * interface.cs (Interface.GetInterfaceBases): Use ExpandInterfaces on the
21271 interface types found.
21273 * typemanager.cs (GetInterfaces): Make this routine returns alll
21274 the interfaces and work around the lame differences between
21275 System.Type and System.Reflection.Emit.TypeBuilder in the results
21276 result for GetInterfaces.
21278 (ExpandInterfaces): Given an array of interface types, expand and
21279 eliminate repeated ocurrences of an interface. This expands in
21280 context like: IA; IB : IA; IC : IA, IB; the interface "IC" to
21283 2002-06-21 Martin Baulig <martin@gnome.org>
21285 * typemanager.cs (TypeManager.EnumToUnderlying): It's now safe to call this function
21288 2002-06-21 Martin Baulig <martin@gnome.org>
21290 * typemanager.cs (TypeManager.TypeToCoreType): New function. When compiling corlib
21291 and called with one of the core types, return the corresponding typebuilder for
21294 * expression.cs (ArrayAccess.DoResolve): Call TypeManager.TypeToCoreType() on the
21297 2002-06-21 Martin Baulig <martin@gnome.org>
21299 * ecore.cs (Expression.ExplicitReferenceConversionExists): Use
21300 `target_type.IsArray' instead of `target_type.IsSubclassOf (TypeManager.array_type)'.
21301 (Expression.ConvertReferenceExplicit): Likewise.
21303 * expression.cs (ElementAccess.DoResolve): Likewise.
21304 (ElementAccess.DoResolveLValue): Likewise.
21306 2002-06-10 Martin Baulig <martin@gnome.org>
21308 * interface.cs (Interface.PopulateIndexer): When creating the setter, we need to
21309 add the "value" parameter to the parameter list.
21311 * statement.cs (Fixed.Emit): Pass the return value of the child block's Emit()
21314 2002-06-19 Miguel de Icaza <miguel@ximian.com>
21316 * expression.cs (ArrayCreation.ExpressionToArrayArgument): Convert
21317 the argument to an int, uint, long or ulong, per the spec. Also
21318 catch negative constants in array creation.
21320 Thu Jun 20 17:56:48 CEST 2002 Paolo Molaro <lupus@ximian.com>
21322 * class.cs: do not allow the same interface to appear twice in
21323 the definition list.
21325 Wed Jun 19 22:33:37 CEST 2002 Paolo Molaro <lupus@ximian.com>
21327 * ecore.cs: don't use ldlen with System.Array.
21329 Wed Jun 19 20:57:40 CEST 2002 Paolo Molaro <lupus@ximian.com>
21331 * ecore.cs: stobj requires a type argument. Handle indirect stores on enums.
21333 Wed Jun 19 20:17:59 CEST 2002 Paolo Molaro <lupus@ximian.com>
21335 * modifiers.cs: produce correct field attributes for protected
21336 internal. Easy fix so miguel can work on ther harder stuff:-)
21338 2002-06-18 Miguel de Icaza <miguel@ximian.com>
21340 * pending.cs: New file. Move the code from class.cs here.
21341 Support clearning the pending flag for all methods (when not doing
21342 explicit interface implementation).
21344 Tue Jun 18 10:36:22 CEST 2002 Paolo Molaro <lupus@ximian.com>
21346 * rootcontext.cs: added a couple more types needed to bootstrap.
21348 2002-06-17 Miguel de Icaza <miguel@ximian.com>
21350 * typemanager.cs (GetConstructor): Use DeclaredOnly to look the
21351 constructor in the type, instead of any constructor in the type
21352 hierarchy. Thanks to Paolo for finding this bug (it showed up as
21353 a bug in the Mono runtime when applying the params attribute).
21355 2002-06-16 Rafael Teixeira <rafaelteixeirabr@hotmail.com>
21356 * changed namespace.cs to use "GenericParser.error(...)" instead of "CSharpParser.error(...)"
21358 2002-06-14 Rachel Hestilow <hestilow@ximian.com>
21360 * expression.cs (Unary.ResolveOperator): Use TypeManager
21361 to resolve the type.
21363 2002-06-13 Ravi Pratap <ravi@ximian.com>
21365 * cs-parser.jay (enum_member_declaration): Pass in the attributes
21368 * enum.cs (AddEnumMember): Add support to store the attributes associated
21369 with each member too.
21371 * attribute.cs (CheckAttribute, ApplyAttributes): Update to handle
21372 field builders too - this takes care of the enum member case.
21374 2002-06-10 Rachel Hestilow <hestilow@ximian.com>
21376 * typemanager.cs (TypeManager.VerifyUnManaged): Allow
21377 address-of operator on both value types and pointers.
21379 2002-06-10 Martin Baulig <martin@gnome.org>
21381 * interface.cs (Interface.PopulateIndexer): Add the indexer's
21382 PropertyBuilder to the `property_builders' list.
21384 * expression.cs (Indexers.GetIndexersForTypeOrInterface): New private method.
21385 (Indexers.GetIndexersForType): Call GetIndexersForTypeOrInterface() on the
21386 `lookup_type' and all its interfaces. Unfortunately, Type.FindMembers() won't
21387 find any indexers which are inherited from an interface.
21389 2002-06-09 Martin Baulig <martin@gnome.org>
21391 * const.cs (Const.LookupConstantValue): Convert `Expr' to a literal of
21392 the same type as the constant if necessary. There's also a test-130.cs
21395 * enum.cs (Enum.ChangeEnumType): Moved to typemanager.cs and made public.
21397 * typemanager.cs (TypeManager.ChangeType): Previously known as
21398 Enum.ChangeEnumType().
21400 2002-06-09 Martin Baulig <martin@gnome.org>
21402 * expression.cs (Cast.TryReduce): Added support for consts.
21404 2002-06-08 Ravi Pratap <ravi@ximian.com>
21406 * class.cs (Accessor): Hold attributes information so we can pass
21409 * cs-parser.jay (get_accessor_declaration, set_accessor_declaration):
21410 Modify to pass in attributes attached to the methods.
21412 (add_accessor_declaration, remove_accessor_declaration): Ditto.
21414 * attribute.cs (ApplyAttributes, CheckAttribute): Update accordingly
21415 to handle the Accessor kind :-)
21417 * class.cs (Property.Emit, Event.Emit): Apply attributes to the accessors
21419 2002-06-08 Martin Baulig <martin@gnome.org>
21421 * expression.cs (Unary.TryReduceNegative): Added support for
21424 2002-06-08 Martin Baulig <martin@gnome.org>
21426 * enum.cs (Enum.LookupEnumValue): Don't report an error if the
21427 name can't be found in the `defined_names' - the caller will do a
21428 MemberLookup in this case and thus find methods in System.Enum
21429 such as Enum.IsDefined().
21431 2002-06-08 Martin Baulig <martin@gnome.org>
21433 * enum.cs (Enum.ChangeEnumType): This is a custom version of
21434 Convert.ChangeType() which works with TypeBuilder created types.
21435 (Enum.LookupEnumValue, Enum.Define): Use it here.
21437 * class.cs (TypeContainer.RegisterRequiredImplementations): Added
21438 `TypeBuilder.BaseType != null' check.
21439 (TypeContainer.FindMembers): Only lookup parent members if we
21440 actually have a parent.
21441 (Method.EmitDestructor): Added `ec.ContainerType.BaseType != null' check.
21442 (ConstructorInitializer.Resolve): Likewise.
21444 * interface.cs (Interface.FindMembers): Added
21445 `TypeBuilder.BaseType != null' check.
21447 * rootcontext.cs (RootContext.ResolveCore): Added
21448 "System.Runtime.CompilerServices.IndexerNameAttribute" to
21449 classes_second_stage.
21451 * typemanager.cs (TypeManager.InitCoreTypes): Don't initialize
21452 debug_type and trace_type when compiling with --nostdlib.
21454 2002-06-07 Martin Baulig <martin@gnome.org>
21456 * class.cs (TypeContainer): Added `have_nonstatic_fields' field.
21457 (AddField): Set it to true when adding a non-static field.
21458 (DefineType): Use `have_nonstatic_fields' to find out whether we
21459 have non-static fields, not `Fields != null'.
21461 2002-06-02 Miguel de Icaza <miguel@ximian.com>
21463 * ecore.cs (SimpleNameResolve): Removed simple bug (we were
21464 dereferencing a null on the static-field code path)
21466 2002-05-30 Martin Baulig <martin@gnome.org>
21468 * codegen.cs (InitMonoSymbolWriter): Added `string[] args' argument
21469 to take command line arguments. Use reflection to call the new
21470 custom `Initialize' function on the symbol writer and pass it the
21471 command line arguments.
21473 * driver.cs (--debug-args): New command line argument to pass command
21474 line arguments to the symbol writer.
21476 2002-05-28 Miguel de Icaza <miguel@ximian.com>
21478 * assign.cs (DoResolve): Forgot to do the implicit conversion to
21479 the target type for indexers and properties. Thanks to Joe for
21482 2002-05-27 Miguel de Icaza <miguel@ximian.com>
21484 * typemanager.cs (MethodFlags): returns the method flags
21485 (Obsolete/ShouldIgnore) that control warning emission and whether
21486 the invocation should be made, or ignored.
21488 * expression.cs (Invocation.Emit): Remove previous hack, we should
21489 not do this on matching a base type, we should do this based on an attribute
21491 Only emit calls to System.Diagnostics.Debug and
21492 System.Diagnostics.Trace if the TRACE and DEBUG defines are passed
21493 on the command line.
21495 * rootcontext.cs: Global settings for tracing and debugging.
21497 * cs-tokenizer.cs (define): New utility function to track
21498 defines. Set the global settings for TRACE and DEBUG if found.
21500 2002-05-25 Ravi Pratap <ravi@ximian.com>
21502 * interface.cs (Populate*): Pass in the TypeContainer as well as
21503 the DeclSpace as parameters so that we can create EmitContexts and
21504 then use that to apply attributes etc.
21506 (PopulateMethod, PopulateEvent, PopulateProperty)
21507 (PopulateIndexer): Apply attributes everywhere.
21509 * attribute.cs (CheckAttribute): Include InterfaceMethod, InterfaceEvent
21512 (ApplyAttributes): Update accordingly.
21514 We now apply interface attributes for all members too.
21516 2002-05-26 Miguel de Icaza <miguel@ximian.com>
21518 * class.cs (Indexer.Define); Correctly check if we are explicit
21519 implementation (instead of checking the Name for a ".", we
21520 directly look up if the InterfaceType was specified).
21522 Delay the creation of the PropertyBuilder.
21524 Only create the PropertyBuilder if we are not an explicit
21525 interface implementation. This means that explicit interface
21526 implementation members do not participate in regular function
21527 lookups, and hence fixes another major ambiguity problem in
21528 overload resolution (that was the visible effect).
21530 (DefineMethod): Return whether we are doing an interface
21533 * typemanager.cs: Temporary hack until we get attributes in
21534 interfaces (Ravi is working on that) and we get IndexerName
21535 support in interfaces.
21537 * interface.cs: Register the indexers as properties.
21539 * attribute.cs (Attribute.Resolve): Catch the error, and emit a
21540 warning, I have verified that this is a bug in the .NET runtime
21541 (JavaScript suffers of the same problem).
21543 * typemanager.cs (MemberLookup): When looking up members for
21544 interfaces, the parent of an interface is the implicit
21545 System.Object (so we succeed in searches of Object methods in an
21546 interface method invocation. Example: IEnumerable x; x.ToString
21549 2002-05-25 Miguel de Icaza <miguel@ximian.com>
21551 * class.cs (Event): Events should also register if they do
21552 implement the methods that an interface requires.
21554 * typemanager.cs (MemberLookup); use the new GetInterfaces
21557 (GetInterfaces): The code used to lookup interfaces for a type is
21558 used in more than one place, factor it here.
21560 * driver.cs: Track the errors at the bottom of the file, we kept
21563 * delegate.cs (NewDelegate.Emit): We have to emit a null as the
21564 instance if the method we are calling is static!
21566 2002-05-24 Miguel de Icaza <miguel@ximian.com>
21568 * attribute.cs (ApplyAttributes): Make this function filter out
21569 the IndexerName attribute (as that attribute in reality is never
21570 applied) and return the string constant for the IndexerName
21573 * class.cs (TypeContainer.Emit): Validate that all the indexers
21574 have the same IndexerName attribute, and if so, set the
21575 DefaultName attribute on the class.
21577 * typemanager.cs: The return value might contain other stuff (not
21578 only methods). For instance, consider a method with an "Item"
21579 property and an Item method.
21581 * class.cs: If there is a problem with the parameter types,
21584 2002-05-24 Ravi Pratap <ravi@ximian.com>
21586 * ecore.cs (ImplicitConversionExists): Wrapper function which also
21587 looks at user defined conversion after making a call to
21588 StandardConversionExists - we need this for overload resolution.
21590 * expression.cs : Update accordingly the various method calls.
21592 This fixes 2 bugs filed against implicit user defined conversions
21594 2002-05-22 Miguel de Icaza <miguel@ximian.com>
21596 * statement.cs: Track the result of the assignment.
21598 2002-05-21 Miguel de Icaza <miguel@ximian.com>
21600 * expression.cs (MemberAccess): Improved error reporting for
21601 inaccessible members.
21603 2002-05-22 Martin Baulig <martin@gnome.org>
21605 * makefile (mcs-mono2.exe): New target. This is mcs compiled with
21606 itself with debugging support.
21608 2002-05-22 Martin Baulig <martin@gnome.org>
21610 * typemanager.cs ("System.Runtime.InteropServices.StructLayoutAttribute"):
21611 Removed, this isn't needed anymore.
21613 2002-05-20 Martin Baulig <martin@gnome.org>
21615 * typemanager.cs (InitEnumUnderlyingTypes): "System.Char" can't
21616 be underlying type for an enum.
21618 2002-05-20 Miguel de Icaza <miguel@ximian.com>
21620 * typemanager.cs (InitEnumUnderlyingTypes): New helper function
21621 that splits out the loading of just the core types.
21623 * rootcontext.cs (ResolveCore): Split the struct resolution in
21624 two, so we can load the enumeration underlying types before any
21627 * expression.cs (Is): Bandaid until we fix properly Switch (see
21628 bug #24985 for details).
21630 * typemanager.cs (ImplementsInterface): The hashtable will contain
21631 a null if there are no interfaces implemented.
21633 2002-05-18 Miguel de Icaza <miguel@ximian.com>
21635 * cs-parser.jay (indexer_declarator): It is fine to have array
21638 2002-05-17 Miguel de Icaza <miguel@ximian.com>
21640 * typemanager.cs: (RegisterBuilder): New function used to register
21641 TypeBuilders that implement interfaces. Since
21642 TypeBuilder.GetInterfaces (as usual) does not work with lame
21644 (AddUserType): register interfaces.
21646 (ImplementsInterface): Use the builder_to_ifaces hash if we are
21647 dealing with TypeBuilder. Also, arrays are showing up as
21648 SymbolTypes, which are not TypeBuilders, but whose GetInterfaces
21649 methods can not be invoked on them!
21651 * ecore.cs (ExplicitReferenceConversionExists): Made public.
21652 (ImplicitReferenceConversionExists): Split out from
21653 StandardConversionExists.
21655 * expression.cs (As): We were only implementing one of the three
21656 cases for the as operator. We now implement them all.
21657 (Is): Implement the various other cases for Is as well.
21659 * typemanager.cs (CACHE): New define used to control if we want or
21660 not the FindMembers cache. Seems to have a negative impact on
21661 performance currently
21663 (MemberLookup): Nested types have full acess to
21664 enclosing type members
21666 Remove code that coped with instance/static returns for events, we
21667 now catch this in RealFindMembers.
21669 (RealFindMembers): only perform static lookup if the instance
21670 lookup did not return a type or an event.
21672 2002-05-17 Miguel de Icaza <miguel@ximian.com>
21674 * assign.cs (CompoundAssign): We pass more semantic information
21675 now to Compound Assignments than we did before: now we have all
21676 the information at hand, and now we resolve the target *before* we
21677 do the expression expansion, which allows the "CacheValue" method
21678 to have the effect we intended (before, a [x] += 1 would generate
21679 two differen ArrayAccess expressions from the ElementAccess,
21680 during the resolution process).
21682 (CompoundAssign.DoResolve): Resolve target and original_source here.
21684 2002-05-16 Miguel de Icaza <miguel@ximian.com>
21686 * expression.cs (ArrayAccess): dropped debugging information.
21688 * typemanager.cs: Small bug fix: I was always returning i_members,
21689 instead of one of i_members or s_members (depending on which had
21692 * assign.cs (IAssignMethod.CacheTemporaries): New method. This
21693 method is invoked before any code generation takes place, and it
21694 is a mechanism to inform that the expression will be invoked more
21695 than once, and that the method should use temporary values to
21696 avoid having side effects
21698 (Assign.Emit): Call CacheTemporaries in the IAssignMethod.
21700 * ecore.cs (Expression.CacheTemporaries): Provide empty default
21703 * expression.cs (Indirection, ArrayAccess): Add support for
21704 CacheTemporaries in these two bad boys.
21706 * ecore.cs (LoadFromPtr): figure out on our own if we need to use
21707 ldobj or ldind_ref.
21708 (StoreFromPtr): Handle stobj as well.
21710 * expression.cs (UnaryMutator): Share more code.
21712 * typemanager.cs (FindMembers): Thanks to Paolo for tracking this
21713 down: I was not tracking the Filter function as well, which
21714 was affecting the results of the cache.
21716 2002-05-15 Miguel de Icaza <miguel@ximian.com>
21718 * attribute.cs: Remove the hack to handle the CharSet property on
21721 2002-05-14 Miguel de Icaza <miguel@ximian.com>
21723 * attribute.cs (DoResolve): More uglyness, we now only try to
21724 resolve the attribute partially, to extract the CharSet
21725 information (only if we are a StructLayout attribute). Otherwise
21727 (GetExtraTypeInfo): Add some code to conditionally kill in the
21728 future this. I am more and more convinced that the .NET
21729 framework has special code to handle the attribute setting on
21732 * expression.cs (IsParamsMethodApplicable): Revert my previous
21733 foreach change here, it was wrong.
21735 2002-05-13 Miguel de Icaza <miguel@ximian.com>
21737 * cs-tokenizer.cs: (pp_primary): Eat the ')' at the end.
21738 (pp_expr): do not abort on unknown input, just return.
21739 (eval): abort if there are pending chars.
21741 * attribute.cs (Attribute.Resolve): Positional parameters are
21742 optional. Deal with that case.
21744 * class.cs (DefineType): Call Attribute.GetExtraTypeInfo to fetch
21745 the Ansi/Unicode/Auto information for the type.
21747 (TypeContainer.DefineType): instantiate the EmitContext here, as
21748 we will be using it during the type definition (to resolve
21749 attributes) and during the emit phase.
21751 * attribute.cs (Attribute.GetExtraTypeInfo): This routine is used
21752 to pull type information out of the attributes
21754 (Attribute.Resolve): track the constructor builder, and allow for
21755 multiple invocations (structs and classes will use this).
21757 * ecore.cs (MemberLookupFinal): new version with all the
21758 parameters customizable.
21760 * expression.cs (New.DoResolve): Use MemberLookupFinal to locate
21761 constructors. Return if the result value is null (as the error
21762 would have been flagged already by MemberLookupFinal)
21764 Do not allow instances of abstract classes or interfaces to be
21767 * class.cs: (MethodSignature.InheritableMemberSignatureCompare):
21768 We have to compare the assembly property here when dealing with
21769 FamANDAssem and Assembly access modifiers, because we might be
21770 creating an assembly from *modules* (that means that we are not
21771 getting TypeBuilders for types defined in other modules that are
21772 part of this assembly).
21774 (Method.Emit): If the method is marked abstract and has a body,
21777 (TypeContainer.DefineMembers): If both the defined member and the
21778 parent name match are methods, then do not emit any warnings: let
21779 the Method.Define routine take care of flagging warnings. But if
21780 there is a mismatch (method overrides something else, or method is
21781 overriwritten by something, then emit warning).
21783 (MethodSignature.MemberSignatureCompare): If the sig.ret_type is
21784 set to null, this means `do not check for the return type on the
21787 (Method.Define): set the return type for the method signature to
21788 null, so that we get methods with the same name and parameters and
21789 different return types. This is used to flag warning 114 (you are
21790 hiding a method, and you probably want to use the new/override
21793 * typemanager.cs (MemberLookup): Implemented proper access
21794 control, closing a long standing set of bug reports. The problem
21795 was that the Framework only has two bits: Public and NonPublic,
21796 and NonPublic includes private and protected methods, but we need
21797 to enforce the FamANDAssem, FamOrAssem and Family.
21799 2002-05-11 Miguel de Icaza <miguel@ximian.com>
21801 * statement.cs (GotoCase): Return true: Ammounts to giving up
21802 knowledge on whether we return or not, and letting the other case
21803 be responsible for it.
21805 2002-05-10 Miguel de Icaza <miguel@ximian.com>
21807 * driver.cs: Do not load directories for each file processed, only
21808 do it if there is a pattern.
21810 * ecore.cs: Report readonly assigns here as well, as we might have
21811 been resolved only by MemberAccess.
21813 (SimpleName.SimpleNameResolve): Also be useful for LValue
21814 resolution. We need this to propagate assign to local readonly variables
21816 * typemanager.cs: Use a ptrhashtable for the criteria, because we
21817 do not want to reuse potential criteria memory.
21819 * class.cs (MyEventBuilder): Set reflected_type;
21821 * ecore.cs (Constantify): Added support for constifying bools.
21823 (RootContext.LookupType): Added a cache for values looked up in
21824 the declaration space.
21826 * typemanager.cs (FindMembers): Now is a front-end to
21827 RealFindMembers, and provides a two-level hashtable-based cache to
21830 15% performance improvement: from 22.5 to 19.2 seconds.
21832 * expression.cs (IsParamsMethodApplicable): use foreach.
21833 (Invocation.DoResolve): ditto.
21834 (New.DoResolve): ditto.
21835 (ArrayCreation.DoResolve): ditto.
21837 * ecore.cs (FindMostEncompassingType): use foreach.
21839 * delegate.cs (NewDelegate.DoResolve): Use foreach
21841 * ecore.cs (Expression.FindMostSpecificSource): Use foreach.
21842 (RemoveMethods): use foreach.
21844 * expression.cs (Invocation.MakeUnionSet): Optimization: Use two
21845 nested foreach statements instead of for, and also break out of
21846 the inner loop once a match is found.
21848 (Invocation.OverloadResolve): Use foreach, simplify the code.
21850 2002-05-08 Miguel de Icaza <miguel@ximian.com>
21852 * cfold.cs (BinaryFold): During an enumeration evaluation context,
21853 we actually unwrap the expression to allow for extra information
21856 * expression.cs: Use Shr_Un on unsigned operations.
21858 2002-05-08 Ravi Pratap <ravi@ximian.com>
21860 * ecore.cs (FindMostEncompass*): Fix trivial bug where the set of
21861 applicable operators was not being considered correctly. This closes
21862 the bug Miguel reported.
21864 Wed May 8 16:40:50 CEST 2002 Paolo Molaro <lupus@ximian.com>
21866 * attribute.cs: check that the type derives from System.Attribute
21867 and report the correct error in that case (moved the duplicate code to
21868 its own method, too).
21870 Wed May 8 11:50:31 CEST 2002 Paolo Molaro <lupus@ximian.com>
21872 * attribute.cs: lookup attribute type name as the spec says: first the
21873 bare attribute name and then name + "Attribute" (nant compiles with
21874 mcs after this fix).
21876 2002-05-07 Miguel de Icaza <miguel@ximian.com>
21878 * expression.cs (Unary.TryReduceNegative): Ah! Tricky! Tricky!
21879 Because of the way we parse things, we should try to see if a
21880 UIntConstant can fit in an integer.
21882 2002-05-07 Ravi Pratap <ravi@ximian.com>
21884 * ecore.cs (GetConversionOperators): Do not pick up op_True operators
21885 when we are in an explicit context.
21887 (ConvertReferenceExplicit): When converting from Iface type S to Class
21888 T make sure the rules are implemented as an OR.
21890 * parameter.cs (ParameterType): Make it a property for now although the
21891 purpose really isn't anything immediate.
21893 * expression.cs (Is*Applicable): Do better checking on the parameter type
21894 of a ref/out parameter. The ones from the system assemblies are already
21895 marked with the correct type so we don't need to do any correction.
21897 * ecore.cs (StandardConversionExists): Conversion from Interface types to
21898 the object type is standard too so include that.
21900 2002-05-06 Miguel de Icaza <miguel@ximian.com>
21902 * ecore.cs (StandardConversionExists): Augment with missing code:
21903 deal with IntConstant, LongConstants and Enumerations.
21905 * assign.cs: Report the error, instead of failing silently
21907 * rootcontext.cs (AddGlobalAttributes): Track attributes on the
21908 typecontainer that they are declared, because the
21909 typecontainer/namespace will have the list of using clauses that
21910 need to be applied.
21912 Assembly Attributes were escaping the normal registration
21915 (EmitCode): Apply attributes within an EmitContext that represents
21916 the container they were declared on.
21918 * cs-parser.jay: Track bases for structs. How did I get this wrong?
21920 2002-05-06 Ravi Pratap <ravi@ximian.com>
21922 * ecore.cs (FindMostEncompassingType, FindMostEncompassedType):
21923 Revamp completely - make much cleaner as we now operate only
21926 (FindMostSpecificSource, FindMostSpecificTarget): New methods
21927 to implement the logic detailed in the spec more correctly.
21929 (UserDefinedConversion): Update accordingly.
21931 2002-05-06 Miguel de Icaza <miguel@ximian.com>
21933 * statement.cs: Return flow analysis information up.
21935 * cs-tokenizer.cs (adjust_real): Share code between LITERAL_DOUBLE
21938 (token): Do not consume an extra character before calling
21941 2002-05-06 Piers Haken <piersh@friskit.com>
21943 * cs-parser.jay: add 'override' attribute to System.Object.Finalize
21945 2002-05-06 Miguel de Icaza <miguel@ximian.com>
21947 * class.cs (Constructor.Emit): Set the IsStatic flag in the
21948 EmitContext during the instance constructor initializer
21949 resolution, to stop access to instance variables.
21951 This is mandated by the spec, last paragraph of the `constructor
21952 initializers' section.
21954 2002-05-05 Miguel de Icaza <miguel@ximian.com>
21956 * cs-parser.jay, class.cs (Accessor): new class used to represent
21957 an accessor (get or set). In the past we used `null' to represent
21958 a missing accessor. But this is ambiguous because there was no
21959 way to tell in abstract indexers/properties if one of them was
21962 Now there is a way of addressing that.
21964 * expression.cs (Indexers.GetIndexersForType): Use TypeManager.MemberLookup
21965 instead of FindMembers.
21967 * class.cs (TypeContainer.EmitFieldInitializer): Do not typecast
21968 the result of Assign.Resolve as Assign, but rather as ExpressionStatement.
21970 * attribute.cs: Treat indexers and properties as the same in terms
21971 of applying attributes
21973 * ecore.cs (FindMostEncompassedType): Use statically initialized
21974 EmptyExpressions()s like we do elsewhere to avoid creating useless
21975 objects (and we take this out of the tight loop).
21977 (GetConversionOperators): Move the code to extract the actual
21978 operators to a separate routine to clean things up.
21980 2002-05-04 Miguel de Icaza <miguel@ximian.com>
21982 * ecore.cs (FieldExpr): Remove un-needed tests for null, since now
21983 events are always registered FieldBuilders.
21985 * class.cs (FieldBase): New class shared by Fields
21987 * delegate.cs: If we are a toplevel delegate, use our full name.
21988 If we are a nested delegate, then only use our tail name.
21990 2002-05-02 Ravi Pratap <ravi@ximian.com>
21992 * expression.cs (IsApplicable): Ensure that we add the "&" to
21993 ref/out types before comparing it with the type of the argument.
21995 (IsParamsMethodApplicable): Ditto.
21997 (Argument.Type): Use TypeManager.LookupType instead of Type.GetType -
22000 * delegate.cs : Handle the case when we have more than one applicable
22001 method. Flag an error only when we finish checking all.
22003 2002-05-02 Miguel de Icaza <miguel@ximian.com>
22005 * expression.cs: Add support for boolean static initializers.
22007 2002-05-01 Miguel de Icaza <miguel@ximian.com>
22009 * attribute.cs: Use proper cast for Events, since we use a MyEventBuilder.
22011 * parameter.cs (ComputeParameterTypes,
22012 ComputeAndDefineParameterTypes): Better error handling: now we
22013 clear the `types' cache if we fail during any of the type lookups.
22014 We also return the status code correctly to our caller
22016 * delegate.cs: If we fail to define a delegate, abort the extra
22019 * expression.cs (Binary.ResolveOperator): for
22020 operator==(object,object) and operator !=(object, object) we also
22021 have to verify that there is an implicit conversion from one to
22024 (ArrayAccess.DoResolve): Array Access can operate on
22027 2002-04-30 Miguel de Icaza <miguel@ximian.com>
22029 * assign.cs (CompoundAssign): A new class used as a "flag" that
22030 the assignment actually is happening as part of a compound
22031 assignment operator.
22033 During compound assignment, a few new rules exist to enable things
22040 x op= y can be evaluated as x = (T) (x op y) (ie, an explicit cast
22041 to the type of x) if y is implicitly convertible to the type of x,
22042 and the operator is a builtin operator and the return type of the
22043 operator is explicitly convertible to the type of x.
22045 * rootcontext.cs: Reset warning level to 2. 4 catches various
22046 "interesting" features in mcs, we must clean this up at some
22047 point, but currently am trying to kill other bugs ;-)
22049 * ecore.cs (SimpleName.SimpleNameResolve): Perform member lookups
22050 in container classes as well.
22052 * expression.cs (Binary.ResolveOperator): Handle string case
22053 before anything else (as operator overloading does emit an error
22054 before doing anything else).
22056 This code could go away when we move to a table driven model, but
22057 i could not come up with a good plan last night.
22059 2002-04-30 Lawrence Pit <loz@cable.a2000.nl>
22061 * typemanager.cs (CSharpName): reimplementation using regex.
22062 * class.cs: added null check for fields in Emit
22063 * rootcontext.cs: set warninglevel to 4
22065 2002-04-29 Miguel de Icaza <miguel@ximian.com>
22067 * typemanager.cs (CSharpName): reimplemented with Lupus
22070 2002-04-28 Miguel de Icaza <miguel@ximian.com>
22072 * statement.cs (If): correclty implement Resolve, because we were
22073 not catching sem errors in there. The same process is needed
22075 (Return, StatementExpression, For, While, Do, Throw, Lock): Implement Resolve
22078 (Statement.Warning_DeadCodeFound): Factorize code.
22079 (While): Report dead code here too.
22081 (Statement): Added Resolve virtual method to allow
22082 for resolution split from the emit code.
22084 2002-04-26 Miguel de Icaza <miguel@ximian.com>
22086 * statement.cs (EmitBoolExpression): No longer try to resolve the
22088 (MakeBoolean): New utility function that resolve, implicitly
22089 converts to boolean and tags the expression.
22092 (If, Do): Implement dead code elimination.
22093 (While): Implement loop inversion
22095 (Do, While, For, If): Resolve the expression prior to calling our
22098 2002-04-22 Lawrence Pit <loz@cable.a2000.nl>
22101 - added method Report28 (warning: program has more than one entry point)
22102 - added method IsEntryPoint, implements paragraph 10.1 of the spec
22103 - modified method Method.Define, the part at the end of the method
22105 * rootcontext.cs: added static public Location EntryPointLocation;
22107 * ../errors/cs0028.cs : Add test case for the above warning.
22110 - modified method CSharpName to allow arrays of primitive type to
22111 be printed nicely (e.g. instead of System.Int32[][] it now prints
22113 - added method CSharpSignature: returns the signature of a method
22114 in string format to be used in reporting errors, warnings, etc.
22116 * support.cs: InternalParameters.ParameterDesc variable tmp initialized
22119 2002-04-26 Ravi Pratap <ravi@ximian.com>
22121 * delegate.cs (Define): Fix extremely silly bug where I was
22122 setting the type of the 'object' parameter of the BeginInvoke
22123 method to System.IAsyncResult instead of System.Object ;-)
22125 2002-04-26 Miguel de Icaza <miguel@ximian.com>
22127 * class.cs (ConstructorInitializer.Resolve): Also use DeclaredOnly
22130 (Constructor.Emit): return if we fail to initialize the
22131 constructor. Another door closed!
22133 * expression.cs (New.DoResolve): Improve error message (from -6 to
22134 1501). Use DeclaredOnly lookup to find the exact constructor.
22136 * typemanager.cs (MemberLookup): If DeclaredOnly is set, do not
22137 loop. This is useful.
22139 * cs-parser.jay: Adjust the default parameters so that destructors
22140 have the proper signature.
22142 2002-04-26 Martin Baulig <martin@gnome.org>
22144 * driver.cs (LoadAssembly): If `assembly' contains any characters
22145 which are only valid in path names and not in assembly names
22146 (currently slash, backslash and point), use Assembly.LoadFrom ()
22147 instead of Assembly.Load () on the `assembly' (before iteration
22148 over the link_paths).
22150 2002-04-26 Martin Baulig <martin@gnome.org>
22152 * cs-tokenizer.cs (is_hex): Correctly handle lowercase chars.
22154 2002-04-25 Miguel de Icaza <miguel@ximian.com>
22156 * class.cs (Property): use the new typemanager.MemberLookup
22158 (TypeContainer.MemberLookup): Implement using the
22159 TypeManager.MemberLookup now.
22161 * typemanager.cs: Make MemberLookup a function of the TypeManager,
22162 and return MemberInfos, so that these can be used without an
22163 EmitContext (what we had before).
22165 2002-04-24 Miguel de Icaza <miguel@ximian.com>
22167 * expression.cs: Fix the case where the argument to params if the
22168 type of the params. I omitted handling this before. Fixed
22170 2002-04-22 Miguel de Icaza <miguel@ximian.com>
22172 * driver.cs: Call BootCorlib_PopulateCoreType
22174 * class.cs (Property.CheckBase): Check for properties only, not
22177 * interface.cs: Temporary hack: try/catch around the
22178 CustomAttributeBuilder, because I am getting an exception that I
22181 * rootcontext.cs (BootCorlib_PopulateCoreType): Populate some
22182 types whose definitions are required to be there (attributes are
22183 defined before standard types).
22185 Compute definitions as we boot the various types, as they are used
22186 immediately (value_type class will need object_type, but if we do
22187 not initialize object_type, we will pass a null, which will let
22188 the runtime pick the System.Object from the existing corlib, which
22189 is not what we want).
22191 2002-04-22 Patrik Torstensson <totte@labs2.com>
22193 * cs-tokenizer.cs: fixed a number of trim() issues.
22195 2002-04-22 Ravi Pratap <ravi@ximian.com>
22197 * expression.cs (Argument.Type): Ensure that we return the correct
22198 type when we have out or ref parameters [in which case we
22201 2002-04-22 Miguel de Icaza <miguel@ximian.com>
22203 * class.cs (Property, Indexer): Allow extern modifier in there.
22205 * typemanager.cs (InitBaseTypes): Initializes object_type and
22206 value_type, since those will be used early on during the bootstrap
22207 process to compile corlib.
22209 (InitCoreTypes): Move code from here to InitBaseTypes.
22211 2002-04-21 Miguel de Icaza <miguel@ximian.com>
22213 * ecore.cs (PropertyExpr): Optimize calls to Array::get_Length on
22214 single-dimension arrays as using the ldlen opcode.
22216 Daniel Lewis discovered this optimization.
22218 * typemanager.cs: Add signature for System.Array::get_Length
22220 2002-04-20 Gonzalo Paniagua Javier <gonzalo@ximian.com>
22222 * statement.cs: report the error when the foreach does not apply to an
22223 array nor a collection.
22225 2002-04-19 Miguel de Icaza <miguel@ximian.com>
22227 * expression.cs: Add implicit conversions to the operator ~.
22229 * constant.cs (DecimalConstant.Emit): Emit decimal value.
22231 * typemanager.cs: Locate the decimal constructor.
22233 2002-04-17 Gonzalo Paniagua Javier <gonzalo@ximian.com>
22235 * attribute.cs: use the new property of TypeOf.
22236 * expression.cs: added 'get' property around typearg.
22238 These changes fix a build breaker reported by NickD. Is this the
22239 correct way to fix? If not, please, revert my changes and make it
22242 2002-04-17 Miguel de Icaza <miguel@ximian.com>
22244 * attribute.cs: Add support for typeof in attribute invocations.
22245 I am not sure that this is right though.
22247 2002-04-14 Duncan Mak <duncan@ximian.com>
22249 * cfold.cs (BinaryFold): Catch DivideByZeroException in the
22250 Binary.Operator.Division case.
22252 2002-04-13 Ravi Pratap <ravi@ximian.com>
22254 * class.cs (DefineType): Ensure that we do a proper check on
22255 attribute types and also register it with the TypeManager.
22257 (TypeContainer.Targets): The default for attribute types is
22258 AttributeTargets.All.
22260 * attribute.cs (ApplyAttributes): Registering the attribute type
22261 is done elsewhere, not when we discover we have a Usage attribute.
22263 2002-04-12 Ravi Pratap <ravi@ximian.com>
22265 * expression.cs (VerifyArgumentsCompat): Implement Miguel's suggestion
22266 and get rid of is_delegate parameter.
22268 * everywhere : update.
22270 2002-04-12 Ravi Pratap <ravi@ximian.com>
22272 * cs-parser.jay (compilation_unit): Revamp completely to use
22273 some new ideas that I got from Rhys' grammar to solve the problems
22274 with assembly level attributes.
22276 (outer_declaration): New grammar production.
22278 (attribute_sections): Add.
22280 (opt_attributes): Base on attribute_sections
22282 (namespace_declaration): Allow opt_attributes to tackle the case
22283 when we have assembly level attributes - we are clever in this
22286 * attribute.cs (ApplyAttributes): Do not worry about assembly
22287 attributes in the non-global context.
22289 * rootcontext.cs (AddGlobalAttributes): Go back to using this
22290 instead of SetGlobalAttributes.
22292 * class.cs, rootcontext.cs : Ensure we define and generate
22293 attribute types before anything else.
22295 * attribute.cs (CheckAttribute and GetValidPlaces): Handle the exception
22296 and flag the new error -20 for the case when the attribute type
22297 does not have valid targets specified. csc does not catch this.
22299 * ../errors/errors.txt : update for error # -20
22301 2002-04-11 Ravi Pratap <ravi@ximian.com>
22303 * support.cs (InternalParameters.ParameterModifier): Do some null
22304 checking and return sane values.
22306 * class.cs (Method.Define): If we are a PInvoke method, ensure
22307 that we are static and extern. Report error # 601
22309 * ../errors/cs0601.cs : Add test case for the above error.
22311 2002-04-07 Ravi Pratap <ravi@ximian.com>
22313 * rootcontext.cs (attribute_types): We need to keep type of
22314 all attribute types separately and emit code for them first.
22316 (RegisterAttribute) : Implement.
22318 * class.cs (DefineType): Check if the current Type is a custom
22319 attribute type and register it accordingly.
22321 * rootcontext.cs (AddGlobalAttributes): Fix silly bug where we were
22322 adding the first attribute twice and rename to
22324 (SetGlobalAttributes): this.
22326 * rootcontext.cs (NamespaceLookup): Run through the aliases too and perform
22329 * attribute.cs (ApplyAttributes): Take an additional argument telling us
22330 if we are processing global arguments. Hmm, I am unsure of this.
22332 2002-04-12 Gonzalo Paniagua Javier <gonzalo@ximian.com>
22334 * expression.cs: added static array of strings to avoid calling
22335 Enum.ToString () for Operator in Binary. Significant recover of
22338 2002-04-10 Miguel de Icaza <miguel@ximian.com>
22340 * class.cs (FindMembers): Allow the Builders of the various
22341 members to be null. If they are skip them. This only happens
22342 during the PInvoke declaration.
22344 2002-04-09 Miguel de Icaza <miguel@ximian.com>
22346 * parameter.cs (Parameters.ComputeParameterTypes): Flag the
22347 failure, so we do not keep going afterwards.
22349 * expression.cs: (Invocation.OverloadResolve): I believe Ravi
22350 wanted to pass `false' as the `is_delegate' argument. If this is
22351 the case, why not use delegate_type == null to mean `is_delegate =
22352 false' and anything else as is_delegate = true.
22354 Tue Apr 9 05:40:12 2002 Piers Haken <piersh@friskit.com>
22356 * statement.cs: fixed SimpleSwitchEmit to make 'goto case' goto the
22357 code for the section, not the beginning of the tests.
22359 2002-04-08 Miguel de Icaza <miguel@ximian.com>
22361 * cfold.cs: Handle operator + (Enum x, Underlying x)
22363 * expression.cs (Binary): same. Warn about errors where we have
22364 Enum/Enum in operator + as well.
22366 Mon Apr 8 06:29:03 2002 Piers Haken <piersh@friskit.com>
22369 - added support for switch(bool)
22370 - optimize loading of I8/U8 constants (ldc.i4, iconv_i8)
22371 - add TableSwitchEmit() to handle table-based switch statements
22373 2002-04-05 Ravi Pratap <ravi@ximian.com>
22375 * expression.cs (Invocation.OverloadResolve): Factor out code which
22376 does parameter compatibility checking with arguments so that we can
22377 re-use the code even from Delegate.VerifyApplicability
22379 (VerifyArgumentsCompat): Move above code here.
22381 * delegate.cs (VerifyApplicability): Get rid of duplicate code
22382 and instead make a call to the above method.
22384 2002-03-31 Ravi Pratap <ravi@ximian.com>
22386 * typemanager.cs (attribute_type): Corresponds to System.Attribute.
22387 We use it to keep track of classes which are attribute types.
22389 2002-04-02 Miguel de Icaza <miguel@ximian.com>
22391 * delegate.cs (Delegate.Define): Correctly define the types in the
22392 presence of fixed and array parameters.
22394 * class.cs (TypeContainers.FindMembers): Use NonPublic flag while
22397 * ecore.cs (Expression.MemberLookup): Reset binding flags to not
22398 include NonPublic after the first iteration.
22400 * class.cs (Indexer.CheckBase): Only check if both parents are
22403 * cs-parser.jay (accessor_body): If empty, set to null.
22405 * ecore.cs (SimpleName.SimpleNameResolve): We did not have the
22406 same code path here to resolve constants names that we did have in
22407 MemberAccess.DoResolve. There is too much code duplicated here.
22409 2002-04-01 Miguel de Icaza <miguel@ximian.com>
22411 * statement.cs, makefile: Drop Statementcollection and just use ArrayLists
22413 * ecore.cs: Optimize UserDefinedConversion by minimizing the calls
22416 * cs-tokenizer.cs: Reuse a single StringBuilder for assembling
22417 tokens, numbers and strings.
22419 * ecore.cs (MethodGroupExpr): Make Emit warn about missing
22422 * delegate.cs: Use ComputeAndDefineParameterTypes for both the
22423 asyncronous parameters and the regular parameters.
22425 * codegen.cs (CodeGen.Init): Use the constructor that allows us to
22426 specify the target directory.
22428 * expression.cs: (This.DoResolve): Simplify
22429 (As.Emit): Optimize, do not generate IsInst if the expression is
22430 always of the given type.
22432 (Is.DoResolve): Bug fix, we were reporting both always/never for
22435 * (Invocation.MakeUnionSet): Simplify vastly and optimize, we were
22436 creating too many unnecessary arrays.
22438 2002-03-31 Miguel de Icaza <miguel@ximian.com>
22440 * class.cs (EmitFieldInitializer): Use Assign expression to assign
22441 fields instead of rolling our own initializer. Takes care of all
22442 implicit conversions, and drops unnecessary static checks/argument.
22444 2002-03-31 Dick Porter <dick@ximian.com>
22446 * driver.cs: use the GetDirectories() return values properly, and
22447 use "/" as path separator.
22449 2002-03-30 Miguel de Icaza <miguel@ximian.com>
22451 * expression.cs (Unary): Optimize - - expr into expr.
22452 (Binary): Optimize a + (-b) into a -b.
22454 * codegen.cs (CodeGen): Made all methods static.
22456 2002-03-29 Miguel de Icaza <miguel@ximian.com>
22460 * decl.cs: Rename `definition' into `TypeBuilder' and drop the
22461 TypeBuilder property.
22463 * cs-parser.jay: Drop the use of RecordXXX and use RecordDecl
22466 * tree.cs: Removed the various RecordXXXX, and replaced with a
22467 single RecordDecl. Removed all the accessor methods, and just
22468 left a single access point Type
22470 * enum.cs: Rename DefineEnum to DefineType.
22472 * decl.cs: New abstract method `DefineType' used to unify the
22473 Defines for Enumerations, Interfaces, TypeContainers and
22476 (FindType): Moved LookupInterfaceOrClass here. Moved the
22477 LookupBaseClasses method that used to live in class.cs and
22478 interface.cs here, and renamed to FindType.
22480 * delegate.cs: Implement DefineType. Take advantage of the
22481 refactored pattern for locating the parent builder without taking
22482 the parent_builder argument (which we know does not work if we are
22483 nested, and triggering a toplevel definition).
22485 2002-03-28 Miguel de Icaza <miguel@ximian.com>
22487 * decl.cs (MemberCore.CheckMethodAgainstBase): Test if the
22488 accessibility of a member has changed during override and report
22491 * class.cs (Method.Define, Property.Define): Only complain on
22492 overrides if the method is private, any other accessibility is
22493 fine (and since we just checked the permission is the same, we are
22496 * cs-tokenizer.cs: only line, region, endregion, if, endif, else
22497 and elif are processed always. The other pre-processing
22498 directives are only processed if we are "taking" the path
22500 2002-03-29 Martin Baulig <martin@gnome.org>
22502 * class.cs (Method.Emit): Only emit symbolic debugging info if the
22503 current location is not Null.
22505 * codegen.cs (CodeGen.SaveSymbols): Split out symbol writing code into
22506 a separate method so we can profile it.
22508 * driver.cs (ShowTime): We need to use `(int) span.TotalSeconds' since
22509 `span.Seconds' are just seconds, but no minutes or hours.
22510 (MainDriver): Profile the CodeGen.SaveSymbols calls.
22512 2002-03-28 Miguel de Icaza <miguel@ximian.com>
22514 * class.cs (Method.Define), (Property.Define), (Indexer.Define):
22515 Remove the gratuitous set of Final:
22517 // If an interface implementation, then we can set Final.
22518 if (((flags & MethodAttributes.Abstract) == 0) &&
22519 implementing.DeclaringType.IsInterface)
22520 flags |= MethodAttributes.Final;
22522 I do not know what I was smoking when I used that.
22525 * cs-parser.jay, delegate.cs: Make Delegate be a DeclSpace, first
22526 step into fixing the name resolution issues for delegates and
22527 unifying the toplevel name resolution.
22529 2002-03-28 Martin Baulig <martin@gnome.org>
22531 * class.cs (Method.Emit): If we have a symbol writer, call its
22532 OpenMethod(), CloseMethod() and SetMethodSourceRange() methods to
22533 tell it about the current method.
22535 * codegen.cs (EmitContext.Mark): New public method. Tell the symbol
22536 writer that we're going to emit the first byte of IL code for a new
22537 statement (a new source line).
22538 (EmitContext.EmitTopBlock): If we have a symbol writer, call
22539 EmitContext.Mark() before emitting any code.
22541 * location.cs (SymbolDocument): Return null when we're Null.
22543 * statement.cs (Statement): Moved the `Location loc' variable here.
22544 (Statement.EmitBoolExpression): If we have a symbol writer, call
22545 ec.Mark() before emitting any code to tell it that we're at the
22546 beginning of a new statement.
22547 (StatementExpression): Added `Location' argument to the constructor.
22548 (Block): Added public readonly variable `StartLocation' and public
22549 variable `EndLocation'. The latter is to be set using SetEndLocation().
22550 (Block): Added constructor which takes a start and end location.
22551 (Block.SetEndLocation): New method. This sets the end location.
22552 (Block.EmitMeta): If we have a symbol writer, tell it the names of the
22553 local variables we create.
22554 (Block.Emit): If we have a symbol writer, call ec.Mark() before emitting
22555 each statement and do also mark the begin and end of the block.
22557 * cs-parser.jay (block : OPEN_BRACE): Use the new `Block' constructor to
22558 tell it the current lexer.Location, use Location.Null for the end of the
22560 (block : OPEN_BRACE opt_statement_list CLOSE_BRACE): When closing the
22561 current block, set its end location using SetEndLocation().
22562 (statement_expression): StatementExpression constructor now takes the
22563 lexer.Location as additional argument.
22564 (for_statement, declare_local_variables): Likewise.
22565 (declare_local_variables): When creating a new implicit block, use the
22566 new Block constructor and pass it the lexer.Location.
22568 2002-03-28 Miguel de Icaza <miguel@ximian.com>
22570 * ecore.cs (Expression.MemberLookup): On interfaces, lookup
22571 members also on the parent interfaces recursively.
22573 2002-03-27 Miguel de Icaza <miguel@ximian.com>
22575 * report.cs: Use new formats, since Gonzalo finished the missing
22578 * expression.cs (Binary.ResolveOperator): added missing operator|
22579 operator& and operator^ for bool/bool.
22581 * cs-parser.jay: CheckDef now takes a Location argument that is
22582 used to report errors more precisly (instead of reporting the end
22583 of a definition, we try to track something which is a lot closer
22584 to the source of the problem).
22586 * cs-tokenizer.cs: Track global token use, so we can properly flag
22587 the use of #define/#undef after the first token has been seen.
22589 Also, rename the reportXXXX to Error_DescriptiveName
22591 * decl.cs (DeclSpace.IsTopLevel): Move property here from
22592 TypeContainer, so that Enum and Interface can use this too.
22594 * class.cs (TypeContainer.LookupInterfaceOrClass,
22595 GetInterfaceOrClass, GetClassBases, DefineType): Drop the
22596 `builder' argument. Typically this was used to pass the parent
22597 builder (a ModuleBuilder or a TypeBuilder from whoever triggered
22600 The problem is that a nested class could trigger the definition of
22601 a toplevel class, and the builder would be obviously wrong in that
22604 So we drop this argument, and we compute dynamically the
22605 TypeBuilder/ModuleBuilder (the correct information was available
22606 to us anyways from DeclSpace.Parent)
22608 * interface.cs (Interface.DefineInterface): Drop builder
22609 parameter cleanup like class.cs
22611 * enum.cs (Enum.DefineEnum): Drop builder parameter. Clean up
22614 * statement.cs (Switch.EmitObjectInteger): Emit short/ushort
22617 (Try.Emit): Propagate the returns value from the statement.
22619 (Return.Emit): Even if we are leavning
22621 * driver.cs: Catch IOExpcetion for Directory.GetFiles as well.
22623 * modifiers.cs: Fix the computation of MethodAttributes flags.
22625 Tue Mar 26 21:14:36 CET 2002 Paolo Molaro <lupus@ximian.com>
22627 * driver.cs: allow compilation of files that start with '/'.
22628 Add a default case when checking the argument of --target.
22630 2002-03-25 Miguel de Icaza <miguel@ximian.com>
22632 * interface.cs: Implement the same search algorithm for types in
22633 the interface code.
22635 * delegate.cs: Do not allow multiple definition.
22637 * Recovered ChangeLog that got accidentally amputated
22639 * interface.cs (Interface.DefineInterface): Prevent from double definitions.
22641 * rootcontext.cs: Load manually enum to allow core classes to
22642 contain enumerations.
22644 * enum.cs, ecore.cs, driver.cs, attribute.cs, class.cs, expression.cs:
22645 Update to new static methods in TypeManager.
22647 * typemanager.cs (GetMethod, GetConstructor): Use our
22648 implementation of FindMembers to find the members, since during
22649 corlib compilation, the types are TypeBuilders and GetMethod and
22650 GetConstructor do not work.
22652 Make all methods in TypeManager static.
22654 (InitCodeHelpers): Split the functionality from
22655 the InitCodeTypes function.
22657 * driver.cs: Call InitCodeHelpers after we have populated the
22660 * cs-parser.jay (delegate_declaration): we did not used to compute
22661 the delegate name correctly for void delegates.
22663 2002-03-24 Miguel de Icaza <miguel@ximian.com>
22665 * rootcontext.cs (RootContext): Init the interface_resolve_order
22666 and type_container_resolve_order always.
22668 (ResolveCore, BootstrapCorlib_ResolveClass,
22669 BootstrapCorlib_ResolveStruct): New functions to bootstrap the
22670 compiler when compiling with --nostdlib
22672 * class.cs (TypeContainer.DefineType): Check that our parent is
22673 not null. This test is most important when we are bootstraping
22676 * codegen.cs: Split out the symbol writing code.
22678 2002-03-25 Martin Baulig <martin@gnome.org>
22680 * driver.cs (-g): Made -g an alias for --debug.
22682 2002-03-24 Martin Baulig <martin@gnome.org>
22684 * codegen.cs (SymbolWriter): New public variable. Returns the
22685 current symbol writer.
22686 (CodeGen): Added `bool want_debugging_support' argument to the
22687 constructor. If true, tell the ModuleBuild that we want debugging
22688 support and ask it for the ISymbolWriter.
22689 (Save): If we have a symbol writer, call it's Close() method after
22690 saving the assembly.
22692 * driver.c (--debug): New command line argument to create a
22693 debugger information file.
22695 * location.cs (SymbolDocument): New public property. Returns an
22696 ISymbolDocumentWriter object for the current source file or null
22697 if we don't have a symbol writer.
22699 2002-03-21 Miguel de Icaza <miguel@ximian.com>
22701 * driver.cs (LoadAssembly): Correctly return when all the paths
22702 have been tried and not before.
22704 * statement.cs (Switch.Emit): return the actual coverage for this
22705 statement (returns/not-returns)
22707 (Switch.SimpleSwitchEmit): Do not generate jumps to the end of the
22708 switch of the statement if we are the last switch section. That
22709 kills two problems: try/catch problems (we used to emit an empty
22710 nop at the end) and switch statements where all branches would
22713 2002-03-19 Miguel de Icaza <miguel@ximian.com>
22715 * driver.cs: Add default assemblies (the equivalent to the
22716 Microsoft CSC.RSP file)
22718 * cs-tokenizer.cs: When updating `cols and setting it to zero,
22719 also update tokens_seen and set it to false.
22721 * driver.cs: Implement --recurse for Mike.
22723 * driver.cs (SplitPathAndPattern): Small bug fix, I was not
22724 correctly splitting out the paths.
22726 2002-03-18 Miguel de Icaza <miguel@ximian.com>
22728 * interface.cs (Interface.PopulateProperty): Instead of using
22729 `parent' as the declaration space for the set parameters, use
22732 * support.cs (InternalParameters): InternalParameters constructor
22733 takes a DeclSpace instead of a TypeContainer.
22735 * expression.cs (ArrayCreation.EmitDynamicInitializers): If value
22736 types are being initialized, load the address of it before calling
22739 (New): Provide a mechanism to disable the generation of local
22740 value type temporaries when the caller will be providing us with
22741 an address to store it.
22743 (ArrayCreation.EmitDynamicInitializers): Use it.
22745 2002-03-17 Miguel de Icaza <miguel@ximian.com>
22747 * expression.cs (Invocation.EmitArguments): Only probe for array
22748 property if there is more than one argument. Sorry about that.
22750 * class.cs (Invocation.EmitArguments): Fix to emit arguments for
22751 empty param arrays.
22753 * class.cs (Method.LabelParameters): Fix incorrect code path that
22754 prevented the `ParamArrayAttribute' from being applied to the
22757 2002-03-16 Miguel de Icaza <miguel@ximian.com>
22759 * support.cs (ReflectionParameters): Correctly compute whether the
22760 last argument is a params array. Fixes the problem with
22763 * typemanager.cs: Make the assemblies array always be non-null
22764 (empty, but non-null)
22766 * tree.cs (RecordDecl): New function that abstracts the recording
22767 of names. This reports error 101, and provides a pointer to the
22768 previous declaration. Fixes a crash in the compiler.
22770 * cs-parser.jay (constructor_declaration): Update to new grammar,
22771 and provide a constructor_body that can be empty.
22773 2002-03-15 Miguel de Icaza <miguel@ximian.com>
22775 * driver.cs: Add support for --resources.
22777 * expression.cs: (FetchGetMethod, FetchAddressMethod, EmitAssign):
22778 Make all types for the various array helper methods be integer.
22780 * ecore.cs (Expression.ConvertNumericExplicit): Pass the
22781 CheckState to ConvCast.
22783 (ConvCast): Now it takes a `checked' state argument, to avoid
22784 depending on the emit context for the conversion, and just using
22785 the resolve time setting.
22787 * expression.cs (ArrayCreation.EmitArrayArguments): New function,
22788 instead of Invocation.EmitArguments. We do not emit the original
22789 arguments, instead we emit those which have been converted to
22790 unsigned int expressions.
22792 * statement.cs (Block.EmitMeta): Drop tracking of indexes.
22794 * codegen.cs: ditto.
22796 * expression.cs (LocalVariableReference): Drop the use of the
22797 Store function that depended on the variable index.
22799 * statement.cs (VariableInfo): Drop the `Idx' property from this
22800 class, as this is not taking into account the indexes for
22801 temporaries tat we generate during the execution, getting the
22804 * class.cs: First emit class initializers, then call the parent
22807 * expression.cs (Binary): Fix opcode emision.
22808 (UnaryMutator.EmitCode): Support checked code generation
22810 * ecore.cs (MemberLookup): TypeManager.FindMembers will return
22811 matches for events for both the Static and Instance scans,
22812 pointing to the same element. Fix that.
22814 2002-03-14 Miguel de Icaza <miguel@ximian.com>
22816 * rootcontext.cs (ResolveTree): Always set the
22817 interface_resolve_order, because nested interfaces will be calling
22820 * class.cs (GetInterfaceOrClass): Track the same resolution
22821 process used by TypeManager.LookupType. This fixes the nested
22822 type lookups in class declarations (separate path from
22825 (TypeContainer.DefineType): Also define nested interfaces.
22826 (TypeContainer.RegisterOrder): New public function used to
22827 register the order in which child interfaces need to be closed.
22829 Nested interfaces need to be closed after their parents have been
22832 * interface.cs (InterfaceAttr): Put all the logic for computing
22833 the interface attribute here.
22835 (DefineInterface): Register our interface order with the
22836 RootContext or with the TypeContainer depending on the case.
22838 2002-03-12 Miguel de Icaza <miguel@ximian.com>
22840 * cs-parser.jay: rework foreach statement to work with the new
22841 changes to the policy on SimpleNames.
22843 * report.cs: support Stacktrace on warnings as well.
22845 * makefile: drop --unsafe and /unsafe from the compile.
22847 2002-03-13 Ravi Pratap <ravi@ximian.com>
22849 * ecore.cs (StandardConversionExists): Modify to take an Expression
22850 as the first parameter. Ensure we do null -> reference type conversion
22853 * Everywhere : update calls accordingly, making use of MyEmptyExpr to store
22854 temporary Expression objects.
22856 Wed Mar 13 12:32:40 CET 2002 Paolo Molaro <lupus@ximian.com>
22858 * interface.cs: workaround bug in method overloading resolution
22859 (there is already a bugzilla bug for it).
22861 2002-03-12 Miguel de Icaza <miguel@ximian.com>
22863 We could also solve this problem by having a separate path for
22864 performing type lookups, instead of DoResolve, we could have a
22865 ResolveType entry point, and only participating pieces of the
22866 production (simplename, deref, array) would implement this.
22868 * codegen.cs (EmitContext): New field OnlyLookupTypes used to
22869 signal SimpleName to only resolve type names and not attempt to
22870 resolve anything else.
22872 * expression.cs (Cast): Set the flag.
22874 * ecore.cs (SimpleName): Use the OnlyLookupTypes flag
22876 * class.cs: Only report 108 if there is no `new' modifier.
22878 * cs-parser.jay: rework foreach statement to work with the new
22879 changes to the policy on SimpleNames.
22881 * report.cs: support Stacktrace on warnings as well.
22883 * makefile: drop --unsafe and /unsafe from the compile.
22885 2002-03-11 Miguel de Icaza <miguel@ximian.com>
22887 * ecore.cs (SimpleName.SimpleNameResolve): Perform local variable
22888 lookups here, instead of doing that at parse time. This means
22889 that our grammar will not introduce `LocalVariableReferences' as
22890 expressions at this point. That solves the problem of code like
22894 static void Main ()
22898 This is only half the fix. The full fix requires parameters to
22899 also be handled in this way.
22901 * Everywhere: Use ec.DeclSpace on calls to LookupType, as this
22902 makes the use more obvious of the DeclSpace. The
22903 ec.TypeContainer.TypeBuilder is now only used to pull the
22904 TypeBuilder for it.
22906 My theory is that I can get rid of the TypeBuilder completely from
22907 the EmitContext, and have typecasts where it is used (from
22908 DeclSpace to where it matters).
22910 The only pending problem is that the code that implements Aliases
22911 is on TypeContainer, and probably should go in DeclSpace.
22913 * ecore.cs (SimpleName.SimpleNameResolve): Perform local variable
22914 lookups here, instead of doing that at parse time. This means
22915 that our grammar will not introduce `LocalVariableReferences' as
22916 expressions at this point. That solves the problem of code like
22920 static void Main ()
22924 This is only half the fix. The full fix requires parameters to
22925 also be handled in this way.
22927 * class.cs (Property.DefineMethod): When implementing an interface
22928 method, set newslot, when implementing an abstract method, do not
22929 set the flag (before we tried never setting it, or always setting
22930 it, which is the difference).
22931 (Indexer.DefineMethod): same.
22932 (Method.DefineMethod): same.
22934 * ecore.cs: Only set the status used flag if we get back a Field.
22936 * attribute.cs: Temporary hack, so Paolo can keep working.
22938 2002-03-08 Ravi Pratap <ravi@ximian.com>
22940 * attribute.cs (Attribute.UnmanagedType): This is to keep track of
22941 the unmanaged type in the case we have a MarshalAs attribute.
22943 (Resolve): Handle the case when we are parsing the special MarshalAs
22944 attribute [we need to store the unmanaged type to use later]
22946 * typemanager.cs (marshal_as_attr_type): Built in type for the
22947 MarshalAs Attribute.
22949 * attribute.cs (ApplyAttributes): Recognize the MarshalAs attribute
22950 on parameters and accordingly set the marshalling info.
22952 2002-03-09 Miguel de Icaza <miguel@ximian.com>
22954 * class.cs: Optimizing slightly by removing redundant code after
22955 we switched to the `NoTypes' return value.
22956 (Property.DefineMethod): use NoTypes here too.
22958 This fixes the bug I introduced in my last batch of changes.
22960 2002-03-05 Ravi Pratap <ravi@ximian.com>
22962 * tree.cs (RecordEnum): Add. We now keep track of enums too.
22964 * class.cs (LookupInterfaceOrClass): Check against the list of recorded
22965 Enums since those are types too.
22967 * cs-parser.jay (enum_declaration): Record enums as we parse them.
22969 * enum.cs (DefineEnum): Return if the TypeBuilder has already been defined
22970 thanks to a call during the lookup process.
22972 2002-03-07 Miguel de Icaza <miguel@ximian.com>
22974 * statement.cs (Foreach): Lots of work to accomodate a particular
22975 kind of foreach statement that I had not kept in mind. It is
22976 possible to have foreachs on classes that provide a GetEnumerator
22977 method that return objects that implement the "pattern" for using
22978 a foreach, there is no need to support GetEnumerator
22981 This is needed to compile nant.
22983 * decl.cs: Only report 114 if the member is not `Finalize' and if
22984 the warning level is at least 2.
22986 * class.cs: Moved the compare function from Method to
22989 (MethodSignature.InheritableMemberSignatureCompare): Add new
22990 filter function that is used to extract inheritable methods from a
22993 (Method.Define): Use the new `inheritable_method_signature_filter'
22996 * cs-tokenizer.cs (get_cmd_arg): Do not add white space to the
22999 2002-03-06 Miguel de Icaza <miguel@ximian.com>
23001 * ecore.cs (Expression.ConvertReferenceExplicit): Removed dead code.
23003 * cs-parser.jay: Add opt_semicolon to the interface declaration.
23005 * expression.cs: Pass location information to
23006 ConvertImplicitStandard.
23008 * class.cs: Added debugging code to track return values from
23011 2002-03-05 Miguel de Icaza <miguel@ximian.com>
23013 * expression.cs (Is.DoResolve): If either side of the `is' is an
23014 interface, do not flag the warning.
23016 * ecore.cs (ImplicitReferenceConversion): We need a separate test
23019 * report.cs: Allow for --fatal to be used with --probe.
23021 * typemanager.cs (NoTypes): Move the definition for the empty Type
23024 * class.cs (TypeContainer.FindMembers): Also look for methods defined by
23026 (TypeContainer.DefineProxy): New function used to proxy to parent
23027 implementations when implementing interfaces.
23028 (TypeContainer.ParentImplements): used to lookup if our parent
23029 implements a public function that is required by an interface.
23030 (TypeContainer.VerifyPendingMethods): Hook this up.
23032 * typemanager.cs (TypeManager, AddModule, AddAssembly): Make the
23033 `modules' and `assemblies' arraylists into arrays. We only grow
23034 these are the very early start up of the program, so this improves
23035 the speedof LookupType (nicely measured).
23037 * expression.cs (MakeByteBlob): Replaced unsafe code with
23038 BitConverter, as suggested by Paolo.
23040 * cfold.cs (ConstantFold.Binary): Special case: perform constant
23041 folding of string concatenation, but if either side is a string,
23042 and the other is not, then return null, and let the runtime use
23043 the concatenation on the string plus the object (using
23044 `Object.ToString').
23046 2002-03-04 Miguel de Icaza <miguel@ximian.com>
23048 Constant Folding has been implemented now.
23050 * expression.cs (Unary.Reduce): Do not throw an exception, catch
23051 the error instead on types that are not supported in one's
23054 * constant.cs (Constant and all children): New set of functions to
23055 perform implict and explicit conversions.
23057 * ecore.cs (EnumConstant): Implement the new functions to perform
23058 conversion by proxying to the child expression.
23060 * codegen.cs: (ConstantCheckState): Constant evaluation has its
23061 own separate setting that can not be turned off from the command
23062 line using --unchecked or --checked and is only controlled using
23063 the checked/unchecked statements and expressions. This setting is
23064 used by the constant folder to flag errors.
23066 * expression.cs (CheckedExpr, UncheckedExpr): Set the
23067 ConstantCheckState as well.
23069 During Resolve, they also have to flag the state, because the
23070 constant folder runs completely in the Resolve phase.
23072 * statement.cs (Checked, Unchecked): Set the ConstantCheckState as
23075 2002-03-01 Miguel de Icaza <miguel@ximian.com>
23077 * cfold.cs: New file, this file contains the constant folder.
23079 * ecore.cs (IMemoryLocation.AddressOf): Now takes an extra
23080 argument to track whether we are using the resulting address to
23081 load or store a value and provide better error messages.
23083 (FieldExpr.Emit, FieldExpr.EmitAssign, FieldExpr.AddressOf): Use
23084 new AddressOf arguments.
23086 * statement.cs (Foreach.EmitCollectionForeach): Update
23088 * expression.cs (Argument.Emit): Call AddressOf with proper
23089 arguments to track usage.
23091 (New.DoEmit): Call AddressOf with new arguments.
23093 (Unary.Emit): Adjust AddressOf call.
23095 2002-03-01 Ravi Pratap <ravi@ximian.com>
23097 * cs-parser.jay (member_access): Change the case for pre-defined types
23098 to use a MemberAccess instead of a SimpleName. Thanks to Felix again for
23101 * class.cs (Operator::Emit): If we are abstract or extern, we don't have
23104 * attribute.cs (CheckAttribute, ApplyAttribute): Ensure that we treat operators
23105 essentially like methods and apply attributes like MethodImplOptions to them too.
23107 * ecore.cs (SimpleName.SimpleNameResolve): Perform a check on ec.TypeContainer.TypeBuilder
23110 * codegen.cs (EmitContext): The constructor now takes in an extra argument specifying the
23111 DeclSpace as the distinction is important. We provide sane defaults as usually the TypeContainer
23114 * Update code everywhere accordingly.
23116 * ecore.cs : Change references to ec.TypeContainer to ec.DeclSpace where appropriate.
23118 * cs-parser.jay (enum_declaration): Set the current namespace of the enum.
23120 2002-02-28 Ravi Pratap <ravi@ximian.com>
23122 * rootcontext.cs (LookupType): As we cycle through the chain of namespaces
23123 try performing lookups against those instead of jumping straight into using
23124 the 'using' clauses.
23126 (ImplicitParent): Add. Thanks to Felix Arrese-Igor for this idea.
23128 (LookupType): Perform lookups in implicit parents too.
23130 * class.cs (GetInterfaceOrClass): Modify to perform the exact same lookup
23131 sequence as RootContext.LookupType.
23133 * rootcontext.cs (NamespaceLookup): Split out code from LookupType which tries
23134 the various cases of namespace lookups into this method.
23136 2002-03-01 Miguel de Icaza <miguel@ximian.com>
23138 * cs-parser.jay: Add support for [Attribute ()] (empty arguments
23139 in positional arguments)
23141 * class.cs (Operator): Update the AllowedModifiers to contain
23144 * cs-parser.jay: Update operator declaration to allow for the
23145 operator body to be empty.
23147 * cs-tokenizer.cs: Added '\u' unicode support in strings and hex
23150 2002-02-27 Miguel de Icaza <miguel@ximian.com>
23152 * class.cs (Method.Emit): Label parameters.
23154 * driver.cs: Return 1 or 0 as the program exit code.
23156 2002-02-26 Miguel de Icaza <miguel@ximian.com>
23158 * expression.cs: Special case the `null' object when trying to
23159 auto-compute the type, as anything can be explicitly converted to
23162 * ecore.cs (Expression.ConvertExplicit): Bug fix, thanks for
23163 spotting this Paolo.
23165 (Expression.ImplicitNumericConversion): Perform comparissions of
23166 the type using the underlying type in the case of an enumeration
23167 rather than using the enumeration type for the compare.
23169 Cope with the underlying == type case, which is not possible to
23172 (Expression.ConvertNumericExplicit): Perform comparissions of
23173 the type using the underlying type in the case of an enumeration
23174 rather than using the enumeration type for the compare.
23176 * driver.cs: If the user does not supply an extension, assume .exe
23178 * cs-parser.jay (if_statement): Rewrote so that we can track the
23179 location for the if statement.
23181 * expression.cs (Binary.ConstantFold): Only concat strings when
23182 the operation is "+", not everything ;-)
23184 * statement.cs (Statement.EmitBoolExpression): Take a location
23186 (If, While, Do): Track location.
23188 * expression.cs (Binary.ResolveOperator): In the object + string
23189 case, I was missing a call to ConvertImplicit
23191 2002-02-25 Ravi Pratap <ravi@ximian.com>
23193 * parameter.cs (Parameter.ExternalType): Take in extra DeclSpace and
23194 Location arguments. Ensure we use RootContext.LookupType to do our work
23195 and not try to do a direct Type.GetType and ModuleBuilder.GetType
23197 * interface.cs (PopulateMethod): Handle the type of the parameter being
23200 * expression.cs (Invocation.BetterFunction): Handle the case when we
23201 have a params method with no fixed arguments and a call is made with no
23204 2002-02-25 Miguel de Icaza <miguel@ximian.com>
23206 * cs-tokenizer.cs: Add support for the quote-escape-sequence in
23207 the verbatim-string-literal
23209 * support.cs (InternalParameters.ParameterModifier): handle null
23211 (InternalParameters.ParameterType): ditto.
23213 * parameter.cs (VerifyArgs): Also check if the fixed parameter is
23214 duplicating the name of the variable parameter.
23215 (GetParameterByName): Fix bug where we were not looking up array
23216 paramters if they were the only present (thanks Paolo!).
23217 (GetParameterInfo): We only have an empty set of types if both
23218 fixed and array are set to null.
23219 (GetParameterInfo-idx): Handle FixedParameter == null
23221 * cs-parser.jay: Handle the case where there is no catch
23222 statements (missing null test).
23224 2002-02-22 Miguel de Icaza <miguel@ximian.com>
23226 * driver.cs (MainDriver): Be conservative on our command line
23229 Catch DirectoryNotFoundException when calling GetFiles.
23231 (SplitPathAndPattern): Used to split the input specification into
23232 a path and a pattern that we can feed to Directory.GetFiles.
23234 2002-02-21 Miguel de Icaza <miguel@ximian.com>
23236 * statement.cs (Fixed): Implement the last case of the Fixed
23237 statement (string handling).
23239 * expression.cs (StringPtr): New class used to return a char * to
23240 a string; Used by the Fixed statement.
23242 * typemanager.cs: Add char_ptr_type. Add get_OffsetToStringData method.
23244 * expression.cs (Binary.ResolveOperator): Remove redundant
23245 MemberLookup pn parent type.
23246 Optimize union call, we do not need a union if the types are the same.
23247 (Unary.ResolveOperator): REmove redundant MemberLookup on parent
23250 Specialize the use of MemberLookup everywhere, instead of using
23251 the default settings.
23253 (StackAlloc): Implement stackalloc keyword.
23255 * cs-parser.jay: Add rule to parse stackalloc.
23257 * driver.cs: Handle /h, /help, /?
23259 * expression.cs (MakeByteBlob): Removed the hacks we had in place
23260 before we supported unsafe code.
23262 * makefile: add --unsafe to the self compilation of mcs.
23264 2002-02-20 Miguel de Icaza <miguel@ximian.com>
23266 * expression.cs (PointerArithmetic): New class that is used to
23267 perform pointer arithmetic.
23268 (Binary.Resolve): Handle pointer arithmetic
23269 Handle pointer comparission.
23270 (ArrayPtr): Utility expression class that is used to take the
23271 address of an array.
23273 (ElementAccess): Implement array access for pointers
23275 * statement.cs (Fixed): Implement fixed statement for arrays, we
23276 are missing one more case before we are done.
23278 * expression.cs (Indirection): Implement EmitAssign and set the
23279 ExprClass to Variable. This allows pointer dereferences to be
23280 treated as variables, and to have values assigned to them.
23282 * ecore.cs (Expression.StoreFromPtr): New utility function to
23283 store values dereferencing.
23285 2002-02-20 Ravi Pratap <ravi@ximian.com>
23287 * expression.cs (Binary.ResolveOperator): Ensure that we are
23288 not trying to operate on a void type - this fixes the reported
23291 * decl.cs (CheckMethodAgainstBase): Do not allow overriding if
23292 the parent implementation is sealed.
23294 * ../errors/cs0239.cs : Add.
23296 * attribute.cs (ApplyAttributes): Handle Modulebuilders too.
23298 * typemanager.cs (unverifiable_code_type): Corresponds to
23299 System.Security.UnverifiableCodeAttribute. We need to emit this for modules
23300 which have unsafe code in them.
23302 * rootcontext.cs (EmitCode): Emit the above attribute when we are in an
23305 2002-02-19 Miguel de Icaza <miguel@ximian.com>
23307 * cs-tokenizer.cs: Add support for @"litreal strings"
23309 Make tokenizer accept pre-processor directives
23310 on any column (remove the old C-like limitation).
23312 * rootcontext.cs (EmitCode): Emit any global attributes.
23313 (AddGlobalAttributes): Used to keep track of assembly attributes.
23315 * attribute.cs (ApplyAttributes): Support AssemblyAttributes.
23317 * cs-parser.jay: Add support for global attributes.
23319 2002-02-17 Miguel de Icaza <miguel@ximian.com>
23321 * expression.cs (Indirection): New helper class. Unary will
23322 create Indirection classes to be able to implement the
23323 IMemoryLocation interface on it.
23325 2002-02-16 Miguel de Icaza <miguel@ximian.com>
23327 * cs-parser.jay (fixed_statement): reference the right statement.
23329 * statement.cs (Fixed.Emit): Finish implementing the fixed
23330 statement for the &x case.
23332 2002-02-14 Miguel de Icaza <miguel@ximian.com>
23334 * class.cs (Property.Define, Method.Define): Remove newslot when
23337 * modifiers.cs: My use of NewSlot when `Abstract' was set was
23338 wrong. NewSlot should only be used if the `new' keyword is present.
23340 * driver.cs (GetSystemDir): Use CodeBase instead of FullName for
23341 locating our system dir. Sorry about this.
23343 2002-02-13 Miguel de Icaza <miguel@ximian.com>
23345 * driver.cs (GetSystemDir): Compute correctly the location of our
23346 system assemblies. I was using the compiler directory instead of
23347 the library directory.
23349 2002-02-13 Ravi Pratap <ravi@ximian.com>
23351 * expression.cs (BetterFunction): Put back in what Miguel commented out
23352 since it is the correct fix. The problem is elsewhere ;-)
23354 (IsParamsMethodApplicable): Fix bug where we were not checking that the fixed
23355 parameters of the parms method are themselves compatible or not !
23357 (StandardConversionExists): Fix very dangerous bug where we were forgetting
23358 to check that a class implements an interface before saying that an implicit
23359 conversion was allowed. Use ImplementsInterface to do the checking.
23361 2002-02-13 Miguel de Icaza <miguel@ximian.com>
23363 * class.cs (Method.Define): Track whether we are an explicit
23364 implementation or not. And only call DefineMethodOverride if we
23365 are an explicit implementation.
23367 (Property.DefineMethod): Ditto.
23369 2002-02-11 Ravi Pratap <ravi@ximian.com>
23371 * expression.cs (BetterFunction): Catch hideous bug which was
23372 preventing us from detecting ambiguous calls due to implicit casts i.e
23375 2002-01-29 Miguel de Icaza <miguel@ximian.com>
23377 * support.cs (Pair): Remove un-needed method. I figured why I was
23378 getting the error in cs-parser.jay, the variable in a foreach loop
23379 is readonly, and the compiler does not really treat this as a variable.
23381 * cs-parser.jay (fixed_statement): Fix grammar. Use ASSIGN
23382 instead of EQUALS in grammar.
23384 * typemanager.cs (VerifyUnmanaged): Report correct error (208)
23386 * expression.cs (Unary.DoResolve): Check whether the argument is
23389 2002-01-28 Miguel de Icaza <miguel@ximian.com>
23391 * support.cs: Api for Pair to set a value. Despite the fact that
23392 the variables are public the MS C# compiler refuses to compile
23393 code that accesses the field if the variable is part of a foreach
23396 * statement.cs (Fixed): Begin implementation of the fixed
23399 (Block.AddVariable): Return the VariableInfo on success and null
23400 on failure instead of true/false.
23402 * cs-parser.jay (foreach): Catch errors on variables already
23403 defined (we were ignoring this value before) and properly unwind
23404 the block hierarchy
23406 (fixed_statement): grammar for the fixed statement.
23408 2002-01-25 Miguel de Icaza <miguel@ximian.com>
23410 * expression.cs (UnaryMutator.IsIncrementableNumber): Allow also
23411 pointer types to be incretemented.
23413 (SizeOf): Implement.
23415 * cs-parser.jay (pointer_member_access): Implement
23416 expr->IDENTIFIER production.
23418 * expression.cs (IndexerAccess.DoResolve, ArrayAccess.DoResolve,
23419 MemberAccess.DoResolve, Invocation.DoResolve): Check for pointers
23422 (Unary): Implement indirection.
23424 * ecore.cs (Expression.UnsafeError): Reports error 214 (pointer
23425 use in non-unsafe context).
23427 (SimpleName.DoResolve): Check for pointers in field access on safe
23430 (Expression.LoadFromPtr): Factor the load-indirect code in this
23431 function. This was duplicated in UnboxCast and ParameterReference
23433 2002-01-24 Miguel de Icaza <miguel@ximian.com>
23435 * expression.cs (ComposedCast): report an error if a pointer cast
23436 is used in a safe region.
23438 * ecore.cs (Expression.ConvertExplicit): Add rules for implicit
23439 pointer type casts in unsafe context.
23441 * codegen.cs (EmitContext): Set up IsUnsafe.
23443 * cs-parser.jay (non_expression_type): Add productions for pointer
23446 * expression.cs (Invocation.EmitCall): Remove chunk of buggy
23447 code. We should not use force into static mode if the method is
23448 not virtual. Fixes bug in MIS
23450 * statement.cs (Do.Emit, While.Emit, For.Emit,
23451 Statement.EmitBoolExpression): Add support to Do and While to
23452 propagate infinite loop as `I do return' semantics.
23454 Improve the For case to also test for boolean constants.
23456 * attribute.cs (Attribute.ApplyAttributes): Add ParameterBuilder
23457 to the list of attributes we can add.
23459 Remove `EmitContext' argument.
23461 * class.cs (Method.Define): Apply parameter attributes.
23462 (Constructor.Define): Apply parameter attributes.
23463 (MethodCore.LabelParameters): Move here the core of labeling
23466 * support.cs (ReflectionParameters.ParameterModifier,
23467 InternalParameters.ParameterModifier): Use IsByRef on the type and
23468 only return the OUT bit for these parameters instead of in/out/ref
23471 This is because I miss-understood things. The ParameterInfo.IsIn
23472 and IsOut represent whether the parameter has the [In] and [Out]
23475 2002-01-22 Miguel de Icaza <miguel@ximian.com>
23477 * ecore.cs (FieldExpr.Emit): Release temporaries.
23479 * assign.cs (LocalTemporary.Release): new function.
23481 * codegen.cs (EmitContext.GetTemporaryStorage,
23482 EmitContext.FreeTemporaryStorage): Rework the way we deal with
23483 temporary storage. Now we can "put back" localbuilders when we
23486 2002-01-21 Miguel de Icaza <miguel@ximian.com>
23488 * ecore.cs (FieldExpr.Emit): Handle initonly fields specially: we
23489 need to make a copy of the variable to generate verifiable code.
23491 2002-01-19 Miguel de Icaza <miguel@ximian.com>
23493 * driver.cs: Compute dynamically the system directory.
23495 * ecore.cs (CopyNewMethods): reworked, exposed, made public.
23496 Slower, but more generally useful. Used by the abstract
23497 registering implementation.
23499 * expression.cs (ResolveMemberAccess): Reorder the way we evaluate
23500 the rules for the special rule on Type/instances. First check if
23501 we have the same name, and if so, try that special static path
23502 rather than the instance path.
23504 2002-01-18 Miguel de Icaza <miguel@ximian.com>
23506 * cs-parser.jay: Emit 642 (warning: possible empty statement) for
23509 * class.cs (TypeBuilder.DefineType): Do not allow inheritance from
23510 Enum, ValueType, Delegate or Array for non-corlib compiles.
23512 * cs-tokenizer.cs: Catch long identifiers (645)
23514 * typemanager.cs (IndexerPropetyName): Ravi never tested this
23517 * class.cs (TypeContainer.RegisterRequiredImplementations): Bug
23518 fix, we were returning too early, so we were not registering
23519 pending methods from abstract classes.
23521 Do not register pending methods if the class is abstract.
23523 * expression.cs (Conditional.DoResolve): Report circular implicit
23524 conversions when we neecd to compute it for conditional
23527 (Is.DoResolve): If the expression is always of the provided type,
23528 flag warning 183. If the expression can not ever be of the
23529 provided type flag warning 184.
23531 * class.cs: Catch 169 as well.
23533 * ecore.cs (FieldExpr): For now in AddressOf mark as assigned and
23536 2002-01-18 Nick Drochak <ndrochak@gol.com>
23538 * makefile: remove path to beta2 csc.exe. path to csc.exe must be in PATH instead.
23540 2002-01-17 Miguel de Icaza <miguel@ximian.com>
23542 * interface.cs: (PopulateMethod): Check for pointers being defined
23543 only if the unsafe context is active.
23544 (PopulateProperty): ditto.
23545 (PopulateIndexer): ditto.
23547 * class.cs (Method, Method.Define): Allow `unsafe' modifier to be
23548 specified. If pointers are present, make sure that they are
23549 present in an unsafe context.
23550 (Constructor, Constructor.Define): ditto.
23551 (Field, Field.Define): ditto.
23552 (Property, Property.Define): ditto.
23553 (Event, Event.Define): ditto.
23555 * interface.cs (Interface.GetInterfaceTypeByName): Only lookup the
23556 hashtable if there are classes or structs defined.
23558 * expression.cs (LocalVariableReference.DoResolve): Simplify this
23559 code, as the constant resolution moved.
23561 * statement.cs (Block.EmitMeta): Resolve all constants as we emit
23562 the metadata, so we can flag error 133.
23564 * decl.cs (MemberCore.UnsafeOK): New function to test that a
23565 pointer is being declared in an unsafe context.
23567 2002-01-16 Miguel de Icaza <miguel@ximian.com>
23569 * modifiers.cs (Modifiers.Check): Require a Location argument.
23570 Report error 227 for Unsafe use.
23572 * typemanager.cs: Remove IsPointerType, we should be using Type.IsPointer
23574 * statement.cs (For.Emit): If the test is null, then report that
23575 we do `return', as we wont reach anything afterwards.
23577 (Switch.SwitchGoverningType): Track the expression that matched
23580 * driver.cs: Allow negative numbers as an error code to flag.
23582 * cs-parser.jay: Handle 1551.
23584 * namespace.cs: Add 1537 checking (repeated using alias namespaces).
23586 2002-01-15 Miguel de Icaza <miguel@ximian.com>
23588 * cs-parser.jay: Report 1518 (type declaration can only contain
23589 class, struct, interface, enum or delegate)
23591 (switch_label): Report 1523 (keywords `case' or `default' must
23594 (opt_switch_sections): Report 1522 (empty switch)
23596 * driver.cs: Report 1515 (response file specified multiple times)
23597 Report 1516 (Source file specified multiple times).
23599 * expression.cs (Argument.Resolve): Signal 1510
23601 (BaseAccess.Resolve, BaseIndexer.Resolve): Signal 1511 (base
23602 access not allowed in static code)
23604 2002-01-11 Ravi Pratap <ravi@ximian.com>
23606 * typemanager.cs (IsPointerType): Utility method which we are going
23609 * ecore.cs (ImplicitReferenceConversion): A pointer type cannot be cast to
23610 the object type, so we take care of that.
23612 * expression.cs (FullMethodDesc): Also include the return type in descriptions.
23614 * support.cs (ParameterDesc): Fix minor bug which was causing params tags to be
23615 added to non-params parameters :-)
23617 * typemanager.cs (CSharpName): Include 'void' type too.
23619 (void_ptr_type): Include in the set of core types.
23621 * ecore.cs (ConvertImplicit): Make use of ConvertImplicitStandard instead of
23624 (ConvertImplicitStandard): Handle standard implicit pointer conversions when we have
23627 * cs-parser.jay (local_variable_pointer_type): Add support for 'void *' as I had
23628 completely forgotten about it.
23630 2002-01-10 Ravi Pratap <ravi@ximian.com>
23632 * cs-parser.jay (pointer_type): Add. This begins our implementation
23633 of parsing rules for unsafe code.
23635 (unsafe_statement): Implement.
23637 (embedded_statement): Modify to include the above.
23639 * statement.cs (Unsafe): Implement new class for unsafe blocks.
23641 * codegen.cs (EmitContext.InUnsafe): Add. This determines
23642 if the current context is an unsafe one.
23644 * cs-parser.jay (local_variable_pointer_type): Since local variable types
23645 are handled differently, we need separate rules for them.
23647 (local_variable_declaration): Update to use local_variable_pointer_type
23648 to allow variable declarations of unmanaged pointer types.
23650 * expression.cs (Unary.ResolveOperator): Ensure that the '&' operator is used only
23651 in unsafe contexts.
23653 * ../errors/cs0214.cs : Add.
23655 2002-01-16 Nick Drochak <ndrochak@gol.com>
23657 * makefile: remove 'response' file when cleaning.
23659 2002-01-15 Miguel de Icaza <miguel@ximian.com>
23661 * cs-parser.jay: Report 1524.
23663 2002-01-14 Miguel de Icaza <miguel@ximian.com>
23665 * typemanager.cs (RegisterMethod): drop checking if we have
23666 registered this from here
23668 2002-01-12 Miguel de Icaza <miguel@ximian.com>
23670 * class.cs (Method.EmitDestructor): Implement calling our base
23673 * statement.cs (Try.Emit): Fix to reset the InFinally to the old
23674 value of InFinally.
23676 * codegen.cs (EmitContext.EmitTopBlock): Destructors will call
23677 this routine and will wrap the call in a try/catch block. Deal
23680 2002-01-11 Miguel de Icaza <miguel@ximian.com>
23682 * ecore.cs (Expression.MemberLookup): instead of taking a
23683 parameter `same_type' that was used to tell whether we could
23684 access private members we compute our containing type from the
23687 (FieldExpr): Added partial support for volatile fields. This does
23688 not work for volatile fields exposed from assemblies, as I can not
23689 figure out how to extract the modreq from it.
23691 Updated all the source files to use this.
23693 * codegen.cs (EmitContext): Compute ContainerType ahead of time,
23694 because it is referenced by MemberLookup very often.
23696 2002-01-09 Ravi Pratap <ravi@ximian.com>
23698 * typemanager.cs (IndexerPropertyName): If we have a TypeBuilder, use
23699 TypeBuilder.GetCustomAttributes to retrieve what we need.
23701 Get rid of redundant default_member_attr_type as this is the same as
23702 default_member_type which already exists.
23704 * interface.cs, attribute.cs : Update accordingly.
23706 2002-01-08 Miguel de Icaza <miguel@ximian.com>
23708 * typemanager.cs: Enable IndexerPropertyName again. It does not
23709 work for TYpeBuilders though. Ravi, can you please fix this?
23711 * cs-tokenizer.cs: Accept _ as a name in pp-expressions.
23713 * expression.cs (Argument.Emit): Handle the case of ref objects
23714 being passed to ref functions;
23716 (ParameterReference.EmitLoad): Loads the content of the pointer
23717 without dereferencing.
23719 2002-01-07 Miguel de Icaza <miguel@ximian.com>
23721 * cs-tokenizer.cs: Implemented the pre-processing expressions.
23723 2002-01-08 Ravi Pratap <ravi@ximian.com>
23725 * class.cs (Indexer.DefineMethod): Incorporate the interface
23726 type in the name of the method if we are doing explicit interface
23729 * expression.cs (ConversionExists): Remove as it is completely obsolete.
23731 (BetterConversion): Fix extremely trivial bug where we were referring to
23732 ConversionExists instead of StandardConversionExists ! Hooray, things are fine
23735 * ../errors/bug16.cs : Add although we have fixed it.
23737 2002-01-07 Miguel de Icaza <miguel@ximian.com>
23739 * expression.cs (BaseIndexer): Begin implementation.
23741 * class.cs (TypeContainer.IsInterfaceMethod): Bug fix.
23743 * cs-parser.jay (indexer_declarator): Use qualified_identifier
23744 production directly to remove a shift/reduce, and implement
23745 explicit interface implementation.
23747 * cs-tokenizer.cs: Fix tokenizer, it was consuming one extra char
23748 after a floating point suffix.
23750 * expression.cs (DoNumericPromotions): Improved the conversion for
23751 uint/uint. If we have a constant, we avoid doing a typecast to a
23754 * class.cs (Indexer): Implement explicit interface implementation
23757 Sat Jan 5 16:08:23 CET 2002 Paolo Molaro <lupus@ximian.com>
23759 * class.cs: make the default instance constructor public and hidebysig.
23761 2001-01-03 Ravi Pratap <ravi@ximian.com>
23763 * interface.cs (EmitDefaultMemberAttr): Make this helper method static
23764 so we can call it from elsewhere.
23766 * class.cs (TypeContainer.Emit): Emit the attribute here too. The rule is that
23767 we emit it internally if the class has a defined indexer; otherwise the user
23768 emits it by decorating the class definition with the DefaultMemberAttribute.
23770 * attribute.cs (ApplyAttributes): Perform checks to see that the DefaultMember
23771 attribute is not used on a type which defines an indexer.
23773 * cs-tokenizer.cs (get_cmd_arg): Ensure we trim whitespace and also include the tab
23774 character when we skip whitespace.
23776 * ../errors/cs0646.cs : Add.
23778 2002-01-03 Miguel de Icaza <miguel@ximian.com>
23780 * ecore.cs (SimpleName.ResolveSimpleName): Report error 120
23783 * makefile: Add practical target `mcs3.exe' which builds the third
23784 generation compiler.
23786 * expression.cs (New): Fix structures constructor calling.
23788 * class.cs (Property, Method, Indexer): Emit Final flag on the
23789 method if we are an interface implementation and we are not
23792 * ecore.cs (PropertyExpr): New public field `IsBase', tells
23793 whether this property is referencing a `base' method.
23795 * expression.cs (Invocation.EmitCall): take an extra argument:
23796 is_base, this is used to determine whether the `call' or
23797 `callvirt' opcode should be used.
23800 * delegate.cs: update EmitCall.
23802 * class.cs (Method.Define): Set NewSlot for the cases where we are
23803 not implementing an interface method.
23805 (Property.Define): ditto.
23807 2002-01-02 Miguel de Icaza <miguel@ximian.com>
23809 * cs-tokenizer.cs: (Tokenizer.escape): Escape '\r' as '\r' not as
23810 'r'. Allows mcs to parse itself fully.
23812 2002-01-02 Ravi Pratap <ravi@ximian.com>
23814 * expression.cs (ArrayCreation.num_automatic_initializers): Keep track
23815 of the number of initializers that require the InitializeArray method.
23817 (CheckIndices): Store the Expression in all cases - not the plain value. Also
23818 update the above field where necessary.
23820 (MakeByteBlob): Update accordingly.
23822 (DoEmit): Call EmitStaticInitializers only if the number of initializers is
23825 (EmitDynamicInitializers): Update in accordance with the new optimization.
23827 (ArrayAccess.EmitStoreOpcode): Include char type along with short and ushort - the
23828 same OpCode applies.
23830 * cs-parser.jay : Fix some glaring errors I introduced.
23832 2002-01-01 Ravi Pratap <ravi@ximian.com>
23834 * parameters.cs (AddVariable, AddConstant): Pass in current_local_parameters
23835 so that we can check for name clashes there too.
23837 * typemanager.cs (default_member_attr_type): The attribute that we need to emit
23838 for interface indexers.
23840 * interfaces.cs (Define): Emit the default member attribute.
23842 * expression.cs (MakeByteBlob): Fix extremely trivial bug where the wrong
23843 variable was being referred to while setting the value ;-)
23845 2002-01-01 Miguel de Icaza <miguel@ximian.com>
23847 * expression.cs (MakeByteBlob): Optimize: we do not need to fill
23848 byte-by-byte information when we know the data is zero.
23850 Make the block always a multiple of 4, because
23851 DefineInitializedData has a bug.
23853 * assign.cs: Fix, we should assign from the temporary, not from
23856 * expression.cs (MakeByteBlob): Fix my incorrect code.
23858 2001-12-31 Miguel de Icaza <miguel@ximian.com>
23860 * typemanager.cs (EnumToUnderlying): This function is used to get
23861 the underlying type from an enumeration, because it does not
23864 * constant.cs: Use the I4_S form for values between -128 and 127.
23866 * statement.cs (Block.LookupLabel): Looks up a label.
23867 (Block): Drop support for labeled blocks.
23869 (LabeledStatement): New kind of statement that represents a label
23872 (Goto): Finally implement this bad boy.
23874 * cs-parser.jay: Update to reflect new mechanism to implement
23877 2001-12-30 Miguel de Icaza <miguel@ximian.com>
23879 * codegen.cs (EmitContext.This): a codegen property that keeps the
23880 a single instance of this instead of creating many different this
23883 * delegate.cs (Delegate.DoResolve): Update to use the property;
23885 * ecore.cs (SimpleName.SimpleNameResolve): Ditto
23887 * expression.cs (BaseAccess.DoResolve): Ditto.
23889 2001-12-29 Ravi Pratap <ravi@ximian.com>
23891 * typemanager.cs (methodimpl_attr_type): Add to hold the type
23892 corresponding to System.Runtime.CompilerServices.MethodImplAttribute.
23894 (InitCoreTypes): Update accordingly.
23896 * attribute.cs (Resolve): Remember if the attribute is a MethodImplAttribute
23897 so we can quickly store the state.
23899 (ApplyAttributes): Set the correct implementation flags
23900 for InternalCall methods.
23902 2001-12-29 Miguel de Icaza <miguel@ximian.com>
23904 * expression.cs (EmitCall): if a method is not virtual, then do
23905 not use callvirt on it.
23907 (ArrayAccess.EmitAssign): storing non-builtin value types (ie,
23908 user defined stuff) requires the use of stobj, which takes an
23909 address on the stack instead of an array and an index. So emit
23910 the Ldelema operation for it.
23912 (EmitStoreOpcode): Use stobj for valuetypes.
23914 (UnaryMutator.EmitCode): Use the right 1 value depending on
23915 whether we are dealing with int64/uint64, float or doubles.
23917 * class.cs (TypeContainer.AddConstructor): Fix the logic to define
23918 constructors that I implemented last night.
23920 (Constructor.IsDefault): Fix to work properly for static
23923 * cs-parser.jay (CheckDef): report method signature errors.
23924 Update error number 103 to be 132.
23926 * decl.cs: New AdditionResult enumeration value: MethodExists.
23927 Although we do this check for methods later on in the semantic
23928 analysis, catching repeated default constructors is so easy that
23929 we catch these here.
23931 * expression.cs (Binary.DoNumericPromotions): Fix the uint64 type
23934 (ParameterReference.EmitAssign, Emit): handle
23937 (ArrayAccess.EmitLoadOpcode): Handle bool type here.
23938 (ArrayAccess.EmitStoreOpcode): ditto.
23940 * cs-tokenizer.cs (is_punct): Eliminated empty computation.
23942 * expression.cs (MakeByteBlob): Complete all the missing types
23943 (uint, short, ushort, byte, sbyte)
23945 * class.cs: Only init instance field initializers on instance
23948 Rename `constructors' to instance_constructors.
23950 (TypeContainer.AddConstructor): Only add constructors to the list
23951 if it is not static.
23953 Make sure that we handle default_static_constructor independently
23954 everywhere where we handle instance_constructors
23956 2001-12-28 Miguel de Icaza <miguel@ximian.com>
23958 * class.cs: Do not lookup or create a base initializer for a
23959 static constructor.
23961 (ConstructorInitializer.Resolve): use the proper type to lookup
23964 * cs-parser.jay: Report error 1585 (modifiers between type and name).
23966 * enum.cs, interface.cs: Remove CloseType, this is taken care by
23969 * decl.cs: CloseType is now an virtual method, the default
23970 implementation just closes this type.
23972 2001-12-28 Ravi Pratap <ravi@ximian.com>
23974 * attribute.cs (DefinePInvokeMethod): Set the implementation flags
23975 to PreserveSig by default. Also emit HideBySig on such methods.
23977 Basically, set the defaults to standard values.
23979 * expression.cs (Invocation.BetterFunction): We need to make sure that for each
23980 argument, if candidate is better, it can't be worse than the best !
23982 (Invocation): Re-write bits to differentiate between methods being
23983 applicable in their expanded form and their normal form - for params
23986 Get rid of use_standard everywhere as only standard conversions are allowed
23987 in overload resolution.
23989 More spec conformance.
23991 2001-12-27 Miguel de Icaza <miguel@ximian.com>
23993 * driver.cs: Add --timestamp, to see where the compiler spends
23996 * ecore.cs (SimpleName.DoResolve): Do not create an implicit
23997 `this' in static code.
23999 (SimpleName.DoResolve): Implement in terms of a helper function
24000 that allows static-references to be passed upstream to
24003 (Expression.ResolveWithSimpleName): Resolve specially simple
24004 names when called by MemberAccess to implement the special
24007 (Expression.ImplicitReferenceConversion): Handle conversions from
24008 Null to reference types before others, as Null's type is
24011 * expression.cs (Invocation.EmitCall): Handle the special case of
24012 calling methods declared on a reference type from a ValueType
24013 (Base classes System.Object and System.Enum)
24015 (MemberAccess.Resolve): Only perform lookups on Enumerations if
24016 the left hand side is a TypeExpr, not on every enumeration.
24018 (Binary.Resolve): If types are reference types, then do a cast to
24019 object on operators != and == of both arguments.
24021 * typemanager.cs (FindMembers): Extract instance and static
24022 members if requested.
24024 * interface.cs (PopulateProperty): Use void_type instead of null
24025 as the return type for the setter method.
24027 (PopulateIndexer): ditto.
24029 2001-12-27 Ravi Pratap <ravi@ximian.com>
24031 * support.cs (ReflectionParameters): Fix minor bug where we
24032 were examining the wrong parameter for the ParamArray attribute.
24034 Cope with requests for the type of the parameter at position
24035 greater than the params parameter's. We now return the element
24036 type of the params array as that makes more sense.
24038 * expression.cs (Invocation.IsParamsMethodApplicable): Update
24039 accordingly as we no longer have to extract the element type
24042 (Invocation.OverloadResolve): Update.
24044 2001-12-27 Miguel de Icaza <miguel@ximian.com>
24046 * statement.cs (Foreach.GetEnumeratorFilter): Do not compare
24047 against IEnumerator, test whether the return value is a descendant
24048 of the IEnumerator interface.
24050 * class.cs (Indexer.Define): Use an auxiliary method to implement
24051 the other bits of the method definition. Begin support for
24052 explicit interface implementation.
24054 (Property.DefineMethod): Use TypeManager.void_type instead of null
24055 for an empty return value.
24057 2001-12-26 Miguel de Icaza <miguel@ximian.com>
24059 * expression.cs (MemberAccess.ResolveMemberAccess): if we are
24060 dealing with a FieldExpr which is composed of a FieldBuilder, in
24061 the code path we did extract the constant, but we should have
24062 obtained the underlying value to be able to cast it (otherwise we
24063 end up in an infinite loop, this is what Ravi was running into).
24065 (ArrayCreation.UpdateIndices): Arrays might be empty.
24067 (MemberAccess.ResolveMemberAccess): Add support for section
24068 14.5.4.1 that deals with the special case of E.I when E is a type
24069 and something else, that I can be a reference to a static member.
24071 (ArrayCreation.MakeByteBlob): It is not an error to not be able to
24072 handle a particular array type to create byte blobs, it is just
24073 something we dont generate byteblobs for.
24075 * cs-tokenizer.cs (get_cmd_arg): Ignore \r in commands and
24078 * location.cs (Push): remove the key from the hashtable that we
24079 are about to add. This happens for empty files.
24081 * driver.cs: Dispose files after we have parsed them.
24083 (tokenize): new function that only runs the tokenizer on its
24084 input, for speed testing.
24086 2001-12-26 Ravi Pratap <ravi@ximian.com>
24088 * class.cs (Event.Define): Define the private field only if there
24089 are no accessors defined.
24091 * expression.cs (ResolveMemberAccess): If there is no associated
24092 field with the event, that means we have an event defined with its
24093 own accessors and we should flag error cs0070 since transforming
24094 ourselves into a field is not valid in that case.
24096 * ecore.cs (SimpleName.DoResolve): Same as above.
24098 * attribute.cs (DefinePInvokeMethod): Set the default calling convention
24099 and charset to sane values.
24101 2001-12-25 Ravi Pratap <ravi@ximian.com>
24103 * assign.cs (DoResolve): Perform check on events only if they
24104 are being accessed outside the declaring type.
24106 * cs-parser.jay (event_declarations): Update rules to correctly
24107 set the type of the implicit parameter etc.
24109 (add_accessor, remove_accessor): Set current local parameters.
24111 * expression.cs (Binary): For delegate addition and subtraction,
24112 cast the return value from the method into the appropriate delegate
24115 2001-12-24 Ravi Pratap <ravi@ximian.com>
24117 * typemanager.cs (RegisterDelegateData, GetDelegateData): Get rid
24118 of these as the workaround is unnecessary.
24120 * delegate.cs (NewDelegate.DoResolve): Get rid of bits which registered
24121 delegate data - none of that is needed at all.
24123 Re-write bits to extract the instance expression and the delegate method
24126 * expression.cs (Binary.ResolveOperator): Handle the '-' binary operator
24129 * attribute.cs (ApplyAttributes): New method to take care of common tasks
24130 of attaching attributes instead of duplicating code everywhere.
24132 * everywhere : Update code to do attribute emission using the above method.
24134 2001-12-23 Miguel de Icaza <miguel@ximian.com>
24136 * expression.cs (IsParamsMethodApplicable): if there are not
24137 parameters, return immediately.
24139 * ecore.cs: The 0 literal can be implicity converted to an enum
24142 (SimpleName.DoResolve): First lookup the type, then lookup the
24145 (FieldExpr.Emit): If the InstanceExpression is a ValueType, we
24146 want to get its address. If the InstanceExpression is not
24147 addressable, store the result in a temporary variable, then get
24150 * codegen.cs: Only display 219 errors on warning level or above.
24152 * expression.cs (ArrayAccess): Make it implement the
24153 IMemoryLocation interface.
24155 (Binary.DoResolve): handle the operator == (object a, object b)
24156 and operator != (object a, object b) without incurring into a
24157 BoxedCast (because 5 != o should never be performed).
24159 Handle binary enumerator operators.
24161 (EmitLoadOpcode): Use Ldelema if the object we are loading is a
24162 value type, otherwise use Ldelem_ref.
24164 Use precomputed names;
24166 (AddressOf): Implement address of
24168 * cs-parser.jay (labeled_statement): Fix recursive block
24169 addition by reworking the production.
24171 * expression.cs (New.DoEmit): New has a special case:
24173 If we are dealing with a ValueType, we have a few
24174 situations to deal with:
24176 * The target of New is a ValueType variable, that is
24177 easy, we just pass this as the variable reference
24179 * The target of New is being passed as an argument,
24180 to a boxing operation or a function that takes a
24183 In this case, we need to create a temporary variable
24184 that is the argument of New.
24187 2001-12-23 Ravi Pratap <ravi@ximian.com>
24189 * rootcontext.cs (LookupType): Check that current_type is not null before
24190 going about looking at nested types.
24192 * ecore.cs (EventExpr.EmitAddOrRemove): Rename from EmitAssign as we do
24193 not implement the IAssignMethod interface any more.
24195 * expression.cs (MemberAccess.ResolveMemberAccess): Handle EventExprs specially
24196 where we tranform them into FieldExprs if they are being resolved from within
24197 the declaring type.
24199 * ecore.cs (SimpleName.DoResolve): Do the same here.
24201 * assign.cs (DoResolve, Emit): Clean up code considerably.
24203 * ../errors/bug10.cs : Add.
24205 * ../errors/cs0070.cs : Add.
24207 * typemanager.cs : Use PtrHashtable for Delegate data hashtable etc.
24209 * assign.cs : Get rid of EventIsLocal everywhere.
24211 2001-12-23 Miguel de Icaza <miguel@ximian.com>
24213 * ecore.cs (ConvertIntLiteral): finished the implementation.
24215 * statement.cs (SwitchLabel): Convert the value we are using as a
24216 key before looking up the table.
24218 2001-12-22 Miguel de Icaza <miguel@ximian.com>
24220 * codegen.cs (EmitTopBlock): Require a Location argument now.
24222 * cs-parser.jay (constructor_declarator): We need to setup
24223 current_local_parameters before we parse the
24224 opt_constructor_initializer, to allow the variables to be bound
24225 to the constructor arguments.
24227 * rootcontext.cs (LookupType): First lookup nested classes in our
24228 class and our parents before we go looking outside our class.
24230 * expression.cs (ConstantFold): Extract/debox the values at the
24233 * rootcontext.cs (EmitCode): Resolve the constants first before we
24234 resolve the types. This is not really needed, but it helps debugging.
24236 * statement.cs: report location.
24238 * cs-parser.jay: pass location to throw statement.
24240 * driver.cs: Small bug fix.
24242 * report.cs: Updated format to be 4-zero filled digits.
24244 2001-12-22 Ravi Pratap <ravi@ximian.com>
24246 * expression.cs (CheckIndices): Fix minor bug where the wrong
24247 variable was being referred to ;-)
24249 (DoEmit): Do not call EmitStaticInitializers when the
24250 underlying type is System.Object.
24252 2001-12-21 Ravi Pratap <ravi@ximian.com>
24254 * ecore.cs (EventExpr.Resolve): Implement to correctly set the type
24255 and do the usual workaround for SRE.
24257 * class.cs (MyEventBuilder.EventType): New member to get at the type
24258 of the event, quickly.
24260 * expression.cs (Binary.ResolveOperator): Handle delegate addition.
24262 * assign.cs (Assign.DoResolve): Handle the case when the target
24263 is an EventExpr and perform the necessary checks.
24265 * ecore.cs (EventExpr.EmitAssign): Implement the IAssignMethod
24268 (SimpleName.MemberStaticCheck): Include check for EventExpr.
24270 (EventExpr): Set the type in the constructor itself since we
24271 are meant to be born fully resolved.
24273 (EventExpr.Define): Revert code I wrote earlier.
24275 * delegate.cs (NewDelegate.Resolve): Handle the case when the MethodGroup's
24276 instance expression is null. The instance expression is a This in that case
24277 or a null, depending on whether it is a static method or not.
24279 Also flag an error if the reference to a method is ambiguous i.e the MethodGroupExpr
24280 refers to more than one method.
24282 * assign.cs (DoResolve): Check whether the event belongs to the same Type container
24283 and accordingly flag errors.
24285 2001-12-21 Miguel de Icaza <miguel@ximian.com>
24287 * statement.cs (Throw.Emit): Add support for re-throwing exceptions.
24289 2001-12-22 Miguel de Icaza <miguel@ximian.com>
24291 * location.cs (ToString): Provide useful rutine.
24293 2001-12-21 Miguel de Icaza <miguel@ximian.com>
24295 * ecore.cs (Expression.ConvertIntLiteral): Do not return Constant
24296 objects, return the actual integral boxed.
24298 * statement.cs (SwitchLabel): define an ILLabel for each
24301 (Switch.CheckSwitch): If the value is a Literal, extract
24302 the underlying literal.
24304 Also in the unused hashtable we had, add the SwitchLabel so we can
24305 quickly look this value up.
24307 * constant.cs: Implement a bunch of new constants. Rewrite
24308 Literal based on this. Made changes everywhere to adapt to this.
24310 * expression.cs (Expression.MakeByteBlob): Optimize routine by
24311 dereferencing array only once, and also copes with enumrations.
24313 bytes are two bytes wide, not one.
24315 (Cast): Perform constant conversions.
24317 * ecore.cs (TryImplicitIntConversion): Return literals instead of
24318 wrappers to the literals here.
24320 * expression.cs (DoNumericPromotions): long literals can converted
24321 to ulong implicity (this is taken care of elsewhere, but I was
24322 missing this spot).
24324 * ecore.cs (Expression.Literalize): Make the return type Literal,
24325 to improve type checking.
24327 * rootcontext.cs: Lookup for nested classes in our class hierarchy.
24329 2001-12-20 Miguel de Icaza <miguel@ximian.com>
24331 * literal.cs: Revert code from ravi that checked the bounds. The
24332 bounds are sane by the definition of the type itself.
24334 * typemanager.cs: Fix implementation of ImplementsInterface. We
24335 need to actually look up in our parent hierarchy for interfaces
24338 * const.cs: Use the underlying type for enumerations
24340 * delegate.cs: Compute the basename for the delegate creation,
24341 that should fix the delegate test case, and restore the correct
24342 Type Lookup semantics in rootcontext
24344 * rootcontext.cs: Revert Ravi's last patch. The correct way of
24345 referencing a nested type with the Reflection API is using the "+"
24348 * cs-parser.jay: Do not require EOF token at the end.
24350 2001-12-20 Ravi Pratap <ravi@ximian.com>
24352 * rootcontext.cs (LookupType): Concatenate type names with
24353 a '.' instead of a '+' The test suite passes again.
24355 * enum.cs (Enum.DefineEnum): Set RTSpecialName on the 'value__'
24356 field of the enumeration.
24358 * expression.cs (MemberAccess.ResolveMemberAccess): Add support for
24359 the case when the member is an EventExpr.
24361 * ecore.cs (EventExpr.InstanceExpression): Every event which is not
24362 static has an associated instance expression.
24364 * typemanager.cs (RegisterEvent): The usual workaround, now for events.
24366 (GetAddMethod, GetRemoveMethod): Workarounds, as usual.
24368 * class.cs (Event.Define): Register event and perform appropriate checks
24371 We define the Add and Remove methods even if the use provides none because
24372 in that case, we provide default implementations ourselves.
24374 Define a private field of the type of the event. This is done by the CSC compiler
24375 and we should be doing it too ;-)
24377 * typemanager.cs (delegate_combine_delegate_delegate, delegate_remove_delegate_delegate):
24378 More methods we use in code we generate.
24380 (multicast_delegate_type, delegate_type): Two separate types since the distinction
24383 (InitCoreTypes): Update accordingly for the above.
24385 * class.cs (Event.Emit): Generate code for default accessors that we provide
24387 (EmitDefaultMethod): Do the job in the above.
24389 * delegate.cs (DefineDelegate): Use TypeManager.multicast_delegate_type in the
24392 2001-12-20 Miguel de Icaza <miguel@ximian.com>
24394 * class.cs (Indexer.Define): Fix bug, we were setting both Get/Set
24395 builders even if we were missing one.
24397 * interface.cs, class.cs, enum.cs: When calling DefineNestedType
24398 pass the Basename as our class name instead of the Name. The
24399 basename will be correctly composed for us.
24401 * parameter.cs (Paramters): Now takes a Location argument.
24403 * decl.cs (DeclSpace.LookupType): Removed convenience function and
24404 make all the code call directly LookupType in RootContext and take
24405 this chance to pass the Location information everywhere.
24407 * Everywhere: pass Location information.
24409 2001-12-19 Miguel de Icaza <miguel@ximian.com>
24411 * class.cs (Constructor.Define): Updated way of detecting the
24412 length of the parameters.
24414 (TypeContainer.DefineType): Use basename as the type name for
24417 (TypeContainer.Define): Do not recursively define types here, as
24418 definition is taken care in order by the RootContext.
24420 * tree.cs: Keep track of namespaces in a per-file basis.
24422 * parameter.cs (Parameter.ComputeSignature): Update to use
24425 (Parameters.GetSignature): ditto.
24427 * interface.cs (InterfaceMethod.GetSignature): Take a DeclSpace
24428 instead of a TypeContainer.
24430 (Interface.SemanticAnalysis): Use `this' instead of our parent to
24431 resolve names. Because we need to be resolve in our context, not
24434 * driver.cs: Implement response files.
24436 * class.cs (TypeContainer.DefineType): If we are defined, do not
24437 redefine ourselves.
24439 (Event.Emit): Emit the code for add/remove handlers.
24440 (Event.Define): Save the MethodBuilders for add/remove.
24442 * typemanager.cs: Use pair here too.
24444 * cs-parser.jay: Replaced use of DictionaryEntry for Pair because
24445 DictionaryEntry requires the first argument to be non-null.
24447 (enum_declaration): Compute full name for registering the
24450 (delegate_declaration): Instead of using
24451 formal_parameter_list, use opt_formal_parameter_list as the list
24454 * cs-tokenizer.cs (PropertyParsing): renamed from `properties'
24455 (EventParsing): New property that controls whether `add' and
24456 `remove' are returned as tokens or identifiers (for events);
24458 2001-12-19 Ravi Pratap <ravi@ximian.com>
24460 * class.cs (Event.Define): Revamp use of EventBuilder completely. We now
24461 use MyEventBuilder only and let it wrap the real builder for us.
24463 (MyEventBuilder): Revamp constructor etc.
24465 Implement all operations that we perform on EventBuilder in precisely the same
24468 (FindMembers): Update to use the EventBuilder member.
24470 (Event.Emit): Update accordingly.
24472 2001-12-18 Ravi Pratap <ravi@ximian.com>
24474 * class.cs (MyEventBuilder.Set*): Chain to the underlying builder
24475 by calling the appropriate methods.
24477 (GetCustomAttributes): Make stubs as they cannot possibly do anything
24480 (Event.Emit): Use MyEventBuilder everywhere - even to set attributes.
24482 2001-12-17 Ravi Pratap <ravi@ximian.com>
24484 * delegate.cs (Delegate.Populate): Check that the return type
24485 and various parameters types are indeed accessible.
24487 * class.cs (Constructor.Define): Same here.
24489 (Field.Define): Ditto.
24491 (Event.Define): Ditto.
24493 (Operator.Define): Check that the underlying Method defined itself
24494 correctly - so it's MethodBuilder should not be null.
24496 * delegate.cs (DelegateInvocation.DoResolve): Bale out if the type of the Instance
24497 expression happens to be null.
24499 * class.cs (MyEventBuilder): Workaround for SRE lameness. Implement various abstract
24500 members but as of now we don't seem to be able to do anything really useful with it.
24502 (FindMembers): Handle events separately by returning the MyEventBuilder of the event,
24503 not the EventBuilder.
24505 2001-12-18 Miguel de Icaza <miguel@ximian.com>
24507 * cs-tokenizer.cs: Add support for defines.
24508 Add support for #if, #elif, #else, #endif
24510 (eval_var): evaluates a variable.
24511 (eval): stubbed for evaluating functions.
24513 * cs-parser.jay: Pass the defines information
24515 * driver.cs: Add --define command line option.
24517 * decl.cs: Move MemberCore here.
24519 Make it the base class for DeclSpace. This allows us to catch and
24520 report 108 and 109 for everything now.
24522 * class.cs (TypeContainer.Define): Extract all the members
24523 before populating and emit the warning 108 (new keyword required
24524 to override) instead of having each member implement this.
24526 (MemberCore.Define): New abstract method, we will be using this in
24527 the warning reporting engine in Populate.
24529 (Operator.Define): Adjust to new MemberCore protocol.
24531 * const.cs (Const): This does not derive from Expression, it is a
24532 temporary object we use to create fields, it is a MemberCore.
24534 * class.cs (Method.Define): Allow the entry point to be in a
24537 * driver.cs: Rewrite the argument handler to clean it up a bit.
24539 * rootcontext.cs: Made it just an auxiliary namespace feature by
24540 making everything static.
24542 * driver.cs: Adapt code to use RootContext type name instead of
24545 * delegate.cs: Remove RootContext argument.
24547 * class.cs: (Struct, TypeContainer, Class): Remove RootContext
24550 * class.cs (Event.Define): The lookup can fail.
24552 * cs-tokenizer.cs: Begin implementation of pre-procesor.
24554 * expression.cs: Resolve the this instance before invoking the code.
24556 2001-12-17 Miguel de Icaza <miguel@ximian.com>
24558 * cs-parser.jay: Add a production in element_access that allows
24559 the thing to become a "type" reference. This way we can parse
24560 things like "(string [])" as a type.
24562 Note that this still does not handle the more complex rules of
24566 * delegate.cs (Delegate.Populate): Register the delegage constructor builder here.
24568 * ecore.cs: (CopyNewMethods): new utility function used to
24569 assemble the list of methods from running FindMembers.
24571 (MemberLookup): Rework FindMembers so that
24573 2001-12-16 Miguel de Icaza <miguel@ximian.com>
24575 * class.cs (TypeContainer): Remove Delegates who fail to be
24578 * delegate.cs (Populate): Verify that we dont get null return
24579 values. TODO: Check for AsAccessible.
24581 * cs-parser.jay: Use basename to emit error 574 (destructor should
24582 have the same name as container class), not the full name.
24584 * cs-tokenizer.cs (adjust_int): Fit the integer in the best
24585 possible representation.
24587 Also implements integer type suffixes U and L.
24589 2001-12-15 Miguel de Icaza <miguel@ximian.com>
24591 * expression.cs (ArrayCreation.DoResolve): We need to do the
24592 argument resolution *always*.
24594 * decl.cs: Make this hold the namespace. Hold the root context as
24596 (LookupType): Move here.
24598 * enum.cs, class.cs, interface.cs: Adapt to new hierarchy.
24600 * location.cs (Row, Name): Fixed the code, it was always returning
24601 references to the first file.
24603 * interface.cs: Register properties defined through interfaces.
24605 * driver.cs: Add support for globbing on the command line
24607 * class.cs (Field): Make it derive from MemberCore as well.
24610 2001-12-15 Ravi Pratap <ravi@ximian.com>
24612 * class.cs (Event::Define): Check that the type of the event is a delegate
24613 type else flag error #66.
24615 Also, re-use TypeContainer.MethodModifiersValid here too as the rules are the
24618 * attribute.cs (DefinePInvokeMethod): Handle named arguments and process
24619 values of EntryPoint, CharSet etc etc.
24621 Pass in the values to TypeBuilder.DefinePInvokeMethod; determine Type etc neatly.
24623 * class.cs (FindMembers): If a method is in transit, its MethodBuilder will
24624 be null and we should ignore this. I am not sure if this is really clean. Apparently,
24625 there's no way of avoiding hitting this because the call is coming from SimpleName.DoResolve,
24626 which needs this to do its work.
24628 * ../errors/cs0066.cs : Add.
24630 2001-12-14 Miguel de Icaza <miguel@ximian.com>
24632 * typemanager.cs: (GetPropertyGetter, GetPropertyGetter): New
24635 * class.cs: (MethodSignature.MethodSignature): Removed hack that
24636 clears out the parameters field.
24637 (MemberSignatureCompare): Cleanup
24639 (MemberCore): New base class used to share code between MethodCore
24642 (RegisterRequiredImplementations) BindingFlags.Public requires
24643 either BindingFlags.Instace or Static. Use instance here.
24645 (Property): Refactored code to cope better with the full spec.
24647 * parameter.cs (GetParameterInfo): Return an empty array instead
24650 * class.cs (Property): Abstract or extern properties have no bodies.
24652 * parameter.cs (GetParameterInfo): return a zero-sized array.
24654 * class.cs (TypeContainer.MethodModifiersValid): Move all the
24655 method modifier validation to the typecontainer so we can reuse
24656 this on properties.
24658 (MethodCore.ParameterTypes): return an empty sized array of types.
24660 (Property.Define): Test property modifier validity.
24662 Add tests for sealed/override too.
24664 (Method.Emit): abstract or extern methods have no bodies.
24666 2001-12-14 Ravi Pratap <ravi@ximian.com>
24668 * class.cs (Method.IsPInvoke): Get rid of it as it is an expensive
24671 (Method::Define, ::Emit): Modify accordingly.
24673 * expression.cs (Invocation::OverloadResolve): Handle error # 121.
24675 (ArrayCreation::MakeByteBlob): Handle floats and doubles.
24677 * makefile: Pass in /unsafe.
24679 2001-12-13 Miguel de Icaza <miguel@ximian.com>
24681 * class.cs (MakeKey): Kill routine.
24683 * class.cs (TypeContainer.Define): Correctly define explicit
24684 method implementations (they require the full interface name plus
24687 * typemanager.cs: Deply the PtrHashtable here and stop using the
24688 lame keys. Things work so much better.
24690 This of course broke everyone who depended on `RegisterMethod' to
24691 do the `test for existance' test. This has to be done elsewhere.
24693 * support.cs (PtrHashtable): A hashtable that avoid comparing with
24694 the object stupid Equals method (because, that like fails all over
24695 the place). We still do not use it.
24697 * class.cs (TypeContainer.SetRequiredInterface,
24698 TypeContainer.RequireMethods): Killed these two routines and moved
24699 all the functionality to RegisterRequiredImplementations.
24701 (TypeContainer.RegisterRequiredImplementations): This routine now
24702 registers all the implementations required in an array for the
24703 interfaces and abstract methods. We use an array of structures
24704 which can be computed ahead of time to reduce memory usage and we
24705 also assume that lookups are cheap as most classes will not
24706 implement too many interfaces.
24708 We also avoid creating too many MethodSignatures.
24710 (TypeContainer.IsInterfaceMethod): Update and optionally does not
24711 clear the "pending" bit if we find that there are problems with
24714 (TypeContainer.VerifyPendingMethods): Update to report errors of
24715 methods that look like implementations but are not.
24717 (TypeContainer.Define): Add support for explicit interface method
24720 2001-12-12 Miguel de Icaza <miguel@ximian.com>
24722 * typemanager.cs: Keep track of the parameters here instead of
24723 being a feature of the TypeContainer.
24725 * class.cs: Drop the registration of parameters here, as
24726 InterfaceMethods are also interface declarations.
24728 * delegate.cs: Register methods with the TypeManager not only with
24729 the TypeContainer. This code was buggy.
24731 * interface.cs: Full registation here.
24733 2001-12-11 Miguel de Icaza <miguel@ximian.com>
24735 * expression.cs: Remove reducer for binary expressions, it can not
24738 * const.cs: Put here the code that used to go into constant.cs
24740 * constant.cs: Put here the code for constants, this is a new base
24741 class for Literals.
24743 * literal.cs: Make Literal derive from Constant.
24745 2001-12-09 Miguel de Icaza <miguel@ximian.com>
24747 * statement.cs (Return.Emit): Report error 157 if the user
24748 attempts to return from a finally block.
24750 (Return.Emit): Instead of emitting a return, jump to the end of
24753 * codegen.cs (EmitContext): ReturnValue, ReturnLabel: new
24754 LocalBuilder to store the result of the function. ReturnLabel is
24755 the target where we jump.
24758 2001-12-09 Radek Doulik <rodo@ximian.com>
24760 * cs-parser.jay: remember alias in current namespace
24762 * ecore.cs (SimpleName::DoResolve): use aliases for types or
24765 * class.cs (LookupAlias): lookup alias in my_namespace
24767 * namespace.cs (UsingAlias): add alias, namespace_or_type pair to
24769 (LookupAlias): lookup alias in this and if needed in parent
24772 2001-12-08 Miguel de Icaza <miguel@ximian.com>
24776 * rootcontext.cs: (ModuleBuilder) Made static, first step into
24777 making things static. I need this to avoid passing the
24778 TypeContainer when calling ParameterType.
24780 * support.cs (InternalParameters.ParameterType): Remove ugly hack
24781 that did string manipulation to compute the type and then call
24782 GetType. Use Parameter.ParameterType instead.
24784 * cs-tokenizer.cs: Consume the suffix for floating values.
24786 * expression.cs (ParameterReference): figure out whether this is a
24787 reference parameter or not. Kill an extra variable by computing
24788 the arg_idx during emission.
24790 * parameter.cs (Parameters.GetParameterInfo): New overloaded
24791 function that returns whether a parameter is an out/ref value or not.
24793 (Parameter.ParameterType): The type of the parameter (base,
24794 without ref/out applied).
24796 (Parameter.Resolve): Perform resolution here.
24797 (Parameter.ExternalType): The full type (with ref/out applied).
24799 * statement.cs (Using.Emit, Using.EmitExpression): Implement
24800 support for expressions on the using statement.
24802 2001-12-07 Miguel de Icaza <miguel@ximian.com>
24804 * statement.cs (Using.EmitLocalVariableDecls): Split the
24805 localvariable handling of the using statement.
24807 (Block.EmitMeta): Keep track of variable count across blocks. We
24808 were reusing slots on separate branches of blocks.
24810 (Try.Emit): Emit the general code block, we were not emitting it.
24812 Check the type of the declaration to be an IDisposable or
24813 something that can be implicity converted to it.
24815 Emit conversions if required.
24817 * ecore.cs (EmptyExpression): New utility class.
24818 (Expression.ImplicitConversionExists): New utility function.
24820 2001-12-06 Miguel de Icaza <miguel@ximian.com>
24822 * statement.cs (Using): Implement.
24824 * expression.cs (LocalVariableReference): Support read only variables.
24826 * statement.cs: Remove the explicit emit for the Leave opcode.
24827 (VariableInfo): Add a readonly field.
24829 2001-12-05 Miguel de Icaza <miguel@ximian.com>
24831 * ecore.cs (ConvCast): new class used to encapsulate the various
24832 explicit integer conversions that works in both checked and
24833 unchecked contexts.
24835 (Expression.ConvertNumericExplicit): Use new ConvCast class to
24836 properly generate the overflow opcodes.
24838 2001-12-04 Miguel de Icaza <miguel@ximian.com>
24840 * statement.cs: The correct type for the EmptyExpression is the
24841 element_type, not the variable type. Ravi pointed this out.
24843 2001-12-04 Ravi Pratap <ravi@ximian.com>
24845 * class.cs (Method::Define): Handle PInvoke methods specially
24846 by using DefinePInvokeMethod instead of the usual one.
24848 * attribute.cs (DefinePInvokeMethod): Implement as this is what is called
24849 above to do the task of extracting information and defining the method.
24851 2001-12-04 Ravi Pratap <ravi@ximian.com>
24853 * expression.cs (ArrayCreation::EmitStaticInitializers): Get rid
24854 of the condition for string type.
24856 (Emit): Move that here.
24858 (ArrayCreation::CheckIndices): Keep string literals in their expression
24861 (EmitDynamicInitializers): Handle strings appropriately.
24863 2001-12-04 Miguel de Icaza <miguel@ximian.com>
24865 * codegen.cs (EmitContext): Replace multiple variables with a
24866 single pointer to the current Switch statement.
24868 * statement.cs (GotoDefault, Switch): Adjust to cleaned up
24871 2001-12-03 Miguel de Icaza <miguel@ximian.com>
24875 * statement.cs (GotoDefault), cs-parser.jay: Implement `goto
24878 (Foreach.Emit): Foreach on arrays was not setting
24879 up the loop variables (for break/continue).
24881 (GotoCase): Semi-implented.
24883 2001-12-03 Ravi Pratap <ravi@ximian.com>
24885 * attribute.cs (CheckAttribute): Handle system attributes by using
24886 Attribute.GetAttributes to examine information we need.
24888 (GetValidPlaces): Same here.
24890 * class.cs (Method::Define): Catch invalid use of extern and abstract together.
24892 * typemanager.cs (dllimport_type): Core type for System.DllImportAttribute.
24894 * class.cs (Method.IsPinvoke): Used to determine if we are a PInvoke method.
24896 (Method::Define): Set appropriate flags if we have a DllImport attribute.
24898 (Method::Emit): Handle the case when we are a PInvoke method.
24900 2001-12-03 Miguel de Icaza <miguel@ximian.com>
24902 * expression.cs: Use ResolveWithSimpleName on compound names.
24904 2001-12-02 Ravi Pratap <ravi@ximian.com>
24906 * constant.cs (EmitConstant): Make sure we resolve the associated expression
24907 before trying to reduce it.
24909 * typemanager.cs (RegisterConstant, LookupConstant): Implement.
24911 * constant.cs (LookupConstantValue): Implement.
24913 (EmitConstant): Use the above in emitting the constant.
24915 * expression.cs (MemberAccess::ResolveMemberAccess): Handle constants
24916 that are user-defined by doing a LookupConstantValue on them.
24918 (SimpleName::DoResolve): When we have a FieldExpr, cope with constants
24921 2001-11-29 Miguel de Icaza <miguel@ximian.com>
24923 * expression.cs (BaseAccess, BaseIndexer): Also split this out.
24925 (BaseAccess.DoResolve): Implement.
24927 (MemberAccess.DoResolve): Split this routine into a
24928 ResolveMemberAccess routine that can be used independently
24930 2001-11-28 Miguel de Icaza <miguel@ximian.com>
24932 * expression.cs (Probe, Is, As): Split Probe in two classes Is and
24933 As that share bits of the implementation. Is returns a boolean,
24934 while As returns the Type that is being probed.
24936 2001-12-01 Ravi Pratap <ravi@ximian.com>
24938 * enum.cs (LookupEnumValue): Re-write various bits, return an object value
24939 instead of a Literal - much easier.
24941 (EnumInTransit): Remove - utterly useless :-)
24943 (Populate): Re-write bits - remove duplicate code etc. The code is much neater now.
24945 * expression.cs (MemberLookup): Cope with user-defined enums when they are in transit.
24947 * enum.cs (LookupEnumValue): Auto-compute next values by going down the dependency
24948 chain when we have no associated expression.
24950 2001-11-30 Ravi Pratap <ravi@ximian.com>
24952 * constant.cs (Define): Use Location while reporting the errror.
24954 Also emit a warning when 'new' is used and there is no inherited
24957 * enum.cs (EnumInTransit): Used to tell if an enum type is in the process of being
24960 (LookupEnumValue): Implement to lookup an enum member's value and define it
24963 (Populate): Re-write accordingly to use the above routine.
24965 2001-11-27 Miguel de Icaza <miguel@ximian.com>
24967 * expression.cs (This): Fix prototype for DoResolveLValue to
24968 override the base class DoResolveLValue.
24970 * cs-parser.cs: Report errors cs574 and cs575 (destructor
24973 * ecore.cs (FieldExpr.EmitAssign): Handle value types specially
24974 (we need to load the address of the field here). This fixes
24977 (FieldExpr.DoResolveLValue): Call the DoResolve
24978 function to initialize the Instance expression.
24980 * statement.cs (Foreach.Emit): Fix the bug where we did not invoke
24981 correctly the GetEnumerator operation on a value type.
24983 * cs-parser.jay: Add more simple parsing error catches.
24985 * statement.cs (Switch): Add support for string switches.
24986 Handle null specially.
24988 * literal.cs (NullLiteral): Make NullLiteral objects singletons.
24990 2001-11-28 Ravi Pratap <ravi@ximian.com>
24992 * cs-parser.jay (local_constant_declaration): Use declare_local_constant.
24994 (declare_local_constant): New helper function.
24996 * statement.cs (AddConstant): Keep a separate record of constants
24998 (IsConstant): Implement to determine if a variable is a constant.
25000 (GetConstantExpression): Implement.
25002 * expression.cs (LocalVariableReference): Handle the case when it is a constant.
25004 * statement.cs (IsVariableDefined): Re-write.
25006 2001-11-27 Ravi Pratap <ravi@ximian.com>
25008 * class.cs (TypeContainer::FindMembers): Look for constants
25009 in the case when we are looking for MemberTypes.Field
25011 * expression.cs (MemberAccess::DoResolve): Check that in the
25012 case we are a FieldExpr and a Literal, we are not being accessed
25013 by an instance reference.
25015 * cs-parser.jay (local_constant_declaration): Implement.
25017 (declaration_statement): Implement for constant declarations.
25019 2001-11-26 Miguel de Icaza <miguel@ximian.com>
25021 * statement.cs (Switch): Catch double defaults.
25023 (Switch): More work on the switch() statement
25024 implementation. It works for integral values now, need to finish
25028 2001-11-24 Miguel de Icaza <miguel@ximian.com>
25030 * ecore.cs (Expression.ConvertIntLiteral): New function to convert
25031 integer literals into other integer literals. To be used by
25034 2001-11-24 Ravi Pratap <ravi@ximian.com>
25036 * expression.cs (ArrayCreation): Get rid of ArrayExprs : we save
25039 (EmitDynamicInitializers): Cope with the above since we extract data
25040 directly from ArrayData now.
25042 (ExpectInitializers): Keep track of whether initializers are mandatory
25045 (Bounds): Make it a hashtable to prevent the same dimension being
25046 recorded for every element in that dimension.
25048 (EmitDynamicInitializers): Fix bug which prevented the Set array method
25051 Also fix bug which was causing the indices to be emitted in the reverse
25054 2001-11-24 Miguel de Icaza <miguel@ximian.com>
25056 * expression.cs (ArrayCreation): Implement the bits that Ravi left
25057 unfinished. They do not work, because the underlying code is
25060 2001-11-22 Miguel de Icaza <miguel@ximian.com>
25062 * cs-parser.jay: Remove bogus fixme.
25064 * statement.cs (Switch, SwitchSection, SwithLabel): Started work
25065 on Switch statement.
25067 2001-11-23 Ravi Pratap <ravi@ximian.com>
25069 * typemanager.cs (IsDelegateType, IsEnumType): Fix logic to determine
25072 * expression.cs (ArrayCreation::CheckIndices): Get rid of the require_constant
25073 parameter. Apparently, any expression is allowed.
25075 (ValidateInitializers): Update accordingly.
25077 (CheckIndices): Fix some tricky bugs thanks to recursion.
25079 * delegate.cs (NewDelegate::DoResolve): Re-write large portions as
25080 I was being completely brain-dead.
25082 (VerifyMethod, VerifyApplicability, VerifyDelegate): Make static
25083 and re-write acordingly.
25085 (DelegateInvocation): Re-write accordingly.
25087 * expression.cs (ArrayCreation::Emit): Handle string initialization separately.
25089 (MakeByteBlob): Handle types more correctly.
25091 * expression.cs (ArrayCreation:Emit): Write preliminary code to do
25092 initialization from expressions but it is incomplete because I am a complete
25095 2001-11-22 Miguel de Icaza <miguel@ximian.com>
25097 * statement.cs (If.Emit): Fix a bug that generated incorrect code
25098 on If. Basically, we have to return `true' (ie, we do return to
25099 our caller) only if both branches of the if return.
25101 * expression.cs (Binary.Emit): LogicalOr and LogicalAnd are
25102 short-circuit operators, handle them as short circuit operators.
25104 (Cast.DoResolve): Resolve type.
25105 (Cast.Cast): Take an expression as the target type.
25107 * cs-parser.jay (cast_expression): Remove old hack that only
25108 allowed a limited set of types to be handled. Now we take a
25109 unary_expression and we resolve to a type during semantic
25112 Use the grammar productions from Rhys to handle casts (this is
25113 not complete like Rhys syntax yet, we fail to handle that corner
25114 case that C# has regarding (-x), but we will get there.
25116 2001-11-22 Ravi Pratap <ravi@ximian.com>
25118 * class.cs (EmitFieldInitializer): Take care of the case when we have a
25119 field which is an array type.
25121 * cs-parser.jay (declare_local_variables): Support array initialization too.
25123 * typemanager.cs (MakeKey): Implement.
25125 (everywhere): Use the above appropriately.
25127 * cs-parser.jay (for_statement): Update for array initialization while
25128 declaring variables.
25130 * ecore.cs : The error message was correct, it's the variable's names that
25131 were misleading ;-) Make the code more readable.
25133 (MemberAccess::DoResolve): Fix the code which handles Enum literals to set
25134 the correct type etc.
25136 (ConvertExplicit): Handle Enum types by examining the underlying type.
25138 2001-11-21 Ravi Pratap <ravi@ximian.com>
25140 * parameter.cs (GetCallingConvention): Always return
25141 CallingConventions.Standard for now.
25143 2001-11-22 Miguel de Icaza <miguel@ximian.com>
25145 * expression.cs (Binary.ResolveOperator): Update the values of `l'
25146 and `r' after calling DoNumericPromotions.
25148 * ecore.cs: Fix error message (the types were in the wrong order).
25150 * statement.cs (Foreach.ProbeCollectionType): Need to pass
25151 BindingFlags.Instance as well
25153 * ecore.cs (Expression.TryImplicitIntConversion): Wrap the result
25154 implicit int literal conversion in an empty cast so that we
25155 propagate the right type upstream.
25157 (UnboxCast): new class used to unbox value types.
25158 (Expression.ConvertExplicit): Add explicit type conversions done
25161 (Expression.ImplicitNumericConversion): Oops, forgot to test for
25162 the target type before applying the implicit LongLiterals to ULong
25165 2001-11-21 Miguel de Icaza <miguel@ximian.com>
25167 * cs-parser.jay (for_statement): Reworked the way For works: now
25168 we declare manually any variables that are introduced in
25169 for_initializer to solve the problem of having out-of-band code
25170 emition (that is what got for broken).
25172 (declaration_statement): Perform the actual variable declaration
25173 that used to be done in local_variable_declaration here.
25175 (local_variable_declaration): Do not declare anything, just pass
25176 the information on a DictionaryEntry
25178 2001-11-20 Ravi Pratap <ravi@ximian.com>
25180 * expression.cs (ArrayCreation::CheckIndices): The story continues :-) Complete
25181 re-write of the logic to now make it recursive.
25183 (UpdateIndices): Re-write accordingly.
25185 Store element data in a separate ArrayData list in the above methods.
25187 (MakeByteBlob): Implement to dump the array data into a byte array.
25189 2001-11-19 Ravi Pratap <ravi@ximian.com>
25191 * expression.cs (ArrayCreation): Factor out some code from ValidateInitializers
25194 * constant.cs (Define): Implement.
25196 (EmitConstant): Re-write fully.
25198 Pass in location info.
25200 * class.cs (Populate, Emit): Call Constant::Define and Constant::EmitConstant
25203 * cs-parser.jay (constant_declarator): Use VariableDeclaration instead of
25204 DictionaryEntry since we need location info too.
25206 (constant_declaration): Update accordingly.
25208 * expression.cs (ArrayCreation): Make ValidateInitializers simpler by factoring
25209 code into another method : UpdateIndices.
25211 2001-11-18 Ravi Pratap <ravi@ximian.com>
25213 * expression.cs (ArrayCreation::ValidateInitializers): Update to perform
25214 some type checking etc.
25216 2001-11-17 Ravi Pratap <ravi@ximian.com>
25218 * expression.cs (ArrayCreation::ValidateInitializers): Implement
25219 bits to provide dimension info if the user skips doing that.
25221 Update second constructor to store the rank correctly.
25223 2001-11-16 Ravi Pratap <ravi@ximian.com>
25225 * expression.cs (ArrayCreation::ValidateInitializers): Poke around
25226 and try to implement.
25228 * ../errors/cs0150.cs : Add.
25230 * ../errors/cs0178.cs : Add.
25232 2001-11-16 Miguel de Icaza <miguel@ximian.com>
25234 * statement.cs: Implement foreach on multi-dimensional arrays.
25236 * parameter.cs (Parameters.GetParameterByName): Also lookup the
25237 name of the params argument.
25239 * expression.cs: Use EmitStoreOpcode to get the right opcode while
25240 initializing the array.
25242 (ArrayAccess.EmitStoreOpcode): move the opcode generation here, so
25243 we can use this elsewhere.
25245 * statement.cs: Finish implementation of foreach for single
25248 * cs-parser.jay: Use an out-of-band stack to pass information
25249 around, I wonder why I need this.
25251 foreach_block: Make the new foreach_block the current_block.
25253 * parameter.cs (Parameters.GetEmptyReadOnlyParameters): New
25254 function used to return a static Parameters structure. Used for
25255 empty parameters, as those are created very frequently.
25257 * cs-parser.jay, class.cs: Use GetEmptyReadOnlyParameters
25259 2001-11-15 Ravi Pratap <ravi@ximian.com>
25261 * interface.cs : Default modifier is private, not public. The
25262 make verify test passes again.
25264 2001-11-15 Ravi Pratap <ravi@ximian.com>
25266 * support.cs (ReflectionParameters): Fix logic to determine
25267 whether the last parameter is a params one. Test 9 passes again.
25269 * delegate.cs (Populate): Register the builders we define with
25270 RegisterParameterForBuilder. Test 19 passes again.
25272 * cs-parser.jay (property_declaration): Reference $6 instead
25273 of $$ to get at the location.
25275 (indexer_declaration): Similar stuff.
25277 (attribute): Ditto.
25279 * class.cs (Property): Register parameters for the Get and Set methods
25280 if they exist. Test 23 passes again.
25282 * expression.cs (ArrayCreation::Emit): Pass null for the method in the
25283 call to EmitArguments as we are sure there aren't any params arguments.
25284 Test 32 passes again.
25286 * suppor.cs (ParameterDesc, ParameterModifier): Fix trivial bug causing
25287 IndexOutOfRangeException.
25289 * class.cs (Property::Define): Register property using TypeManager.RegisterProperty
25290 Test 33 now passes again.
25292 2001-11-15 Miguel de Icaza <miguel@ximian.com>
25294 * cs-parser.jay: Kill horrendous hack ($??? = lexer.Location) that
25295 broke a bunch of things. Will have to come up with a better way
25296 of tracking locations.
25298 * statement.cs: Implemented foreach for single dimension arrays.
25300 2001-11-09 Miguel de Icaza <miguel@ximian.com>
25302 * enum.cs (Enum.Emit): Delay the lookup of loc until we run into
25303 an error. This removes the lookup from the critical path.
25305 * cs-parser.jay: Removed use of temporary_loc, which is completely
25308 2001-11-14 Miguel de Icaza <miguel@ximian.com>
25310 * support.cs (ReflectionParameters.ParameterModifier): Report
25311 whether the argument is a PARAMS argument or not.
25313 * class.cs: Set the attribute `ParamArrayAttribute' on the
25314 parameter argument.
25316 * typemanager.cs: Define param_array_type (ParamArrayAttribute)
25317 and cons_param_array_attribute (ConstructorInfo for
25318 ParamArrayAttribute).,
25320 * codegen.cs: Emit the return using the `Return' statement, that
25321 way we can report the error correctly for missing return values.
25323 * class.cs (Method.Emit): Clean up.
25325 * expression.cs (Argument.Resolve): Take another argument: the
25326 location where this argument is used. Notice that this is not
25327 part of the "Argument" class as to reduce the size of the
25328 structure (we know the approximate location anyways).
25330 Test if the argument is a variable-reference, if not, then
25331 complain with a 206.
25333 (Argument.Emit): Emit addresses of variables.
25335 (Argument.FullDesc): Simplify.
25337 (Invocation.DoResolve): Update for Argument.Resolve.
25339 (ElementAccess.DoResolve): ditto.
25341 * delegate.cs (DelegateInvocation.Emit): Invocation of Invoke
25342 method should be virtual, as this method is always virtual.
25344 (NewDelegate.DoResolve): Update for Argument.Resolve.
25346 * class.cs (ConstructorInitializer.DoResolve): ditto.
25348 * attribute.cs (Attribute.Resolve): ditto.
25350 2001-11-13 Miguel de Icaza <miguel@ximian.com>
25352 * statement.cs (Foreach.Emit): Use EmitAssign instead of Store.
25354 * expression.cs (ParameterReference): Drop IStackStorage and implement
25355 IAssignMethod instead.
25357 (LocalVariableReference): ditto.
25359 * ecore.cs (FieldExpr): Drop IStackStorage and implement
25360 IAssignMethod instead.
25362 2001-11-13 Miguel de Icaza <miguel@ximian.com>
25364 * parameter.cs, expression.cs, class.cs, ecore.cs: Made all
25365 enumerations that are used in heavily used structures derive from
25366 byte in a laughable and pathetic attempt to reduce memory usage.
25367 This is the kind of pre-optimzations that you should not do at
25368 home without adult supervision.
25370 * expression.cs (UnaryMutator): New class, used to handle ++ and
25371 -- separatedly from the other unary operators. Cleans up the
25372 code, and kills the ExpressionStatement dependency in Unary.
25374 (Unary): Removed `method' and `Arguments' from this class, making
25375 it smaller, and moving it all to SimpleCall, so I can reuse this
25376 code in other locations and avoid creating a lot of transient data
25377 strucutres when not required.
25379 * cs-parser.jay: Adjust for new changes.
25381 2001-11-11 Miguel de Icaza <miguel@ximian.com>
25383 * enum.cs (Enum.Populate): If there is a failure during
25386 * cs-parser.jay (opt_enum_base): we used to catch type errors
25387 here, but this is really incorrect. The type error should be
25388 catched during semantic analysis.
25390 2001-12-11 Ravi Pratap <ravi@ximian.com>
25392 * cs-parser.jay (operator_declarator, conversion_operator_declarator): Set
25393 current_local_parameters as expected since I, in my stupidity, had forgotten
25396 * attribute.cs (GetValidPlaces): Fix stupid bug.
25398 * class.cs (Method::Emit): Perform check on applicability of attributes.
25400 (Constructor::Emit): Ditto.
25402 (Field::Emit): Ditto.
25404 (Field.Location): Store location information.
25406 (Property, Event, Indexer, Operator): Ditto.
25408 * cs-parser.jay (field_declaration): Pass in location for each field.
25410 * ../errors/cs0592.cs : Add.
25412 2001-11-12 Ravi Pratap <ravi@ximian.com>
25414 * typemanager.cs (attribute_usage_type): New static member for System.AttributeUsage.
25416 (InitCoreTypes): Update accordingly.
25418 (RegisterAttrType, LookupAttr): Implement.
25420 * attribute.cs (Attribute.Targets, AllowMultiple, Inherited): New fields to hold
25421 info about the same.
25423 (Resolve): Update to populate the above as necessary.
25425 (Error592): Helper.
25427 (GetValidPlaces): Helper to the above.
25429 (CheckAttribute): Implement to perform validity of attributes on declarative elements.
25431 * class.cs (TypeContainer::Emit): Update attribute emission code to perform checking etc.
25433 2001-11-12 Ravi Pratap <ravi@ximian.com>
25435 * attribute.cs (Attribute::Resolve): Expand to handle named arguments too.
25437 * ../errors/cs0617.cs : Add.
25439 2001-11-11 Ravi Pratap <ravi@ximian.com>
25441 * enum.cs (Emit): Rename to Populate to be more consistent with what
25442 we expect it to do and when exactly it is called.
25444 * class.cs, rootcontext.cs : Update accordingly.
25446 * typemanager.cs (RegisterField, GetValue): Workarounds for the fact that
25447 FieldInfo.GetValue does not work on dynamic types ! S.R.E lameness strikes again !
25449 * enum.cs (Populate): Register fields with TypeManager.RegisterField.
25451 * expression.cs (MemberAccess.DoResolve): Adjust code to obtain the value
25452 of a fieldinfo using the above, when dealing with a FieldBuilder.
25454 2001-11-10 Ravi Pratap <ravi@ximian.com>
25456 * ../errors/cs0031.cs : Add.
25458 * ../errors/cs1008.cs : Add.
25460 * ../errrors/cs0543.cs : Add.
25462 * enum.cs (DefineEnum): Check the underlying type and report an error if not a valid
25465 (FindMembers): Implement.
25467 * typemanager.cs (FindMembers): Re-write to call the appropriate methods for
25468 enums and delegates too.
25470 (enum_types): Rename to builder_to_enum.
25472 (delegate_types): Rename to builder_to_delegate.
25474 * delegate.cs (FindMembers): Implement.
25476 2001-11-09 Ravi Pratap <ravi@ximian.com>
25478 * typemanager.cs (IsEnumType): Implement.
25480 * enum.cs (Emit): Re-write parts to account for the underlying type
25481 better and perform checking etc.
25483 (GetNextDefaultValue): Helper to ensure we don't overshoot max value
25484 of the underlying type.
25486 * literal.cs (GetValue methods everywhere): Perform bounds checking and return
25489 * enum.cs (error31): Helper to report error #31.
25491 * cs-parser.jay (enum_declaration): Store location of each member too.
25493 * enum.cs (member_to_location): New hashtable.
25495 (AddEnumMember): Update location hashtable.
25497 (Emit): Use the location of each member while reporting errors.
25499 2001-11-09 Miguel de Icaza <miguel@ximian.com>
25501 * cs-parser.jay: A for_initializer if is a
25502 local_variable_declaration really ammount to have an implicit
25503 block with the variable declaration and no initializer for for.
25505 * statement.cs (For.Emit): Cope with null initializers.
25507 This fixes the infinite loop on for initializers.
25509 2001-11-08 Miguel de Icaza <miguel@ximian.com>
25511 * enum.cs: More cleanup.
25513 * ecore.cs: Remove dead code.
25515 * class.cs (Property.Emit): More simplification.
25516 (Event.Emit): ditto.
25518 Reworked to have less levels of indentation.
25520 2001-11-08 Ravi Pratap <ravi@ximian.com>
25522 * class.cs (Property): Emit attributes.
25532 * enum.cs (Emit): Ditto.
25534 * rootcontext.cs (ResolveTree, EmitCode, CloseTypes): Do the same for
25537 * class.cs (Field, Event, etc.): Move attribute generation into the
25538 Emit method everywhere.
25540 * enum.cs (Enum): Revamp to use the same definition semantics as delegates so
25541 we have a DefineEnum, CloseEnum etc. The previous way of doing things was not right
25542 as we had no way of defining nested enums !
25544 * rootcontext.cs : Adjust code accordingly.
25546 * typemanager.cs (AddEnumType): To keep track of enum types separately.
25548 2001-11-07 Ravi Pratap <ravi@ximian.com>
25550 * expression.cs (EvalConstantExpression): Move into ecore.cs
25552 * enum.cs (Enum): Rename some members and make them public and readonly
25553 according to our convention.
25555 * modifiers.cs (EnumAttr): Implement as we need to set only visibility flags,
25558 * enum.cs (Enum::Define): Use the above instead of TypeAttr.
25560 (Enum::Emit): Write a simple version for now which doesn't try to compute
25561 expressions. I shall modify this to be more robust in just a while.
25563 * class.cs (TypeContainer::Emit): Make sure we include Enums too.
25565 (TypeContainer::CloseType): Create the Enum types too.
25567 * attribute.cs (Resolve): Use the new Reduce method instead of EvalConstantExpression.
25569 * expression.cs (EvalConstantExpression): Get rid of completely.
25571 * enum.cs (Enum::Emit): Use the new expression reducer. Implement assigning
25572 user-defined values and other cases.
25574 (IsValidEnumLiteral): Helper function.
25576 * expression.cs (ExprClassfromMemberInfo): Modify to not do any literalizing
25577 out there in the case we had a literal FieldExpr.
25579 (MemberAccess:DoResolve): Do the literalizing of the FieldExpr here.
25581 (Literalize): Revamp a bit to take two arguments.
25583 (EnumLiteral): New class which derives from Literal to wrap enum literals.
25585 2001-11-06 Ravi Pratap <ravi@ximian.com>
25587 * cs-parser.jay (compilation_unit): Remove extra opt_attributes for now.
25589 * expression.cs (ArrayCreation::ValidateInitializers): Implement.
25591 (Resolve): Use the above to ensure we have proper initializers.
25593 2001-11-05 Ravi Pratap <ravi@ximian.com>
25595 * expression.cs (Expression::EvalConstantExpression): New method to
25596 evaluate constant expressions.
25598 * attribute.cs (Attribute::Resolve): Modify bits to use the above function.
25600 2001-11-07 Miguel de Icaza <miguel@ximian.com>
25602 * expression.cs (ArrayCreation.Emit): Some bits to initialize data
25605 (Binary.ResolveOperator): Handle operator != (object a, object b)
25606 and operator == (object a, object b);
25608 (Binary.DoNumericPromotions): Indicate whether the numeric
25609 promotion was possible.
25611 (ArrayAccess.DoResolve, ArrayAccess.Emit, ArrayAccess.EmitAssign):
25614 Made the ArrayAccess implement interface IAssignMethod instead of
25615 IStackStore as the order in which arguments are passed reflects
25618 * assign.cs: Instead of using expr.ExprClass to select the way of
25619 assinging, probe for the IStackStore/IAssignMethod interfaces.
25621 * typemanager.cs: Load InitializeArray definition.
25623 * rootcontext.cs (RootContext.MakeStaticData): Used to define
25624 static data that can be used to initialize arrays.
25626 2001-11-05 Miguel de Icaza <miguel@ximian.com>
25628 * expression.cs: Handle operator== and operator!= for booleans.
25630 (Conditioal.Reduce): Implement reducer for the ?: operator.
25632 (Conditional.Resolve): Implement dead code elimination.
25634 (Binary.Resolve): Catch string literals and return a new
25635 concatenated string.
25637 (Unary.Reduce): Implement reduction of unary expressions.
25639 * ecore.cs: Split out the expression core handling here.
25641 (Expression.Reduce): New method used to perform constant folding
25642 and CSE. This is needed to support constant-expressions.
25644 * statement.cs (Statement.EmitBoolExpression): Pass true and false
25645 targets, and optimize for !x.
25647 2001-11-04 Ravi Pratap <ravi@ximian.com>
25649 * attribute.cs (Attribute::Resolve): Implement guts. Note that resolution
25650 of an attribute gives us a CustomAttributeBuilder which we use accordingly to
25651 set custom atttributes.
25653 * literal.cs (Literal::GetValue): New abstract method to return the actual
25654 value of the literal, cast as an object.
25656 (*Literal): Implement GetValue method.
25658 * cs-parser.jay (positional_argument_list, named_argument_list): Add not just plain
25659 expressions to the arraylist but objects of type Argument.
25661 * class.cs (TypeContainer::Emit): Emit our attributes too.
25663 (Method::Emit, Constructor::Emit): Ditto.
25665 * cs-parser.jay (constructor_declaration): Set attributes too, which we seemed
25666 to be ignoring earlier.
25668 2001-11-03 Ravi Pratap <ravi@ximian.com>
25670 * attribute.cs (AttributeSection::Define): Implement to do the business
25671 of constructing a CustomAttributeBuilder.
25673 (Attribute): New trivial class. Increases readability of code.
25675 * cs-parser.jay : Update accordingly.
25677 (positional_argument_list, named_argument_list, named_argument): New rules
25679 (attribute_arguments): Use the above so that we are more correct.
25681 2001-11-02 Ravi Pratap <ravi@ximian.com>
25683 * expression.cs (Invocation::IsParamsMethodApplicable): Implement
25684 to perform all checks for a method with a params parameter.
25686 (Invocation::OverloadResolve): Update to use the above method and therefore
25687 cope correctly with params method invocations.
25689 * support.cs (InternalParameters::ParameterDesc): Provide a desc for
25692 * class.cs (ConstructorInitializer::Resolve): Make sure we look for Non-public
25693 constructors in our parent too because we can't afford to miss out on
25696 * attribute.cs (AttributeSection): New name for the class Attribute
25698 Other trivial changes to improve readability.
25700 * cs-parser.jay (opt_attributes, attribute_section etc.): Modify to
25701 use the new class names.
25703 2001-11-01 Ravi Pratap <ravi@ximian.com>
25705 * class.cs (Method::Define): Complete definition for params types too
25707 (Indexer::Define): Ditto.
25709 * support.cs (InternalParameters::ParameterType, ParameterDesc, ParameterModifier):
25710 Cope everywhere with a request for info about the array parameter.
25712 2001-11-01 Ravi Pratap <ravi@ximian.com>
25714 * tree.cs (RecordNamespace): Fix up to check for the correct key.
25716 * cs-parser.jay (GetQualifiedIdentifier): New Helper method used in
25717 local_variable_type to extract the string corresponding to the type.
25719 (local_variable_type): Fixup the action to use the new helper method.
25721 * codegen.cs : Get rid of RefOrOutParameter, it's not the right way to
25724 * expression.cs : Clean out code which uses the above.
25726 2001-10-31 Ravi Pratap <ravi@ximian.com>
25728 * typemanager.cs (RegisterMethod): Check if we already have an existing key
25729 and bale out if necessary by returning a false.
25731 (RegisterProperty): Ditto.
25733 * class.cs (everywhere): Check the return value from TypeManager.RegisterMethod
25734 and print out appropriate error messages.
25736 * interface.cs (everywhere): Ditto.
25738 * cs-parser.jay (property_declaration, event_declaration, indexer_declaration): Pass
25739 location to constructor.
25741 * class.cs (Property, Event, Indexer): Update accordingly.
25743 * ../errors/cs111.cs : Added.
25745 * expression.cs (Invocation::IsApplicable): New static method to determine applicability
25746 of a method, as laid down by the spec.
25748 (Invocation::OverloadResolve): Use the above method.
25750 2001-10-31 Ravi Pratap <ravi@ximian.com>
25752 * support.cs (InternalParameters): Get rid of crap taking in duplicate info. We
25753 now take a TypeContainer and a Parameters object.
25755 (ParameterData): Modify return type of ParameterModifier method to be
25756 Parameter.Modifier and not a string.
25758 (ReflectionParameters, InternalParameters): Update accordingly.
25760 * expression.cs (Argument::GetParameterModifier): Same here.
25762 * support.cs (InternalParameters::ParameterType): Find a better way of determining
25763 if we are a ref/out parameter. Actually, the type shouldn't be holding the '&'
25764 symbol in it at all so maybe this is only for now.
25766 2001-10-30 Ravi Pratap <ravi@ximian.com>
25768 * support.cs (InternalParameters): Constructor now takes an extra argument
25769 which is the actual Parameters class.
25771 (ParameterDesc): Update to provide info on ref/out modifiers.
25773 * class.cs (everywhere): Update call to InternalParameters to pass in
25774 the second argument too.
25776 * support.cs (ParameterData): Add ParameterModifier, which is a method
25777 to return the modifier info [ref/out etc]
25779 (InternalParameters, ReflectionParameters): Implement the above.
25781 * expression.cs (Argument::ParameterModifier): Similar function to return
25782 info about the argument's modifiers.
25784 (Invocation::OverloadResolve): Update to take into account matching modifiers
25787 * class.cs (Indexer::Define): Actually define a Parameter object and put it onto
25788 a new SetFormalParameters object which we pass to InternalParameters.
25790 2001-10-30 Ravi Pratap <ravi@ximian.com>
25792 * expression.cs (NewArray): Merge into the ArrayCreation class.
25794 2001-10-29 Ravi Pratap <ravi@ximian.com>
25796 * expression.cs (NewArray): Merge classes NewBuiltinArray and
25797 NewUserdefinedArray into one as there wasn't much of a use in having
25800 * expression.cs (Argument): Change field's name to ArgType from Type.
25802 (Type): New readonly property which returns the proper type, taking into
25803 account ref/out modifiers.
25805 (everywhere): Adjust code accordingly for the above.
25807 * codegen.cs (EmitContext.RefOrOutParameter): New field to determine
25808 whether we are emitting for a ref or out parameter.
25810 * expression.cs (Argument::Emit): Use the above field to set the state.
25812 (LocalVariableReference::Emit): Update to honour the flag and emit the
25815 * parameter.cs (Attributes): Set the correct flags for ref parameters.
25817 * expression.cs (Argument::FullDesc): New function to provide a full desc.
25819 * support.cs (ParameterData): Add method ParameterDesc to the interface.
25821 (ReflectionParameters, InternalParameters): Implement the above method.
25823 * expression.cs (Invocation::OverloadResolve): Use the new desc methods in
25826 (Invocation::FullMethodDesc): Ditto.
25828 2001-10-29 Miguel de Icaza <miguel@ximian.com>
25830 * cs-parser.jay: Add extra production for the second form of array
25833 * expression.cs (ArrayCreation): Update to reflect the above
25836 * Small changes to prepare for Array initialization.
25838 2001-10-28 Miguel de Icaza <miguel@ximian.com>
25840 * typemanager.cs (ImplementsInterface): interface might be null;
25841 Deal with this problem;
25843 Also, we do store negative hits on the cache (null values), so use
25844 this instead of calling t.GetInterfaces on the type everytime.
25846 2001-10-28 Ravi Pratap <ravi@ximian.com>
25848 * typemanager.cs (IsBuiltinType): New method to help determine the same.
25850 * expression.cs (New::DoResolve): Get rid of array creation code and instead
25851 split functionality out into different classes.
25853 (New::FormArrayType): Move into NewBuiltinArray.
25855 (Invocation::EmitArguments): Get rid of the MethodBase argument. Appears
25858 (NewBuiltinArray): New class to handle creation of built-in arrays.
25860 (NewBuiltinArray::DoResolve): Implement guts of array creation. Also take into
25861 account creation of one-dimensional arrays.
25863 (::Emit): Implement to use Newarr and Newobj opcodes accordingly.
25865 (NewUserdefinedArray::DoResolve): Implement.
25867 * cs-parser.jay (local_variable_type): Fix up to add the rank to the variable too.
25869 * typemanager.cs (AddModule): Used to add a ModuleBuilder to the list of modules
25870 we maintain inside the TypeManager. This is necessary to perform lookups on the
25873 (LookupType): Update to perform GetType on the module builders too.
25875 * driver.cs (Driver): Add the ModuleBuilder to the list maintained by the TypeManager.
25877 * exprssion.cs (NewUserdefinedArray::Emit): Implement.
25879 2001-10-23 Ravi Pratap <ravi@ximian.com>
25881 * expression.cs (New::DoResolve): Implement guts of array creation.
25883 (New::FormLookupType): Rename to FormArrayType and modify ever so slightly.
25885 2001-10-27 Miguel de Icaza <miguel@ximian.com>
25887 * expression.cs: Fix bug I introduced lsat night that broke
25890 (Expression.Resolve): Report a 246 error (can not resolve name)
25891 if we find a SimpleName in the stream.
25893 (Expression.ResolveLValue): Ditto.
25895 (Expression.ResolveWithSimpleName): This function is a variant of
25896 ResolveName, this one allows SimpleNames to be returned without a
25897 warning. The only consumer of SimpleNames is MemberAccess
25899 2001-10-26 Miguel de Icaza <miguel@ximian.com>
25901 * expression.cs (Invocation::DoResolve): Catch SimpleNames that
25902 might arrive here. I have my doubts that this is correct.
25904 * statement.cs (Lock): Implement lock statement.
25906 * cs-parser.jay: Small fixes to support `lock' and `using'
25908 * cs-tokenizer.cs: Remove extra space
25910 * driver.cs: New flag --checked, allows to turn on integer math
25913 * typemanger.cs: Load methodinfos for Threading.Monitor.Enter and
25914 Threading.Monitor.Exit
25916 2001-10-23 Miguel de Icaza <miguel@ximian.com>
25918 * expression.cs (IndexerAccess::DoResolveLValue): Set the
25919 Expression Class to be IndexerAccess.
25921 Notice that Indexer::DoResolve sets the eclass to Value.
25923 2001-10-22 Miguel de Icaza <miguel@ximian.com>
25925 * class.cs (TypeContainer::Emit): Emit code for indexers.
25927 * assign.cs (IAssignMethod): New interface implemented by Indexers
25928 and Properties for handling assignment.
25930 (Assign::Emit): Simplify and reuse code.
25932 * expression.cs (IndexerAccess, PropertyExpr): Implement
25933 IAssignMethod, clean up old code.
25935 2001-10-22 Ravi Pratap <ravi@ximian.com>
25937 * typemanager.cs (ImplementsInterface): New method to determine if a type
25938 implements a given interface. Provides a nice cache too.
25940 * expression.cs (ImplicitReferenceConversion): Update checks to use the above
25943 (ConvertReferenceExplicit): Ditto.
25945 * delegate.cs (Delegate::Populate): Update to define the parameters on the
25946 various methods, with correct names etc.
25948 * class.cs (Operator::OpType): New members Operator.UnaryPlus and
25949 Operator.UnaryNegation.
25951 * cs-parser.jay (operator_declarator): Be a little clever in the case where
25952 we have a unary plus or minus operator.
25954 * expression.cs (Unary): Rename memebers of Operator enum to UnaryPlus and
25957 * everywhere : update accordingly.
25959 * everywhere : Change Negate and BitComplement to LogicalNot and OnesComplement
25962 * class.cs (Method::Define): For the case where we are implementing a method
25963 inherited from an interface, we need to set the MethodAttributes.Final flag too.
25964 Also set MethodAttributes.NewSlot and MethodAttributes.HideBySig.
25966 2001-10-21 Ravi Pratap <ravi@ximian.com>
25968 * interface.cs (FindMembers): Implement to work around S.R.E
25971 * typemanager.cs (IsInterfaceType): Implement.
25973 (FindMembers): Update to handle interface types too.
25975 * expression.cs (ImplicitReferenceConversion): Re-write bits which
25976 use IsAssignableFrom as that is not correct - it doesn't work.
25978 * delegate.cs (DelegateInvocation): Derive from ExpressionStatement
25979 and accordingly override EmitStatement.
25981 * expression.cs (ConvertReferenceExplicit): Re-write similary, this time
25982 using the correct logic :-)
25984 2001-10-19 Ravi Pratap <ravi@ximian.com>
25986 * ../errors/cs-11.cs : Add to demonstrate error -11
25988 2001-10-17 Miguel de Icaza <miguel@ximian.com>
25990 * assign.cs (Assign::Resolve): Resolve right hand side first, and
25991 then pass this as a hint to ResolveLValue.
25993 * expression.cs (FieldExpr): Add Location information
25995 (FieldExpr::LValueResolve): Report assignment to readonly
25998 (Expression::ExprClassFromMemberInfo): Pass location information.
26000 (Expression::ResolveLValue): Add new method that resolves an
26003 (Expression::DoResolveLValue): Default invocation calls
26006 (Indexers): New class used to keep track of indexers in a given
26009 (IStackStore): Renamed from LValue, as it did not really describe
26010 what this did. Also ResolveLValue is gone from this interface and
26011 now is part of Expression.
26013 (ElementAccess): Depending on the element access type
26015 * typemanager.cs: Add `indexer_name_type' as a Core type
26016 (System.Runtime.CompilerServices.IndexerNameAttribute)
26018 * statement.cs (Goto): Take a location.
26020 2001-10-18 Ravi Pratap <ravi@ximian.com>
26022 * delegate.cs (Delegate::VerifyDelegate): New method to verify
26023 if two delegates are compatible.
26025 (NewDelegate::DoResolve): Update to take care of the case when
26026 we instantiate a delegate from another delegate.
26028 * typemanager.cs (FindMembers): Don't even try to look up members
26029 of Delegate types for now.
26031 2001-10-18 Ravi Pratap <ravi@ximian.com>
26033 * delegate.cs (NewDelegate): New class to take care of delegate
26036 * expression.cs (New): Split the delegate related code out into
26037 the NewDelegate class.
26039 * delegate.cs (DelegateInvocation): New class to handle delegate
26042 * expression.cs (Invocation): Split out delegate related code into
26043 the DelegateInvocation class.
26045 2001-10-17 Ravi Pratap <ravi@ximian.com>
26047 * expression.cs (New::DoResolve): Implement delegate creation fully
26048 and according to the spec.
26050 (New::DoEmit): Update to handle delegates differently.
26052 (Invocation::FullMethodDesc): Fix major stupid bug thanks to me
26053 because of which we were printing out arguments in reverse order !
26055 * delegate.cs (VerifyMethod): Implement to check if the given method
26056 matches the delegate.
26058 (FullDelegateDesc): Implement.
26060 (VerifyApplicability): Implement.
26062 * expression.cs (Invocation::DoResolve): Update to accordingly handle
26063 delegate invocations too.
26065 (Invocation::Emit): Ditto.
26067 * ../errors/cs1593.cs : Added.
26069 * ../errors/cs1594.cs : Added.
26071 * delegate.cs (InstanceExpression, TargetMethod): New properties.
26073 2001-10-16 Ravi Pratap <ravi@ximian.com>
26075 * typemanager.cs (intptr_type): Core type for System.IntPtr
26077 (InitCoreTypes): Update for the same.
26079 (iasyncresult_type, asynccallback_type): Ditto.
26081 * delegate.cs (Populate): Fix to use System.Intptr as it is indeed
26084 * typemanager.cs (AddDelegateType): Store a pointer to the Delegate class
26087 * delegate.cs (ConstructorBuilder, InvokeBuilder, ...): New members to hold
26088 the builders for the 4 members of a delegate type :-)
26090 (Populate): Define the BeginInvoke and EndInvoke methods on the delegate
26093 * expression.cs (New::DoResolve): Implement guts for delegate creation.
26095 * ../errors/errors.txt : Update for an error (-11) which only we catch :-)
26097 2001-10-15 Miguel de Icaza <miguel@ximian.com>
26099 * statement.cs (Break::Emit): Implement.
26100 (Continue::Emit): Implement.
26102 (For::Emit): Track old being/end loops; Set Begin loop, ack end loop
26103 (While::Emit): Track old being/end loops; Set Begin loop, ack end loop
26104 (Do::Emit): Track old being/end loops; Set Begin loop, ack end loop
26105 (Foreach::Emit): Track old being/end loops; Set Begin loop, ack
26108 * codegen.cs (EmitContext::LoopEnd, EmitContext::LoopBegin): New
26109 properties that track the label for the current loop (begin of the
26110 loop and end of the loop).
26112 2001-10-15 Ravi Pratap <ravi@ximian.com>
26114 * delegate.cs (Emit): Get rid of it as there doesn't seem to be any ostensible
26115 use of emitting anything at all.
26117 * class.cs, rootcontext.cs : Get rid of calls to the same.
26119 * delegate.cs (DefineDelegate): Make sure the class we define is also sealed.
26121 (Populate): Define the constructor correctly and set the implementation
26124 * typemanager.cs (delegate_types): New hashtable to hold delegates that
26127 (AddDelegateType): Implement.
26129 (IsDelegateType): Implement helper method.
26131 * delegate.cs (DefineDelegate): Use AddDelegateType instead of AddUserType.
26133 * expression.cs (New::DoResolve): Check if we are trying to instantiate a delegate type
26134 and accordingly handle it.
26136 * delegate.cs (Populate): Take TypeContainer argument.
26137 Implement bits to define the Invoke method. However, I still haven't figured out
26138 how to take care of the native int bit :-(
26140 * cs-parser.jay (delegate_declaration): Fixed the bug that I had introduced :-)
26141 Qualify the name of the delegate, not its return type !
26143 * expression.cs (ImplicitReferenceConversion): Implement guts of implicit array
26146 (StandardConversionExists): Checking for array types turns out to be recursive.
26148 (ConvertReferenceExplicit): Implement array conversion.
26150 (ExplicitReferenceConversionExists): New method to determine precisely that :-)
26152 2001-10-12 Ravi Pratap <ravi@ximian.com>
26154 * cs-parser.jay (delegate_declaration): Store the fully qualified
26155 name as it is a type declaration.
26157 * delegate.cs (ReturnType, Name): Rename members to these. Make them
26160 (DefineDelegate): Renamed from Define. Does the same thing essentially,
26161 as TypeContainer::DefineType.
26163 (Populate): Method in which all the definition of the various methods (Invoke)
26166 (Emit): Emit any code, if necessary. I am not sure about this really, but let's
26169 (CloseDelegate): Finally creates the delegate.
26171 * class.cs (TypeContainer::DefineType): Update to define delegates.
26172 (Populate, Emit and CloseType): Do the same thing here too.
26174 * rootcontext.cs (ResolveTree, PopulateTypes, EmitCode, CloseTypes): Include
26175 delegates in all these operations.
26177 2001-10-14 Miguel de Icaza <miguel@ximian.com>
26179 * expression.cs: LocalTemporary: a new expression used to
26180 reference a temporary that has been created.
26182 * assign.cs: Handle PropertyAccess back here, so that we can
26183 provide the proper semantic access to properties.
26185 * expression.cs (Expression::ConvertReferenceExplicit): Implement
26186 a few more explicit conversions.
26188 * modifiers.cs: `NEW' modifier maps to HideBySig.
26190 * expression.cs (PropertyExpr): Make this into an
26191 ExpressionStatement, and support the EmitStatement code path.
26193 Perform get/set error checking, clean up the interface.
26195 * assign.cs: recognize PropertyExprs as targets, and if so, turn
26196 them into toplevel access objects.
26198 2001-10-12 Miguel de Icaza <miguel@ximian.com>
26200 * expression.cs: PropertyExpr::PropertyExpr: use work around the
26203 * typemanager.cs: Keep track here of our PropertyBuilders again to
26204 work around lameness in SRE.
26206 2001-10-11 Miguel de Icaza <miguel@ximian.com>
26208 * expression.cs (LValue::LValueResolve): New method in the
26209 interface, used to perform a second resolution pass for LValues.
26211 (This::DoResolve): Catch the use of this in static methods.
26213 (This::LValueResolve): Implement.
26215 (This::Store): Remove warning, assigning to `this' in structures
26218 (Invocation::Emit): Deal with invocation of
26219 methods on value types. We need to pass the address to structure
26220 methods rather than the object itself. (The equivalent code to
26221 emit "this" for structures leaves the entire structure on the
26222 stack instead of a pointer to it).
26224 (ParameterReference::DoResolve): Compute the real index for the
26225 argument based on whether the method takes or not a `this' pointer
26226 (ie, the method is static).
26228 * codegen.cs (EmitContext::GetTemporaryStorage): Used to store
26229 value types returned from functions when we need to invoke a
26230 method on the sturcture.
26233 2001-10-11 Ravi Pratap <ravi@ximian.com>
26235 * class.cs (TypeContainer::DefineType): Method to actually do the business of
26236 defining the type in the Modulebuilder or Typebuilder. This is to take
26237 care of nested types which need to be defined on the TypeBuilder using
26238 DefineNestedMethod.
26240 (TypeContainer::GetClassBases): Implement. Essentially the code from the
26241 methods in RootContext, only ported to be part of TypeContainer.
26243 (TypeContainer::GetInterfaceOrClass): Ditto.
26245 (TypeContainer::LookupInterfaceOrClass, ::MakeFQN): Ditto.
26247 * interface.cs (Interface::DefineInterface): New method. Does exactly
26248 what RootContext.CreateInterface did earlier, only it takes care of nested types
26251 (Interface::GetInterfaces): Move from RootContext here and port.
26253 (Interface::GetInterfaceByName): Same here.
26255 * rootcontext.cs (ResolveTree): Re-write.
26257 (PopulateTypes): Re-write.
26259 * class.cs (TypeContainer::Populate): Populate nested types too.
26260 (TypeContainer::Emit): Emit nested members too.
26262 * typemanager.cs (AddUserType): Do not make use of the FullName property,
26263 instead just use the name argument passed in as it is already fully
26266 (FindMembers): Check in the Builders to TypeContainer mapping instead of the name
26267 to TypeContainer mapping to see if a type is user-defined.
26269 * class.cs (TypeContainer::CloseType): Implement.
26271 (TypeContainer::DefineDefaultConstructor): Use Basename, not Name while creating
26272 the default constructor.
26274 (TypeContainer::Populate): Fix minor bug which led to creating default constructors
26277 (Constructor::IsDefault): Fix up logic to determine if it is the default constructor
26279 * interface.cs (CloseType): Create the type here.
26281 * rootcontext.cs (CloseTypes): Re-write to recursively close types by running through
26284 Remove all the methods which are now in TypeContainer.
26286 2001-10-10 Ravi Pratap <ravi@ximian.com>
26288 * delegate.cs (Define): Re-write bits to define the delegate
26291 2001-10-10 Miguel de Icaza <miguel@ximian.com>
26293 * makefile: Renamed the compiler to `mcs.exe' instead of compiler.exe
26295 * expression.cs (ImplicitReferenceConversion): handle null as well
26296 as a source to convert to any reference type.
26298 * statement.cs (Return): Perform any implicit conversions to
26299 expected return type.
26301 Validate use of return statement.
26303 * codegen.cs (EmitContext): Pass the expected return type here.
26305 * class.cs (Method, Constructor, Property): Pass expected return
26306 type to EmitContext.
26308 2001-10-09 Miguel de Icaza <miguel@ximian.com>
26310 * expression.cs: Make DoResolve take an EmitContext instead of a
26313 Replaced `l' and `location' for `loc', for consistency.
26315 (Error, Warning): Remove unneeded Tc argument.
26317 * assign.cs, literal.cs, constant.cs: Update to new calling
26320 * codegen.cs: EmitContext now contains a flag indicating whether
26321 code is being generated in a static method or not.
26323 * cs-parser.jay: DecomposeQI, new function that replaces the old
26324 QualifiedIdentifier. Now we always decompose the assembled
26325 strings from qualified_identifier productions into a group of
26328 2001-10-08 Miguel de Icaza <miguel@ximian.com>
26330 * rootcontext.cs: Deal with field-less struct types correctly now
26331 by passing the size option to Define Type.
26333 * class.cs: Removed hack that created one static field.
26335 2001-10-07 Miguel de Icaza <miguel@ximian.com>
26337 * statement.cs: Moved most of the code generation here.
26339 2001-10-09 Ravi Pratap <ravi@ximian.com>
26341 * expression.cs (New::DoResolve): Revert changes for array creation, doesn't
26344 (ElementAccess): Remove useless bits for now - keep checks as the spec
26347 2001-10-08 Ravi Pratap <ravi@ximian.com>
26349 * expression.cs (ElementAccess::DoResolve): Remove my crap code
26350 and start performing checks according to the spec.
26352 2001-10-07 Ravi Pratap <ravi@ximian.com>
26354 * cs-parser.jay (type_suffix*): Remove - they are redundant. Use
26355 rank_specifiers instead.
26357 (rank_specifiers): Change the order in which the rank specifiers are stored
26359 (local_variable_declaration): Use opt_rank_specifier instead of type_suffixes.
26361 * expression.cs (ElementAccess): Implement the LValue interface too.
26363 2001-10-06 Ravi Pratap <ravi@ximian.com>
26365 * expression.cs (ConvertExplicitStandard): Add. Same as ConvertExplicit
26366 except that user defined conversions are not included.
26368 (UserDefinedConversion): Update to use the ConvertExplicitStandard to
26369 perform the conversion of the return type, if necessary.
26371 (New::DoResolve): Check whether we are creating an array or an object
26372 and accordingly do the needful.
26374 (New::Emit): Same here.
26376 (New::DoResolve): Implement guts of array creation.
26378 (New::FormLookupType): Helper function.
26380 2001-10-07 Miguel de Icaza <miguel@ximian.com>
26382 * codegen.cs: Removed most of the code generation here, and move the
26383 corresponding code generation bits to the statement classes.
26385 Added support for try/catch/finalize and throw.
26387 * cs-parser.jay: Added support for try/catch/finalize.
26389 * class.cs: Catch static methods having the flags override,
26390 virtual or abstract.
26392 * expression.cs (UserCast): This user cast was not really doing
26393 what it was supposed to do. Which is to be born in fully resolved
26394 state. Parts of the resolution were being performed at Emit time!
26398 2001-10-05 Miguel de Icaza <miguel@ximian.com>
26400 * expression.cs: Implicity convert the result from UserCast.
26402 2001-10-05 Ravi Pratap <ravi@ximian.com>
26404 * expression.cs (Expression::FindMostEncompassingType): Fix bug which
26405 prevented it from working correctly.
26407 (ConvertExplicit): Make the first try, a call to ConvertImplicitStandard, not
26408 merely ConvertImplicit.
26410 2001-10-05 Miguel de Icaza <miguel@ximian.com>
26412 * typemanager.cs: Make the LookupTypeContainer function static,
26413 and not per-instance.
26415 * class.cs: Make static FindMembers (the one that takes a Type
26418 * codegen.cs: Add EmitForeach here.
26420 * cs-parser.jay: Make foreach a toplevel object instead of the
26421 inline expansion, as we need to perform semantic analysis on it.
26423 2001-10-05 Ravi Pratap <ravi@ximian.com>
26425 * expression.cs (Expression::ImplicitUserConversion): Rename to
26426 UserDefinedConversion.
26428 (Expression::UserDefinedConversion): Take an extra argument specifying
26429 whether we look for explicit user conversions too.
26431 (Expression::ImplicitUserConversion): Make it a call to UserDefinedConversion.
26433 (UserDefinedConversion): Incorporate support for user defined explicit conversions.
26435 (ExplicitUserConversion): Make it a call to UserDefinedConversion
26436 with the appropriate arguments.
26438 * cs-parser.jay (cast_expression): Record location too.
26440 * expression.cs (Cast): Record location info.
26442 (Expression::ConvertExplicit): Take location argument.
26444 (UserImplicitCast): Change name to UserCast. Take an extra constructor argument
26445 to determine if we are doing explicit conversions.
26447 (UserCast::Emit): Update accordingly.
26449 (Expression::ConvertExplicit): Report an error if everything fails.
26451 * ../errors/cs0030.cs : Add.
26453 2001-10-04 Miguel de Icaza <miguel@ximian.com>
26455 * modifiers.cs: If the ABSTRACT keyword is present, also set the
26456 virtual and newslot bits.
26458 * class.cs (TypeContainer::RegisterRequiredImplementations):
26459 Record methods we need.
26461 (TypeContainer::MakeKey): Helper function to make keys for
26462 MethodBases, since the Methodbase key is useless.
26464 (TypeContainer::Populate): Call RegisterRequiredImplementations
26465 before defining the methods.
26467 Create a mapping for method_builders_to_methods ahead of time
26468 instead of inside a tight loop.
26470 (::RequireMethods): Accept an object as the data to set into the
26471 hashtable so we can report interface vs abstract method mismatch.
26473 2001-10-03 Miguel de Icaza <miguel@ximian.com>
26475 * report.cs: Make all of it static.
26477 * rootcontext.cs: Drop object_type and value_type computations, as
26478 we have those in the TypeManager anyways.
26480 Drop report instance variable too, now it is a global.
26482 * driver.cs: Use try/catch on command line handling.
26484 Add --probe option to debug the error reporting system with a test
26487 * report.cs: Add support for exiting program when a probe
26488 condition is reached.
26490 2001-10-03 Ravi Pratap <ravi@ximian.com>
26492 * expression.cs (Binary::DoNumericPromotions): Fix the case when
26493 we do a forcible conversion regardless of type, to check if
26494 ForceConversion returns a null.
26496 (Binary::error19): Use location to report error.
26498 (Unary::error23): Use location here too.
26500 * ../errors/cs0019.cs : Check in.
26502 * ../errors/cs0023.cs : Check in.
26504 * expression.cs (Expression.MemberLookup): Return null for a rather esoteric
26505 case of a non-null MethodInfo object with a length of 0 !
26507 (Binary::ResolveOperator): Flag error if overload resolution fails to find
26508 an applicable member - according to the spec :-)
26509 Also fix logic to find members in base types.
26511 (Unary::ResolveOperator): Same here.
26513 (Unary::report23): Change name to error23 and make first argument a TypeContainer
26514 as I was getting thoroughly confused between this and error19 :-)
26516 * expression.cs (Expression::ImplicitUserConversion): Re-write fully
26517 (::FindMostEncompassedType): Implement.
26518 (::FindMostEncompassingType): Implement.
26519 (::StandardConversionExists): Implement.
26521 (UserImplicitCast): Re-vamp. We now need info about most specific
26522 source and target types so that we can do the necessary conversions.
26524 (Invocation::MakeUnionSet): Completely re-write to make sure we form a proper
26525 mathematical union with no duplicates.
26527 2001-10-03 Miguel de Icaza <miguel@ximian.com>
26529 * rootcontext.cs (RootContext::PopulateTypes): Populate containers
26530 in order from base classes to child classes, so that we can in
26531 child classes look up in our parent for method names and
26532 attributes (required for handling abstract, virtual, new, override
26533 constructs: we need to instrospect our base class, and if we dont
26534 populate the classes in order, the introspection might be
26535 incorrect. For example, a method could query its parent before
26536 the parent has any methods and would determine that the parent has
26537 no abstract methods (while it could have had them)).
26539 (RootContext::CreateType): Record the order in which we define the
26542 2001-10-02 Miguel de Icaza <miguel@ximian.com>
26544 * class.cs (TypeContainer::Populate): Also method definitions can
26545 fail now, keep track of this.
26547 (TypeContainer::FindMembers): Implement support for
26548 DeclaredOnly/noDeclaredOnly flag.
26550 (Constructor::Emit) Return the ConstructorBuilder.
26552 (Method::Emit) Return the MethodBuilder.
26553 Check for abstract or virtual methods to be public.
26555 * rootcontext.cs (RootContext::CreateType): Register all the
26556 abstract methods required for the class to be complete and the
26557 interface methods that must be implemented.
26559 * cs-parser.jay: Report error 501 (method requires body if it is
26560 not marked abstract or extern).
26562 * expression.cs (TypeOf::Emit): Implement.
26564 * typemanager.cs: runtime_handle_type, new global type.
26566 * class.cs (Property::Emit): Generate code for properties.
26568 2001-10-02 Ravi Pratap <ravi@ximian.com>
26570 * expression.cs (Unary::ResolveOperator): Find operators on base type
26571 too - we now conform exactly to the spec.
26573 (Binary::ResolveOperator): Same here.
26575 * class.cs (Operator::Define): Fix minor quirk in the tests.
26577 * ../errors/cs0215.cs : Added.
26579 * ../errors/cs0556.cs : Added.
26581 * ../errors/cs0555.cs : Added.
26583 2001-10-01 Miguel de Icaza <miguel@ximian.com>
26585 * cs-tokenizer.cs: Reimplemented Location to be a struct with a
26586 single integer which is really efficient
26588 2001-10-01 Ravi Pratap <ravi@ximian.com>
26590 * expression.cs (Expression::ImplicitUserConversion): Use location
26591 even in the case when we are examining True operators.
26593 * class.cs (Operator::Define): Perform extensive checks to conform
26594 with the rules for operator overloading in the spec.
26596 * expression.cs (Expression::ImplicitReferenceConversion): Implement
26597 some of the other conversions mentioned in the spec.
26599 * typemanager.cs (array_type): New static member for the System.Array built-in
26602 (cloneable_interface): For System.ICloneable interface.
26604 * driver.cs (Driver::Driver): Initialize TypeManager's core types even before
26605 we start resolving the tree and populating types.
26607 * ../errors/errors.txt : Update for error numbers -7, -8, -9, -10
26609 2001-10-01 Miguel de Icaza <miguel@ximian.com>
26611 * expression.cs (Expression::ExprClassFromMemberInfo,
26612 Expression::Literalize): Create literal expressions from
26613 FieldInfos which are literals.
26615 (ConvertNumericExplicit, ImplicitNumericConversion): Fix a few
26616 type casts, because they were wrong. The test suite in tests
26619 (ImplicitNumericConversion): ushort to ulong requires a widening
26622 Int32 constant to long requires widening cast as well.
26624 * literal.cs (LongLiteral::EmitLong): Do not generate i4 constants
26625 for integers because the type on the stack is not i4.
26627 2001-09-30 Miguel de Icaza <miguel@ximian.com>
26629 * expression.cs (report118): require location argument.
26631 * parameter.cs: Do not dereference potential null value.
26633 * class.cs: Catch methods that lack the `new' keyword when
26634 overriding a name. Report warnings when `new' is used without
26635 anything being there to override.
26637 * modifiers.cs: Handle `NEW' as MethodAttributes.NewSlot.
26639 * class.cs: Only add constructor to hashtable if it is non-null
26640 (as now constructors can fail on define).
26642 (TypeManager, Class, Struct): Take location arguments.
26644 Catch field instance initialization in structs as errors.
26646 accepting_filter: a new filter for FindMembers that is static so
26647 that we dont create an instance per invocation.
26649 (Constructor::Define): Catch errors where a struct constructor is
26652 * cs-parser.jay: Pass location information for various new
26655 * delegate.cs (Delegate): take a location argument.
26657 * driver.cs: Do not call EmitCode if there were problesm in the
26658 Definition of the types, as many Builders wont be there.
26660 * decl.cs (Decl::Decl): Require a location argument.
26662 * cs-tokenizer.cs: Handle properly hex constants that can not fit
26663 into integers, and find the most appropiate integer for it.
26665 * literal.cs: Implement ULongLiteral.
26667 * rootcontext.cs: Provide better information about the location of
26668 failure when CreateType fails.
26670 2001-09-29 Miguel de Icaza <miguel@ximian.com>
26672 * rootcontext.cs (RootContext::PopulateTypes): Populates structs
26675 * expression.cs (Binary::CheckShiftArguments): Add missing type
26677 (Binary::ResolveOperator): Add type to the logical and and logical
26678 or, Bitwise And/Or and Exclusive Or code paths, it was missing
26681 (Binary::DoNumericPromotions): In the case where either argument
26682 is ulong (and most signed types combined with ulong cause an
26683 error) perform implicit integer constant conversions as well.
26685 2001-09-28 Miguel de Icaza <miguel@ximian.com>
26687 * expression.cs (UserImplicitCast): Method should always be
26689 (Invocation::BetterConversion): Simplified test for IntLiteral.
26691 (Expression::ImplicitNumericConversion): Split this routine out.
26692 Put the code that performs implicit constant integer conversions
26695 (Expression::Resolve): Become a wrapper around DoResolve so we can
26696 check eclass and type being set after resolve.
26698 (Invocation::Badness): Remove this dead function
26700 (Binary::ResolveOperator): Do not compute the expensive argumnets
26701 unless we have a union for it.
26703 (Probe::Emit): Is needs to do an isinst and then
26704 compare against null.
26706 (::CanConvert): Added Location argument. If the Location argument
26707 is null (Location.Null), then we do not report errors. This is
26708 used by the `probe' mechanism of the Explicit conversion. We do
26709 not want to generate an error for something that the user
26710 explicitly requested to be casted. But the pipeline for an
26711 explicit cast first tests for potential implicit casts.
26713 So for now, if the Location is null, it means `Probe only' to
26714 avoid adding another argument. Might have to revise this
26717 (ClassCast): New class used to type cast objects into arbitrary
26718 classes (used in Explicit Reference Conversions).
26720 Implement `as' as well.
26722 Reverted all the patches from Ravi below: they were broken:
26724 * The use of `level' as a mechanism to stop recursive
26725 invocations is wrong. That was there just to catch the
26726 bug with a strack trace but not as a way of addressing
26729 To fix the problem we have to *understand* what is going
26730 on and the interactions and come up with a plan, not
26731 just get things going.
26733 * The use of the type conversion cache that I proposed
26734 last night had an open topic: How does this work across
26735 protection domains. A user defined conversion might not
26736 be public in the location where we are applying the
26737 conversion, a different conversion might be selected
26738 (ie, private A->B (better) but public B->A (worse),
26739 inside A, A->B applies, but outside it, B->A will
26742 * On top of that (ie, even if the above is solved),
26743 conversions in a cache need to be abstract. Ie, `To
26744 convert from an Int to a Short use an OpcodeCast', not
26745 `To convert from an Int to a Short use the OpcodeCast on
26746 the variable 5' (which is what this patch was doing).
26748 2001-09-28 Ravi Pratap <ravi@ximian.com>
26750 * expression.cs (Invocation::ConversionExists): Re-write to use
26751 the conversion cache
26753 (Expression::ConvertImplicit): Automatic bailing out if level != 0. Also
26754 cache all conversions done, not just user-defined ones.
26756 (Invocation::BetterConversion): The real culprit. Use ConversionExists
26757 to determine if a conversion exists instead of acutually trying to
26758 perform the conversion. It's faster too.
26760 (Expression::ConvertExplicit): Modify to use ConversionExists to check
26761 and only then attempt the implicit conversion.
26763 2001-09-28 Ravi Pratap <ravi@ximian.com>
26765 * expression.cs (ConvertImplicit): Use a cache for conversions
26766 already found. Check level of recursion and bail out if necessary.
26768 2001-09-28 Miguel de Icaza <miguel@ximian.com>
26770 * typemanager.cs (string_concat_string_string, string_concat_object_object):
26771 Export standard methods that we expect for string operations.
26773 * statement.cs (Block::UsageWarning): Track usage of variables and
26774 report the errors for not used variables.
26776 * expression.cs (Conditional::Resolve, ::Emit): Implement ?:
26779 2001-09-27 Miguel de Icaza <miguel@ximian.com>
26781 * codegen.cs: remove unnneded code
26783 * expression.cs: Removed BuiltinTypeAccess class
26785 Fix the order in which implicit conversions are
26788 The previous fixed dropped support for boxed conversions (adding a
26789 test to the test suite now)
26791 (UserImplicitCast::CanConvert): Remove test for source being null,
26792 that code is broken. We should not feed a null to begin with, if
26793 we do, then we should track the bug where the problem originates
26794 and not try to cover it up here.
26796 Return a resolved expression of type UserImplicitCast on success
26797 rather than true/false. Ravi: this is what I was talking about,
26798 the pattern is to use a static method as a "constructor" for
26801 Also, do not create arguments until the very last minute,
26802 otherwise we always create the arguments even for lookups that
26803 will never be performed.
26805 (UserImplicitCast::Resolve): Eliminate, objects of type
26806 UserImplicitCast are born in a fully resolved state.
26808 * typemanager.cs (InitCoreTypes): Init also value_type
26809 (System.ValueType).
26811 * expression.cs (Cast::Resolve): First resolve the child expression.
26813 (LValue): Add new method AddressOf to be used by
26816 Change the argument of Store to take an EmitContext instead of an
26817 ILGenerator, because things like FieldExpr need to be able to call
26818 their children expression to generate the instance code.
26820 (Expression::Error, Expression::Warning): Sugar functions for
26823 (Expression::MemberLookup): Accept a TypeContainer instead of a
26824 Report as the first argument.
26826 (Expression::ResolvePrimary): Killed. I still want to improve
26827 this as currently the code is just not right.
26829 (Expression::ResolveMemberAccess): Simplify, but it is still
26832 (Unary::Resolve): Catch errors in AddressOf operators.
26834 (LocalVariableReference::Emit, ::Store, ::AddressOf): typecast
26835 index to a byte for the short-version, or the compiler will choose
26836 the wrong Emit call, which generates the wrong data.
26838 (ParameterReference::Emit, ::Store): same.
26840 (FieldExpr::AddressOf): Implement.
26842 * typemanager.cs: TypeManager: made public variable instead of
26845 * driver.cs: document --fatal.
26847 * report.cs (ErrorMessage, WarningMessage): new names for the old
26848 Error and Warning classes.
26850 * cs-parser.jay (member_access): Turn built-in access to types
26851 into a normal simplename
26853 2001-09-27 Ravi Pratap <ravi@ximian.com>
26855 * expression.cs (Invocation::BetterConversion): Fix to cope
26856 with q being null, since this was introducing a bug.
26858 * expression.cs (ConvertImplicit): Do built-in conversions first.
26860 2001-09-27 Ravi Pratap <ravi@ximian.com>
26862 * expression.cs (UserImplicitCast::Resolve): Fix bug.
26864 2001-09-27 Ravi Pratap <ravi@ximian.com>
26866 * class.cs (TypeContainer::AddConstructor): Fix a stupid bug
26867 I had introduced long ago (what's new ?).
26869 * expression.cs (UserImplicitCast::CanConvert): Static method to do
26870 the work of all the checking.
26871 (ConvertImplicit): Call CanConvert and only then create object if necessary.
26872 (UserImplicitCast::CanConvert, ::Resolve): Re-write.
26874 (Unary::Operator): Rename Add and Subtract to Addition and Subtraction because
26875 that is the right way.
26877 (Invocation::MakeUnionSet): Convenience function to make unions of sets for
26878 overloading resolution. Use everywhere instead of cutting and pasting code.
26880 (Binary::ResolveOperator): Use MakeUnionSet.
26882 (UserImplicitCast::CanConvert, ::Resolve): Update to take care of the case when
26883 we have to convert to bool types. Not complete yet.
26885 2001-09-27 Miguel de Icaza <miguel@ximian.com>
26887 * typemanager.cs (TypeManager::CSharpName): support ushort.
26889 * expression.cs (Expression::TryImplicitIntConversion): Attempts
26890 to provide an expression that performsn an implicit constant int
26891 conversion (section 6.1.6).
26892 (Expression::ConvertImplicitRequired): Reworked to include
26893 implicit constant expression conversions.
26895 (Expression::ConvertNumericExplicit): Finished.
26897 (Invocation::Emit): If InstanceExpression is null, then it means
26898 that we perform a call on this.
26900 2001-09-26 Miguel de Icaza <miguel@ximian.com>
26902 * expression.cs (Unary::Emit): Remove some dead code.
26903 (Probe): Implement Resolve and Emit for `is'.
26904 (Expression::ConvertImplicitRequired): Attempt to do constant
26905 expression conversions here. Maybe should be moved to
26906 ConvertImplicit, but I am not sure.
26907 (Expression::ImplicitLongConstantConversionPossible,
26908 Expression::ImplicitIntConstantConversionPossible): New functions
26909 that tell whether is it possible to apply an implicit constant
26910 expression conversion.
26912 (ConvertNumericExplicit): Started work on explicit numeric
26915 * cs-parser.jay: Update operator constants.
26917 * parameter.cs (Parameters::GetParameterInfo): Hook up VerifyArgs
26918 (Parameters::GetSignature): Hook up VerifyArgs here.
26919 (Parameters::VerifyArgs): Verifies that no two arguments have the
26922 * class.cs (Operator): Update the operator names to reflect the
26923 ones that the spec expects (as we are just stringizing the
26926 * expression.cs (Unary::ResolveOperator): Fix bug: Use
26927 MethodInfo's ReturnType instead of LookupMethodByBuilder as the
26928 previous usage did only work for our methods.
26929 (Expression::ConvertImplicit): Handle decimal implicit numeric
26930 conversions as well.
26931 (Expression::InternalTypeConstructor): Used to invoke constructors
26932 on internal types for default promotions.
26934 (Unary::Emit): Implement special handling for the pre/post
26935 increment/decrement for overloaded operators, as they need to have
26936 the same semantics as the other operators.
26938 (Binary::ResolveOperator): ditto.
26939 (Invocation::ConversionExists): ditto.
26940 (UserImplicitCast::Resolve): ditto.
26942 2001-09-26 Ravi Pratap <ravi@ximian.com>
26944 * expression.cs (Unary::Emit and Binary::Emit): If we have an overloaded
26945 operator, return after emitting body. Regression tests pass again !
26947 * expression.cs (ConvertImplicit): Take TypeContainer as first argument
26948 (Unary::ForceConversion, Binary::ForceConversion): Ditto.
26949 (Invocation::OverloadResolve): Ditto.
26950 (Invocation::BetterFunction, BetterConversion, ConversionExists): Ditto.
26952 * everywhere : update calls to the above methods accordingly.
26954 2001-09-26 Miguel de Icaza <miguel@ximian.com>
26956 * assign.cs (Assign): Make it inherit from ExpressionStatement.
26958 * expression.cs (ExpressionStatement): New base class used for
26959 expressions that can appear in statements, so that we can provide
26960 an alternate path to generate expression that do not leave a value
26963 (Expression::Emit, and all the derivatives): We no longer return
26964 whether a value is left on the stack or not. Every expression
26965 after being emitted leaves a single value on the stack.
26967 * codegen.cs (EmitContext::EmitStatementExpression): Use the
26968 facilties of ExpressionStatement if possible.
26970 * cs-parser.jay: Update statement_expression.
26972 2001-09-25 Miguel de Icaza <miguel@ximian.com>
26974 * driver.cs: Change the wording of message
26976 2001-09-25 Ravi Pratap <ravi@ximian.com>
26978 * expression.cs (Binary::ResolveOperator): Had forgottten to set
26979 the type of the expression to the return type of the method if
26980 we have an overloaded operator match ! The regression tests pass again !
26981 (Unary::ResolveOperator): Ditto.
26983 * expression.cs (Invocation::ConversionExists): Correct the member lookup
26984 to find "op_Implicit", not "implicit" ;-)
26985 (UserImplicitCast): New class to take care of user-defined implicit conversions.
26986 (ConvertImplicit, ForceConversion): Take TypeContainer argument
26988 * everywhere : Correct calls to the above accordingly.
26990 * expression.cs (UserImplicitCast::Resolve, ::Emit): Implement.
26991 (ConvertImplicit): Do user-defined conversion if it exists.
26993 2001-09-24 Miguel de Icaza <miguel@ximian.com>
26995 * assign.cs: track location.
26996 (Resolve): Use implicit conversions on assignment.
26998 * literal.cs: Oops. Not good, Emit of short access values should
26999 pass (Bytes) or the wrong argument will be selected.
27001 * expression.cs (Unary::Emit): Emit code for -expr.
27003 (Unary::ResolveOperator): Handle `Substract' for non-constants
27004 (substract from zero from the non-constants).
27005 Deal with Doubles as well.
27007 (Expression::ConvertImplicitRequired): New routine that reports an
27008 error if no implicit conversion exists.
27010 (Invocation::OverloadResolve): Store the converted implicit
27011 expressions if we make them
27013 2001-09-24 Ravi Pratap <ravi@ximian.com>
27015 * class.cs (ConstructorInitializer): Take a Location argument.
27016 (ConstructorBaseInitializer): Same here.
27017 (ConstructorThisInitializer): Same here.
27019 * cs-parser.jay : Update all calls accordingly.
27021 * expression.cs (Unary, Binary, New): Take location argument.
27022 Update accordingly everywhere.
27024 * cs-parser.jay : Update all calls to the above to take a location
27027 * class.cs : Ditto.
27029 2001-09-24 Ravi Pratap <ravi@ximian.com>
27031 * expression.cs (Invocation::BetterFunction): Take TypeContainer argument
27032 (Invocation::BetterConversion): Same here
27033 (Invocation::ConversionExists): Ditto.
27035 (Invocation::ConversionExists): Implement.
27037 2001-09-22 Ravi Pratap <ravi@ximian.com>
27039 * expression.cs (OverloadResolve): Improve some more to catch errors 1502 and 1503
27040 Also take an additional TypeContainer argument.
27042 * All over : Pass in TypeContainer as argument to OverloadResolve.
27044 * typemanager.cs (CSharpName): Update to check for the string type and return
27047 * expression.cs (Invocation::FullMethodDesc): New static method to return a string fully describing
27050 2001-09-21 Ravi Pratap <ravi@ximian.com>
27052 * expression.cs (Invocation::OverloadResolve): Re-write to conform more to the spec.
27053 (Invocation::BetterFunction): Implement.
27054 (Invocation::BetterConversion): Implement.
27055 (Invocation::ConversionExists): Skeleton, no implementation yet.
27057 Okay, things work fine !
27059 2001-09-21 Miguel de Icaza <miguel@ximian.com>
27061 * typemanager.cs: declare and load enum_type, delegate_type and
27064 * expression.cs (Expression::Emit): Now emit returns a value that
27065 tells whether a value is left on the stack or not. This strategy
27066 might be reveted tomorrow with a mechanism that would address
27067 multiple assignments.
27068 (Expression::report118): Utility routine to report mismatches on
27071 (Unary::Report23): Report impossible type/operator combination
27074 (Unary::IsIncrementableNumber): Whether the type can be
27075 incremented or decremented with add.
27076 (Unary::ResolveOperator): Also allow enumerations to be bitwise
27078 (Unary::ResolveOperator): Implement ++, !, ~,
27080 (Invocation::Emit): Deal with new Emit convetion.
27082 * All Expression derivatives: Updated their Emit method to return
27083 whether they leave values on the stack or not.
27085 * codegen.cs (CodeGen::EmitStatement): Pop values left on the
27086 stack for expressions that are statements.
27088 2001-09-20 Miguel de Icaza <miguel@ximian.com>
27090 * expression.cs (LValue): New interface. Must be implemented by
27092 (LocalVariableReference, ParameterReference, FieldExpr): Implement
27095 * assign.cs (Assign::Emit, Assign::Resolve): Use new LValue
27096 interface for generating code, simplifies the code.
27098 2001-09-20 Ravi Pratap <ravi@ximian.com>
27100 * expression.cs (everywhere): Comment out return statements in ::Resolve
27101 methods to avoid the warnings.
27103 2001-09-20 Miguel de Icaza <miguel@ximian.com>
27105 * driver.cs (parse): Report error 2001 if we can not open the
27108 * expression.cs (SimpleName::ResolveSimpleName): Error if we can
27111 * cs-parser.jay (QualifierIdentifier): Pass location to SimpleName
27114 * statement.cs (Block::EmitMeta): Reuse the count across all the variables,
27115 otherwise nested blocks end up with the same index.
27117 * codegen.cs (CodeGen::EmitTopBlock): Pass initial sequence
27119 * expression.cs: Instead of having FIXMEs in the Resolve
27120 functions, throw exceptions so it is obvious that we are facing a
27123 * cs-parser.jay (invocation_expression): Pass Location information.
27125 * codegen.cs (CodeGen::Save, CodeGen::CodeGen, CodeGen::Basename):
27126 Use a basename for those routines because .NET does not like paths
27129 * class.cs (TypeContainer::AddMethod): Do not call DefineName if the name was
27132 2001-09-19 Miguel de Icaza <miguel@ximian.com>
27134 * typemanager.cs (TypeManager::CoreLookupType): A function to make sure that we
27135 are loading the correct data types (throws an exception if not).
27136 (TypeManager::InitCoreTypes): Use CoreLookupType
27138 * expression.cs (Unary::ResolveOperator): return the child
27139 expression for expressions which are just +expr.
27140 (Unary::ResolveOperator): Return negative literals for -LITERAL
27141 expressions (otherwise they are Unary {Literal}).
27142 (Invocation::Badness): Take into account `Implicit constant
27143 expression conversions'.
27145 * literal.cs (LongLiteral): Implement long literal class.
27146 (IntLiteral): export the `Value' of the intliteral.
27148 2001-09-19 Ravi Pratap <ravi@ximian.com>
27150 * expression.cs (Binary::Emit): Finally get the emission right ! Woo!
27152 * class.cs (Operator::Define): Change the methodname prefix to 'op_'
27153 instead of 'Operator'
27155 * expression.cs (Binary::ResolveOperator): Update accordingly.
27156 (Unary::Operator): Change names to 'Add' and 'Subtract' instead 'Plus'
27159 * cs-parser.jay (unary_expression): Update to use the new names.
27161 * gen-treedump.cs (GetUnary): Same here.
27163 * expression.cs (Unary::Resolve): Implement.
27164 (Binary::ResolveOperator): Re-write bits to quietly continue if no overloaded
27165 operators are found instead of making noise ;-)
27166 (Unary::ResolveOperator): New method to do precisely the same thing which
27167 Binary::ResolveOperator does for Binary expressions.
27168 (Unary.method, .Arguments): Add.
27169 (Unary::OperName): Implement.
27170 (Unary::ForceConversion): Copy and Paste !
27172 * class.cs (Operator::Define): Fix a small bug for the case when we have
27175 * expression.cs (Unary::Emit): Implement. Need to find the right Opcodes
27176 for the inbuilt operators. Only overloading works for now ;-)
27178 2001-09-18 Miguel de Icaza <miguel@ximian.com>
27180 * expression.cs (CheckedExpr::Resolve, CheckedExpr::Emit,
27181 UnCheckedExpr::Resolve, UnCheckedExpr::Emit): Implement.
27183 * expression.cs (This::Emit): Implement.
27184 (This::Resolve): Implement.
27185 (TypeOf:Resolve): Implement.
27186 (Expression::ResolveSimpleName): Add an implicit this to instance
27188 (MemberAccess::Resolve): Deal with Parameters and Fields.
27189 Bind instance variable to Field expressions.
27190 (FieldExpr::Instance): New field used to track the expression that
27191 represents the object instance.
27192 (FieldExpr::Resolve): Track potential errors from MemberLookup not
27194 (FieldExpr::Emit): Implement.
27196 * codegen.cs (EmitIf, EmitStatement, EmitBlock): Propagate whether
27197 the last instruction contains a return opcode to avoid generating
27198 the last `ret' instruction (this generates correct code, and it is
27199 nice to pass the peverify output).
27201 * class.cs (TypeContainer::EmitFieldInitializers): Implement field
27202 initializer for static and instance variables.
27203 (Constructor::Emit): Allow initializer to be null in the case of
27204 static constructors. Only emit initializer for instance
27207 (TypeContainer::FindMembers): Return a null array if there are no
27210 Also fix the code for the MemberTypes.Method branch, as it was not
27211 scanning that for operators (or tried to access null variables before).
27213 * assign.cs (Assign::Emit): Handle instance and static fields.
27217 * driver.cs: Stop compilation if there are parse errors.
27219 * cs-parser.jay (constructor_declaration): Provide default base
27220 initializer for non-static constructors.
27221 (constructor_declarator): Do not provide a default base
27222 initializers if none was specified.
27223 Catch the fact that constructors should not have parameters.
27225 * class.cs: Do not emit parent class initializers for static
27226 constructors, that should be flagged as an error.
27228 2001-09-18 Ravi Pratap <ravi@ximian.com>
27230 * class.cs (RegisterMethodBuilder): Remove : it's unnecessary.
27231 Move back code into TypeContainer::Populate.
27233 2001-09-18 Ravi Pratap <ravi@ximian.com>
27235 * class.cs (TypeContainer::AddConstructor): Fix the check to
27236 compare against Name, not Basename.
27237 (Operator::OpType): Change Plus and Minus to Add and Subtract.
27239 * cs-parser.jay : Update accordingly.
27241 * class.cs (TypeContainer::FindMembers): For the case where we are searching
27242 for methods, don't forget to look into the operators too.
27243 (RegisterMethodBuilder): Helper method to take care of this for
27244 methods, constructors and operators.
27245 (Operator::Define): Completely revamp.
27246 (Operator.OperatorMethod, MethodName): New fields.
27247 (TypeContainer::Populate): Move the registering of builders into
27248 RegisterMethodBuilder.
27249 (Operator::Emit): Re-write.
27251 * expression.cs (Binary::Emit): Comment out code path to emit method
27252 invocation stuff for the case when we have a user defined operator. I am
27253 just not able to get it right !
27255 2001-09-17 Miguel de Icaza <miguel@ximian.com>
27257 * expression.cs (Expression::OverloadResolve): Drop TypeContainer
27260 (Expression::MemberLookup): Provide a version that allows to
27261 specify the MemberTypes and BindingFlags.
27263 * statement.cs (Block::GetVariableInfo): Forgot to recurse here,
27264 so it was not fetching variable information from outer blocks.
27266 * modifiers.cs: (Modifiers::TypeAttr): Invert condition on
27267 Beforefieldinit as it was buggy.
27269 * rootcontext.cs (::LookupInterfaceOrClass): Removed an Error -200
27270 that Ravi put here.
27272 * class.cs (Constructor::Emit): Only emit if block is not null.
27273 (TypeContainer::EmitDefaultConstructor): Removed routine, now we
27274 deal with this by semantically definining it as if the user had
27277 (TypeContainer::FindMembers): Removed ad-hoc hack to deal with
27278 constructors as we now "emit" them at a higher level.
27280 (TypeContainer::DefineDefaultConstructor): Used to define the
27281 default constructors if none was provided.
27283 (ConstructorInitializer): Add methods Resolve and Emit.
27285 * expression.cs: Cast to ConstructorInfo instead of MethodInfo
27287 2001-09-17 Ravi Pratap <ravi@ximian.com>
27289 * class.cs (TypeContainer::EmitDefaultConstructor): Register
27290 the default constructor builder with our hashtable for methodbuilders
27293 * expression.cs (Invocation::OverloadResolve): Add a check for pd == null
27294 and argument_count is 0 in which case we have a match.
27295 (Binary::ResolveOperator): More null checking and miscellaneous coding
27298 2001-09-17 Ravi Pratap <ravi@ximian.com>
27300 * rootcontext.cs (IsNameSpace): Compare against null.
27302 * everywhere : Correct spelling to 'Greater' and to 'Subtract'
27304 * class.cs (Operator::OpType): Change names to match the ones in Binary::Operator
27305 and Unary::Operator.
27307 * cs-parser.jay (operator_declaration, CheckBinaryOperator, CheckUnaryOperator): Update
27310 * expression.cs (Binary::method): New member to hold the MethodBase for the case when
27311 we have overloaded operators.
27312 (Binary::ResolveOperator): Implement the part which does the operator overload
27315 * class.cs (Operator::Emit): Implement.
27316 (TypeContainer::Emit): Emit the operators we have too.
27318 * expression.cs (Binary::Emit): Update to emit the appropriate code for
27319 the case when we have a user-defined operator.
27321 2001-09-17 Miguel de Icaza <miguel@ximian.com>
27323 * rootcontext.cs: Fix bug: tree.Namespaces might be null.
27325 2001-09-16 Ravi Pratap <ravi@ximian.com>
27327 * class.cs (EmitStaticFieldInitializers, EmitFieldInitializers): Make public.
27328 (TypeContainer::EmitConstructor): Remove and move code into Contructor::Emit.
27329 (Constructor::Emit): Implement.
27330 (EmitStaticFieldInitializers, EmitFieldInitializers): Ensure we return immediately
27331 if we have no work to do.
27332 (TypeContainer::Emit): Pass in TypeContainer as argument to the constructor's
27335 * interface.cs (Interface::InterfaceAttr): Re-write to be more correct and complete.
27336 (Interface::IsTopLevel): Add. Same as TypeContainer::IsTopLevel.
27338 * class.cs (TypeContainer::IsTopLevel): Modify to use parent.Parent instead
27341 2001-09-15 Ravi Pratap <ravi@ximian.com>
27343 * tree.cs (Tree::namespaces): New hashtable to keep track of namespaces
27345 (Tree::RecordNamespace): Method to do what the name says ;-)
27346 (Tree::Namespaces): Property to get at the namespaces hashtable.
27348 * cs-parser.jay (namespace_declaration): Call RecordNamespace to
27351 * rootcontext.cs (IsNamespace): Fixed it :-)
27353 2001-09-14 Miguel de Icaza <miguel@ximian.com>
27355 * class.cs (TypeContainer::FindMembers): Add support for
27357 (MethodCore): New class that encapsulates both the shared aspects
27358 of a Constructor and a Method.
27359 (Method, Constructor): Factored pieces into MethodCore.
27361 * driver.cs: Added --fatal which makes errors throw exceptions.
27362 Load System assembly as well as part of the standard library.
27364 * report.cs: Allow throwing exceptions on errors for debugging.
27366 * modifiers.cs: Do not use `parent', instead use the real type
27367 container to evaluate permission settings.
27369 * class.cs: Put Ravi's patch back in. He is right, and we will
27370 have to cope with the
27372 2001-09-14 Ravi Pratap <ravi@ximian.com>
27374 * modifiers.cs (TypeAttr, MethodAttr, FieldAttr): Map protected internal to
27375 FamORAssem, not FamANDAssem.
27377 2001-09-14 Miguel de Icaza <miguel@ximian.com>
27379 * driver.cs: Added --parse option that only parses its input files
27382 * class.cs: Reverted last change from Ravi to IsTopLevel. That is
27383 incorrect. IsTopLevel is not used to tell whether an object is
27384 root_types or not (that can be achieved by testing this ==
27385 root_types). But to see if this is a top-level *class* (not
27386 necessarly our "toplevel" container).
27388 2001-09-14 Ravi Pratap <ravi@ximian.com>
27390 * enum.cs (Enum::Define): Modify to call the Lookup method on the
27391 parent instead of a direct call to GetType.
27393 2001-09-14 Ravi Pratap <ravi@ximian.com>
27395 * class.cs (TypeContainer::TypeAttr): Remove property code and move it into
27396 Modifiers.TypeAttr. This should just be a call to that method.
27398 * modifiers.cs (TypeAttr): Re-write and take an extra argument, the TypeContainer
27399 object so that we can determine if we are top-level or not.
27401 * delegate.cs (Delegate::Define): Update call to TypeAttr method to pass in the
27404 * enum.cs (Enum::Define): Ditto.
27406 * modifiers.cs (FieldAttr): Re-write.
27408 * class.cs (TypeContainer::IsTopLevel): Change accessibility to public.
27409 (TypeContainer::HaveStaticConstructor): New property to provide access
27410 to precisely that info.
27412 * modifiers.cs (MethodAttr): Re-write.
27413 (EventAttr): Remove altogether as there seems to be no ostensible use for it.
27415 * class.cs (TypeContainer::IsTopLevel): Re-write. root_types doesn't seem to be the parent
27416 of top-level types as claimed.
27418 2001-09-13 Miguel de Icaza <miguel@ximian.com>
27420 * expression.cs (MemberLookup): Fruitless attempt to lookup
27421 constructors. Maybe I need to emit default constructors? That
27422 might be it (currently .NET emits this for me automatically).
27423 (Invocation::OverloadResolve): Cope with Arguments == null.
27424 (Invocation::EmitArguments): new function, shared by the new
27425 constructor and us.
27426 (Invocation::Emit): Handle static and instance methods. Emit
27427 proper call instruction for virtual or non-virtual invocations.
27428 (New::Emit): Implement.
27429 (New::Resolve): Implement.
27430 (MemberAccess:Resolve): Implement.
27431 (MethodGroupExpr::InstanceExpression): used conforming to the spec
27432 to track instances.
27433 (FieldExpr::Resolve): Set type.
27435 * support.cs: Handle empty arguments.
27437 * cs-parser.jay (CompositeLookup, QualifierIdentifier,
27438 SimpleLookup): Auxiliary routines to help parse a qualifier
27441 Update qualifier_identifier rule.
27443 * codegen.cs: Removed debugging messages.
27445 * class.cs: Make this a global thing, this acts just as a "key" to
27446 objects that we might have around.
27448 (Populate): Only initialize method_builders_to_methods once.
27450 * expression.cs (PropertyExpr): Initialize type from the
27453 * codegen.cs (EmitContext::EmitBoolExpression): Use propper
27454 Resolve pattern. Attempt to implicitly convert value to boolean.
27457 * expression.cs: Set the type for the int32/int32 argument case.
27458 (Binary::ResolveOperator): Set the return type to boolean for
27459 comparission operators
27461 * typemanager.cs: Remove debugging print code.
27463 (Invocation::Resolve): resolve type.
27465 * class.cs: Allocate a MemberInfo of the correct size, as the code
27466 elsewhere depends on the test to reflect the correct contents.
27468 (Method::) Keep track of parameters, due to System.Reflection holes
27470 (TypeContainer::Populate): Keep track of MethodBuilders to Method
27473 (TypeContainer::FindMembers): Use ArrayList and then copy an array
27474 of the exact size and return that.
27476 (Class::LookupMethodByBuilder): New function that maps
27477 MethodBuilders to its methods. Required to locate the information
27478 on methods because System.Reflection bit us again.
27480 * support.cs: New file, contains an interface ParameterData and
27481 two implementations: ReflectionParameters and InternalParameters
27482 used to access Parameter information. We will need to grow this
27485 * expression.cs (Invocation::GetParameterData): implement a cache
27486 and a wrapper around the ParameterData creation for methods.
27487 (Invocation::OverloadResolve): Use new code.
27489 2001-09-13 Ravi Pratap <ravi@ximian.com>
27491 * class.cs (TypeContainer::EmitField): Remove and move into
27492 (Field::Define): here and modify accordingly.
27493 (Field.FieldBuilder): New member.
27494 (TypeContainer::Populate): Update accordingly.
27495 (TypeContainer::FindMembers): Implement.
27497 2001-09-13 Miguel de Icaza <miguel@ximian.com>
27499 * statement.cs: (VariableInfo::VariableType): New field to be
27500 initialized with the full type once it is resolved.
27502 2001-09-12 Miguel de Icaza <miguel@ximian.com>
27504 * parameter.cs (GetParameterInfo): Use a type cache to compute
27505 things only once, and to reuse this information
27507 * expression.cs (LocalVariableReference::Emit): Implement.
27508 (OpcodeCast::Emit): fix.
27510 (ParameterReference::Resolve): Implement.
27511 (ParameterReference::Emit): Implement.
27513 * cs-parser.jay: Fix bug introduced by Ravi, variable initializers
27514 that are expressions need to stay as Expressions.
27516 * typemanager.cs (CSharpName): Returns the C# name of a type if
27519 * expression.cs (Expression::ConvertImplicit): New function that
27520 implements implicit type conversions.
27522 (Expression::ImplicitReferenceConversion): Implements implicit
27523 reference conversions.
27525 (EmptyCast): New type for transparent casts.
27527 (OpcodeCast): New type for casts of types that are performed with
27528 a sequence of bytecodes.
27530 (BoxedCast): New type used for casting value types into reference
27531 types. Emits a box opcode.
27533 (Binary::DoNumericPromotions): Implements numeric promotions of
27534 and computation of the Binary::Type.
27536 (Binary::EmitBranchable): Optimization.
27538 (Binary::Emit): Implement code emission for expressions.
27540 * typemanager.cs (TypeManager): Added two new core types: sbyte
27543 2001-09-12 Ravi Pratap <ravi@ximian.com>
27545 * class.cs (TypeContainer::FindMembers): Method which does exactly
27546 what Type.FindMembers does, only we don't have to use reflection. No
27547 implementation yet.
27549 * typemanager.cs (typecontainers): New hashtable to hold the corresponding
27550 typecontainer objects as we need to get at them.
27551 (TypeManager::AddUserType): Overload to take an extra argument, the TypeContainer.
27553 * rootcontext.cs : Correspondingly modify called to AddUserType to pass the
27554 typecontainer object.
27556 * expression.cs (MemberLookup): Modify signature to take a RootContext object instead
27557 of just a Report object.
27559 2001-09-11 Ravi Pratap <ravi@ximian.com>
27561 * class.cs (Event::Define): Go back to using the prefixes "add_" and
27563 (TypeContainer::Populate): Now define the delegates of the type too.
27564 (TypeContainer.Delegates): Property to access the list of delegates defined
27567 * delegates.cs (Delegate::Define): Implement partially.
27569 * modifiers.cs (TypeAttr): Handle more flags.
27571 2001-09-11 Ravi Pratap <ravi@ximian.com>
27573 * class.cs (Indexer::Define): Fix for loop iteration condition to be just <
27575 (Operator::Define): Re-write logic to get types by using the LookupType method
27576 instead of blindly doing a Type.GetType ! How stupid can I get ;-) ?
27577 (Indexer::Define): Ditto.
27578 (Event::Define): Ditto.
27579 (Property::Define): Ditto.
27581 2001-09-10 Ravi Pratap <ravi@ximian.com>
27583 * class.cs (TypeContainer::Populate): Now define operators too.
27584 (TypeContainer.Operators): New property to access the list of operators
27586 (Operator.OperatorMethodBuilder): New member to hold the method builder
27587 for the operator we are defining.
27588 (Operator::Define): Implement.
27590 2001-09-10 Ravi Pratap <ravi@ximian.com>
27592 * class.cs (Event::Define): Make the prefixes of the accessor methods
27593 addOn_ and removeOn_
27595 * genericparser.cs (GenericParser::error): Overloaded method to handle the case
27596 of the location being passed in too. Ideally, this should go later since all
27597 error reporting should be done through the Report object.
27599 * class.cs (TypeContainer.Indexers): New property to access the list of indexers.
27600 (Populate): Iterate thru the indexers we have and define them too.
27601 (Indexer.GetMethodBuilder, .SetMethodBuilder): New members to hold the method builders
27602 for the get and set accessors.
27603 (Indexer::Define): Implement.
27605 2001-09-09 Miguel de Icaza <miguel@ximian.com>
27607 * expression.cs (Binary::Resolve): Beginning of it. I scratched
27608 my previous implementation, did not work.
27610 * typemanager.cs: Add a couple of missing types (the longs).
27612 * literal.cs: Use TypeManager.bool_type instead of getting it.
27614 * expression.cs (EventExpr): New kind of expressions.
27615 (Expressio::ExprClassFromMemberInfo): finish
27617 2001-09-08 Miguel de Icaza <miguel@ximian.com>
27619 * assign.cs: Emit stores to static fields differently.
27621 2001-09-08 Ravi Pratap <ravi@ximian.com>
27623 * Merge in changes and adjust code to tackle conflicts. Backed out my
27624 code in Assign::Resolve ;-)
27626 2001-09-08 Ravi Pratap <ravi@ximian.com>
27628 * cs-parser.jay (CheckAttributeTarget): Modify call to error to use
27629 instead Report.Error and also pass in the location.
27630 (CSharpParser::Lexer): New readonly property to return the reference
27631 to the Tokenizer object.
27632 (declare_local_variables): Use Report.Error with location instead of plain
27636 * class.cs (Operator::CheckUnaryOperator): Move into cs-parser.jay.
27637 (Operator.CheckBinaryOperator): Ditto.
27639 * cs-parser.jay (operator_declarator): Update accordingly.
27641 * cs-parser.jay (CheckUnaryOperator): Modify to use Report.Error
27642 (CheckBinaryOperator): Same here.
27644 * rootcontext.cs (LookupType): Add an extra lookup which simply does a lookup
27645 on the name without any prefixes of namespace names etc. This is because we
27646 already might have something already fully qualified like
27647 'System.Console.WriteLine'
27649 * assign.cs (Resolve): Begin implementation. Stuck ;-)
27651 2001-09-07 Ravi Pratap <ravi@ximian.com>
27653 * cs-tokenizer.cs (location): Return a string which also contains
27656 * expression.cs (ElementAccess): New class for expressions of the
27657 type 'element access.'
27658 (BaseAccess): New class for expressions of the type 'base access.'
27659 (CheckedExpr, UnCheckedExpr): New classes for Checked and Unchecked expressions
27662 * cs-parser.jay (element_access): Implement action.
27663 (base_access): Implement actions.
27664 (checked_expression, unchecked_expression): Implement.
27666 * cs-parser.jay (local_variable_type): Correct and implement.
27667 (type_suffixes, type_suffix_list, type_suffix): Implement actions.
27669 * cs-tokenizer.cs (real_type_suffix): Comment out the extra getchar.
27671 * cs-parser.jay (rank_specifiers): Remove space while concatenating the type's
27672 name and the specifiers.
27674 * interface.cs (InterfaceAttr): New property to return the corresponding TypeAttributes
27676 * rootcontext.cs (CreateInterface): Use the InterfaceAttr property instead of
27677 making them all public ;-)
27679 * cs-parser.jay (error): Remove entirely as we have an implementation in the base
27682 2001-09-07 Miguel de Icaza <miguel@ximian.com>
27684 * expression.cs (ExprClassFromMemberInfo): Return FieldExpr and
27686 (FieldExpr, PropertyExprs): New resolved expressions.
27687 (SimpleName::MemberStaticCheck): Perform static checks for access
27688 to non-static fields on static methods. Maybe this should be
27689 generalized for MemberAccesses.
27690 (SimpleName::ResolveSimpleName): More work on simple name
27693 * cs-parser.jay (primary_expression/qualified_identifier): track
27694 the parameter index.
27696 * codegen.cs (CodeGen::Save): Catch save exception, report error.
27697 (EmitContext::EmitBoolExpression): Chain to expression generation
27698 instead of temporary hack.
27699 (::EmitStatementExpression): Put generic expression code generation.
27701 * assign.cs (Assign::Emit): Implement variable assignments to
27702 local variables, parameters and fields.
27704 2001-09-06 Miguel de Icaza <miguel@ximian.com>
27706 * statement.cs (Block::GetVariableInfo): New method, returns the
27707 VariableInfo for a variable name in a block.
27708 (Block::GetVariableType): Implement in terms of GetVariableInfo
27710 * literal.cs (IntLiteral::Emit, FloatLiteral::Emit,
27711 DoubleLiteral::Emit, CharLiteral::Emit, BoolLiteral::Emit): Implement
27713 2001-09-06 Ravi Pratap <ravi@ximian.com>
27715 * cs-parser.jay (operator_declaration): Continue on my quest : update
27716 to take attributes argument.
27717 (event_declaration): Ditto.
27718 (enum_declaration): Ditto.
27719 (indexer_declaration): Ditto.
27721 * class.cs (Operator::Operator): Update constructor accordingly.
27722 (Event::Event): Ditto.
27724 * delegate.cs (Delegate::Delegate): Same here.
27726 * enum.cs (Enum::Enum): Same here.
27728 2001-09-05 Ravi Pratap <ravi@ximian.com>
27730 * cs-parser.jay (CheckAttributeTarget): Update to use the right error number.
27732 * ../tests/cs0658.cs : New file to demonstrate error 0658.
27734 * attribute.cs (Attributes): New class to encapsulate all attributes which were
27735 being passed around as an arraylist.
27736 (Attributes::AddAttribute): Method to add attribute sections.
27738 * cs-parser.jay (opt_attributes): Modify actions to use the new Attributes class.
27739 (struct_declaration): Update accordingly.
27740 (constant_declaration): Update.
27741 (field_declaration): Update.
27742 (method_header): Update.
27743 (fixed_parameter): Update.
27744 (parameter_array): Ditto.
27745 (property_declaration): Ditto.
27746 (destructor_declaration): Ditto.
27748 * class.cs (Struct::Struct): Update constructors accordingly.
27749 (Class::Class): Ditto.
27750 (Field::Field): Ditto.
27751 (Method::Method): Ditto.
27752 (Property::Property): Ditto.
27753 (TypeContainer::OptAttribute): update property's return type.
27755 * interface.cs (Interface.opt_attributes): New member.
27756 (Interface::Interface): Update to take the extra Attributes argument.
27758 * parameter.cs (Parameter::Parameter): Ditto.
27760 * constant.cs (Constant::Constant): Ditto.
27762 * interface.cs (InterfaceMemberBase): New OptAttributes field.
27763 (InterfaceMemberBase::InterfaceMemberBase): Update constructor to take
27764 the attributes as a parameter.
27765 (InterfaceProperty): Update constructor call.
27766 (InterfaceEvent): Ditto.
27767 (InterfaceMethod): Ditto.
27768 (InterfaceIndexer): Ditto.
27770 * cs-parser.jay (interface_indexer_declaration): Update call to constructor to
27771 pass the attributes too.
27772 (interface_event_declaration): Ditto.
27773 (interface_property_declaration): Ditto.
27774 (interface_method_declaration): Ditto.
27775 (interface_declaration): Ditto.
27777 2001-09-05 Miguel de Icaza <miguel@ximian.com>
27779 * class.cs (Method::Define): Track the "static Main" definition to
27780 create an entry point.
27782 * rootcontext.cs (RootContext::EntryPoint): MethodInfo that holds the
27783 EntryPoint if we find it.
27785 * codegen.cs (EmitContext::EmitInvocation): Emit invocations.
27786 (EmitContext::ig): Make this variable public.
27788 * driver.cs: Make the default output file be the first file name
27789 with the .exe extension.
27791 Detect empty compilations
27793 Handle various kinds of output targets. Handle --target and
27794 rename -t to --dumper.
27796 * expression.cs, literal.cs, assign.cs, constant.cs: All `Resolve'
27797 methods inherited from Expression return now an Expression. This
27798 will is used during the tree rewriting as we resolve them during
27801 (Expression::MemberLookup): Implements the MemberLookup (7.3) from
27802 the spec. Missing entirely is the information about
27803 accessability of elements of it.
27805 (Expression::ExprClassFromMemberInfo): New constructor for
27806 Expressions that creates a fully initialized Expression based on
27807 a MemberInfo that is one of Eventinfo, FieldINfo, PropertyInfo or
27810 (Invocation::Resolve): Begin implementing resolution of invocations.
27812 * literal.cs (StringLiteral): Implement Emit.
27814 2001-09-05 Ravi Pratap <ravi@ximian.com>
27816 * cs-parser.jay (error): Add new modifier because we are hiding an inherited
27819 2001-09-04 Ravi Pratap <ravi@ximian.com>
27821 * cs-parser.jay (attribute_arguments): Implement actions.
27822 (attribute): Fix bug in production. Implement action.
27823 (attribute_list): Implement.
27824 (attribute_target): Implement.
27825 (attribute_target_specifier, opt_target_specifier): Implement
27826 (CheckAttributeTarget): New method to check if the attribute target
27828 (attribute_section): Implement.
27829 (opt_attributes): Implement.
27831 * attribute.cs : New file to handle attributes.
27832 (Attribute): Class to hold attribute info.
27834 * cs-parser.jay (opt_attribute_target_specifier): Remove production
27835 (attribute_section): Modify production to use 2 different rules to
27836 achieve the same thing. 1 s/r conflict down !
27837 Clean out commented, useless, non-reducing dimension_separator rules.
27839 * class.cs (TypeContainer.attributes): New member to hold list
27840 of attributes for a type.
27841 (Struct::Struct): Modify to take one more argument, the attribute list.
27842 (Class::Class): Ditto.
27843 (Field::Field): Ditto.
27844 (Method::Method): Ditto.
27845 (Property::Property): Ditto.
27847 * cs-parser.jay (struct_declaration): Update constructor call to
27848 pass in the attributes too.
27849 (class_declaration): Ditto.
27850 (constant_declaration): Ditto.
27851 (field_declaration): Ditto.
27852 (method_header): Ditto.
27853 (fixed_parameter): Ditto.
27854 (parameter_array): Ditto.
27855 (property_declaration): Ditto.
27857 * constant.cs (Constant::Constant): Update constructor similarly.
27858 Use System.Collections.
27860 * parameter.cs (Parameter::Parameter): Update as above.
27862 2001-09-02 Ravi Pratap <ravi@ximian.com>
27864 * class.cs (TypeContainer::AddDelegate): New method to add a delegate.
27865 (TypeContainer.delegates): New member to hold list of delegates.
27867 * cs-parser.jay (delegate_declaration): Implement the action correctly
27868 this time as I seem to be on crack ;-)
27870 2001-09-02 Miguel de Icaza <miguel@ximian.com>
27872 * rootcontext.cs (RootContext::IsNamespace): new function, used to
27873 tell whether an identifier represents a namespace.
27875 * expression.cs (NamespaceExpr): A namespace expression, used only
27876 temporarly during expression resolution.
27877 (Expression::ResolveSimpleName, ::ResolvePrimary, ::ResolveName):
27878 utility functions to resolve names on expressions.
27880 2001-09-01 Miguel de Icaza <miguel@ximian.com>
27882 * codegen.cs: Add hook for StatementExpressions.
27884 * class.cs: Fix inverted test for static flag in methods.
27886 2001-09-02 Ravi Pratap <ravi@ximian.com>
27888 * class.cs (Operator::CheckUnaryOperator): Correct error number used
27889 to make it coincide with MS' number.
27890 (Operator::CheckBinaryOperator): Ditto.
27892 * ../errors/errors.txt : Remove error numbers added earlier.
27894 * ../errors/cs1019.cs : Test case for error # 1019
27896 * ../errros/cs1020.cs : Test case for error # 1020
27898 * cs-parser.jay : Clean out commented cruft.
27899 (dimension_separators, dimension_separator): Comment out. Ostensibly not
27900 used anywhere - non-reducing rule.
27901 (namespace_declarations): Non-reducing rule - comment out.
27903 * enum.cs (Enum::AddEnum): Rename to AddEnumMember as I was getting confused
27904 with TypeContainer::AddEnum.
27906 * delegate.cs : New file for delegate handling classes.
27907 (Delegate): Class for declaring delegates.
27909 * makefile : Update.
27911 * cs-parser.jay (delegate_declaration): Implement.
27913 2001-09-01 Ravi Pratap <ravi@che.iitm.ac.in>
27915 * class.cs (Event::Define): Implement.
27916 (Event.EventBuilder): New member.
27918 * class.cs (TypeContainer::Populate): Update to define all enums and events
27920 (Events): New property for the events arraylist we hold. Shouldn't we move to using
27921 readonly fields for all these cases ?
27923 2001-08-31 Ravi Pratap <ravi@che.iitm.ac.in>
27925 * class.cs (Property): Revamp to use the convention of making fields readonly.
27926 Accordingly modify code elsewhere.
27928 * class.cs : Apply patch from Mr. Mandar <go_mono@hotmail.com> for implementing
27929 the Define method of the Property class.
27931 * class.cs : Clean up applied patch and update references to variables etc. Fix
27933 (TypeContainer::Populate): Update to define all the properties we have. Also
27934 define all enumerations.
27936 * enum.cs (Define): Implement.
27938 2001-08-31 Ravi Pratap <ravi@che.iitm.ac.in>
27940 * cs-parser.jay (overloadable_operator): The semantic value is an
27941 enum of the Operator class.
27942 (operator_declarator): Implement actions.
27943 (operator_declaration): Implement.
27945 * class.cs (Operator::CheckUnaryOperator): New static method to help in checking
27946 validity of definitions.
27947 (Operator::CheckBinaryOperator): Static method to check for binary operators
27948 (TypeContainer::AddOperator): New method to add an operator to a type.
27950 * cs-parser.jay (indexer_declaration): Added line to actually call the
27951 AddIndexer method so it gets added ;-)
27953 * ../errors/errors.txt : Update to include new error numbers. Are these numbers
27954 already taken care of by the MS compiler ?
27956 2001-08-29 Ravi Pratap <ravi@che.iitm.ac.in>
27958 * class.cs (Operator): New class for operator declarations.
27959 (Operator::OpType): Enum for the various operators.
27961 2001-08-29 Ravi Pratap <ravi@che.iitm.ac.in>
27963 * class.cs (TypeContainer::AddIndexer): Remove FIXME comment. We
27964 ostensibly handle this in semantic analysis.
27966 * cs-parser.jay (general_catch_clause): Comment out
27967 (specific_catch_clauses, specific_catch_clause): Ditto.
27968 (opt_general_catch_clause, opt_specific_catch_clauses): Ditto
27969 (catch_args, opt_catch_args): New productions.
27970 (catch_clause): Rewrite to use the new productions above
27971 (catch_clauses): Modify accordingly.
27972 (opt_catch_clauses): New production to use in try_statement
27973 (try_statement): Revamp. Basically, we get rid of one unnecessary rule
27974 and re-write the code in the actions to extract the specific and
27975 general catch clauses by being a little smart ;-)
27977 * ../tests/try.cs : Fix. It's not 'finalize' my friend, it's 'finally' !
27978 Hooray, try and catch statements parse fine !
27980 2001-08-28 Ravi Pratap <ravi@che.iitm.ac.in>
27982 * statement.cs (Block::GetVariableType): Fix logic to extract the type
27983 string from the hashtable of variables.
27985 * cs-parser.jay (event_accessor_declarations): Trivial fix. Man, how did
27986 I end up making that mistake ;-)
27987 (catch_clauses): Fixed gross error which made Key and Value of the
27988 DictionaryEntry the same : $1 !!
27990 2001-08-28 Ravi Pratap <ravi@che.iitm.ac.in>
27992 * cs-tokenizer.cs (initTokens): Add keywords 'add' and 'remove'
27994 * cs-parser.jay (event_declaration): Correct to remove the semicolon
27995 when the add and remove accessors are specified.
27997 2001-08-28 Ravi Pratap <ravi@che.iitm.ac.in>
27999 * cs-parser.jay (IndexerDeclaration): New helper class to hold
28000 information about indexer_declarator.
28001 (indexer_declarator): Implement actions.
28002 (parsing_indexer): New local boolean used to keep track of whether
28003 we are parsing indexers or properties. This is necessary because
28004 implicit_parameters come into picture even for the get accessor in the
28005 case of an indexer.
28006 (get_accessor_declaration, set_accessor_declaration): Correspondingly modified.
28008 * class.cs (Indexer): New class for indexer declarations.
28009 (TypeContainer::AddIndexer): New method to add an indexer to a type.
28010 (TypeContainer::indexers): New member to hold list of indexers for the
28013 2001-08-27 Ravi Pratap <ravi@che.iitm.ac.in>
28015 * cs-parser.jay (add_accessor_declaration): Implement action.
28016 (remove_accessor_declaration): Implement action.
28017 (event_accessors_declaration): Implement
28018 (variable_declarators): swap statements for first rule - trivial.
28020 * class.cs (Event): New class to hold information about event
28022 (TypeContainer::AddEvent): New method to add an event to a type
28023 (TypeContainer::events): New member to hold list of events.
28025 * cs-parser.jay (event_declaration): Implement actions.
28027 2001-08-27 Ravi Pratap <ravi@che.iitm.ac.in>
28029 * cs-parser.jay (dim_separators): Implement. Make it a string
28030 concatenating all the commas together, just as they appear.
28031 (opt_dim_separators): Modify accordingly
28032 (rank_specifiers): Update accordingly. Basically do the same
28033 thing - instead, collect the brackets here.
28034 (opt_rank_sepcifiers): Modify accordingly.
28035 (array_type): Modify to actually return the complete type string
28036 instead of ignoring the rank_specifiers.
28037 (expression_list): Implement to collect the expressions
28038 (variable_initializer): Implement. We make it a list of expressions
28039 essentially so that we can handle the array_initializer case neatly too.
28040 (variable_initializer_list): Implement.
28041 (array_initializer): Make it a list of variable_initializers
28042 (opt_array_initializer): Modify accordingly.
28044 * expression.cs (New::NType): Add enumeration to help us
28045 keep track of whether we have an object/delegate creation
28046 or an array creation.
28047 (New:NewType, New::Rank, New::Indices, New::Initializers): New
28048 members to hold data about array creation.
28049 (New:New): Modify to update NewType
28050 (New:New): New Overloaded contructor for the array creation
28053 * cs-parser.jay (array_creation_expression): Implement to call
28054 the overloaded New constructor.
28056 2001-08-26 Ravi Pratap <ravi@che.iitm.ac.in>
28058 * class.cs (TypeContainer::Constructors): Return member
28059 constructors instead of returning null.
28061 2001-08-26 Miguel de Icaza <miguel@ximian.com>
28063 * typemanager.cs (InitCoreTypes): Initialize the various core
28064 types after we have populated the type manager with the user
28065 defined types (this distinction will be important later while
28066 compiling corlib.dll)
28068 * expression.cs, literal.cs, assign.cs, constant.cs: Started work
28069 on Expression Classification. Now all expressions have a method
28070 `Resolve' and a method `Emit'.
28072 * codegen.cs, cs-parser.jay: Fixed the bug that stopped code
28073 generation from working. Also add some temporary debugging
28076 2001-08-24 Miguel de Icaza <miguel@ximian.com>
28078 * codegen.cs: Lots of code generation pieces. This is only the
28079 beginning, will continue tomorrow with more touches of polish. We
28080 handle the fundamentals of if, while, do, for, return. Others are
28081 trickier and I need to start working on invocations soon.
28083 * gen-treedump.cs: Bug fix, use s.Increment here instead of
28086 * codegen.cs (EmitContext): New struct, used during code
28087 emission to keep a context. Most of the code generation will be
28090 * cs-parser.jay: Add embedded blocks to the list of statements of
28091 this block. So code generation proceeds in a top down fashion.
28093 2001-08-23 Miguel de Icaza <miguel@ximian.com>
28095 * statement.cs: Add support for multiple child blocks.
28097 2001-08-22 Miguel de Icaza <miguel@ximian.com>
28099 * codegen.cs (EmitCode): New function, will emit the code for a
28100 Block of code given a TypeContainer and its ILGenerator.
28102 * statement.cs (Block): Standard public readonly optimization.
28103 (Block::Block constructors): Link children.
28104 (Block::Child): Child Linker.
28105 (Block::EmitVariables): Emits IL variable declarations.
28107 * class.cs: Drop support for MethodGroups here, delay until
28109 (Method::): Applied the same simplification that I did before, and
28110 move from Properties to public readonly fields.
28111 (Method::ParameterTypes): Returns the parameter types for the
28112 function, and implements a cache that will be useful later when I
28113 do error checking and the semantic analysis on the methods is
28115 (Constructor::GetCallingConvention): Renamed from CallingConvetion
28116 and made a method, optional argument tells whether this is a class
28117 or a structure to apply the `has-this' bit.
28118 (Method::GetCallingConvention): Implement, returns the calling
28120 (Method::Define): Defines the type, a second pass is performed
28121 later to populate the methods.
28123 (Constructor::ParameterTypes): implement a cache similar to the
28124 one on Method::ParameterTypes, useful later when we do semantic
28127 (TypeContainer::EmitMethod): New method. Emits methods.
28129 * expression.cs: Removed MethodGroup class from here.
28131 * parameter.cs (Parameters::GetCallingConvention): new method.
28133 2001-08-21 Miguel de Icaza <miguel@ximian.com>
28135 * class.cs (TypeContainer::Populate): Drop RootContext from the
28138 (Constructor::CallingConvention): Returns the calling convention.
28139 (Constructor::ParameterTypes): Returns the constructor parameter
28142 (TypeContainer::AddConstructor): Keep track of default constructor
28143 and the default static constructor.
28145 (Constructor::) Another class that starts using `public readonly'
28146 instead of properties.
28148 (Constructor::IsDefault): Whether this is a default constructor.
28150 (Field::) use readonly public fields instead of properties also.
28152 (TypeContainer::TypeAttr, TypeContainer::AddConstructor): Keep
28153 track of static constructors; If none is used, turn on
28154 BeforeFieldInit in the TypeAttributes.
28156 * cs-parser.jay (opt_argument_list): now the return can be null
28157 for the cases where there are no arguments.
28159 (constructor_declarator): If there is no implicit `base' or
28160 `this', then invoke the default parent constructor.
28162 * modifiers.cs (MethodAttr): New static function maps a set of
28163 modifiers flags into a MethodAttributes enum
28164 (FieldAttr): renamed from `Map'. So now we have FieldAttr,
28165 MethodAttr, TypeAttr to represent the various mappings where the
28166 modifiers are used.
28167 (FieldAttr): Map also `readonly' to `FieldAttributes.InitOnly'
28169 2001-08-19 Miguel de Icaza <miguel@ximian.com>
28171 * parameter.cs (GetParameterInfo): Fix bug where there would be no
28174 * interface.cs (PopulateIndexer): Implemented the code generator
28175 for interface indexers.
28177 2001-08-17 Miguel de Icaza <miguel@ximian.com>
28179 * interface.cs (InterfaceMemberBase): Now we track the new status
28182 (PopulateProperty): Implement property population. Woohoo! Got
28183 Methods and Properties going today.
28185 Removed all the properties for interfaces, and replaced them with
28186 `public readonly' fields.
28188 2001-08-16 Miguel de Icaza <miguel@ximian.com>
28190 * interface.cs (AddEvent, AddMethod, AddIndexer, AddProperty):
28191 initialize their hashtables/arraylists only when they are needed
28192 instead of doing this always.
28194 * parameter.cs: Handle refs and out parameters.
28196 * cs-parser.jay: Use an ArrayList to construct the arguments
28197 instead of the ParameterCollection, and then cast that to a
28200 * parameter.cs: Drop the use of ParameterCollection and use
28201 instead arrays of Parameters.
28203 (GetParameterInfo): Use the Type, not the Name when resolving
28206 2001-08-13 Miguel de Icaza <miguel@ximian.com>
28208 * parameter.cs: Eliminate the properties Name, Type and ModFlags,
28209 and instead use public readonly fields.
28211 * class.cs: Put back walking code for type containers.
28213 2001-08-11 Miguel de Icaza <miguel@ximian.com>
28215 * class.cs (MakeConstant): Code to define constants.
28217 * rootcontext.cs (LookupType): New function. Used to locate types
28220 2001-08-08 Miguel de Icaza <miguel@ximian.com>
28222 * rootcontext.cs: OH MY! My trick works! It is amazing how nice
28223 this System.Reflection code is. Kudos to Microsoft
28225 * typemanager.cs: Implement a type cache and avoid loading all
28226 types at boot time. Wrap in LookupType the internals. This made
28227 the compiler so much faster. Wow. I rule!
28229 * driver.cs: Make sure we always load mscorlib first (for
28230 debugging purposes, nothing really important).
28232 * Renamespaced things that were on `CSC' to `CIR'. Maybe I should
28233 have moved to `CSC' rather than `CIR'. Oh man! The confussion!
28235 * rootcontext.cs: Lookup types on their namespace; Lookup types
28236 on namespaces that have been imported using the `using' keyword.
28238 * class.cs (TypeContainer::TypeAttr): Virtualize.
28239 (Class::TypeAttr): Return attributes suitable for this bad boy.
28240 (Struct::TypeAttr): ditto.
28241 Handle nested classes.
28242 (TypeContainer::) Remove all the type visiting code, it is now
28243 replaced with the rootcontext.cs code
28245 * rootcontext.cs (GetClassBases): Added support for structs.
28247 2001-08-06 Miguel de Icaza <miguel@ximian.com>
28249 * interface.cs, statement.cs, class.cs, parameter.cs,
28250 rootcontext.cs, gen-treedump.cs, enum.cs, cs-parse.jay:
28251 Drop use of TypeRefs, and use strings instead.
28253 2001-08-04 Miguel de Icaza <miguel@ximian.com>
28257 * class.cs (Struct::Struct): set the SEALED flags after
28258 checking the modifiers.
28259 (TypeContainer::TypeAttr): new property, returns the
28260 TypeAttributes for a class.
28262 * cs-parser.jay (type_list): Oops, list production was creating a
28263 new list of base types.
28265 * rootcontext.cs (StdLib): New property.
28266 (GetInterfaceTypeByName): returns an interface by type name, and
28267 encapsulates error handling here.
28268 (GetInterfaces): simplified.
28269 (ResolveTree): Encapsulated all the tree resolution here.
28270 (CreateClass, GetClassBases, GetInterfaceOrClass): Create class
28273 * driver.cs: Add support for --nostdlib, to avoid loading the
28274 default assemblies.
28275 (Main): Do not put tree resolution here.
28277 * rootcontext.cs: Beginning of the class resolution.
28279 2001-08-03 Miguel de Icaza <miguel@ximian.com>
28281 * rootcontext.cs: Provide better error reporting.
28283 * cs-parser.jay (interface_base): set our $$ to be interfaces.
28285 * rootcontext.cs (CreateInterface): Handle the case where there
28286 are no parent interfaces.
28288 (CloseTypes): Routine to flush types at the end.
28289 (CreateInterface): Track types.
28290 (GetInterfaces): Returns an array of Types from the list of
28291 defined interfaces.
28293 * typemanager.c (AddUserType): Mechanism to track user types (puts
28294 the type on the global type hash, and allows us to close it at the
28297 2001-08-02 Miguel de Icaza <miguel@ximian.com>
28299 * tree.cs: Removed RecordType, added RecordClass, RecordStruct and
28300 RecordInterface instead.
28302 * cs-parser.jay: Updated to reflect changes above.
28304 * decl.cs (Definition): Keep track of the TypeBuilder type that
28305 represents this type here. Not sure we will use it in the long
28306 run, but wont hurt for now.
28308 * driver.cs: Smaller changes to accomodate the new code.
28310 Call ResolveInterfaceBases, Call ResolveClassBases, Save assembly
28313 * rootcontext.cs (CreateInterface): New method, used to create
28314 the System.TypeBuilder type for interfaces.
28315 (ResolveInterfaces): new entry point to resolve the interface
28317 (CodeGen): Property, used to keep track of the code generator.
28319 2001-07-26 Miguel de Icaza <miguel@ximian.com>
28321 * cs-parser.jay: Add a second production for delegate_declaration
28324 (enum_body): Put an opt_comma here instead of putting it on
28325 enum_body or enum_member_declarations so we can handle trailing
28326 commas on enumeration members. Gets rid of a shift/reduce.
28328 (type_list): Need a COMMA in the middle.
28330 (indexer_declaration): Tell tokenizer to recognize get/set
28332 * Remove old targets.
28334 * Re-add the parser target.
28336 2001-07-13 Simon Cozens <simon@simon-cozens.org>
28338 * cs-parser.jay: Add precendence rules for a number of operators
28339 ot reduce the number of shift/reduce conflicts in the grammar.
28341 2001-07-17 Miguel de Icaza <miguel@ximian.com>
28343 * tree.cs: moved IGenerator interface and renamed it to ITreeDump
28346 Get rid of old crufty code.
28348 * rootcontext.cs: Use this to keep track of the parsed
28349 representation and the defined types available to the program.
28351 * gen-treedump.cs: adjust for new convention.
28353 * type.cs: Split out the type manager, and the assembly builder
28356 * typemanager.cs: the type manager will live here now.
28358 * cil-codegen.cs: And the code generator here.
28360 2001-07-14 Sean MacIsaac <macisaac@ximian.com>
28362 * makefile: Fixed up for easy making.
28364 2001-07-13 Simon Cozens <simon@simon-cozens.org>
28366 * cs-parser.jay (rank_specifier): Remove a conflict by reordering
28369 (unary_expression): Expand pre_increment_expression and
28370 post_decrement_expression to reduce a shift/reduce.
28372 2001-07-11 Simon Cozens
28374 * cs-tokenizer.cs: Hex numbers should begin with a 0.
28376 Improve allow_keyword_as_indent name.
28378 2001-06-19 Miguel de Icaza <miguel@ximian.com>
28380 * Adjustments for Beta2.
28382 2001-06-13 Miguel de Icaza <miguel@ximian.com>
28384 * decl.cs: Added `Define' abstract method.
28385 (InTransit): new property, used to catch recursive definitions.
28387 * interface.cs: Implement `Define'.
28389 * modifiers.cs: Map Modifiers.constants to
28390 System.Reflection.TypeAttribute flags.
28392 * class.cs: Keep track of types and user-defined types.
28393 (BuilderInit): New method for creating an assembly
28394 (ResolveType): New function to launch the resolution process, only
28395 used by interfaces for now.
28397 * cs-parser.jay: Keep track of Classes, Structs and Interfaces
28398 that are inserted into the name space.
28400 2001-06-08 Miguel de Icaza <miguel@ximian.com>
28402 * ARGH. I have screwed up my tree so many times due to the use of
28403 rsync rather than using CVS. Going to fix this at once.
28405 * driver.cs: Objetify driver. Load assemblies, use assemblies to
28408 2001-06-07 Miguel de Icaza <miguel@ximian.com>
28410 * Experiment successful: Use System.Type rather that our own
28413 2001-05-25 Miguel de Icaza <miguel@ximian.com>
28415 * cs-parser.jay: Removed nsAliases from here.
28417 Use new namespaces, handle `using XXX;'
28419 * namespace.cs: Reimplemented namespace handling, use a recursive
28420 definition of the class. Now we can keep track of using clauses
28421 and catch invalid using clauses.
28423 2001-05-24 Miguel de Icaza <miguel@ximian.com>
28425 * gen-treedump.cs: Adapted for all the renaming.
28427 * expression.cs (Expression): this class now has a Type property
28428 which returns an expression Type.
28430 (Probe::, New::, TypeOf::, SizeOf::, Constant::): renamed from
28431 `Type', as this has a different meaning now in the base
28433 2001-05-22 Miguel de Icaza <miguel@ximian.com>
28435 * interface.cs, class.cs: Removed from all the sources the
28436 references to signature computation, as we can not do method
28437 signature computation during the parsing time, as we are not
28438 trying to solve at that point distinguishing:
28442 void a (NS.Blah x) {}
28445 Which depending on the context might be valid or not, as we do not
28446 know if Blah is the same thing as NS.Blah at that point.
28448 * Redid everything so the code uses TypeRefs now instead of
28449 Types. TypeRefs are just temporary type placeholders, that need
28450 to be resolved. They initially have a pointer to a string and the
28451 current scope in which they are used. This is used later by the
28452 compiler to resolve the reference to an actual Type.
28454 * DeclSpace is no longer a CIR.Type, and neither are
28455 TypeContainers (Class and Struct) nor Interfaces nor Enums. They
28456 are all DeclSpaces, but no Types.
28458 * type.cs (TypeRefManager): This implements the TypeRef manager,
28459 which keeps track of all the types that need to be resolved after
28460 the parsing has finished.
28462 2001-05-13 Miguel de Icaza <miguel@ximian.com>
28464 * ARGH. We are going to have to store `foreach' as a class rather
28465 than resolving it, as we need to verify error 1579 after name
28466 resolution. *OR* we could keep a flag that says `This request to
28467 IEnumerator comes from a foreach statement' which we can then use
28468 to generate the error.
28470 2001-05-10 Miguel de Icaza <miguel@ximian.com>
28472 * class.cs (TypeContainer.AddMethod): we now add methods to the
28473 MethodGroup instead of the method hashtable.
28475 * expression.cs: Add MethodGroup abstraction, which gets us one
28476 step closer to the specification in the way we handle method
28479 * cs-parser.jay (primary_expression): qualified_identifier now
28480 tried to match up an identifier to a local variable reference or
28481 to a parameter reference.
28483 current_local_parameters is now a parser global variable that
28484 points to the current parameters for the block, used during name
28487 (property_declaration): Now creates an implicit `value' argument to
28490 2001-05-09 Miguel de Icaza <miguel@ximian.com>
28492 * parameter.cs: Do not use `param' arguments as part of the
28493 signature, per the spec.
28495 2001-05-08 Miguel de Icaza <miguel@ximian.com>
28497 * decl.cs: Base class for classes, structs and interfaces. This
28498 is the "Declaration Space"
28500 * cs-parser.jay: Use CheckDef for checking declaration errors
28501 instead of having one on each function.
28503 * class.cs: Factor out some code for handling error handling in
28504 accordance to the "Declarations" section in the "Basic Concepts"
28505 chapter in the ECMA C# spec.
28507 * interface.cs: Make all interface member classes derive from
28508 InterfaceMemberBase.
28510 2001-05-07 Miguel de Icaza <miguel@ximian.com>
28512 * Many things: all interfaces are parsed and generated in
28513 gen-treedump. Support for member variables, constructors,
28514 destructors, properties, constants is there.
28516 Beginning of the IL backend, but very little done, just there for
28519 2001-04-29 Miguel de Icaza <miguel@ximian.com>
28521 * cs-parser.jay: Fix labeled statement.
28523 * cs-tokenizer.cs (escape): Escape " and ' always.
28524 ref_line, ref_name: keep track of the line/filename as instructed
28525 by #line by the compiler.
28528 2001-04-27 Miguel de Icaza <miguel@ximian.com>
28530 * System.CodeDOM/CodeBinaryOperatorExpression.cs: Rearrange enum
28531 to match the values in System.CodeDOM.
28533 Divid renamed to Divide.
28535 * System.CodeDOM/CodeForLoopStatement.cs: Always have valid
28537 (Statements.set): remove.
28539 * System.CodeDOM/CodeCatchClause.cs: always have a valid
28542 * System.CodeDOM/CodeIfStatement.cs: trueStatements and
28543 falseStatements always have valid values.
28545 * cs-parser.jay: Use System.CodeDOM now.